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

C++ monster spawn in different place not on players

3688599

Darkness-babek.no-ip.org
Joined
Mar 23, 2013
Messages
92
Reaction score
12
Location
EGYPT
HELP !

i have problem when monster spawn he goes down in the same place where the player is standing .. all just i need when the monster comes down it descends in a different place than the place in which the player stands

I turn : allowBlockSpawn = false : to spawn and there are people in the area

C++:
bool Spawn::addMonster(const std::string& _name, const Position& _pos, Direction _dir, uint32_t _interval)
{
    if(!g_game.getTile(_pos))
    {
        std::clog << "[Spawn::addMonster] NULL tile at spawn position (" << _pos << ")" << std::endl;
        return false;
    }

    MonsterType* mType = g_monsters.getMonsterType(_name);
    if(!mType)
    {
        std::clog << "[Spawn::addMonster] Cannot find \"" << _name << "\"" << std::endl;
        return false;
    }

    if(_interval < interval)
        interval = _interval;

    spawnBlock_t sb;
    sb.mType = mType;
    sb.pos = _pos;
    sb.direction = _dir;
    sb.interval = _interval;
    sb.lastSpawn = 0;

    uint32_t spawnId = (int32_t)spawnMap.size() + 1;
    spawnMap[spawnId] = sb;
    return true;
}
i think in this line !
 
Last edited:
Top