silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 211
hello folks, then I'm here to ask something about the respawn, you know that in the tibia global the spawn of monster can be different.
different how ?
exemple: have a spawn with 2 monsters, 1 minotaur and 1 minotaur archer
each monster have ur own position to spawn right?
then, sometimes in the place of the minotaur can be spawned a minotaur archer
or the inverse, I want to implement it, to make my respawn random with the monsters that are in the spawn area
seems that is here:
So I need some help with this
different how ?
exemple: have a spawn with 2 monsters, 1 minotaur and 1 minotaur archer
each monster have ur own position to spawn right?
then, sometimes in the place of the minotaur can be spawned a minotaur archer
or the inverse, I want to implement it, to make my respawn random with the monsters that are in the spawn area
seems that is here:
Code:
bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, bool startup /*= false*/)
{
std::unique_ptr<Monster> monster_ptr(new Monster(mType));
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_ptr.get(), pos, true)) {
return false;
}
} else {
if (!g_game.placeCreature(monster_ptr.get(), pos, false, true)) {
return false;
}
}
Monster* monster = monster_ptr.release();
if (!g_events->eventMonsterOnSpawn(monster)) {
return false;
}
monster->setDirection(dir);
monster->setSpawn(this);
monster->setMasterPos(pos);
monster->incrementReferenceCounter();
spawnedMap.insert(spawned_pair(spawnId, monster));
spawnMap[spawnId].lastSpawn = OTSYS_TIME();
return true;
}