It can be 100% Lua. Addit's for war server
onPrepareDeath
event that return false
and heal player. It should make him unkillable. Test it, if it works fine (player can still walk etc.), then add code that adds mana and teleports to temple and that's should be all.addEvent
that executed 60 times with 1 second interval and removed PZ lock from player, if he was still in protection zone.onPrepareDeath
event that returns false, C++ 'onDeath' code won't execute. If your server bases on C++ code that gives exp for kills, you got to replicate that code in Lua, to give exp to player. Corpse won't drop, you will have to add it in Lua too.InCan you provide me with these scripts cause i'm not expert enough to create them on my own & thx in advance
data/creaturescripts/creaturescripts.xml
add:<event type="login" name="NoDeathLogin" event="script" value="no_death.lua"/>
<event type="preparedeath" name="NoDeathPrepareDeath" event="script" value="no_death.lua"/>
data/creaturescripts/scripts/no_death.lua
and paste into it:local templePosition = {x = 1000, y = 1000, z = 7}
function onLogin(cid)
registerCreatureEvent(cid, "NoDeathPrepareDeath")
return true
end
local function removePzLock(cid, iterations)
if isPlayer(cid) and getTileInfo(getThingPosition(cid)).protection then
doPlayerSetPzLocked(cid, false)
if iterations > 0 then
addEvent(removePzLock, 1000, cid, iterations - 1)
end
end
end
function onPrepareDeath(cid, deathList)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doRemoveConditions(cid)
doTeleportThing(cid, templePosition, true, true)
removePzLock(cid, 60)
return false
end
local templePosition = {x = 1000, y = 1000, z = 7}
function onPrepareDeath(cid, deathList)
in older versions never worked correctly.