Ir para conteúdo

Featured Replies

Postado

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

Ex. TFS 1.3;

Base: 

1.3

 

Qual erro está surgindo/O que você procura?

Alguem ajuda a adaptar esse sistema para tfs 1.3

 

Você tem o código disponível? Se tiver publique-o aqui:

monsters.h

Spoiler
Código (C ++):
  1. bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable,
  2. isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth ;

Substituir com:

 

Código (C ++):
  1. bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable,
  2. isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth, hideLevel ;
Procurar por:

 

Código (C ++):
  1. int32_t defesa, armadura, saúde, saúdeMax, baseSpeed, lookCorpse, cadseUnique, corpseAction,
  2. maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities,
  3. lightLevel, lightColor, changeTargetSpeed, changeTargetChance ;
Substituir com:

 

Código (C ++):
  1. int32_t defesa, armadura, saúde, saúdeMax, baseSpeed, lookCorpse, cadseUnique, corpseAction,
  2. maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities,
  3. lightLevel, lightColor, changeTargetSpeed, changeTargetChance, levelMin, levelMax ;

monsters.cpp

Spoiler

Procurar por:

Código (C ++):
  1. canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = ocultarName = ocultarHealth = false ;

Substituir com:

 

Código (C ++):
  1. canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = ocultarName = ocultarSaúde = ocultarNível = falso ;
Procurar por:

 

Código (C ++):
  1. baseSpeed = 200 ;
Abaixo, adicione:

 

Código (C ++):
  1. levelMin = levelMax = 1 ;
Encontre:

 

Código (C ++):
  1. bool Monstros :: loadMonster
Dentro da função, procure por:

 

Código (C ++):
  1. para ( xmlNodePtr p = root - > filhos ; p ; p = p - > próximo )
  2.     {
  3.         if ( p - > tipo ! = XML_ELEMENT_NODE )
  4.             continue ;
  5.  
  6.         if ( ! xmlStrcmp ( p - > nome, ( const xmlChar * ) "saúde" ) )
  7.         {
  8.             if ( ! readXMLInteger ( p, "max" , intValue ) )
  9.             {
  10.                 SHOW_XML_ERROR ( " Health.max em falta" ) ;
  11.                 monsterLoad = false ;
  12.                 pausa ;
  13.             }
  14.  
  15.             mType - > healthMax = intValue ;
  16.             if ( ! readXMLInteger ( p, "agora" , intValue ) )
  17.                 mType - > health = mType - > healthMax ;
  18.             outro
  19.                 mType - > health = intValue ;
  20.         }
Abaixo, adicione:

 

Código (C ++):
  1. else if ( ! xmlStrcmp ( p - > nome, ( const xmlChar * ) "nível" ) )
  2.         {
  3.             if ( ! readXMLInteger ( p, "max" , intValue ) )
  4.                 mType - > levelMax = 1 ;
  5.             outro
  6.                 mType - > levelMax = intValue ;
  7.  
  8.             if ( ! readXMLInteger ( p, "min" , intValue ) )
  9.                 mType - > levelMin = mType - > levelMax ;
  10.             outro
  11.                 mType - > levelMin = intValue ;
  12.         }
Procurar por:

 

Código (C ++):
  1. if ( readXMLString ( tmpNode, "emblema" , strValue ) )
  2.     mType - > guildEmblem = getEmblems ( strValue ) ;
Abaixo, adicione:

 

Código (C ++):
  1. if ( readXMLString ( tmpNode, "hidelevel" , strValue ) )
  2.         mType - > hideLevel = booleanString ( strValue ) ;

monster.h

Spoiler

Encontre:

Código (C ++):
  1. Classe Monstro : Criatura pública
  2. {

Logo abaixo:

 

Código (C ++):
  1.     público :
  2. #ifdef __ENABLE_SERVER_DIAGNOSTIC__
  3.         static uint32_t monsterCount ;
  4. #fim se
  5.         virtual ~ Monster ( ) ;
Adicionar:

 

Código (C ++):
  1. std :: string name, nameDescription ;
  2. int32_t level ;
  3. double bonusAttack, bonusDefense ;
Substituir:

 

Código (C ++):
  1. virtual const std :: string & getNome ( ) const { return mType - > nome ; }
  2. virtual const std :: string & getNameDescription ( ) const { retornar mType - > nomeDescrição ; }
  3. virtual std :: string getDescription ( int32_t ) const { retornar mType - > nameDescription + "." ; }
Por:

 

Código (C ++):
  1. Const virtual std :: string & getName ( ) const { nome do retorno ; }
  2. Virtual const std :: corda & getNameDescription ( ) const { retornar nameDescription ; }
  3. Virtual std :: string de getDescription ( int32_t ) const { return nameDescription + "" ; }

monster.cpp

Spoiler

Procurar por:

Código (Texto):
  1. Monstro :: Monstro (MonsterType * _mType):

Logo abaixo:

 

Código (C ++):
  1. isIdle = true ;
Adicionar:

 

Código (C ++):
  1. name = _mType - > name ;
  2. nameDescription = _mType - > nameDescription ;
  3. level = ( int32_t ) random_range ( _mType - > levelMin, _mType - > levelMax, DISTRO_NORMAL ) ;
  4. bonusAttack = 1,0 ;
  5. bonusDefense = 1,0 ;
Procurar por:

 

Código (C ++):
  1. Monstro :: onCreatureAppear
Substitua a função inteira por:

 

Código (C ++):
  1. vazio Monstro :: onCreatureAppear ( const Criatura * criatura )
  2. {
  3.     Criatura :: onCreatureAppear ( criatura ) ;
  4.     if ( criatura == isso )
  5.     {
  6.         // Acabamos de gerar vamos olhar em volta para ver quem está lá.
  7.         if ( isSummon ( ) )
  8.         {
  9. valor             std :: string ;
  10.             this - > master - > getStorage ( ( std :: string ) "nível_superior" , valor ) ;
  11.  
  12.             uint8_t intValue = atoi ( valor. c_str ( ) ) ;
  13.             if ( intValue || valor == "0" )
  14.                 level = intValue ;
  15.             outro
  16.                 nível = 1 ;
  17.             isMasterInRange = canSee ( master - > getPosition ( ) ) ;
  18.         }
  19.  
  20.         if ( g_config. getBool ( ConfigManager :: MONSTER_HAS_LEVEL ) )
  21.         {
  22.             este - > healthMax = std :: andar ( este - > getMaxHealth ( ) * ( 1 . + ( 0,1 * ( nível - 1 ) ) ) ) ;
  23.             isso - > saúde = isso - > healthMax ;
  24.  
  25.             this - > bonusAttack + = ( 0,01 * ( nível - 1 ) ) ;
  26.             isto - > bonusDefense + = ( 0.005 * ( level - 1 ) ) ;
  27.         }
  28.  
  29.  
  30.  
  31.         updateTargetList ( ) ;
  32.         updateIdleStatus ( ) ;
  33.     }
  34.     outro
  35.         onCreatureEnter ( const_cast < Criatura * > ( criatura ) ) ;
  36. }
Substitua tudo:

 

Código (C ++):
  1. g_config. getDouble ( ConfigManager :: RATE_MONSTER_DEFENSE )
Por:

 

Código (C ++):
  1. g_config. getDouble ( ConfigManager :: RATE_MONSTER_DEFENSE ) * bonusDefense
Substitua tudo:

 

Código (C ++):
  1. g_config. getDouble ( ConfigManager :: RATE_MONSTER_ATTACK )
Por:

 

Código (C ++):
  1. g_config. getDouble ( ConfigManager :: RATE_MONSTER_ATTACK ) * bonusAttack

map.cpp

Spoiler

Procurar por:

Código (C ++):
  1. #include "game.h"

Adicionar:

 

Código (C ++):
  1. #include "configmanager.h"
Procurar por:

 

Código (C ++):
  1. extern Jogo g_game ;
Adicione abaixo:

 

Código (C ++):
  1. extern ConfigManager g_config ;
Procure a função:

 

Código (C ++):
  1. bool Map :: placeCreature
  2. {
Adicione logo depois:

 

Código (C ++):
  1.  Monstro * monstro = criatura - > getMonster ( ) ;
  2.     if ( monstro && g_config. getBool ( ConfigManager :: MONSTER_HAS_LEVEL ) )
  3.     {
  4.         nível uint8_t ;
  5.         if ( ! monstro - > getMonsterType ( ) - > hideLevel )
  6.         {
  7.             if ( monstro - > isSummon ( ) )
  8.             {
  9. valor                 std :: string ;
  10.                 monstro - > getMaster ( ) - > getStorage ( ( std :: string ) "nível_de_superficial" , valor ) ;
  11.  
  12.                 uint8_t intValue = atoi ( valor. c_str ( ) ) ;
  13.                 if ( intValue || valor == "0" )
  14.                     level = intValue ;
  15.                 outro
  16.                     nível = 1 ;
  17.             }
  18.             outro
  19.                 nível = monstro - > nível ;
  20.  
  21.             buffer de caracteres [ 10 ] ;
  22.             monstro - > nome = monstro - > getName ( ) + "[" + itoa ( nível, buffer, 10 ) + "]" ;
  23.         }
  24.     }

configmanager.h

Spoiler

Procurar por:

Código (C ++):
  1. MONSTER_SPAWN_WALKBACK,

E adicione abaixo:

 

Código (C ++):
  1. MONSTER_HAS_LEVEL,

configmanager.cpp

Spoiler

Procurar por:

Código (C ++):
  1. m_loaded = true ;

Adicione um pouco antes:

 

Código (C ++):
  1. m_confBool [ MONSTER_HAS_LEVEL ] = getGlobalBool ( "monsterHasLevel" , true ) ;

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

  • Respostas 5
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
15 horas atrás, FlavioHulk disse:

Cara, essa feature é do Static, esse sistema funciona perfeitamente no TFS 1.3

errado já logo de cara no monster.h essas linhas não existe no 1.3

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo