[OTX 0.3.6] Respawn Com Efeito (Tibia RL)
em 27/1/2018, 21:04
Fala galera bom eu achei um código na otland que ao iniciar o tempo de respawn de um monstro no mapa mostra um efeito antes umas 3 vezes avisando e nasce o monstro igual ao tibia normal bom eu consegui colocar na minha source otx 0.3.6 e estou aqui para compartilhar com todos vocês vamos aos códigos na sua source.
Procure as bibliotecas
Em Spawn.cpp
Procure por:
E substitua o código todo por:
OBS: Onde está em negrito é a área para editar o efeito que vai aparecer quando o monstro for nascer.
Procure por:
Neste código mude:
Para:
Procure por:
Logo acima desse código vai ter:
Mude para:
Em spawn.h:
Procure por:
Substitua por:
Pronto, seja feliz!
Vídeo demonstrativo:
Créditos:
Treta20 (Otland)
Procure as bibliotecas
Em Spawn.cpp
Procure por:
- Spoiler:
- bool Spawn::spawnMonster(uint32_t spawnId, MonsterType* mType,
E substitua o código todo por:
- Spoiler:
- 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_EFEITO87);
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;
}
OBS: Onde está em negrito é a área para editar o efeito que vai aparecer quando o monstro for nascer.
Procure por:
- Spoiler:
- void Spawn::startup()
Neste código mude:
- Spoiler:
- spawnMonster(it->first, sb.mType, sb.pos, sb.direction, true);
Para:
- Spoiler:
- spawnMonster(it->first, sb.mType, sb.pos, sb.direction, false);
Procure por:
- Spoiler:
- if(spawnCount >= (uint32_t)g_config.getNumber(ConfigManager::RATE_SPAWN))
Logo acima desse código vai ter:
- Spoiler:
- spawnMonster(it->first, sb.mType, sb.pos, sb.direction);
Mude para:
- Spoiler:
- spawnMonster(it->first, sb.mType, sb.pos, sb.direction, 4200);
Em spawn.h:
Procure por:
- Spoiler:
- bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir ,bool startup = false);
Substitua por:
- Spoiler:
- bool spawnMonster(uint32_t spawnId, MonsterType* mType, const Position& pos, Direction dir, int16_t t,bool startup = false);
Pronto, seja feliz!
Vídeo demonstrativo:
Créditos:
Treta20 (Otland)
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum
|
|