Critico
Sexy
- Joined
- Mar 25, 2010
- Messages
- 370
- Reaction score
- 176
Automatic Raids.xml
explanation:
The day of the invasion is placed between " " and the first letter is uppercase, ex:
After are the hours the invasion, which is placed between " " and only the hours and minutes, seconds do not need, example:
Positions are enclosed in {} by adding the x, y, and z is the beginning and end of the area, ex:
fromPosition - beginning of the area where the raid will happen
toPosition - end of the area where the raid will happen
The monters has a special way to set up, you put between {} and each monster between " ", and between "" you add "AMOUNT MONSTER"
and to add more types monster is separated by commas, for example:
Time is an extra function, if nobody participate in the event then for the monsters do not stay on the map... and is in minutes, for example:
Lua:
<?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"] = {
["21:30"] = {nome = "Orshabaal", pos = {fromPosition = {x=184, y=55, z=7},toPosition = {x=188, y=58, z=7}},m = {"5 Fire Devil", "2 Orshabaal"}, Time = 15},
["21:33"] = {nome = "Dragon", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}},m = {"50 Dragon"}, Time = 20}
},
["Sunday"] = {
["10:08"] = {nome = "Demon", pos = {fromPosition = {x=202, y=11, z=7},toPosition = {x=204, y=12, z=7}}, m = {"20 Demon"}, Time = 15},
["10:46"] = {nome = "Hydra", pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}}, m = {"7 Hydra", "4 Cyclops"}, 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>
explanation:
Lua:
["Day"] = {
["Hour of the invasion"] = {nome = "INVASION NAME", pos = {beginning and end of the area}, monster = {"MONSTERS"}, Time = to remove monsters}
}
The day of the invasion is placed between " " and the first letter is uppercase, ex:
Lua:
"Saturday"
After are the hours the invasion, which is placed between " " and only the hours and minutes, seconds do not need, example:
Lua:
"15:00"
Positions are enclosed in {} by adding the x, y, and z is the beginning and end of the area, ex:
Lua:
pos = {fromPosition = {x=197, y=57, z=7},toPosition = {x=203, y=60, z=7}}
fromPosition - beginning of the area where the raid will happen
toPosition - end of the area where the raid will happen
The monters has a special way to set up, you put between {} and each monster between " ", and between "" you add "AMOUNT MONSTER"
and to add more types monster is separated by commas, for example:
Lua:
{"40 Water Elemental", "5 Cyclops"}
Time is an extra function, if nobody participate in the event then for the monsters do not stay on the map... and is in minutes, for example:
Lua:
Time = 15