LG

[Encerrado] Aumento do dano do Poison/Burn

Por lgan, 16 de jan. de 2014 em Tópicos Sem Resposta

resolvido
12
1.2k
lganL
16 de janeiro de 2014 às 23:35

alguem sabe como posso fazer para que se o player tiver xx storage, o dano do poison eh multiplicado por 2 ou 3?

segue a parte do dano no newStatusSys.lua

 

 

 

function doBurn2(cid, cd, check, damage)
local stg = conds["Burn"]
if not isCreature(cid) then return true end --is creature?
if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then
setPlayerStorageValue(cid, stg, cd) --allterado v1.8
return true
end

if not check and getPlayerStorageValue(cid, stg) >= 1 then
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
else
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
end

local a = getPlayerStorageValue(cid, stg)

if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
doItemSetAttribute(item.uid, "burn", a)
doItemSetAttribute(item.uid, "burndmg", damage)
end

if a <= -1 then
setPlayerStorageValue(cid, stg, -1)
return true
end

doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)
addEvent(doBurn2, 3500, cid, -1, a, damage)
end

function doPoison2(cid, cd, check, damage)
local stg = conds["Poison"]
if not isCreature(cid) then return true end --is creature?
----------
if isSummon(cid) or ehMonstro(cid) and pokes[getCreatureName(cid)] then --alterado v1.6
local type = pokes[getCreatureName(cid)].type
local type2 = pokes[getCreatureName(cid)].type2
if isInArray({"poison", "steel"}, type) or isInArray({"poison", "steel"}, type2) then
return true
end
end
---------
if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then
setPlayerStorageValue(cid, stg, cd) --allterado v1.8
return true
end

if not check and getPlayerStorageValue(cid, stg) >= 1 then
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
else
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
end

local a = getPlayerStorageValue(cid, stg)

if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
doItemSetAttribute(item.uid, "poison", a)
doItemSetAttribute(item.uid, "poisondmg", damage)
end

if a <= -1 or getCreatureHealth(cid) == 1 then
setPlayerStorageValue(cid, stg, -1)
return true
end

local dano = getCreatureHealth(cid)-damage <= 0 and getCreatureHealth(cid)-1 or damage
doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)

addEvent(doPoison2, 1500, cid, -1, a, damage)

end

 

 

 

zipter98Z
17 de janeiro de 2014 às 12:39

Tenta assim, deixei indicado no código o quê você deve alterar.

 

 

function doBurn2(cid, cd, check, damage)
 
local stg = conds["Burn"]
 
    if not isCreature(cid) then return true end --is creature?
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then
        setPlayerStorageValue(cid, stg, cd) --allterado v1.8
        return true
    end
 
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
        setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
        setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
 
local a = getPlayerStorageValue(cid, stg)
 
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
        local owner = getCreatureMaster(cid)
        local storage = xxx     --Storage necessário para aumentar o damage - Burn.
        local valor = xxx       --Valor necessário da storage acima.
        local multiplicador = 3       --O dano do Burn será multplicado por quanto?
        if getPlayerStorageValue(owner, storage) >= valor then
            damage = damage*multiplicador
        end
    end       
 
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
        local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
        doItemSetAttribute(item.uid, "burn", a)
        doItemSetAttribute(item.uid, "burndmg", damage)
    end
 
    if a <= -1 then
        setPlayerStorageValue(cid, stg, -1)
        return true
    end
 
    doCreatureAddHealth(cid, -damage, 15, COLOR_BURN)
    addEvent(doBurn2, 3500, cid, -1, a, damage)
end
 
function doPoison2(cid, cd, check, damage)
 
local stg = conds["Poison"]
    if not isCreature(cid) then return true end --is creature?
----------
    if isSummon(cid) or ehMonstro(cid) and pokes[getCreatureName(cid)] then --alterado v1.6
        local type = pokes[getCreatureName(cid)].type
        local type2 = pokes[getCreatureName(cid)].type2
        if isInArray({"poison", "steel"}, type) or isInArray({"poison", "steel"}, type2) then
            return true
        end
    end
---------
    if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then
        setPlayerStorageValue(cid, stg, cd) --allterado v1.8
        return true
    end
 
    if not check and getPlayerStorageValue(cid, stg) >= 1 then
        setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
    else
        setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
    end
 
local a = getPlayerStorageValue(cid, stg)
 
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
        local owner = getCreatureMaster(cid)
        local storage = xxx     --Storage necessário para aumentar o damage - Poison.
        local valor = xxx       --Valor necessário da storage acima.
        local multiplicador = 3       --O dano do Poison será multplicado por quanto?
        if getPlayerStorageValue(owner, storage) >= valor then
            damage = damage*multiplicador
        end
    end       
 
    if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
        local item = getPlayerSlotItem(getCreatureMaster(cid), 8)
        doItemSetAttribute(item.uid, "poison", a)
        doItemSetAttribute(item.uid, "poisondmg", damage)
    end
 
    if a <= -1 or getCreatureHealth(cid) == 1 then
        setPlayerStorageValue(cid, stg, -1)
        return true
    end
 
local dano = getCreatureHealth(cid)-damage <= 0 and getCreatureHealth(cid)-1 or damage
 
    doCreatureAddHealth(cid, -dano, 8, COLOR_GRASS)
    addEvent(doPoison2, 1500, cid, -1, a, damage)
end

lganL
17 de janeiro de 2014 às 19:42

