local days = {
["Sunday"] = {
["00:00"] = {nome = "Demon Invasões", pos = {x=185, y=54, z=7}, monster = {"40 Demon", "50 Fire Devil", "4 Orshabaal"}, Time = 15},
["21:00"] = {nome = "Dragon Invasões", pos = {x=185, y=54, z=7}, monster = {"2 Dragon"}, Time = 15}
},
["Saturday"] = {
["00:00"] = {nome = "Demon Invasões", pos = {x=180, y=390, z=7}, monster = {"40 Demon", "50 Fire Devil", "4 Orshabaal"}, Time = 15},
["21:48"] = {nome = "Dragon Invasões", pos = {x=180, y=390, z=7},monster = {"2 Dragon"}, Time = 15}
}
}
function onThink(interval, lastExecution)
function getDayName()
local days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
return days[os.date("*t")["wday"]]
end
hours = tostring(os.date("%X")):sub(1, 5)
tb = days[getDayName()][hours]
if tb then
function removeCreature()
for x = ((tb.pos.x)-10), ((tb.pos.x)+10) do
for y = ((tb.pos.y)-10), ((tb.pos.y)+10) do
local m = getTopCreature({x=x, y=y, z= tb.pos.z}).uid
if m ~= 0 and isMonster(m) then
doRemoveCreature(m)
end
end
end
return true
end
addEvent(removeCreature, tb.Time*60*1000)
doBroadcastMessage(tb.nome)
for _,x in pairs(tb.monster) do
for s = 1, tonumber(x:match("%d+")) do
doSummonCreature(x:match("%s(.+)"), tb.pos)
end
end
end
return true
end