<?xml version="1.0" encoding="UTF-8"?>
<mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="otl.com" enabled="yes">
<config name="raids_func"><![CDATA[
days = {
["Monday"] = {
["15:30"] = {
nome = "Orshabaal",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"5 Demon", "2 Orshabaal"},
Time = 15
},
["22:00"] = {
nome = "Evil Sorcerer",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"10 Evil Sorcerer"},
Time = 20
}
},
["Sunday"] = {
["15:00"] = {
nome = "Demon",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"20 Demon"},
Time = 15
},
["22:00"] = {
nome = "Evil Sorcerer",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"10 Evil Sorcerer"},
Time = 20
}
},
["Saturday"] = {
["15:00"] = {
nome = "Grims",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"40 Grim Reaper"},
Time = 15
},
["22:00"] = {
nome = "Evil Sorcerer",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"10 Evil Sorcerer"},
Time = 20
}
},
["Friday"] = {
["00:50"] = {
nome = "Terrible Dragon",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"15 Terrible Dragon"},
Time = 15
},
["22:00"] = {
nome = "Ferumbras",
pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"1 Ferumbras, 3 Orshabaal"},
Time = 20
}
},
["Thursday"] = {
["10:08"] = {
nome = "Demon",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"20 Demon"},
Time = 15
},
["22:00"] = {
nome = "Evil Sorcerer",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"10 Evil Sorcerer"},
Time = 20
}
},
["Wednesday"] = {
["15:00"] = {
nome = "Demon",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"20 Demon"},
Time = 15
},
["22:00"] = {
nome = "Tank",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"1 Tank"},
Time = 20
}
},
["Tuesday"] = {
["15:00"] = {
nome = "Orshabaal",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"5 Orshabaal"},
Time = 15
},
["22:00"] = {
nome = "Rotworm Queen",
pos = pos = {fromPosition = pos = {fromPosition = {x=953, y=973, z=7},toPosition = {x=1068, y=1014, z=7} } },
m = {"1 Rotworm queen"},
Time = 20
}
}
}
]]></config>
<globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[
domodlib('raids_func')
function onThink(interval, lastExecution)
if days[os.date("%A")] then
hours = tostring(os.date("%X")):sub(1, 5)
tb = days[os.date("%A")][hours]
if tb then
function removeCreature(tb)
for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
local m = getTopCreature({x=x, y=y, z=tb.pos.fromPosition.z}).uid
if m ~= 0 and isMonster(m) then
doRemoveCreature(m)
end
end
end
end
doBroadcastMessage("The invasion of " .. tb.nome .. " started")
for _,x in pairs(tb.m) do
for s = 1, tonumber(x:match("%d+")) do
pos = {
x = math.random(tb.pos.fromPosition.x,tb.pos.toPosition.x),
y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y),
z = tb.pos.fromPosition.z
}
doSummonCreature(x:match("%s(.+)"), pos)
end
end
addEvent(removeCreature, tb.Time*60*1000, tb)
end
end
return true
end
]]></globalevent>
</mod>