Postado Setembro 9, 2016 8 anos Olá pessoal do TK, queria pedir um sistema de dodge, mas um pouco diferente, eu queria que a chance do dodge aumentasse de acordo com a skill AXE, diferente dos que estão no fórum que só aumentam quando você usa um certo item... Obrigado desde já!
Postado Setembro 10, 2016 8 anos Autor tag: <event type="statschange" name="dodge" event="script" value="dodge.lua"/> script: local lvldodge = 48902 local percent = 0.5 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) and isPlayer(attacker) then if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then value = math.ceil(value*(percent)) doTargetCombatHealth(attacker, cid, combat, -value, -value, 255) doSendAnimatedText(getCreaturePos(cid), "DODGE", 6) return false end end return true end
Postado Setembro 10, 2016 8 anos Testa aí amigo: local percent = 0.5 local dodgeRate = 1 -- Deixando 1, a cada lvl de axe aumenta 1% a chance de dodge. Se colocar 2, cada lvl de axe aumenta 2% a chance de dodge. function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) and isPlayer(attacker) then if (getPlayerSkill(cid, 3)*dodgeRate) >= math.random (0,100) then value = math.ceil(value*(percent)) doTargetCombatHealth(attacker, cid, combat, -value, -value, 255) doSendAnimatedText(getCreaturePos(cid), "DODGE", 6) return false end end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.