KA

[Resolvido] [PEDIDO Spell] Passive pxg Sturdy

Por kaleudd, 02 de set. de 2015 em Resolvidos

7
2.2k
02 de setembro de 2015 às 21:15

Explicação da spell: Sturdy: É uma passive muito interessante, Aggron resiste até o ultimo momento por seu treinador, quando ele ficar com 1 de vida, sua coloração muda, e ele resiste por 8 segundos antes de ser derrotado. Essa habilidade pode ser muito util, onde Aggron resiste a combos muito poderosos, ou até mesmo para carregar algum cd e finalizar o inimigo.

zipter98Z
02 de setembro de 2015 às 22:01
Melhor resposta

Apesar de ter feito este código faz um tempo, suponho que ainda esteja funcionando como deve.

Para base PDA:

data/creaturescripts/scripts, exp2.0.lua:
Troque:
if valor >= getCreatureHealth(cid) then
    if isInArray(cannotKill, combat) and isPlayer(cid) then
        valor = getCreatureHealth(cid) - 1
    else
        valor = getCreatureHealth(cid) 
    end
end
por:
local config = {
    sturdy = {                    --Pokémons que possuem a habilidade Sturdy. Configuração: ["nome_do_pokemon"] = lookType,
        ["Aggron"] = lookType,
    },
    cd = 30,                      --Cooldown da habilidade.
    duration = 8,                 --Duração, em segundos, do Sturdy.
    storage = 8402,
}
 
if getPlayerStorageValue(cid, config.storage) > -1 then
    return false
end
local hp = getCreatureHealth(cid) - valor
if not isPlayer(cid) and hp <= 1 and config.sturdy[getCreatureName(cid)] then
    local b = true
    if isSummon(cid) then
        local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
        if ball and getCD(ball.uid, "sturdy") > 0 then
            b = false
        end
    end
    if b then
        if hp < 1 then
            doCreatureAddHealth(cid, hp < 0 and (hp * -1) + 1 or 1)
        end
        setPlayerStorageValue(cid, config.storage, 1)
        if isSummon(cid) then
            local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
            if ball then
                setCD(ball.uid, "sturdy", config.duration + config.cd) 
            end
        end
        doSetCreatureOutfit(cid, {lookType = config.sturdy[getCreatureName(cid)]}, config.duration * 1000)
        addEvent(function()
            if isCreature(cid) and getPlayerStorageValue(cid, config.storage) > -1 then
                setPlayerStorageValue(cid, config.storage, -1)
                doCreatureAddHealth(cid, -getCreatureHealth(cid))
            end
        end, config.duration * 1000)
    end
end
if valor >= getCreatureHealth(cid) then
    if isInArray(cannotKill, combat) and isPlayer(cid) then
        valor = getCreatureHealth(cid) - 1
    else
        valor = getCreatureHealth(cid) 
    end
end
data/lib, newStatusSyst.lua:
Troque:
doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)  
end
Troque:
doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)  
end
Troque:
doCreatureAddHealth(cid, -damage)
doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144)
doSendMagicEffect(getThingPos(cid), 45)
------
local newlife = life - getCreatureHealth(cid)
if newlife >= 1 and attacker ~= 0 then
    doSendMagicEffect(getThingPos(attacker), 14)
    doCreatureAddHealth(attacker, newlife)
    doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32)
end
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -damage)
    doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144)
    doSendMagicEffect(getThingPos(cid), 45)
------
    local newlife = life - getCreatureHealth(cid)
    if newlife >= 1 and attacker ~= 0 then
        doSendMagicEffect(getThingPos(attacker), 14)
        doCreatureAddHealth(attacker, newlife)
        doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32)
    end 
end

 

Editado Setembro 2 por zipter98

03 de setembro de 2015 às 11:45

Uau,muito obrigado,funciono perfeitamente como eu queria =)

MudrockM
03 de setembro de 2015 às 12:27

