Ir para conteúdo

Featured Replies

Postado

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?

  • Respostas 6
  • Visualizações 864
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 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

Postado

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.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado
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 por DukeeH (veja o histórico de edições)

asdukeeh.jpg

Postado
  • 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo