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

Monster does not Respawn.

chucky91

Active Member
Joined
Apr 8, 2010
Messages
81
Reaction score
47
I'm having a problem with respawn, for example: the Black Knight even placing it at 12 sqm away from the afk player is not reappear.
Only if I go further there will it reappear.
Config.lua Nostalrius 7.4
-- Monsters
deSpawnRange = 2
deSpawnRadius = 0
 

Terotrificy

Well-Known Member
Joined
Oct 18, 2020
Messages
251
Solutions
9
Reaction score
89
Location
Santiago, Chile.
To modify the monster view (range in which monster will attack you if respawn) you need to edit map.h, this lines:


C++:
    static const int32_t maxViewportX = 10;        //here you set x sqms of monster sight to west-east, counting the standing position as 0
    static const int32_t maxViewportY = 10;        //here you set x sqms of monster sight to north-south, counting the standing position as 0
    static const int32_t maxClientViewportX = 8;
    static const int32_t maxClientViewportY = 6;

And for set the distance at where the monster respawn, you must edit this line in spawn.cpp:


C++:
bool Spawn::findPlayer(const Position& pos)
{
    SpectatorVec list;
    SpectatorVec::iterator it;
    g_game.getSpectators(list, pos, false, false, 7+1/*WEST*/, 7+2/*EAST*/ , 5+1 /*NORTH*/, 5+2/*SOUTH*/);  //Here you edit the area in sqms where if the player stands monster can't spawn

    Player* tmpPlayer = NULL;
    for(it = list.begin(); it != list.end(); ++it) {
        if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->hasFlag(PlayerFlag_IgnoredByMonsters)){
            return true;
        }
    }

    return false;
}

That way, you can wait Black Knight and once the monster spawn, you will notice because the monster will enter on screen to attack you.

Ps: I use Othire but i think you have the same or at least similar sources than me.
 
Top