cara não funcionou... nenhum erro no distro nem nada.... soh o dano eh o mesmo, nãomuda independente da storage

 

edit...

 

faz 3 hrs que to tentando entender ond calcula o dano do poison/burn, até agora nada... achei que pudesse ser em pokemon moves, mas n achei nada.. ali no script que postei soh fala damage... mas não entendi o calculo do damage... será que alguem sabe como funciona isso?

Editado Janeiro 17 por lgan

zerefshirouZ
18 de janeiro de 2014 às 00:38

Calculo se ve em pokemon moves ou exp.lua...

 

Tenta trocar essa parte:

 

local dano = getCreatureHealth(cid)-damage <= 0 and getCreatureHealth(cid)-1 or damage

 

Por:

 

dano = getCreatureHealth(cid)-damage <= 0 and getCreatureHealth(cid)-1 or damage
 
storagePoisonBonus = 15120489012
if isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), storagePoisonBonus) > 0 then
bonusPoisonDamage = 2
dano = dano * bonusPoisonDamage
end
lganL
18 de janeiro de 2014 às 14:09

tb não funcionou... mas depois que você falou do exp.lua... fui procurar e achei isso:

 

 

elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then ---- DANO DO POISON ----
local ret = {}
ret.id = cid
ret.cd = math.random(6, 15)
ret.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
ret.cond = "Poison"

doCondition2(ret)
end

 

 

será que não seria melhor ele checar a storage aki ao invés do newStatusSystem?

 

alguem sabe como poderia fazer isso?

Editado Janeiro 18 por lgan

zerefshirouZ
18 de janeiro de 2014 às 16:45

Desse jeito também da, bem então faz assim

dmg = math.floor((getPokemonLevel(attacker)+lvl)/2)
if isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 1209581295) > 0 then
dmg = dmg * 2
end

ai no lugar do

ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)

coloca

ret.damage = dmg

Reporte o resultado

lganL
18 de janeiro de 2014 às 18:02

cara antes de você postar, estava trabalhando nisso... e cheguei a isso...

 

 

elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then ---- DANO DO POISON ----
local ret = {}
ret.id = cid
ret.cd = math.random(6, 15)
ret.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/1.2)
ret.cond = "Poison"

local ret2 = {}
ret2.id = cid
ret2.cd = math.random(6, 15)
ret2.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret2.damage = math.floor((getPokemonLevel(attacker)+lvl)*2.3)
ret2.cond = "Poison"

local ret3 = {}
ret3.id = cid
ret3.cd = math.random(6, 15)
ret3.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret3.damage = math.floor((getPokemonLevel(attacker)+lvl)*2.9)
ret3.cond = "Poison"

if ehMonstro(cid) and ehMonstro(attacker) and not isSummon(cid) and not isSummon(attacker) then
doCondition2(ret)
end
if isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) <= 0 then
doCondition2(ret)
elseif isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) == 1 then
doCondition2(ret2)
elseif isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) == 2 then
doCondition2(ret3)
end
end
end
end
end

 

 

funcionou... soh que... o script esta subindo o dano de atk e de def tb.... ou seja se o player esta com a sto o player bate 500 no poison.

 

Se outro poke que ataca-lo tb ira bater 500 no poison.. tentei mexer na função ali do "ehMonster" mas não tive exito, tem alguma ideia pra isso?

Editado Janeiro 18 por lgan

zerefshirouZ
18 de janeiro de 2014 às 23:06

O resultado que você disse, deu com o meu ou com o seu?

lganL
20 de janeiro de 2014 às 21:11

desculpe pela demora..... esse resultado foi com o meu.... o seu não funcionou...

lganL
23 de janeiro de 2014 às 23:54

dae pessoal hj estava eu quebrando a cabeça denovo com isso... e até que tive uma ideia, e deu certo.... pra quem quiser usar, segue ai como ficou o script:

 

exp2.0.lua: na parte do poison

 

 

elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then ---- DANO DO POISON ----

 

local ret = {}
ret.id = cid
ret.cd = math.random(6, 15)
ret.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/1) --aki vc altera o qt ele vai multiplicar o dano
ret.cond = "Poison"

local ret2 = {}
ret2.id = cid
ret2.cd = math.random(6, 15)
ret2.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret2.damage = math.floor((getPokemonLevel(attacker)+lvl)*1.5) --aki vc altera o qt ele vai multiplicar o dano
ret2.cond = "Poison"

local ret3 = {}
ret3.id = cid
ret3.cd = math.random(6, 15)
ret3.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
ret3.damage = math.floor((getPokemonLevel(attacker)+lvl)*2.9) --aki vc altera o qt ele vai multiplicar o dano
ret3.cond = "Poison"


if isSummon(cid) then
doCondition2(ret)
elseif isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) == -1 then
doCondition2(ret)
elseif isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) == 1 then
doCondition2(ret2)
elseif isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(attacker), 406347) == 2 then
doCondition2(ret3)

end
end
end
end
end

 

 

 

explicando: se o player tiver a storage 406347 valor 1 ele vai hitar 1,5 +

se o player tiver a storage 406347 valor 2 ele vai hitar 2.9 +

 

vlw ai a todos que tentaram ajudar...

 

Duvida sanada, podem fechar.

OmegaO
24 de janeiro de 2014 às 01:39

Tópico movido para a seção de dúvidas e pedidos resolvidos.

4 anos depois...
StigalS
21 de abril de 2018 às 03:23
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.