WikiArk21
New Member
- Joined
- Oct 24, 2023
- Messages
- 14
- Reaction score
- 1
I found a dodge script on internet forums, but it does not have the necessary tags. I know it's for creaturescripts, but which tag should be added?
local SKILL_ID = 5 -- id do skill...
local percentual = 0.3
function onStatsChange(cid, attacker, type, combat, value)
local COLOR_ID = 200 -- cor do texto
local MAGIC_EFFECT = 1 -- id do magic effect
if not isCreature(cid) then
return false
end
for _, tudo in pairs(skills) do
local chance = (getPlayerSkillLevel(cid, SKILL_ID) * percentual) * 10
if math.random(1, 1000) <= chance then
if combat ~= COMBAT_HEALING then
doSendMagicEffect(getCreaturePosition(cid), MAGIC_EFFECT)
doSendAnimatedText(getCreaturePosition(cid), "MISS!", COLOR_ID)
return false
end
end
end
return true
end