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)