[Aportes indexados] PegaDoble

Estado
Cerrado para nuevas respuestas.

DarkThom

Oráculo Lvl 3
[Servidor] PegaDoble

A ver ahroa posteo un codigo y diganme si la q me mande va a funcionar


Primero en Declares.bas, debajo de Apuñala as Byte puse esto:



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">PegaDoble <span style="color: #b1b100;">as</span> Byte</li></ol></div>[/vb]



Despues en LoadOBJData buscas esto:



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">ObjData<span style="color: #66cc66;">(</span>Object<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Apu</span>ñala = <span style="color: #b1b100;">val</span><span style="color: #66cc66;">(</span>Leer.<span style="color: #66cc66;">DarValor</span><span style="color: #66cc66;">(</span><span style="color: #ffffff;">"OBJ"</span> & Object, <span style="color: #ffffff;">"Apuñala"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></li></ol></div>[/vb]



Y debajo agregas esto, dentro del mismo If del OBJTYPE_WEAPON, por supuesto.



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">ObjData<span style="color: #66cc66;">(</span>Object<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">PegaDoble</span> = <span style="color: #b1b100;">val</span><span style="color: #66cc66;">(</span>Leer.<span style="color: #66cc66;">DarValor</span><span style="color: #66cc66;">(</span><span style="color: #ffffff;">"Obj"</span> & Object, <span style="color: #ffffff;">"PegaDoble"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></li></ol></div>[/vb]



Luego, buscas esto en UserDañoUser:



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">Select <span style="color: #b1b100;">Case</span> Lugar</li></ol></div>[/vb]



Y reemplazas desde ahi hasta el:



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> = UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> - daño</li></ol></div>[/vb]



Con esto lo reemplazas, (Incluyendo esas dos lineas):



[vb]<div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1"><span style="color: #808080;">'Si el numero al azar es menor al % de PegaDoble del arma TonC pega doble</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">If</span> ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>AtacanteIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">WeaponEqpObjIndex</span><span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">PegaDoble</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> RandomNumber<span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">)</span> <= ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">WeaponEqpObjIndex</span><span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">PegaDoble</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li2"> </li><li style="" class="li1">Select <span style="color: #b1b100;">Case</span> Lugar</li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">Case</span> bCabeza</li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene casco absorbe el golpe</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li2">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li2">daño = daño - absorbido</li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">Case</span> <span style="color: #b1b100;">Else</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene armadura absorbe el golpe</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li2">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li2">daño = daño - absorbido</li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">End</span> Select</li><li style="" class="li1"> </li><li style="" class="li1"> </li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, AtacanteIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N5"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, VictimaIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N4"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>AtacanteIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li1">UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> = UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> - daño</li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"> </li><li style="" class="li2">Select <span style="color: #b1b100;">Case</span> Lugar</li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Case</span> bCabeza</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene casco absorbe el golpe</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li1">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li2">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li1">daño = daño - absorbido</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Case</span> <span style="color: #b1b100;">Else</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene armadura absorbe el golpe</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li1">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li2">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li1">daño = daño - absorbido</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> Select</li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, AtacanteIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N5"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, VictimaIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N4"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>AtacanteIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> = UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> - daño</li><li style="" class="li1"> </li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Else</span></li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"> </li><li style="" class="li2">Select <span style="color: #b1b100;">Case</span> Lugar</li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Case</span> bCabeza</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene casco absorbe el golpe</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li1">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">CascoEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li2">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li1">daño = daño - absorbido</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Case</span> <span style="color: #b1b100;">Else</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #808080;">'Si tiene armadura absorbe el golpe</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">If</span> UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span> > <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span></li><li style="" class="li1"> </li><li style="" class="li1">Obj = ObjData<span style="color: #66cc66;">(</span>UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Invent</span>.<span style="color: #66cc66;">ArmourEqpObjIndex</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">absorbido = RandomNumber<span style="color: #66cc66;">(</span>Obj.<span style="color: #66cc66;">MinDef</span>, Obj.<span style="color: #66cc66;">MaxDef</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li2">absorbido = absorbido + defbarco - Resist</li><li style="" class="li1"> </li><li style="" class="li1">daño = daño - absorbido</li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">If</span> daño < <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> daño = <span style="color: #cc66cc;">1</span></li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> Select</li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"> </li><li style="" class="li2"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, AtacanteIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N5"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">Call</span> SendData<span style="color: #66cc66;">(</span>ToIndex, VictimaIndex, <span style="color: #cc66cc;">0</span>, <span style="color: #ffffff;">"N4"</span> & Lugar & <span style="color: #ffffff;">","</span> & daño & <span style="color: #ffffff;">","</span> & UserList<span style="color: #66cc66;">(</span>AtacanteIndex<span style="color: #66cc66;">)</span>.<span style="color: #b1b100;">Name</span><span style="color: #66cc66;">)</span></li><li style="" class="li2"> </li><li style="" class="li1">UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> = UserList<span style="color: #66cc66;">(</span>VictimaIndex<span style="color: #66cc66;">)</span>.<span style="color: #66cc66;">Stats</span>.<span style="color: #66cc66;">MinHP</span> - daño</li><li style="" class="li1"> </li><li style="" class="li2"> </li><li style="" class="li1"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="" class="li2"> </li><li style="" class="li1"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li></ol></div>[/vb]



Entonces eso funcionaria , agregando en el OBJ.dat al arma q pega doble, PegaDoble=100, por ejemplo, donde 100 seria la probabilidad de que pegue doble.

Diganme Si Esta bien Echo
 

Tavo

[color=#BF0000]Lucha por tus ideales![/color]
No se puede afirmar, pero si encontras le codigo de Lagalot y es el mismo avisame...
 

Pocho

Oráculo Lvl 3
on sabe ni como se usa, pone q pega doble as byte y despues deice q ay q poner pegadoble = 100
 
A

Anonymous

Invitado
Pocho dijo:
on sabe ni como se usa, pone q pega doble as byte y despues deice q ay q poner pegadoble = 100

Esta bien que le ponga PegaDoble = 100, mientras no se pase del valor maximo de un byte (255)


Atte. Tales
 
Estado
Cerrado para nuevas respuestas.
Arriba