Ir para conteúdo

Featured Replies

Postado

Estava testando um projeto meu, e me deparei com um Bug que nunca tinha visto e fiquei com bastante dificuldade em arruma-lo então preciso da ajuda de vocês.. 

 

BUG: Quando encontro um pokémon selvagem com o pokémon para fora, ao invés de ele atacar meu pokémon ele ataca a mim, porém tira sangue do meu pokémon.. Está meio complicado de se entender, por isso tirei este print:

 

NP9sDEt.png

 

Obrigado pela atenção!

Ajudei ? Resp+ :D

Assim o Tibia King vai crescer rsrs.

Postado

Se te ajudei, deixe seu curti, clique em melhor resposta, para que eu possa ajudar sempre.

 

skype.png

Trabalhos (C++):

Cor das mensagens nos channels

Ajusta/Mudar cor das mensagens de Loot

Liberação dos novos Remakes da PokeXGames.

NPC "Guild Master" que cria, deleta, invita, kicka players da guild.

 

 B4OBUkH.png At Soon, LIKE ON FACEBOOK. Clik on Imgs

Postado
  • Autor

Tentei não funcionou, mas percebi que nas minhas sources não tinha o seguinte:

    if(!isHostile() && getHealth() == getMaxHealth() && !isSummon()){

        return false;


    }

E no tutorial pediu para colocar isso embaixo de 

if(!isHostile() && getHealth() == getMaxHealth() && !isSummon()){

        return false;


    }

que fica abaixo de

bool Monster::selectTarget(Creature* creature)

Porém abaixo deste código tem apenas

 

#ifdef __DEBUG__
std::cout << "Selecting target... " << std::endl;
#endif
if(!isTarget(creature))
return false;
 
CreatureList::iterator it = std::find(targetList.begin(), targetList.end(), creature);
if(it == targetList.end())
{
//Target not found in our target list.
#ifdef __DEBUG__
std::cout << "Target not found in targetList." << std::endl;
#endif
return false;
}

Editado por xXJuninho (veja o histórico de edições)

Ajudei ? Resp+ :D

Assim o Tibia King vai crescer rsrs.

Postado

 

Tentei não funcionou, mas percebi que nas minhas sources não tinha o seguinte:

    

if(!isHostile() && getHealth() == getMaxHealth() && !isSummon()){

        return false;

    }

E no tutorial pediu para colocar isso embaixo de 

if(!isHostile() && getHealth() == getMaxHealth() && !isSummon()){

        return false;

    }

que fica abaixo de

bool Monster::selectTarget(Creature* creature)

Porém abaixo deste código tem apenas

 

#ifdef __DEBUG__
std::cout << "Selecting target... " << std::endl;
#endif
if(!isTarget(creature))
return false;
 
CreatureList::iterator it = std::find(targetList.begin(), targetList.end(), creature);
if(it == targetList.end())
{
//Target not found in our target list.
#ifdef __DEBUG__
std::cout << "Target not found in targetList." << std::endl;
#endif
return false;
}

 

Eu tinha o mesmo bug e adicionei nas Sources e funcionou direitinho, Da para fazer uma Gambiarra em Script mais isso era para ser feito nas Sources , Cria um Arquivo Chamado "Atk.lua" em data/creaturescripts:

function onAttack(cid, target)

if not isCreature(cid) then

return false

end

if isPlayer(target) then

if #getCreatureSummons(target) >= 1 then

doMonsterSetTarget(cid, getCreatureSummons(target)[1])

end

end

return true

end

- XML: <event type="attack" name="atacar" event="script" value="atk.lua"/>

 

Para Facilitar se voce tem o Sistema de Respawn de Shiny é so Voce registrar na função "onSpawn(cid)":

registerCreatureEvent(cid, "atacar")

 

- Caso voce nao tenha a Função "onSpawn(cid)" Voce tera que registrar no Login.lua e adicionar o Event em cada Pokemon assim:

    <script>
        <event name="atacar"/>
    </script>

Editado por Nextbr (veja o histórico de edições)


 

 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo