Como Sempre com Ótimos Conteudos ! Segure meu REP ++
- Forums
- OTServ
- Recursos
- Linguagens de Programação
- [C ] Level System in monster [0.3.6]
[C ] Level System in monster [0.3.6]
By Deadpool, 25 de set. de 2016 in Linguagens de Programação
Parabéns, meninão :-)
info
Group: Campones
Joined: 14/02/07
Posts: 74
Reputation: +11
Gender: Masculino

Meu deus
top top top
info
Group: Campones
Joined: 17/06/09
Posts: 75
Reputation: +13
Gender: Masculino

Esse buga o GetMonsterInfo igual o do OneShot?
info
Group: Artesão
Joined: 28/03/16
Posts: 120
Reputation: +31
Gender: Masculino
Tibia Character: Stroozinho

Reputado...
Irei testar no meu OT!
info
Group: Visconde
Joined: 28/02/14
Posts: 416
Reputation: +90
Gender: Masculino

ow ta ai uma novidade no forum kkk parabens reputado
info
Group: Herói
Joined: 25/10/11
Posts: 2.2k
Reputation: +862
Gender: Masculino
Tibia Character: Sociopata

Em 25/09/2016 at 14:16, aleknpto disse:Como Sempre com Ótimos Conteudos ! Segure meu REP ++
Haha, tamo ai!
Em 25/09/2016 at 15:32, Oneshot disse:Parabéns, meninão :-)
awn, estou muito feliz com este comentario <3 editei, e removi algumas coisas, tipo.. o level system pega no summon tambem, e um amigo pediu pra eu coloca pra n mudar o nome do bixo, dai vou postar separado as atualizações
Em 25/09/2016 at 16:19, InsanityA disse:Meu deus
top top top
haha
Em 25/09/2016 at 16:31, klipstyle disse:Esse buga o GetMonsterInfo igual o do OneShot?
Sim, mas eu vou arrumar jaja e colocar como opção, caso você queira mudar ou nao o nome do bixo!
Em 25/09/2016 at 19:29, Str00per disse:Reputado...
Irei testar no meu OT!
haha, qualquer erro posta ai..
22 horas atrás, valakas disse:ow ta ai uma novidade no forum kkk parabens reputado
vlw, tmj kk
Será que isso funciona em OT de pokemon? pra só colocar pros monstros selvagens aparecerem com nível? haha seria uma boa ein msm assim rep+ :DD
Edited Novembro 2 by PuW
info
Group: Cavaleiro
Joined: 28/08/16
Posts: 172
Reputation: +3
Gender: Masculino
Tibia Character: Raskgames

@Deadpool achei que ja tinha parado com script no forum
info
Group: Campones
Joined: 05/04/18
Posts: 95
Reputation: +46
Gender: Masculino
Tibia Character: Deetrax

Em 02/11/2017 em 12:17, Raskgames disse:@Deadpool achei que ja tinha parado com script no forum
Este tópico foi postado em 2016
info
Group: Cavaleiro
Joined: 28/08/16
Posts: 172
Reputation: +3
Gender: Masculino
Tibia Character: Raskgames

2 minutos atrás, Walox disse:Este tópico foi postado em 2016
E essa pergunta foi 2017
info
Group: Campones
Joined: 05/04/18
Posts: 95
Reputation: +46
Gender: Masculino
Tibia Character: Deetrax

1 minuto atrás, Raskgames disse:E essa pergunta foi 2017
e esta resposta em 2018
info
Group: Cavaleiro
Joined: 28/08/16
Posts: 172
Reputation: +3
Gender: Masculino
Tibia Character: Raskgames

1 minuto atrás, Walox disse:e esta resposta em 2018
Não perguntei
info
Group: Banidos
Joined: 25/01/17
Posts: 108
Reputation: +76
Gender: Masculino
Tibia Character: Kyogron

Porque se comportar igual criança em um fórum? ambos estão discutindo por que? O tópico foi para postar algo sobre Pokémon e não para discussão.








