Postado Agosto 21, 2022 2 anos Autor 1 hora atrás, FeeTads disse: essa função eh uma merreca, ela puxa da source, e ela "duplica" pq ela eh um "statsChange" então vc chama ela de novo no script eu indico usar assim: local lvlcrit = 98798645 local multiplier = 2 function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (1,1000) then --Fix* chance de 1 a 1000 evita bug dano = math.ceil(value*multiplier) if isCreature(cid) then doCreatureAddHealth(cid, -dano) end addEvent(function() if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-"..dano, 180) end end, 100) if isCreature(attacker) then doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144) end end end return true end Funcional, esta funciando sem error no console, porem tem um problema....quando o char esta de utamo vita ou energy ring, o CRITICAL da dois danos ! no HP e HP ao mesmo tempo. tem como ''ajeitar'' isso pf ? >< Editado Agosto 21, 2022 2 anos por deza (veja o histórico de edições)
Postado Agosto 21, 2022 2 anos 1 hora atrás, deza disse: em como ''ajeitar'' isso pf ? >< só modificar o type pra reconhecer local lvlcrit = 98798645 local multiplier = 2 function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (1,1000) then --Fix* chance de 1 a 1000 evita bug dano = math.ceil(value*multiplier) if isCreature(cid) then if type == STATSCHANGE_HEALTHLOSS then doCreatureAddHealth(cid, -dano) elseif type == STATSCHANGE_MANALOSS then doCreatureAddMana(cid, -dano) end end addEvent(function() if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-"..dano, 180) end end, 100) if isCreature(attacker) then doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144) end end end return true end nesse caso ai que é o meu critical, vai acontecer assim por exemplo: hit hit hit critical > script critical > script tirando 2*hit > dano total = hit + 2*hit (ou seja 3 hits)
Postado Agosto 21, 2022 2 anos Autor 7 horas atrás, FeeTads disse: só modificar o type pra reconhecer local lvlcrit = 98798645 local multiplier = 2 function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (1,1000) then --Fix* chance de 1 a 1000 evita bug dano = math.ceil(value*multiplier) if isCreature(cid) then if type == STATSCHANGE_HEALTHLOSS then doCreatureAddHealth(cid, -dano) elseif type == STATSCHANGE_MANALOSS then doCreatureAddMana(cid, -dano) end end addEvent(function() if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-"..dano, 180) end end, 100) if isCreature(attacker) then doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144) end end end return true end nesse caso ai que é o meu critical, vai acontecer assim por exemplo: hit hit hit critical > script critical > script tirando 2*hit > dano total = hit + 2*hit (ou seja 3 hits) Agradeço por tentar ajudar, mas esse seu script da dano no HP e MP, queria q ele funcionasse normal, critical no Hp ou Mp, como os normais !
Postado Agosto 22, 2022 2 anos 10 horas atrás, deza disse: Agradeço por tentar ajudar, mas esse seu script da dano no HP e MP não po se vc tiver apanhando na mana, ele vai tirar dano da mana, porém o dano vai ser "-1000" em vermelho pra todos os casos. caso queira que se tiver apanhando em mana, mostrar o dano do critical em azul, só colocar o type, pra ele checar tbm ex: local lvlcrit = 98798645 local multiplier = 2 function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (1,1000) then --Fix* chance de 1 a 1000 evita bug dano = math.ceil(value*multiplier) if isCreature(cid) then if type == STATSCHANGE_HEALTHLOSS then doCreatureAddHealth(cid, -dano) elseif type == STATSCHANGE_MANALOSS then doCreatureAddMana(cid, -dano) end end addEvent(function() if isCreature(cid) then if type == STATSCHANGE_HEALTHLOSS then doSendAnimatedText(getCreaturePos(cid), "-"..dano, 180) elseif type == STATSCHANGE_MANALOSS then doSendAnimatedText(getCreaturePos(cid), "-"..dano, 30) end end end, 100) if isCreature(attacker) then doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144) end end end return true end
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.