Arenas_Positions = {
{
startPosition = {x = 943,y=944,z=7},
endPosition = {x=979,y=954,z=7},
startPosition2 = {x= 949,y=955,z=7},
endPosition2 = {x= 979,y=960,z=7},
position = {x=944,y=958,z=7}},
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local tmp = getCreaturePosition(cid)
for _, arena in ipairs(Arenas_Positions) do
if(isInArea(tmp, arena.startPosition, arena.endPosition) == TRUE) then
if getPlayerSex(cid) == 1 then
doCreateItem(6080, 1, tmp)
elseif getPlayerSex(cid) == 2 then
doCreateItem(6081, 1, tmp)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid), TRUE)
doTeleportThing(cid, arena.position, TRUE)
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(arena.position,10)
return FALSE
elseif(isInArea(tmp, arena.startPosition2, arena.endPosition2) == TRUE) then
if getPlayerSex(cid, 1) == TRUE then
doCreateItem(tmp ,3128)
elseif getPlayerSex(cid, 2) == TRUE then
doCreateItem(tmp, 6081)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doTeleportThing(cid, arena.position, TRUE)
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
return FALSE
end
end
return TRUE
end