info
Group: Herói
Joined: 25/10/11
Posts: 2.2k
Reputation: +862
Gender: Masculino
Tibia Character: Sociopata
Boa tarde, venho compartilhar o código feito por @Oneshot, com adaptação para tfs 0.3.6 (854). Bem, ele postou para tfs 0.4 (860), dai eu só mexi em umas linhas parar funcionar no tfs 0.3.6(854), dai vou compartilhar com vocês.
Com o monster level system, o monstro passa a ter level e ganha mais HP, dá mais dano, tem mais defesa, dependendo dele.monsters.h
procure por:
bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable, isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth;Substitua por:
bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable, isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth, hideLevel;Procure por:
int32_t defense, armor, health, healthMax, baseSpeed, lookCorpse, corpseUnique, corpseAction, maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities, lightLevel, lightColor, changeTargetSpeed, changeTargetChance;Substitua por:
int32_t defense, armor, health, healthMax, baseSpeed, lookCorpse, corpseUnique, corpseAction, maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities, lightLevel, lightColor, changeTargetSpeed, changeTargetChance, levelMin, levelMax;monsters.cpp
Procure por:
canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = hideName = hideHealth = false;Substitua por:
canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = hideName = hideHealth = hideLevel = false;Procure por:
baseSpeed = 200;Logo abaixo, adicione:
levelMin = levelMax = 1;Localize:
if(readXMLInteger(p, "max", intValue)) mType->healthMax = intValue; else { SHOW_XML_ERROR("Missing health.max"); monsterLoad = false; } }abaixo adicione:
else if(!xmlStrcmp(p->name, (const xmlChar*)"level")) { if(!readXMLInteger(p, "max", intValue)) mType->levelMax = 1; else mType->levelMax = intValue; if(!readXMLInteger(p, "min", intValue)) mType->levelMin = mType->levelMax; else mType->levelMin = intValue; }procure por:
if(readXMLString(tmpNode, "shield", strValue)) mType->partyShield = getPartyShield(strValue);logo baixo adicione:
if(readXMLString(tmpNode, "hidelevel", strValue)) mType->hideLevel = booleanString(strValue);Monster.h
Procure:
virtual ~Monster(); std::string name, nameDescription;abaixo adicione:
std::string name, nameDescription;int32_t level;double bonusAttack, bonusDefense;Procure:
virtual const std::string& getName() const {return mType->name;}virtual const std::string& getNameDescription() const {return mType->nameDescription;}virtual std::string getDescription(int32_t) const {return mType->nameDescription + ".";}Substitua por:
virtual const std::string& getName() const {return name;}virtual const std::string& getNameDescription() const {return nameDescription;}virtual std::string getDescription(int32_t) const {return nameDescription + ".";}Monster.cpp
Logo abaixo de:
isIdle = true;Adicione:
name = _mType->name;nameDescription = _mType->nameDescription;level = (int32_t)random_range(_mType->levelMin, _mType->levelMax, DISTRO_NORMAL);bonusAttack = 1.0;bonusDefense = 1.0;Procure por está função:
Monster::onCreatureAppearApague e coloque está função:
Substitua todos:
g_config.getDouble(ConfigManager::RATE_MONSTER_DEFENSE)Por:
g_config.getDouble(ConfigManager::RATE_MONSTER_DEFENSE) * bonusDefenseSubstitua todos:
g_config.getDouble(ConfigManager::RATE_MONSTER_ATTACK)Por:
g_config.getDouble(ConfigManager::RATE_MONSTER_ATTACK) * bonusAttackMap.cpp
Procure por:
#include "game.h"Adicione em baixo:
#include "configmanager.h"Procure por:
extern Game g_game;Adicione em baixo:
extern ConfigManager g_config;Procure por está função:
bool Map::placeCreature(const Position& centerPos, Creature* creature, bool extendedPos /*= false*/, bool forced /*= false*/){Abaixo do " { " adicione:
Monster* monster = creature->getMonster(); if(monster && g_config.getBool(ConfigManager::MONSTER_HAS_LEVEL)) { uint8_t level; if(!monster->getMonsterType()->hideLevel) { if(monster->isSummon()) { std::string value;// monster->getMaster()->getStorage((uint32_t)"1996", value); monster->getMaster()->getStorage((uint32_t)"1996", value); uint8_t intValue = atoi(value.c_str()); if(intValue || value == "0") level = intValue; else level = 1; } else level = monster->level; char buffer [10]; monster->name = monster->getName() + " [" + itoa(level, buffer, 10) + "]"; } }configmanager.h
Procure por:
ADDONS_PREMIUM,e abaixo adicione logo em baixo:
MONSTER_HAS_LEVEL,configmanager.cpp
procure por:
m_confBool[ADDONS_PREMIUM] = getGlobalBool("addonsOnlyPremium", true);e logo em baixo adicione:
m_confBool[MONSTER_HAS_LEVEL] = getGlobalBool("monsterHasLevel", true);no Config.lua adicione:
monsterHasLevel = true -- true para monstros nascerem com level, false para não nascerem com levelSão muitas modificações para fazer, mas o resultado é garantido e é uma funcionalidade a mais para seu servidor.
Como está programado, a cada level, monstros ganham 10% de HP, 1% de dano e 0.5% de defesa.
Para configurar level mínimo e máximo, é só adicionar no XML do monstro:
E alterar a seu gosto.
Se você fizer certo irá ficar assim:
Créditos:
@Oneshot
Edited Setembro 25 by Deadpool