local exhaustionConfig = {
21144, -- storage
600 -- time in seconds
}
local mobs = {
{ -- 1
{"Rift Worm", {x=2057,y=1190,z=10}},
{"Rift Worm", {x=2059,y=1190,z=10}},
{"Rift Worm", {x=2067,y=1190,z=10}},
{"Rift Worm", {x=2069,y=1190,z=10}}
},
{ -- 2
{"Rift Brood", {x=2063,y=1183,z=10}},
{"Rift Brood", {x=2062,y=1186,z=10}},
{"Rift Brood", {x=2063,y=1186,z=10}},
{"Rift Brood", {x=2064,y=1186,z=10}}
},
{ -- 3
{"Rift Scythe", {x=2062,y=1194,z=10}},
{"Rift Scythe", {x=2063,y=1194,z=10}},
{"Rift Scythe", {x=2064,y=1194,z=10}},
{"Rift Scythe", {x=2063,y=1195,z=10}}
},
{ -- 4
{"Azerus", {x=2063,y=1191,z=10}},
{"War Golem", {x=2058,y=1194,z=10}},
{"War Golem", {x=2068,y=1194,z=10}},
{"War Golem", {x=2068,y=1186,z=10}},
{"War Golem", {x=2058,y=1186,z=10}}
}
}
local function summonMonsters(array)
for f = 1, #array do
doSummonCreature(unpack(array[f]))
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getGlobalStorageValue(exhaustionConfig[1]) <= os.time(t) then
for t = 1, 4 do
addEvent(summonMonsters, 5000 * (t - 1), mobs[t])
end
setGlobalStorageValue(exhaustionConfig[1], os.time(t) + exhaustionConfig[2])
end
return TRUE
end