dam , here is script , take a look
Lua:
local arena = {
frompos = { x = 168, y = 657, z = 7 },
topos = { x = 177, y = 666, z = 7 },
exit = { x = 169, y = 668, z = 6 }
}
local function exitArena(p)
local mana = (getCreatureMaxMana(p.cid) * 0.8)
doCreatureAddHealth(p.cid, getCreatureMaxHealth(p.cid))
doCreatureAddMana(p.cid, -mana)
doRemoveCondition(p.cid, CONDITION_INFIGHT)
doSendMagicEffect(p.exit, 10)
doTeleportThing(p.cid, p.exit, FALSE)
return TRUE
end
function onPrepareDeath(cid, killer)
arenastatus = getPlayerStorageValue(cid,74859)
if arenastatus == -1 then
doCreatureAddHealth(cid, 1)
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, 1)
setPlayerStorageValue(cid, 74859, 0)
addEvent(exitArena, 1, {cid=cid, exit=arena.exit})
end
else
return TRUE
end
end
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end