function onPrepareDeath(cid, deathList)
if isCreature(cid) and isPlayer(deathList[1]) then
if getPlayerLevel(deathList[1]) <= 20 then
doTeleportThing(deathList[1], getTownTemplePosition(getPlayerTown(deathList[1])))
doCreatureAddHealth(deathList[1], getCreatureMaxHealth(deathList[1]), true)
doCreatureAddMana(deathList[1], getCreatureMaxMana(deathList[1]), true)
doRemoveCondition(deathList[1], CONDITION_INFIGHT)
end
end
return false
end