Dodge System por item V2
Para quem não sabe eu ja tinha feito um Dodge System ano passado, na época que eu não sabia nada, embora eu ainda não saiba nada to melhorando , eu tava sem nada para fazer ai decidir refazer, o script não tem nada de novo só foi modificado e melhorado algumas coisa.
Para que não sabe dodge é um sistema que faz com que o player tenha uma certa porcentagem de esquiva de um ataque( por ele te esquivado ele não vai toma nenhum ataque e não apenas 50%)
Então vamos la:
Em creaturescript:
Dodge System.lua
function onStatsChange(cid, attacker, type, combat, value) local getStorage = getPlayerStorageValue(cid, 123455678) if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then local chance = math.random (0,100) if chance <= getStorage then doSendAnimatedText(getCreaturePos(cid), "MISS!", 214) doSendMagicEffect(getCreaturePosition(cid), 30) return false end end return true end
<event type="StatsChange" name="DodgeSystem" event="script" value="Dodge System.lua"/>
registerCreatureEvent(cid, "DodgeSystem") if getPlayerStorageValue(cid, 123455678) == -1 then setPlayerStorageValue(cid, 123455678, 0) end
function onUse(cid, item, fromPosition, itemEx, toPosition) local max = 50 -- limite de dodge local storagedodge = 123455678 -- storage do dodge if getPlayerStorageValue(cid, storagedodge) >= max then return doPlayerSendTextMessage(cid,22,"Você ja chego no limite de Dodge.") else doPlayerSetStorageValue(cid, storagedodge, (getPlayerStorageValue(cid, storagedodge)) + 1) doPlayerSendTextMessage(cid,22, "DodgeSKILL:["..getPlayerStorageValue(cid, storagedodge).."/"..max.."].") doRemoveItem(item.uid, 1) end return true end
<action itemid="Id do item" event="script" value="dodgestone.lua"/>
Se tiver algum bug ou dica de como melhorar pode comentar ai nos cometários
Ps. com base nesse da para fazer Critical System, Reflect System e da para usar como magia de esquiva, se precisar é so fala