function onUse(cid, item, frompos, item2, topos)
--Config-->
local statue_pos = {x = 1185, y = 480, z = 11}
local portal_quest01_pos = {x = 1185, y = 489, z = 11, stackpos = 1}
local portal_quest02_pos = {x = 1186, y = 491, z = 10, stackpos = 2}
local new_portal_pos = {x = 1185, y = 473, z = 11, stackpos = 1}
local new_pos = {x = 1186, y = 507, z = 9}
--End Config-->
function Potwory1()
if math.random (1,8) == 4 then
doCreateMonster('Rift Brood', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
else
doCreateMonster('Rift Brood', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
end
end
function Potwory2()
doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
end
function Potwory3()
doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
end
function Potwory4()
doCreateMonster('Azerus', {x = statue_pos.x, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('War Golem', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
doCreateMonster('War Golem', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
end
function createOrb()
doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1)
return true
end
function RemoveAll()
doRemoveItem(getThingfromPos(portal_quest01_pos).uid,1)
doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1)
end
if getItemCountFromPosition(9772, portal_quest02_pos) == 0 and item.uid == 1968 and getThingfromPos(portal_quest01_pos).itemid ~= 9772 then
doCreateItem(9772,1,portal_quest02_pos)
addEvent(createOrb, 600 * 1000)
addEvent(Potwory1, 0)
addEvent(Potwory2, 60 * 1000)
addEvent(Potwory2, 90 * 1000)
addEvent(Potwory3, 120 * 1000)
addEvent(Potwory4, 180 * 1000)
else
doCreatureSay(cid, "Monsters attack automatic! You have to wait 10 minutes before this globe will charge.", TALKTYPE_ORANGE_1)
end
return TRUE
end