• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X tfs 0.4 raid system

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i have problem with raid system, cuz this script spawn boss every 1 second

if anyone knows how to fix this xml file feel free to do it, because i have no clue how to

but i got it to work on my 0.3.6 tfs by doing this:
in lib/100-compat.lua add
Code:
days = {
["Tuesday"] = {
  ["19:49"] = {nome = "Countess Sorrow", pos = {fromPosition = {x=775, y=1194, z=9},toPosition = {x=777, y=1194, z=9}},m = {"1 Countess Sorrow"}, Time = 2},
  ["21:33"] = {nome = "The Imperor", pos = {fromPosition = {x=826, y=1229, z=10},toPosition = {x=828, y=1229, z=10}},m = {"1 The Imperor"}, Time = 20},
},

["Wednesday"] = {
  ["04:08"] = {nome = "Mr. punish", pos = {fromPosition = {x=1000, y=990, z=7},toPosition = {x=1005, y=1000, z=7}},m = {"1 Mr. Punish"}, Time = 2},
},

["Sunday"] = {
  ["10:08"] = {nome = "Dracola", pos = {fromPosition = {x=882, y=1192, z=10},toPosition = {x=884, y=1192, z=10}}, m = {"1 Dracola"}, Time = 15},
  ["10:46"] = {nome = "Massacre", pos = {fromPosition = {x=919, y=1227, z=10},toPosition = {x=921, y=1227, z=10}}, m = {"1 Massacre"}, Time = 20},
  ["10:47"] = {nome = "Son of Verminor", pos = {fromPosition = {x=735, y=1243, z=10},toPosition = {x=737, y=1243, z=10}}, m = {"1 Son of Verminor"}, Time = 20},
}                                     
}
in globalevents.xml add
Code:
    <globalevent name="AutomaticRaids" interval="1" event="script" value="automatic_raids.lua"/>
and in /globalevents/scripts/automatic_raids.lua add
Code:
local function removeCreature(t)
    for x = ((t.pos.fromPosition.x)-10), ((t.pos.toPosition.x)+10) do
        for y = ((t.pos.fromPosition.y)-10), ((t.pos.toPosition.y)+10) do
         local m = getTopCreature({x=x, y=y, z= t.pos.fromPosition.z}).uid
            if m ~= 0 and isMonster(m) then
                doRemoveCreature(m)
            end
        end
    end
end

function onThink(interval, lastExecution, thinkInterval) 
    if days[os.date("%A")] then 
      local tb = days[os.date("%A")][string.sub(os.date("%X"), 1, 5)]
        if tb then       
            removeCreature(tb)
            doBroadcastMessage("The invasion of " .. tb.nome .. " started")
            for _,x in pairs(tb.m) do
                for s = 1, tonumber(x:match("%d+")) do
                    print(tb.pos.toPosition.x, tb.pos.fromPosition.x)
                    print(tb.pos.toPosition.y, tb.pos.fromPosition.y)
                  local 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}
                    doCreateMonster(x:match("%s(.+)"), pos)
                end
            end
            addEvent(removeCreature, tb.Time*60*1000, tb)
        end
    end

    return true
end
and change things in the times etc and interval to whatever you want (1 = 1 second in interval)
 
At the end it is written.
and change things in the times etc and interval to whatever you want (1 = 1 second in interval)

<globalevent name="AutomaticRaids" interval="1" event="script" value="automatic_raids.lua"/>
 
At the end it is written.
and change things in the times etc and interval to whatever you want (1 = 1 second in interval)

<globalevent name="AutomaticRaids" interval="1" event="script" value="automatic_raids.lua"/>


I change IT to 1000 cuz i use tfs 0.4 but in config i set 1 boss, and this script spawn XXX bosses not only one\


.///edit

I tested it now, and this script dont spawn XXX bosses but he teleporting everytime one boss to start position and in console i have it

Code:
> Broadcasted message: "The invasion of Boss Of Aphel started".
1067
1067
1091
1091
 
Last edited:
Back
Top