local arenas = {
{fromPos={x=95, y=128, z=7}, toPos={x=98, y=131, z=7}, arenaLeave={x=94, y=135, z=7}},
{fromPos={x=99, y=131, z=7}, toPos={x=101, y=134, z=7}, arenaLeave={x=94, y=135, z=7}}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local tmp = getCreaturePosition(cid)
for _, arena in ipairs(arenas) do
if(isInArea(tmp, arena.fromPos, arena.toPos) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doTeleportThing(cid, arena.arenaLeave, TRUE)
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
doRemoveCondition(cid, CONDITION_INFIGHT)
return FALSE
end
end
return TRUE
end