function onPrepareDeath(cid, deathList)
local attacker = deathList[1]
if isInRange(getCreaturePosition(cid), arena.frompos, arena.topos) then
doItemSetAttribute(doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize "..getCreatureName(cid)..". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".\n[War-Event kill]")
doTeleportThing(cid, out_place, FALSE)
doSendMagicEffect(getCreaturePosition(cid), 10)
doRemoveConditions(cid, FALSE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item").." in the war event.")
if isPlayer(attacker) then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_BLUE, "You killed "..getCreatureName(cid).." in the war event.")
end
if getPlayerStorageValue(cid,joined) == 1 then
addRed()
setPlayerStorageValue(cid,10000,-1)
elseif getPlayerStorageValue(cid,joined) == 2 then
addBlue()
setPlayerStorageValue(cid,10000,-1)
end
return false
end
return true
end