Postado Julho 31, 2015 9 anos 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: Obrigado pela atenção! Ajudei ? Resp+ Assim o Tibia King vai crescer rsrs.
Postado Julho 31, 2015 9 anos Faça isso nas sources: http://www.tibiaking.com/forum/topic/53496-monstros-focando-summons/ Se te ajudei, deixe seu curti, clique em melhor resposta, para que eu possa ajudar sempre. 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. At Soon, LIKE ON FACEBOOK. Clik on Imgs
Postado Julho 31, 2015 9 anos 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 Julho 31, 2015 9 anos por xXJuninho (veja o histórico de edições) Ajudei ? Resp+ Assim o Tibia King vai crescer rsrs.
Postado Julho 31, 2015 9 anos 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 Julho 31, 2015 9 anos 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.