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

onSpawn execute on startup?

Looking at spawn.cpp -
Code:
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([B]startup[/B])
	{
[B]		[COLOR="#006400"]//No need to send out events to the surrounding since there is no one out there to listen![/COLOR]
		if(!g_game.internalPlaceCreature(monster, pos, false, true))
		{
			delete monster;
			return false;
		}[/B]
	}
	else
	{
		if(!g_game.placeCreature(monster, pos, false, true))
		{
			delete monster;
			return false;
		}
	}

	monster->setSpawn(this);
	monster->addRef();

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

	spawnedMap.insert(SpawnedPair(spawnId, monster));
	spawnMap[spawnId].lastSpawn = OTSYS_TIME();
	return true;
}
Would it make a difference if startup was false when starting up the server :p?
 
Back
Top