Tópico Movido
Este tópico foi movido de "OTServSuporteSuporte Servidores derivados"
para "OTServSuporteSuporte Servidores derivadosPedidos e dúvidas resolvidos - Servidores derivados".

 

 

Developer BergD
03 de setembro de 2015 às 23:33

Apesar de ter feito este código faz um tempo, suponho que ainda esteja funcionando como deve.

Para base PDA:

data/creaturescripts/scripts, exp2.0.lua:
Troque:
if valor >= getCreatureHealth(cid) then
    if isInArray(cannotKill, combat) and isPlayer(cid) then
        valor = getCreatureHealth(cid) - 1
    else
        valor = getCreatureHealth(cid) 
    end
end
por:
local config = {
    sturdy = {                    --Pokémons que possuem a habilidade Sturdy. Configuração: ["nome_do_pokemon"] = lookType,
        ["Aggron"] = lookType,
    },
    cd = 30,                      --Cooldown da habilidade.
    duration = 8,                 --Duração, em segundos, do Sturdy.
    storage = 8402,
}
 
if getPlayerStorageValue(cid, config.storage) > -1 then
    return false
end
local hp = getCreatureHealth(cid) - valor
if not isPlayer(cid) and hp <= 1 and config.sturdy[getCreatureName(cid)] then
    local b = true
    if isSummon(cid) then
        local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
        if ball and getCD(ball.uid, "sturdy") > 0 then
            b = false
        end
    end
    if b then
        if hp < 1 then
            doCreatureAddHealth(cid, hp < 0 and (hp * -1) + 1 or 1)
        end
        setPlayerStorageValue(cid, config.storage, 1)
        if isSummon(cid) then
            local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
            if ball then
                setCD(ball.uid, "sturdy", config.duration + config.cd) 
            end
        end
        doSetCreatureOutfit(cid, {lookType = config.sturdy[getCreatureName(cid)]}, config.duration * 1000)
        addEvent(function()
            if isCreature(cid) and getPlayerStorageValue(cid, config.storage) > -1 then
                setPlayerStorageValue(cid, config.storage, -1)
                doCreatureAddHealth(cid, -getCreatureHealth(cid))
            end
        end, config.duration * 1000)
    end
end
if valor >= getCreatureHealth(cid) then
    if isInArray(cannotKill, combat) and isPlayer(cid) then
        valor = getCreatureHealth(cid) - 1
    else
        valor = getCreatureHealth(cid) 
    end
end
data/lib, newStatusSyst.lua:
Troque:
doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)  
end
Troque:
doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)  
end
Troque:
doCreatureAddHealth(cid, -damage)
doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144)
doSendMagicEffect(getThingPos(cid), 45)
------
local newlife = life - getCreatureHealth(cid)
if newlife >= 1 and attacker ~= 0 then
    doSendMagicEffect(getThingPos(attacker), 14)
    doCreatureAddHealth(attacker, newlife)
    doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32)
end
por:
if getPlayerStorageValue(cid, 8402) == -1 then
    doCreatureAddHealth(cid, -damage)
    doSendAnimatedText(getThingPos(cid), "-"..damage.."", 144)
    doSendMagicEffect(getThingPos(cid), 45)
------
    local newlife = life - getCreatureHealth(cid)
    if newlife >= 1 and attacker ~= 0 then
        doSendMagicEffect(getThingPos(attacker), 14)
        doCreatureAddHealth(attacker, newlife)
        doSendAnimatedText(getThingPos(attacker), "+"..newlife.."", 32)
    end 
end

 

Zipter, poderia me ajudar a adaptar esse sistema para a base do Kpdo/ exaioros ? nessa base n tem essas scripts ( exp2.0.lua e newStatusSyst.lua )

ClaudioMar231oC
03 de setembro de 2015 às 23:56

Adoro o Zipter98 , sou fã =)

2 anos depois...
FrenviusF
29 de novembro de 2017 às 14:21
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.