Postado Fevereiro 28, 2017 8 anos Galera, estou com um script aqui de dodge system, porém ele só funciona pra perda de vida, se um mage estiver de utamo vita, o dodge nao sai, meu script é esse : creaturescripts/dodgecombat.lua Spoiler local storagedodge = 98798644 -- storage do dodge local cor = 35 -- cor do texto local effect = 30 -- id do magic effect local msg = "DODGE!" -- msg local dodge = { {min = 1, max = 10, chance = 10}, -- se o dodge tiver entre 1 e 2 tem 10% de chance de da dodge. {min = 11, max = 20, chance = 20}, -- podem ser configurada portanto que não passe do limite {min = 21, max = 40, chance = 25}, -- vocês pode adicionar mas se quiserem {min = 41, max = 60, chance = 30}, {min = 61, max = 90, chance = 35}, {min = 91, 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 queria que ele funcionasse também quando o player estivesse de utamo, alguem poderia ajudar?
Postado Fevereiro 28, 2017 8 anos Esta é uma mensagem automática! Este tópico foi movido para a área correta.Pedimos que você leia as regras do fórum. Spoiler This is an automated message! This topic has been moved to the correct area.Please read the forum rules.
Postado Março 1, 2017 8 anos 21 horas atrás, luannhrj disse: obg, alguem pode ajudar? local storagedodge = 98798644 -- storage do dodge local cor = 35 -- cor do texto local effect = 30 -- id do magic effect local msg = "DODGE!" -- msg local dodge = { {min = 1, max = 10, chance = 10}, -- se o dodge tiver entre 1 e 2 tem 10% de chance de da dodge. {min = 11, max = 20, chance = 20}, -- podem ser configurada portanto que não passe do limite {min = 21, max = 40, chance = 25}, -- vocês pode adicionar mas se quiserem {min = 41, max = 60, chance = 30}, {min = 61, max = 90, chance = 35}, {min = 91, 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 type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then doSendMagicEffect(getCreaturePosition(cid), effect) doSendAnimatedText(getCreaturePosition(cid), msg, cor) return false end end end end return true end Editado Março 1, 2017 8 anos por DukeeH (veja o histórico de edições)
Postado Março 2, 2017 8 anos Autor Em 01/03/2017 ás 16:56, DukeeH disse: local storagedodge = 98798644 -- storage do dodge local cor = 35 -- cor do texto local effect = 30 -- id do magic effect local msg = "DODGE!" -- msg local dodge = { {min = 1, max = 10, chance = 10}, -- se o dodge tiver entre 1 e 2 tem 10% de chance de da dodge. {min = 11, max = 20, chance = 20}, -- podem ser configurada portanto que não passe do limite {min = 21, max = 40, chance = 25}, -- vocês pode adicionar mas se quiserem {min = 41, max = 60, chance = 30}, {min = 61, max = 90, chance = 35}, {min = 91, 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 type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then doSendMagicEffect(getCreaturePosition(cid), effect) doSendAnimatedText(getCreaturePosition(cid), msg, cor) return false end end end end return true end muito obrigado!, tenho um pedido sobre reset system , tem como me ajudar?
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.