local config = {
flampos = {x=983,y=1101,z=15},
tppos = {x=983,y=1101,z=15}, -- WHERE TO TELEPORT TO.
monsterpos = {x=995,y=1119,z=15}, -- WHERE MONSTER TELEPORTS.
maxplayers = 90, -- HOW MANY PLAYERS CAN ENTER.
globalstorage = 50290,
monsterstorage = 50310,
enteredArea = 50300, -- EMPTY PLAYER STORAGE.
exhauststorage = 50340, -- EMPTY PLAYER STORAGE.
fromPosition = {x=976, y=1112, z=15}, -- top left cornor of the playground
toPosition = {x=1001, y=1124, z=15} -- bottom right cornor of the playground -- top left cornor of the playground
}
local monsters = {'morgaroth','Massacre','Ushuriel','Zugurosh'}
function onStepIn(cid,item,pos,fromPos)
if isPlayer(cid) then
if getPlayerLevel(cid) < 250 then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You need to be of Level 250 or higher to enter.')
else
local g = math.max(0, getStorage(config.globalstorage)) + 1
if g > config.maxplayers then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Too many players are participating already.')
elseif exhaustion.check(cid,config.exhauststorage) then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You can\'t enter yet, you\'ll have to wait '..exhaustion.get(cid,config.exhauststorage)..' more seconds.')
else
doSetStorage(config.globalstorage, g)
doCreatureSetStorage(cid,50300,1)
doTeleportThing(cid,config.tppos)
doSendMagicEffect(config.tppos, CONST_ME_TELEPORT)
doSendMagicEffect(pos,CONST_ME_POFF)
if getStorage(config.monsterstorage) < 1 then
local pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)}
doSummonCreature(monsters[math.random(#monsters)],pos)
doSendMagicEffect(config.monsterpos,CONST_ME_TELEPORT)
doSetStorage(config.monsterstorage,1)
end
return
end
end
doTeleportThing(cid, fromPos)
doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
end
end
function onAddItem(moveitem, tileitem, pos)
pos.x = pos.x + 3
doTeleportThing(moveitem.uid, pos)
doSendMagicEffect(pos, 12)
end