hello otland, I'm making a script to make a monster immortal (does not take damage), when there is a specific monster for example a summon, and when the summons die it is mortal (takes damage), and when I summon them again he becomes immortal again and so on, I already started a script where he is completely immortal but I am new to this so I don't know what else to move him, if someone could help me I would appreciate it, I currently use Otx 2.9.
I have done so far this part of the code the code works is a creaturescript.
I have done so far this part of the code the code works is a creaturescript.
Lua:
local percent = 100
local percent2 = 0
local monster = "Rotworm"
function onStatsChange(cid, attacker, type, combat, value)
if (type == STATSCHANGE_HEALTHLOSS) and isCreature(attacker) then
value = math.ceil(value*(percent))
doTargetCombatHealth(attacker, cid, combat, -value, 255)
doSendAnimatedText(getCreaturePos(cid), "Inmortal", 6)
return false
end
return true
end