local arena = {
frompos = {x=100, y=100, z=7}, -- Top Left Corner
topos = {x=100, y=100, z=7}, -- Bottom Right Corner
exit = {x=100, y=100, z=7} -- Exit
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if isInArea(getCreaturePosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doTeleportThing(cid, arena.exit)
doSendMagicEffect(arena.exit, 10)
doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_ORANGE,'[ARENA] You have defeated '..getCreatureName(cid)..'!')
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'[ARENA] You where defeated by '..getCreatureName(mostDamageKiller)..'!')
end
return true
end
end