-- Made by Third Aid
-- Edited by Xiduzo
setGlobalStorageValue(17000, 0)
function monsterSpawns()
local monsters = {"Rat", "Rotworm", "Orc Leader", "Bog Raider", "Giant Spider", "Diabolic Imp", "Destroyer", "Dark Torturer", "Behemoth", "Hellspawn", "War Golem", "Serpent Spawn", "Hellhound", "Plaguesmith",
"Demon", "Undead Dragon"} -- list of monster which should spawn (do not add extra monster / only change the names)
local monstersPos = {x=308, y=274, z=7} -- Where the monsters should be spawned
local northWestX = 304 -- North West X of the room with the bomb
local northEastX = 319 -- North East X of the room with the bomb
local northWestY = 270 -- North West Y of the room with the bomb
local southWestY = 279 -- South West Y of the room with the bomb
local roomFloor = 7 -- Floor / Z of the room with the bomb
if getGlobalStorageValue(17000) == 1 then
if getGlobalStorageValue(17001) <= 15 then
setGlobalStorageValue(17001, getGlobalStorageValue(17001)+1)
addEvent(monsterSpawns, 60*1000)
for i = 1, 3 do -- summons 3 monsters
doSummonCreature(monsters[getGlobalStorageValue(17001)], monstersPos)
end
else
setGlobalStorageValue(17000, 0)
setGlobalStorageValue(17001, 0)
for x = northWestX, northEastX do
for y = northWestY, southWestY do
local explosionArea = {x=x, y=y, z=roomFloor, stackPos=253}
local getCreatures = getTopCreature(explosionArea).uid
doSendMagicEffect(explosionArea, CONST_ME_FIREATTACK)
if(isCreature(getCreatures) == TRUE) then
doCreatureAddHealth(getCreatures, -getCreatureHealth(getCreatures))
end
end
end
end
end
return true
end
local playerPosition = {
{x=293, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}, -- The tiles they should stand on when pulling the switch
{x=294, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=295, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=296, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}
}
local newPosition = {
{x=305, y=273, z=7}, -- Where they get teleported in the room with the bomb
{x=305, y=274, z=7},
{x=305, y=275, z=7},
{x=305, y=276, z=7}
}
local wallName = "Brick Wall" -- Name of the "Wall monster"
local wallPos = {x=319, y=275, z=7} -- Where the wall should be
-- do not edit below here!--
setGlobalStorageValue(17002,0)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = {}
if item.itemid == 1945 then
setGlobalStorageValue(17002,0)
if getGlobalStorageValue(17000) == 0 then
for i = 1, 4 do
player[i] = getThingfromPos(playerPosition[i])
if player[i].itemid > 0 then
if isPlayer(player[i].uid) == true then
if getPlayerLevel(player[i].uid) <= 99 then
doPlayerSendCancel(cid, "All players need to be level 100 or higher.")
else
setGlobalStorageValue(17002, getGlobalStorageValue(17002)+1)
if getGlobalStorageValue(17002) == 4 then
for i = 1, 4 do
doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
doTeleportThing(player[i].uid, newPosition[i], FALSE)
doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
end
addEvent(monsterSpawns, 30*1000)
doSummonCreature(wallName, wallPos)
doTransformItem(item.uid, item.itemid + 1)
setGlobalStorageValue(17001, 0)
setGlobalStorageValue(17000, 1)
else
doPlayerSendCancel(cid, "You need 4 people to start this quest.")
end
end
end
end
end
elseif getGlobalStorageValue(17000) == 1 then
doPlayerSendCancel(cid, "There is allready a team inside, please be patient.")
end
elseif item.itemid == 1946 then
doTransformItem(item.uid, item.itemid - 1)
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end