Jump to content

sunnyqeen

Members
  • Posts

    3
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

About sunnyqeen

  • Birthday 01/01/1

sunnyqeen's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. PlayerbotAI fix: If the player is unmounted, when add a mounted bot, the bot will not change it's mounted status. If the player and bots are mounted, and the bots is under attacked, the bot will stoped following the player. diff --git a/src/game/playerbot/PlayerbotAI.cpp b/src/game/playerbot/PlayerbotAI.cpp index 12d9dbb..40c45b3 100644 --- a/src/game/playerbot/PlayerbotAI.cpp +++ b/src/game/playerbot/PlayerbotAI.cpp @@ -2827,14 +2827,25 @@ void PlayerbotAI::UpdateAI(const uint32 p_time) m_spellIdCommand = 0; m_targetGuidCommand = 0; } + + //if master is unmounted, unmount the bot + else if (!GetMaster()->IsMounted() && m_bot->IsMounted()) + { + WorldPacket emptyPacket; + m_bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); //updated code + } // handle combat (either self/master/group in combat, or combat state and valid target) else if (IsInCombat() || (m_botState == BOTSTATE_COMBAT && m_targetCombat)) - { - if (!pSpell || !pSpell->IsChannelActive()) - DoNextCombatManeuver(); - else - SetIgnoreUpdateTime(1); // It's better to update AI more frequently during combat + { + //check if the bot is Mounted + if (!m_bot->IsMounted()) + { + if (!pSpell || !pSpell->IsChannelActive()) + DoNextCombatManeuver(); + else + SetIgnoreUpdateTime(1); // It's better to update AI more frequently during combat + } } // bot was in combat recently - loot now else if (m_botState == BOTSTATE_COMBAT)
  2. Hi blueboy, Thanks for your attention. I will have a try.
  3. Fix for the bot flight. Bots will automatically learn the new flight places when master goes to speek to the flight guy. Currently bots will automatically learn the new flight places only when master start flying. diff --git a/src/game/playerbot/PlayerbotMgr.cpp b/src/game/playerbot/PlayerbotMgr.cpp index f55d2c2..d56d39f 100644 --- a/src/game/playerbot/PlayerbotMgr.cpp +++ b/src/game/playerbot/PlayerbotMgr.cpp @@ -398,9 +398,67 @@ void PlayerbotMgr::HandleMasterIncomingPacket(const WorldPacket& packet) } } break; + + case CMSG_TAXIQUERYAVAILABLENODES: + { + WorldPacket p(packet); + p.rpos(0); // reset reader + ObjectGuid npcGUID; + p >> npcGUID; + + Creature *pNpc = m_master->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_FLIGHTMASTER); + if (pNpc) + { + for (PlayerBotMap::const_iterator it = GetPlayerBotsBegin(); it != GetPlayerBotsEnd(); ++it) + { + Player* const bot = it->second; + if (!bot) + return; + + Creature *unit = bot->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_FLIGHTMASTER); + if (!unit) + { + DEBUG_LOG("PlayerbotAI: talk to FLIGHTMASTER - %s not found or you can't interact with it.", npcGUID.GetString().c_str()); + continue; + } + bot->GetSession()->SendLearnNewTaxiNode(unit); + } + return; + } + return; + } + // if master talks to an NPC case CMSG_GOSSIP_HELLO: + { + WorldPacket p(packet); + p.rpos(0); // reset reader + ObjectGuid npcGUID; + p >> npcGUID; + + Creature *pNpc = m_master->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_FLIGHTMASTER); + if (pNpc) + { + for (PlayerBotMap::const_iterator it = GetPlayerBotsBegin(); it != GetPlayerBotsEnd(); ++it) + { + Player* const bot = it->second; + if (!bot) + return; + + Creature *unit = bot->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_FLIGHTMASTER); + if (!unit) + { + DEBUG_LOG("PlayerbotAI: talk to FLIGHTMASTER - %s not found or you can't interact with it.", npcGUID.GetString().c_str()); + continue; + } + + bot->GetSession()->SendLearnNewTaxiNode(unit); + } + return; + } + + } case CMSG_QUESTGIVER_HELLO: { WorldPacket p(packet);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use