Hello there and thanks in advance,
I've been updating a server i started long time ago and i've encounterd a problem i can't seem to find the solution to.
I've created an 'onPrepareDeath' creature event but it doesnt seem to trigger.
I'm using Mystic spirit v0.2 which already made me change my script since it doesnt support 'onStatsChange' events, and now it won't trigger the onPrepareDeath events.
Is there any problem with the mystic Spirit server, i'm missing?
This is the code i have in case you need to look at it, but im fairly certain that it is correct and i'm not getting any error in my console either.
creaturescripts/scripts/palma_OB.lua
creaturescripts.xml
login.lua
thanks,
Kird~
I've been updating a server i started long time ago and i've encounterd a problem i can't seem to find the solution to.
I've created an 'onPrepareDeath' creature event but it doesnt seem to trigger.
I'm using Mystic spirit v0.2 which already made me change my script since it doesnt support 'onStatsChange' events, and now it won't trigger the onPrepareDeath events.
Is there any problem with the mystic Spirit server, i'm missing?
This is the code i have in case you need to look at it, but im fairly certain that it is correct and i'm not getting any error in my console either.
creaturescripts/scripts/palma_OB.lua
Lua:
local temple_pos ={x = 1136, y = 1203, z = 7}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if getCreatureHealth(cid) <= 0 and isPlayer(cid) then
doTeleportThing(cid, temple_pos, true)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid), true)
return false
end
return true
end
creaturescripts.xml
Lua:
<event type="preparedeath" name="palmaOB" event="script" value="palma_OB.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "palmaOB")
thanks,
Kird~