samuel157
/root
- Joined
- Mar 19, 2010
- Messages
- 518
- Solutions
- 3
- Reaction score
- 71
- Location
- São Paulo, Brazil
- GitHub
- Samuel10M
Code: spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
Code:
bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
---> Whats And Remove the Player Checker???
C++:
bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,
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 (t == 0)
{
if (!g_game.placeCreature(monster, pos, false, true))
{
delete monster;
return false;
}
}
else {
g_game.addMagicEffect(pos, MAGIC_EFFECT_TELEPORT);
Scheduler::getInstance().addEvent(createSchedulerTask(
1400, boost::bind(&Spawn::spawnMonster, this, spawnId, mType, pos, dir, t - 1400,false)));
return true;
}
monster->setSpawn(this);
monster->setMasterPosition(pos, radius);
monster->setDirection(dir);
monster->addRef();
spawnedMap.insert(SpawnedPair(spawnId, monster));
spawnMap[spawnId].lastSpawn = OTSYS_TIME();
return true;
}
Code:
bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
---> Whats And Remove the Player Checker???