local temple = {x=3000, y=2998, z=7}
local t = {
items = {2499, 2500, 2501},
exp = 10000
}
local config = {
arena = {
frompos = {x = 2792, y = 2891, z =7},
topos = {x = 2822, y = 2909, z=7}
}
}
function onPrepareDeath(cid, deathList)
if (isMonster(deathList[1]) and isPlayer(cid)) then
if (getCreatureName(deathList[1]) == "Apocalypse") then
if #getPlayersfromArea(config.arena.frompos, config.arena.topos) == 1 then
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratulations, you won! Enjoy your reward!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
local v = math.random(1, 3)
if v < 3 then
doPlayerAddItem(cid, t.items[math.random(#t.items)], 1)
else
doPlayerAddExp(cid, t.exp)
end
else
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
return false
end
end
elseif isPlayer(deathList[1]) and isPlayer(cid) and isInRange(getCreaturePosition(cid), config.arena.frompos, config.arena.topos) then
doTeleportThing(cid, temple)
doSendMagicEffect(getCreaturePosition(cid),10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
return false
end
return false
end