Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local storagedodge = 98798644 -- storage do dodge
- local cor = 210 -- cor do texto
- local effect = 61 -- id do magic effect
- local msg = "Block" -- msg
- local dodge = {
- {min = 5, max = 20, chance = 18}, -- se o dodge tiver entre 1 e 2 tem 10% de chance de da dodge.
- {min = 21, max = 40, chance = 23}, -- podem ser configurada portanto que não passe do limite
- {min = 41, max = 60, chance = 28}, -- vocês pode adicionar mas se quiserem
- {min = 61, max = 80, chance = 35},
- {min = 81, max = 98, chance = 38},
- {min = 99, max = math.huge, chance = 40}
- }
- function onStatsChange(cid, attacker, type, combat, value)
- if not isCreature(cid) then
- return false
- end
- for _, tudo in pairs(dodge) do
- if getPlayerStorageValue(cid, storagedodge) >= tudo.min and getPlayerStorageValue(cid, storagedodge) <= tudo.max then
- local chancex = math.random(1, 100)
- if chancex <= tudo.chance then
- if combat ~= COMBAT_HEALING then
- doSendMagicEffect(getCreaturePosition(cid), effect)
- doSendAnimatedText(getCreaturePosition(cid), msg, cor)
- return false
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement