• 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!

Raid on tfs 1.2 system

Piifafa

Member
Joined
Apr 16, 2023
Messages
67
Reaction score
16
Hello everyone, I have my raids working, but I would like them to be somehow set for specific days to happen during the week. In my case my raids happen randomly but almost all the time. I'll show you how I ended up doing it.


Lua:
    <raid name="yurotscaverats" repeat="true" margin="60" interval2="600" file="yurotscaverats.xml"/>


Lua:
<?xml version="1.0" encoding="UTF-8"?>
<raid>
    <announce delay="10000" type="event" message="Rat plague in Yurots!"/>
    <areaspawn delay="10000" radius="7" centerx="5976" centery="6050" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="20000" radius="7" centerx="5980" centery="6056" centerz="6">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="25000" radius="7" centerx="5963" centery="6051" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="30000" radius="7" centerx="5976" centery="6043" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="35000" radius="7" centerx="5976" centery="6034" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="40000" radius="7" centerx="5971" centery="6029" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="45000" radius="7" centerx="5960" centery="6030" centerz="6">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="50000" radius="7" centerx="5982" centery="6031" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="55000" radius="7" centerx="5989" centery="6030" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="60000" radius="7" centerx="5996" centery="6030" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="65000" radius="7" centerx="6013" centery="6032" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="70000" radius="7" centerx="6019" centery="6025" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="75000" radius="7" centerx="6021" centery="6040" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="80000" radius="7" centerx="6021" centery="6050" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="85000" radius="7" centerx="6010" centery="6050" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="90000" radius="7" centerx="6032" centery="6049" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="95000" radius="7" centerx="6032" centery="6065" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="100000" radius="7" centerx="6023" centery="6067" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
    <areaspawn delay="105000" radius="7" centerx="6021" centery="6081" centerz="7">
        <monster name="cave rat" minamount="20" maxamount="30"/>
    </areaspawn>
</raid>
 
It's up to you, use onTime or onThink and somehow organize it whatever you like.
Example:
XML:
<globalevent name="Rats" time="04:00:00" script="rat_raid.lua" />
Lua:
local days = { 'Monday', 'Sunday' }

function onTime(interval)
    local day = os.date('%A')
    if table.contains(days, day) then
        Game.startRaid('yurotscaverats')
    end

    return true
end

Or implement some event that's called every X seconds that checks which raid to execute (at what time/day or after X minutes since last execution).
 
But do I need to have it registered as a raid?

I would like to better understand how this works.
Lua:
 <raid name="yurotscaverats" repeat="true" margin="60" interval2="600" file="yurotscaverats.xml"/>
 
this I want to understand, but do I need to have the script inside the raid folder added? and connected to the tag? Because it turns out that it can be run randomly then no?
 
@Piifafa Yes you need to register raid to execute it, thought that's obvious part.
Just try and see, I didn't even tried to run that script, it's POC.
Set some high interval2 and margin to make sure it won't be called via raids logic.
There's some attribute repeat to prevent it being called more than once (via raids).
 
Back
Top