• 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.4 monster overspawn

Competitibia

Pain & Glory WHole
Joined
Apr 1, 2021
Messages
545
Solutions
3
Reaction score
210
C++:
bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup /*= false*/)
{
    Monster* monster = Monster::createMonster(mType);
    if(!monster)
        return false;

    if(startup)
    {
        //No need to send out events to the surrounding since there is no one out there to listen!
        if(!g_game.internalPlaceCreature(monster, pos, false, true))
        {
            delete monster;
            return false;
        }
    }
    else if(!g_game.placeCreature(monster, pos, false, true))
    {
        delete monster;
        return false;
    }

    monster->setSpawn(this);
    monster->setMasterPosition(pos, radius);
    monster->setDirection(dir);

    monster->addRef();
    spawnedMap.insert(SpawnedPair(spawnId, monster));
    spawnMap[spawnId].lastSpawn = OTSYS_TIME();
    return true;
}

where can i put a check if monster that spawned within its master radius is still present within that are and if not spawn him again if the spawn time passed? (so people can lure monsters and they still spawn)
 
Back
Top