@Biinhows Qual versão de TFS suporta?
FUNCIOU!!! Valew cara, tem outra forma de absorver esse dano sem que seja por %?
Eu refiz o sistema todo de dano a jogadores e adicionei um cálculo de armor. No caso eu precisei adicionar algumas funções também. Ainda preciso reformular o cálculo baseado na armor, mas o sistema ja ta feito.
if(isCreature(attacker)) then
if isPlayer(cid) then
local armor = getPlayerArmor(cid)
local dmg = math.ceil(value)
local mindmg = 0
local toPos = getCreaturePosition(attacker)
local nome = getCreatureName(cid)
if (armor > dmg) then
local dmg = 1
doCreatureAddHealth(cid, - dmg)
addEvent(doSendAnimatedText, 5, getThingPos(cid), dmg , 180)
doPlayerSendTextMessage(attacker, 23, "You deal ".. dmg .. " damage to a ".. nome..". ")
return false
else
local dmg = ((value - armor))
doCreatureAddHealth(cid, - dmg)
addEvent(doSendAnimatedText, 5, getThingPos(cid), dmg , 180)
doPlayerSendTextMessage(attacker, 23, "You deal ".. dmg .. " damage to a ".. nome..". ")
return false
end
end
end