spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
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;
}...
spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
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;
}
bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
noway u are my love work 100%Code:spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
Code: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; }
And Remove the Player CheckerCode:bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
Code:spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
Code: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; }
And Remove the Player CheckerCode:bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
Scheduler::getInstance().addEvent(createSchedulerTask(
x, boost::bind(&Spawn::spawnMonster, this, spawnId, mType, pos, dir, t - x,false)));
Please create your own thread about receiving help, in Support board.Hello tetra20 ,
You can help me please?
spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
This phrase and script is added in what archive? spawn.cpp?