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

Lua Please someone explains raids.xml to me (in detail)

Fermantor

Active Member
Joined
Dec 16, 2009
Messages
209
Solutions
4
Reaction score
33
Location
Germany
So I want to use random monster spawns on my server. But it is a small populated server, so severall spawns each day, would be way too much. So I just want to have out of a list of 10 bosses, 1-3 spawns each day.
Now, how do I make this.
What I got so far is this:
Code:
<raid name="Feverish" file="feverish.xml" interval2="1440" margin="540"/>
"Name" and "file" are self explaining.
"interval2" is said to be the average execution between two raids in minutes.
"margin" is not explained anywhere, not even in the code. But I guess, it is the minimum wait time, before the raid goes off (again, this is just a guess, and I would please someone, to tell me, if I'm right, or what it is meant to be)

Another question, what I have is, are raid executions saved somewhere (I haven't found something in the DB, so I guess not), because if you put something like 100 000 there, which is much more than a day, is it executed every 69 days? Even when the server shuts down each server safe?

I hope someone can give me a little light into this ^^

P.s.: I am using TFS 0.2.14 if this is important, as I guess raids haven't changed in a long time
 
Dunno which server your using but my distro works like this...interval is the average interval between 2 executions of the raid in minutes, as for margin it is in the code lol The margin is time added after the last raid end... btw margin in source is multiplied by 60
Code:
    for(RaidList::iterator it = raidList.begin(); it != raidList.end(); ++it){
            if(now >= (getLastRaidEnd() + ((*it)->getMargin() * 1000) )){
                if(MAX_RAND_RANGE*CHECK_RAIDS_INTERVAL/(*it)->getInterval() >= (uint32_t)random_range(0, MAX_RAND_RANGE)){
#ifdef __DEBUG_RAID__
                    char buffer[32];
                    time_t tmp = std::time(NULL);
                    formatDate(tmp, buffer);
                    std::cout << buffer << " [Notice] Raids: Starting raid " << (*it)->getName() << std::endl;
#endif
                    setRunning(*it);
                    (*it)->startRaid();
                    break;
                }
 
So I want to use random monster spawns on my server. But it is a small populated server, so severall spawns each day, would be way too much. So I just want to have out of a list of 10 bosses, 1-3 spawns each day.
Another question, what I have is, are raid executions saved somewhere (I haven't found something in the DB, so I guess not), because if you put something like 100 000 there, which is much more than a day, is it executed every 69 days? Even when the server shuts down each server safe?
No, the server will count 69 days from start and then execute your raid (considering the margin stuff), but if you close the server prior to the raid happening it will never run.

I have patched the most recent version of TFS to have Lua-scripted raids instead of that XML file, check it: https://github.com/ranisalt/forgottenserver/tree/bye-bye-raids/data that way you can trigger a raid virtually whenever you want and be much more flexible about it.
But you will have to update your server version to the more modern available.
 
I have patched the most recent version of TFS to have Lua-scripted raids instead of that XML file, check it: ranisalt/forgottenserver (https://github.com/ranisalt/forgottenserver/tree/bye-bye-raids/data) that way you can trigger a raid virtually whenever you want and be much more flexible about it.
But you will have to update your server version to the more modern available.

I'm curious what server versions support this lua raid file? I want the flexibility. I'm working with a modified TFS 1.3 and still using the XML file.
 
Back
Top