• 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 1.X+ Spawntimes stack on one another

Dip Set

Veteran OT User
Joined
Dec 27, 2007
Messages
405
Solutions
2
Reaction score
369
So i noticed something very strange, not too sure if it's a me issue or a TFS 1.3 issue.
Using Nekiro 7.72 TFS 1.3+ downgrade heavily modified.
The problem:
If i go to this spawn for example
XML:
    <spawn centerx="32839" centery="32014" centerz="9" radius="1">
        <monster name="Bug" x="-1" y="-1" z="9" spawntime="60" />
        <monster name="Bug" x="1" y="-1" z="9" spawntime="60" />
        <monster name="Troll" x="0" y="0" z="9" spawntime="60" />
    </spawn>
and I kill all the monsters (with a ultimate explosion for example)
60 seconds later the first bug will spawn
120 seconds later, the second bug will spawn
180 seconds later, the troll will spawn


Every spawn is like this, very strange, has anyone else had this issue?
 
I’ll try it and let you know, thanks!
-- Update, no, that actually had nothing to do with it, I think this is a source error. I will look into spawn.cpp etc.
Thank you for trying though
Post automatically merged:

UPDATE- FIXED
The issue is actually in spawn.h source file.

Lua:
class Spawn
{
    public:
        Spawn(Position pos, int32_t radius) : centerPos(std::move(pos)), radius(radius) {}
        ~Spawn();

        // non-copyable
        Spawn(const Spawn&) = delete;
        Spawn& operator=(const Spawn&) = delete;

        bool addMonster(const std::string& name, const Position& pos, Direction dir, uint32_t interval);
        void removeMonster(Monster* monster);

        uint32_t getInterval() const {
            return interval;
        }
        void startup();

        void startSpawnCheck();
        void stopEvent();

        bool isInSpawnZone(const Position& pos);
        void cleanup();

    private:
        //map of the spawned creatures
        using SpawnedMap = std::multimap<uint32_t, Monster*>;
        using spawned_pair = SpawnedMap::value_type;
        SpawnedMap spawnedMap;

        //map of creatures in the spawn
        std::map<uint32_t, spawnBlock_t> spawnMap;

        Position centerPos;
        int32_t radius;

        uint32_t interval = 60000; //this is the spawn interval between monsters within the same spawn
        uint32_t checkSpawnEvent = 0;

        static bool findPlayer(const Position& pos);
        bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup = false);
        void checkSpawn();
};
Line 37 unit32_t interval = 60000 <- that controls spawn time BETWEEN monsters within the same spawn flame.
so I just changed to
unit32_t interval = 0

Now after spawntime in spawns.xml, they will all respawn at the same time.
 
Last edited:
Back
Top