From 69b4bfa5a9b3f0956ae499fd72971c6d3b52fecf Mon Sep 17 00:00:00 2001 From: Nicolas Lebacq Date: Tue, 27 Jan 2026 22:22:16 +0100 Subject: [PATCH 001/222] DrinkAction refactor (#2) * fix: Made bots drink responsibly by implementing a real check algorithm on drinking. * fix: Remove a unused variable. * fix: Improved the drinking detection logic following PR comments. * feat: Added inspector pattern to replace distinct functions. * feat: Improved drinking behaviour drastically. * chore: Removed debug action. * chore: Removed remnants of debug code. * fix: Improved DrinkAction::isPossible logic. --- src/Ai/Base/ActionContext.h | 1 + src/Ai/Base/Actions/NonCombatActions.cpp | 55 ---- src/Ai/Base/Actions/NonCombatActions.h | 10 - src/Ai/Base/SharedValueContext.h | 2 +- .../Strategy/ChatCommandHandlerStrategy.cpp | 2 - src/Bot/PlayerbotAI.cpp | 240 +++++++++--------- .../inspector/abstract/AbstractInspector.h | 19 ++ .../abstract/AbstractPlayerInspector.h | 37 +++ .../inspector/global/GlobalPlayerInspector.h | 107 ++++++++ .../actions/non-combat/drink/DrinkAction.h | 88 +++++++ .../drink/definition/enum/DrinkAuraEnum.h | 110 ++++++++ 11 files changed, 488 insertions(+), 183 deletions(-) create mode 100644 src/domain/core/inspector/abstract/AbstractInspector.h create mode 100644 src/domain/player/inspector/abstract/AbstractPlayerInspector.h create mode 100644 src/domain/player/inspector/global/GlobalPlayerInspector.h create mode 100644 src/strategy/actions/non-combat/drink/DrinkAction.h create mode 100644 src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h diff --git a/src/Ai/Base/ActionContext.h b/src/Ai/Base/ActionContext.h index 93bba4afee..23931f62b6 100644 --- a/src/Ai/Base/ActionContext.h +++ b/src/Ai/Base/ActionContext.h @@ -43,6 +43,7 @@ #include "MoveToTravelTargetAction.h" #include "MovementActions.h" #include "NonCombatActions.h" +#include "DrinkAction.h" #include "OutfitAction.h" #include "PositionAction.h" #include "DropQuestAction.h" diff --git a/src/Ai/Base/Actions/NonCombatActions.cpp b/src/Ai/Base/Actions/NonCombatActions.cpp index 492da8ae6b..22e6cd802e 100644 --- a/src/Ai/Base/Actions/NonCombatActions.cpp +++ b/src/Ai/Base/Actions/NonCombatActions.cpp @@ -8,61 +8,6 @@ #include "Event.h" #include "Playerbots.h" -bool DrinkAction::Execute(Event event) -{ - if (botAI->HasCheat(BotCheatMask::food)) - { - // if (bot->IsNonMeleeSpellCast(true)) - // return false; - - bot->ClearUnitState(UNIT_STATE_CHASE); - bot->ClearUnitState(UNIT_STATE_FOLLOW); - - if (bot->isMoving()) - { - bot->StopMoving(); - // botAI->SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); - // return false; - } - bot->SetStandState(UNIT_STAND_STATE_SIT); - botAI->InterruptSpell(); - - // float hp = bot->GetHealthPercent(); - float mp = bot->GetPowerPct(POWER_MANA); - float p = mp; - float delay; - - if (!bot->InBattleground()) - delay = 18000.0f * (100 - p) / 100.0f; - else - delay = 12000.0f * (100 - p) / 100.0f; - - botAI->SetNextCheckDelay(delay); - - bot->AddAura(25990, bot); - return true; - // return botAI->CastSpell(24707, bot); - } - - return UseItemAction::Execute(event); -} - -bool DrinkAction::isUseful() -{ - return UseItemAction::isUseful() && - AI_VALUE2(bool, "has mana", "self target") && - AI_VALUE2(uint8, "mana", "self target") < 100; -} - -bool DrinkAction::isPossible() -{ - return !bot->IsInCombat() && - !bot->IsMounted() && - !botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", - "aquatic form","flight form", "swift flight form", nullptr) && - (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible()); -} - bool EatAction::Execute(Event event) { if (botAI->HasCheat(BotCheatMask::food)) diff --git a/src/Ai/Base/Actions/NonCombatActions.h b/src/Ai/Base/Actions/NonCombatActions.h index 3156d49921..86b353cf0a 100644 --- a/src/Ai/Base/Actions/NonCombatActions.h +++ b/src/Ai/Base/Actions/NonCombatActions.h @@ -10,16 +10,6 @@ class PlayerbotAI; -class DrinkAction : public UseItemAction -{ -public: - DrinkAction(PlayerbotAI* botAI) : UseItemAction(botAI, "drink") {} - - bool Execute(Event event) override; - bool isUseful() override; - bool isPossible() override; -}; - class EatAction : public UseItemAction { public: diff --git a/src/Ai/Base/SharedValueContext.h b/src/Ai/Base/SharedValueContext.h index 94653aeabf..0ac35ab1b2 100644 --- a/src/Ai/Base/SharedValueContext.h +++ b/src/Ai/Base/SharedValueContext.h @@ -8,7 +8,7 @@ #include "LootValues.h" #include "NamedObjectContext.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" #include "PvpValues.h" #include "QuestValues.h" diff --git a/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp index 0a81686a9d..91a0ce5c5e 100644 --- a/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp +++ b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp @@ -5,8 +5,6 @@ #include "ChatCommandHandlerStrategy.h" -#include "Playerbots.h" - class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory { public: diff --git a/src/Bot/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp index 34fc133645..7aee754621 100644 --- a/src/Bot/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -56,6 +56,7 @@ #include "Unit.h" #include "UpdateTime.h" #include "Vehicle.h" +#include "GlobalPlayerInspector.h" const int SPELL_TITAN_GRIP = 49152; @@ -150,7 +151,7 @@ PlayerbotAI::PlayerbotAI(Player* bot) engines[BOT_STATE_COMBAT] = AiFactory::createCombatEngine(bot, this, aiObjectContext); engines[BOT_STATE_NON_COMBAT] = AiFactory::createNonCombatEngine(bot, this, aiObjectContext); engines[BOT_STATE_DEAD] = AiFactory::createDeadEngine(bot, this, aiObjectContext); - if (sPlayerbotAIConfig.applyInstanceStrategies) + if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId()); currentEngine = engines[BOT_STATE_NON_COMBAT]; currentState = BOT_STATE_NON_COMBAT; @@ -230,7 +231,7 @@ PlayerbotAI::~PlayerbotAI() delete aiObjectContext; if (bot) - PlayerbotsMgr::instance().RemovePlayerBotData(bot->GetGUID(), true); + sPlayerbotsMgr->RemovePlayerBotData(bot->GetGUID(), true); } void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) @@ -248,7 +249,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) // Handle cheat options (set bot health and power if cheats are enabled) if (bot->IsAlive() && - (static_cast(GetCheat()) > 0 || static_cast(sPlayerbotAIConfig.botCheatMask) > 0)) + (static_cast(GetCheat()) > 0 || static_cast(sPlayerbotAIConfig->botCheatMask) > 0)) { if (HasCheat(BotCheatMask::health)) bot->SetFullHealth(); @@ -329,7 +330,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) if (spellTarget && !bot->HasInArc(CAST_ANGLE_IN_FRONT, spellTarget) && (spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT)) { - ServerFacade::instance().SetFacingTo(bot, spellTarget); + sServerFacade->SetFacingTo(bot, spellTarget); } // Wait for spell cast @@ -384,7 +385,7 @@ void PlayerbotAI::UpdateAIGroupMaster() Group* group = bot->GetGroup(); - bool IsRandomBot = sRandomPlayerbotMgr.IsRandomBot(bot); + bool IsRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot); // If bot is not in group verify that for is RandomBot before clearing master and resetting. if (!group) @@ -448,7 +449,7 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal std::string const mapString = WorldPosition(bot).isOverworld() ? std::to_string(bot->GetMapId()) : "I"; PerfMonitorOperation* pmo = - sPerfMonitor.start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); + sPerfMonitor->start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); ExternalEventHelper helper(aiObjectContext); // chat replies @@ -500,12 +501,12 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal } else { - sRandomPlayerbotMgr.LogoutPlayerBot(bot->GetGUID()); + sRandomPlayerbotMgr->LogoutPlayerBot(bot->GetGUID()); } return; } - SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); return; } @@ -580,10 +581,10 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr if (type == CHAT_MSG_SYSTEM) return; - if (filtered.find(sPlayerbotAIConfig.commandSeparator) != std::string::npos) + if (filtered.find(sPlayerbotAIConfig->commandSeparator) != std::string::npos) { std::vector commands; - split(commands, filtered, sPlayerbotAIConfig.commandSeparator.c_str()); + split(commands, filtered, sPlayerbotAIConfig->commandSeparator.c_str()); for (std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { HandleCommand(type, *i, fromPlayer); @@ -591,12 +592,12 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr return; } - if (!sPlayerbotAIConfig.commandPrefix.empty()) + if (!sPlayerbotAIConfig->commandPrefix.empty()) { - if (filtered.find(sPlayerbotAIConfig.commandPrefix) != 0) + if (filtered.find(sPlayerbotAIConfig->commandPrefix) != 0) return; - filtered = filtered.substr(sPlayerbotAIConfig.commandPrefix.size()); + filtered = filtered.substr(sPlayerbotAIConfig->commandPrefix.size()); } if (chatMap.empty()) @@ -628,7 +629,7 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_ADDON, response.c_str(), LANG_ADDON, CHAT_TAG_NONE, bot->GetGUID(), bot->GetName()); - ServerFacade::instance().SendPacket(&fromPlayer, &data); + sServerFacade->SendPacket(&fromPlayer, &data); return; } @@ -758,10 +759,10 @@ void PlayerbotAI::HandleTeleportAck() } // apply instance-related strategies after map attach - if (sPlayerbotAIConfig.applyInstanceStrategies) + if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId(), true); - if (sPlayerbotAIConfig.restrictHealerDPS) + if (sPlayerbotAIConfig->restrictHealerDPS) EvaluateHealerDpsStrategy(); // reset AI state after teleport @@ -852,7 +853,7 @@ void PlayerbotAI::Reset(bool full) aiObjectContext->GetValue("last taxi")->Get().Set(nullptr); aiObjectContext->GetValue("travel target") ->Get() - ->setTarget(TravelMgr::instance().nullTravelDestination, TravelMgr::instance().nullWorldPosition, true); + ->setTarget(sTravelMgr->nullTravelDestination, sTravelMgr->nullWorldPosition, true); aiObjectContext->GetValue("travel target")->Get()->setStatus(TRAVEL_STATUS_EXPIRED); aiObjectContext->GetValue("travel target")->Get()->setExpireIn(1000); rpgInfo = NewRpgInfo(); @@ -917,10 +918,10 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro if (type == CHAT_MSG_SYSTEM) return; - if (text.find(sPlayerbotAIConfig.commandSeparator) != std::string::npos) + if (text.find(sPlayerbotAIConfig->commandSeparator) != std::string::npos) { std::vector commands; - split(commands, text, sPlayerbotAIConfig.commandSeparator.c_str()); + split(commands, text, sPlayerbotAIConfig->commandSeparator.c_str()); for (std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { HandleCommand(type, *i, fromPlayer); @@ -930,12 +931,12 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro } std::string filtered = text; - if (!sPlayerbotAIConfig.commandPrefix.empty()) + if (!sPlayerbotAIConfig->commandPrefix.empty()) { - if (filtered.find(sPlayerbotAIConfig.commandPrefix) != 0) + if (filtered.find(sPlayerbotAIConfig->commandPrefix) != 0) return; - filtered = filtered.substr(sPlayerbotAIConfig.commandPrefix.size()); + filtered = filtered.substr(sPlayerbotAIConfig->commandPrefix.size()); } if (chatMap.empty()) @@ -1097,7 +1098,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) } case SMSG_MESSAGECHAT: // do not react to self or if not ready to reply { - if (!sPlayerbotAIConfig.randomBotTalk) + if (!sPlayerbotAIConfig->randomBotTalk) return; if (!AllowActivity()) @@ -1153,7 +1154,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) bool isFromFreeBot = false; sCharacterCache->GetCharacterNameByGuid(guid1, name); uint32 accountId = sCharacterCache->GetCharacterAccountIdByGuid(guid1); - isFromFreeBot = sPlayerbotAIConfig.IsInRandomAccountList(accountId); + isFromFreeBot = sPlayerbotAIConfig->IsInRandomAccountList(accountId); bool isMentioned = message.find(bot->GetName()) != std::string::npos; // ChatChannelSource chatChannelSource = GetChatChannelSource(bot, msgtype, chanName); @@ -1171,20 +1172,20 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) if (lang == LANG_ADDON) return; - if (message.starts_with(sPlayerbotAIConfig.toxicLinksPrefix) && + if (message.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) && (GetChatHelper()->ExtractAllItemIds(message).size() > 0 || GetChatHelper()->ExtractAllQuestIds(message).size() > 0) && - sPlayerbotAIConfig.toxicLinksRepliesChance) + sPlayerbotAIConfig->toxicLinksRepliesChance) { - if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig.toxicLinksRepliesChance) + if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig->toxicLinksRepliesChance) { return; } } else if ((GetChatHelper()->ExtractAllItemIds(message).count(19019) && - sPlayerbotAIConfig.thunderfuryRepliesChance)) + sPlayerbotAIConfig->thunderfuryRepliesChance)) { - if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig.thunderfuryRepliesChance) + if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig->thunderfuryRepliesChance) { return; } @@ -1194,8 +1195,8 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) if (isFromFreeBot && urand(0, 20)) return; - // if (msgtype == CHAT_MSG_GUILD && (!sPlayerbotAIConfig.guildRepliesRate || urand(1, 100) >= - // sPlayerbotAIConfig.guildRepliesRate)) return; + // if (msgtype == CHAT_MSG_GUILD && (!sPlayerbotAIConfig->guildRepliesRate || urand(1, 100) >= + // sPlayerbotAIConfig->guildRepliesRate)) return; if (!isFromFreeBot) { @@ -1282,7 +1283,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) // bot->GetMotionMaster()->MoveKnockbackFrom(fx, fy, horizontalSpeed, verticalSpeed); // // set delay based on actual distance - // float newdis = sqrt(ServerFacade::instance().GetDistance2d(bot, fx, fy)); + // float newdis = sqrt(sServerFacade->GetDistance2d(bot, fx, fy)); // SetNextCheckDelay((uint32)((newdis / dis) * moveTimeHalf * 4 * IN_MILLISECONDS)); // // add moveflags @@ -1344,9 +1345,9 @@ int32 PlayerbotAI::CalculateGlobalCooldown(uint32 spellid) return 0; if (bot->HasSpellCooldown(spellid)) - return sPlayerbotAIConfig.globalCoolDown; + return sPlayerbotAIConfig->globalCoolDown; - return sPlayerbotAIConfig.reactDelay; + return sPlayerbotAIConfig->reactDelay; } void PlayerbotAI::HandleMasterIncomingPacket(WorldPacket const& packet) @@ -1407,7 +1408,7 @@ void PlayerbotAI::DoNextAction(bool min) { if (!bot->IsInWorld() || bot->IsBeingTeleported() || (GetMaster() && GetMaster()->IsBeingTeleported())) { - SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); return; } @@ -1453,6 +1454,15 @@ void PlayerbotAI::DoNextAction(bool min) bool minimal = !this->AllowActivity(); + const GlobalPlayerInspector playerInspector(this->bot->GetGUID().GetRawValue()); + + if (!minimal && playerInspector.isDrinking() && playerInspector.shouldBeDrinking(95.0f)) + { + this->SetNextCheckDelay(500); + + return; + } + currentEngine->DoNextAction(nullptr, 0, (minimal || min)); if (minimal) @@ -1460,7 +1470,7 @@ void PlayerbotAI::DoNextAction(bool min) if (!bot->isAFK() && !bot->InBattleground() && !HasRealPlayerMaster()) bot->ToggleAFK(); - SetNextCheckDelay(sPlayerbotAIConfig.passiveDelay); + SetNextCheckDelay(sPlayerbotAIConfig->passiveDelay); return; } else if (bot->isAFK()) @@ -1468,7 +1478,7 @@ void PlayerbotAI::DoNextAction(bool min) if (master && master->IsInWorld()) { - float distance = ServerFacade::instance().GetDistance2d(bot, master); + float distance = sServerFacade->GetDistance2d(bot, master); if (master->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING) && distance < 20.0f) bot->m_movementInfo.AddMovementFlag(MOVEMENTFLAG_WALKING); @@ -1702,7 +1712,7 @@ bool PlayerbotAI::PlayEmote(uint32 emote) WorldPacket data(SMSG_TEXT_EMOTE); data << (TextEmotes)emote; data << EmoteAction::GetNumberOfEmoteVariants((TextEmotes)emote, bot->getRace(), bot->getGender()); - data << ((master && (ServerFacade::instance().GetDistance2d(bot, master) < 30.0f) && urand(0, 1)) ? master->GetGUID() + data << ((master && (sServerFacade->GetDistance2d(bot, master) < 30.0f) && urand(0, 1)) ? master->GetGUID() : (bot->GetTarget() && urand(0, 1)) ? bot->GetTarget() : ObjectGuid::Empty); bot->GetSession()->HandleTextEmoteOpcode(data); @@ -1731,14 +1741,14 @@ void PlayerbotAI::ResetStrategies(bool load) AiFactory::AddDefaultCombatStrategies(bot, this, engines[BOT_STATE_COMBAT]); AiFactory::AddDefaultNonCombatStrategies(bot, this, engines[BOT_STATE_NON_COMBAT]); AiFactory::AddDefaultDeadStrategies(bot, this, engines[BOT_STATE_DEAD]); - if (sPlayerbotAIConfig.applyInstanceStrategies) + if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId()); for (uint8 i = 0; i < BOT_STATE_MAX; i++) engines[i]->Init(); // if (load) - // PlayerbotRepository::instance().Load(this); + // sPlayerbotRepository->Load(this); } bool PlayerbotAI::IsRanged(Player* player, bool bySpec) @@ -2716,7 +2726,7 @@ bool PlayerbotAI::SayToParty(const std::string& msg) for (auto reciever : GetPlayersInGroup()) { - ServerFacade::instance().SendPacket(reciever, &data); + sServerFacade->SendPacket(reciever, &data); } return true; @@ -2733,7 +2743,7 @@ bool PlayerbotAI::SayToRaid(const std::string& msg) for (auto reciever : GetPlayersInGroup()) { - ServerFacade::instance().SendPacket(reciever, &data); + sServerFacade->SendPacket(reciever, &data); } return true; @@ -2800,7 +2810,7 @@ bool PlayerbotAI::TellMasterNoFacing(std::string const text, PlayerbotSecurityLe masterBotAI = GET_PLAYERBOT_AI(master); if ((!master || (masterBotAI && !masterBotAI->IsRealPlayer())) && - (sPlayerbotAIConfig.randomBotSayWithoutMaster || HasStrategy("debug", BOT_STATE_NON_COMBAT))) + (sPlayerbotAIConfig->randomBotSayWithoutMaster || HasStrategy("debug", BOT_STATE_NON_COMBAT))) { bot->Say(text, (bot->GetTeamId() == TEAM_ALLIANCE ? LANG_COMMON : LANG_ORCISH)); return true; @@ -2811,7 +2821,7 @@ bool PlayerbotAI::TellMasterNoFacing(std::string const text, PlayerbotSecurityLe time_t lastSaid = whispers[text]; - if (!lastSaid || (time(nullptr) - lastSaid) >= sPlayerbotAIConfig.repeatDelay / 1000) + if (!lastSaid || (time(nullptr) - lastSaid) >= sPlayerbotAIConfig->repeatDelay / 1000) { whispers[text] = time(nullptr); @@ -2849,10 +2859,10 @@ bool PlayerbotAI::IsTellAllowed(PlayerbotSecurityLevel securityLevel) if (!GetSecurity()->CheckLevelFor(securityLevel, true, master)) return false; - if (sPlayerbotAIConfig.whisperDistance && !bot->GetGroup() && sRandomPlayerbotMgr.IsRandomBot(bot) && + if (sPlayerbotAIConfig->whisperDistance && !bot->GetGroup() && sRandomPlayerbotMgr->IsRandomBot(bot) && master->GetSession()->GetSecurity() < SEC_GAMEMASTER && (bot->GetMapId() != master->GetMapId() || - ServerFacade::instance().GetDistance2d(bot, master) > sPlayerbotAIConfig.whisperDistance)) + sServerFacade->GetDistance2d(bot, master) > sPlayerbotAIConfig->whisperDistance)) return false; return true; @@ -2867,7 +2877,7 @@ bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel secu { if (!master) { - if (sPlayerbotAIConfig.randomBotSayWithoutMaster) + if (sPlayerbotAIConfig->randomBotSayWithoutMaster) return TellMasterNoFacing(text, securityLevel); } if (!TellMasterNoFacing(text, securityLevel)) @@ -2876,7 +2886,7 @@ bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel secu if (!bot->isMoving() && !bot->IsInCombat() && bot->GetMapId() == master->GetMapId() && !bot->HasUnitState(UNIT_STATE_IN_FLIGHT) && !bot->IsFlying()) { - if (!bot->HasInArc(EMOTE_ANGLE_IN_FRONT, master, sPlayerbotAIConfig.sightDistance)) + if (!bot->HasInArc(EMOTE_ANGLE_IN_FRONT, master, sPlayerbotAIConfig->sightDistance)) bot->SetFacingToObject(master); bot->HandleEmoteCommand(EMOTE_ONESHOT_TALK); @@ -3090,7 +3100,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, { if (!spellid) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. No spellid. - spellid: {}, bot name: {}", spellid, bot->GetName()); @@ -3100,7 +3110,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Unit state lost control. - spellid: {}, bot name: {}", spellid, bot->GetName()); @@ -3120,7 +3130,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (checkHasSpell && !bot->HasSpell(spellid)) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Bot not has spell. - target name: {}, spellid: {}, bot name: {}", @@ -3131,7 +3141,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG( "playerbots", @@ -3143,7 +3153,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->HasSpellCooldown(spellid)) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Spell not has cooldown. - target name: {}, spellid: {}, bot name: {}", @@ -3155,7 +3165,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); if (!spellInfo) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. No spellInfo. - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3165,7 +3175,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if ((bot->GetShapeshiftForm() == FORM_FLIGHT || bot->GetShapeshiftForm() == FORM_FLIGHT_EPIC) && !bot->IsInCombat()) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG( "playerbots", @@ -3179,7 +3189,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, // bool interruptOnMove = spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT; if ((CastingTime || spellInfo->IsAutoRepeatRangedSpell()) && bot->isMoving()) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Casting time and bot is moving - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3194,7 +3204,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, { if (spellid != 44572) // Deep Freeze { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "target is immuned to spell - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3204,9 +3214,9 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, // Otherwise, allow Deep Freeze even if immune } - if (bot != target && ServerFacade::instance().GetDistance2d(bot, target) > sPlayerbotAIConfig.sightDistance) + if (bot != target && sServerFacade->GetDistance2d(bot, target) > sPlayerbotAIConfig->sightDistance) { - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "target is out of sight distance - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3232,7 +3242,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, SpellCastResult result = spell->CheckCast(true); delete spell; - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // if (result != SPELL_FAILED_NOT_READY && result != SPELL_CAST_OK) // { @@ -3256,7 +3266,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, case SPELL_FAILED_OUT_OF_RANGE: return true; default: - if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "CanCastSpell Check Failed. - target name: {}, spellid: {}, bot name: {}, result: {}", @@ -3292,7 +3302,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, GameObject* goTarget, bool checkH if (CastingTime > 0 && bot->isMoving()) return false; - if (ServerFacade::instance().GetDistance2d(bot, goTarget) > sPlayerbotAIConfig.sightDistance) + if (sServerFacade->GetDistance2d(bot, goTarget) > sPlayerbotAIConfig->sightDistance) return false; // ObjectGuid oldSel = bot->GetTarget(); @@ -3345,7 +3355,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, float x, float y, float z, bool c if (!itemTarget) { - if (bot->GetDistance(x, y, z) > sPlayerbotAIConfig.sightDistance) + if (bot->GetDistance(x, y, z) > sPlayerbotAIConfig->sightDistance) return false; } @@ -3447,7 +3457,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (bot->IsFlying() || bot->HasUnitState(UNIT_STATE_IN_FLIGHT)) { - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast is flying - target name: {}, spellid: {}, bot name: {}}", // target->GetName(), spellId, bot->GetName()); @@ -3470,13 +3480,13 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) WorldObject* faceTo = target; if (!bot->HasInArc(CAST_ANGLE_IN_FRONT, faceTo) && (spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT)) { - ServerFacade::instance().SetFacingTo(bot, faceTo); + sServerFacade->SetFacingTo(bot, faceTo); // failWithDelay = true; } if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); return false; } @@ -3493,7 +3503,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) { bot->GetTradeData()->SetSpell(spellId); delete spell; - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast no item - target name: {}, spellid: {}, bot name: {}", // target->GetName(), spellId, bot->GetName()); @@ -3555,7 +3565,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (bot->isMoving() && spell->GetCastTime()) { // bot->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); spell->cancel(); delete spell; return false; @@ -3563,7 +3573,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) // spell->m_targets.SetUnitTarget(target); // SpellCastResult spellSuccess = spell->CheckCast(true); - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast result - target name: {}, spellid: {}, bot name: {}, result: {}", // target->GetName(), spellId, bot->GetName(), spellSuccess); @@ -3575,7 +3585,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (result != SPELL_CAST_OK) { - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast failed. - target name: {}, spellid: {}, bot name: {}, result: {}", // target->GetName(), spellId, bot->GetName(), result); @@ -3643,7 +3653,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) // { // spell->cancel(); // delete spell; - // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast loot - target name: {}, spellid: {}, bot name: {}", // target->GetName(), spellId, bot->GetName()); @@ -3723,7 +3733,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); return false; } @@ -3766,7 +3776,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite if (bot->isMoving() && spell->GetCastTime()) { // bot->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); spell->cancel(); delete spell; return false; @@ -3844,12 +3854,12 @@ bool PlayerbotAI::CanCastVehicleSpell(uint32 spellId, Unit* target) if (CastingTime && vehicleBase->isMoving()) return false; - if (vehicleBase != spellTarget && ServerFacade::instance().GetDistance2d(vehicleBase, spellTarget) > 120.0f) + if (vehicleBase != spellTarget && sServerFacade->GetDistance2d(vehicleBase, spellTarget) > 120.0f) return false; if (!target && siegePos.isSet()) { - if (ServerFacade::instance().GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) + if (sServerFacade->GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) return false; } @@ -3919,7 +3929,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) PositionInfo siegePos = GetAiObjectContext()->GetValue("position")->Get()["bg siege"]; if (!target && siegePos.isSet()) { - if (ServerFacade::instance().GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) + if (sServerFacade->GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) return false; } @@ -3957,7 +3967,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); return false; } @@ -3998,7 +4008,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) if (seat->CanControl() && vehicleBase->isMoving() && spell->GetCastTime()) { vehicleBase->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); spell->cancel(); // delete spell; return false; @@ -4075,7 +4085,7 @@ void PlayerbotAI::WaitForSpellCast(Spell* spell) castTime += duration; } - SetNextCheckDelay(castTime + sPlayerbotAIConfig.reactDelay); + SetNextCheckDelay(castTime + sPlayerbotAIConfig->reactDelay); } void PlayerbotAI::InterruptSpell() @@ -4167,8 +4177,8 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType) if (!aura || aura->IsPassive() || aura->IsRemoved()) continue; - if (sPlayerbotAIConfig.dispelAuraDuration && aura->GetDuration() && - aura->GetDuration() < (int32)sPlayerbotAIConfig.dispelAuraDuration) + if (sPlayerbotAIConfig->dispelAuraDuration && aura->GetDuration() && + aura->GetDuration() < (int32)sPlayerbotAIConfig->dispelAuraDuration) continue; SpellInfo const* spellInfo = aura->GetSpellInfo(); @@ -4288,7 +4298,7 @@ bool PlayerbotAI::HasRealPlayerMaster() bool PlayerbotAI::HasActivePlayerMaster() { return master && !GET_PLAYERBOT_AI(master); } -bool PlayerbotAI::IsAlt() { return HasRealPlayerMaster() && !sRandomPlayerbotMgr.IsRandomBot(bot); } +bool PlayerbotAI::IsAlt() { return HasRealPlayerMaster() && !sRandomPlayerbotMgr->IsRandomBot(bot); } Player* PlayerbotAI::GetGroupLeader() { @@ -4377,7 +4387,7 @@ bool PlayerbotAI::HasPlayerNearby(WorldPosition* pos, float range) { float sqRange = range * range; bool nearPlayer = false; - for (auto& player : sRandomPlayerbotMgr.GetPlayers()) + for (auto& player : sRandomPlayerbotMgr->GetPlayers()) { if (!player->IsGameMaster() || player->isGMVisible()) { @@ -4411,9 +4421,9 @@ bool PlayerbotAI::HasManyPlayersNearby(uint32 trigerrValue, float range) float sqRange = range * range; uint32 found = 0; - for (auto& player : sRandomPlayerbotMgr.GetPlayers()) + for (auto& player : sRandomPlayerbotMgr->GetPlayers()) { - if ((!player->IsGameMaster() || player->isGMVisible()) && ServerFacade::instance().GetDistance2d(player, bot) < sqRange) + if ((!player->IsGameMaster() || player->isGMVisible()) && sServerFacade->GetDistance2d(player, bot) < sqRange) { found++; @@ -4459,7 +4469,7 @@ inline bool ZoneHasRealPlayers(Player* bot) return false; } - for (Player* player : sRandomPlayerbotMgr.GetPlayers()) + for (Player* player : sRandomPlayerbotMgr->GetPlayers()) { if (player->GetMapId() != bot->GetMapId()) continue; @@ -4490,7 +4500,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) return false; // when botActiveAlone is 100% and smartScale disabled - if (sPlayerbotAIConfig.botActiveAlone >= 100 && !sPlayerbotAIConfig.botActiveAloneSmartScale) + if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale) { return true; } @@ -4508,7 +4518,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) // which prevents unneeded expensive GameTime calls. if (_isBotInitializing) { - _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig.maxRandomBots * 0.11; + _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.11; // no activity allowed during bot initialization if (_isBotInitializing) @@ -4530,7 +4540,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // bot map has active players. - if (sPlayerbotAIConfig.BotActiveAloneForceWhenInMap) + if (sPlayerbotAIConfig->BotActiveAloneForceWhenInMap) { if (HasRealPlayers(bot->GetMap())) { @@ -4539,7 +4549,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // bot zone has active players. - if (sPlayerbotAIConfig.BotActiveAloneForceWhenInZone) + if (sPlayerbotAIConfig->BotActiveAloneForceWhenInZone) { if (ZoneHasRealPlayers(bot)) { @@ -4548,7 +4558,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // when in real guild - if (sPlayerbotAIConfig.BotActiveAloneForceWhenInGuild) + if (sPlayerbotAIConfig->BotActiveAloneForceWhenInGuild) { if (IsInRealGuild()) { @@ -4557,7 +4567,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // Player is near. Always active. - if (HasPlayerNearby(sPlayerbotAIConfig.BotActiveAloneForceWhenInRadius)) + if (HasPlayerNearby(sPlayerbotAIConfig->BotActiveAloneForceWhenInRadius)) { return true; } @@ -4629,13 +4639,13 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // HasFriend - if (sPlayerbotAIConfig.BotActiveAloneForceWhenIsFriend) + if (sPlayerbotAIConfig->BotActiveAloneForceWhenIsFriend) { // shouldnt be needed analyse in future if (!bot->GetGUID()) return false; - for (auto& player : sRandomPlayerbotMgr.GetPlayers()) + for (auto& player : sRandomPlayerbotMgr->GetPlayers()) { if (!player || !player->GetSession() || !player->IsInWorld() || player->IsDuringRemoveFromWorld() || player->GetSession()->isLogingOut()) @@ -4667,7 +4677,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) return false; } - if (sPlayerbotAIConfig.botActiveAlone <= 0) + if (sPlayerbotAIConfig->botActiveAlone <= 0) { return false; } @@ -4679,19 +4689,19 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) // Below is code to have a specified % of bots active at all times. // The default is 100%. With 1% of all bots going active or inactive each minute. - uint32 mod = sPlayerbotAIConfig.botActiveAlone > 100 ? 100 : sPlayerbotAIConfig.botActiveAlone; - if (sPlayerbotAIConfig.botActiveAloneSmartScale && - bot->GetLevel() >= sPlayerbotAIConfig.botActiveAloneSmartScaleWhenMinLevel && - bot->GetLevel() <= sPlayerbotAIConfig.botActiveAloneSmartScaleWhenMaxLevel) + uint32 mod = sPlayerbotAIConfig->botActiveAlone > 100 ? 100 : sPlayerbotAIConfig->botActiveAlone; + if (sPlayerbotAIConfig->botActiveAloneSmartScale && + bot->GetLevel() >= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMinLevel && + bot->GetLevel() <= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMaxLevel) { mod = AutoScaleActivity(mod); } uint32 ActivityNumber = - GetFixedBotNumer(100, sPlayerbotAIConfig.botActiveAlone * static_cast(mod) / 100 * 0.01f); + GetFixedBotNumer(100, sPlayerbotAIConfig->botActiveAlone * static_cast(mod) / 100 * 0.01f); return ActivityNumber <= - (sPlayerbotAIConfig.botActiveAlone * mod) / + (sPlayerbotAIConfig->botActiveAlone * mod) / 100; // The given percentage of bots should be active and rotate 1% of those active bots each minute. } @@ -4723,8 +4733,8 @@ uint32 PlayerbotAI::AutoScaleActivity(uint32 mod) { // Current max server update time (ms), and the configured floor/ceiling values for bot scaling uint32 maxDiff = sWorldUpdateTime.GetMaxUpdateTimeOfCurrentTable(); - uint32 diffLimitFloor = sPlayerbotAIConfig.botActiveAloneSmartScaleDiffLimitfloor; - uint32 diffLimitCeiling = sPlayerbotAIConfig.botActiveAloneSmartScaleDiffLimitCeiling; + uint32 diffLimitFloor = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitfloor; + uint32 diffLimitCeiling = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitCeiling; if (diffLimitCeiling <= diffLimitFloor) { @@ -5316,19 +5326,19 @@ float PlayerbotAI::GetRange(std::string const type) return val; if (type == "spell") - return sPlayerbotAIConfig.spellDistance; + return sPlayerbotAIConfig->spellDistance; if (type == "shoot") - return sPlayerbotAIConfig.shootDistance; + return sPlayerbotAIConfig->shootDistance; if (type == "flee") - return sPlayerbotAIConfig.fleeDistance; + return sPlayerbotAIConfig->fleeDistance; if (type == "heal") - return sPlayerbotAIConfig.healDistance; + return sPlayerbotAIConfig->healDistance; if (type == "melee") - return sPlayerbotAIConfig.meleeDistance; + return sPlayerbotAIConfig->meleeDistance; return 0; } @@ -5997,7 +6007,7 @@ bool PlayerbotAI::IsInRealGuild() if (!bot->GetGuildId()) return false; - return PlayerbotGuildMgr::instance().IsRealGuild(bot->GetGuildId()); + return sPlayerbotGuildMgr->IsRealGuild(bot->GetGuildId()); } void PlayerbotAI::QueueChatResponse(const ChatQueuedReply chatReply) { chatReplies.push_back(std::move(chatReply)); } @@ -6551,17 +6561,17 @@ std::set PlayerbotAI::GetCurrentIncompleteQuestIds() uint32 PlayerbotAI::GetReactDelay() { - uint32 base = sPlayerbotAIConfig.reactDelay; // Default 100(ms) + uint32 base = sPlayerbotAIConfig->reactDelay; // Default 100(ms) // If dynamic react delay is disabled, use a static calculation - if (!sPlayerbotAIConfig.dynamicReactDelay) + if (!sPlayerbotAIConfig->dynamicReactDelay) { if (HasRealPlayerMaster()) return base; bool inBG = bot->InBattleground() || bot->InArena(); - if (sPlayerbotAIConfig.fastReactInBG && inBG) + if (sPlayerbotAIConfig->fastReactInBG && inBG) return base; bool inCombat = bot->IsInCombat(); @@ -6586,11 +6596,11 @@ uint32 PlayerbotAI::GetReactDelay() { if (bot->IsInCombat() || currentState == BOT_STATE_COMBAT) { - return static_cast(base * (sPlayerbotAIConfig.fastReactInBG ? 2.5f : 5.0f)); + return static_cast(base * (sPlayerbotAIConfig->fastReactInBG ? 2.5f : 5.0f)); } else { - return static_cast(base * (sPlayerbotAIConfig.fastReactInBG ? 1.0f : 10.0f)); + return static_cast(base * (sPlayerbotAIConfig->fastReactInBG ? 1.0f : 10.0f)); } } @@ -6763,7 +6773,7 @@ void PlayerbotAI::EvaluateHealerDpsStrategy() if (!IsHeal(bot, true)) return; - if (sPlayerbotAIConfig.IsRestrictedHealerDPSMap(bot->GetMapId())) + if (sPlayerbotAIConfig->IsRestrictedHealerDPSMap(bot->GetMapId())) ChangeStrategy("-healer dps", BOT_STATE_COMBAT); else ChangeStrategy("+healer dps", BOT_STATE_COMBAT); diff --git a/src/domain/core/inspector/abstract/AbstractInspector.h b/src/domain/core/inspector/abstract/AbstractInspector.h new file mode 100644 index 0000000000..7906180f65 --- /dev/null +++ b/src/domain/core/inspector/abstract/AbstractInspector.h @@ -0,0 +1,19 @@ +#pragma once + +class AbstractInspector +{ +protected: + AbstractInspector() = default; + ~AbstractInspector() = default; + + AbstractInspector(AbstractInspector const&) = default; + AbstractInspector& operator=(AbstractInspector const&) = default; + + AbstractInspector(AbstractInspector&&) = default; + AbstractInspector& operator=(AbstractInspector&&) = default; + + virtual bool isInspectable() const + { + return true; + } +}; diff --git a/src/domain/player/inspector/abstract/AbstractPlayerInspector.h b/src/domain/player/inspector/abstract/AbstractPlayerInspector.h new file mode 100644 index 0000000000..66e5874a08 --- /dev/null +++ b/src/domain/player/inspector/abstract/AbstractPlayerInspector.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +#include "ObjectGuid.h" +#include "ObjectAccessor.h" +#include "Player.h" + +#include "AbstractInspector.h" + +class AbstractPlayerInspector : public AbstractInspector +{ +public: + AbstractPlayerInspector( + uint64_t playerGUID + ) : + playerGUID(playerGUID) + {} + + AbstractPlayerInspector& operator=(AbstractPlayerInspector const&) = delete; + + Player* getCurrentPlayer() const + { + const ObjectGuid playerFullGUID = ObjectGuid::Create(this->playerGUID); + Player* const player = ObjectAccessor::FindPlayer(playerFullGUID); + + return player; + } + + bool isInspectable() const override + { + return true; + } + +protected: + const uint64_t playerGUID; +}; diff --git a/src/domain/player/inspector/global/GlobalPlayerInspector.h b/src/domain/player/inspector/global/GlobalPlayerInspector.h new file mode 100644 index 0000000000..7c1f0adf72 --- /dev/null +++ b/src/domain/player/inspector/global/GlobalPlayerInspector.h @@ -0,0 +1,107 @@ +#pragma once + +#include + +#include "ObjectAccessor.h" +#include "SharedDefines.h" +#include "Player.h" +#include "GridNotifiers.h" + +#include "AiObjectContext.h" +#include "AiFactory.h" +#include "PlayerbotAI.h" +#include "AbstractPlayerInspector.h" +#include "PlayerbotMgr.h" + +class GlobalPlayerInspector : public AbstractPlayerInspector +{ +public: + GlobalPlayerInspector( + uint64_t playerGUID + ) : + AbstractPlayerInspector(playerGUID) + {} + + bool isDrinking() const + { + const Player* const player = this->getCurrentPlayer(); + + if (player == nullptr) + return false; + + if (!player->IsSitState()) + return false; + + return player->HasAuraType(SPELL_AURA_MOD_POWER_REGEN) || player->HasAuraType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); + } + + bool isEating() const + { + const Player* const player = this->getCurrentPlayer(); + + if (player == nullptr) + return false; + + if (!player->IsSitState()) + return false; + + return player->HasAuraType(SPELL_AURA_MOD_REGEN) || player->HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); + } + + bool shouldBeDrinking(float manaThresholdPercent) const + { + Player* const player = this->getCurrentPlayer(); + + if (player == nullptr) + return false; + + if (!player->HasActivePowerType(POWER_MANA)) + return false; + + if (player->IsInCombat()) + return false; + + if (player->GetPowerPct(POWER_MANA) > manaThresholdPercent) + return false; + + if (player->IsUnderWater()) + return false; + + // Bots must not keep drinking if they have hostile entities close to them! + if (this->hasHostileUnitsInRange(15.0f)) + return false; + + PlayerbotAI* botAI = PlayerbotsMgr::instance()->GetPlayerbotAI(player); + + if (botAI == nullptr) + return false; + + AiObjectContext* context = botAI->GetAiObjectContext(); + + if (context == nullptr) + return false; + + bool hasAvailableLoot = context->GetValue("loot target"); + + if (hasAvailableLoot) + return false; + + return true; + } + + bool hasHostileUnitsInRange(float range) const + { + const Player* const player = this->getCurrentPlayer(); + + if (player == nullptr) + return false; + + std::list targets; + + Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(player, 15.0f); + Acore::UnitListSearcher searcher(player, targets, u_check); + Cell::VisitObjects(player, searcher, PlayerbotAIConfig::instance()->sightDistance); + + return !targets.empty(); + } +}; diff --git a/src/strategy/actions/non-combat/drink/DrinkAction.h b/src/strategy/actions/non-combat/drink/DrinkAction.h new file mode 100644 index 0000000000..f0f895cea2 --- /dev/null +++ b/src/strategy/actions/non-combat/drink/DrinkAction.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_DRINK_ACTION_H +#define _PLAYERBOT_DRINK_ACTION_H + +#include + +#include "Event.h" +#include "UseItemAction.h" +#include "GlobalPlayerInspector.h" +#include "DrinkAuraEnum.h" + + +class PlayerbotAI; + +class DrinkAction : public UseItemAction +{ +public: + DrinkAction(PlayerbotAI* botAI) : UseItemAction(botAI, "drink") {} + + bool isPossible() override + { + if (this->bot->IsInCombat()) + { + return false; + } + + if (this->bot->IsMounted()) + { + return false; + } + + if (this->botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form","flight form", "swift flight form", nullptr)) + { + return false; + } + + if (this->bot->IsCrowdControlled()) + { + return false; + } + + return this->botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible(); + } + + bool isUseful() override + { + const GlobalPlayerInspector playerInspector(this->bot->GetGUID().GetRawValue()); + + if (playerInspector.isDrinking()) + return false; + + return playerInspector.shouldBeDrinking(50.0f); + } + + bool Execute(Event event) override + { + std::string name = this->bot->GetName().c_str(); + + this->bot->ClearUnitState(UNIT_STATE_CHASE); + this->bot->ClearUnitState(UNIT_STATE_FOLLOW); + + this->botAI->InterruptSpell(); + + if (this->bot->isMoving()) + this->bot->StopMoving(); + + this->bot->SetStandState(UNIT_STAND_STATE_SIT); + + if (this->botAI->HasCheat(BotCheatMask::food)) + { + this->bot->AddAura(DRINK_AURA_GRACCU_MINCE_MEAT_FRUITCAKE, bot); + + this->botAI->SetNextCheckDelay(1000); + + return true; + } + + this->botAI->SetNextCheckDelay(1000); + + return UseItemAction::Execute(event); + } +}; + +#endif diff --git a/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h b/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h new file mode 100644 index 0000000000..94b5f14f67 --- /dev/null +++ b/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_DRINK_AURA_ENUM_H +#define _PLAYERBOT_DRINK_AURA_ENUM_H + +enum DrinkAuraEnum { + DRINK_AURA_GRACCU_MINCE_MEAT_FRUITCAKE = 25990, + DRINK_AURA_FISH_FEAST = 57426, + DRINK_AURA_GREAT_FEAST = 57301, + DRINK_AURA_DRAGONFIN_FILET = 57370, + DRINK_AURA_GIGANTIC_FEAST = 58465, + DRINK_AURA_BLACKENED_DRAGONFIN = 57366, + DRINK_AURA_BLACK_JELLY = 64354, + DRINK_AURA_FIRECRACKER_SALMON = 57341, + DRINK_AURA_PURIFIED_DRAENIC_WATER = 27089, + DRINK_AURA_DALARAN_CLAM_CHOWDER = 58067, + DRINK_AURA_HOT_BUTTERED_TROUT = 42309, + DRINK_AURA_KUNGALOOSH = 52911, + DRINK_AURA_CRANBERRY_CHUTNEY = 65420, + DRINK_AURA_BAKED_MANTA_RAY = 57101, + DRINK_AURA_SLOW_ROASTED_TURKEY = 65422, + DRINK_AURA_CONJURED_MANA_STRUDEL = 43523, + DRINK_AURA_CANDIED_SWEET_POTATO = 65418, + DRINK_AURA_SPICE_BREAD_STUFFING = 65419, + DRINK_AURA_SMALL_FEAST = 58474, + DRINK_AURA_SMOKED_SAGEFISH = 25690, + DRINK_AURA_YETI_MILK = 43183, + DRINK_AURA_SNAPPER_EXTREME = 57359, + DRINK_AURA_SMOKED_ROCKFIN = 57070, + DRINK_AURA_POACHED_NETTLEFISH = 57098, + DRINK_AURA_BLACK_COFFEE = 27089, + DRINK_AURA_MOUNTAIN_WATER = 27089, + DRINK_AURA_PUMPKIN_PIE = 65421, + DRINK_AURA_FILTERED_DRAENIC_WATER = 34291, + DRINK_AURA_BITTER_PLASMA = 43182, + DRINK_AURA_WORG_TARTARE = 57359, + DRINK_AURA_CLAMLETTE_MAGNIFIQUE = 64056, + DRINK_AURA_BOUNTIFUL_FEAST = 66476, + DRINK_AURA_GRILLED_SCULPIN = 57085, + DRINK_AURA_CONJURED_MANA_PIE = 61828, + DRINK_AURA_CUTTLESTEAK = 57364, + DRINK_AURA_PUNGENT_SEAL_WHEY = 43182, + DRINK_AURA_IMPERIAL_MANTA_STEAK = 57344, + DRINK_AURA_SWEET_NECTAR = 1133, + DRINK_AURA_BOTTLED_WINTERSPRING_WATER = 1135, + DRINK_AURA_CONJURED_MOUNTAIN_SPRING_WATER = 34291, + DRINK_AURA_HONEYMINT_TEA = 43183, + DRINK_AURA_SAUTEED_GOBY = 57070, + DRINK_AURA_REFRESHING_SPRING_WATER = 430, + DRINK_AURA_ENCHANTED_WATER = 1133, + DRINK_AURA_SMOKED_SALMON = 57096, + DRINK_AURA_GRIZZLEBERRY_JUICE = 27089, + DRINK_AURA_STAR_SORROW = 43183, + DRINK_AURA_PICKLED_FANGTOOTH = 57106, + DRINK_AURA_CONJURED_FRESH_WATER = 431, + DRINK_AURA_MORNING_GLORY_DEW = 1137, + DRINK_AURA_CONJURED_GLACIER_WATER = 27089, + DRINK_AURA_SKULLFISH_SOUP = 43706, + DRINK_AURA_SWEETENED_GOAT_MILK = 27089, + DRINK_AURA_BLACKROCK_FORTIFIED_WATER = 27089, + DRINK_AURA_FIZZY_FAIRE_DRINK = 432, + DRINK_AURA_ENRICHED_TEROCONE_JUICE = 41031, + DRINK_AURA_POACHED_NORTHERN_SCULPIN = 57335, + DRINK_AURA_CRUSADER_WATERSKIN = 43183, + DRINK_AURA_ALTERAC_MANNA_BISCUIT = 23692, + DRINK_AURA_HOT_APPLE_CIDER = 45020, + DRINK_AURA_SPICY_FRIED_HERRING = 57354, + DRINK_AURA_CONJURED_WATER = 430, + DRINK_AURA_CONJURED_MINERAL_WATER = 1135, + DRINK_AURA_CONJURED_CRYSTAL_WATER = 22734, + DRINK_AURA_BUBBLING_WATER = 432, + DRINK_AURA_GRILLED_BONESCALE = 57070, + DRINK_AURA_SPICY_BLUE_NETTLEFISH = 57343, + DRINK_AURA_FRESH_APPLE_JUICE = 43182, + DRINK_AURA_ICE_COLD_MILK = 431, + DRINK_AURA_UNDERSPORE_POD = 33772, + DRINK_AURA_FRESH_SQUEEZED_LIMEADE = 43182, + DRINK_AURA_JILLIAN_GOURMET_FISH_FEAST = 57426, + DRINK_AURA_MELON_JUICE = 432, + DRINK_AURA_GILNEAS_SPARKLING_WATER = 27089, + DRINK_AURA_STAR_LAMENT = 22734, + DRINK_AURA_CONJURED_SPRING_WATER = 1133, + DRINK_AURA_HYJAL_NECTAR = 22734, + DRINK_AURA_BLACKROCK_SPRING_WATER = 1137, + DRINK_AURA_BLACKROCK_MINERAL_WATER = 34291, + DRINK_AURA_ETHERMEAD = 27089, + DRINK_AURA_GOLDTHORN_TEA = 1133, + DRINK_AURA_ENRICHED_MANNA_BISCUIT = 18071, + DRINK_AURA_GREEN_TEA_LEAF = 833, + DRINK_AURA_CONJURED_PURIFIED_WATER = 432, + DRINK_AURA_CONJURED_SPARKLING_WATER = 1137, + DRINK_AURA_STAR_TEAR = 27089, + DRINK_AURA_NAARU_RATION = 44166, + DRINK_AURA_MOONBERRY_JUICE = 1135, + DRINK_AURA_SILVERWINE = 34291, + DRINK_AURA_FULL_MOONSHINE = 438, + DRINK_AURA_DOS_OGRIS = 27089, + DRINK_AURA_ESSENCE_MANGO = 24384, + DRINK_AURA_SENGGIN_ROOT = 2639, + DRINK_AURA_BLENDED_BEAN_BREW = 431, + DRINK_AURA_SAGEFISH_DELIGHT = 25691, + DRINK_AURA_SPARKLING_SOUTHSHORE_CIDER = 27089, + DRINK_AURA_CONJURED_MANA_BISCUIT = 44166, + DRINK_AURA_FROSTBERRY_JUICE = 27089 +}; + +#endif From 7f982904dbd2a012c8e30346582c5b01ff811a83 Mon Sep 17 00:00:00 2001 From: Nicolas Lebacq Date: Wed, 28 Jan 2026 22:26:37 +0100 Subject: [PATCH 002/222] fix: Improper singletons migration to clean Meyer's singletons. (#4) * fix: Changed PlayerbotsMgr to be a true Meyer's singleton passed by reference. * fix: Migrated PlayerbotAIConfig to a clean singleton pattern instead of a pointer. * fix: Migrated RandomItemMgr to a clean singleton pattern. * fix: Migrated SharedValueContext to a clean singleton pattern. * fix: Migrated PlayerbotCommandServer to a clean singleton instead of using a pointer. * fix: Migrated PerfMonitor to a clean singleton instead of using a pointer. * fix: Migrated FlightMasterCache to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotDungeonRepository to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotRepository to a clean singleton without using a pointer. * fix: Migrated PlayerbotSpellRepository to a clean singleton instead of using a pointer. * fix: Migrated GuildTaskMgr to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotGuildMgr to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotTextMgr to a clean singletong instead of using a pointer. * fix: Migrated TravelMgr to a clean singleton instead of using a pointer. * fix: Migrated TravelNodeMap to a clean singleton instead of a pointer and removed unused, misleading public constructor on the same class. * fix: Migrated PlayerbotWorldThreadProcessor to a clean singleton instead of using a pointer. * fix: Migrated ServerFacade to a clean singleton instead of a pointer. * chore: Removed unnecessary const from move constructor/operator. --- src/Bot/PlayerbotAI.cpp | 230 +++++++++--------- src/Db/PlayerbotSpellRepository.cpp | 1 + src/Mgr/Guild/PlayerbotGuildMgr.h | 2 +- src/Mgr/Text/PlayerbotTextMgr.h | 1 + .../PlayerbotWorldThreadProcessor.cpp | 1 + .../WorldThr/PlayerbotWorldThreadProcessor.h | 1 + .../inspector/global/GlobalPlayerInspector.h | 4 +- 7 files changed, 122 insertions(+), 118 deletions(-) diff --git a/src/Bot/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp index 7aee754621..6ac54a9e1a 100644 --- a/src/Bot/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -151,7 +151,7 @@ PlayerbotAI::PlayerbotAI(Player* bot) engines[BOT_STATE_COMBAT] = AiFactory::createCombatEngine(bot, this, aiObjectContext); engines[BOT_STATE_NON_COMBAT] = AiFactory::createNonCombatEngine(bot, this, aiObjectContext); engines[BOT_STATE_DEAD] = AiFactory::createDeadEngine(bot, this, aiObjectContext); - if (sPlayerbotAIConfig->applyInstanceStrategies) + if (sPlayerbotAIConfig.applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId()); currentEngine = engines[BOT_STATE_NON_COMBAT]; currentState = BOT_STATE_NON_COMBAT; @@ -231,7 +231,7 @@ PlayerbotAI::~PlayerbotAI() delete aiObjectContext; if (bot) - sPlayerbotsMgr->RemovePlayerBotData(bot->GetGUID(), true); + PlayerbotsMgr::instance().RemovePlayerBotData(bot->GetGUID(), true); } void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) @@ -249,7 +249,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) // Handle cheat options (set bot health and power if cheats are enabled) if (bot->IsAlive() && - (static_cast(GetCheat()) > 0 || static_cast(sPlayerbotAIConfig->botCheatMask) > 0)) + (static_cast(GetCheat()) > 0 || static_cast(sPlayerbotAIConfig.botCheatMask) > 0)) { if (HasCheat(BotCheatMask::health)) bot->SetFullHealth(); @@ -330,7 +330,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) if (spellTarget && !bot->HasInArc(CAST_ANGLE_IN_FRONT, spellTarget) && (spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT)) { - sServerFacade->SetFacingTo(bot, spellTarget); + ServerFacade::instance().SetFacingTo(bot, spellTarget); } // Wait for spell cast @@ -385,7 +385,7 @@ void PlayerbotAI::UpdateAIGroupMaster() Group* group = bot->GetGroup(); - bool IsRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot); + bool IsRandomBot = sRandomPlayerbotMgr.IsRandomBot(bot); // If bot is not in group verify that for is RandomBot before clearing master and resetting. if (!group) @@ -449,7 +449,7 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal std::string const mapString = WorldPosition(bot).isOverworld() ? std::to_string(bot->GetMapId()) : "I"; PerfMonitorOperation* pmo = - sPerfMonitor->start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); + sPerfMonitor.start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); ExternalEventHelper helper(aiObjectContext); // chat replies @@ -501,12 +501,12 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal } else { - sRandomPlayerbotMgr->LogoutPlayerBot(bot->GetGUID()); + sRandomPlayerbotMgr.LogoutPlayerBot(bot->GetGUID()); } return; } - SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); return; } @@ -581,10 +581,10 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr if (type == CHAT_MSG_SYSTEM) return; - if (filtered.find(sPlayerbotAIConfig->commandSeparator) != std::string::npos) + if (filtered.find(sPlayerbotAIConfig.commandSeparator) != std::string::npos) { std::vector commands; - split(commands, filtered, sPlayerbotAIConfig->commandSeparator.c_str()); + split(commands, filtered, sPlayerbotAIConfig.commandSeparator.c_str()); for (std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { HandleCommand(type, *i, fromPlayer); @@ -592,12 +592,12 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr return; } - if (!sPlayerbotAIConfig->commandPrefix.empty()) + if (!sPlayerbotAIConfig.commandPrefix.empty()) { - if (filtered.find(sPlayerbotAIConfig->commandPrefix) != 0) + if (filtered.find(sPlayerbotAIConfig.commandPrefix) != 0) return; - filtered = filtered.substr(sPlayerbotAIConfig->commandPrefix.size()); + filtered = filtered.substr(sPlayerbotAIConfig.commandPrefix.size()); } if (chatMap.empty()) @@ -629,7 +629,7 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_ADDON, response.c_str(), LANG_ADDON, CHAT_TAG_NONE, bot->GetGUID(), bot->GetName()); - sServerFacade->SendPacket(&fromPlayer, &data); + ServerFacade::instance().SendPacket(&fromPlayer, &data); return; } @@ -759,10 +759,10 @@ void PlayerbotAI::HandleTeleportAck() } // apply instance-related strategies after map attach - if (sPlayerbotAIConfig->applyInstanceStrategies) + if (sPlayerbotAIConfig.applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId(), true); - if (sPlayerbotAIConfig->restrictHealerDPS) + if (sPlayerbotAIConfig.restrictHealerDPS) EvaluateHealerDpsStrategy(); // reset AI state after teleport @@ -853,7 +853,7 @@ void PlayerbotAI::Reset(bool full) aiObjectContext->GetValue("last taxi")->Get().Set(nullptr); aiObjectContext->GetValue("travel target") ->Get() - ->setTarget(sTravelMgr->nullTravelDestination, sTravelMgr->nullWorldPosition, true); + ->setTarget(TravelMgr::instance().nullTravelDestination, TravelMgr::instance().nullWorldPosition, true); aiObjectContext->GetValue("travel target")->Get()->setStatus(TRAVEL_STATUS_EXPIRED); aiObjectContext->GetValue("travel target")->Get()->setExpireIn(1000); rpgInfo = NewRpgInfo(); @@ -918,10 +918,10 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro if (type == CHAT_MSG_SYSTEM) return; - if (text.find(sPlayerbotAIConfig->commandSeparator) != std::string::npos) + if (text.find(sPlayerbotAIConfig.commandSeparator) != std::string::npos) { std::vector commands; - split(commands, text, sPlayerbotAIConfig->commandSeparator.c_str()); + split(commands, text, sPlayerbotAIConfig.commandSeparator.c_str()); for (std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { HandleCommand(type, *i, fromPlayer); @@ -931,12 +931,12 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro } std::string filtered = text; - if (!sPlayerbotAIConfig->commandPrefix.empty()) + if (!sPlayerbotAIConfig.commandPrefix.empty()) { - if (filtered.find(sPlayerbotAIConfig->commandPrefix) != 0) + if (filtered.find(sPlayerbotAIConfig.commandPrefix) != 0) return; - filtered = filtered.substr(sPlayerbotAIConfig->commandPrefix.size()); + filtered = filtered.substr(sPlayerbotAIConfig.commandPrefix.size()); } if (chatMap.empty()) @@ -1098,7 +1098,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) } case SMSG_MESSAGECHAT: // do not react to self or if not ready to reply { - if (!sPlayerbotAIConfig->randomBotTalk) + if (!sPlayerbotAIConfig.randomBotTalk) return; if (!AllowActivity()) @@ -1154,7 +1154,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) bool isFromFreeBot = false; sCharacterCache->GetCharacterNameByGuid(guid1, name); uint32 accountId = sCharacterCache->GetCharacterAccountIdByGuid(guid1); - isFromFreeBot = sPlayerbotAIConfig->IsInRandomAccountList(accountId); + isFromFreeBot = sPlayerbotAIConfig.IsInRandomAccountList(accountId); bool isMentioned = message.find(bot->GetName()) != std::string::npos; // ChatChannelSource chatChannelSource = GetChatChannelSource(bot, msgtype, chanName); @@ -1172,20 +1172,20 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) if (lang == LANG_ADDON) return; - if (message.starts_with(sPlayerbotAIConfig->toxicLinksPrefix) && + if (message.starts_with(sPlayerbotAIConfig.toxicLinksPrefix) && (GetChatHelper()->ExtractAllItemIds(message).size() > 0 || GetChatHelper()->ExtractAllQuestIds(message).size() > 0) && - sPlayerbotAIConfig->toxicLinksRepliesChance) + sPlayerbotAIConfig.toxicLinksRepliesChance) { - if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig->toxicLinksRepliesChance) + if (urand(0, 50) > 0 || urand(1, 100) > sPlayerbotAIConfig.toxicLinksRepliesChance) { return; } } else if ((GetChatHelper()->ExtractAllItemIds(message).count(19019) && - sPlayerbotAIConfig->thunderfuryRepliesChance)) + sPlayerbotAIConfig.thunderfuryRepliesChance)) { - if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig->thunderfuryRepliesChance) + if (urand(0, 60) > 0 || urand(1, 100) > sPlayerbotAIConfig.thunderfuryRepliesChance) { return; } @@ -1195,8 +1195,8 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) if (isFromFreeBot && urand(0, 20)) return; - // if (msgtype == CHAT_MSG_GUILD && (!sPlayerbotAIConfig->guildRepliesRate || urand(1, 100) >= - // sPlayerbotAIConfig->guildRepliesRate)) return; + // if (msgtype == CHAT_MSG_GUILD && (!sPlayerbotAIConfig.guildRepliesRate || urand(1, 100) >= + // sPlayerbotAIConfig.guildRepliesRate)) return; if (!isFromFreeBot) { @@ -1283,7 +1283,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet) // bot->GetMotionMaster()->MoveKnockbackFrom(fx, fy, horizontalSpeed, verticalSpeed); // // set delay based on actual distance - // float newdis = sqrt(sServerFacade->GetDistance2d(bot, fx, fy)); + // float newdis = sqrt(ServerFacade::instance().GetDistance2d(bot, fx, fy)); // SetNextCheckDelay((uint32)((newdis / dis) * moveTimeHalf * 4 * IN_MILLISECONDS)); // // add moveflags @@ -1345,9 +1345,9 @@ int32 PlayerbotAI::CalculateGlobalCooldown(uint32 spellid) return 0; if (bot->HasSpellCooldown(spellid)) - return sPlayerbotAIConfig->globalCoolDown; + return sPlayerbotAIConfig.globalCoolDown; - return sPlayerbotAIConfig->reactDelay; + return sPlayerbotAIConfig.reactDelay; } void PlayerbotAI::HandleMasterIncomingPacket(WorldPacket const& packet) @@ -1408,7 +1408,7 @@ void PlayerbotAI::DoNextAction(bool min) { if (!bot->IsInWorld() || bot->IsBeingTeleported() || (GetMaster() && GetMaster()->IsBeingTeleported())) { - SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); return; } @@ -1470,7 +1470,7 @@ void PlayerbotAI::DoNextAction(bool min) if (!bot->isAFK() && !bot->InBattleground() && !HasRealPlayerMaster()) bot->ToggleAFK(); - SetNextCheckDelay(sPlayerbotAIConfig->passiveDelay); + SetNextCheckDelay(sPlayerbotAIConfig.passiveDelay); return; } else if (bot->isAFK()) @@ -1478,7 +1478,7 @@ void PlayerbotAI::DoNextAction(bool min) if (master && master->IsInWorld()) { - float distance = sServerFacade->GetDistance2d(bot, master); + float distance = ServerFacade::instance().GetDistance2d(bot, master); if (master->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING) && distance < 20.0f) bot->m_movementInfo.AddMovementFlag(MOVEMENTFLAG_WALKING); @@ -1712,7 +1712,7 @@ bool PlayerbotAI::PlayEmote(uint32 emote) WorldPacket data(SMSG_TEXT_EMOTE); data << (TextEmotes)emote; data << EmoteAction::GetNumberOfEmoteVariants((TextEmotes)emote, bot->getRace(), bot->getGender()); - data << ((master && (sServerFacade->GetDistance2d(bot, master) < 30.0f) && urand(0, 1)) ? master->GetGUID() + data << ((master && (ServerFacade::instance().GetDistance2d(bot, master) < 30.0f) && urand(0, 1)) ? master->GetGUID() : (bot->GetTarget() && urand(0, 1)) ? bot->GetTarget() : ObjectGuid::Empty); bot->GetSession()->HandleTextEmoteOpcode(data); @@ -1741,14 +1741,14 @@ void PlayerbotAI::ResetStrategies(bool load) AiFactory::AddDefaultCombatStrategies(bot, this, engines[BOT_STATE_COMBAT]); AiFactory::AddDefaultNonCombatStrategies(bot, this, engines[BOT_STATE_NON_COMBAT]); AiFactory::AddDefaultDeadStrategies(bot, this, engines[BOT_STATE_DEAD]); - if (sPlayerbotAIConfig->applyInstanceStrategies) + if (sPlayerbotAIConfig.applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId()); for (uint8 i = 0; i < BOT_STATE_MAX; i++) engines[i]->Init(); // if (load) - // sPlayerbotRepository->Load(this); + // PlayerbotRepository::instance().Load(this); } bool PlayerbotAI::IsRanged(Player* player, bool bySpec) @@ -2726,7 +2726,7 @@ bool PlayerbotAI::SayToParty(const std::string& msg) for (auto reciever : GetPlayersInGroup()) { - sServerFacade->SendPacket(reciever, &data); + ServerFacade::instance().SendPacket(reciever, &data); } return true; @@ -2743,7 +2743,7 @@ bool PlayerbotAI::SayToRaid(const std::string& msg) for (auto reciever : GetPlayersInGroup()) { - sServerFacade->SendPacket(reciever, &data); + ServerFacade::instance().SendPacket(reciever, &data); } return true; @@ -2810,7 +2810,7 @@ bool PlayerbotAI::TellMasterNoFacing(std::string const text, PlayerbotSecurityLe masterBotAI = GET_PLAYERBOT_AI(master); if ((!master || (masterBotAI && !masterBotAI->IsRealPlayer())) && - (sPlayerbotAIConfig->randomBotSayWithoutMaster || HasStrategy("debug", BOT_STATE_NON_COMBAT))) + (sPlayerbotAIConfig.randomBotSayWithoutMaster || HasStrategy("debug", BOT_STATE_NON_COMBAT))) { bot->Say(text, (bot->GetTeamId() == TEAM_ALLIANCE ? LANG_COMMON : LANG_ORCISH)); return true; @@ -2821,7 +2821,7 @@ bool PlayerbotAI::TellMasterNoFacing(std::string const text, PlayerbotSecurityLe time_t lastSaid = whispers[text]; - if (!lastSaid || (time(nullptr) - lastSaid) >= sPlayerbotAIConfig->repeatDelay / 1000) + if (!lastSaid || (time(nullptr) - lastSaid) >= sPlayerbotAIConfig.repeatDelay / 1000) { whispers[text] = time(nullptr); @@ -2859,10 +2859,10 @@ bool PlayerbotAI::IsTellAllowed(PlayerbotSecurityLevel securityLevel) if (!GetSecurity()->CheckLevelFor(securityLevel, true, master)) return false; - if (sPlayerbotAIConfig->whisperDistance && !bot->GetGroup() && sRandomPlayerbotMgr->IsRandomBot(bot) && + if (sPlayerbotAIConfig.whisperDistance && !bot->GetGroup() && sRandomPlayerbotMgr.IsRandomBot(bot) && master->GetSession()->GetSecurity() < SEC_GAMEMASTER && (bot->GetMapId() != master->GetMapId() || - sServerFacade->GetDistance2d(bot, master) > sPlayerbotAIConfig->whisperDistance)) + ServerFacade::instance().GetDistance2d(bot, master) > sPlayerbotAIConfig.whisperDistance)) return false; return true; @@ -2877,7 +2877,7 @@ bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel secu { if (!master) { - if (sPlayerbotAIConfig->randomBotSayWithoutMaster) + if (sPlayerbotAIConfig.randomBotSayWithoutMaster) return TellMasterNoFacing(text, securityLevel); } if (!TellMasterNoFacing(text, securityLevel)) @@ -2886,7 +2886,7 @@ bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel secu if (!bot->isMoving() && !bot->IsInCombat() && bot->GetMapId() == master->GetMapId() && !bot->HasUnitState(UNIT_STATE_IN_FLIGHT) && !bot->IsFlying()) { - if (!bot->HasInArc(EMOTE_ANGLE_IN_FRONT, master, sPlayerbotAIConfig->sightDistance)) + if (!bot->HasInArc(EMOTE_ANGLE_IN_FRONT, master, sPlayerbotAIConfig.sightDistance)) bot->SetFacingToObject(master); bot->HandleEmoteCommand(EMOTE_ONESHOT_TALK); @@ -3100,7 +3100,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, { if (!spellid) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. No spellid. - spellid: {}, bot name: {}", spellid, bot->GetName()); @@ -3110,7 +3110,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Unit state lost control. - spellid: {}, bot name: {}", spellid, bot->GetName()); @@ -3130,7 +3130,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (checkHasSpell && !bot->HasSpell(spellid)) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Bot not has spell. - target name: {}, spellid: {}, bot name: {}", @@ -3141,7 +3141,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG( "playerbots", @@ -3153,7 +3153,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (bot->HasSpellCooldown(spellid)) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. Spell not has cooldown. - target name: {}, spellid: {}, bot name: {}", @@ -3165,7 +3165,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); if (!spellInfo) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Can cast spell failed. No spellInfo. - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3175,7 +3175,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if ((bot->GetShapeshiftForm() == FORM_FLIGHT || bot->GetShapeshiftForm() == FORM_FLIGHT_EPIC) && !bot->IsInCombat()) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG( "playerbots", @@ -3189,7 +3189,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, // bool interruptOnMove = spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT; if ((CastingTime || spellInfo->IsAutoRepeatRangedSpell()) && bot->isMoving()) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "Casting time and bot is moving - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3204,7 +3204,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, { if (spellid != 44572) // Deep Freeze { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "target is immuned to spell - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3214,9 +3214,9 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, // Otherwise, allow Deep Freeze even if immune } - if (bot != target && sServerFacade->GetDistance2d(bot, target) > sPlayerbotAIConfig->sightDistance) + if (bot != target && ServerFacade::instance().GetDistance2d(bot, target) > sPlayerbotAIConfig.sightDistance) { - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "target is out of sight distance - target name: {}, spellid: {}, bot name: {}", target->GetName(), spellid, bot->GetName()); @@ -3242,7 +3242,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, SpellCastResult result = spell->CheckCast(true); delete spell; - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // if (result != SPELL_FAILED_NOT_READY && result != SPELL_CAST_OK) // { @@ -3266,7 +3266,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, case SPELL_FAILED_OUT_OF_RANGE: return true; default: - if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) { LOG_DEBUG("playerbots", "CanCastSpell Check Failed. - target name: {}, spellid: {}, bot name: {}, result: {}", @@ -3302,7 +3302,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, GameObject* goTarget, bool checkH if (CastingTime > 0 && bot->isMoving()) return false; - if (sServerFacade->GetDistance2d(bot, goTarget) > sPlayerbotAIConfig->sightDistance) + if (ServerFacade::instance().GetDistance2d(bot, goTarget) > sPlayerbotAIConfig.sightDistance) return false; // ObjectGuid oldSel = bot->GetTarget(); @@ -3355,7 +3355,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, float x, float y, float z, bool c if (!itemTarget) { - if (bot->GetDistance(x, y, z) > sPlayerbotAIConfig->sightDistance) + if (bot->GetDistance(x, y, z) > sPlayerbotAIConfig.sightDistance) return false; } @@ -3457,7 +3457,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (bot->IsFlying() || bot->HasUnitState(UNIT_STATE_IN_FLIGHT)) { - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast is flying - target name: {}, spellid: {}, bot name: {}}", // target->GetName(), spellId, bot->GetName()); @@ -3480,13 +3480,13 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) WorldObject* faceTo = target; if (!bot->HasInArc(CAST_ANGLE_IN_FRONT, faceTo) && (spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT)) { - sServerFacade->SetFacingTo(bot, faceTo); + ServerFacade::instance().SetFacingTo(bot, faceTo); // failWithDelay = true; } if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); return false; } @@ -3503,7 +3503,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) { bot->GetTradeData()->SetSpell(spellId); delete spell; - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast no item - target name: {}, spellid: {}, bot name: {}", // target->GetName(), spellId, bot->GetName()); @@ -3565,7 +3565,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (bot->isMoving() && spell->GetCastTime()) { // bot->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); spell->cancel(); delete spell; return false; @@ -3573,7 +3573,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) // spell->m_targets.SetUnitTarget(target); // SpellCastResult spellSuccess = spell->CheckCast(true); - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast result - target name: {}, spellid: {}, bot name: {}, result: {}", // target->GetName(), spellId, bot->GetName(), spellSuccess); @@ -3585,7 +3585,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) if (result != SPELL_CAST_OK) { - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast failed. - target name: {}, spellid: {}, bot name: {}, result: {}", // target->GetName(), spellId, bot->GetName(), result); @@ -3653,7 +3653,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) // { // spell->cancel(); // delete spell; - // if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) + // if (!sPlayerbotAIConfig.logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) // { // LOG_DEBUG("playerbots", "Spell cast loot - target name: {}, spellid: {}, bot name: {}", // target->GetName(), spellId, bot->GetName()); @@ -3733,7 +3733,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); return false; } @@ -3776,7 +3776,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite if (bot->isMoving() && spell->GetCastTime()) { // bot->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); spell->cancel(); delete spell; return false; @@ -3854,12 +3854,12 @@ bool PlayerbotAI::CanCastVehicleSpell(uint32 spellId, Unit* target) if (CastingTime && vehicleBase->isMoving()) return false; - if (vehicleBase != spellTarget && sServerFacade->GetDistance2d(vehicleBase, spellTarget) > 120.0f) + if (vehicleBase != spellTarget && ServerFacade::instance().GetDistance2d(vehicleBase, spellTarget) > 120.0f) return false; if (!target && siegePos.isSet()) { - if (sServerFacade->GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) + if (ServerFacade::instance().GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) return false; } @@ -3929,7 +3929,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) PositionInfo siegePos = GetAiObjectContext()->GetValue("position")->Get()["bg siege"]; if (!target && siegePos.isSet()) { - if (sServerFacade->GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) + if (ServerFacade::instance().GetDistance2d(vehicleBase, siegePos.x, siegePos.y) > 120.0f) return false; } @@ -3967,7 +3967,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) if (failWithDelay) { - SetNextCheckDelay(sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(sPlayerbotAIConfig.reactDelay); return false; } @@ -4008,7 +4008,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) if (seat->CanControl() && vehicleBase->isMoving() && spell->GetCastTime()) { vehicleBase->StopMoving(); - SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); + SetNextCheckDelay(sPlayerbotAIConfig.globalCoolDown); spell->cancel(); // delete spell; return false; @@ -4085,7 +4085,7 @@ void PlayerbotAI::WaitForSpellCast(Spell* spell) castTime += duration; } - SetNextCheckDelay(castTime + sPlayerbotAIConfig->reactDelay); + SetNextCheckDelay(castTime + sPlayerbotAIConfig.reactDelay); } void PlayerbotAI::InterruptSpell() @@ -4177,8 +4177,8 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType) if (!aura || aura->IsPassive() || aura->IsRemoved()) continue; - if (sPlayerbotAIConfig->dispelAuraDuration && aura->GetDuration() && - aura->GetDuration() < (int32)sPlayerbotAIConfig->dispelAuraDuration) + if (sPlayerbotAIConfig.dispelAuraDuration && aura->GetDuration() && + aura->GetDuration() < (int32)sPlayerbotAIConfig.dispelAuraDuration) continue; SpellInfo const* spellInfo = aura->GetSpellInfo(); @@ -4298,7 +4298,7 @@ bool PlayerbotAI::HasRealPlayerMaster() bool PlayerbotAI::HasActivePlayerMaster() { return master && !GET_PLAYERBOT_AI(master); } -bool PlayerbotAI::IsAlt() { return HasRealPlayerMaster() && !sRandomPlayerbotMgr->IsRandomBot(bot); } +bool PlayerbotAI::IsAlt() { return HasRealPlayerMaster() && !sRandomPlayerbotMgr.IsRandomBot(bot); } Player* PlayerbotAI::GetGroupLeader() { @@ -4387,7 +4387,7 @@ bool PlayerbotAI::HasPlayerNearby(WorldPosition* pos, float range) { float sqRange = range * range; bool nearPlayer = false; - for (auto& player : sRandomPlayerbotMgr->GetPlayers()) + for (auto& player : sRandomPlayerbotMgr.GetPlayers()) { if (!player->IsGameMaster() || player->isGMVisible()) { @@ -4421,9 +4421,9 @@ bool PlayerbotAI::HasManyPlayersNearby(uint32 trigerrValue, float range) float sqRange = range * range; uint32 found = 0; - for (auto& player : sRandomPlayerbotMgr->GetPlayers()) + for (auto& player : sRandomPlayerbotMgr.GetPlayers()) { - if ((!player->IsGameMaster() || player->isGMVisible()) && sServerFacade->GetDistance2d(player, bot) < sqRange) + if ((!player->IsGameMaster() || player->isGMVisible()) && ServerFacade::instance().GetDistance2d(player, bot) < sqRange) { found++; @@ -4469,7 +4469,7 @@ inline bool ZoneHasRealPlayers(Player* bot) return false; } - for (Player* player : sRandomPlayerbotMgr->GetPlayers()) + for (Player* player : sRandomPlayerbotMgr.GetPlayers()) { if (player->GetMapId() != bot->GetMapId()) continue; @@ -4500,7 +4500,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) return false; // when botActiveAlone is 100% and smartScale disabled - if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale) + if (sPlayerbotAIConfig.botActiveAlone >= 100 && !sPlayerbotAIConfig.botActiveAloneSmartScale) { return true; } @@ -4518,7 +4518,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) // which prevents unneeded expensive GameTime calls. if (_isBotInitializing) { - _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.11; + _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig.maxRandomBots * 0.11; // no activity allowed during bot initialization if (_isBotInitializing) @@ -4540,7 +4540,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // bot map has active players. - if (sPlayerbotAIConfig->BotActiveAloneForceWhenInMap) + if (sPlayerbotAIConfig.BotActiveAloneForceWhenInMap) { if (HasRealPlayers(bot->GetMap())) { @@ -4549,7 +4549,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // bot zone has active players. - if (sPlayerbotAIConfig->BotActiveAloneForceWhenInZone) + if (sPlayerbotAIConfig.BotActiveAloneForceWhenInZone) { if (ZoneHasRealPlayers(bot)) { @@ -4558,7 +4558,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // when in real guild - if (sPlayerbotAIConfig->BotActiveAloneForceWhenInGuild) + if (sPlayerbotAIConfig.BotActiveAloneForceWhenInGuild) { if (IsInRealGuild()) { @@ -4567,7 +4567,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // Player is near. Always active. - if (HasPlayerNearby(sPlayerbotAIConfig->BotActiveAloneForceWhenInRadius)) + if (HasPlayerNearby(sPlayerbotAIConfig.BotActiveAloneForceWhenInRadius)) { return true; } @@ -4639,13 +4639,13 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) } // HasFriend - if (sPlayerbotAIConfig->BotActiveAloneForceWhenIsFriend) + if (sPlayerbotAIConfig.BotActiveAloneForceWhenIsFriend) { // shouldnt be needed analyse in future if (!bot->GetGUID()) return false; - for (auto& player : sRandomPlayerbotMgr->GetPlayers()) + for (auto& player : sRandomPlayerbotMgr.GetPlayers()) { if (!player || !player->GetSession() || !player->IsInWorld() || player->IsDuringRemoveFromWorld() || player->GetSession()->isLogingOut()) @@ -4677,7 +4677,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) return false; } - if (sPlayerbotAIConfig->botActiveAlone <= 0) + if (sPlayerbotAIConfig.botActiveAlone <= 0) { return false; } @@ -4689,19 +4689,19 @@ bool PlayerbotAI::AllowActive(ActivityType activityType) // Below is code to have a specified % of bots active at all times. // The default is 100%. With 1% of all bots going active or inactive each minute. - uint32 mod = sPlayerbotAIConfig->botActiveAlone > 100 ? 100 : sPlayerbotAIConfig->botActiveAlone; - if (sPlayerbotAIConfig->botActiveAloneSmartScale && - bot->GetLevel() >= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMinLevel && - bot->GetLevel() <= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMaxLevel) + uint32 mod = sPlayerbotAIConfig.botActiveAlone > 100 ? 100 : sPlayerbotAIConfig.botActiveAlone; + if (sPlayerbotAIConfig.botActiveAloneSmartScale && + bot->GetLevel() >= sPlayerbotAIConfig.botActiveAloneSmartScaleWhenMinLevel && + bot->GetLevel() <= sPlayerbotAIConfig.botActiveAloneSmartScaleWhenMaxLevel) { mod = AutoScaleActivity(mod); } uint32 ActivityNumber = - GetFixedBotNumer(100, sPlayerbotAIConfig->botActiveAlone * static_cast(mod) / 100 * 0.01f); + GetFixedBotNumer(100, sPlayerbotAIConfig.botActiveAlone * static_cast(mod) / 100 * 0.01f); return ActivityNumber <= - (sPlayerbotAIConfig->botActiveAlone * mod) / + (sPlayerbotAIConfig.botActiveAlone * mod) / 100; // The given percentage of bots should be active and rotate 1% of those active bots each minute. } @@ -4733,8 +4733,8 @@ uint32 PlayerbotAI::AutoScaleActivity(uint32 mod) { // Current max server update time (ms), and the configured floor/ceiling values for bot scaling uint32 maxDiff = sWorldUpdateTime.GetMaxUpdateTimeOfCurrentTable(); - uint32 diffLimitFloor = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitfloor; - uint32 diffLimitCeiling = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitCeiling; + uint32 diffLimitFloor = sPlayerbotAIConfig.botActiveAloneSmartScaleDiffLimitfloor; + uint32 diffLimitCeiling = sPlayerbotAIConfig.botActiveAloneSmartScaleDiffLimitCeiling; if (diffLimitCeiling <= diffLimitFloor) { @@ -5326,19 +5326,19 @@ float PlayerbotAI::GetRange(std::string const type) return val; if (type == "spell") - return sPlayerbotAIConfig->spellDistance; + return sPlayerbotAIConfig.spellDistance; if (type == "shoot") - return sPlayerbotAIConfig->shootDistance; + return sPlayerbotAIConfig.shootDistance; if (type == "flee") - return sPlayerbotAIConfig->fleeDistance; + return sPlayerbotAIConfig.fleeDistance; if (type == "heal") - return sPlayerbotAIConfig->healDistance; + return sPlayerbotAIConfig.healDistance; if (type == "melee") - return sPlayerbotAIConfig->meleeDistance; + return sPlayerbotAIConfig.meleeDistance; return 0; } @@ -6007,7 +6007,7 @@ bool PlayerbotAI::IsInRealGuild() if (!bot->GetGuildId()) return false; - return sPlayerbotGuildMgr->IsRealGuild(bot->GetGuildId()); + return PlayerbotGuildMgr::instance().IsRealGuild(bot->GetGuildId()); } void PlayerbotAI::QueueChatResponse(const ChatQueuedReply chatReply) { chatReplies.push_back(std::move(chatReply)); } @@ -6561,17 +6561,17 @@ std::set PlayerbotAI::GetCurrentIncompleteQuestIds() uint32 PlayerbotAI::GetReactDelay() { - uint32 base = sPlayerbotAIConfig->reactDelay; // Default 100(ms) + uint32 base = sPlayerbotAIConfig.reactDelay; // Default 100(ms) // If dynamic react delay is disabled, use a static calculation - if (!sPlayerbotAIConfig->dynamicReactDelay) + if (!sPlayerbotAIConfig.dynamicReactDelay) { if (HasRealPlayerMaster()) return base; bool inBG = bot->InBattleground() || bot->InArena(); - if (sPlayerbotAIConfig->fastReactInBG && inBG) + if (sPlayerbotAIConfig.fastReactInBG && inBG) return base; bool inCombat = bot->IsInCombat(); @@ -6596,11 +6596,11 @@ uint32 PlayerbotAI::GetReactDelay() { if (bot->IsInCombat() || currentState == BOT_STATE_COMBAT) { - return static_cast(base * (sPlayerbotAIConfig->fastReactInBG ? 2.5f : 5.0f)); + return static_cast(base * (sPlayerbotAIConfig.fastReactInBG ? 2.5f : 5.0f)); } else { - return static_cast(base * (sPlayerbotAIConfig->fastReactInBG ? 1.0f : 10.0f)); + return static_cast(base * (sPlayerbotAIConfig.fastReactInBG ? 1.0f : 10.0f)); } } @@ -6773,7 +6773,7 @@ void PlayerbotAI::EvaluateHealerDpsStrategy() if (!IsHeal(bot, true)) return; - if (sPlayerbotAIConfig->IsRestrictedHealerDPSMap(bot->GetMapId())) + if (sPlayerbotAIConfig.IsRestrictedHealerDPSMap(bot->GetMapId())) ChangeStrategy("-healer dps", BOT_STATE_COMBAT); else ChangeStrategy("+healer dps", BOT_STATE_COMBAT); diff --git a/src/Db/PlayerbotSpellRepository.cpp b/src/Db/PlayerbotSpellRepository.cpp index d745ba3074..7cb6dfaffc 100644 --- a/src/Db/PlayerbotSpellRepository.cpp +++ b/src/Db/PlayerbotSpellRepository.cpp @@ -7,6 +7,7 @@ #include "PlayerbotSpellRepository.h" + // caches the result set void PlayerbotSpellRepository::Initialize() { diff --git a/src/Mgr/Guild/PlayerbotGuildMgr.h b/src/Mgr/Guild/PlayerbotGuildMgr.h index 5d85ce9e79..499a33e606 100644 --- a/src/Mgr/Guild/PlayerbotGuildMgr.h +++ b/src/Mgr/Guild/PlayerbotGuildMgr.h @@ -54,4 +54,4 @@ class PlayerbotGuildMgr void PlayerBotsGuildValidationScript(); -#endif +#endif \ No newline at end of file diff --git a/src/Mgr/Text/PlayerbotTextMgr.h b/src/Mgr/Text/PlayerbotTextMgr.h index 398d7640ab..5f173fdd16 100644 --- a/src/Mgr/Text/PlayerbotTextMgr.h +++ b/src/Mgr/Text/PlayerbotTextMgr.h @@ -100,6 +100,7 @@ class PlayerbotTextMgr PlayerbotTextMgr(PlayerbotTextMgr&&) = delete; PlayerbotTextMgr& operator=(PlayerbotTextMgr&&) = delete; + std::map> botTexts; std::map botTextChance; uint32 botTextLocalePriority[MAX_LOCALES]; diff --git a/src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp index 3679d3169a..f84bf62174 100644 --- a/src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp +++ b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp @@ -10,6 +10,7 @@ #include "Timer.h" #include "Log.h" + void PlayerbotWorldThreadProcessor::Update(uint32 diff) { if (!m_enabled) diff --git a/src/Script/WorldThr/PlayerbotWorldThreadProcessor.h b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.h index e975b8fbdb..94b91b97ba 100644 --- a/src/Script/WorldThr/PlayerbotWorldThreadProcessor.h +++ b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.h @@ -14,6 +14,7 @@ #include "PlayerbotOperation.h" + /** * @brief Processes thread-unsafe bot operations in the world thread * diff --git a/src/domain/player/inspector/global/GlobalPlayerInspector.h b/src/domain/player/inspector/global/GlobalPlayerInspector.h index 7c1f0adf72..7b4a7b0164 100644 --- a/src/domain/player/inspector/global/GlobalPlayerInspector.h +++ b/src/domain/player/inspector/global/GlobalPlayerInspector.h @@ -71,7 +71,7 @@ class GlobalPlayerInspector : public AbstractPlayerInspector if (this->hasHostileUnitsInRange(15.0f)) return false; - PlayerbotAI* botAI = PlayerbotsMgr::instance()->GetPlayerbotAI(player); + PlayerbotAI* botAI = PlayerbotsMgr::instance().GetPlayerbotAI(player); if (botAI == nullptr) return false; @@ -100,7 +100,7 @@ class GlobalPlayerInspector : public AbstractPlayerInspector Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(player, 15.0f); Acore::UnitListSearcher searcher(player, targets, u_check); - Cell::VisitObjects(player, searcher, PlayerbotAIConfig::instance()->sightDistance); + Cell::VisitObjects(player, searcher, PlayerbotAIConfig::instance().sightDistance); return !targets.empty(); } From 8172cc8f3408c0db33360a28824028fd00bc40dc Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 10:52:16 +0100 Subject: [PATCH 003/222] fix: Resolved a warning in NextAction constructor. --- src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp | 6 +++--- src/Bot/Engine/Action/Action.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp b/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp index 96d61d4ba3..e302927ac8 100644 --- a/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp +++ b/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp @@ -6,9 +6,9 @@ #include "AcceptBattlegroundInvitationAction.h" #include "Event.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" -bool AcceptBgInvitationAction::Execute(Event event) +bool AcceptBgInvitationAction::Execute(Event) { uint8 type = 0; // arenatype if arena uint8 unk2 = 0; // unk, can be 0x0 (may be if was invited?) and 0x1 @@ -18,9 +18,9 @@ bool AcceptBgInvitationAction::Execute(Event event) WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); packet << type << unk2 << (uint32)bgTypeId_ << unk << action; - // packet << bgTypeId_ << action; bot->GetSession()->HandleBattleFieldPortOpcode(packet); botAI->ResetStrategies(); + return true; } diff --git a/src/Bot/Engine/Action/Action.h b/src/Bot/Engine/Action/Action.h index 2395c5ea87..dd66338738 100644 --- a/src/Bot/Engine/Action/Action.h +++ b/src/Bot/Engine/Action/Action.h @@ -6,7 +6,6 @@ #pragma once #include "AiObject.h" -#include "Common.h" #include "Event.h" #include "Value.h" @@ -17,8 +16,10 @@ class NextAction { public: NextAction(std::string const name, float relevance = 0.0f) - : relevance(relevance), name(name) {} // name after relevance - whipowill - NextAction(NextAction const& o) : relevance(o.relevance), name(o.name) {} // name after relevance - whipowill + : relevance(relevance), name(name) {} + + NextAction(NextAction const&) = default; + NextAction& operator=(NextAction const&) = default; std::string const getName() { return name; } float getRelevance() { return relevance; } From 860033d8851286dfa15546680f426ad28f1ad842 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 10:59:54 +0100 Subject: [PATCH 004/222] fix: Resolved a wrong type comparison in MovementActions.h. --- src/Ai/Base/Actions/MovementActions.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/MovementActions.h b/src/Ai/Base/Actions/MovementActions.h index 7db911baa4..046805ccf3 100644 --- a/src/Ai/Base/Actions/MovementActions.h +++ b/src/Ai/Base/Actions/MovementActions.h @@ -266,7 +266,7 @@ class RotateAroundTheCenterPointAction : public MovementAction { public: RotateAroundTheCenterPointAction(PlayerbotAI* ai, std::string name, float center_x, float center_y, - float radius = 40.0f, uint32 intervals = 16, bool clockwise = true, + float radius = 40.0f, uint32_t intervals = 16, bool clockwise = true, float start_angle = 0) : MovementAction(ai, name) { @@ -276,7 +276,8 @@ class RotateAroundTheCenterPointAction : public MovementAction this->intervals = intervals; this->clockwise = clockwise; this->call_counters = 0; - for (int i = 0; i < intervals; i++) + + for (uint32_t i = 0; i < intervals; ++i) { float angle = start_angle + 2 * M_PI * i / intervals; waypoints.push_back(std::make_pair(center_x + cos(angle) * radius, center_y + sin(angle) * radius)); From ae0409eabbe3755a0a375359c164db1e61f28d4b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:01:06 +0100 Subject: [PATCH 005/222] fix: Resolved a unused parameter warning in AddLootAction.cpp. --- src/Ai/Base/Actions/AddLootAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/AddLootAction.cpp b/src/Ai/Base/Actions/AddLootAction.cpp index 9e16ee2d3a..0b6a85d29a 100644 --- a/src/Ai/Base/Actions/AddLootAction.cpp +++ b/src/Ai/Base/Actions/AddLootAction.cpp @@ -22,7 +22,7 @@ bool AddLootAction::Execute(Event event) return AI_VALUE(LootObjectStack*, "available loot")->Add(guid); } -bool AddAllLootAction::Execute(Event event) +bool AddAllLootAction::Execute(Event) { bool added = false; From 312a72195cc510543e653880f25fcc947af501db Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:02:27 +0100 Subject: [PATCH 006/222] fix: Resolved a unused parameter warning in AreaTriggerAction.cpp. --- src/Ai/Base/Actions/AreaTriggerAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/AreaTriggerAction.cpp b/src/Ai/Base/Actions/AreaTriggerAction.cpp index c610085400..77e992b5ca 100644 --- a/src/Ai/Base/Actions/AreaTriggerAction.cpp +++ b/src/Ai/Base/Actions/AreaTriggerAction.cpp @@ -58,7 +58,7 @@ bool ReachAreaTriggerAction::Execute(Event event) return true; } -bool AreaTriggerAction::Execute(Event event) +bool AreaTriggerAction::Execute(Event) { LastMovement& movement = context->GetValue("last area trigger")->Get(); From 69fa6788088a48fce092dd2be161a89d299745d1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:06:20 +0100 Subject: [PATCH 007/222] fix: Resolved several wrong type comparisons in PlayerbotAIConfig.cpp. --- src/PlayerbotAIConfig.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index b511369484..f3201190c1 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -898,7 +898,7 @@ std::vector> PlayerbotAIConfig::ParseTempTalentsOrder(uint32 spells[talentTabInfo->tabpage].push_back(talentInfo); } - for (int tab = 0; tab < 3; tab++) + for (uint64_t tab = 0; tab < 3; tab++) { if (tab_links.size() <= tab) { @@ -907,7 +907,8 @@ std::vector> PlayerbotAIConfig::ParseTempTalentsOrder(uint32 std::sort(spells[tab].begin(), spells[tab].end(), [&](TalentEntry const* lhs, TalentEntry const* rhs) { return lhs->Row != rhs->Row ? lhs->Row < rhs->Row : lhs->Col < rhs->Col; }); - for (int i = 0; i < tab_links[tab].size(); i++) + + for (uint64_t i = 0; i < tab_links[tab].size(); ++i) { if (i >= spells[tab].size()) { @@ -956,7 +957,8 @@ std::vector> PlayerbotAIConfig::ParseTempPetTalentsOrder(uin std::sort(spells.begin(), spells.end(), [&](TalentEntry const* lhs, TalentEntry const* rhs) { return lhs->Row != rhs->Row ? lhs->Row < rhs->Row : lhs->Col < rhs->Col; }); - for (int i = 0; i < tab_link.size(); i++) + + for (uint64_t i = 0; i < tab_link.size(); ++i) { if (i >= spells.size()) { From 108a73461e0af786984569f57e98c15a0a61a93b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:08:06 +0100 Subject: [PATCH 008/222] fix: Resolved a unused parameter warning in AutoMaintenanceOnLevelupAction.cpp. --- src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp index de8b5c6fdc..17f60dc926 100644 --- a/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp +++ b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp @@ -1,19 +1,20 @@ #include "AutoMaintenanceOnLevelupAction.h" -#include "GuildMgr.h" +#include "SpellMgr.h" + #include "PlayerbotAIConfig.h" #include "PlayerbotFactory.h" -#include "Playerbots.h" #include "RandomPlayerbotMgr.h" #include "SharedDefines.h" #include "BroadcastHelper.h" -bool AutoMaintenanceOnLevelupAction::Execute(Event event) +bool AutoMaintenanceOnLevelupAction::Execute(Event) { AutoPickTalents(); AutoLearnSpell(); AutoUpgradeEquip(); AutoTeleportForLevel(); + return true; } From 0eee7b0f25360cd7bdae75c92b7d5793ea90cc9c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:25:29 +0100 Subject: [PATCH 009/222] fix: Resolved a unused parameter warning in ItemCountValue.cpp. --- src/Ai/Base/Value/ItemCountValue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Value/ItemCountValue.h b/src/Ai/Base/Value/ItemCountValue.h index 6f7c593b23..99265a013f 100644 --- a/src/Ai/Base/Value/ItemCountValue.h +++ b/src/Ai/Base/Value/ItemCountValue.h @@ -17,7 +17,7 @@ class InventoryItemValueBase : public InventoryAction public: InventoryItemValueBase(PlayerbotAI* botAI) : InventoryAction(botAI, "empty") {} - bool Execute(Event event) override { return false; } + bool Execute(Event) override { return false; } protected: std::vector Find(std::string const qualifier); From bbc1e23fa1a8d554786cafffa5b4ce6ca581ccdb Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:26:51 +0100 Subject: [PATCH 010/222] fix: Resolved a unused parameter warning in BankAction.cpp. --- src/Ai/Base/Actions/BankAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/BankAction.cpp b/src/Ai/Base/Actions/BankAction.cpp index 4d8d6c4d8c..1e6a0bc93f 100644 --- a/src/Ai/Base/Actions/BankAction.cpp +++ b/src/Ai/Base/Actions/BankAction.cpp @@ -27,7 +27,7 @@ bool BankAction::Execute(Event event) return false; } -bool BankAction::ExecuteBank(std::string const text, Unit* bank) +bool BankAction::ExecuteBank(std::string const text, Unit*) { if (text.empty() || text == "?") { From 94373c6d589c97a9c47e5f97419398f1fd7e9dc8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:27:39 +0100 Subject: [PATCH 011/222] fix: Resolved a unused parameter warning in BossAuraActions.cpp. --- src/Ai/Base/Actions/BossAuraActions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/BossAuraActions.cpp b/src/Ai/Base/Actions/BossAuraActions.cpp index d711559ee5..1cd77d2035 100644 --- a/src/Ai/Base/Actions/BossAuraActions.cpp +++ b/src/Ai/Base/Actions/BossAuraActions.cpp @@ -18,7 +18,7 @@ bool BossFireResistanceAction::isUseful() return bossFireResistanceTrigger.IsActive(); } -bool BossFireResistanceAction::Execute(Event event) +bool BossFireResistanceAction::Execute(Event) { PaladinFireResistanceStrategy paladinFireResistanceStrategy(botAI); botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFireResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT); @@ -32,7 +32,7 @@ bool BossFrostResistanceAction::isUseful() return bossFrostResistanceTrigger.IsActive(); } -bool BossFrostResistanceAction::Execute(Event event) +bool BossFrostResistanceAction::Execute(Event) { PaladinFrostResistanceStrategy paladinFrostResistanceStrategy(botAI); botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFrostResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT); @@ -46,7 +46,7 @@ bool BossNatureResistanceAction::isUseful() return bossNatureResistanceTrigger.IsActive(); } -bool BossNatureResistanceAction::Execute(Event event) +bool BossNatureResistanceAction::Execute(Event) { HunterNatureResistanceStrategy hunterNatureResistanceStrategy(botAI); botAI->ChangeStrategy(ADD_STRATEGY_CHAR + hunterNatureResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT); @@ -60,7 +60,7 @@ bool BossShadowResistanceAction::isUseful() return bossShadowResistanceTrigger.IsActive(); } -bool BossShadowResistanceAction::Execute(Event event) +bool BossShadowResistanceAction::Execute(Event) { PaladinShadowResistanceStrategy paladinShadowResistanceStrategy(botAI); botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinShadowResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT); From da4df2793c5f247a3c97dc285971b3f45775aa5b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:29:51 +0100 Subject: [PATCH 012/222] fix: Resolved all warnings in BattleGroundJoinAction.cpp. --- .../Base/Actions/BattleGroundJoinAction.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Actions/BattleGroundJoinAction.cpp b/src/Ai/Base/Actions/BattleGroundJoinAction.cpp index 418b0f1fa7..3107f39873 100644 --- a/src/Ai/Base/Actions/BattleGroundJoinAction.cpp +++ b/src/Ai/Base/Actions/BattleGroundJoinAction.cpp @@ -13,9 +13,8 @@ #include "PlayerbotAI.h" #include "Playerbots.h" #include "PositionValue.h" -#include "UpdateTime.h" -bool BGJoinAction::Execute(Event event) +bool BGJoinAction::Execute(Event) { uint32 queueType = AI_VALUE(uint32, "bg type"); if (!queueType) // force join to fill bg @@ -25,8 +24,6 @@ bool BGJoinAction::Execute(Event event) BattlegroundQueueTypeId queueTypeId = (BattlegroundQueueTypeId)bgList[urand(0, bgList.size() - 1)]; BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(queueTypeId); - BattlegroundBracketId bracketId; - bool isArena = false; bool isRated = false; Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); @@ -38,12 +35,8 @@ bool BGJoinAction::Execute(Event event) if (!pvpDiff) return false; - bracketId = pvpDiff->GetBracketId(); - if (ArenaType type = ArenaType(BattlegroundMgr::BGArenaType(queueTypeId))) { - isArena = true; - std::vector::iterator i = find(ratedList.begin(), ratedList.end(), queueTypeId); if (i != ratedList.end()) isRated = true; @@ -409,8 +402,6 @@ bool BGJoinAction::JoinQueue(uint32 type) bracketId = pvpDiff->GetBracketId(); - uint32 BracketSize = bg->GetMaxPlayersPerTeam() * 2; - uint32 TeamSize = bg->GetMaxPlayersPerTeam(); TeamId teamId = bot->GetTeamId(); // check if already in queue @@ -487,8 +478,6 @@ bool BGJoinAction::JoinQueue(uint32 type) if (isArena) { isArena = true; - BracketSize = type * 2; - TeamSize = type; isRated = botAI->GetAiObjectContext()->GetValue("arena type")->Get(); if (joinAsGroup) @@ -653,7 +642,7 @@ bool FreeBGJoinAction::shouldJoinBg(BattlegroundQueueTypeId queueTypeId, Battleg return false; } -bool BGLeaveAction::Execute(Event event) +bool BGLeaveAction::Execute(Event) { if (!(bot->InBattlegroundQueue() || bot->InBattleground())) return false; @@ -1064,7 +1053,7 @@ bool BGStatusAction::Execute(Event event) return true; } -bool BGStatusCheckAction::Execute(Event event) +bool BGStatusCheckAction::Execute(Event) { if (bot->IsBeingTeleported()) return false; @@ -1080,7 +1069,7 @@ bool BGStatusCheckAction::Execute(Event event) bool BGStatusCheckAction::isUseful() { return bot->InBattlegroundQueue(); } -bool BGStrategyCheckAction::Execute(Event event) +bool BGStrategyCheckAction::Execute(Event) { bool inside_bg = bot->InBattleground() && bot->GetBattleground(); ; From 64c19f666ff74b3eb9929bfdeeca40aae871ed77 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:32:53 +0100 Subject: [PATCH 013/222] fix: Resolved an implicit default copy constructor warning in PositionValue.h. --- src/Ai/Base/Value/PositionValue.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Value/PositionValue.h b/src/Ai/Base/Value/PositionValue.h index a0123dafc8..9e613e1398 100644 --- a/src/Ai/Base/Value/PositionValue.h +++ b/src/Ai/Base/Value/PositionValue.h @@ -20,10 +20,12 @@ class PositionInfo : x(x), y(y), z(z), mapId(mapId), valueSet(valueSet) { } - PositionInfo(PositionInfo const& other) - : x(other.x), y(other.y), z(other.z), mapId(other.mapId), valueSet(other.valueSet) - { - } + + PositionInfo(PositionInfo const& other) = default; + PositionInfo& operator=(PositionInfo const& other) = default; + + PositionInfo(PositionInfo&& other) = default; + PositionInfo& operator=(PositionInfo&& other) = default; void Set(float newX, float newY, float newZ, uint32 newMapId) { From 24dd7ac703b677a472cc4a32100ea1f7fdf9450f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:33:40 +0100 Subject: [PATCH 014/222] fix: Resolved a unused parameter warning in CancelChannelAction.cpp. --- src/Ai/Base/Actions/CancelChannelAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/CancelChannelAction.cpp b/src/Ai/Base/Actions/CancelChannelAction.cpp index 9f359f392b..314430844f 100644 --- a/src/Ai/Base/Actions/CancelChannelAction.cpp +++ b/src/Ai/Base/Actions/CancelChannelAction.cpp @@ -7,12 +7,14 @@ #include "Player.h" #include "PlayerbotAI.h" -bool CancelChannelAction::Execute(Event event) +bool CancelChannelAction::Execute(Event) { if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { bot->InterruptSpell(CURRENT_CHANNELED_SPELL); + return true; } + return false; } From a822ced6828950237b15eb811d51da5376375863 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:34:49 +0100 Subject: [PATCH 015/222] fix: Resolved a unused parameter warning in CastCustomSpellAction.h. --- src/Ai/Base/Actions/CastCustomSpellAction.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/CastCustomSpellAction.h b/src/Ai/Base/Actions/CastCustomSpellAction.h index ed53b18a5a..67bbb6ccc5 100644 --- a/src/Ai/Base/Actions/CastCustomSpellAction.h +++ b/src/Ai/Base/Actions/CastCustomSpellAction.h @@ -21,7 +21,7 @@ class CastCustomSpellAction : public InventoryAction } bool Execute(Event event) override; - virtual std::string const castString(WorldObject* target) { return "cast"; } + virtual std::string const castString(WorldObject*) { return "cast"; } protected: bool ncCast = false; @@ -49,7 +49,7 @@ class CastRandomSpellAction : public ListSpellsAction bool isUseful() override { return false; } virtual bool AcceptSpell(SpellInfo const* spellInfo); - virtual uint32 GetSpellPriority(SpellInfo const* spellInfo) { return 1; } + virtual uint32 GetSpellPriority(SpellInfo const*) { return 1; } virtual bool castSpell(uint32 spellId, WorldObject* wo); bool Execute(Event event) override; From 9ec5b75149855db36616a3460995cc0851939db0 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:35:06 +0100 Subject: [PATCH 016/222] fix: Resolved a unused parameter warning in CastCustomSpellAction.cpp. --- src/Ai/Base/Actions/CastCustomSpellAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/CastCustomSpellAction.cpp b/src/Ai/Base/Actions/CastCustomSpellAction.cpp index 2ec7210d29..48c61f3902 100644 --- a/src/Ai/Base/Actions/CastCustomSpellAction.cpp +++ b/src/Ai/Base/Actions/CastCustomSpellAction.cpp @@ -334,7 +334,7 @@ bool CastRandomSpellAction::castSpell(uint32 spellId, WorldObject* wo) return botAI->CastSpell(spellId, wo->GetPositionX(), wo->GetPositionY(), wo->GetPositionZ()); } -bool DisEnchantRandomItemAction::Execute(Event event) +bool DisEnchantRandomItemAction::Execute(Event) { std::vector items = AI_VALUE2(std::vector, "inventory items", "usage " + std::to_string(ITEM_USAGE_DISENCHANT)); From 786ee09e1d8273c796be73f5e46e1b5f560949a8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 11:50:46 +0100 Subject: [PATCH 017/222] fix: Resolved all but one warning in BattleGroundTactics.cpp. --- src/Ai/Base/Actions/BattleGroundTactics.cpp | 31 ++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/Ai/Base/Actions/BattleGroundTactics.cpp b/src/Ai/Base/Actions/BattleGroundTactics.cpp index 1704150a30..d889ece7c8 100644 --- a/src/Ai/Base/Actions/BattleGroundTactics.cpp +++ b/src/Ai/Base/Actions/BattleGroundTactics.cpp @@ -1364,8 +1364,8 @@ std::string const BGTactics::HandleConsoleCommandPrivate(WorldSession* session, } } } - uint32 min = 0u; - uint32 max = vPaths->size() - 1; + int64_t min = 0u; + int64_t max = vPaths->size() - 1; if (num >= 0) // num specified or found { if (num > max) @@ -1557,7 +1557,7 @@ bool BGTactics::eyJumpDown() // // actual bg tactics below // -bool BGTactics::Execute(Event event) +bool BGTactics::Execute(Event) { Battleground* bg = bot->GetBattleground(); if (!bg) @@ -2185,16 +2185,6 @@ bool BGTactics::selectObjective(bool reset) case 3: // Balanced defendersProhab = 3; break; - case 4: - case 5: - case 6: - case 7: // Heavy Offense - defendersProhab = 1; - break; - case 8: - case 9: // Heavy Defense - defendersProhab = 6; - break; } if (enemyStrategy == WS_STRATEGY_DEFENSIVE) @@ -2226,9 +2216,14 @@ bool BGTactics::selectObjective(bool reset) target.Relocate(enemyFC->GetPositionX(), enemyFC->GetPositionY(), enemyFC->GetPositionZ()); } // Graveyard Camping if in lead - else if (!hasFlag && role < 8 && - (team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) || - (team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0)) + else if ( + !hasFlag + && role < 8 + && ( + (team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) + || (team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0) + ) + ) { if (team == TEAM_ALLIANCE) SetSafePos(WS_GY_CAMPING_HORDE, 10.0f); @@ -2497,7 +2492,6 @@ bool BGTactics::selectObjective(bool reset) EYBotStrategy strategyHorde = static_cast(GetBotStrategyForTeam(bg, TEAM_HORDE)); EYBotStrategy strategyAlliance = static_cast(GetBotStrategyForTeam(bg, TEAM_ALLIANCE)); EYBotStrategy strategy = (team == TEAM_ALLIANCE) ? strategyAlliance : strategyHorde; - EYBotStrategy enemyStrategy = (team == TEAM_ALLIANCE) ? strategyHorde : strategyAlliance; auto IsOwned = [&](uint32 nodeId) -> bool { return eyeOfTheStormBG->GetCapturePointInfo(nodeId)._ownerTeamId == team; }; @@ -3231,7 +3225,6 @@ bool BGTactics::selectObjectiveWp(std::vector const& vPaths) if (bgType == BATTLEGROUND_RB) bgType = bg->GetBgTypeID(true); - PositionMap& posMap = context->GetValue("position")->Get(); PositionInfo pos = context->GetValue("position")->Get()["bg objective"]; if (!pos.isSet()) return false; @@ -4249,7 +4242,7 @@ bool BGTactics::IsLockedInsideKeep() return false; } -bool ArenaTactics::Execute(Event event) +bool ArenaTactics::Execute(Event) { if (!bot->InBattleground()) { From 4009a082bb5a4c45d458557c58048f053f106d03 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:36:26 +0100 Subject: [PATCH 018/222] fix: Resolved all warnings within ChatShortcutActions.cpp. --- src/Ai/Base/Actions/ChatShortcutActions.cpp | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Ai/Base/Actions/ChatShortcutActions.cpp b/src/Ai/Base/Actions/ChatShortcutActions.cpp index 85b141d4d1..18a417c35e 100644 --- a/src/Ai/Base/Actions/ChatShortcutActions.cpp +++ b/src/Ai/Base/Actions/ChatShortcutActions.cpp @@ -42,7 +42,7 @@ void PositionsResetAction::SetStayPosition(float x, float y, float z) posMap["stay"] = pos; } -bool FollowChatShortcutAction::Execute(Event event) +bool FollowChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -74,7 +74,7 @@ bool FollowChatShortcutAction::Execute(Event event) else { WorldLocation loc = formation->GetLocation(); - if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1) + if (Formation::IsNullLocation(loc)) return false; MovementPriority priority = botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL; @@ -82,7 +82,7 @@ bool FollowChatShortcutAction::Execute(Event event) true, priority); } - if (Pet* pet = bot->GetPet()) + if (bot->GetPet() != nullptr) { botAI->PetFollow(); } @@ -116,7 +116,7 @@ bool FollowChatShortcutAction::Execute(Event event) return true; } -bool StayChatShortcutAction::Execute(Event event) +bool StayChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -133,7 +133,7 @@ bool StayChatShortcutAction::Execute(Event event) return true; } -bool MoveFromGroupChatShortcutAction::Execute(Event event) +bool MoveFromGroupChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -148,7 +148,7 @@ bool MoveFromGroupChatShortcutAction::Execute(Event event) return true; } -bool FleeChatShortcutAction::Execute(Event event) +bool FleeChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -171,7 +171,7 @@ bool FleeChatShortcutAction::Execute(Event event) return true; } -bool GoawayChatShortcutAction::Execute(Event event) +bool GoawayChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -188,7 +188,7 @@ bool GoawayChatShortcutAction::Execute(Event event) return true; } -bool GrindChatShortcutAction::Execute(Event event) +bool GrindChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -204,7 +204,7 @@ bool GrindChatShortcutAction::Execute(Event event) return true; } -bool TankAttackChatShortcutAction::Execute(Event event) +bool TankAttackChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -224,7 +224,7 @@ bool TankAttackChatShortcutAction::Execute(Event event) return true; } -bool MaxDpsChatShortcutAction::Execute(Event event) +bool MaxDpsChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) @@ -241,7 +241,7 @@ bool MaxDpsChatShortcutAction::Execute(Event event) return true; } -bool BwlChatShortcutAction::Execute(Event event) +bool BwlChatShortcutAction::Execute(Event) { Player* master = GetMaster(); if (!master) From e10f8917dbfda22ea00370e82601976a41f78adb Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:38:56 +0100 Subject: [PATCH 019/222] fix: Resolved an unused parameter warning in ChangeTalentsAction.cpp. --- src/Ai/Base/Actions/ChangeTalentsAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/ChangeTalentsAction.cpp b/src/Ai/Base/Actions/ChangeTalentsAction.cpp index 9b57a201a0..a2c6f1e34b 100644 --- a/src/Ai/Base/Actions/ChangeTalentsAction.cpp +++ b/src/Ai/Base/Actions/ChangeTalentsAction.cpp @@ -10,9 +10,9 @@ #include "Event.h" #include "PlayerbotAIConfig.h" #include "PlayerbotFactory.h" -#include "Playerbots.h" #include "AiObjectContext.h" #include "Log.h" +#include "RandomPlayerbotMgr.h" bool ChangeTalentsAction::Execute(Event event) { @@ -368,11 +368,11 @@ std::string ChangeTalentsAction::SpecApply(std::string param) // return nullptr; // } -bool AutoSetTalentsAction::Execute(Event event) +bool AutoSetTalentsAction::Execute(Event) { std::ostringstream out; - if (!sPlayerbotAIConfig.autoPickTalents || !sRandomPlayerbotMgr.IsRandomBot(bot)) + if (!PlayerbotAIConfig::instance().autoPickTalents || !RandomPlayerbotMgr::instance().IsRandomBot(bot)) return false; if (bot->GetFreeTalentPoints() <= 0) From 1daccdb612a5b0d65a3c632684bdbe274c3a1766 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:40:18 +0100 Subject: [PATCH 020/222] fix: Resolved an unused parameter warning in CheckMailAction.cpp. --- src/Ai/Base/Actions/CheckMailAction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/CheckMailAction.cpp b/src/Ai/Base/Actions/CheckMailAction.cpp index f9c70ff11f..25c82a0ade 100644 --- a/src/Ai/Base/Actions/CheckMailAction.cpp +++ b/src/Ai/Base/Actions/CheckMailAction.cpp @@ -7,9 +7,10 @@ #include "Event.h" #include "GuildTaskMgr.h" -#include "Playerbots.h" +#include "PlayerbotAIConfig.h" +#include "PlayerbotAI.h" -bool CheckMailAction::Execute(Event event) +bool CheckMailAction::Execute(Event) { WorldPacket p; bot->GetSession()->HandleQueryNextMailTime(p); @@ -28,7 +29,7 @@ bool CheckMailAction::Execute(Event event) continue; uint32 account = owner->GetSession()->GetAccountId(); - if (sPlayerbotAIConfig.IsInRandomAccountList(account)) + if (PlayerbotAIConfig::instance().IsInRandomAccountList(account)) continue; ProcessMail(mail, owner, trans); From 302db25ae8bfc7e95b6c072050b3f89f3d440215 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:41:52 +0100 Subject: [PATCH 021/222] fix: Resolved an unused parameter warning in CheckValuesAction.cpp. --- src/Ai/Base/Actions/CheckValuesAction.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/CheckValuesAction.cpp b/src/Ai/Base/Actions/CheckValuesAction.cpp index 7c64b7c513..2b001d82f9 100644 --- a/src/Ai/Base/Actions/CheckValuesAction.cpp +++ b/src/Ai/Base/Actions/CheckValuesAction.cpp @@ -6,12 +6,15 @@ #include "CheckValuesAction.h" #include "Event.h" -#include "Playerbots.h" #include "ServerFacade.h" +#include "PlayerbotAI.h" +#include "TravelNode.h" +#include "AiObjectContext.h" + CheckValuesAction::CheckValuesAction(PlayerbotAI* botAI) : Action(botAI, "check values") {} -bool CheckValuesAction::Execute(Event event) +bool CheckValuesAction::Execute(Event) { if (botAI->HasStrategy("debug move", BOT_STATE_NON_COMBAT)) { From 68c72c66cd24f82b2c345fd3423d350954c37630 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:42:51 +0100 Subject: [PATCH 022/222] fix: Resolved an unused parameter warning in ChooseTargetActions.cpp. --- src/Ai/Base/Actions/ChooseTargetActions.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/ChooseTargetActions.cpp b/src/Ai/Base/Actions/ChooseTargetActions.cpp index 200094c900..aff81e9eac 100644 --- a/src/Ai/Base/Actions/ChooseTargetActions.cpp +++ b/src/Ai/Base/Actions/ChooseTargetActions.cpp @@ -61,7 +61,7 @@ bool AttackAnythingAction::isUseful() return true; } -bool DropTargetAction::Execute(Event event) +bool DropTargetAction::Execute(Event) { Unit* target = context->GetValue("current target")->Get(); if (target && target->isDead()) @@ -115,11 +115,10 @@ bool AttackAnythingAction::Execute(Event event) { if (Unit* grindTarget = GetTarget()) { - if (char const* grindName = grindTarget->GetName().c_str()) + if (grindTarget->GetName().c_str()) { context->GetValue("pull target")->Set(grindTarget->GetGUID()); bot->GetMotionMaster()->Clear(); - // bot->StopMoving(); } } } @@ -137,7 +136,7 @@ bool DpsAssistAction::isUseful() return true; } -bool AttackRtiTargetAction::Execute(Event event) +bool AttackRtiTargetAction::Execute(Event) { Unit* rtiTarget = AI_VALUE(Unit*, "rti target"); From 85d706e38a368ada97feb5d1a319fcfb24eb790c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:47:52 +0100 Subject: [PATCH 023/222] fix: Resolved all warnings within ChooseRpgTargetAction.cpp. --- src/Ai/Base/Actions/ChooseRpgTargetAction.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp b/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp index 7d83c2b2bc..8893b0f747 100644 --- a/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp +++ b/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp @@ -6,7 +6,6 @@ #include #include "ChooseRpgTargetAction.h" -#include "BattlegroundMgr.h" #include "BudgetValues.h" #include "ChatHelper.h" #include "Event.h" @@ -14,7 +13,6 @@ #include "GuildCreateActions.h" #include "Playerbots.h" #include "RpgSubActions.h" -#include "Util.h" #include "ServerFacade.h" #include "PossibleRpgTargetsValue.h" @@ -112,21 +110,17 @@ float ChooseRpgTargetAction::getMaxRelevance(GuidPosition guidP) return floor((maxRelevance - 1.0) * 1000.0f); } -bool ChooseRpgTargetAction::Execute(Event event) +bool ChooseRpgTargetAction::Execute(Event) { - //TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); //not used, line marked for removal. Player* master = botAI->GetMaster(); GuidPosition masterRpgTarget; - if (master && master != bot && GET_PLAYERBOT_AI(master) && master->GetMapId() == bot->GetMapId() && !master->IsBeingTeleported()) + + if (master == nullptr || master == bot || GET_PLAYERBOT_AI(master) == nullptr || master->GetMapId() != bot->GetMapId() || master->IsBeingTeleported()) { - Player* player = botAI->GetMaster(); - //GuidPosition masterRpgTarget = PAI_VALUE(GuidPosition, "rpg target"); //not used, line marked for removal. - } - else master = nullptr; + } std::unordered_map targets; - // uint32 num = 0; //not used, line marked for removal. GuidVector possibleTargets = AI_VALUE(GuidVector, "possible rpg targets"); GuidVector possibleObjects = AI_VALUE(GuidVector, "nearest game objects no los"); GuidVector possiblePlayers = AI_VALUE(GuidVector, "nearest friendly players"); @@ -339,8 +333,14 @@ bool ChooseRpgTargetAction::isFollowValid(Player* bot, WorldPosition pos) if (!botAI->HasActivePlayerMaster() && distance < 50.0f) { Player* player = groupLeader; - if (groupLeader && !groupLeader->isMoving() || - PAI_VALUE(WorldPosition, "last long move").distance(pos) < sPlayerbotAIConfig.reactDistance) + + if ( + ( + groupLeader != nullptr + && !groupLeader->isMoving() + ) + || PAI_VALUE(WorldPosition, "last long move").distance(pos) < sPlayerbotAIConfig.reactDistance + ) return true; } From ab8494735f535433a90db22912f41836d213de0a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 12:59:51 +0100 Subject: [PATCH 024/222] fix: Refactored horrible code in AttackAnythingAction::Execute. --- src/Ai/Base/Actions/ChooseTargetActions.cpp | 31 ++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/Ai/Base/Actions/ChooseTargetActions.cpp b/src/Ai/Base/Actions/ChooseTargetActions.cpp index aff81e9eac..793f61000e 100644 --- a/src/Ai/Base/Actions/ChooseTargetActions.cpp +++ b/src/Ai/Base/Actions/ChooseTargetActions.cpp @@ -111,19 +111,30 @@ bool DropTargetAction::Execute(Event) bool AttackAnythingAction::Execute(Event event) { bool result = AttackAction::Execute(event); - if (result) + + if (!result) { - if (Unit* grindTarget = GetTarget()) - { - if (grindTarget->GetName().c_str()) - { - context->GetValue("pull target")->Set(grindTarget->GetGUID()); - bot->GetMotionMaster()->Clear(); - } - } + return false; + } + + const Unit* const grindTarget = this->GetTarget(); + + if (grindTarget == nullptr) + { + return true; + } + + const std::string& grindTargetName = grindTarget->GetName(); + + if (grindTargetName.empty()) + { + return true; } - return result; + this->context->GetValue("pull target")->Set(grindTarget->GetGUID()); + this->bot->GetMotionMaster()->Clear(); + + return true; } bool AttackAnythingAction::isPossible() { return AttackAction::isPossible() && GetTarget(); } From d8320c73b93e97971d01af5558f3ffb1ca22c45a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:05:48 +0100 Subject: [PATCH 025/222] fix: Resolved an unused parameter warning with DelayAction.cpp. --- src/Ai/Base/Actions/DelayAction.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/DelayAction.cpp b/src/Ai/Base/Actions/DelayAction.cpp index b47b6898d1..9d9affa36b 100644 --- a/src/Ai/Base/Actions/DelayAction.cpp +++ b/src/Ai/Base/Actions/DelayAction.cpp @@ -6,15 +6,19 @@ #include "DelayAction.h" #include "Event.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" +#include "PlayerbotAIConfig.h" -bool DelayAction::Execute(Event event) +bool DelayAction::Execute(Event) { - uint32 delay = sPlayerbotAIConfig.passiveDelay + sPlayerbotAIConfig.globalCoolDown; + const uint32 delay = PlayerbotAIConfig::instance().passiveDelay + PlayerbotAIConfig::instance().globalCoolDown; botAI->SetNextCheckDelay(delay); return true; } -bool DelayAction::isUseful() { return !botAI->AllowActivity(ALL_ACTIVITY); } +bool DelayAction::isUseful() +{ + return !botAI->AllowActivity(ALL_ACTIVITY); +} From 13f1889fdfc6020f971fe0d7682d330c4b7ff2d7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:10:03 +0100 Subject: [PATCH 026/222] fix: Resolved all warnings within ChooseTravelTargetAction.cpp. --- .../Base/Actions/ChooseTravelTargetAction.cpp | 31 ++++++------------- .../Base/Actions/ChooseTravelTargetAction.h | 2 +- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Ai/Base/Actions/ChooseTravelTargetAction.cpp b/src/Ai/Base/Actions/ChooseTravelTargetAction.cpp index 0f75a30798..761efc5b62 100644 --- a/src/Ai/Base/Actions/ChooseTravelTargetAction.cpp +++ b/src/Ai/Base/Actions/ChooseTravelTargetAction.cpp @@ -9,7 +9,7 @@ #include "LootObjectStack.h" #include "Playerbots.h" -bool ChooseTravelTargetAction::Execute(Event event) +bool ChooseTravelTargetAction::Execute(Event) { // Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); //not used, line marked for removal. @@ -103,13 +103,13 @@ void ChooseTravelTargetAction::getNewTarget(TravelTarget* newTarget, TravelTarge if (urand(1, 100) > 50) { // Turn in quests for money. - foundTarget = SetQuestTarget(newTarget, true, false, true, true); + foundTarget = SetQuestTarget(newTarget, false, true, true); } if (!foundTarget) { // Find new (low) level quests - foundTarget = SetQuestTarget(newTarget, false, true, false, false); + foundTarget = SetQuestTarget(newTarget, true, false, false); } } else @@ -150,7 +150,7 @@ void ChooseTravelTargetAction::getNewTarget(TravelTarget* newTarget, TravelTarge if (!foundTarget && urand(1, 100) > 5) { // Do any nearby - foundTarget = SetQuestTarget(newTarget, false, true, true, true); + foundTarget = SetQuestTarget(newTarget, true, true, true); } //Explore a nearby unexplored area. @@ -232,15 +232,6 @@ void ChooseTravelTargetAction::ReportTravelTarget(TravelTarget* newTarget, Trave QuestTravelDestination* QuestDestination = (QuestTravelDestination*)destination; Quest const* quest = QuestDestination->GetQuestTemplate(); WorldPosition botLocation(bot); - - CreatureTemplate const* cInfo = nullptr; - GameObjectTemplate const* gInfo = nullptr; - - if (destination->getEntry() > 0) - cInfo = sObjectMgr->GetCreatureTemplate(destination->getEntry()); - else - gInfo = sObjectMgr->GetGameObjectTemplate(destination->getEntry() * -1); - std::string Sub; if (newTarget->isGroupCopy()) @@ -478,7 +469,7 @@ bool ChooseTravelTargetAction::SetCurrentTarget(TravelTarget* target, TravelTarg return target->isActive(); } -bool ChooseTravelTargetAction::SetQuestTarget(TravelTarget* target, bool onlyCompleted, bool newQuests, bool activeQuests, bool completedQuests) +bool ChooseTravelTargetAction::SetQuestTarget(TravelTarget* target, bool newQuests, bool activeQuests, bool completedQuests) { std::vector activeDestinations; std::vector activePoints; @@ -823,10 +814,6 @@ char* strstri(char const* haystack, char const* needle); TravelDestination* ChooseTravelTargetAction::FindDestination(Player* bot, std::string const name, bool zones, bool npcs, bool quests, bool mobs, bool bosses) { - PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot); - - // AiObjectContext* context = botAI->GetAiObjectContext(); //not used, line marked for removal. - std::vector dests; //Quests @@ -934,14 +921,16 @@ bool ChooseTravelTargetAction::needForQuest(Unit* target) for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) { - int32 entry = questTemplate->RequiredNpcOrGo[j]; + int32_t entry = questTemplate->RequiredNpcOrGo[j]; - if (entry && entry > 0) + if (entry > 0) { int required = questTemplate->RequiredNpcOrGoCount[j]; int available = questStatus.CreatureOrGOCount[j]; - if (required && available < required && (target->GetEntry() == entry || justCheck)) + const int64_t targetEntry = target->GetEntry(); + + if (required && available < required && (targetEntry == entry || justCheck)) return true; } diff --git a/src/Ai/Base/Actions/ChooseTravelTargetAction.h b/src/Ai/Base/Actions/ChooseTravelTargetAction.h index 2ec026dc20..7a259612ec 100644 --- a/src/Ai/Base/Actions/ChooseTravelTargetAction.h +++ b/src/Ai/Base/Actions/ChooseTravelTargetAction.h @@ -36,7 +36,7 @@ class ChooseTravelTargetAction : public MovementAction bool getBestDestination(std::vector* activeDestinations, std::vector* activePoints); bool SetGroupTarget(TravelTarget* target); bool SetCurrentTarget(TravelTarget* target, TravelTarget* oldTarget); - bool SetQuestTarget(TravelTarget* target, bool onlyCompleted = false, bool newQuests = true, bool activeQuests = true, bool completedQuests = true); + bool SetQuestTarget(TravelTarget* target, bool newQuests = true, bool activeQuests = true, bool completedQuests = true); bool SetNewQuestTarget(TravelTarget* target); bool SetRpgTarget(TravelTarget* target); bool SetGrindTarget(TravelTarget* target); From 5c55ada13371954ac5493dce038fd5cc117d18af Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:16:41 +0100 Subject: [PATCH 027/222] fix: Resolved a warning in BattleGroundTactics.cpp. --- src/Ai/Base/Actions/BattleGroundTactics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/BattleGroundTactics.cpp b/src/Ai/Base/Actions/BattleGroundTactics.cpp index d889ece7c8..598e2cc939 100644 --- a/src/Ai/Base/Actions/BattleGroundTactics.cpp +++ b/src/Ai/Base/Actions/BattleGroundTactics.cpp @@ -3319,7 +3319,9 @@ bool BGTactics::selectObjectiveWp(std::vector const& vPaths) // don't pick path where bot is already closest to the paths closest point to target (it means path cant lead it // anywhere) don't pick path where closest point is too far away - if (closestPointIndex == (reverse ? 0 : path->size() - 1) || closestPointDistToBot > botDistanceLimit) + const int64_t pathSize = path->size() - 1; + + if (closestPointIndex == (reverse ? 0 : pathSize) || closestPointDistToBot > botDistanceLimit) continue; // creates a score based on dist-to-bot and dist-to-destination, where lower is better, and dist-to-bot is more From a529e82a11f449b29b2a7fe6414c3755c9d22a84 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:17:14 +0100 Subject: [PATCH 028/222] fix: Resolved an unused parameter warning in DestroyItemAction.cpp. --- src/Ai/Base/Actions/DestroyItemAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/DestroyItemAction.cpp b/src/Ai/Base/Actions/DestroyItemAction.cpp index 0fce4ad701..cd5fbfebec 100644 --- a/src/Ai/Base/Actions/DestroyItemAction.cpp +++ b/src/Ai/Base/Actions/DestroyItemAction.cpp @@ -39,7 +39,7 @@ void DestroyItemAction::DestroyItem(FindItemVisitor* visitor) bool SmartDestroyItemAction::isUseful() { return !botAI->HasActivePlayerMaster(); } -bool SmartDestroyItemAction::Execute(Event event) +bool SmartDestroyItemAction::Execute(Event) { uint8 bagSpace = AI_VALUE(uint8, "bag space"); From a5704fa5420e82572f3d0f202c50d99a79f67d8f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:20:19 +0100 Subject: [PATCH 029/222] fix: Resolved an unused variable warning in DebugAction.cpp. --- src/Ai/Base/Actions/DebugAction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/DebugAction.cpp b/src/Ai/Base/Actions/DebugAction.cpp index 578ece17c4..cff3c9c457 100644 --- a/src/Ai/Base/Actions/DebugAction.cpp +++ b/src/Ai/Base/Actions/DebugAction.cpp @@ -7,7 +7,11 @@ #include "ChooseTravelTargetAction.h" #include "MapMgr.h" -#include "Playerbots.h" +#include "TravelMgr.h" +#include "Player.h" +#include "PlayerbotAI.h" +#include "SpellMgr.h" +#include "Spell.h" bool DebugAction::Execute(Event event) { @@ -516,7 +520,7 @@ bool DebugAction::Execute(Event event) botPos.setY(botPos.getY() + (dy - 5) * 5); botPos.setZ(botPos.getHeight()); - Creature* wpCreature = bot->SummonCreature(effect, botPos.getX(), botPos.getY(), botPos.getZ(), 0, + bot->SummonCreature(effect, botPos.getX(), botPos.getY(), botPos.getZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000.0f); } } From c5cd8c219ed7673ed1bfa7a8cc7d17a7e4ec423c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:21:03 +0100 Subject: [PATCH 030/222] fix: Resolved an unusued parameter warning in EmoteAction.cpp. --- src/Ai/Base/Actions/EmoteAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/EmoteAction.cpp b/src/Ai/Base/Actions/EmoteAction.cpp index 197cc436b1..8e2c9f67b1 100644 --- a/src/Ai/Base/Actions/EmoteAction.cpp +++ b/src/Ai/Base/Actions/EmoteAction.cpp @@ -6,7 +6,6 @@ #include "EmoteAction.h" #include "Event.h" -#include "PlayerbotTextMgr.h" #include "Playerbots.h" #include "ServerFacade.h" @@ -787,7 +786,7 @@ bool EmoteAction::isUseful() return time(nullptr) >= lastEmote; } -bool TalkAction::Execute(Event event) +bool TalkAction::Execute(Event) { Unit* target = botAI->GetUnit(AI_VALUE(ObjectGuid, "talk target")); if (!target) From e7796bd43f470341aafd7f1aaa008e344cfdcd5d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:25:46 +0100 Subject: [PATCH 031/222] fix: Resolved several warnings in EquipAction.cpp. --- src/Ai/Base/Actions/EquipAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/EquipAction.cpp b/src/Ai/Base/Actions/EquipAction.cpp index 32508ef2e5..e0770abe19 100644 --- a/src/Ai/Base/Actions/EquipAction.cpp +++ b/src/Ai/Base/Actions/EquipAction.cpp @@ -85,8 +85,8 @@ void EquipAction::EquipItem(Item* item) if (itemProto->Class == ITEM_CLASS_CONTAINER) { // Attempt to equip as a bag - Bag* pBag = reinterpret_cast(item); uint8 newBagSlot = GetSmallestBagSlot(); + if (newBagSlot > 0) { uint16 src = ((bagIndex << 8) | slot); @@ -397,7 +397,7 @@ bool EquipUpgradesAction::Execute(Event event) return true; } -bool EquipUpgradeAction::Execute(Event event) +bool EquipUpgradeAction::Execute(Event) { CollectItemsVisitor visitor; IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS); From 6c2e30024d63e5852ae706f42f71cda4730c1ac0 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:27:13 +0100 Subject: [PATCH 032/222] fix: Resolved several warnings in FollowActions.cpp. --- src/Ai/Base/Actions/FollowActions.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Actions/FollowActions.cpp b/src/Ai/Base/Actions/FollowActions.cpp index b9623233a9..cfed8ae620 100644 --- a/src/Ai/Base/Actions/FollowActions.cpp +++ b/src/Ai/Base/Actions/FollowActions.cpp @@ -5,17 +5,14 @@ #include "FollowActions.h" -#include - #include "Event.h" #include "Formations.h" #include "LastMovementValue.h" #include "PlayerbotAI.h" #include "Playerbots.h" #include "ServerFacade.h" -#include "SharedDefines.h" -bool FollowAction::Execute(Event event) +bool FollowAction::Execute(Event) { Formation* formation = AI_VALUE(Formation*, "formation"); std::string const target = formation->GetTargetName(); @@ -28,7 +25,7 @@ bool FollowAction::Execute(Event event) else { WorldLocation loc = formation->GetLocation(); - if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1) + if (Formation::IsNullLocation(loc)) return false; MovementPriority priority = botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL; @@ -116,7 +113,7 @@ bool FollowAction::CanDeadFollow(Unit* target) return true; } -bool FleeToGroupLeaderAction::Execute(Event event) +bool FleeToGroupLeaderAction::Execute(Event) { Unit* fTarget = AI_VALUE(Unit*, "group leader"); bool canFollow = Follow(fTarget); From ea0bca67e72e8de96bf0264cd1d65605b4b5e627 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:28:32 +0100 Subject: [PATCH 033/222] fix: Resolved several warnings in FishingAction.cpp. --- src/Ai/Base/Actions/FishingAction.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Ai/Base/Actions/FishingAction.cpp b/src/Ai/Base/Actions/FishingAction.cpp index 0fc09c3bce..c38cbe576a 100644 --- a/src/Ai/Base/Actions/FishingAction.cpp +++ b/src/Ai/Base/Actions/FishingAction.cpp @@ -8,6 +8,7 @@ #include "Event.h" #include "GridNotifiers.h" +// Required due to poor AC implementation #include "GridNotifiersImpl.h" #include "ItemPackets.h" #include "LastMovementValue.h" @@ -246,7 +247,7 @@ WorldPosition FindFishingHole(PlayerbotAI* botAI) return WorldPosition(); } -bool MoveNearWaterAction::Execute(Event event) +bool MoveNearWaterAction::Execute(Event) { WorldPosition landSpot = AI_VALUE(WorldPosition, "fishing spot"); if (landSpot.IsValid()) @@ -292,7 +293,6 @@ bool MoveNearWaterAction::isPossible() // Water spot is out of range, lets look for a spot to move to for the fishing hole. if (distance > MAX_DISTANCE_TO_WATER || distance < MIN_DISTANCE_TO_WATER) { - float angle = bot->GetAngle(fishingHole.GetPositionX(), fishingHole.GetPositionY()); WorldPosition landSpot = FindLandRadialFromPosition(botAI, fishingHole, MIN_DISTANCE_TO_WATER, MAX_DISTANCE_TO_WATER, SEARCH_INCREMENT, fishingSearchWindow, 32); if (landSpot.IsValid()) { @@ -323,7 +323,6 @@ bool MoveNearWaterAction::isPossible() if (!water.IsValid()) return false; - bool hasLOS = bot->IsWithinLOS(water.GetPositionX(), water.GetPositionY(), water.GetPositionZ()); float angle = bot->GetAngle(water.GetPositionX(), water.GetPositionY()); WorldPosition landSpot = FindLandFromPosition(botAI, 0.0f, MAX_DISTANCE_TO_WATER, 1.0f, angle, water, fishingSearchWindow, false); @@ -336,7 +335,7 @@ bool MoveNearWaterAction::isPossible() return false; } -bool EquipFishingPoleAction::Execute(Event event) +bool EquipFishingPoleAction::Execute(Event) { if (!_pole) return false; @@ -463,7 +462,7 @@ bool UseBobberAction::isUseful() return AI_VALUE(bool, "can use fishing bobber"); } -bool UseBobberAction::Execute(Event event) +bool UseBobberAction::Execute(Event) { GuidVector gos = AI_VALUE(GuidVector, "nearest game objects no los"); for (auto const& guid : gos) @@ -485,7 +484,7 @@ bool UseBobberAction::Execute(Event event) return false; } -bool EndMasterFishingAction::Execute(Event event) +bool EndMasterFishingAction::Execute(Event) { botAI->ChangeStrategy("-master fishing", BOT_STATE_NON_COMBAT); return true; @@ -503,7 +502,7 @@ bool EndMasterFishingAction::isUseful() return !nearWater.IsValid(); } -bool RemoveBobberStrategyAction::Execute(Event event) +bool RemoveBobberStrategyAction::Execute(Event) { botAI->ChangeStrategy("-use bobber", BOT_STATE_NON_COMBAT); return true; From 50e311868aac30c2d4e48c7f19b5de0e48dd4ef1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:29:13 +0100 Subject: [PATCH 034/222] fix: Resolved several warnings in GenericActions.cpp. --- src/Ai/Base/Actions/GenericActions.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/GenericActions.cpp b/src/Ai/Base/Actions/GenericActions.cpp index 453834c097..cb4f4fb9e6 100644 --- a/src/Ai/Base/Actions/GenericActions.cpp +++ b/src/Ai/Base/Actions/GenericActions.cpp @@ -11,8 +11,6 @@ #include "CreatureAI.h" #include "Playerbots.h" #include "CharmInfo.h" -#include "SharedDefines.h" -#include "ObjectGuid.h" #include "SpellMgr.h" #include "SpellInfo.h" #include @@ -54,7 +52,7 @@ bool MeleeAction::isUseful() return true; } -bool TogglePetSpellAutoCastAction::Execute(Event event) +bool TogglePetSpellAutoCastAction::Execute(Event) { Pet* pet = bot->GetPet(); if (!pet) @@ -119,7 +117,7 @@ bool TogglePetSpellAutoCastAction::Execute(Event event) return toggled; } -bool PetAttackAction::Execute(Event event) +bool PetAttackAction::Execute(Event) { Guardian* pet = bot->GetGuardianPet(); if (!pet) From 5b1ffc6e8c17738da4cfa17cfcc0f849b61d4ac2 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:34:38 +0100 Subject: [PATCH 035/222] fix: Refactored CastAuraSpellAction::isUseful. --- src/Ai/Base/Actions/GenericSpellActions.cpp | 36 ++++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/Ai/Base/Actions/GenericSpellActions.cpp b/src/Ai/Base/Actions/GenericSpellActions.cpp index 819816f948..de49eb4ab5 100644 --- a/src/Ai/Base/Actions/GenericSpellActions.cpp +++ b/src/Ai/Base/Actions/GenericSpellActions.cpp @@ -17,19 +17,17 @@ #include "WorldPacket.h" #include "Group.h" #include "Chat.h" -#include "Language.h" #include "GenericBuffUtils.h" #include "PlayerbotAI.h" using ai::buff::MakeAuraQualifierForBuff; -using ai::buff::UpgradeToGroupIfAppropriate; CastSpellAction::CastSpellAction(PlayerbotAI* botAI, std::string const spell) - : Action(botAI, spell), range(botAI->GetRange("spell")), spell(spell) + : Action(botAI, spell), spell(spell), range(botAI->GetRange("spell")) { } -bool CastSpellAction::Execute(Event event) +bool CastSpellAction::Execute(Event) { if (spell == "conjure food" || spell == "conjure water") { @@ -172,13 +170,27 @@ bool CastMeleeDebuffSpellAction::isUseful() bool CastAuraSpellAction::isUseful() { - if (!GetTarget() || !CastSpellAction::isUseful()) + Unit* const target = this->GetTarget(); + + if (target == nullptr || !CastSpellAction::isUseful()) + { return false; - Aura* aura = botAI->GetAura(spell, GetTarget(), isOwner, checkDuration); - if (!aura) + } + + const Aura* const aura = botAI->GetAura(this->spell, target, this->isOwner, this->checkDuration); + + if (aura == nullptr) + { return true; - if (beforeDuration && aura->GetDuration() < beforeDuration) + } + + const int64_t& signedBeforeDuration = this->beforeDuration; + + if (signedBeforeDuration > 0 && aura->GetDuration() < signedBeforeDuration) + { return true; + } + return false; } @@ -233,7 +245,7 @@ Value* BuffOnPartyAction::GetTargetValue() return context->GetValue("party member without aura", MakeAuraQualifierForBuff(spell)); } -bool BuffOnPartyAction::Execute(Event event) +bool BuffOnPartyAction::Execute(Event) { std::string castName = spell; // default = mono @@ -290,7 +302,7 @@ Value* CastSnareSpellAction::GetTargetValue() { return context->GetValue< Value* CastCrowdControlSpellAction::GetTargetValue() { return context->GetValue("cc target", getName()); } -bool CastCrowdControlSpellAction::Execute(Event event) { return botAI->CastSpell(getName(), GetTarget()); } +bool CastCrowdControlSpellAction::Execute(Event) { return botAI->CastSpell(getName(), GetTarget()); } bool CastCrowdControlSpellAction::isPossible() { return botAI->CanCastSpell(getName(), GetTarget()); } @@ -308,13 +320,13 @@ bool CastVehicleSpellAction::isPossible() bool CastVehicleSpellAction::isUseful() { return botAI->IsInVehicle(false, true); } -bool CastVehicleSpellAction::Execute(Event event) +bool CastVehicleSpellAction::Execute(Event) { uint32 spellId = AI_VALUE2(uint32, "vehicle spell id", spell); return botAI->CastVehicleSpell(spellId, GetTarget()); } -bool UseTrinketAction::Execute(Event event) +bool UseTrinketAction::Execute(Event) { Item* trinket1 = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TRINKET1); From 653c8f84b5a7caf52967f79e542d9306b59a64c9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:35:09 +0100 Subject: [PATCH 036/222] fix: Resolved a warning in GenericSpellActions.cpp. --- src/Ai/Base/Actions/GenericSpellActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/GenericSpellActions.cpp b/src/Ai/Base/Actions/GenericSpellActions.cpp index de49eb4ab5..0762bbdaab 100644 --- a/src/Ai/Base/Actions/GenericSpellActions.cpp +++ b/src/Ai/Base/Actions/GenericSpellActions.cpp @@ -219,7 +219,7 @@ bool CastEnchantItemAction::isPossible() CastHealingSpellAction::CastHealingSpellAction(PlayerbotAI* botAI, std::string const spell, uint8 estAmount, HealingManaEfficiency manaEfficiency, bool isOwner) - : CastAuraSpellAction(botAI, spell, isOwner), estAmount(estAmount), manaEfficiency(manaEfficiency) + : CastAuraSpellAction(botAI, spell, isOwner), manaEfficiency(manaEfficiency), estAmount(estAmount) { range = botAI->GetRange("heal"); } From 047d849132a05ed8f0827781a51768260556f4f1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:41:20 +0100 Subject: [PATCH 037/222] fix: Resolved all warnings in GiveItemAction.cpp. --- src/Ai/Base/Actions/GiveItemAction.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/GiveItemAction.cpp b/src/Ai/Base/Actions/GiveItemAction.cpp index 350b465b83..029d16f513 100644 --- a/src/Ai/Base/Actions/GiveItemAction.cpp +++ b/src/Ai/Base/Actions/GiveItemAction.cpp @@ -11,7 +11,7 @@ std::vector split(std::string const s, char delim); -bool GiveItemAction::Execute(Event event) +bool GiveItemAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -28,7 +28,6 @@ bool GiveItemAction::Execute(Event event) if (receiverAi->GetAiObjectContext()->GetValue("item count", item)->Get()) return true; - bool moved = false; std::vector items = InventoryAction::parseItems(item, ITERATE_ITEMS_IN_BAGS); for (Item* item : items) { @@ -42,7 +41,6 @@ bool GiveItemAction::Execute(Event event) bot->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); item->SetOwnerGUID(target->GetGUID()); receiver->MoveItemToInventory(dest, item, true); - moved = true; std::ostringstream out; out << "Got " << chat->FormatItem(item->GetTemplate(), item->GetCount()) << " from " << bot->GetName(); From 9b959a2a05db21e5118f30acd6fca1eee1fc530b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:42:00 +0100 Subject: [PATCH 038/222] fix: Resolved an unused parameter warning in GreetAction.cpp. --- src/Ai/Base/Actions/GreetAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/GreetAction.cpp b/src/Ai/Base/Actions/GreetAction.cpp index a9fda122ec..630f969398 100644 --- a/src/Ai/Base/Actions/GreetAction.cpp +++ b/src/Ai/Base/Actions/GreetAction.cpp @@ -10,7 +10,7 @@ GreetAction::GreetAction(PlayerbotAI* botAI) : Action(botAI, "greet") {} -bool GreetAction::Execute(Event event) +bool GreetAction::Execute(Event) { ObjectGuid guid = AI_VALUE(ObjectGuid, "new player nearby"); if (!guid || !guid.IsPlayer()) From 0e7c4436b77bf98993418d5525f4ce18345d25f7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:43:08 +0100 Subject: [PATCH 039/222] fix: Resolved an unused parameter warning in GuildBankAction.cpp. --- src/Ai/Base/Actions/GuildBankAction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/GuildBankAction.cpp b/src/Ai/Base/Actions/GuildBankAction.cpp index 2d9c74ff69..2de53864d3 100644 --- a/src/Ai/Base/Actions/GuildBankAction.cpp +++ b/src/Ai/Base/Actions/GuildBankAction.cpp @@ -6,7 +6,8 @@ #include "GuildBankAction.h" #include "GuildMgr.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" +#include "AiObjectContext.h" bool GuildBankAction::Execute(Event event) { @@ -52,7 +53,7 @@ bool GuildBankAction::Execute(std::string const text, GameObject* bank) return result; } -bool GuildBankAction::MoveFromCharToBank(Item* item, GameObject* bank) +bool GuildBankAction::MoveFromCharToBank(Item* item, GameObject*) { uint32 playerSlot = item->GetSlot(); uint32 playerBag = item->GetBagSlot(); From b3e5893317bb099e23f9e1bbdf160fab2ecc759b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:44:01 +0100 Subject: [PATCH 040/222] fix: Resolved all warnings within GuildCreateActions.cpp. --- src/Ai/Base/Actions/GuildCreateActions.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Ai/Base/Actions/GuildCreateActions.cpp b/src/Ai/Base/Actions/GuildCreateActions.cpp index c9f9e689eb..2e36ac15b3 100644 --- a/src/Ai/Base/Actions/GuildCreateActions.cpp +++ b/src/Ai/Base/Actions/GuildCreateActions.cpp @@ -12,12 +12,11 @@ #include "Playerbots.h" #include "RandomPlayerbotFactory.h" #include "ServerFacade.h" -#include "SharedDefines.h" // GOLD +#include "SharedDefines.h" -bool BuyPetitionAction::Execute(Event event) +bool BuyPetitionAction::Execute(Event) { GuidVector vendors = botAI->GetAiObjectContext()->GetValue("nearest npcs")->Get(); - bool vendored = false, result = false; for (GuidVector::iterator i = vendors.begin(); i != vendors.end(); ++i) { ObjectGuid vendorguid = *i; @@ -97,7 +96,6 @@ bool BuyPetitionAction::canBuyPetition(Player* bot) bool PetitionOfferAction::Execute(Event event) { - uint32 petitionEntry = 5863; // GUILD_CHARTER std::vector petitions = AI_VALUE2(std::vector, "inventory items", chat->FormatQItem(5863)); if (petitions.empty()) @@ -152,7 +150,7 @@ bool PetitionOfferAction::Execute(Event event) bool PetitionOfferAction::isUseful() { return !bot->GetGuildId(); } -bool PetitionOfferNearbyAction::Execute(Event event) +bool PetitionOfferNearbyAction::Execute(Event) { uint32 found = 0; @@ -209,10 +207,9 @@ bool PetitionOfferNearbyAction::isUseful() AI_VALUE(uint8, "petition signs") < sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS); } -bool PetitionTurnInAction::Execute(Event event) +bool PetitionTurnInAction::Execute(Event) { GuidVector vendors = botAI->GetAiObjectContext()->GetValue("nearest npcs")->Get(); - bool vendored = false, result = false; std::vector petitions = AI_VALUE2(std::vector, "inventory items", chat->FormatQItem(5863)); if (petitions.empty()) @@ -297,7 +294,7 @@ bool PetitionTurnInAction::isUseful() !context->GetValue("travel target")->Get()->isTraveling(); } -bool BuyTabardAction::Execute(Event event) +bool BuyTabardAction::Execute(Event) { bool canBuy = botAI->DoSpecificAction("buy", Event("buy tabard", "Hitem:5976:")); if (canBuy && AI_VALUE2(uint32, "item count", chat->FormatQItem(5976))) From bcf0c8297227c0ec247c6958dc2817d04b2b051d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:44:48 +0100 Subject: [PATCH 041/222] fix Resolved all warnings in GuildManagementActions.cpp. --- src/Ai/Base/Actions/GuildManagementActions.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/GuildManagementActions.cpp b/src/Ai/Base/Actions/GuildManagementActions.cpp index be94b6ae62..27f96120a3 100644 --- a/src/Ai/Base/Actions/GuildManagementActions.cpp +++ b/src/Ai/Base/Actions/GuildManagementActions.cpp @@ -128,7 +128,7 @@ bool GuildRemoveAction::PlayerIsValid(Player* member) return member->GetGuildId() == bot->GetGuildId() && GetRankId(bot) < GetRankId(member); }; -bool GuildManageNearbyAction::Execute(Event event) +bool GuildManageNearbyAction::Execute(Event) { uint32 found = 0; @@ -149,7 +149,6 @@ bool GuildManageNearbyAction::Execute(Event event) // Promote or demote nearby members based on chance. if (player->GetGuildId() && player->GetGuildId() == bot->GetGuildId()) { - Guild::Member* member = guild->GetMember(player->GetGUID()); uint32 dCount = AI_VALUE(uint32, "death count"); if (!urand(0, 30) && dCount < 2 && guild->GetRankRights(botMember->GetRankId()) & GR_RIGHT_PROMOTE) From ecab7d3ad4f713dd4e07ea936c275f8c277a0d13 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:46:01 +0100 Subject: [PATCH 042/222] fix: Resolved all warnings in HireAction.cpp. --- src/Ai/Base/Actions/HireAction.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Actions/HireAction.cpp b/src/Ai/Base/Actions/HireAction.cpp index eba607d2e5..53e399caab 100644 --- a/src/Ai/Base/Actions/HireAction.cpp +++ b/src/Ai/Base/Actions/HireAction.cpp @@ -6,15 +6,16 @@ #include "HireAction.h" #include "Event.h" -#include "Playerbots.h" +#include "RandomPlayerbotMgr.h" +#include "PlayerbotAI.h" -bool HireAction::Execute(Event event) +bool HireAction::Execute(Event) { Player* master = GetMaster(); if (!master) return false; - if (!sRandomPlayerbotMgr.IsRandomBot(bot)) + if (!RandomPlayerbotMgr::instance().IsRandomBot(bot)) return false; uint32 account = master->GetSession()->GetAccountId(); @@ -39,7 +40,7 @@ bool HireAction::Execute(Event event) return false; } - uint32 discount = sRandomPlayerbotMgr.GetTradeDiscount(bot, master); + uint32 discount = RandomPlayerbotMgr::instance().GetTradeDiscount(bot, master); uint32 m = 1 + (bot->GetLevel() / 10); uint32 moneyReq = m * 5000 * bot->GetLevel(); if (discount < moneyReq) @@ -54,7 +55,7 @@ bool HireAction::Execute(Event event) botAI->TellMaster("I will join you at your next relogin"); bot->SetMoney(moneyReq); - sRandomPlayerbotMgr.Remove(bot); + RandomPlayerbotMgr::instance().Remove(bot); CharacterDatabase.Execute("UPDATE characters SET account = {} WHERE guid = {}", account, bot->GetGUID().GetCounter()); From 2339898fb893011a89a9d6e6215d0c842ef8c797 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:46:46 +0100 Subject: [PATCH 043/222] fix: Resolved all warnings in HelpAction.cpp. --- src/Ai/Base/Actions/HelpAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/HelpAction.cpp b/src/Ai/Base/Actions/HelpAction.cpp index 3dbe1d6e4b..afa56fc022 100644 --- a/src/Ai/Base/Actions/HelpAction.cpp +++ b/src/Ai/Base/Actions/HelpAction.cpp @@ -7,13 +7,13 @@ #include "ChatActionContext.h" #include "Event.h" -#include "Playerbots.h" +#include "AiObjectContext.h" HelpAction::HelpAction(PlayerbotAI* botAI) : Action(botAI, "help") { chatContext = new ChatActionContext(); } HelpAction::~HelpAction() { delete chatContext; } -bool HelpAction::Execute(Event event) +bool HelpAction::Execute(Event) { TellChatCommands(); TellStrategies(); From d37ac2bc75b4a7b33ed5805f34c485ef7bd66fe5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:50:53 +0100 Subject: [PATCH 044/222] fix: Resolved a default copy operator generation warning in CraftValue.h. --- src/Ai/Base/Value/CraftValue.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Value/CraftValue.h b/src/Ai/Base/Value/CraftValue.h index d3311e6c8a..def3352b9c 100644 --- a/src/Ai/Base/Value/CraftValue.h +++ b/src/Ai/Base/Value/CraftValue.h @@ -16,11 +16,13 @@ class CraftData { public: CraftData() : itemId(0) {} - CraftData(CraftData const& other) : itemId(other.itemId) - { - required.insert(other.required.begin(), other.required.end()); - obtained.insert(other.obtained.begin(), other.obtained.end()); - } + ~CraftData() = default; + + CraftData(CraftData const& other) = default; + CraftData& operator=(CraftData const& other) = default; + + CraftData(CraftData&&) = default; + CraftData& operator=(CraftData&&) = default; uint32 itemId; std::map required, obtained; From 8edb29dd27664870c30cb32eb3c435eea442cea9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:53:01 +0100 Subject: [PATCH 045/222] fix: Resolved all warnings in ImbueAction.cpp. --- src/Ai/Base/Actions/ImbueAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/ImbueAction.cpp b/src/Ai/Base/Actions/ImbueAction.cpp index 8c151ef8a6..1f07d21e34 100644 --- a/src/Ai/Base/Actions/ImbueAction.cpp +++ b/src/Ai/Base/Actions/ImbueAction.cpp @@ -10,7 +10,7 @@ ImbueWithPoisonAction::ImbueWithPoisonAction(PlayerbotAI* botAI) : Action(botAI, "apply poison") {} -bool ImbueWithPoisonAction::Execute(Event event) +bool ImbueWithPoisonAction::Execute(Event) { if (bot->IsInCombat()) return false; @@ -103,7 +103,7 @@ bool ImbueWithPoisonAction::Execute(Event event) // Search and apply stone to weapons ImbueWithStoneAction::ImbueWithStoneAction(PlayerbotAI* botAI) : Action(botAI, "apply stone") {} -bool ImbueWithStoneAction::Execute(Event event) +bool ImbueWithStoneAction::Execute(Event) { if (bot->IsInCombat()) return false; @@ -148,7 +148,7 @@ bool ImbueWithStoneAction::Execute(Event event) // Search and apply oil to weapons ImbueWithOilAction::ImbueWithOilAction(PlayerbotAI* botAI) : Action(botAI, "apply oil") {} -bool ImbueWithOilAction::Execute(Event event) +bool ImbueWithOilAction::Execute(Event) { if (bot->IsInCombat()) return false; @@ -201,7 +201,7 @@ static const uint32 uPrioritizedHealingItemIds[19] = { TryEmergencyAction::TryEmergencyAction(PlayerbotAI* botAI) : Action(botAI, "try emergency") {} -bool TryEmergencyAction::Execute(Event event) +bool TryEmergencyAction::Execute(Event) { // Do not use consumable if bot can heal self if ((botAI->IsHeal(bot)) && (bot->GetPowerPct(POWER_MANA) > 20)) From 1f4e2dca90c654343844104ef8147a89bcf77c4a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:56:07 +0100 Subject: [PATCH 046/222] fix: Resolved all warnings in InventoryAction.cpp. --- src/Ai/Base/Actions/InventoryAction.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Actions/InventoryAction.cpp b/src/Ai/Base/Actions/InventoryAction.cpp index f7b606a91a..aa77bafae6 100644 --- a/src/Ai/Base/Actions/InventoryAction.cpp +++ b/src/Ai/Base/Actions/InventoryAction.cpp @@ -373,9 +373,7 @@ ItemIds InventoryAction::FindOutfitItems(std::string const name) std::string const InventoryAction::parseOutfitName(std::string const outfit) { - uint32 pos = outfit.find("="); - if (pos == -1) - return ""; + const uint64_t pos = outfit.find("="); return outfit.substr(0, pos); } @@ -387,9 +385,7 @@ ItemIds InventoryAction::parseOutfitItems(std::string const text) uint8 pos = text.find("=") + 1; while (pos < text.size()) { - uint32 endPos = text.find(',', pos); - if (endPos == -1) - endPos = text.size(); + uint64_t endPos = text.find(',', pos); std::string const idC = text.substr(pos, endPos - pos); uint32 id = atol(idC.c_str()); From 0db3662613a8b5fb21d986c86be573773c4bf363 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 13:57:59 +0100 Subject: [PATCH 047/222] fix: Resolved an unused parameter warning in LeaveGroupAction.cpp. --- src/Ai/Base/Actions/LeaveGroupAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/LeaveGroupAction.cpp b/src/Ai/Base/Actions/LeaveGroupAction.cpp index 03a24bd199..47b7724827 100644 --- a/src/Ai/Base/Actions/LeaveGroupAction.cpp +++ b/src/Ai/Base/Actions/LeaveGroupAction.cpp @@ -92,7 +92,7 @@ bool LeaveGroupAction::Leave() return true; } -bool LeaveFarAwayAction::Execute(Event event) +bool LeaveFarAwayAction::Execute(Event) { // allow bot to leave party when they want return Leave(); From 5a15333b538ae03d9d73efe6781cce8699b17b5f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:01:55 +0100 Subject: [PATCH 048/222] fix: Resolved all warnings in InviteToGroupAction.cpp. --- src/Ai/Base/Actions/InviteToGroupAction.cpp | 27 +++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Actions/InviteToGroupAction.cpp b/src/Ai/Base/Actions/InviteToGroupAction.cpp index 14f943f76c..1f99ade256 100644 --- a/src/Ai/Base/Actions/InviteToGroupAction.cpp +++ b/src/Ai/Base/Actions/InviteToGroupAction.cpp @@ -8,7 +8,6 @@ #include "BroadcastHelper.h" #include "Event.h" #include "GuildMgr.h" -#include "Log.h" #include "PlayerbotOperations.h" #include "Playerbots.h" #include "PlayerbotWorldThreadProcessor.h" @@ -44,7 +43,7 @@ bool InviteToGroupAction::Invite(Player* inviter, Player* player) return true; } -bool InviteNearbyToGroupAction::Execute(Event event) +bool InviteNearbyToGroupAction::Execute(Event) { GuidVector nearGuids = botAI->GetAiObjectContext()->GetValue("nearest friendly players")->Get(); for (auto& i : nearGuids) @@ -62,7 +61,7 @@ bool InviteNearbyToGroupAction::Execute(Event event) if (player->GetGroup()) continue; - if (!sPlayerbotAIConfig.randomBotInvitePlayer && GET_PLAYERBOT_AI(player)->IsRealPlayer()) + if (!PlayerbotAIConfig::instance().randomBotInvitePlayer && GET_PLAYERBOT_AI(player)->IsRealPlayer()) continue; Group* group = bot->GetGroup(); @@ -88,7 +87,7 @@ bool InviteNearbyToGroupAction::Execute(Event event) if (abs(int32(player->GetLevel() - bot->GetLevel())) > 2) continue; - if (ServerFacade::instance().GetDistance2d(bot, player) > sPlayerbotAIConfig.sightDistance) + if (ServerFacade::instance().GetDistance2d(bot, player) > PlayerbotAIConfig::instance().sightDistance) continue; // When inviting the 5th member of the group convert to raid for future invites. @@ -99,7 +98,7 @@ bool InviteNearbyToGroupAction::Execute(Event event) PlayerbotWorldThreadProcessor::instance().QueueOperation(std::move(convertOp)); } - if (sPlayerbotAIConfig.inviteChat && sRandomPlayerbotMgr.IsRandomBot(bot)) + if (PlayerbotAIConfig::instance().inviteChat && RandomPlayerbotMgr::instance().IsRandomBot(bot)) { std::map placeholders; placeholders["%player"] = player->GetName(); @@ -120,7 +119,7 @@ bool InviteNearbyToGroupAction::Execute(Event event) bool InviteNearbyToGroupAction::isUseful() { - if (!sPlayerbotAIConfig.randomBotGroupNearby) + if (!PlayerbotAIConfig::instance().randomBotGroupNearby) return false; if (bot->InBattleground()) @@ -166,11 +165,9 @@ std::vector InviteGuildToGroupAction::getGuildMembers() return worker.GetResult(); } -bool InviteGuildToGroupAction::Execute(Event event) +bool InviteGuildToGroupAction::Execute(Event) { - Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); - - for (auto& member : getGuildMembers()) + for (auto& member : this->getGuildMembers()) { Player* player = member; @@ -186,7 +183,7 @@ bool InviteGuildToGroupAction::Execute(Event event) if (player->isDND()) continue; - if (!sPlayerbotAIConfig.randomBotInvitePlayer && GET_PLAYERBOT_AI(player)->IsRealPlayer()) + if (!PlayerbotAIConfig::instance().randomBotInvitePlayer && GET_PLAYERBOT_AI(player)->IsRealPlayer()) continue; if (player->IsBeingTeleported()) @@ -221,7 +218,7 @@ bool InviteGuildToGroupAction::Execute(Event event) player->GetLevel() + 5) // Do not invite members that too low level or risk dragging them to deadly places. continue; - if (!playerAi && ServerFacade::instance().GetDistance2d(bot, player) > sPlayerbotAIConfig.sightDistance) + if (!playerAi && ServerFacade::instance().GetDistance2d(bot, player) > PlayerbotAIConfig::instance().sightDistance) continue; Group* group = bot->GetGroup(); @@ -233,13 +230,13 @@ bool InviteGuildToGroupAction::Execute(Event event) PlayerbotWorldThreadProcessor::instance().QueueOperation(std::move(convertOp)); } - if (sPlayerbotAIConfig.inviteChat && - (sRandomPlayerbotMgr.IsRandomBot(bot) || !botAI->HasActivePlayerMaster())) + if (PlayerbotAIConfig::instance().inviteChat && + (RandomPlayerbotMgr::instance().IsRandomBot(bot) || !botAI->HasActivePlayerMaster())) { BroadcastHelper::BroadcastGuildGroupOrRaidInvite(botAI, bot, player, group); } - return Invite(bot, player); + return this->Invite(bot, player); } return false; From 9f9c7b46fbfcaca009f53a3d330e96c13f468268 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:15:23 +0100 Subject: [PATCH 049/222] fix: Resolved all warnings in LfgActions.cpp and did a small refactor. --- src/Ai/Base/Actions/LfgActions.cpp | 73 ++++++++++++++++++------------ src/Ai/Base/Actions/LfgActions.h | 2 +- 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/Ai/Base/Actions/LfgActions.cpp b/src/Ai/Base/Actions/LfgActions.cpp index a34c3efc63..1a3a332715 100644 --- a/src/Ai/Base/Actions/LfgActions.cpp +++ b/src/Ai/Base/Actions/LfgActions.cpp @@ -8,19 +8,22 @@ #include "AiFactory.h" #include "ItemVisitors.h" #include "LFGMgr.h" -#include "LFGPackets.h" #include "Opcodes.h" #include "Playerbots.h" #include "World.h" #include "WorldPacket.h" +#include "RandomPlayerbotMgr.h" using namespace lfg; -bool LfgJoinAction::Execute(Event event) { return JoinLFG(); } +bool LfgJoinAction::Execute(Event) +{ + return JoinLFG(); +} -uint32 LfgJoinAction::GetRoles() +uint8_t LfgJoinAction::GetRoles() const { - if (!sRandomPlayerbotMgr.IsRandomBot(bot)) + if (!RandomPlayerbotMgr::instance().IsRandomBot(bot)) { if (botAI->IsTank(bot)) return PLAYER_ROLE_TANK; @@ -30,7 +33,7 @@ uint32 LfgJoinAction::GetRoles() return PLAYER_ROLE_DAMAGE; } - uint8 spec = AiFactory::GetPlayerSpecTab(bot); + const uint8_t spec = AiFactory::GetPlayerSpecTab(bot); switch (bot->getClass()) { case CLASS_DRUID: @@ -101,7 +104,7 @@ bool LfgJoinAction::JoinLFG() LfgDungeonSet list; std::vector selected; - std::vector dungeons = sRandomPlayerbotMgr.LfgDungeons[bot->GetTeamId()]; + std::vector dungeons = RandomPlayerbotMgr::instance().LfgDungeons[bot->GetTeamId()]; if (!dungeons.size()) return false; @@ -115,9 +118,16 @@ bool LfgJoinAction::JoinLFG() auto const& botLevel = bot->GetLevel(); /*LFG_TYPE_RANDOM on classic is 15-58 so bot over level 25 will never queue*/ - if (dungeon->MinLevel && (botLevel < dungeon->MinLevel || botLevel > dungeon->MaxLevel) || - (botLevel > dungeon->MinLevel + 10 && dungeon->TypeID == LFG_TYPE_DUNGEON)) + if ( + ( + dungeon->MinLevel != 0 + && (botLevel < dungeon->MinLevel || botLevel > dungeon->MaxLevel) + ) + || (botLevel > dungeon->MinLevel + 10 && dungeon->TypeID == LFG_TYPE_DUNGEON) + ) + { continue; + } selected.push_back(dungeon->ID); list.insert(dungeon->ID); @@ -170,28 +180,31 @@ bool LfgJoinAction::JoinLFG() return true; } -bool LfgRoleCheckAction::Execute(Event event) +bool LfgRoleCheckAction::Execute(Event) { - if (Group* group = bot->GetGroup()) + const Group* const group = bot->GetGroup(); + + if (group == nullptr) { - uint32 currentRoles = sLFGMgr->GetRoles(bot->GetGUID()); - uint32 newRoles = GetRoles(); - // if (currentRoles == newRoles) - // return false; + return false; + } - WorldPacket* packet = new WorldPacket(CMSG_LFG_SET_ROLES); - *packet << (uint8)newRoles; - bot->GetSession()->QueuePacket(packet); - // sLFGMgr->SetRoles(bot->GetGUID(), newRoles); - // sLFGMgr->UpdateRoleCheck(group->GetGUID(), bot->GetGUID(), newRoles); + const uint8_t newRoles = this->GetRoles(); - LOG_INFO("playerbots", "Bot {} {}:{} <{}>: LFG roles checked", bot->GetGUID().ToString().c_str(), - bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str()); + WorldPacket* const packet = new WorldPacket(CMSG_LFG_SET_ROLES); + *packet << newRoles; + bot->GetSession()->QueuePacket(packet); - return true; - } + LOG_INFO( + "playerbots", + "Bot {} {}:{} <{}>: LFG roles checked", + bot->GetGUID().ToString().c_str(), + bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", + bot->GetLevel(), + bot->GetName().c_str() + ); - return false; + return true; } bool LfgAcceptAction::Execute(Event event) @@ -216,9 +229,9 @@ bool LfgAcceptAction::Execute(Event event) *packet << id << true; bot->GetSession()->QueuePacket(packet); - if (sRandomPlayerbotMgr.IsRandomBot(bot) && !bot->GetGroup()) + if (RandomPlayerbotMgr::instance().IsRandomBot(bot) && !bot->GetGroup()) { - sRandomPlayerbotMgr.Refresh(bot); + RandomPlayerbotMgr::instance().Refresh(bot); botAI->ResetStrategies(); } @@ -251,9 +264,9 @@ bool LfgAcceptAction::Execute(Event event) *packet << id << true; bot->GetSession()->QueuePacket(packet); - if (sRandomPlayerbotMgr.IsRandomBot(bot) && !bot->GetGroup()) + if (RandomPlayerbotMgr::instance().IsRandomBot(bot) && !bot->GetGroup()) { - sRandomPlayerbotMgr.Refresh(bot); + RandomPlayerbotMgr::instance().Refresh(bot); botAI->ResetStrategies(); } @@ -265,7 +278,7 @@ bool LfgAcceptAction::Execute(Event event) return false; } -bool LfgLeaveAction::Execute(Event event) +bool LfgLeaveAction::Execute(Event) { // Don't leave if lfg strategy enabled // if (botAI->HasStrategy("lfg", BOT_STATE_NON_COMBAT)) @@ -337,7 +350,7 @@ bool LfgJoinAction::isUseful() if (bot->isDead()) return false; - if (!sRandomPlayerbotMgr.IsRandomBot(bot)) + if (!RandomPlayerbotMgr::instance().IsRandomBot(bot)) return false; Map* map = bot->GetMap(); diff --git a/src/Ai/Base/Actions/LfgActions.h b/src/Ai/Base/Actions/LfgActions.h index 8622a42d76..a45ac2c8a9 100644 --- a/src/Ai/Base/Actions/LfgActions.h +++ b/src/Ai/Base/Actions/LfgActions.h @@ -20,7 +20,7 @@ class LfgJoinAction : public InventoryAction protected: bool JoinLFG(); - uint32 GetRoles(); + uint8_t GetRoles() const; }; class LfgAcceptAction : public LfgJoinAction From 2082dcb2eca94c0f2abdc387dc676b833773686d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:16:10 +0100 Subject: [PATCH 050/222] fix: Resolved an unused variable warning in LootStrategyAction.cpp. --- src/Ai/Base/Actions/LootStrategyAction.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Ai/Base/Actions/LootStrategyAction.cpp b/src/Ai/Base/Actions/LootStrategyAction.cpp index 68f8089c2e..b5f328b041 100644 --- a/src/Ai/Base/Actions/LootStrategyAction.cpp +++ b/src/Ai/Base/Actions/LootStrategyAction.cpp @@ -16,7 +16,6 @@ bool LootStrategyAction::Execute(Event event) { std::string const strategy = event.getParam(); - LootObjectStack* lootItems = AI_VALUE(LootObjectStack*, "available loot"); std::set& alwaysLootItems = AI_VALUE(std::set&, "always loot list"); Value* lootStrategy = context->GetValue("loot strategy"); From fdc485cf8f4bcb052b96f851528e8c161808c623 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:16:48 +0100 Subject: [PATCH 051/222] fix: Resolved all warnings in LootRollAction.cpp. --- src/Ai/Base/Actions/LootRollAction.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/LootRollAction.cpp b/src/Ai/Base/Actions/LootRollAction.cpp index e600f1f204..0047522730 100644 --- a/src/Ai/Base/Actions/LootRollAction.cpp +++ b/src/Ai/Base/Actions/LootRollAction.cpp @@ -13,7 +13,7 @@ #include "PlayerbotAIConfig.h" #include "Playerbots.h" -bool LootRollAction::Execute(Event event) +bool LootRollAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -27,7 +27,6 @@ bool LootRollAction::Execute(Event event) continue; } ObjectGuid guid = roll->itemGUID; - uint32 slot = roll->itemSlot; uint32 itemId = roll->itemid; int32 randomProperty = 0; if (roll->itemRandomPropId) @@ -186,7 +185,6 @@ bool MasterLootRollAction::Execute(Event event) if (!group) return false; - RollVote vote = CalculateRollVote(proto); group->CountRollVote(bot->GetGUID(), creatureGuid, CalculateRollVote(proto)); return true; From 2b71af659f1816e326c1dbd90294ffd82447542f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:20:53 +0100 Subject: [PATCH 052/222] fix: Resolved all warnings in MailAction.cpp. --- src/Ai/Base/Actions/MailAction.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Actions/MailAction.cpp b/src/Ai/Base/Actions/MailAction.cpp index 4ee2fee6d7..cbbc6eb6c5 100644 --- a/src/Ai/Base/Actions/MailAction.cpp +++ b/src/Ai/Base/Actions/MailAction.cpp @@ -78,7 +78,7 @@ class TellMailProcessor : public MailProcessor class TakeMailProcessor : public MailProcessor { public: - bool Process(uint32 index, Mail* mail, PlayerbotAI* botAI) override + bool Process(uint32_t, Mail* mail, PlayerbotAI* botAI) override { Player* bot = botAI->GetBot(); if (!CheckBagSpace(bot)) @@ -104,8 +104,14 @@ class TakeMailProcessor : public MailProcessor { std::vector guids; for (MailItemInfoVec::iterator i = mail->items.begin(); i != mail->items.end(); ++i) - if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(i->item_template)) + { + const ItemTemplate* const itemTemplate = ObjectMgr::instance()->GetItemTemplate(i->item_template); + + if (itemTemplate != nullptr) + { guids.push_back(i->item_guid); + } + } for (std::vector::iterator i = guids.begin(); i != guids.end(); ++i) { @@ -134,7 +140,7 @@ class TakeMailProcessor : public MailProcessor private: bool CheckBagSpace(Player* bot) { - uint32 totalused = 0, total = 16; + uint32 totalused = 0; for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; slot++) if (bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) ++totalused; @@ -157,7 +163,7 @@ class TakeMailProcessor : public MailProcessor class DeleteMailProcessor : public MailProcessor { public: - bool Process(uint32 index, Mail* mail, PlayerbotAI* botAI) override + bool Process(uint32_t, Mail* mail, PlayerbotAI* botAI) override { std::ostringstream out; out << "|cffffffff" << mail->subject << "|cffff0000 deleted"; @@ -172,7 +178,7 @@ class DeleteMailProcessor : public MailProcessor class ReadMailProcessor : public MailProcessor { public: - bool Process(uint32 index, Mail* mail, PlayerbotAI* botAI) override + bool Process(uint32_t, Mail* mail, PlayerbotAI* botAI) override { std::ostringstream out, body; out << "|cffffffff" << mail->subject; From 1d5e48272f5a48bb97ac6579149c2b114bb361fa Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:21:40 +0100 Subject: [PATCH 053/222] fix: Resolved all warnings in MoveToRpgTargetAction.cpp. --- src/Ai/Base/Actions/MoveToRpgTargetAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp b/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp index 4e898f30ef..0fbbf6b7e9 100644 --- a/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp +++ b/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp @@ -11,7 +11,7 @@ #include "LastMovementValue.h" #include "Playerbots.h" -bool MoveToRpgTargetAction::Execute(Event event) +bool MoveToRpgTargetAction::Execute(Event) { GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target"); Unit* unit = botAI->GetUnit(guidP); @@ -24,7 +24,6 @@ bool MoveToRpgTargetAction::Execute(Event event) { return false; } - Player* player = guidP.GetPlayer(); WorldObject* wo = nullptr; if (unit) From 0bfe7070ec62bb51b6173790e610e3a21f341d4d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:25:28 +0100 Subject: [PATCH 054/222] fix: Resolved all warnings in OpenItemAction.cpp and did a small refactor. --- src/Ai/Base/Actions/OpenItemAction.cpp | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Ai/Base/Actions/OpenItemAction.cpp b/src/Ai/Base/Actions/OpenItemAction.cpp index d1ebcbaaaf..b298aef855 100644 --- a/src/Ai/Base/Actions/OpenItemAction.cpp +++ b/src/Ai/Base/Actions/OpenItemAction.cpp @@ -7,35 +7,35 @@ #include "LootObjectStack.h" #include "AiObjectContext.h" -bool OpenItemAction::Execute(Event event) +bool OpenItemAction::Execute(Event) { - bool foundOpenable = false; + Item* const item = botAI->FindOpenableItem(); - Item* item = botAI->FindOpenableItem(); - if (item) + if (item == nullptr) { - uint8 bag = item->GetBagSlot(); // Retrieves the bag slot (0 for main inventory) - uint8 slot = item->GetSlot(); // Retrieves the actual slot inside the bag - - OpenItem(item, bag, slot); - foundOpenable = true; + return false; } - return foundOpenable; + uint8_t bag = item->GetBagSlot(); // Retrieves the bag slot (255 for main inventory) + uint8_t slot = item->GetSlot(); // Retrieves the actual slot inside the bag + + this->OpenItem(item, bag, slot); + + return true; } -void OpenItemAction::OpenItem(Item* item, uint8 bag, uint8 slot) +void OpenItemAction::OpenItem(Item* item, uint8_t bag, uint8_t slot) { WorldPacket packet(CMSG_OPEN_ITEM); packet << bag << slot; - bot->GetSession()->HandleOpenItemOpcode(packet); + this->bot->GetSession()->HandleOpenItemOpcode(packet); // Store the item GUID as the loot target LootObject lootObject; lootObject.guid = item->GetGUID(); - botAI->GetAiObjectContext()->GetValue("loot target")->Set(lootObject); + this->botAI->GetAiObjectContext()->GetValue("loot target")->Set(lootObject); std::ostringstream out; out << "Opened item: " << item->GetTemplate()->Name1; - botAI->TellMaster(out.str()); + this->botAI->TellMaster(out.str()); } From 0c8fa997630b84d47020776aa33725fce92a2cef Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:30:47 +0100 Subject: [PATCH 055/222] fix: Resolved an unused parameter warning in MoveToTravelTargetAction.cpp. --- src/Ai/Base/Actions/MoveToTravelTargetAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/MoveToTravelTargetAction.cpp b/src/Ai/Base/Actions/MoveToTravelTargetAction.cpp index 958dfe7391..1679a824e1 100644 --- a/src/Ai/Base/Actions/MoveToTravelTargetAction.cpp +++ b/src/Ai/Base/Actions/MoveToTravelTargetAction.cpp @@ -7,10 +7,9 @@ #include "ChooseRpgTargetAction.h" #include "LootObjectStack.h" -#include "PathGenerator.h" #include "Playerbots.h" -bool MoveToTravelTargetAction::Execute(Event event) +bool MoveToTravelTargetAction::Execute(Event) { TravelTarget* target = AI_VALUE(TravelTarget*, "travel target"); From d35183016b6c59384b55b0877b8ed326eef5d584 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:35:51 +0100 Subject: [PATCH 056/222] fix: Resolved all warnings in MovementActions.cpp. --- src/Ai/Base/Actions/MovementActions.cpp | 84 +++++++++---------------- 1 file changed, 31 insertions(+), 53 deletions(-) diff --git a/src/Ai/Base/Actions/MovementActions.cpp b/src/Ai/Base/Actions/MovementActions.cpp index c595dff6e4..a052fe2e3f 100644 --- a/src/Ai/Base/Actions/MovementActions.cpp +++ b/src/Ai/Base/Actions/MovementActions.cpp @@ -15,7 +15,6 @@ #include "FleeManager.h" #include "G3D/Vector3.h" #include "GameObject.h" -#include "Geometry.h" #include "LastMovementValue.h" #include "LootObjectStack.h" #include "Map.h" @@ -36,9 +35,7 @@ #include "SpellAuraEffects.h" #include "SpellInfo.h" #include "Stances.h" -#include "TargetedMovementGenerator.h" #include "Timer.h" -#include "Transport.h" #include "Unit.h" #include "Vehicle.h" #include "WaypointMovementGenerator.h" @@ -78,7 +75,6 @@ bool MovementAction::JumpTo(uint32 mapId, float x, float y, float z, MovementPri { return false; } - float botZ = bot->GetPositionZ(); float speed = bot->GetSpeed(MOVE_RUN); MotionMaster& mm = *bot->GetMotionMaster(); mm.Clear(); @@ -100,9 +96,6 @@ bool MovementAction::MoveNear(WorldObject* target, float distance, MovementPrior distance += target->GetCombatReach(); - float x = target->GetPositionX(); - float y = target->GetPositionY(); - float z = target->GetPositionZ(); float followAngle = GetFollowAngle(); for (float angle = followAngle; angle <= followAngle + static_cast(2 * M_PI); @@ -120,7 +113,6 @@ bool MovementAction::MoveNear(WorldObject* target, float distance, MovementPrior return true; } - // botAI->TellError("All paths not in LOS"); return false; } @@ -129,9 +121,6 @@ bool MovementAction::MoveToLOS(WorldObject* target, bool ranged) if (!target) return false; - // std::ostringstream out; out << "Moving to LOS!"; - // bot->Say(out.str(), LANG_UNIVERSAL); - float x = target->GetPositionX(); float y = target->GetPositionY(); float z = target->GetPositionZ(); @@ -176,7 +165,7 @@ bool MovementAction::MoveToLOS(WorldObject* target, bool ranged) return false; } -bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, bool react, bool normal_only, +bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool, bool, bool normal_only, bool exact_waypoint, MovementPriority priority, bool lessDelay, bool backwards) { UpdateMovementState(); @@ -264,7 +253,6 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, // bot->CastStop(); // botAI->InterruptSpell(); // } - G3D::Vector3 endP = path.back(); DoMovePoint(bot, x, y, z, generatePath, backwards); float delay = 1000.0f * MoveDelay(distance, backwards); if (lessDelay) @@ -779,8 +767,6 @@ bool MovementAction::MoveTo(WorldObject* target, float distance, MovementPriorit float by = bot->GetPositionY(); float bz = bot->GetPositionZ(); - float tx = target->GetPositionX(); - float ty = target->GetPositionY(); float tz = target->GetPositionZ(); float distanceToTarget = bot->GetDistance(target); @@ -812,10 +798,6 @@ bool MovementAction::ReachCombatTo(Unit* target, float distance) if (!IsMovingAllowed(target)) return false; - float bx = bot->GetPositionX(); - float by = bot->GetPositionY(); - float bz = bot->GetPositionZ(); - float tx = target->GetPositionX(); float ty = target->GetPositionY(); float tz = target->GetPositionZ(); @@ -905,7 +887,7 @@ bool MovementAction::IsMovingAllowed(WorldObject* target) return IsMovingAllowed(); } -bool MovementAction::IsMovingAllowed(uint32 mapId, float x, float y, float z) +bool MovementAction::IsMovingAllowed(uint32, float, float, float) { // removed sqrt as means distance limit was effectively 22500 (ReactDistance�) // leaving it commented incase we find ReactDistance limit causes problems @@ -918,7 +900,7 @@ bool MovementAction::IsMovingAllowed(uint32 mapId, float x, float y, float z) return IsMovingAllowed(); } -bool MovementAction::IsDuplicateMove(uint32 mapId, float x, float y, float z) +bool MovementAction::IsDuplicateMove(uint32, float x, float y, float z) { LastMovement& lastMove = *context->GetValue("last movement"); @@ -1286,7 +1268,7 @@ bool MovementAction::Follow(Unit* target, float distance, float angle) return true; } -bool MovementAction::ChaseTo(WorldObject* obj, float distance, float angle) +bool MovementAction::ChaseTo(WorldObject* obj, float distance, float) { if (!IsMovingAllowed()) { @@ -1417,7 +1399,6 @@ bool MovementAction::Flee(Unit* target) if (botAI->IsTank(player)) { float distanceToTank = ServerFacade::instance().GetDistance2d(bot, player); - float distanceToTarget = ServerFacade::instance().GetDistance2d(bot, target); if (distanceToTank < fleeDistance) { fleeTarget = player; @@ -1438,8 +1419,6 @@ bool MovementAction::Flee(Unit* target) else // bot is not targeted, try to flee dps/healers { bool isHealer = botAI->IsHeal(bot); - bool isDps = !isHealer && !botAI->IsTank(bot); - bool isTank = botAI->IsTank(bot); bool needHealer = !isHealer && AI_VALUE2(uint8, "health", "self target") < 50; bool isRanged = botAI->IsRanged(bot); @@ -1844,7 +1823,7 @@ void MovementAction::DoMovePoint(Unit* unit, float x, float y, float z, bool gen } } -bool FleeAction::Execute(Event event) +bool FleeAction::Execute(Event) { return MoveAway(AI_VALUE(Unit*, "current target"), sPlayerbotAIConfig.fleeDistance, true); } @@ -1862,9 +1841,9 @@ bool FleeAction::isUseful() return true; } -bool FleeWithPetAction::Execute(Event event) +bool FleeWithPetAction::Execute(Event) { - if (Pet* pet = bot->GetPet()) + if (bot->GetPet() != nullptr) { botAI->PetFollow(); } @@ -1874,7 +1853,9 @@ bool FleeWithPetAction::Execute(Event event) bool AvoidAoeAction::isUseful() { - if (getMSTime() - moveInterval < lastMoveTimer) + const int64_t currentMoveTimer = getMSTime() - this->lastMoveTimer; + + if (currentMoveTimer < this->lastMoveTimer) { return false; } @@ -1883,7 +1864,7 @@ bool AvoidAoeAction::isUseful() return AI_VALUE(Aura*, "area debuff") || !traps.empty() || !triggers.empty(); } -bool AvoidAoeAction::Execute(Event event) +bool AvoidAoeAction::Execute(Event) { // Case #1: Aura with dynamic object (e.g. rain of fire) if (AvoidAuraWithDynamicObj()) @@ -2306,7 +2287,9 @@ bool MovementAction::CheckLastFlee(float curAngle, std::list& infoList bool CombatFormationMoveAction::isUseful() { - if (getMSTime() - moveInterval < lastMoveTimer) + const int64_t currentMoveTimer = getMSTime() - this->lastMoveTimer; + + if (currentMoveTimer < this->lastMoveTimer) { return false; } @@ -2317,7 +2300,7 @@ bool CombatFormationMoveAction::isUseful() return true; } -bool CombatFormationMoveAction::Execute(Event event) +bool CombatFormationMoveAction::Execute(Event) { float dis = AI_VALUE(float, "disperse distance"); if (dis <= 0.0f || (!bot->IsInCombat() && botAI->HasStrategy("stay", BotState::BOT_STATE_NON_COMBAT)) || @@ -2448,7 +2431,7 @@ Player* CombatFormationMoveAction::NearestGroupMember(float dis) return result; } -bool TankFaceAction::Execute(Event event) +bool TankFaceAction::Execute(Event) { Unit* target = AI_VALUE(Unit*, "current target"); if (!target) @@ -2532,7 +2515,7 @@ bool RearFlankAction::isUseful() return inFront || inRear; } -bool RearFlankAction::Execute(Event event) +bool RearFlankAction::Execute(Event) { Unit* target = AI_VALUE(Unit*, "current target"); if (!target) @@ -2643,9 +2626,9 @@ bool DisperseSetAction::Execute(Event event) return true; } -bool RunAwayAction::Execute(Event event) { return Flee(AI_VALUE(Unit*, "group leader")); } +bool RunAwayAction::Execute(Event) { return Flee(AI_VALUE(Unit*, "group leader")); } -bool MoveToLootAction::Execute(Event event) +bool MoveToLootAction::Execute(Event) { LootObject loot = AI_VALUE(LootObject, "loot target"); if (!loot.IsLootPossible(bot)) @@ -2654,7 +2637,7 @@ bool MoveToLootAction::Execute(Event event) return MoveNear(loot.GetWorldObject(bot), sPlayerbotAIConfig.contactDistance); } -bool MoveOutOfEnemyContactAction::Execute(Event event) +bool MoveOutOfEnemyContactAction::Execute(Event) { Unit* target = AI_VALUE(Unit*, "current target"); if (!target) @@ -2665,7 +2648,7 @@ bool MoveOutOfEnemyContactAction::Execute(Event event) bool MoveOutOfEnemyContactAction::isUseful() { return AI_VALUE2(bool, "inside target", "current target"); } -bool SetFacingTargetAction::Execute(Event event) +bool SetFacingTargetAction::Execute(Event) { Unit* target = AI_VALUE(Unit*, "current target"); if (!target) @@ -2691,7 +2674,7 @@ bool SetFacingTargetAction::isPossible() return true; } -bool SetBehindTargetAction::Execute(Event event) +bool SetBehindTargetAction::Execute(Event) { Unit* target = AI_VALUE(Unit*, "current target"); if (!target) @@ -2751,7 +2734,7 @@ bool SetBehindTargetAction::Execute(Event event) false, true, MovementPriority::MOVEMENT_COMBAT); } -bool MoveOutOfCollisionAction::Execute(Event event) +bool MoveOutOfCollisionAction::Execute(Event) { float angle = M_PI * 2000 / frand(1.f, 1000.f); float distance = sPlayerbotAIConfig.followDistance; @@ -2769,7 +2752,7 @@ bool MoveOutOfCollisionAction::isUseful() botAI->GetAiObjectContext()->GetValue("nearest friendly players")->Get().size() < 15; } -bool MoveRandomAction::Execute(Event event) +bool MoveRandomAction::Execute(Event) { float distance = sPlayerbotAIConfig.tooCloseDistance + urand(10, 30); @@ -2782,9 +2765,7 @@ bool MoveRandomAction::Execute(Event event) float angle = (float)rand_norm() * static_cast(M_PI); x += urand(0, distance) * cos(angle); y += urand(0, distance) * sin(angle); - float ox = x; - float oy = y; - float oz = z; + if (!bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), x, y, z)) continue; @@ -2801,9 +2782,9 @@ bool MoveRandomAction::Execute(Event event) bool MoveRandomAction::isUseful() { return !AI_VALUE(GuidPosition, "rpg target"); } -bool MoveInsideAction::Execute(Event event) { return MoveInside(bot->GetMapId(), x, y, bot->GetPositionZ(), distance); } +bool MoveInsideAction::Execute(Event) { return MoveInside(bot->GetMapId(), x, y, bot->GetPositionZ(), distance); } -bool RotateAroundTheCenterPointAction::Execute(Event event) +bool RotateAroundTheCenterPointAction::Execute(Event) { uint32 next_point = GetCurrWaypoint(); if (MoveTo(bot->GetMapId(), waypoints[next_point].first, waypoints[next_point].second, bot->GetPositionZ(), false, @@ -2823,10 +2804,9 @@ bool MoveFromGroupAction::Execute(Event event) return MoveFromGroup(distance); } -bool MoveAwayFromCreatureAction::Execute(Event event) +bool MoveAwayFromCreatureAction::Execute(Event) { GuidVector targets = AI_VALUE(GuidVector, "nearest npcs"); - Creature* nearestCreature = bot->FindNearestCreature(creatureId, range, alive); // Find all creatures with the specified Id std::vector creatures; @@ -2904,13 +2884,11 @@ bool MoveAwayFromCreatureAction::Execute(Event event) bool MoveAwayFromCreatureAction::isPossible() { return bot->CanFreeMove(); } -bool MoveAwayFromPlayerWithDebuffAction::Execute(Event event) +bool MoveAwayFromPlayerWithDebuffAction::Execute(Event) { - Player* closestPlayer = nullptr; - float minDistance = 0.0f; + Group* const group = bot->GetGroup(); - Group* group = bot->GetGroup(); - if (!group) + if (group == nullptr) { return false; } From aac3b8670032ff0f7b502d1843f64ff870922de1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:45:05 +0100 Subject: [PATCH 057/222] fix: Resolved all warnings within PassLeadershipToMasterAction.cpp and did a small refactor. --- .../Actions/PassLeadershipToMasterAction.cpp | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp b/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp index 4ecfdc3bc1..5019a9a8ab 100644 --- a/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp +++ b/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp @@ -7,30 +7,39 @@ #include "Event.h" #include "PlayerbotOperations.h" -#include "Playerbots.h" #include "PlayerbotWorldThreadProcessor.h" -bool PassLeadershipToMasterAction::Execute(Event event) +bool PassLeadershipToMasterAction::Execute(Event) { - if (Player* master = GetMaster()) - if (master && master != bot && bot->GetGroup() && bot->GetGroup()->IsMember(master->GetGUID())) - { - auto setLeaderOp = std::make_unique(bot->GetGUID(), master->GetGUID()); - PlayerbotWorldThreadProcessor::instance().QueueOperation(std::move(setLeaderOp)); + const Player* const master = this->GetMaster(); - if (!message.empty()) - botAI->TellMasterNoFacing(message); + if (master == nullptr || master == this->bot) + { + return false; + } - if (sRandomPlayerbotMgr.IsRandomBot(bot)) - { - botAI->ResetStrategies(); - botAI->Reset(); - } + const Group* const group = this->bot->GetGroup(); - return true; - } + if (group == nullptr || !bot->GetGroup()->IsMember(master->GetGUID())) + { + return false; + } - return false; + std::unique_ptr setLeaderOp = std::make_unique(this->bot->GetGUID(), master->GetGUID()); + PlayerbotWorldThreadProcessor::instance().QueueOperation(std::move(setLeaderOp)); + + if (!message.empty()) + { + this->botAI->TellMasterNoFacing(message); + } + + if (RandomPlayerbotMgr::instance().IsRandomBot(this->bot)) + { + this->botAI->ResetStrategies(); + this->botAI->Reset(); + } + + return true; } bool PassLeadershipToMasterAction::isUseful() From a8d4a20ebfa748ebfb5bc31fac70f303660993e8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:46:24 +0100 Subject: [PATCH 058/222] fix: Resolved all warnings in PetAction.h and PetAction.cpp. --- src/Ai/Base/Actions/PetsAction.h | 3 --- src/Ai/Base/Actions/PositionAction.cpp | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Actions/PetsAction.h b/src/Ai/Base/Actions/PetsAction.h index f9334e3194..eaccdcb1a8 100644 --- a/src/Ai/Base/Actions/PetsAction.h +++ b/src/Ai/Base/Actions/PetsAction.h @@ -9,8 +9,6 @@ #include #include "Action.h" -#include "PlayerbotFactory.h" -#include "Unit.h" class PlayerbotAI; @@ -22,7 +20,6 @@ class PetsAction : public Action bool Execute(Event event) override; private: - bool warningEnabled = true; std::string defaultCmd; }; diff --git a/src/Ai/Base/Actions/PositionAction.cpp b/src/Ai/Base/Actions/PositionAction.cpp index 7d8f4264ca..e7e7f3b5f7 100644 --- a/src/Ai/Base/Actions/PositionAction.cpp +++ b/src/Ai/Base/Actions/PositionAction.cpp @@ -102,7 +102,7 @@ bool PositionAction::Execute(Event event) return false; } -bool MoveToPositionAction::Execute(Event event) +bool MoveToPositionAction::Execute(Event) { PositionInfo pos = context->GetValue("position")->Get()[qualifier]; if (!pos.isSet()) @@ -123,7 +123,7 @@ bool MoveToPositionAction::isUseful() return pos.isSet() && distance > sPlayerbotAIConfig.followDistance && distance < sPlayerbotAIConfig.reactDistance; } -bool SetReturnPositionAction::Execute(Event event) +bool SetReturnPositionAction::Execute(Event) { PositionMap& posMap = context->GetValue("position")->Get(); PositionInfo returnPos = posMap["return"]; From 139427dde9aebdf387f08f996ae0de79545d5b93 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:47:51 +0100 Subject: [PATCH 059/222] fix: Resolved all warnings in QueryQuestAction.cpp. --- src/Ai/Base/Actions/QueryQuestAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/QueryQuestAction.cpp b/src/Ai/Base/Actions/QueryQuestAction.cpp index 5f5d63e08c..337f83a213 100644 --- a/src/Ai/Base/Actions/QueryQuestAction.cpp +++ b/src/Ai/Base/Actions/QueryQuestAction.cpp @@ -7,7 +7,7 @@ #include "ChatHelper.h" #include "Event.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" void QueryQuestAction::TellObjective(std::string const name, uint32 available, uint32 required) { @@ -16,7 +16,6 @@ void QueryQuestAction::TellObjective(std::string const name, uint32 available, u bool QueryQuestAction::Execute(Event event) { - Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); Player* bot = botAI->GetBot(); WorldPosition botPos(bot); WorldPosition* ptr_botpos = &botPos; From 95b700eaabb36ab6368c68e1495da56821d553f1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 14:52:47 +0100 Subject: [PATCH 060/222] fix: Resolved all warnings in QuestAction.cpp. --- src/Ai/Base/Actions/QuestAction.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Ai/Base/Actions/QuestAction.cpp b/src/Ai/Base/Actions/QuestAction.cpp index dfe7bb9f1e..e30ff38481 100644 --- a/src/Ai/Base/Actions/QuestAction.cpp +++ b/src/Ai/Base/Actions/QuestAction.cpp @@ -5,6 +5,7 @@ #include "QuestAction.h" #include +#include #include "Chat.h" #include "ChatHelper.h" @@ -116,7 +117,8 @@ bool QuestAction::CompleteQuest(Player* player, uint32 entry) player->CastedCreatureOrGO(creature, ObjectGuid(), spell_id); } }*/ - /*else*/ if (creature > 0) + /*else*/ + if (creature > 0) { if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature)) for (uint16 z = 0; z < creaturecount; ++z) @@ -350,7 +352,6 @@ bool QuestUpdateAddItemAction::Execute(Event event) uint32 itemId, count; p >> itemId >> count; - Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); auto const* itemPrototype = sObjectMgr->GetItemTemplate(itemId); if (itemPrototype) { @@ -405,15 +406,14 @@ bool QuestItemPushResultAction::Execute(Event event) if (!quest) return false; - const QuestStatusData& q_status = bot->getQuestStatusMap().at(questId); - for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { uint32 itemId = quest->RequiredItemId[i]; if (!itemId) continue; - int32 previousCount = itemCount - count; + uint32_t previousCount = std::max(itemCount - count, 0); + if (itemId == itemEntry && previousCount < quest->RequiredItemCount[i]) { if (botAI->GetMaster()) @@ -432,7 +432,7 @@ bool QuestItemPushResultAction::Execute(Event event) return false; } -bool QuestUpdateFailedAction::Execute(Event event) +bool QuestUpdateFailedAction::Execute(Event) { //opcode SMSG_QUESTUPDATE_FAILED is never sent...(yet?) return false; @@ -446,8 +446,6 @@ bool QuestUpdateFailedTimerAction::Execute(Event event) uint32 questId; p >> questId; - Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); - Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId); if (qInfo) From ddbc4dd03fcd4881b118f756d3181e891a7f29f9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 15:04:34 +0100 Subject: [PATCH 061/222] fix: Resolved all warnings in RaidIccActions.cpp. --- src/Ai/Base/Actions/RandomBotUpdateAction.cpp | 2 +- .../Raid/Icecrown/Action/RaidIccActions.cpp | 168 +++++++----------- 2 files changed, 64 insertions(+), 106 deletions(-) diff --git a/src/Ai/Base/Actions/RandomBotUpdateAction.cpp b/src/Ai/Base/Actions/RandomBotUpdateAction.cpp index 76ed46c901..fdf853bee0 100644 --- a/src/Ai/Base/Actions/RandomBotUpdateAction.cpp +++ b/src/Ai/Base/Actions/RandomBotUpdateAction.cpp @@ -8,7 +8,7 @@ #include "Event.h" #include "Playerbots.h" -bool RandomBotUpdateAction::Execute(Event event) +bool RandomBotUpdateAction::Execute(Event) { if (!sRandomPlayerbotMgr.IsRandomBot(bot)) return false; diff --git a/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp b/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp index d6a91d0477..7876187a63 100644 --- a/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp +++ b/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp @@ -1,19 +1,16 @@ #include "RaidIccActions.h" #include "NearestNpcsValue.h" #include "ObjectAccessor.h" -#include "RaidIccStrategy.h" #include "Playerbots.h" -#include "Timer.h" #include "Vehicle.h" #include "RtiValue.h" #include "GenericSpellActions.h" #include "GenericActions.h" -#include #include "RaidIccTriggers.h" #include "Multiplier.h" // Lord Marrowgwar -bool IccLmTankPositionAction::Execute(Event event) +bool IccLmTankPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "lord marrowgar"); if (!boss) @@ -73,7 +70,7 @@ bool IccLmTankPositionAction::MoveTowardPosition(const Position& position, float MovementPriority::MOVEMENT_COMBAT); } -bool IccSpikeAction::Execute(Event event) +bool IccSpikeAction::Execute(Event) { // If we're impaled, we can't do anything if (botAI->GetAura("Impaled", bot)) @@ -183,7 +180,7 @@ void IccSpikeAction::UpdateRaidTargetIcon(Unit* target) } // Lady Deathwhisper -bool IccDarkReckoningAction::Execute(Event event) +bool IccDarkReckoningAction::Execute(Event) { constexpr float SAFE_DISTANCE_THRESHOLD = 2.0f; @@ -201,7 +198,7 @@ bool IccDarkReckoningAction::Execute(Event event) return false; } -bool IccRangedPositionLadyDeathwhisperAction::Execute(Event event) +bool IccRangedPositionLadyDeathwhisperAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "lady deathwhisper"); if (!boss) @@ -301,7 +298,7 @@ bool IccRangedPositionLadyDeathwhisperAction::MaintainRangedSpacing() return false; // Everyone is properly spaced } -bool IccAddsLadyDeathwhisperAction::Execute(Event event) +bool IccAddsLadyDeathwhisperAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "lady deathwhisper"); if (!boss) @@ -419,7 +416,7 @@ void IccAddsLadyDeathwhisperAction::UpdateRaidTargetIcon(Unit* target) } } -bool IccShadeLadyDeathwhisperAction::Execute(Event event) +bool IccShadeLadyDeathwhisperAction::Execute(Event) { static constexpr uint32 VENGEFUL_SHADE_ID = NPC_SHADE; static constexpr float SAFE_DISTANCE = 12.0f; @@ -473,7 +470,7 @@ bool IccShadeLadyDeathwhisperAction::Execute(Event event) return false; } -bool IccRottingFrostGiantTankPositionAction::Execute(Event event) +bool IccRottingFrostGiantTankPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "rotting frost giant"); if (!boss) @@ -696,7 +693,7 @@ bool IccRottingFrostGiantTankPositionAction::Execute(Event event) } //Gunship -bool IccCannonFireAction::Execute(Event event) +bool IccCannonFireAction::Execute(Event) { Unit* vehicleBase = bot->GetVehicleBase(); Vehicle* vehicle = bot->GetVehicle(); @@ -755,7 +752,7 @@ bool IccCannonFireAction::TryCastCannonSpell(uint32 spellId, Unit* target, Unit* return false; } -bool IccGunshipEnterCannonAction::Execute(Event event) +bool IccGunshipEnterCannonAction::Execute(Event) { // Do not switch vehicles if already in one if (bot->GetVehicle()) @@ -855,7 +852,7 @@ bool IccGunshipEnterCannonAction::EnterVehicle(Unit* vehicleBase, bool moveIfFar return true; } -bool IccGunshipTeleportAllyAction::Execute(Event event) +bool IccGunshipTeleportAllyAction::Execute(Event) { static constexpr float MAX_WAITING_DISTANCE = 45.0f; static constexpr float MAX_ATTACK_DISTANCE = 15.0f; @@ -922,7 +919,7 @@ void IccGunshipTeleportAllyAction::UpdateBossSkullIcon(Unit* boss, uint8_t SKULL } } -bool IccGunshipTeleportHordeAction::Execute(Event event) +bool IccGunshipTeleportHordeAction::Execute(Event) { static constexpr float MAX_WAITING_DISTANCE = 45.0f; static constexpr float MAX_ATTACK_DISTANCE = 15.0f; @@ -990,7 +987,7 @@ void IccGunshipTeleportHordeAction::UpdateBossSkullIcon(Unit* boss, uint8_t SKUL } //DBS -bool IccDbsTankPositionAction::Execute(Event event) +bool IccDbsTankPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "deathbringer saurfang"); if (!boss) @@ -1037,8 +1034,6 @@ bool IccDbsTankPositionAction::CrowdControlBloodBeasts() NPC_BLOOD_BEAST4}; const GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); - bool appliedCC = false; - for (auto const& npc : npcs) { Unit* unit = botAI->GetUnit(npc); @@ -1059,70 +1054,60 @@ bool IccDbsTankPositionAction::CrowdControlBloodBeasts() if (!botAI->HasAura("Frost Nova", unit)) { botAI->CastSpell("Frost Nova", unit); - appliedCC = true; } break; case CLASS_DRUID: if (!botAI->HasAura("Entangling Roots", unit)) { botAI->CastSpell("Entangling Roots", unit); - appliedCC = true; } break; case CLASS_PALADIN: if (!botAI->HasAura("Hammer of Justice", unit)) { botAI->CastSpell("Hammer of Justice", unit); - appliedCC = true; } break; case CLASS_WARRIOR: if (!botAI->HasAura("Hamstring", unit)) { botAI->CastSpell("Hamstring", unit); - appliedCC = true; } break; case CLASS_HUNTER: if (!botAI->HasAura("Concussive Shot", unit)) { botAI->CastSpell("Concussive Shot", unit); - appliedCC = true; } break; case CLASS_ROGUE: if (!botAI->HasAura("Kidney Shot", unit)) { botAI->CastSpell("Kidney Shot", unit); - appliedCC = true; } break; case CLASS_SHAMAN: if (!botAI->HasAura("Frost Shock", unit)) { botAI->CastSpell("Frost Shock", unit); - appliedCC = true; } break; case CLASS_DEATH_KNIGHT: if (!botAI->HasAura("Chains of Ice", unit)) { botAI->CastSpell("Chains of Ice", unit); - appliedCC = true; } break; case CLASS_PRIEST: if (!botAI->HasAura("Psychic Scream", unit)) { botAI->CastSpell("Psychic Scream", unit); - appliedCC = true; } break; case CLASS_WARLOCK: if (!botAI->HasAura("Fear", unit)) { botAI->CastSpell("Fear", unit); - appliedCC = true; } break; default: @@ -1231,7 +1216,7 @@ bool IccDbsTankPositionAction::PositionInRangedFormation() return false; } -bool IccAddsDbsAction::Execute(Event event) +bool IccAddsDbsAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "deathbringer saurfang"); if (!boss) @@ -1295,7 +1280,7 @@ void IccAddsDbsAction::UpdateSkullMarker(Unit* priorityTarget) } // Festergut -bool IccFestergutGroupPositionAction::Execute(Event event) +bool IccFestergutGroupPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "festergut"); if (!boss) @@ -1467,7 +1452,6 @@ int IccFestergutGroupPositionAction::CalculatePositionIndex(Group* group) else { // Fill remaining spots in second row - int spotsInFirstRow = 6; int spotsInSecondRow = healerSpotsUsed - 6; int remainingInSecondRow = 6 - spotsInSecondRow; @@ -1511,10 +1495,9 @@ int IccFestergutGroupPositionAction::CalculatePositionIndex(Group* group) return -1; } -bool IccFestergutSporeAction::Execute(Event event) +bool IccFestergutSporeAction::Execute(Event) { constexpr float POSITION_TOLERANCE = 4.0f; - constexpr float SPREAD_RADIUS = 2.0f; // Check if bot has spore bool hasSpore = bot->HasAura(SPELL_GAS_SPORE); // gas spore @@ -1624,7 +1607,7 @@ bool IccFestergutSporeAction::CheckMainTankSpore() } // Rotface -bool IccRotfaceTankPositionAction::Execute(Event event) +bool IccRotfaceTankPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "rotface"); if (!boss) @@ -1662,7 +1645,7 @@ bool IccRotfaceTankPositionAction::PositionMainTankAndMelee(Unit* boss) { bool isBossCasting = false; if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->GetCurrentSpell(SPELL_SLIME_SPRAY)) - bool isBossCasting = true; + isBossCasting = true; if (bot->GetExactDist2d(ICC_ROTFACE_CENTER_POSITION) > 7.0f && botAI->HasAggro(boss) && botAI->IsMainTank(bot)) MoveTo(bot->GetMapId(), ICC_ROTFACE_CENTER_POSITION.GetPositionX(), @@ -1700,7 +1683,7 @@ bool IccRotfaceTankPositionAction::HandleAssistTankPositioning(Unit* boss) return HandleBigOozePositioning(boss); } -bool IccRotfaceTankPositionAction::HandleBigOozePositioning(Unit* boss) +bool IccRotfaceTankPositionAction::HandleBigOozePositioning(Unit*) { // Find all big oozes GuidVector bigOozes = AI_VALUE(GuidVector, "nearest hostile npcs"); @@ -1824,28 +1807,21 @@ bool IccRotfaceTankPositionAction::HandleBigOozePositioning(Unit* boss) return false; } -bool IccRotfaceGroupPositionAction::Execute(Event event) +bool IccRotfaceGroupPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "rotface"); if (!boss) return false; const GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); - bool floodPresent = false; for (auto const& npc : npcs) { Unit* unit = botAI->GetUnit(npc); if (!unit || !botAI->HasAura("Ooze Flood", unit)) continue; - - float puddleDistance = bot->GetExactDist2d(unit); - - if (puddleDistance < 30.0f) - floodPresent = true; } - Unit* bigOoze = AI_VALUE2(Unit*, "find target", "big ooze"); bool hasOozeFlood = botAI->HasAura("Ooze Flood", bot); Unit* smallOoze = AI_VALUE2(Unit*, "find target", "little ooze"); bool hasMutatedInfection = botAI->HasAura("Mutated Infection", bot); @@ -1891,7 +1867,7 @@ bool IccRotfaceGroupPositionAction::HandlePuddleAvoidance(Unit* boss) return false; } -bool IccRotfaceGroupPositionAction::MoveAwayFromPuddle(Unit* boss, Unit* puddle, float puddleDistance) +bool IccRotfaceGroupPositionAction::MoveAwayFromPuddle(Unit* boss, Unit* puddle, float) { if (!boss || !puddle) return false; @@ -2017,7 +1993,7 @@ bool IccRotfaceGroupPositionAction::PositionRangedAndHealers(Unit* boss,Unit *sm Difficulty diff = bot->GetRaidDifficulty(); bool isBossCasting = false; if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->GetCurrentSpell(SPELL_SLIME_SPRAY)) - bool isBossCasting = true; + isBossCasting = true; bool isHeroic = (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC); @@ -2052,7 +2028,7 @@ bool IccRotfaceGroupPositionAction::PositionRangedAndHealers(Unit* boss,Unit *sm return FindAndMoveFromClosestMember(boss, smallOoze); } -bool IccRotfaceGroupPositionAction::FindAndMoveFromClosestMember(Unit* boss, Unit* smallOoze) +bool IccRotfaceGroupPositionAction::FindAndMoveFromClosestMember(Unit*, Unit* smallOoze) { const GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); @@ -2073,7 +2049,6 @@ bool IccRotfaceGroupPositionAction::FindAndMoveFromClosestMember(Unit* boss, Uni const float maxMoveDistance = 12.0f; // Limit maximum movement distance const float puddleSafeDistance = 30.0f; // Minimum distance to stay away from puddle const float minCenterDistance = 20.0f; // Minimum distance from center position - const bool isRanged = botAI->IsRanged(bot) || botAI->IsHeal(bot); // Ranged: spread from other members const GuidVector members = AI_VALUE(GuidVector, "group members"); @@ -2175,7 +2150,7 @@ bool IccRotfaceGroupPositionAction::FindAndMoveFromClosestMember(Unit* boss, Uni return false; // Everyone is properly spaced } -bool IccRotfaceMoveAwayFromExplosionAction::Execute(Event event) +bool IccRotfaceMoveAwayFromExplosionAction::Execute(Event) { // Skip if main tank or ooze flood if (botAI->IsMainTank(bot)) @@ -2238,7 +2213,6 @@ bool IccRotfaceMoveAwayFromExplosionAction::MoveToRandomSafeLocation() // Move in increments of 5.0f towards the calculated position float currentX = bot->GetPositionX(); float currentY = bot->GetPositionY(); - float currentZ = bot->GetPositionZ(); float directionX = moveX - currentX; float directionY = moveY - currentY; @@ -2258,7 +2232,7 @@ bool IccRotfaceMoveAwayFromExplosionAction::MoveToRandomSafeLocation() } // Proffesor Putricide -bool IccPutricideGrowingOozePuddleAction::Execute(Event event) +bool IccPutricideGrowingOozePuddleAction::Execute(Event) { Unit* closestPuddle = FindClosestThreateningPuddle(); if (!closestPuddle) @@ -2281,7 +2255,6 @@ Unit* IccPutricideGrowingOozePuddleAction::FindClosestThreateningPuddle() Unit* closestPuddle = nullptr; float closestDistance = FLT_MAX; - float closestSafeDistance = BASE_RADIUS; for (auto const& npc : npcs) { @@ -2298,7 +2271,6 @@ Unit* IccPutricideGrowingOozePuddleAction::FindClosestThreateningPuddle() if (currentDistance < safeDistance && currentDistance < closestDistance) { closestDistance = currentDistance; - closestSafeDistance = safeDistance; closestPuddle = unit; } } @@ -2416,7 +2388,7 @@ bool IccPutricideGrowingOozePuddleAction::IsPositionTooCloseToOtherPuddles(float return false; } -bool IccPutricideVolatileOozeAction::Execute(Event event) +bool IccPutricideVolatileOozeAction::Execute(Event) { static const float STACK_DISTANCE = 7.0f; @@ -2529,7 +2501,7 @@ Unit* IccPutricideVolatileOozeAction::FindAuraTarget() return nullptr; } -bool IccPutricideGasCloudAction::Execute(Event event) +bool IccPutricideGasCloudAction::Execute(Event) { Unit* gasCloud = AI_VALUE2(Unit*, "find target", "gas cloud"); if (!gasCloud) @@ -2806,7 +2778,6 @@ Position IccPutricideGasCloudAction::CalculateEmergencyPosition(const Position& Position bestPos = Position(botPos.GetPositionX() + dx * 15.0f, botPos.GetPositionY() + dy * 15.0f, botPos.GetPositionZ()); float bestFreedom = 0.0f; - static const float MOVEMENT_INCREMENT = 5.0f; // Fixed movement increment // Try fewer directions for emergency but still avoid corners for (int i = 0; i < 8; i++) @@ -2942,7 +2913,7 @@ bool IccPutricideGasCloudAction::GroupHasGaseousBloat(Group* group) return false; } -bool IccPutricideAvoidMalleableGooAction::Execute(Event event) +bool IccPutricideAvoidMalleableGooAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "professor putricide"); if (!boss) @@ -2964,7 +2935,7 @@ bool IccPutricideAvoidMalleableGooAction::Execute(Event event) return HandleBossPositioning(boss); } -bool IccPutricideAvoidMalleableGooAction::HandleTankPositioning(Unit* boss) +bool IccPutricideAvoidMalleableGooAction::HandleTankPositioning(Unit*) { if (!botAI->IsTank(bot)) return false; @@ -3229,7 +3200,7 @@ Position IccPutricideAvoidMalleableGooAction::CalculateIncrementalMove(const Pos } // BPC -bool IccBpcKelesethTankAction::Execute(Event event) +bool IccBpcKelesethTankAction::Execute(Event) { if (!botAI->IsAssistTank(bot)) return false; @@ -3310,7 +3281,7 @@ bool IccBpcKelesethTankAction::Execute(Event event) return false; } -bool IccBpcMainTankAction::Execute(Event event) +bool IccBpcMainTankAction::Execute(Event) { // Main tank specific behavior (higher priority) if (botAI->IsMainTank(bot)) @@ -3427,7 +3398,7 @@ void IccBpcMainTankAction::MarkEmpoweredPrince() } } -bool IccBpcEmpoweredVortexAction::Execute(Event event) +bool IccBpcEmpoweredVortexAction::Execute(Event) { Unit* valanar = AI_VALUE2(Unit*, "find target", "prince valanar"); if (!valanar) @@ -3612,7 +3583,7 @@ bool IccBpcEmpoweredVortexAction::HandleEmpoweredVortexSpread() return false; // Everyone is properly spaced } -bool IccBpcKineticBombAction::Execute(Event event) +bool IccBpcKineticBombAction::Execute(Event) { // Early exit if not ranged DPS if (!botAI->IsRangedDps(bot)) @@ -3657,7 +3628,6 @@ bool IccBpcKineticBombAction::Execute(Event event) Unit* IccBpcKineticBombAction::FindOptimalKineticBomb() { - static constexpr float MAX_HEIGHT_DIFF = 20.0f; static constexpr std::array KINETIC_BOMB_ENTRIES = {NPC_KINETIC_BOMB1, NPC_KINETIC_BOMB2, NPC_KINETIC_BOMB3, NPC_KINETIC_BOMB4}; @@ -3758,7 +3728,7 @@ bool IccBpcKineticBombAction::IsBombAlreadyHandled(Unit* bomb, Group* group) return false; } -bool IccBpcBallOfFlameAction::Execute(Event event) +bool IccBpcBallOfFlameAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "prince taldaram"); if (!boss) @@ -3839,7 +3809,7 @@ bool IccBpcBallOfFlameAction::Execute(Event event) } // Blood Queen Lana'thel -bool IccBqlGroupPositionAction::Execute(Event event) +bool IccBqlGroupPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "blood-queen lana'thel"); if (!boss) @@ -3920,7 +3890,8 @@ bool IccBqlGroupPositionAction::HandleShadowsMovement() GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); Unit* shadows[100]{}; // Reasonable max estimate int shadowCount = 0; - for (int i = 0; i < npcs.size() && shadowCount < 100; i++) + + for (uint64_t i = 0; i < npcs.size() && shadowCount < 100; i++) { Unit* unit = botAI->GetUnit(npcs[i]); if (unit && unit->IsAlive() && unit->GetEntry() == NPC_SWARMING_SHADOWS) @@ -4021,7 +3992,6 @@ bool IccBqlGroupPositionAction::HandleShadowsMovement() // Find closest safe point by searching in both directions from closest point Position safeMoveTarget = closestPoint; - float safeMoveTargetDist = FLT_MAX; bool foundSafe = closestIsSafe; // Only search for safe spots if the closest point isn't already safe @@ -4092,7 +4062,6 @@ bool IccBqlGroupPositionAction::HandleShadowsMovement() if (foundSafe) { // If we found a safe point, penalize based on travel distance along the curve to reach it - float stepsToCurve = minDist / 2.0f; // Approximate steps to reach the curve float safeDist = bot->GetExactDist2d(safeMoveTarget); // Add distance penalty based on how far we need to move along the curve @@ -4373,7 +4342,6 @@ bool IccBqlGroupPositionAction::HandleGroupPosition(Unit* boss, Aura* frenzyAura rangedBots.erase(std::remove(rangedBots.begin(), rangedBots.end(), h), rangedBots.end()); // Distribute remaining ranged evenly - size_t totalRanged = leftSide.size() + rightSide.size() + rangedBots.size(); size_t leftCount = leftSide.size(); size_t rightCount = rightSide.size(); for (Player* p : rangedBots) @@ -4532,14 +4500,14 @@ bool IccBqlGroupPositionAction::HandleGroupPosition(Unit* boss, Aura* frenzyAura // Find all swarming shadows GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); std::vector swarmingShadows; - for (int i = 0; i < npcs.size(); ++i) + for (uint64_t i = 0; i < npcs.size(); ++i) { Unit* unit = botAI->GetUnit(npcs[i]); if (unit && unit->IsAlive() && unit->GetEntry() == NPC_SWARMING_SHADOWS) swarmingShadows.push_back(unit); } - for (int i = 0; i < members.size(); i++) + for (uint64_t i = 0; i < members.size(); i++) { Unit* member = botAI->GetUnit(members[i]); if (!member || !member->IsAlive() || member == bot || botAI->GetAura("Frenzied Bloodthirst", member) || @@ -4601,7 +4569,7 @@ bool IccBqlGroupPositionAction::HandleGroupPosition(Unit* boss, Aura* frenzyAura return false; } -bool IccBqlPactOfDarkfallenAction::Execute(Event event) +bool IccBqlPactOfDarkfallenAction::Execute(Event) { // Check if bot has Pact of the Darkfallen if (!botAI->GetAura("Pact of the Darkfallen", bot)) @@ -4720,7 +4688,7 @@ bool IccBqlPactOfDarkfallenAction::MoveToTargetPosition(const Position& targetPo return false; } -bool IccBqlVampiricBiteAction::Execute(Event event) +bool IccBqlVampiricBiteAction::Execute(Event) { // Only act when bot has Frenzied Bloodthirst if (!botAI->GetAura("Frenzied Bloodthirst", bot)) @@ -4857,7 +4825,7 @@ bool IccBqlVampiricBiteAction::CastVampiricBite(Player* target) } // Sister Svalna -bool IccValkyreSpearAction::Execute(Event event) +bool IccValkyreSpearAction::Execute(Event) { // Find the nearest spear Creature* spear = bot->FindNearestCreature(NPC_SPEAR, 100.0f); @@ -4883,7 +4851,7 @@ bool IccValkyreSpearAction::Execute(Event event) return false; } -bool IccSisterSvalnaAction::Execute(Event event) +bool IccSisterSvalnaAction::Execute(Event) { Unit* svalna = AI_VALUE2(Unit*, "find target", "sister svalna"); if (!svalna || !svalna->HasAura(SPELL_AETHER_SHIELD)) // Check for Aether Shield aura @@ -4908,7 +4876,7 @@ bool IccSisterSvalnaAction::Execute(Event event) } // VDW -bool IccValithriaGroupAction::Execute(Event event) +bool IccValithriaGroupAction::Execute(Event) { // Helper lambda to find nearest creature of given entries auto findNearestCreature = [this](std::initializer_list entries, float range) -> Creature* @@ -5318,7 +5286,7 @@ bool IccValithriaGroupAction::Handle10ManGroupLogic() return false; } -bool IccValithriaPortalAction::Execute(Event event) +bool IccValithriaPortalAction::Execute(Event) { // Only healers should take portals, and not if already inside if (!botAI->IsHeal(bot) || bot->HasAura(SPELL_DREAM_STATE)) @@ -5451,7 +5419,7 @@ bool IccValithriaPortalAction::Execute(Event event) return false; } -bool IccValithriaHealAction::Execute(Event event) +bool IccValithriaHealAction::Execute(Event) { // Early validation checks if (!botAI->IsHeal(bot) || bot->GetHealthPct() < 50.0f) @@ -5541,7 +5509,7 @@ bool IccValithriaHealAction::Execute(Event event) return false; } -bool IccValithriaDreamCloudAction::Execute(Event event) +bool IccValithriaDreamCloudAction::Execute(Event) { // Only execute if we're in dream state if (!bot->HasAura(SPELL_DREAM_STATE)) @@ -5572,7 +5540,6 @@ bool IccValithriaDreamCloudAction::Execute(Event event) auto it = std::find(dreamBots.begin(), dreamBots.end(), bot); if (it == dreamBots.end()) return false; - size_t myIndex = std::distance(dreamBots.begin(), it); // Check if all dream bots are stacked within 3f of the current leader (lowest guid) constexpr float STACK_RADIUS = 2.0f; @@ -5612,7 +5579,7 @@ bool IccValithriaDreamCloudAction::Execute(Event event) std::vector dreamClouds; std::vector nightmareClouds; - for (int i = 0; i < npcs.size(); ++i) + for (uint64_t i = 0; i < npcs.size(); ++i) { Unit* unit = botAI->GetUnit(npcs[i]); if (unit && unit->IsAlive()) @@ -5824,7 +5791,7 @@ bool IccValithriaDreamCloudAction::Execute(Event event) } // Sindragosa -bool IccSindragosaGroupPositionAction::Execute(Event event) +bool IccSindragosaGroupPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss || boss->HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY)) @@ -6083,7 +6050,7 @@ bool IccSindragosaGroupPositionAction::MoveIncrementallyToPosition(const Positio MovementPriority::MOVEMENT_COMBAT); } -bool IccSindragosaTankSwapPositionAction::Execute(Event event) +bool IccSindragosaTankSwapPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss) @@ -6107,7 +6074,7 @@ bool IccSindragosaTankSwapPositionAction::Execute(Event event) return false; } -bool IccSindragosaFrostBeaconAction::Execute(Event event) +bool IccSindragosaFrostBeaconAction::Execute(Event) { const Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss) @@ -6341,7 +6308,7 @@ bool IccSindragosaFrostBeaconAction::IsBossFlying(const Unit* boss) ICC_SINDRAGOSA_FLYING_POSITION.GetPositionY()) < 30.0f; } -bool IccSindragosaBlisteringColdAction::Execute(Event event) +bool IccSindragosaBlisteringColdAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss) @@ -6389,7 +6356,7 @@ bool IccSindragosaBlisteringColdAction::Execute(Event event) return false; } -bool IccSindragosaUnchainedMagicAction::Execute(Event event) +bool IccSindragosaUnchainedMagicAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss) @@ -6411,7 +6378,7 @@ bool IccSindragosaUnchainedMagicAction::Execute(Event event) return false; } -bool IccSindragosaChilledToTheBoneAction::Execute(Event event) +bool IccSindragosaChilledToTheBoneAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss) @@ -6434,7 +6401,7 @@ bool IccSindragosaChilledToTheBoneAction::Execute(Event event) return false; } -bool IccSindragosaMysticBuffetAction::Execute(Event event) +bool IccSindragosaMysticBuffetAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); if (!boss || !bot || !bot->IsAlive()) @@ -6517,7 +6484,7 @@ bool IccSindragosaMysticBuffetAction::Execute(Event event) return false; } -bool IccSindragosaFrostBombAction::Execute(Event event) +bool IccSindragosaFrostBombAction::Execute(Event) { if (!bot || !bot->IsAlive() || bot->HasAura(SPELL_ICE_TOMB)) // Skip if dead or in Ice Tomb return false; @@ -6709,7 +6676,6 @@ bool IccSindragosaFrostBombAction::Execute(Event event) } } Unit* losTomb = myTombs[bestIdx]; - ObjectGuid losTombGuid = myTombGuids[bestIdx]; // Calculate position for LOS (stand at least 6.5f behind the tomb from the bomb) float angle = marker->GetAngle(losTomb); @@ -6792,7 +6758,6 @@ bool IccSindragosaFrostBombAction::Execute(Event event) // Clear the marker for our group's icon group->SetTargetIcon(iconIndex, bot->GetGUID(), ObjectGuid::Empty); } - Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa"); bot->AttackStop(); return true; } @@ -6802,7 +6767,7 @@ bool IccSindragosaFrostBombAction::Execute(Event event) } // The Lich King -bool IccLichKingShadowTrapAction::Execute(Event event) +bool IccLichKingShadowTrapAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "the lich king"); if (!boss || !botAI->IsTank(bot)) @@ -6929,7 +6894,7 @@ bool IccLichKingShadowTrapAction::Execute(Event event) return false; } -bool IccLichKingNecroticPlagueAction::Execute(Event event) +bool IccLichKingNecroticPlagueAction::Execute(Event) { bool hasPlague = botAI->HasAura("Necrotic Plague", bot); // Only execute if we have the plague @@ -6981,7 +6946,7 @@ bool IccLichKingNecroticPlagueAction::Execute(Event event) return false; } -bool IccLichKingWinterAction::Execute(Event event) +bool IccLichKingWinterAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "the lich king"); if (!boss) @@ -7032,7 +6997,6 @@ bool IccLichKingWinterAction::Execute(Event event) const ObjectGuid currentSkullTarget = group->GetTargetIcon(7); if (!currentSkullTarget.IsEmpty()) { - Unit* skullTarget = ObjectAccessor::GetUnit(*bot, currentSkullTarget); group->SetTargetIcon(7, bot->GetGUID(), ObjectGuid::Empty); } } @@ -7196,7 +7160,7 @@ const Position* IccLichKingWinterAction::GetMainTankRangedPosition() return &ICC_LK_FROSTR3_POSITION; } -bool IccLichKingWinterAction::IsPositionSafeFromDefile(float x, float y, float z, float minSafeDistance) +bool IccLichKingWinterAction::IsPositionSafeFromDefile(float x, float y, float, float minSafeDistance) { Unit* boss = AI_VALUE2(Unit*, "find target", "the lich king"); if (!boss) @@ -7556,7 +7520,7 @@ void IccLichKingWinterAction::HandleRangedPositioning() } } -void IccLichKingWinterAction::HandleMainTankAddManagement(Unit* boss, const Position* tankPos) +void IccLichKingWinterAction::HandleMainTankAddManagement(Unit*, const Position* tankPos) { if (!botAI->IsMainTank(bot)) return; @@ -7679,7 +7643,7 @@ void IccLichKingWinterAction::HandleMainTankAddManagement(Unit* boss, const Posi } } -void IccLichKingWinterAction::HandleAssistTankAddManagement(Unit* boss, const Position* tankPos) +void IccLichKingWinterAction::HandleAssistTankAddManagement(Unit*, const Position* tankPos) { if (!botAI->IsAssistTank(bot)) return; @@ -7783,7 +7747,7 @@ void IccLichKingWinterAction::HandleAssistTankAddManagement(Unit* boss, const Po } } -bool IccLichKingAddsAction::Execute(Event event) +bool IccLichKingAddsAction::Execute(Event) { if (bot->HasAura(SPELL_HARVEST_SOUL_VALKYR)) // Don't process actions if bot is picked up by Val'kyr return false; @@ -7812,7 +7776,6 @@ bool IccLichKingAddsAction::Execute(Event event) //------CHEAT------- } - Unit* spiritWarden = AI_VALUE2(Unit*, "find target", "spirit warden"); bool hasPlague = botAI->HasAura("Necrotic Plague", bot); Unit* terenasMenethilHC = bot->FindNearestCreature(NPC_TERENAS_MENETHIL_HC, 55.0f); @@ -8324,7 +8287,7 @@ bool IccLichKingAddsAction::HandleQuakeMechanics(Unit* boss) return false; } -void IccLichKingAddsAction::HandleShamblingHorrors(Unit* boss, bool hasPlague) +void IccLichKingAddsAction::HandleShamblingHorrors(Unit*, bool) { // Find closest shambling horror GuidVector npcs2 = AI_VALUE(GuidVector, "nearest hostile npcs"); @@ -8485,8 +8448,6 @@ bool IccLichKingAddsAction::HandleAssistTankAddManagement(Unit* boss, Difficulty // In heroic mode, stay at melee position if (diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC)) { - Unit* mainTank = AI_VALUE(Unit*, "main tank"); - if (bot->GetExactDist2d(ICC_LICH_KING_ASSISTHC_POSITION.GetPositionX(), ICC_LICH_KING_ASSISTHC_POSITION.GetPositionY()) > 2.0f) { @@ -8723,7 +8684,6 @@ void IccLichKingAddsAction::HandleDefileMechanics(Unit* boss, Difficulty diff) // Gather all defile units std::vector defiles; - Unit* closestDefile = nullptr; float closestDistance = std::numeric_limits::max(); GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); @@ -8737,7 +8697,6 @@ void IccLichKingAddsAction::HandleDefileMechanics(Unit* boss, Difficulty diff) if (dist < closestDistance) { closestDistance = dist; - closestDefile = unit; } } } @@ -9078,7 +9037,6 @@ void IccLichKingAddsAction::HandleValkyrMarking(const std::vector& grabbi std::sort(sortedValkyrs.begin(), sortedValkyrs.end(), [](Unit* a, Unit* b) { return a->GetGUID() < b->GetGUID(); }); static constexpr uint8_t ICON_INDICES[] = {7, 6, 0}; // Skull, Cross, Star - static constexpr const char* ICON_NAMES[] = {"skull", "cross", "star"}; // In heroic mode, clean up invalid markers for all possible icons if (diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC)) From 90daeca8a817bd3630eab9a035477162a44abe46 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 15:05:36 +0100 Subject: [PATCH 062/222] fix: Resolved all warnings in ReachTargetActions.cpp. --- src/Ai/Base/Actions/ReachTargetActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/ReachTargetActions.cpp b/src/Ai/Base/Actions/ReachTargetActions.cpp index a58e9b96ea..e0528555f0 100644 --- a/src/Ai/Base/Actions/ReachTargetActions.cpp +++ b/src/Ai/Base/Actions/ReachTargetActions.cpp @@ -10,7 +10,7 @@ #include "Playerbots.h" #include "ServerFacade.h" -bool ReachTargetAction::Execute(Event event) { return ReachCombatTo(AI_VALUE(Unit*, GetTargetName()), distance); } +bool ReachTargetAction::Execute(Event) { return ReachCombatTo(AI_VALUE(Unit*, GetTargetName()), distance); } bool ReachTargetAction::isUseful() { From 29cfdc834368bb47314ab63482e40155abbb0c5d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 15:13:04 +0100 Subject: [PATCH 063/222] fix: Resolved all warnings in RememberTaxiAction.cpp. --- src/Ai/Base/Actions/RememberTaxiAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/RememberTaxiAction.cpp b/src/Ai/Base/Actions/RememberTaxiAction.cpp index af5a540370..b056f38402 100644 --- a/src/Ai/Base/Actions/RememberTaxiAction.cpp +++ b/src/Ai/Base/Actions/RememberTaxiAction.cpp @@ -7,7 +7,7 @@ #include "Event.h" #include "LastMovementValue.h" -#include "Playerbots.h" +#include "AiObjectContext.h" bool RememberTaxiAction::Execute(Event event) { @@ -28,7 +28,7 @@ bool RememberTaxiAction::Execute(Event event) case CMSG_ACTIVATETAXIEXPRESS: { ObjectGuid guid; - uint32 node_count, totalcost; + uint32 node_count; p >> guid >> node_count; LastMovement& movement = context->GetValue("last taxi")->Get(); From f7aa9c03854730f884ce393d9ccd82c9fec76292 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 15:35:29 +0100 Subject: [PATCH 064/222] fix: Resolved all warnings in ReadyCheckAction.cpp and did a small refactor. --- src/Ai/Base/Actions/ReadyCheckAction.cpp | 43 +++++++++++++++--------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Actions/ReadyCheckAction.cpp b/src/Ai/Base/Actions/ReadyCheckAction.cpp index 1c510d69d4..671fef37dd 100644 --- a/src/Ai/Base/Actions/ReadyCheckAction.cpp +++ b/src/Ai/Base/Actions/ReadyCheckAction.cpp @@ -11,19 +11,32 @@ #include "Event.h" #include "Playerbots.h" -std::string const formatPercent(std::string const name, uint8 value, float percent) +std::string_view getColorForThreshold(const float threshold) +{ + if (threshold > 75.0f) + { + return "|cff00ff00"; + } + + if (threshold > 50.0f) + { + return "|cffffff00"; + } + + return "|cffff0000"; +} + +std::string formatPercent(const std::string& name, const uint32_t value, const float threshold) { std::ostringstream out; - std::string color; - if (percent > 75) - color = "|cff00ff00"; - else if (percent > 50) - color = "|cffffff00"; - else - color = "|cffff0000"; + out << "|cffffffff[" + << name + << "]" + << getColorForThreshold(threshold) + << "x" + << value; - out << "|cffffffff[" << name << "]" << color << "x" << (int)value; return out.str(); } @@ -45,7 +58,7 @@ std::once_flag ReadyChecker::initFlag; class HealthChecker : public ReadyChecker { public: - bool Check(PlayerbotAI* botAI, AiObjectContext* context) override + bool Check(PlayerbotAI*, AiObjectContext* context) override { return AI_VALUE2(uint8, "health", "self target") > sPlayerbotAIConfig.almostFullHealth; } @@ -56,7 +69,7 @@ class HealthChecker : public ReadyChecker class ManaChecker : public ReadyChecker { public: - bool Check(PlayerbotAI* botAI, AiObjectContext* context) override + bool Check(PlayerbotAI*, AiObjectContext* context) override { return !AI_VALUE2(bool, "has mana", "self target") || AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig.mediumHealth; @@ -68,7 +81,7 @@ class ManaChecker : public ReadyChecker class DistanceChecker : public ReadyChecker { public: - bool Check(PlayerbotAI* botAI, AiObjectContext* context) override + bool Check(PlayerbotAI* botAI, AiObjectContext*) override { Player* bot = botAI->GetBot(); if (Player* master = botAI->GetMaster()) @@ -90,7 +103,7 @@ class DistanceChecker : public ReadyChecker class HunterChecker : public ReadyChecker { public: - bool Check(PlayerbotAI* botAI, AiObjectContext* context) override + bool Check(PlayerbotAI* botAI, AiObjectContext*) override { Player* bot = botAI->GetBot(); if (bot->getClass() == CLASS_HUNTER) @@ -126,7 +139,7 @@ class ItemCountChecker : public ReadyChecker public: ItemCountChecker(std::string const item, std::string const name) : item(item), name(name) {} - bool Check(PlayerbotAI* botAI, AiObjectContext* context) override + bool Check(PlayerbotAI*, AiObjectContext* context) override { return AI_VALUE2(uint32, "item count", item) > 0; } @@ -225,4 +238,4 @@ bool ReadyCheckAction::ReadyCheck() return true; } -bool FinishReadyCheckAction::Execute(Event event) { return ReadyCheck(); } +bool FinishReadyCheckAction::Execute(Event) { return ReadyCheck(); } From 46ccb6d7443f4df94b4a87d2343921ad5389798a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 15:37:32 +0100 Subject: [PATCH 065/222] fix: Resolved all warnings in ReleaseSpiritAction.cpp. --- src/Ai/Base/Actions/ReleaseSpiritAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/ReleaseSpiritAction.cpp b/src/Ai/Base/Actions/ReleaseSpiritAction.cpp index 9e3ec445d2..e62192b61a 100644 --- a/src/Ai/Base/Actions/ReleaseSpiritAction.cpp +++ b/src/Ai/Base/Actions/ReleaseSpiritAction.cpp @@ -65,7 +65,7 @@ void ReleaseSpiritAction::IncrementDeathCount() const } } -void ReleaseSpiritAction::LogRelease(const std::string& releaseMsg, bool isAutoRelease) const +void ReleaseSpiritAction::LogRelease(const std::string& releaseMsg, bool) const { const std::string teamPrefix = bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H"; @@ -78,7 +78,7 @@ void ReleaseSpiritAction::LogRelease(const std::string& releaseMsg, bool isAutoR } // AutoReleaseSpiritAction implementation -bool AutoReleaseSpiritAction::Execute(Event event) +bool AutoReleaseSpiritAction::Execute(Event) { IncrementDeathCount(); bot->DurabilityRepairAll(false, 1.0f, false); @@ -214,7 +214,7 @@ bool AutoReleaseSpiritAction::ShouldDelayBattlegroundRelease() const return true; } -bool RepopAction::Execute(Event event) +bool RepopAction::Execute(Event) { const GraveyardStruct* graveyard = GetGrave( AI_VALUE(uint32, "death count") > 10 || @@ -250,7 +250,7 @@ void RepopAction::PerformGraveyardTeleport(const GraveyardStruct* graveyard) con } // SelfResurrectAction implementation for Warlock's Soulstone Resurrection/Shaman's Reincarnation -bool SelfResurrectAction::Execute(Event event) +bool SelfResurrectAction::Execute(Event) { if (!bot->IsAlive() && bot->GetUInt32Value(PLAYER_SELF_RES_SPELL)) { From 88b8e61f6dcf7ee86b0644f66bb3a60e713045d5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:17:01 +0100 Subject: [PATCH 066/222] fix: Resolved all warnings in RepairAllAcction.cpp. --- src/Ai/Base/Actions/RepairAllAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/RepairAllAction.cpp b/src/Ai/Base/Actions/RepairAllAction.cpp index a66ba3a1bb..d62fb1ad12 100644 --- a/src/Ai/Base/Actions/RepairAllAction.cpp +++ b/src/Ai/Base/Actions/RepairAllAction.cpp @@ -9,7 +9,7 @@ #include "Event.h" #include "Playerbots.h" -bool RepairAllAction::Execute(Event event) +bool RepairAllAction::Execute(Event) { GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs"); for (ObjectGuid const guid : npcs) From 336542f3846a627286fe5381a4f29159caf32df8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:19:38 +0100 Subject: [PATCH 067/222] fix: Resolved all warnings in ResetInstancesAction.cpp. --- src/Ai/Base/Actions/ResetInstancesAction.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Actions/ResetInstancesAction.cpp b/src/Ai/Base/Actions/ResetInstancesAction.cpp index cce5eef1e3..8bf9946d5d 100644 --- a/src/Ai/Base/Actions/ResetInstancesAction.cpp +++ b/src/Ai/Base/Actions/ResetInstancesAction.cpp @@ -5,15 +5,19 @@ #include "ResetInstancesAction.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" -bool ResetInstancesAction::Execute(Event event) +bool ResetInstancesAction::Execute(Event) { WorldPacket packet(CMSG_RESET_INSTANCES, 0); - bot->GetSession()->HandleResetInstancesOpcode(packet); - botAI->TellMaster("Resetting all instances"); + this->bot->GetSession()->HandleResetInstancesOpcode(packet); + this->botAI->TellMaster("Resetting all instances"); + return true; } -bool ResetInstancesAction::isUseful() { return botAI->GetGroupLeader() == bot; }; +bool ResetInstancesAction::isUseful() +{ + return this->botAI->GetGroupLeader() == this->bot; +}; From 0dd4e10254fc2fc6482fc4f4ff340949077da776 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:20:42 +0100 Subject: [PATCH 068/222] fix: Resolved all warnings in RevealGatheringItemAction.cpp. --- src/Ai/Base/Actions/RevealGatheringItemAction.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/RevealGatheringItemAction.cpp b/src/Ai/Base/Actions/RevealGatheringItemAction.cpp index 35cd7f8f04..7c2a3c85ee 100644 --- a/src/Ai/Base/Actions/RevealGatheringItemAction.cpp +++ b/src/Ai/Base/Actions/RevealGatheringItemAction.cpp @@ -5,16 +5,18 @@ #include "RevealGatheringItemAction.h" -#include "CellImpl.h" #include "ChatHelper.h" #include "Event.h" #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" -#include "Playerbots.h" #include "ServerFacade.h" #include "NearestGameObjects.h" +#include "PlayerbotAI.h" + +// Required due to a poor implementation by AC +#include "CellImpl.h" +#include "GridNotifiersImpl.h" -bool RevealGatheringItemAction::Execute(Event event) +bool RevealGatheringItemAction::Execute(Event) { if (!bot->GetGroup()) return false; From 27c5da11c27c368e97dacdd94dd22d7e38e0dbed Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:23:03 +0100 Subject: [PATCH 069/222] fix: Resolved all warnings in ReviveFromCorpseAction.cpp. --- src/Ai/Base/Actions/ReviveFromCorpseAction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/ReviveFromCorpseAction.cpp b/src/Ai/Base/Actions/ReviveFromCorpseAction.cpp index 4af96fc698..7a60753f69 100644 --- a/src/Ai/Base/Actions/ReviveFromCorpseAction.cpp +++ b/src/Ai/Base/Actions/ReviveFromCorpseAction.cpp @@ -9,7 +9,6 @@ #include "FleeManager.h" #include "GameGraveyard.h" #include "MapMgr.h" -#include "PlayerbotFactory.h" #include "Playerbots.h" #include "RandomPlayerbotMgr.h" #include "ServerFacade.h" @@ -74,7 +73,7 @@ bool ReviveFromCorpseAction::Execute(Event event) return true; } -bool FindCorpseAction::Execute(Event event) +bool FindCorpseAction::Execute(Event) { if (bot->InBattleground()) return false; @@ -293,7 +292,7 @@ GraveyardStruct const* SpiritHealerAction::GetGrave(bool startZone) return ClosestGrave; } -bool SpiritHealerAction::Execute(Event event) +bool SpiritHealerAction::Execute(Event) { Corpse* corpse = bot->GetCorpse(); if (!corpse) From 20699801916546a2c5519e9458cad6e179d797a8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:24:07 +0100 Subject: [PATCH 070/222] fix: Resolved all warnings in RpgSubActions.cpp. --- src/Ai/Base/Actions/RpgSubActions.cpp | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Ai/Base/Actions/RpgSubActions.cpp b/src/Ai/Base/Actions/RpgSubActions.cpp index 43bff6ab83..f0a37155ee 100644 --- a/src/Ai/Base/Actions/RpgSubActions.cpp +++ b/src/Ai/Base/Actions/RpgSubActions.cpp @@ -99,7 +99,7 @@ Event RpgSubAction::ActionEvent(Event event) { return event; } bool RpgStayAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); } -bool RpgStayAction::Execute(Event event) +bool RpgStayAction::Execute(Event) { bot->PlayerTalkClass->SendCloseGossip(); @@ -109,7 +109,7 @@ bool RpgStayAction::Execute(Event event) bool RpgWorkAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); } -bool RpgWorkAction::Execute(Event event) +bool RpgWorkAction::Execute(Event) { bot->HandleEmoteCommand(EMOTE_STATE_USE_STANDING); rpg->AfterExecute(); @@ -118,7 +118,7 @@ bool RpgWorkAction::Execute(Event event) bool RpgEmoteAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); } -bool RpgEmoteAction::Execute(Event event) +bool RpgEmoteAction::Execute(Event) { uint32 type = TalkAction::GetRandomEmote(rpg->guidP().GetUnit()); @@ -133,7 +133,7 @@ bool RpgEmoteAction::Execute(Event event) return true; } -bool RpgCancelAction::Execute(Event event) +bool RpgCancelAction::Execute(Event) { RESET_AI_VALUE(GuidPosition, "rpg target"); rpg->OnExecute(""); @@ -142,7 +142,7 @@ bool RpgCancelAction::Execute(Event event) bool RpgTaxiAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); } -bool RpgTaxiAction::Execute(Event event) +bool RpgTaxiAction::Execute(Event) { GuidPosition guidP = rpg->guidP(); @@ -203,7 +203,7 @@ bool RpgTaxiAction::Execute(Event event) return true; } -bool RpgDiscoverAction::Execute(Event event) +bool RpgDiscoverAction::Execute(Event) { GuidPosition guidP = rpg->guidP(); @@ -222,7 +222,7 @@ bool RpgDiscoverAction::Execute(Event event) std::string const RpgStartQuestAction::ActionName() { return "accept all quests"; } -Event RpgStartQuestAction::ActionEvent(Event event) +Event RpgStartQuestAction::ActionEvent(Event) { WorldPacket p(CMSG_QUESTGIVER_ACCEPT_QUEST); p << rpg->guid(); @@ -232,7 +232,7 @@ Event RpgStartQuestAction::ActionEvent(Event event) std::string const RpgEndQuestAction::ActionName() { return "talk to quest giver"; } -Event RpgEndQuestAction::ActionEvent(Event event) +Event RpgEndQuestAction::ActionEvent(Event) { WorldPacket p(CMSG_QUESTGIVER_COMPLETE_QUEST); p << rpg->guid(); @@ -242,17 +242,17 @@ Event RpgEndQuestAction::ActionEvent(Event event) std::string const RpgBuyAction::ActionName() { return "buy"; } -Event RpgBuyAction::ActionEvent(Event event) { return Event("rpg action", "vendor"); } +Event RpgBuyAction::ActionEvent(Event) { return Event("rpg action", "vendor"); } std::string const RpgSellAction::ActionName() { return "sell"; } -Event RpgSellAction::ActionEvent(Event event) { return Event("rpg action", "vendor"); } +Event RpgSellAction::ActionEvent(Event) { return Event("rpg action", "vendor"); } std::string const RpgRepairAction::ActionName() { return "repair"; } std::string const RpgTrainAction::ActionName() { return "trainer"; } -bool RpgHealAction::Execute(Event event) +bool RpgHealAction::Execute(Event) { bool retVal = false; @@ -287,21 +287,21 @@ std::string const RpgBuyPetitionAction::ActionName() { return "buy petition"; } std::string const RpgUseAction::ActionName() { return "use"; } -Event RpgUseAction::ActionEvent(Event event) +Event RpgUseAction::ActionEvent(Event) { return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject())); } std::string const RpgSpellAction::ActionName() { return "cast random spell"; } -Event RpgSpellAction::ActionEvent(Event event) +Event RpgSpellAction::ActionEvent(Event) { return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject())); } std::string const RpgCraftAction::ActionName() { return "craft random item"; } -Event RpgCraftAction::ActionEvent(Event event) +Event RpgCraftAction::ActionEvent(Event) { return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject())); } @@ -341,7 +341,7 @@ std::vector RpgTradeUsefulAction::CanGiveItems(GuidPosition guidPosition) return giveItems; } -bool RpgTradeUsefulAction::Execute(Event event) +bool RpgTradeUsefulAction::Execute(Event) { GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target"); @@ -416,7 +416,7 @@ bool RpgDuelAction::isUseful() return true; } -bool RpgDuelAction::Execute(Event event) +bool RpgDuelAction::Execute(Event) { GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target"); @@ -434,7 +434,7 @@ bool RpgMountAnimAction::isUseful() return AI_VALUE2(bool, "mounted", "self target") && !AI_VALUE2(bool, "moving", "self target"); } -bool RpgMountAnimAction::Execute(Event event) +bool RpgMountAnimAction::Execute(Event) { WorldPacket p; bot->GetSession()->HandleMountSpecialAnimOpcode(p); From 2ec67aaf71d9bc017db852dc7a65221b696b1af5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:25:07 +0100 Subject: [PATCH 071/222] fix: Resolved all warnings in RpgAction.cpp. --- src/Ai/Base/Actions/RpgAction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/RpgAction.cpp b/src/Ai/Base/Actions/RpgAction.cpp index 919e25c58e..c1a484882d 100644 --- a/src/Ai/Base/Actions/RpgAction.cpp +++ b/src/Ai/Base/Actions/RpgAction.cpp @@ -7,7 +7,6 @@ #include -#include "BattlegroundMgr.h" #include "ChatHelper.h" #include "EmoteAction.h" #include "Event.h" @@ -16,7 +15,7 @@ #include "ServerFacade.h" #include "RpgSubActions.h" -bool RpgAction::Execute(Event event) +bool RpgAction::Execute(Event) { GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target"); if (!guidP && botAI->GetMaster()) @@ -108,7 +107,7 @@ bool RpgAction::SetNextRpgAction() { std::vector> sortedActions; - for (int i = 0; i < actions.size(); i++) + for (uint64_t i = 0; i < actions.size(); i++) sortedActions.push_back(std::make_pair(actions[i], relevances[i])); std::sort(sortedActions.begin(), sortedActions.end(), [](std::pairi, std::pair j) {return i.second > j.second; }); From 8a76821949d0892b977fc0b8503f66e1835891bf Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:25:35 +0100 Subject: [PATCH 072/222] fix: Resolved an unused parameter warning in RtiAction.cpp. --- src/Ai/Base/Actions/RtiAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/RtiAction.cpp b/src/Ai/Base/Actions/RtiAction.cpp index b34b3eec3d..84a6aeba56 100644 --- a/src/Ai/Base/Actions/RtiAction.cpp +++ b/src/Ai/Base/Actions/RtiAction.cpp @@ -55,7 +55,7 @@ void RtiAction::AppendRti(std::ostringstream& out, std::string const type) out << " (" << target->GetName() << ")"; } -bool MarkRtiAction::Execute(Event event) +bool MarkRtiAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) From d0c0fbd7e4bf7d1cacd9faa659c4c30f6718388e Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:29:43 +0100 Subject: [PATCH 073/222] fix: Refactored SecurityCheckAction.cpp. --- src/Ai/Base/Actions/SecurityCheckAction.cpp | 45 ++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/Ai/Base/Actions/SecurityCheckAction.cpp b/src/Ai/Base/Actions/SecurityCheckAction.cpp index ede59440e3..b1c5825076 100644 --- a/src/Ai/Base/Actions/SecurityCheckAction.cpp +++ b/src/Ai/Base/Actions/SecurityCheckAction.cpp @@ -10,28 +10,37 @@ bool SecurityCheckAction::isUseful() { - return sRandomPlayerbotMgr.IsRandomBot(bot) && botAI->GetMaster() && - botAI->GetMaster()->GetSession()->GetSecurity() < SEC_GAMEMASTER && !GET_PLAYERBOT_AI(botAI->GetMaster()); + return RandomPlayerbotMgr::instance().IsRandomBot(this->bot) + && this->botAI->GetMaster() + && this->botAI->GetMaster()->GetSession()->GetSecurity() < SEC_GAMEMASTER + && !GET_PLAYERBOT_AI(this->botAI->GetMaster()); } -bool SecurityCheckAction::Execute(Event event) +bool SecurityCheckAction::Execute(Event) { - if (Group* group = bot->GetGroup()) + const Group* const group = bot->GetGroup(); + + if (group == nullptr) { - LootMethod method = group->GetLootMethod(); - ItemQualities threshold = group->GetLootThreshold(); - if (method == MASTER_LOOT || method == FREE_FOR_ALL || threshold > ITEM_QUALITY_UNCOMMON) - { - if ((botAI->GetGroupLeader()->GetSession()->GetSecurity() == SEC_PLAYER) && - (!bot->GetGuildId() || bot->GetGuildId() != botAI->GetGroupLeader()->GetGuildId())) - { - botAI->TellError("I will play with this loot type only if I'm in your guild :/"); - botAI->ChangeStrategy("+passive,+stay", BOT_STATE_NON_COMBAT); - botAI->ChangeStrategy("+passive,+stay", BOT_STATE_COMBAT); - } - return true; - } + return false; } - return false; + const LootMethod method = group->GetLootMethod(); + const ItemQualities threshold = group->GetLootThreshold(); + + if (method != MASTER_LOOT && method != FREE_FOR_ALL && threshold <= ITEM_QUALITY_UNCOMMON) + { + return false; + } + + if ( + (this->botAI->GetGroupLeader()->GetSession()->GetSecurity() == SEC_PLAYER) + && (!this->bot->GetGuildId() || this->bot->GetGuildId() != this->botAI->GetGroupLeader()->GetGuildId()) + ) + { + this->botAI->TellError("I will play with this loot type only if I'm in your guild :/"); + this->botAI->ChangeStrategy("+passive,+stay", BOT_STATE_NON_COMBAT); + this->botAI->ChangeStrategy("+passive,+stay", BOT_STATE_COMBAT); + } + return true; } From 2cbb22ddfc5bd2214b8e6369e608e0c95dcc8b0d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:30:25 +0100 Subject: [PATCH 074/222] fix: Resolved all warnings in SeeSpellAction.cpp. --- src/Ai/Base/Actions/SeeSpellAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/SeeSpellAction.cpp b/src/Ai/Base/Actions/SeeSpellAction.cpp index bec9577cf6..b8d13974bf 100644 --- a/src/Ai/Base/Actions/SeeSpellAction.cpp +++ b/src/Ai/Base/Actions/SeeSpellAction.cpp @@ -7,7 +7,6 @@ #include "Event.h" #include "Formations.h" -#include "PathGenerator.h" #include "Playerbots.h" #include "RTSCValues.h" #include "RtscAction.h" @@ -16,7 +15,7 @@ std::set const FISHING_SPELLS = {7620, 7731, 7732, 18248, 33095, 51294}; -Creature* SeeSpellAction::CreateWps(Player* wpOwner, float x, float y, float z, float o, uint32 entry, Creature* lastWp, +Creature* SeeSpellAction::CreateWps(Player* wpOwner, float x, float y, float z, float o, uint32 entry, Creature*, bool important) { float dist = wpOwner->GetDistance(x, y, z); From 605763d5d25ef7c00e3153dcb04d2febf1812aef Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:31:12 +0100 Subject: [PATCH 075/222] fix: Resolved all warnings in SharedQuestAction.cpp. --- src/Ai/Base/Actions/ShareQuestAction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/ShareQuestAction.cpp b/src/Ai/Base/Actions/ShareQuestAction.cpp index a9fe32c973..a778d33fb8 100644 --- a/src/Ai/Base/Actions/ShareQuestAction.cpp +++ b/src/Ai/Base/Actions/ShareQuestAction.cpp @@ -40,9 +40,8 @@ bool ShareQuestAction::Execute(Event event) return false; } -bool AutoShareQuestAction::Execute(Event event) +bool AutoShareQuestAction::Execute(Event) { - Player* requester = event.getOwner() ? event.getOwner() : GetMaster(); bool shared = false; for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot) From eb288a85f11219c9599731751fa43eca9adb6efd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:37:12 +0100 Subject: [PATCH 076/222] fix: Resolved all warnings in SetHomeAction.cpp and did a small refactor. --- src/Ai/Base/Actions/SetHomeAction.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Actions/SetHomeAction.cpp b/src/Ai/Base/Actions/SetHomeAction.cpp index 44f3c7b49f..b7dff92054 100644 --- a/src/Ai/Base/Actions/SetHomeAction.cpp +++ b/src/Ai/Base/Actions/SetHomeAction.cpp @@ -8,7 +8,7 @@ #include "Event.h" #include "Playerbots.h" -bool SetHomeAction::Execute(Event event) +bool SetHomeAction::Execute(Event) { Player* master = GetMaster(); @@ -26,20 +26,10 @@ bool SetHomeAction::Execute(Event event) if (Unit* unit = botAI->GetUnit(selection)) if (unit->HasNpcFlag(UNIT_NPC_FLAG_INNKEEPER)) { - if (isRpgAction) - { - Creature* creature = botAI->GetCreature(selection); - bot->GetSession()->SendBindPoint(creature); - botAI->TellMaster("This inn is my new home"); - return true; - } - else - { - Creature* creature = botAI->GetCreature(selection); - bot->GetSession()->SendBindPoint(creature); - botAI->TellMaster("This inn is my new home"); - return true; - } + Creature* creature = botAI->GetCreature(selection); + bot->GetSession()->SendBindPoint(creature); + botAI->TellMaster("This inn is my new home"); + return true; } GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs"); From 241e0027f5cec06513e7e2d65bf0b9296e6797cb Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:38:24 +0100 Subject: [PATCH 077/222] fix: Resolved all warnings in SayAction.cpp. --- src/Ai/Base/Actions/SayAction.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Ai/Base/Actions/SayAction.cpp b/src/Ai/Base/Actions/SayAction.cpp index 050d7ddbba..8dadca531a 100644 --- a/src/Ai/Base/Actions/SayAction.cpp +++ b/src/Ai/Base/Actions/SayAction.cpp @@ -9,9 +9,7 @@ #include #include -#include "ChannelMgr.h" #include "Event.h" -#include "GuildMgr.h" #include "PlayerbotTextMgr.h" #include "Playerbots.h" @@ -56,7 +54,7 @@ static const std::unordered_set noReplyMsgStarts = {"e ", "accept " SayAction::SayAction(PlayerbotAI* botAI) : Action(botAI, "say"), Qualified() {} -bool SayAction::Execute(Event event) +bool SayAction::Execute(Event) { std::string text = ""; std::map placeholders; @@ -92,7 +90,6 @@ bool SayAction::Execute(Event event) } // set delay before next say - time_t lastSaid = AI_VALUE2(time_t, "last said", qualifier); uint32 nextTime = time(nullptr) + urand(1, 30); botAI->GetAiObjectContext()->GetValue("last said", qualifier)->Set(nextTime); @@ -157,9 +154,8 @@ bool SayAction::isUseful() return (time(nullptr) - lastSaid) > 30; } -void ChatReplyAction::ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint32& guid2, std::string& msg, std::string& chanName, std::string& name) +void ChatReplyAction::ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint32&, std::string& msg, std::string& chanName, std::string& name) { - ChatReplyType replyType = REPLY_NOT_UNDERSTAND; // default not understand std::string respondsText = ""; // if we're just commanding bots around, don't respond... @@ -224,7 +220,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint SendGeneralResponse(bot, chatChannelSource, messageRepy, name); } -bool ChatReplyAction::HandleThunderfuryReply(Player* bot, ChatChannelSource chatChannelSource, std::string& msg, std::string& name) +bool ChatReplyAction::HandleThunderfuryReply(Player* bot, ChatChannelSource chatChannelSource, std::string&, std::string&) { std::map placeholders; const auto thunderfury = sObjectMgr->GetItemTemplate(19019); @@ -252,7 +248,7 @@ bool ChatReplyAction::HandleThunderfuryReply(Player* bot, ChatChannelSource chat return true; } -bool ChatReplyAction::HandleToxicLinksReply(Player* bot, ChatChannelSource chatChannelSource, std::string& msg, std::string& name) +bool ChatReplyAction::HandleToxicLinksReply(Player* bot, ChatChannelSource chatChannelSource, std::string&, std::string&) { //quests std::vector incompleteQuests; From 74fe5cb98b3c85da63346b41a0c74d9666cd99bd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:38:46 +0100 Subject: [PATCH 078/222] fix: Resolved all warnings in SayAction.h. --- src/Ai/Base/Actions/SayAction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/SayAction.h b/src/Ai/Base/Actions/SayAction.h index 5bf9a8f044..f0bf95ba54 100644 --- a/src/Ai/Base/Actions/SayAction.h +++ b/src/Ai/Base/Actions/SayAction.h @@ -29,7 +29,7 @@ class ChatReplyAction : public Action { public: ChatReplyAction(PlayerbotAI* ai) : Action(ai, "chat message") {} - virtual bool Execute(Event event) { return true; } + virtual bool Execute(Event) { return true; } bool isUseful() { return true; } static void ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint32& guid2, std::string& msg, std::string& chanName, std::string& name); From 0f48b9ce3f630d508283d24340994abd8ec6aa59 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:39:52 +0100 Subject: [PATCH 079/222] fix: Resolved all warnings in StatsAction.cpp. --- src/Ai/Base/Actions/StatsAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/StatsAction.cpp b/src/Ai/Base/Actions/StatsAction.cpp index f6872c8468..caf367fb2e 100644 --- a/src/Ai/Base/Actions/StatsAction.cpp +++ b/src/Ai/Base/Actions/StatsAction.cpp @@ -7,9 +7,9 @@ #include "ChatHelper.h" #include "Event.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" -bool StatsAction::Execute(Event event) +bool StatsAction::Execute(Event) { std::ostringstream out; From f09997c3bb96b50351e7ef8c76c56f1165d72646 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:40:26 +0100 Subject: [PATCH 080/222] fix: Resolved all warnings in TameAction.cpp. --- src/Ai/Base/Actions/TameAction.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Ai/Base/Actions/TameAction.cpp b/src/Ai/Base/Actions/TameAction.cpp index 5b3eda1034..b19626e594 100644 --- a/src/Ai/Base/Actions/TameAction.cpp +++ b/src/Ai/Base/Actions/TameAction.cpp @@ -6,12 +6,10 @@ #include "TameAction.h" #include #include -#include #include #include #include #include "DBCStructure.h" -#include "Log.h" #include "ObjectMgr.h" #include "Pet.h" #include "Player.h" @@ -53,7 +51,6 @@ bool TameAction::Execute(Event event) { std::set normalFamilies; std::set exoticFamilies; - Player* bot = botAI->GetBot(); // Loop over all creature templates and collect tameable families CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates(); From b26c1631df630f995d858d67fa7e514996bc3423 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:42:13 +0100 Subject: [PATCH 081/222] fix: Resolved all warnings in SuggestWhatToDoAction.cpp. --- src/Ai/Base/Actions/SuggestWhatToDoAction.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp b/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp index 9012443beb..b3324c3cac 100644 --- a/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp +++ b/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp @@ -7,25 +7,19 @@ #include "SuggestWhatToDoAction.h" #include "ServerFacade.h" -#include "ChannelMgr.h" #include "Event.h" #include "ItemVisitors.h" #include "AiFactory.h" #include "ChatHelper.h" #include "Playerbots.h" -#include "PlayerbotTextMgr.h" -#include "Config.h" #include "BroadcastHelper.h" #include "AiFactory.h" -#include "ChannelMgr.h" #include "ChatHelper.h" -#include "Config.h" #include "Event.h" -#include "GuildMgr.h" #include "ItemVisitors.h" -#include "PlayerbotTextMgr.h" #include "Playerbots.h" #include "ServerFacade.h" +#include "Channel.h" enum eTalkType { @@ -62,14 +56,13 @@ bool SuggestWhatToDoAction::isUseful() return (time(0) - lastSaid) > 30; } -bool SuggestWhatToDoAction::Execute(Event event) +bool SuggestWhatToDoAction::Execute(Event) { uint32 index = rand() % suggestions.size(); auto fnct_ptr = suggestions[index]; fnct_ptr(); std::string const qualifier = "suggest what to do"; - time_t lastSaid = AI_VALUE2(time_t, "last said", qualifier); botAI->GetAiObjectContext()->GetValue("last said", qualifier)->Set(time(nullptr) + urand(1, 60)); return true; @@ -227,7 +220,7 @@ void SuggestWhatToDoAction::thunderfury() class FindTradeItemsVisitor : public IterateItemsVisitor { public: - FindTradeItemsVisitor(uint32 quality) : quality(quality), IterateItemsVisitor() {} + FindTradeItemsVisitor(uint32 quality) : IterateItemsVisitor(), quality(quality) {} bool Visit(Item* item) override { @@ -258,7 +251,7 @@ class FindTradeItemsVisitor : public IterateItemsVisitor SuggestDungeonAction::SuggestDungeonAction(PlayerbotAI* botAI) : SuggestWhatToDoAction(botAI, "suggest dungeon") {} -bool SuggestDungeonAction::Execute(Event event) +bool SuggestDungeonAction::Execute(Event) { // TODO: use PlayerbotDungeonRepository::instance() @@ -325,7 +318,7 @@ bool SuggestDungeonAction::Execute(Event event) SuggestTradeAction::SuggestTradeAction(PlayerbotAI* botAI) : SuggestWhatToDoAction(botAI, "suggest trade") {} -bool SuggestTradeAction::Execute(Event event) +bool SuggestTradeAction::Execute(Event) { uint32 quality = urand(0, 100); if (quality > 95) From ed96df89d46614b89fcfe2d50f72ab2c490e644b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:42:43 +0100 Subject: [PATCH 082/222] fix: Resolved all warnings in TalkToQuestGiverAction.cpp. --- src/Ai/Base/Actions/TalkToQuestGiverAction.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Ai/Base/Actions/TalkToQuestGiverAction.cpp b/src/Ai/Base/Actions/TalkToQuestGiverAction.cpp index 8fd120d605..35e8584b82 100644 --- a/src/Ai/Base/Actions/TalkToQuestGiverAction.cpp +++ b/src/Ai/Base/Actions/TalkToQuestGiverAction.cpp @@ -231,7 +231,6 @@ void TalkToQuestGiverAction::AskToSelectReward(Quest const* quest, std::ostrings for (uint8 i = 0; i < quest->GetRewChoiceItemsCount(); ++i) { ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i]); - ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", quest->RewardChoiceItemId[i]); if (!forEquip || BestRewards(quest).count(i) > 0) { @@ -248,7 +247,6 @@ bool TurnInQueryQuestAction::Execute(Event event) WorldPacket pakcet = event.getPacket(); ObjectGuid guid; uint32 questId; - ObjectGuid unk1; pakcet >> guid >> questId; Object* object = ObjectAccessor::GetObjectByTypeMask(*bot, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM); From 6dc52e70449306f921214fb75ac073ad2150264f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:44:14 +0100 Subject: [PATCH 083/222] fix: Resolved all warnings in TeleportAction.cpp. --- src/Ai/Base/Actions/TeleportAction.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/TeleportAction.cpp b/src/Ai/Base/Actions/TeleportAction.cpp index 65aa24e09f..65a76b12d7 100644 --- a/src/Ai/Base/Actions/TeleportAction.cpp +++ b/src/Ai/Base/Actions/TeleportAction.cpp @@ -7,9 +7,12 @@ #include "Event.h" #include "LastMovementValue.h" -#include "Playerbots.h" +#include "AiObjectContext.h" +#include "PlayerbotAI.h" +#include "SpellMgr.h" +#include "Spell.h" -bool TeleportAction::Execute(Event event) +bool TeleportAction::Execute(Event) { /* // List of allowed portal entries (you can populate this dynamically) @@ -74,7 +77,7 @@ bool TeleportAction::Execute(Event event) continue; uint32 spellId = goInfo->spellcaster.spellId; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + SpellInfo const* spellInfo = SpellMgr::instance()->GetSpellInfo(spellId); if (!spellInfo || !spellInfo->HasEffect(SPELL_EFFECT_TELEPORT_UNITS)) continue; From f4a87098e7cf05223858e77f4393c015439c997c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:44:55 +0100 Subject: [PATCH 084/222] fix: Resolved all warnings in TellLosAction.cpp. --- src/Ai/Base/Actions/TellLosAction.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Actions/TellLosAction.cpp b/src/Ai/Base/Actions/TellLosAction.cpp index 13852bdc0a..7bac6f5b17 100644 --- a/src/Ai/Base/Actions/TellLosAction.cpp +++ b/src/Ai/Base/Actions/TellLosAction.cpp @@ -4,11 +4,9 @@ */ #include "TellLosAction.h" -#include #include #include "ChatHelper.h" -#include "DBCStores.h" #include "Event.h" #include "ItemTemplate.h" #include "ObjectMgr.h" @@ -77,7 +75,7 @@ void TellLosAction::ListGameObjects(std::string const title, GuidVector gos) } } -bool TellAuraAction::Execute(Event event) +bool TellAuraAction::Execute(Event) { botAI->TellMaster("--- Auras ---"); sLog->outMessage("playerbot", LOG_LEVEL_DEBUG, "--- Auras ---"); @@ -97,7 +95,6 @@ bool TellAuraAction::Execute(Event event) std::string caster_name = caster ? caster->GetName() : "unknown"; bool is_area = aura->IsArea(); int32 duration = aura->GetDuration(); - const SpellInfo* spellInfo = aura->GetSpellInfo(); int32 spellId = aura->GetSpellInfo()->Id; bool isPositive = aura->GetSpellInfo()->IsPositive(); sLog->outMessage("playerbot", LOG_LEVEL_DEBUG, @@ -130,7 +127,7 @@ bool TellAuraAction::Execute(Event event) return true; } -bool TellEstimatedDpsAction::Execute(Event event) +bool TellEstimatedDpsAction::Execute(Event) { float dps = AI_VALUE(float, "estimated group dps"); botAI->TellMaster("Estimated Group DPS: " + std::to_string(dps)); From 03b6cfcf220213968fc4f0af0a3e2d2e9edfecf8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:45:58 +0100 Subject: [PATCH 085/222] fix: Resolved all warnings in TellMasterAction.cpp. --- src/Ai/Base/Actions/TellMasterAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/TellMasterAction.cpp b/src/Ai/Base/Actions/TellMasterAction.cpp index 4b8d96d561..1da66554db 100644 --- a/src/Ai/Base/Actions/TellMasterAction.cpp +++ b/src/Ai/Base/Actions/TellMasterAction.cpp @@ -8,13 +8,13 @@ #include "Event.h" #include "Playerbots.h" -bool TellMasterAction::Execute(Event event) +bool TellMasterAction::Execute(Event) { botAI->TellMaster(text); return true; } -bool OutOfReactRangeAction::Execute(Event event) +bool OutOfReactRangeAction::Execute(Event) { botAI->TellMaster("Wait for me!"); return true; From 36e5484be71c8a96b27e00876c156f4dfcf8ad17 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:48:00 +0100 Subject: [PATCH 086/222] fix: Resolved all warnings in TellReputationAction.cpp. --- src/Ai/Base/Actions/TellReputationAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/TellReputationAction.cpp b/src/Ai/Base/Actions/TellReputationAction.cpp index e08a38d840..050a2457a5 100644 --- a/src/Ai/Base/Actions/TellReputationAction.cpp +++ b/src/Ai/Base/Actions/TellReputationAction.cpp @@ -6,10 +6,10 @@ #include "TellReputationAction.h" #include "Event.h" -#include "Playerbots.h" #include "ReputationMgr.h" +#include "PlayerbotAI.h" -bool TellReputationAction::Execute(Event event) +bool TellReputationAction::Execute(Event) { Player* master = GetMaster(); if (!master) From 19172ab7f2711b9da89cce67567791e01309ece8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:48:51 +0100 Subject: [PATCH 087/222] fix: Resolved all warnings in TellTargetAction.cpp. --- src/Ai/Base/Actions/TellTargetAction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/TellTargetAction.cpp b/src/Ai/Base/Actions/TellTargetAction.cpp index 7ecd8efb5a..8830618996 100644 --- a/src/Ai/Base/Actions/TellTargetAction.cpp +++ b/src/Ai/Base/Actions/TellTargetAction.cpp @@ -6,10 +6,11 @@ #include "TellTargetAction.h" #include "Event.h" -#include "Playerbots.h" #include "ThreatMgr.h" +#include "AiObjectContext.h" +#include "PlayerbotAI.h" -bool TellTargetAction::Execute(Event event) +bool TellTargetAction::Execute(Event) { Unit* target = context->GetValue("current target")->Get(); if (target) @@ -24,7 +25,7 @@ bool TellTargetAction::Execute(Event event) return true; } -bool TellAttackersAction::Execute(Event event) +bool TellAttackersAction::Execute(Event) { botAI->TellMaster("--- Attackers ---"); From 77ee9f202457e88d9f86f4ac8cc7915be8624425 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:53:32 +0100 Subject: [PATCH 088/222] fix: Resolved all warnings in TradeAction.cpp. --- src/Ai/Base/Actions/TradeAction.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/TradeAction.cpp b/src/Ai/Base/Actions/TradeAction.cpp index b6f6912be2..84faae89f4 100644 --- a/src/Ai/Base/Actions/TradeAction.cpp +++ b/src/Ai/Base/Actions/TradeAction.cpp @@ -8,7 +8,7 @@ #include "Event.h" #include "ItemCountValue.h" #include "ItemVisitors.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" bool TradeAction::Execute(Event event) { @@ -56,7 +56,18 @@ bool TradeAction::Execute(Event event) } size_t pos = text.rfind(" "); - int count = pos != std::string::npos ? atoi(text.substr(pos + 1).c_str()) : 1; + + uint32_t count = 1; + + if (pos != std::string::npos) + { + const int32_t possibleValue = atoi(text.substr(pos + 1).c_str()); + + if (possibleValue > 0) + { + count = possibleValue; + } + } std::vector found = parseItems(text); if (found.empty()) From c4bd492fa20d69e53bcae98da5c6b186358121eb Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 16:54:31 +0100 Subject: [PATCH 089/222] fix: Resolved all warnings in TradeStatusAction.cpp. --- src/Ai/Base/Actions/TradeStatusAction.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Ai/Base/Actions/TradeStatusAction.cpp b/src/Ai/Base/Actions/TradeStatusAction.cpp index 3057fff097..72ddb87109 100644 --- a/src/Ai/Base/Actions/TradeStatusAction.cpp +++ b/src/Ai/Base/Actions/TradeStatusAction.cpp @@ -64,8 +64,6 @@ bool TradeStatusAction::Execute(Event event) uint32 discount = sRandomPlayerbotMgr.GetTradeDiscount(bot, trader); if (CheckTrade()) { - int32 botMoney = CalculateCost(bot, true); - std::map givenItemIds, takenItemIds; for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot) { @@ -161,13 +159,11 @@ bool TradeStatusAction::CheckTrade() if (!botAI->HasActivePlayerMaster() && GET_PLAYERBOT_AI(bot->GetTrader())) { - bool isGivingItem = false; for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot) { Item* item = bot->GetTradeData()->GetItem((TradeSlots)slot); if (item) { - isGivingItem = true; break; } } From 4ecfe1243b90149d52ae33610974e3373c9f071c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:07:45 +0100 Subject: [PATCH 090/222] fix: Resolved all warnings in UnlockItemAction.cpp. --- src/Ai/Base/Actions/UnlockItemAction.cpp | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Actions/UnlockItemAction.cpp b/src/Ai/Base/Actions/UnlockItemAction.cpp index 367a4fcbfb..0e869e72c6 100644 --- a/src/Ai/Base/Actions/UnlockItemAction.cpp +++ b/src/Ai/Base/Actions/UnlockItemAction.cpp @@ -1,38 +1,39 @@ #include "UnlockItemAction.h" #include "PlayerbotAI.h" #include "ItemTemplate.h" -#include "WorldPacket.h" #include "Player.h" #include "ObjectMgr.h" #include "SpellInfo.h" -#define PICK_LOCK_SPELL_ID 1804 +inline constexpr uint32_t PICK_LOCK_SPELL_ID = 1804; -bool UnlockItemAction::Execute(Event event) +bool UnlockItemAction::Execute(Event) { - bool foundLockedItem = false; + Item* const item = botAI->FindLockedItem(); - Item* item = botAI->FindLockedItem(); - if (item) + if (item == nullptr) { - UnlockItem(item); - foundLockedItem = true; + return false; } - return foundLockedItem; + this->UnlockItem(item); + + return true; } void UnlockItemAction::UnlockItem(Item* item) { // Use CastSpell to unlock the item - if (botAI->CastSpell(PICK_LOCK_SPELL_ID, bot, item)) + const bool unlocked = this->botAI->CastSpell(PICK_LOCK_SPELL_ID, bot, item); + + if (unlocked) { std::ostringstream out; out << "Used Pick Lock on: " << item->GetTemplate()->Name1; - botAI->TellMaster(out.str()); - } - else - { - botAI->TellError("Failed to cast Pick Lock."); + this->botAI->TellMaster(out.str()); + + return; } + + this->botAI->TellError("Failed to cast Pick Lock."); } From 6ca35c84574d9ab02faa0f6b333b9d01e2c55b64 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:09:38 +0100 Subject: [PATCH 091/222] fix: Resolved all warnings in TrainerAction.cpp. --- src/Ai/Base/Actions/TrainerAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/TrainerAction.cpp b/src/Ai/Base/Actions/TrainerAction.cpp index e377fa3eb2..0155da5789 100644 --- a/src/Ai/Base/Actions/TrainerAction.cpp +++ b/src/Ai/Base/Actions/TrainerAction.cpp @@ -155,7 +155,7 @@ void TrainerAction::TellFooter(uint32 totalCost) } } -bool MaintenanceAction::Execute(Event event) +bool MaintenanceAction::Execute(Event) { if (!sPlayerbotAIConfig.maintenanceCommand) { @@ -255,7 +255,7 @@ bool MaintenanceAction::Execute(Event event) return true; } -bool RemoveGlyphAction::Execute(Event event) +bool RemoveGlyphAction::Execute(Event) { for (uint32 slotIndex = 0; slotIndex < MAX_GLYPH_SLOT_INDEX; ++slotIndex) { @@ -265,7 +265,7 @@ bool RemoveGlyphAction::Execute(Event event) return true; } -bool AutoGearAction::Execute(Event event) +bool AutoGearAction::Execute(Event) { if (!sPlayerbotAIConfig.autoGearCommand) { From 33ba5d864763c65cdbba9b005eaf5272db429a8b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:12:01 +0100 Subject: [PATCH 092/222] fix: Resolved all warnings in TravelAction.cpp. --- src/Ai/Base/Actions/TravelAction.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Ai/Base/Actions/TravelAction.cpp b/src/Ai/Base/Actions/TravelAction.cpp index f0afef01bf..5b0d3aa9b1 100644 --- a/src/Ai/Base/Actions/TravelAction.cpp +++ b/src/Ai/Base/Actions/TravelAction.cpp @@ -5,12 +5,13 @@ #include "TravelAction.h" -#include "CellImpl.h" #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "Playerbots.h" +// Required due to a poor implementation by AC +#include "CellImpl.h" +#include "GridNotifiersImpl.h" -bool TravelAction::Execute(Event event) +bool TravelAction::Execute(Event) { TravelTarget* target = AI_VALUE(TravelTarget*, "travel target"); @@ -37,7 +38,9 @@ bool TravelAction::Execute(Event event) if (!newTarget->IsAlive()) continue; - if (newTarget->GetEntry() == target->getDestination()->getEntry()) + const int64_t newTargetEntry = newTarget->GetEntry(); + + if (newTargetEntry == target->getDestination()->getEntry()) continue; if (newTarget->IsInCombat()) @@ -60,7 +63,7 @@ bool TravelAction::isUseful() (!AI_VALUE(GuidPosition, "rpg target") || !AI_VALUE(ObjectGuid, "pull target")); } -bool MoveToDarkPortalAction::Execute(Event event) +bool MoveToDarkPortalAction::Execute(Event) { if (bot->GetGroup()) if (bot->GetGroup()->GetLeaderGUID() != bot->GetGUID() && @@ -111,7 +114,7 @@ bool MoveToDarkPortalAction::Execute(Event event) bool MoveToDarkPortalAction::isUseful() { return bot->GetLevel() > 54; } -bool DarkPortalAzerothAction::Execute(Event event) +bool DarkPortalAzerothAction::Execute(Event) { if (bot->GetLevel() > 57) { @@ -126,7 +129,7 @@ bool DarkPortalAzerothAction::Execute(Event event) bool DarkPortalAzerothAction::isUseful() { return bot->GetLevel() > 57; } -bool MoveFromDarkPortalAction::Execute(Event event) +bool MoveFromDarkPortalAction::Execute(Event) { RESET_AI_VALUE(GuidPosition, "rpg target"); From 003a2717ab1ed26966e9d110d9d17bb7defa1505 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:16:09 +0100 Subject: [PATCH 093/222] fix: Resolved all warnings TravelAction.cpp. --- src/Ai/Base/Actions/TravelAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/TravelAction.cpp b/src/Ai/Base/Actions/TravelAction.cpp index 5b0d3aa9b1..0038425f80 100644 --- a/src/Ai/Base/Actions/TravelAction.cpp +++ b/src/Ai/Base/Actions/TravelAction.cpp @@ -134,9 +134,9 @@ bool MoveFromDarkPortalAction::Execute(Event) RESET_AI_VALUE(GuidPosition, "rpg target"); if (bot->GetTeamId() == TEAM_ALLIANCE) + { return MoveTo(530, -319.261f, 1027.213, 54.172638f, false, true); - else - return MoveTo(530, -180.444f, 1027.947, 54.181538f, false, true); + } - return false; + return MoveTo(530, -180.444f, 1027.947, 54.181538f, false, true); } From 38131af397716d4913a7e962e776530ce1022984 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:18:50 +0100 Subject: [PATCH 094/222] fix: Resolved all warnings in UseItemAction.cpp. --- src/Ai/Base/Actions/UseItemAction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/UseItemAction.cpp b/src/Ai/Base/Actions/UseItemAction.cpp index 473816e3ec..ba828d962e 100644 --- a/src/Ai/Base/Actions/UseItemAction.cpp +++ b/src/Ai/Base/Actions/UseItemAction.cpp @@ -69,7 +69,6 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni uint8 bagIndex = item->GetBagSlot(); uint8 slot = item->GetSlot(); - uint8 spell_index = 0; uint8 cast_count = 1; ObjectGuid item_guid = item->GetGUID(); uint32 glyphIndex = 0; @@ -423,7 +422,7 @@ bool UseRandomRecipe::isUseful() bool UseRandomRecipe::isPossible() { return AI_VALUE2(uint32, "item count", "recipe") > 0; } -bool UseRandomRecipe::Execute(Event event) +bool UseRandomRecipe::Execute(Event) { std::vector recipes = AI_VALUE2(std::vector, "inventory items", "recipe"); @@ -452,7 +451,7 @@ bool UseRandomQuestItem::isUseful() bool UseRandomQuestItem::isPossible() { return AI_VALUE2(uint32, "item count", "quest") > 0; } -bool UseRandomQuestItem::Execute(Event event) +bool UseRandomQuestItem::Execute(Event) { Unit* unitTarget = nullptr; ObjectGuid goTarget; From c49d431712e7c8a152141d4d468cb181ef1d683e Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:22:56 +0100 Subject: [PATCH 095/222] fix: Resolved all warnings in VehicleActions.cpp. --- src/Ai/Base/Actions/VehicleActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/VehicleActions.cpp b/src/Ai/Base/Actions/VehicleActions.cpp index ac925fbcb1..f5a43f899c 100644 --- a/src/Ai/Base/Actions/VehicleActions.cpp +++ b/src/Ai/Base/Actions/VehicleActions.cpp @@ -95,7 +95,7 @@ bool EnterVehicleAction::EnterVehicle(Unit* vehicleBase, bool moveIfFar) return true; } -bool LeaveVehicleAction::Execute(Event event) +bool LeaveVehicleAction::Execute(Event) { Vehicle* myVehicle = bot->GetVehicle(); if (!myVehicle) From 3040ac6580166c92ad36ac2e80525b6f7de84c74 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:30:25 +0100 Subject: [PATCH 096/222] fix: Rewrote WipeAction::Execute from scratch because it was guaranteed to crash. --- src/Ai/Base/Actions/WipeAction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Actions/WipeAction.cpp b/src/Ai/Base/Actions/WipeAction.cpp index bbd1997d6c..84c5771309 100644 --- a/src/Ai/Base/Actions/WipeAction.cpp +++ b/src/Ai/Base/Actions/WipeAction.cpp @@ -8,11 +8,15 @@ bool WipeAction::Execute(Event event) { - Player* master = event.getOwner(); + const Player* const owner = event.getOwner(); + const Player* const master = this->botAI->GetMaster(); - if (botAI->GetMaster()->GetGUID() != event.getOwner()->GetGUID()) + if (owner != nullptr && master != nullptr && master->GetGUID() != owner->GetGUID()) + { return false; + } bot->Kill(bot, bot); + return true; } From 1c383a3690865a55d1349faa2006c3a47b73814f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:32:36 +0100 Subject: [PATCH 097/222] fix: Resolved all warnings in UseMeetingStoneAction.cpp. --- src/Ai/Base/Actions/UseMeetingStoneAction.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/UseMeetingStoneAction.cpp b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp index b334429189..a676b0cf28 100644 --- a/src/Ai/Base/Actions/UseMeetingStoneAction.cpp +++ b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp @@ -5,14 +5,15 @@ #include "UseMeetingStoneAction.h" -#include "CellImpl.h" #include "Event.h" #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "NearestGameObjects.h" #include "PlayerbotAIConfig.h" #include "Playerbots.h" #include "PositionValue.h" +// Required because of a poor implementation by AC +#include "GridNotifiersImpl.h" +#include "CellImpl.h" bool UseMeetingStoneAction::Execute(Event event) { @@ -55,13 +56,13 @@ bool UseMeetingStoneAction::Execute(Event event) return Teleport(master, bot, false); } -bool SummonAction::Execute(Event event) +bool SummonAction::Execute(Event) { Player* master = GetMaster(); if (!master) return false; - if (Pet* pet = bot->GetPet()) + if (bot->GetPet() != nullptr) { botAI->PetFollow(); } From 2cb08657e1c9eff2197a0cf8580a1916e5ab8145 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:33:45 +0100 Subject: [PATCH 098/222] fix: Added explicit this in WipeAction.cpp. --- src/Ai/Base/Actions/WipeAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/WipeAction.cpp b/src/Ai/Base/Actions/WipeAction.cpp index 84c5771309..7101b9f2c0 100644 --- a/src/Ai/Base/Actions/WipeAction.cpp +++ b/src/Ai/Base/Actions/WipeAction.cpp @@ -16,7 +16,7 @@ bool WipeAction::Execute(Event event) return false; } - bot->Kill(bot, bot); + this->bot->Kill(this->bot, this->bot); return true; } From 3d33bf523dfebaf330da309133c5c69b7cd3cc3c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:34:41 +0100 Subject: [PATCH 099/222] fix: Resolved all warnings in WhoAction.cpp. --- src/Ai/Base/Actions/WhoAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Actions/WhoAction.cpp b/src/Ai/Base/Actions/WhoAction.cpp index 8f83b6e489..1cc325038f 100644 --- a/src/Ai/Base/Actions/WhoAction.cpp +++ b/src/Ai/Base/Actions/WhoAction.cpp @@ -108,7 +108,7 @@ std::string const WhoAction::QuerySkill(std::string const text) return out.str(); } -std::string const WhoAction::QuerySpec(std::string const text) +std::string const WhoAction::QuerySpec(std::string) { std::ostringstream out; From fb2bb2d3762bdb54f1a495f202456c2b72db31fc Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:35:24 +0100 Subject: [PATCH 100/222] fix: Resolved an unused parameter warning in ChatCommandHandlerStrategy.cpp. --- src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp index 91a0ce5c5e..7439494aff 100644 --- a/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp +++ b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp @@ -11,7 +11,7 @@ class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory Date: Thu, 29 Jan 2026 17:36:05 +0100 Subject: [PATCH 101/222] fix: Resolved all warnings in CombatStrategy.cpp. --- src/Ai/Base/Strategy/CombatStrategy.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Strategy/CombatStrategy.cpp b/src/Ai/Base/Strategy/CombatStrategy.cpp index 75700e9a6d..c8a066f48d 100644 --- a/src/Ai/Base/Strategy/CombatStrategy.cpp +++ b/src/Ai/Base/Strategy/CombatStrategy.cpp @@ -5,7 +5,6 @@ #include "CombatStrategy.h" -#include "Playerbots.h" #include "Strategy.h" void CombatStrategy::InitTriggers(std::vector& triggers) @@ -65,11 +64,11 @@ std::vector AvoidAoeStrategy::getDefaultActions() }; } -void AvoidAoeStrategy::InitTriggers(std::vector& triggers) +void AvoidAoeStrategy::InitTriggers(std::vector&) { } -void AvoidAoeStrategy::InitMultipliers(std::vector& multipliers) +void AvoidAoeStrategy::InitMultipliers(std::vector&) { } @@ -82,7 +81,7 @@ std::vector TankFaceStrategy::getDefaultActions() }; } -void TankFaceStrategy::InitTriggers(std::vector& triggers) +void TankFaceStrategy::InitTriggers(std::vector&) { } From 5e956903d2b207baa09d8e1d76103fbf3c68d482 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:36:35 +0100 Subject: [PATCH 102/222] fix: Resolved all warning in DuelStrategy.cpp. --- src/Ai/Base/Strategy/DuelStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/DuelStrategy.cpp b/src/Ai/Base/Strategy/DuelStrategy.cpp index 4c08397e6b..6c5ff2618c 100644 --- a/src/Ai/Base/Strategy/DuelStrategy.cpp +++ b/src/Ai/Base/Strategy/DuelStrategy.cpp @@ -5,8 +5,6 @@ #include "DuelStrategy.h" -#include "Playerbots.h" - void DuelStrategy::InitTriggers(std::vector& triggers) { PassTroughStrategy::InitTriggers(triggers); @@ -19,6 +17,6 @@ void DuelStrategy::InitTriggers(std::vector& triggers) DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} -void StartDuelStrategy::InitTriggers(std::vector& triggers) {} +void StartDuelStrategy::InitTriggers(std::vector&) {} StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} From 2f63d8a54f8eeae663e7cb2e9ba0827dfa9575ef Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:37:02 +0100 Subject: [PATCH 103/222] fix: Resolved all warnings in FollowMasterStrategy.cpp. --- src/Ai/Base/Strategy/FollowMasterStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/FollowMasterStrategy.cpp b/src/Ai/Base/Strategy/FollowMasterStrategy.cpp index 0308b113f9..bd87b4c28c 100644 --- a/src/Ai/Base/Strategy/FollowMasterStrategy.cpp +++ b/src/Ai/Base/Strategy/FollowMasterStrategy.cpp @@ -5,8 +5,6 @@ #include "FollowMasterStrategy.h" -#include "Playerbots.h" - std::vector FollowMasterStrategy::getDefaultActions() { return { @@ -14,6 +12,6 @@ std::vector FollowMasterStrategy::getDefaultActions() }; } -void FollowMasterStrategy::InitTriggers(std::vector& triggers) +void FollowMasterStrategy::InitTriggers(std::vector&) { } From 90ea002ef0f85e2a63202ba4e04be77d1100a926 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:37:29 +0100 Subject: [PATCH 104/222] fix: Resolved all warnings in GuardStrategy.cpp. --- src/Ai/Base/Strategy/GuardStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/GuardStrategy.cpp b/src/Ai/Base/Strategy/GuardStrategy.cpp index 9a396ac57f..70635d65cb 100644 --- a/src/Ai/Base/Strategy/GuardStrategy.cpp +++ b/src/Ai/Base/Strategy/GuardStrategy.cpp @@ -5,8 +5,6 @@ #include "GuardStrategy.h" -#include "Playerbots.h" - std::vector GuardStrategy::getDefaultActions() { return { @@ -14,4 +12,4 @@ std::vector GuardStrategy::getDefaultActions() }; } -void GuardStrategy::InitTriggers(std::vector& triggers) {} +void GuardStrategy::InitTriggers(std::vector&) {} From c7948db6649e2764978f706db07f7a8c5aba4f02 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:38:10 +0100 Subject: [PATCH 105/222] fix: Resolved all warnings in NonCombatStrategy.cpp. --- src/Ai/Base/Strategy/NonCombatStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/NonCombatStrategy.cpp b/src/Ai/Base/Strategy/NonCombatStrategy.cpp index 6b8f76ac95..c37c558f42 100644 --- a/src/Ai/Base/Strategy/NonCombatStrategy.cpp +++ b/src/Ai/Base/Strategy/NonCombatStrategy.cpp @@ -5,8 +5,6 @@ #include "NonCombatStrategy.h" -#include "Playerbots.h" - void NonCombatStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("random", { NextAction("clean quest log", 1.0f) })); @@ -19,7 +17,7 @@ void CollisionStrategy::InitTriggers(std::vector& triggers) new TriggerNode("collision", { NextAction("move out of collision", 2.0f) })); } -void MountStrategy::InitTriggers(std::vector& triggers) +void MountStrategy::InitTriggers(std::vector&) { } From fceb9c379398cdb1e7c690b6bbde216d7e21fba7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:38:46 +0100 Subject: [PATCH 106/222] fix: Resolved all warnings in RTSCStrategy.cpp. --- src/Ai/Base/Strategy/RTSCStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/RTSCStrategy.cpp b/src/Ai/Base/Strategy/RTSCStrategy.cpp index 2c64092e3c..daf8bfc579 100644 --- a/src/Ai/Base/Strategy/RTSCStrategy.cpp +++ b/src/Ai/Base/Strategy/RTSCStrategy.cpp @@ -5,8 +5,6 @@ #include "RTSCStrategy.h" -#include "Playerbots.h" - RTSCStrategy::RTSCStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} -void RTSCStrategy::InitTriggers(std::vector& triggers) {} +void RTSCStrategy::InitTriggers(std::vector&) {} From 994fda93a03b40bb3c1209a9762cd733e5fcf0c0 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:39:30 +0100 Subject: [PATCH 107/222] fix: Resolved all warnings in RacialsStrategy.cpp. --- src/Ai/Base/Strategy/RacialsStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/RacialsStrategy.cpp b/src/Ai/Base/Strategy/RacialsStrategy.cpp index f4f270b1b0..68fa9af4cf 100644 --- a/src/Ai/Base/Strategy/RacialsStrategy.cpp +++ b/src/Ai/Base/Strategy/RacialsStrategy.cpp @@ -5,15 +5,13 @@ #include "RacialsStrategy.h" -#include "Playerbots.h" - class RacialsStrategyActionNodeFactory : public NamedObjectFactory { public: RacialsStrategyActionNodeFactory() { creators["lifeblood"] = &lifeblood; } private: - static ActionNode* lifeblood(PlayerbotAI* botAI) + static ActionNode* lifeblood(PlayerbotAI*) { return new ActionNode("lifeblood", /*P*/ {}, From 6f36acdbb2f24f677e6848873d08c2ae769f3a2b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:39:55 +0100 Subject: [PATCH 108/222] fix: Resolved all warnings in UsePotionsStrategy.cpp. --- src/Ai/Base/Strategy/UsePotionsStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Base/Strategy/UsePotionsStrategy.cpp b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp index b0e0049269..f252c91ccb 100644 --- a/src/Ai/Base/Strategy/UsePotionsStrategy.cpp +++ b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp @@ -5,15 +5,13 @@ #include "UsePotionsStrategy.h" -#include "Playerbots.h" - class UsePotionsStrategyActionNodeFactory : public NamedObjectFactory { public: UsePotionsStrategyActionNodeFactory() { creators["healthstone"] = &healthstone; } private: - static ActionNode* healthstone(PlayerbotAI* botAI) + static ActionNode* healthstone(PlayerbotAI*) { return new ActionNode("healthstone", /*P*/ {}, From f0aca0b807684ef1e345af31f9c2279b40b5d091 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:43:13 +0100 Subject: [PATCH 109/222] fix: Resolved all warnings in GenericTriggers.cpp. --- src/Ai/Base/Trigger/GenericTriggers.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Trigger/GenericTriggers.cpp b/src/Ai/Base/Trigger/GenericTriggers.cpp index a933bc232d..35041970cd 100644 --- a/src/Ai/Base/Trigger/GenericTriggers.cpp +++ b/src/Ai/Base/Trigger/GenericTriggers.cpp @@ -7,9 +7,7 @@ #include -#include "BattlegroundWS.h" #include "CreatureAI.h" -#include "GameTime.h" #include "ItemVisitors.h" #include "LastSpellCastValue.h" #include "ObjectGuid.h" @@ -166,7 +164,10 @@ bool BuffTrigger::IsActive() Aura* aura = botAI->GetAura(spell, target, checkIsOwner, checkDuration); if (!aura) return true; - if (beforeDuration && aura->GetDuration() < beforeDuration) + + const int64_t signedBeforeDuration = this->beforeDuration; + + if (beforeDuration && aura->GetDuration() < signedBeforeDuration) return true; return false; } @@ -412,7 +413,12 @@ bool HealerShouldAttackTrigger::IsActive() return true; } -bool ItemCountTrigger::IsActive() { return AI_VALUE2(uint32, "item count", item) < count; } +bool ItemCountTrigger::IsActive() +{ + const int64_t aiValue = this->context->GetValue("item count", item)->Get(); + + return aiValue < this->count; +} bool InterruptSpellTrigger::IsActive() { From 42398ec6dca91edfb38d9290da91470e5111c2d4 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 17:46:18 +0100 Subject: [PATCH 110/222] fix: Resolved all warnings within RaidKarazhanActions.cpp. --- .../Karazhan/Action/RaidKarazhanActions.cpp | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp b/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp index adf0eac488..b9f85b1cfd 100644 --- a/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp +++ b/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp @@ -9,7 +9,7 @@ using namespace KarazhanHelpers; // Mana Warps blow up when they die for massive raid damage // But they cannot cast the ability if they are stunned -bool ManaWarpStunCreatureBeforeWarpBreachAction::Execute(Event event) +bool ManaWarpStunCreatureBeforeWarpBreachAction::Execute(Event) { Unit* manaWarp = GetFirstAliveUnitByEntry(botAI, NPC_MANA_WARP); if (!manaWarp) @@ -39,7 +39,7 @@ bool ManaWarpStunCreatureBeforeWarpBreachAction::Execute(Event event) // Attumen the Huntsman // Prioritize Midnight until Attumen is mounted -bool AttumenTheHuntsmanMarkTargetAction::Execute(Event event) +bool AttumenTheHuntsmanMarkTargetAction::Execute(Event) { Unit* attumenMounted = GetFirstAliveUnitByEntry(botAI, NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED); if (attumenMounted) @@ -76,7 +76,7 @@ bool AttumenTheHuntsmanMarkTargetAction::Execute(Event event) } // Off tank should move Attumen out of the way so he doesn't cleave bots -bool AttumenTheHuntsmanSplitBossesAction::Execute(Event event) +bool AttumenTheHuntsmanSplitBossesAction::Execute(Event) { Unit* midnight = AI_VALUE2(Unit*, "find target", "midnight"); if (!midnight) @@ -104,7 +104,7 @@ bool AttumenTheHuntsmanSplitBossesAction::Execute(Event event) } // Stack behind mounted Attumen (inside minimum range of Berserker Charge) -bool AttumenTheHuntsmanStackBehindAction::Execute(Event event) +bool AttumenTheHuntsmanStackBehindAction::Execute(Event) { Unit* attumenMounted = GetFirstAliveUnitByEntry(botAI, NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED); if (!attumenMounted) @@ -125,7 +125,7 @@ bool AttumenTheHuntsmanStackBehindAction::Execute(Event event) } // Reset timer for bots to pause DPS when Attumen mounts Midnight -bool AttumenTheHuntsmanManageDpsTimerAction::Execute(Event event) +bool AttumenTheHuntsmanManageDpsTimerAction::Execute(Event) { Unit* midnight = AI_VALUE2(Unit*, "find target", "midnight"); if (!midnight) @@ -152,7 +152,7 @@ bool AttumenTheHuntsmanManageDpsTimerAction::Execute(Event event) // Moroes -bool MoroesMainTankAttackBossAction::Execute(Event event) +bool MoroesMainTankAttackBossAction::Execute(Event) { Unit* moroes = AI_VALUE2(Unit*, "find target", "moroes"); if (!moroes) @@ -168,7 +168,7 @@ bool MoroesMainTankAttackBossAction::Execute(Event event) } // Mark targets with skull in the recommended kill order -bool MoroesMarkTargetAction::Execute(Event event) +bool MoroesMarkTargetAction::Execute(Event) { Unit* dorothea = AI_VALUE2(Unit*, "find target", "baroness dorothea millstipe"); Unit* catriona = AI_VALUE2(Unit*, "find target", "lady catriona von'indi"); @@ -193,7 +193,7 @@ bool MoroesMarkTargetAction::Execute(Event event) // Tank the boss in the center of the room // Move to healers after Repentenace to break the stun -bool MaidenOfVirtueMoveBossToHealerAction::Execute(Event event) +bool MaidenOfVirtueMoveBossToHealerAction::Execute(Event) { Unit* maiden = AI_VALUE2(Unit*, "find target", "maiden of virtue"); if (!maiden) @@ -247,7 +247,7 @@ bool MaidenOfVirtueMoveBossToHealerAction::Execute(Event event) } // Spread out ranged DPS between the pillars -bool MaidenOfVirtuePositionRangedAction::Execute(Event event) +bool MaidenOfVirtuePositionRangedAction::Execute(Event) { const uint8 maxIndex = 7; uint8 index = 0; @@ -287,7 +287,7 @@ bool MaidenOfVirtuePositionRangedAction::Execute(Event event) // The Big Bad Wolf // Tank the boss at the front left corner of the stage -bool BigBadWolfPositionBossAction::Execute(Event event) +bool BigBadWolfPositionBossAction::Execute(Event) { Unit* wolf = AI_VALUE2(Unit*, "find target", "the big bad wolf"); if (!wolf) @@ -318,7 +318,7 @@ bool BigBadWolfPositionBossAction::Execute(Event event) } // Run away, little girl, run away -bool BigBadWolfRunAwayFromBossAction::Execute(Event event) +bool BigBadWolfRunAwayFromBossAction::Execute(Event) { const ObjectGuid botGuid = bot->GetGUID(); uint8 index = bigBadWolfRunIndex.count(botGuid) ? bigBadWolfRunIndex[botGuid] : 0; @@ -341,7 +341,7 @@ bool BigBadWolfRunAwayFromBossAction::Execute(Event event) // Romulo and Julianne // Keep the couple within 10% HP of each other -bool RomuloAndJulianneMarkTargetAction::Execute(Event event) +bool RomuloAndJulianneMarkTargetAction::Execute(Event) { Unit* romulo = AI_VALUE2(Unit*, "find target", "romulo"); if (!romulo) @@ -370,7 +370,7 @@ bool RomuloAndJulianneMarkTargetAction::Execute(Event event) // The Wizard of Oz // Mark targets with skull in the recommended kill order -bool WizardOfOzMarkTargetAction::Execute(Event event) +bool WizardOfOzMarkTargetAction::Execute(Event) { Unit* dorothee = AI_VALUE2(Unit*, "find target", "dorothee"); Unit* tito = AI_VALUE2(Unit*, "find target", "tito"); @@ -387,7 +387,7 @@ bool WizardOfOzMarkTargetAction::Execute(Event event) } // Mages spam Scorch on Strawman to disorient him -bool WizardOfOzScorchStrawmanAction::Execute(Event event) +bool WizardOfOzScorchStrawmanAction::Execute(Event) { Unit* strawman = AI_VALUE2(Unit*, "find target", "strawman"); if (strawman && botAI->CanCastSpell("scorch", strawman)) @@ -399,7 +399,7 @@ bool WizardOfOzScorchStrawmanAction::Execute(Event event) // The Curator // Prioritize destroying Astral Flares -bool TheCuratorMarkAstralFlareAction::Execute(Event event) +bool TheCuratorMarkAstralFlareAction::Execute(Event) { Unit* flare = AI_VALUE2(Unit*, "find target", "astral flare"); if (!flare) @@ -415,7 +415,7 @@ bool TheCuratorMarkAstralFlareAction::Execute(Event event) // Tank the boss in the center of the hallway near the Guardian's Library // Main tank and off tank will attack the boss; others will focus on Astral Flares -bool TheCuratorPositionBossAction::Execute(Event event) +bool TheCuratorPositionBossAction::Execute(Event) { Unit* curator = AI_VALUE2(Unit*, "find target", "the curator"); if (!curator) @@ -449,7 +449,7 @@ bool TheCuratorPositionBossAction::Execute(Event event) } // Spread out ranged DPS to avoid Arcing Sear damage -bool TheCuratorSpreadRangedAction::Execute(Event event) +bool TheCuratorSpreadRangedAction::Execute(Event) { const float minDistance = 5.0f; Unit* nearestPlayer = GetNearestPlayerInRadius(bot, minDistance); @@ -467,7 +467,7 @@ bool TheCuratorSpreadRangedAction::Execute(Event event) // Terestian Illhoof // Prioritize (1) Demon Chains, (2) Kil'rek, (3) Illhoof -bool TerestianIllhoofMarkTargetAction::Execute(Event event) +bool TerestianIllhoofMarkTargetAction::Execute(Event) { Unit* demonChains = AI_VALUE2(Unit*, "find target", "demon chains"); Unit* kilrek = AI_VALUE2(Unit*, "find target", "kil'rek"); @@ -483,7 +483,7 @@ bool TerestianIllhoofMarkTargetAction::Execute(Event event) // Shade of Aran // Run to the edge of the room to avoid Arcane Explosion -bool ShadeOfAranRunAwayFromArcaneExplosionAction::Execute(Event event) +bool ShadeOfAranRunAwayFromArcaneExplosionAction::Execute(Event) { Unit* aran = AI_VALUE2(Unit*, "find target", "shade of aran"); if (!aran) @@ -502,7 +502,7 @@ bool ShadeOfAranRunAwayFromArcaneExplosionAction::Execute(Event event) } // I will not move when Flame Wreath is cast or the raid blows up -bool ShadeOfAranStopMovingDuringFlameWreathAction::Execute(Event event) +bool ShadeOfAranStopMovingDuringFlameWreathAction::Execute(Event) { AI_VALUE(LastMovement&, "last movement").Set(nullptr); @@ -517,7 +517,7 @@ bool ShadeOfAranStopMovingDuringFlameWreathAction::Execute(Event event) } // Mark Conjured Elementals with skull so DPS can burn them down -bool ShadeOfAranMarkConjuredElementalAction::Execute(Event event) +bool ShadeOfAranMarkConjuredElementalAction::Execute(Event) { Unit* elemental = GetFirstAliveUnitByEntry(botAI, NPC_CONJURED_ELEMENTAL); @@ -529,7 +529,7 @@ bool ShadeOfAranMarkConjuredElementalAction::Execute(Event event) // Don't get closer than 11 yards to Aran to avoid counterspell // Don't get farther than 15 yards from Aran to avoid getting stuck in alcoves -bool ShadeOfAranRangedMaintainDistanceAction::Execute(Event event) +bool ShadeOfAranRangedMaintainDistanceAction::Execute(Event) { Unit* aran = AI_VALUE2(Unit*, "find target", "shade of aran"); if (!aran) @@ -593,7 +593,7 @@ bool ShadeOfAranRangedMaintainDistanceAction::Execute(Event event) // One tank bot per phase will dance in and out of the red beam (5 seconds in, 5 seconds out) // Tank bots will ignore void zones--their positioning is too important to risk losing beam control -bool NetherspiteBlockRedBeamAction::Execute(Event event) +bool NetherspiteBlockRedBeamAction::Execute(Event) { Unit* netherspite = AI_VALUE2(Unit*, "find target", "netherspite"); if (!netherspite) @@ -680,7 +680,7 @@ Position NetherspiteBlockRedBeamAction::GetPositionOnBeam(Unit* netherspite, Uni // Two non-Rogue/Warrior DPS bots will block the blue beam for each phase (swap at 25 debuff stacks) // When avoiding void zones, blocking bots will move along the beam to continue blocking -bool NetherspiteBlockBlueBeamAction::Execute(Event event) +bool NetherspiteBlockBlueBeamAction::Execute(Event) { Unit* netherspite = AI_VALUE2(Unit*, "find target", "netherspite"); if (!netherspite) @@ -773,7 +773,7 @@ bool NetherspiteBlockBlueBeamAction::Execute(Event event) // Two healer bots will block the green beam for each phase (swap at 25 debuff stacks) // OR one rogue or DPS warrior bot will block the green beam for an entire phase (if they begin the phase as the blocker) // When avoiding void zones, blocking bots will move along the beam to continue blocking -bool NetherspiteBlockGreenBeamAction::Execute(Event event) +bool NetherspiteBlockGreenBeamAction::Execute(Event) { Unit* netherspite = AI_VALUE2(Unit*, "find target", "netherspite"); if (!netherspite) @@ -863,13 +863,12 @@ bool NetherspiteBlockGreenBeamAction::Execute(Event event) } // All bots not currently blocking a beam will avoid beams and void zones -bool NetherspiteAvoidBeamAndVoidZoneAction::Execute(Event event) +bool NetherspiteAvoidBeamAndVoidZoneAction::Execute(Event) { Unit* netherspite = AI_VALUE2(Unit*, "find target", "netherspite"); if (!netherspite) return false; - auto [redBlocker, greenBlocker, blueBlocker] = GetCurrentBeamBlockers(botAI, bot); std::vector voidZones = GetAllVoidZones(botAI, bot); bool nearVoidZone = !IsSafePosition(bot->GetPositionX(), bot->GetPositionY(), @@ -979,7 +978,7 @@ bool NetherspiteAvoidBeamAndVoidZoneAction::IsAwayFromBeams( return true; } -bool NetherspiteBanishPhaseAvoidVoidZoneAction::Execute(Event event) +bool NetherspiteBanishPhaseAvoidVoidZoneAction::Execute(Event) { std::vector voidZones = GetAllVoidZones(botAI, bot); @@ -992,7 +991,7 @@ bool NetherspiteBanishPhaseAvoidVoidZoneAction::Execute(Event event) return false; } -bool NetherspiteManageTimersAndTrackersAction::Execute(Event event) +bool NetherspiteManageTimersAndTrackersAction::Execute(Event) { Unit* netherspite = AI_VALUE2(Unit*, "find target", "netherspite"); if (!netherspite) @@ -1044,7 +1043,7 @@ bool NetherspiteManageTimersAndTrackersAction::Execute(Event event) // Move away from the boss to avoid Shadow Nova when Enfeebled // Do not cross within Infernal Hellfire radius while doing so -bool PrinceMalchezaarEnfeebledAvoidHazardAction::Execute(Event event) +bool PrinceMalchezaarEnfeebledAvoidHazardAction::Execute(Event) { Unit* malchezaar = AI_VALUE2(Unit*, "find target", "prince malchezaar"); if (!malchezaar) @@ -1056,7 +1055,6 @@ bool PrinceMalchezaarEnfeebledAvoidHazardAction::Execute(Event event) const float minSafeBossDistanceSq = minSafeBossDistance * minSafeBossDistance; const float maxSafeBossDistance = 60.0f; const float safeInfernalDistance = 23.0f; - const float safeInfernalDistanceSq = safeInfernalDistance * safeInfernalDistance; const float distIncrement = 0.5f; const uint8 numAngles = 64; @@ -1121,7 +1119,7 @@ bool PrinceMalchezaarEnfeebledAvoidHazardAction::Execute(Event event) // Move away from infernals while staying within range of the boss // Prioritize finding a safe path to the new location, but will fallback to just finding a safe location if needed -bool PrinceMalchezaarNonTankAvoidInfernalAction::Execute(Event event) +bool PrinceMalchezaarNonTankAvoidInfernalAction::Execute(Event) { Unit* malchezaar = AI_VALUE2(Unit*, "find target", "prince malchezaar"); if (!malchezaar) @@ -1188,7 +1186,7 @@ bool PrinceMalchezaarNonTankAvoidInfernalAction::Execute(Event event) // This is similar to the non-tank avoid infernal action, but the movement is based on the bot's location // And the safe distance from infernals is larger to give melee more room to maneuver -bool PrinceMalchezaarMainTankMovementAction::Execute(Event event) +bool PrinceMalchezaarMainTankMovementAction::Execute(Event) { Unit* malchezaar = AI_VALUE2(Unit*, "find target", "prince malchezaar"); if (!malchezaar) @@ -1254,7 +1252,7 @@ bool PrinceMalchezaarMainTankMovementAction::Execute(Event event) // The tank position is near the Southeastern area of the Master's Terrace // The tank moves Nightbane into position in two steps to try to get Nightbane to face sideways to the raid -bool NightbaneGroundPhasePositionBossAction::Execute(Event event) +bool NightbaneGroundPhasePositionBossAction::Execute(Event) { Unit* nightbane = AI_VALUE2(Unit*, "find target", "nightbane"); if (!nightbane) @@ -1300,7 +1298,7 @@ bool NightbaneGroundPhasePositionBossAction::Execute(Event event) // Ranged bots rotate between 3 positions to avoid standing in Charred Earth, which lasts for // 30s and has a minimum cooldown of 18s (so there can be 2 active at once) // Ranged positions are near the Northeastern door to the tower -bool NightbaneGroundPhaseRotateRangedPositionsAction::Execute(Event event) +bool NightbaneGroundPhaseRotateRangedPositionsAction::Execute(Event) { const ObjectGuid botGuid = bot->GetGUID(); uint8 index = nightbaneRangedStep.count(botGuid) ? nightbaneRangedStep[botGuid] : 0; @@ -1344,7 +1342,7 @@ bool NightbaneGroundPhaseRotateRangedPositionsAction::Execute(Event event) } // For countering Bellowing Roars during the ground phase -bool NightbaneCastFearWardOnMainTankAction::Execute(Event event) +bool NightbaneCastFearWardOnMainTankAction::Execute(Event) { Player* mainTank = nullptr; if (Group* group = bot->GetGroup()) @@ -1367,7 +1365,7 @@ bool NightbaneCastFearWardOnMainTankAction::Execute(Event event) } // Put pets on passive during the flight phase so they don't try to chase Nightbane off the map -bool NightbaneControlPetAggressionAction::Execute(Event event) +bool NightbaneControlPetAggressionAction::Execute(Event) { Unit* nightbane = AI_VALUE2(Unit*, "find target", "nightbane"); if (!nightbane) @@ -1393,7 +1391,7 @@ bool NightbaneControlPetAggressionAction::Execute(Event event) // 2. Once Rain of Bones hits, the whole party moves to a new stack position // This action lasts for the first 35 seconds of the flight phase, after which Nightbane gets // ready to land, and the player will need to lead the bots over near the ground phase position -bool NightbaneFlightPhaseMovementAction::Execute(Event event) +bool NightbaneFlightPhaseMovementAction::Execute(Event) { Unit* nightbane = AI_VALUE2(Unit*, "find target", "nightbane"); if (!nightbane || nightbane->GetPositionZ() <= NIGHTBANE_FLIGHT_Z) @@ -1439,7 +1437,7 @@ bool NightbaneFlightPhaseMovementAction::Execute(Event event) return false; } -bool NightbaneManageTimersAndTrackersAction::Execute(Event event) +bool NightbaneManageTimersAndTrackersAction::Execute(Event) { Unit* nightbane = AI_VALUE2(Unit*, "find target", "nightbane"); if (!nightbane) From a340f86550849deb42bd7f0fa0007d8e8900ed9a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:06:29 +0100 Subject: [PATCH 111/222] fix: Resolved all warnings in LastMovementValue.cpp. --- src/Ai/Base/Value/LastMovementValue.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Value/LastMovementValue.cpp b/src/Ai/Base/Value/LastMovementValue.cpp index ba54020e39..34f554616a 100644 --- a/src/Ai/Base/Value/LastMovementValue.cpp +++ b/src/Ai/Base/Value/LastMovementValue.cpp @@ -5,7 +5,6 @@ #include "LastMovementValue.h" -#include "Playerbots.h" #include "Timer.h" LastMovement::LastMovement() { clear(); } @@ -15,11 +14,11 @@ LastMovement::LastMovement(LastMovement& other) taxiMaster(other.taxiMaster), lastFollow(other.lastFollow), lastAreaTrigger(other.lastAreaTrigger), + lastFlee(other.lastFlee), lastMoveToX(other.lastMoveToX), lastMoveToY(other.lastMoveToY), lastMoveToZ(other.lastMoveToZ), - lastMoveToOri(other.lastMoveToOri), - lastFlee(other.lastFlee) + lastMoveToOri(other.lastMoveToOri) { lastMoveShort = other.lastMoveShort; nextTeleport = other.nextTeleport; From 6d02eb2741bff59709ce0f4c50d039d664d5e133 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:07:34 +0100 Subject: [PATCH 112/222] fix: Resolved all warnings in RangeTriggers.cpp. --- src/Ai/Base/Trigger/RangeTriggers.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Trigger/RangeTriggers.cpp b/src/Ai/Base/Trigger/RangeTriggers.cpp index 2acc2aec85..d0d86d0148 100644 --- a/src/Ai/Base/Trigger/RangeTriggers.cpp +++ b/src/Ai/Base/Trigger/RangeTriggers.cpp @@ -11,10 +11,10 @@ #include "ServerFacade.h" #include "SharedDefines.h" -static float GetSpeedInMotion(Unit* target) -{ - return target->GetSpeed(Movement::SelectSpeedType(target->GetUnitMovementFlags())); -} +// static float GetSpeedInMotion(Unit* target) +// { +// return target->GetSpeed(Movement::SelectSpeedType(target->GetUnitMovementFlags())); +// } bool EnemyTooCloseForSpellTrigger::IsActive() { @@ -201,7 +201,6 @@ bool PartyMemberToHealOutOfSpellRangeTrigger::IsActive() if (!target) return false; - float combatReach = bot->GetCombatReach() + target->GetCombatReach(); return target && (ServerFacade::instance().GetDistance2d(bot, target) > (distance + sPlayerbotAIConfig.contactDistance) || !bot->IsWithinLOSInMap(target)); } From 51e12cdf8f1bed84e5b0554a7e01268d2074a30f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:09:59 +0100 Subject: [PATCH 113/222] fix: Resolved all warnings in RaidMagtheridonActions.cpp. --- .../Action/RaidMagtheridonActions.cpp | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp index 69fc862442..1de87d1acb 100644 --- a/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp +++ b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp @@ -7,7 +7,7 @@ using namespace MagtheridonHelpers; -bool MagtheridonMainTankAttackFirstThreeChannelersAction::Execute(Event event) +bool MagtheridonMainTankAttackFirstThreeChannelersAction::Execute(Event) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); if (!magtheridon) @@ -67,7 +67,7 @@ bool MagtheridonMainTankAttackFirstThreeChannelersAction::Execute(Event event) return false; } -bool MagtheridonFirstAssistTankAttackNWChannelerAction::Execute(Event event) +bool MagtheridonFirstAssistTankAttackNWChannelerAction::Execute(Event) { Creature* channelerDiamond = GetChanneler(bot, NORTHWEST_CHANNELER); if (!channelerDiamond || !channelerDiamond->IsAlive()) @@ -100,7 +100,7 @@ bool MagtheridonFirstAssistTankAttackNWChannelerAction::Execute(Event event) return false; } -bool MagtheridonSecondAssistTankAttackNEChannelerAction::Execute(Event event) +bool MagtheridonSecondAssistTankAttackNEChannelerAction::Execute(Event) { Creature* channelerTriangle = GetChanneler(bot, NORTHEAST_CHANNELER); if (!channelerTriangle || !channelerTriangle->IsAlive()) @@ -134,7 +134,7 @@ bool MagtheridonSecondAssistTankAttackNEChannelerAction::Execute(Event event) } // Misdirect West & East Channelers to Main Tank -bool MagtheridonMisdirectHellfireChannelers::Execute(Event event) +bool MagtheridonMisdirectHellfireChannelers::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -211,7 +211,7 @@ bool MagtheridonMisdirectHellfireChannelers::Execute(Event event) return false; } -bool MagtheridonAssignDPSPriorityAction::Execute(Event event) +bool MagtheridonAssignDPSPriorityAction::Execute(Event) { // Listed in order of priority Creature* channelerSquare = GetChanneler(bot, SOUTH_CHANNELER); @@ -306,7 +306,7 @@ bool MagtheridonAssignDPSPriorityAction::Execute(Event event) // Assign Burning Abyssals to Warlocks to Banish // Burning Abyssals in excess of Warlocks in party will be Feared -bool MagtheridonWarlockCCBurningAbyssalAction::Execute(Event event) +bool MagtheridonWarlockCCBurningAbyssalAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -340,7 +340,9 @@ bool MagtheridonWarlockCCBurningAbyssalAction::Execute(Event event) } } - if (warlockIndex >= 0 && warlockIndex < abyssals.size()) + const int64_t abyssalSize = abyssals.size(); + + if (warlockIndex >= 0 && warlockIndex < abyssalSize) { Unit* assignedAbyssal = abyssals[warlockIndex]; if (!assignedAbyssal->HasAura(SPELL_BANISH) && botAI->CanCastSpell(SPELL_BANISH, assignedAbyssal, true)) @@ -359,7 +361,7 @@ bool MagtheridonWarlockCCBurningAbyssalAction::Execute(Event event) } // Main tank will back up to the Northern point of the room -bool MagtheridonMainTankPositionBossAction::Execute(Event event) +bool MagtheridonMainTankPositionBossAction::Execute(Event) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); if (!magtheridon) @@ -399,7 +401,7 @@ bool MagtheridonMainTankPositionBossAction::Execute(Event event) std::unordered_map MagtheridonSpreadRangedAction::initialPositions; std::unordered_map MagtheridonSpreadRangedAction::hasReachedInitialPosition; -bool MagtheridonSpreadRangedAction::Execute(Event event) +bool MagtheridonSpreadRangedAction::Execute(Event) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); if (!magtheridon) @@ -509,7 +511,7 @@ bool MagtheridonSpreadRangedAction::Execute(Event event) // For bots that are assigned to click cubes // Magtheridon casts Blast Nova every 54.35 to 55.40s, with a 2s cast time -bool MagtheridonUseManticronCubeAction::Execute(Event event) +bool MagtheridonUseManticronCubeAction::Execute(Event) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); if (!magtheridon) @@ -543,7 +545,7 @@ bool MagtheridonUseManticronCubeAction::Execute(Event event) return false; } -bool MagtheridonUseManticronCubeAction::HandleCubeRelease(Unit* magtheridon, GameObject* cube) +bool MagtheridonUseManticronCubeAction::HandleCubeRelease(Unit* magtheridon, GameObject*) { if (bot->HasAura(SPELL_SHADOW_GRASP) && !(magtheridon->HasUnitState(UNIT_STATE_CASTING) && @@ -650,7 +652,7 @@ bool MagtheridonUseManticronCubeAction::HandleCubeInteraction(const CubeInfo& cu // is not interrupted or takes too long to interrupt, the timer will be thrown off for the rest of the encounter. // Correcting this issue is complicated and probably would need some rewriting--I have not done so and // and view the current solution as sufficient since in TBC a missed Blast Nova would be a guaranteed wipe anyway. -bool MagtheridonManageTimersAndAssignmentsAction::Execute(Event event) +bool MagtheridonManageTimersAndAssignmentsAction::Execute(Event) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); if (!magtheridon) From 09c2a538b8d728de6d44a2f38dda8bef18ff60de Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:14:09 +0100 Subject: [PATCH 114/222] fix: Resolved all warnings in RpgTriggers.cpp. --- src/Ai/Base/Trigger/RpgTriggers.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Trigger/RpgTriggers.cpp b/src/Ai/Base/Trigger/RpgTriggers.cpp index f390359be3..ed528d2b72 100644 --- a/src/Ai/Base/Trigger/RpgTriggers.cpp +++ b/src/Ai/Base/Trigger/RpgTriggers.cpp @@ -31,9 +31,16 @@ bool RpgTrigger::IsActive() { return true; } Event RpgTrigger::Check() { - if (!NoRpgTargetTrigger::IsActive() && (AI_VALUE(std::string, "next rpg action") == "choose rpg target") || - !FarFromRpgTargetTrigger::IsActive()) + if ( + ( + !NoRpgTargetTrigger::IsActive() + && (AI_VALUE(std::string, "next rpg action") == "choose rpg target") + ) + || !FarFromRpgTargetTrigger::IsActive() + ) + { return Trigger::Check(); + } return Event(); } From b89b0dc85f01494043c74c154cf67259cee167b1 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:20:25 +0100 Subject: [PATCH 115/222] fix: Resolved all warnings in Arrow.h and Arrow.cpp. --- src/Ai/Base/Value/Arrow.cpp | 8 +++----- src/Ai/Base/Value/Arrow.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Value/Arrow.cpp b/src/Ai/Base/Value/Arrow.cpp index 5fd710220c..25e3a03947 100644 --- a/src/Ai/Base/Value/Arrow.cpp +++ b/src/Ai/Base/Value/Arrow.cpp @@ -6,7 +6,8 @@ #include "Arrow.h" #include "Map.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" +#include "Group.h" WorldLocation ArrowFormation::GetLocationInternal() { @@ -18,7 +19,6 @@ WorldLocation ArrowFormation::GetLocationInternal() uint32 tankLines = 1 + tanks.Size() / 6; uint32 meleeLines = 1 + melee.Size() / 6; uint32 rangedLines = 1 + ranged.Size() / 6; - uint32 healerLines = 1 + healers.Size() / 6; float offset = 0.f; Player* master = botAI->GetMaster(); @@ -143,12 +143,10 @@ UnitPosition MultiLineUnitPlacer::Place(FormationUnit* unit, uint32 index, uint3 uint32 lineNo = index / 6; uint32 indexInLine = index % 6; uint32 lineSize = std::max(count - lineNo * 6, uint32(6)); - float x = cos(orientation) * sPlayerbotAIConfig.followDistance * lineNo; - float y = sin(orientation) * sPlayerbotAIConfig.followDistance * lineNo; return placer.Place(unit, indexInLine, lineSize); } -UnitPosition SingleLineUnitPlacer::Place(FormationUnit* unit, uint32 index, uint32 count) +UnitPosition SingleLineUnitPlacer::Place(FormationUnit*, uint32 index, uint32 count) { float angle = orientation - M_PI / 2.0f; float x = cos(angle) * sPlayerbotAIConfig.followDistance * ((float)index - (float)count / 2); diff --git a/src/Ai/Base/Value/Arrow.h b/src/Ai/Base/Value/Arrow.h index 3e5a76b8fb..7a14fba4d1 100644 --- a/src/Ai/Base/Value/Arrow.h +++ b/src/Ai/Base/Value/Arrow.h @@ -102,7 +102,7 @@ class ArrowFormation : public MoveAheadFormation { public: ArrowFormation(PlayerbotAI* botAI) - : MoveAheadFormation(botAI, "arrow"), built(false), masterUnit(nullptr), botUnit(nullptr) + : MoveAheadFormation(botAI, "arrow"), masterUnit(nullptr), botUnit(nullptr), built(false) { } From 66e3ad5b2856d35b4f0c65c4d8c55461084e624d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:22:49 +0100 Subject: [PATCH 116/222] fix: Resolved all warnings in CcTargetValue.cpp. --- src/Ai/Base/Value/CcTargetValue.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Value/CcTargetValue.cpp b/src/Ai/Base/Value/CcTargetValue.cpp index 1c305aec3c..e84f4f4b70 100644 --- a/src/Ai/Base/Value/CcTargetValue.cpp +++ b/src/Ai/Base/Value/CcTargetValue.cpp @@ -6,7 +6,9 @@ #include "CcTargetValue.h" #include "Action.h" -#include "Playerbots.h" +#include "AiObjectContext.h" +#include "Group.h" +#include "PlayerbotAI.h" #include "ServerFacade.h" class FindTargetForCcStrategy : public FindTargetStrategy @@ -18,7 +20,7 @@ class FindTargetForCcStrategy : public FindTargetStrategy } public: - void CheckAttacker(Unit* creature, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* creature, ThreatMgr*) override { Player* bot = botAI->GetBot(); if (!botAI->CanCastSpell(spell, creature)) From 2ad34ac6d2fc869c2e57784c6215d30cb8a7fbdb Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:23:59 +0100 Subject: [PATCH 117/222] fix: Resolved all warnings in BudgetValues.cpp. --- src/Ai/Base/Value/BudgetValues.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Value/BudgetValues.cpp b/src/Ai/Base/Value/BudgetValues.cpp index daa7aca863..06b2e1d576 100644 --- a/src/Ai/Base/Value/BudgetValues.cpp +++ b/src/Ai/Base/Value/BudgetValues.cpp @@ -10,7 +10,7 @@ uint32 MaxGearRepairCostValue::Calculate() { uint32 TotalCost = 0; - for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) + for (uint32_t i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { uint16 pos = ((INVENTORY_SLOT_BAG_0 << 8) | i); Item* item = bot->GetItemByPos(pos); From 03cd3777a8abb25d4456b564640ba8a69049a6b5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:29:01 +0100 Subject: [PATCH 118/222] fix: Resolved all warnings in CurrentCcTargetValue.cpp. --- src/Ai/Base/Value/CurrentCcTargetValue.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Value/CurrentCcTargetValue.cpp b/src/Ai/Base/Value/CurrentCcTargetValue.cpp index 27b8100264..7739dd81b9 100644 --- a/src/Ai/Base/Value/CurrentCcTargetValue.cpp +++ b/src/Ai/Base/Value/CurrentCcTargetValue.cpp @@ -4,8 +4,7 @@ */ #include "CurrentCcTargetValue.h" - -#include "Playerbots.h" +#include "PlayerbotAI.h" class FindCurrentCcTargetStrategy : public FindTargetStrategy { @@ -14,7 +13,7 @@ class FindCurrentCcTargetStrategy : public FindTargetStrategy { } - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (botAI->HasAura(spell, attacker)) result = attacker; From 14e36d1d49ff78666ee917b5da5d54082ca589b2 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:29:57 +0100 Subject: [PATCH 119/222] fix: Resolved all warnings in DpsTargetValue.cpp. --- src/Ai/Base/Value/DpsTargetValue.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Ai/Base/Value/DpsTargetValue.cpp b/src/Ai/Base/Value/DpsTargetValue.cpp index 1a813c9940..d1bad8c17d 100644 --- a/src/Ai/Base/Value/DpsTargetValue.cpp +++ b/src/Ai/Base/Value/DpsTargetValue.cpp @@ -29,7 +29,6 @@ class FindMaxThreatGapTargetStrategy : public FindTargetStrategy foundHighPriority = true; return; } - Unit* victim = attacker->GetVictim(); if (!result || CalcThreatGap(attacker, threatMgr) > CalcThreatGap(result, &result->GetThreatMgr())) result = attacker; } @@ -53,7 +52,7 @@ class CasterFindTargetSmartStrategy : public FindTargetStrategy result = nullptr; } - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (Group* group = botAI->GetBot()->GetGroup()) { @@ -144,7 +143,7 @@ class GeneralFindTargetSmartStrategy : public FindTargetStrategy { } - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (Group* group = botAI->GetBot()->GetGroup()) { @@ -195,7 +194,6 @@ class GeneralFindTargetSmartStrategy : public FindTargetStrategy } int32_t GetIntervalLevel(Unit* unit) { - float time = unit->GetHealth() / dps_; float dis = unit->GetDistance(botAI->GetBot()); float attackRange = botAI->IsRanged(botAI->GetBot()) ? sPlayerbotAIConfig.spellDistance : sPlayerbotAIConfig.meleeDistance; @@ -218,7 +216,7 @@ class ComboFindTargetSmartStrategy : public FindTargetStrategy { } - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (Group* group = botAI->GetBot()->GetGroup()) { @@ -276,7 +274,6 @@ class ComboFindTargetSmartStrategy : public FindTargetStrategy } int32_t GetIntervalLevel(Unit* unit) { - float time = unit->GetHealth() / dps_; float dis = unit->GetDistance(botAI->GetBot()); float attackRange = botAI->IsRanged(botAI->GetBot()) ? sPlayerbotAIConfig.spellDistance : sPlayerbotAIConfig.meleeDistance; @@ -322,7 +319,7 @@ class FindMaxHpTargetStrategy : public FindTargetStrategy public: FindMaxHpTargetStrategy(PlayerbotAI* botAI) : FindTargetStrategy(botAI), maxHealth(0) {} - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (Group* group = botAI->GetBot()->GetGroup()) { From fc9a10c69c6765421f2d14711a82515fa7e8aede Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:32:53 +0100 Subject: [PATCH 120/222] fix: Resolved all warnings in GrindTargetValue.cpp. --- src/Ai/Base/Value/GrindTargetValue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Value/GrindTargetValue.cpp b/src/Ai/Base/Value/GrindTargetValue.cpp index ce021a2d9a..d0c5095b8a 100644 --- a/src/Ai/Base/Value/GrindTargetValue.cpp +++ b/src/Ai/Base/Value/GrindTargetValue.cpp @@ -30,7 +30,6 @@ Unit* GrindTargetValue::Calculate() Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount) { - uint32 memberCount = 1; Group* group = bot->GetGroup(); Player* master = GetMaster(); @@ -65,7 +64,6 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount) if (!unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) continue; - auto& rep = bot->ToPlayer()->GetReputationMgr(); if (unit->ToCreature() && !unit->ToCreature()->GetCreatureTemplate()->lootid && bot->GetReactionTo(unit) >= REP_NEUTRAL) continue; @@ -184,7 +182,9 @@ bool GrindTargetValue::needForQuest(Unit* target) int required = questTemplate->RequiredNpcOrGoCount[j]; int available = questStatus->CreatureOrGOCount[j]; - if (required && available < required && target->GetEntry() == entry) + const int64_t targetEntry = target->GetEntry(); + + if (required && available < required && targetEntry == entry) return true; } } From 07b882e37f2bca59b10f73ea4a37ea80015564a8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:43:36 +0100 Subject: [PATCH 121/222] fix: Refactored ItemCoutValue.cpp. --- src/Ai/Base/Value/ItemCountValue.cpp | 25 +++++++------------------ src/Ai/Base/Value/ItemCountValue.h | 3 --- src/Ai/Base/Value/LogLevelValue.h | 1 + src/Ai/Base/ValueContext.h | 1 + 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/Ai/Base/Value/ItemCountValue.cpp b/src/Ai/Base/Value/ItemCountValue.cpp index 2c719d8f4d..9d4cb729f9 100644 --- a/src/Ai/Base/Value/ItemCountValue.cpp +++ b/src/Ai/Base/Value/ItemCountValue.cpp @@ -5,26 +5,12 @@ #include "ItemCountValue.h" -#include "Playerbots.h" - -std::vector InventoryItemValueBase::Find(std::string const qualifier) +uint32_t ItemCountValue::Calculate() { - std::vector result; - - Player* bot = InventoryAction::botAI->GetBot(); - + uint32_t count = 0; std::vector items = InventoryAction::parseItems(qualifier); - for (Item* item : items) - result.push_back(item); - - return result; -} -uint32 ItemCountValue::Calculate() -{ - uint32 count = 0; - std::vector items = Find(qualifier); - for (Item* item : items) + for (const Item* const item : items) { count += item->GetCount(); } @@ -32,4 +18,7 @@ uint32 ItemCountValue::Calculate() return count; } -std::vector InventoryItemValue::Calculate() { return Find(qualifier); } +std::vector InventoryItemValue::Calculate() +{ + return InventoryAction::parseItems(qualifier); +} diff --git a/src/Ai/Base/Value/ItemCountValue.h b/src/Ai/Base/Value/ItemCountValue.h index 99265a013f..41ac9a62f4 100644 --- a/src/Ai/Base/Value/ItemCountValue.h +++ b/src/Ai/Base/Value/ItemCountValue.h @@ -18,9 +18,6 @@ class InventoryItemValueBase : public InventoryAction InventoryItemValueBase(PlayerbotAI* botAI) : InventoryAction(botAI, "empty") {} bool Execute(Event) override { return false; } - -protected: - std::vector Find(std::string const qualifier); }; class ItemCountValue : public Uint32CalculatedValue, public Qualified, InventoryItemValueBase diff --git a/src/Ai/Base/Value/LogLevelValue.h b/src/Ai/Base/Value/LogLevelValue.h index 18fdbddcee..f8515b13b2 100644 --- a/src/Ai/Base/Value/LogLevelValue.h +++ b/src/Ai/Base/Value/LogLevelValue.h @@ -6,6 +6,7 @@ #ifndef _PLAYERBOT_LOGLEVELVALUE_H #define _PLAYERBOT_LOGLEVELVALUE_H +#include "LogCommon.h" #include "Value.h" class PlayerbotAI; diff --git a/src/Ai/Base/ValueContext.h b/src/Ai/Base/ValueContext.h index ab93bcea47..82ef819ce2 100644 --- a/src/Ai/Base/ValueContext.h +++ b/src/Ai/Base/ValueContext.h @@ -51,6 +51,7 @@ #include "LineTargetValue.h" #include "LogLevelValue.h" #include "LootStrategyValue.h" +#include "LootValues.h" #include "MaintenanceValues.h" #include "ManaSaveLevelValue.h" #include "NearestAdsValue.h" From 308295052766f4397d96b8dd218cd197f559f443 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:47:40 +0100 Subject: [PATCH 122/222] fix: Resolved all warnings in LootStrategyValue.cpp. --- src/Ai/Base/Value/LeastHpTargetValue.cpp | 5 ++--- src/Ai/Base/Value/LootStrategyValue.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Value/LeastHpTargetValue.cpp b/src/Ai/Base/Value/LeastHpTargetValue.cpp index 8b9f1a55fc..04b3fcefff 100644 --- a/src/Ai/Base/Value/LeastHpTargetValue.cpp +++ b/src/Ai/Base/Value/LeastHpTargetValue.cpp @@ -6,16 +6,14 @@ #include "LeastHpTargetValue.h" #include "AttackersValue.h" -#include "Playerbots.h" class FindLeastHpTargetStrategy : public FindNonCcTargetStrategy { public: FindLeastHpTargetStrategy(PlayerbotAI* botAI) : FindNonCcTargetStrategy(botAI), minHealth(0) {} - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { - Player* bot = botAI->GetBot(); if (IsCcTarget(attacker)) return; @@ -30,5 +28,6 @@ class FindLeastHpTargetStrategy : public FindNonCcTargetStrategy Unit* LeastHpTargetValue::Calculate() { FindLeastHpTargetStrategy strategy(botAI); + return FindTarget(&strategy); } diff --git a/src/Ai/Base/Value/LootStrategyValue.cpp b/src/Ai/Base/Value/LootStrategyValue.cpp index 6a4f9b9b48..0ff6f7e98b 100644 --- a/src/Ai/Base/Value/LootStrategyValue.cpp +++ b/src/Ai/Base/Value/LootStrategyValue.cpp @@ -60,7 +60,7 @@ class DisenchantLootStrategy : public NormalLootStrategy class AllLootStrategy : public LootStrategy { public: - bool CanLoot(ItemTemplate const* proto, AiObjectContext* context) override { return true; } + bool CanLoot(ItemTemplate const*, AiObjectContext*) override { return true; } std::string const GetName() override { return "all"; } }; From 753f80ce726e6e17fb97f1eb5b70c23c5c5eb861 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:50:12 +0100 Subject: [PATCH 123/222] fix: Resolved all warnings in NearestCorpsesValue.cpp. --- src/Ai/Base/Value/NearestCorpsesValue.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Value/NearestCorpsesValue.cpp b/src/Ai/Base/Value/NearestCorpsesValue.cpp index fec1aed21f..3e049ea24d 100644 --- a/src/Ai/Base/Value/NearestCorpsesValue.cpp +++ b/src/Ai/Base/Value/NearestCorpsesValue.cpp @@ -5,28 +5,30 @@ #include "NearestCorpsesValue.h" -#include "CellImpl.h" #include "GridNotifiers.h" +// Required due to +#include "CellImpl.h" #include "GridNotifiersImpl.h" -#include "Playerbots.h" class AnyDeadUnitInObjectRangeCheck { public: - AnyDeadUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {} + AnyDeadUnitInObjectRangeCheck(WorldObject const* obj) : i_obj(obj) {} WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Unit* u) { return !u->IsAlive(); } private: WorldObject const* i_obj; - float i_range; }; void NearestCorpsesValue::FindUnits(std::list& targets) { - AnyDeadUnitInObjectRangeCheck u_check(bot, range); + AnyDeadUnitInObjectRangeCheck u_check(bot); Acore::UnitListSearcher searcher(bot, targets, u_check); Cell::VisitObjects(bot, searcher, range); } -bool NearestCorpsesValue::AcceptUnit(Unit* unit) { return true; } +bool NearestCorpsesValue::AcceptUnit(Unit*) +{ + return true; +} From 04e713945a3a82461356bf5c15ec3b6ef99592c4 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:53:05 +0100 Subject: [PATCH 124/222] fix: Resolved all warnings in PartyMemberToDispel.cpp. --- src/Ai/Base/Value/PartyMemberToDispel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Value/PartyMemberToDispel.cpp b/src/Ai/Base/Value/PartyMemberToDispel.cpp index 91b1955b27..d578052c10 100644 --- a/src/Ai/Base/Value/PartyMemberToDispel.cpp +++ b/src/Ai/Base/Value/PartyMemberToDispel.cpp @@ -4,14 +4,14 @@ */ #include "PartyMemberToDispel.h" +#include "PlayerbotAI.h" -#include "Playerbots.h" class PartyMemberToDispelPredicate : public FindPlayerPredicate, public PlayerbotAIAware { public: PartyMemberToDispelPredicate(PlayerbotAI* botAI, uint32 dispelType) - : PlayerbotAIAware(botAI), FindPlayerPredicate(), dispelType(dispelType) + : FindPlayerPredicate(), PlayerbotAIAware(botAI), dispelType(dispelType) { } From 17ac30fb832976fbbbe1bb7c1cbe9ee70e60c5f6 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:55:25 +0100 Subject: [PATCH 125/222] fix: Resolved all warnings in PartyMemverValue.cpp. --- src/Ai/Base/Value/PartyMemberValue.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Ai/Base/Value/PartyMemberValue.cpp b/src/Ai/Base/Value/PartyMemberValue.cpp index 7477429094..56178693fa 100644 --- a/src/Ai/Base/Value/PartyMemberValue.cpp +++ b/src/Ai/Base/Value/PartyMemberValue.cpp @@ -6,8 +6,11 @@ #include "PartyMemberValue.h" #include "Corpse.h" -#include "Playerbots.h" +#include "Group.h" +#include "PlayerbotAI.h" #include "ServerFacade.h" +#include "Pet.h" +#include "Spell.h" Unit* PartyMemberValue::FindPartyMember(std::vector* party, FindPlayerPredicate& predicate) { @@ -24,7 +27,7 @@ Unit* PartyMemberValue::FindPartyMember(std::vector* party, FindPlayerP return nullptr; } -Unit* PartyMemberValue::FindPartyMember(FindPlayerPredicate& predicate, bool ignoreOutOfGroup) +Unit* PartyMemberValue::FindPartyMember(FindPlayerPredicate& predicate, bool) { Player* master = GetMaster(); // GuidVector nearestPlayers; From 77a3dd3eaa22057fd948c25dbb9c62265fb4b206 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 20:59:48 +0100 Subject: [PATCH 126/222] fix: Resolved all warnings in PartyMemberWithoutAuraValue.h and PartyMemberWithoutAuraValue.cpp. --- src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp | 2 +- src/Ai/Base/Value/PartyMemberWithoutAuraValue.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp index f195a899bd..e9b181d791 100644 --- a/src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp +++ b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp @@ -13,7 +13,7 @@ class PlayerWithoutAuraPredicate : public FindPlayerPredicate, public PlayerbotA { public: PlayerWithoutAuraPredicate(PlayerbotAI* botAI, std::string const aura) - : PlayerbotAIAware(botAI), FindPlayerPredicate(), auras(split(aura, ',')) + : FindPlayerPredicate(), PlayerbotAIAware(botAI), auras(split(aura, ',')) { } diff --git a/src/Ai/Base/Value/PartyMemberWithoutAuraValue.h b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.h index 4ba9558ffe..6d95a31313 100644 --- a/src/Ai/Base/Value/PartyMemberWithoutAuraValue.h +++ b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.h @@ -8,7 +8,6 @@ #include "NamedObjectContext.h" #include "PartyMemberValue.h" -#include "PlayerbotAIConfig.h" class PlayerbotAI; class Unit; @@ -16,8 +15,7 @@ class Unit; class PartyMemberWithoutAuraValue : public PartyMemberValue, public Qualified { public: - PartyMemberWithoutAuraValue(PlayerbotAI* botAI, std::string const name = "party member without aura", - float range = sPlayerbotAIConfig.sightDistance) + PartyMemberWithoutAuraValue(PlayerbotAI* botAI, std::string const name = "party member without aura") : PartyMemberValue(botAI, name) { } From 176ddf4a794c340d7ed7c2a40b4c54850f59820b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:01:58 +0100 Subject: [PATCH 127/222] fix: Resolved all warnings in PartyMemberWithoutItemValue.h and PartyMemberWithoutItemValue.cpp. --- src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp | 2 +- src/Ai/Base/Value/PartyMemberWithoutItemValue.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp b/src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp index c9136c61a5..fe8032a459 100644 --- a/src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp +++ b/src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp @@ -11,7 +11,7 @@ class PlayerWithoutItemPredicate : public FindPlayerPredicate, public PlayerbotA { public: PlayerWithoutItemPredicate(PlayerbotAI* botAI, std::string const item) - : PlayerbotAIAware(botAI), FindPlayerPredicate(), item(item) + : FindPlayerPredicate(), PlayerbotAIAware(botAI), item(item) { } diff --git a/src/Ai/Base/Value/PartyMemberWithoutItemValue.h b/src/Ai/Base/Value/PartyMemberWithoutItemValue.h index 2918ea4c57..379835543e 100644 --- a/src/Ai/Base/Value/PartyMemberWithoutItemValue.h +++ b/src/Ai/Base/Value/PartyMemberWithoutItemValue.h @@ -8,7 +8,6 @@ #include "NamedObjectContext.h" #include "PartyMemberValue.h" -#include "PlayerbotAIConfig.h" class PlayerbotAI; class Unit; @@ -16,8 +15,7 @@ class Unit; class PartyMemberWithoutItemValue : public PartyMemberValue, public Qualified { public: - PartyMemberWithoutItemValue(PlayerbotAI* botAI, std::string const name = "party member without item", - float range = sPlayerbotAIConfig.farDistance) + PartyMemberWithoutItemValue(PlayerbotAI* botAI, std::string const name = "party member without item") : PartyMemberValue(botAI, name) { } From e47129f13ab4121e93ae325685ba2d34e11f365f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:31:31 +0100 Subject: [PATCH 128/222] fix: Refactored PvpValues.cpp and PvpValues.h. It was too horrible to stay this way. --- src/Ai/Base/Value/PvpValues.cpp | 101 +++++++++++++------------------- src/Ai/Base/Value/PvpValues.h | 9 ++- 2 files changed, 50 insertions(+), 60 deletions(-) diff --git a/src/Ai/Base/Value/PvpValues.cpp b/src/Ai/Base/Value/PvpValues.cpp index c8caf1441f..e68a613a9b 100644 --- a/src/Ai/Base/Value/PvpValues.cpp +++ b/src/Ai/Base/Value/PvpValues.cpp @@ -5,77 +5,60 @@ #include "PvpValues.h" -#include "BattlegroundEY.h" #include "BattlegroundMgr.h" -#include "BattlegroundWS.h" +#include "AreaDefines.h" #include "Playerbots.h" #include "ServerFacade.h" -Unit* FlagCarrierValue::Calculate() +Player* FlagCarrierValue::GetBattlegroundFlagCarrier(Battleground& battleground) const { - Unit* carrier = nullptr; + const uint32_t mapId = battleground.GetMapId(); - if (botAI->GetBot()->InBattleground()) + if (mapId != MAP_WARSONG_GULCH && mapId != MAP_EYE_OF_THE_STORM) { - if (botAI->GetBot()->GetBattlegroundTypeId() == BattlegroundTypeId::BATTLEGROUND_WS) - { - BattlegroundWS* bg = (BattlegroundWS*)botAI->GetBot()->GetBattleground(); + return nullptr; + } - if (!bg) - return nullptr; - - if ((!sameTeam && bot->GetTeamId() == TEAM_HORDE || (sameTeam && bot->GetTeamId() == TEAM_ALLIANCE)) && - !bg->GetFlagPickerGUID(TEAM_HORDE).IsEmpty()) - carrier = ObjectAccessor::GetPlayer(bg->GetBgMap(), bg->GetFlagPickerGUID(TEAM_HORDE)); - - if ((!sameTeam && bot->GetTeamId() == TEAM_ALLIANCE || (sameTeam && bot->GetTeamId() == TEAM_HORDE)) && - !bg->GetFlagPickerGUID(TEAM_ALLIANCE).IsEmpty()) - carrier = ObjectAccessor::GetPlayer(bg->GetBgMap(), bg->GetFlagPickerGUID(TEAM_ALLIANCE)); - - if (carrier) - { - if (ignoreRange || bot->IsWithinDistInMap(carrier, sPlayerbotAIConfig.sightDistance)) - { - return carrier; - } - else - return nullptr; - } - } + const ObjectGuid& flagCarrierGUID = battleground.GetFlagPickerGUID(); - if (botAI->GetBot()->GetBattlegroundTypeId() == BATTLEGROUND_EY) - { - BattlegroundEY* bg = (BattlegroundEY*)botAI->GetBot()->GetBattleground(); + if (flagCarrierGUID.IsEmpty()) + { + return nullptr; + } - if (!bg) - return nullptr; - - if (bg->GetFlagPickerGUID().IsEmpty()) - return nullptr; - - Player* fc = ObjectAccessor::GetPlayer(bg->GetBgMap(), bg->GetFlagPickerGUID()); - if (!fc) - return nullptr; - - if (!sameTeam && (fc->GetTeamId() != bot->GetTeamId())) - carrier = fc; - - if (sameTeam && (fc->GetTeamId() == bot->GetTeamId())) - carrier = fc; - - if (carrier) - { - if (ignoreRange || bot->IsWithinDistInMap(carrier, sPlayerbotAIConfig.sightDistance)) - { - return carrier; - } - else - return nullptr; - } - } + Player* const flagCarrier = ObjectAccessor::GetPlayer(battleground.GetBgMap(), flagCarrierGUID); + + if (flagCarrier == nullptr) + { + return nullptr; + } + + const TeamId& flagCarrierTeamId = flagCarrier->GetTeamId(); + const TeamId& botTeamId = this->bot->GetTeamId(); + + if (!this->sameTeam && flagCarrierTeamId != botTeamId) + { + return flagCarrier; + } + + if (this->sameTeam && flagCarrierTeamId == botTeamId) + { + return flagCarrier; + } + + return nullptr; +} + +Unit* FlagCarrierValue::Calculate() +{ + Battleground* const battleground = this->bot->GetBattleground(); + + if (battleground == nullptr) + { + return nullptr; } - return carrier; + return this->GetBattlegroundFlagCarrier(*battleground); } std::vector BgMastersValue::Calculate() diff --git a/src/Ai/Base/Value/PvpValues.h b/src/Ai/Base/Value/PvpValues.h index bad46b951b..734567c411 100644 --- a/src/Ai/Base/Value/PvpValues.h +++ b/src/Ai/Base/Value/PvpValues.h @@ -59,13 +59,20 @@ class RpgBgTypeValue : public CalculatedValue class FlagCarrierValue : public UnitCalculatedValue { public: - FlagCarrierValue(PlayerbotAI* botAI, bool sameTeam = false, bool ignoreRange = false) + FlagCarrierValue( + PlayerbotAI* botAI, + bool sameTeam = false, + bool ignoreRange = false + ) : UnitCalculatedValue(botAI), sameTeam(sameTeam), ignoreRange(ignoreRange) { } Unit* Calculate() override; +protected: + Player* GetBattlegroundFlagCarrier(Battleground& battleground) const; + private: bool sameTeam; bool ignoreRange; From 38e0eb3dc4d1c98a135fe4bbc66dcd9e702e4bb3 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:34:30 +0100 Subject: [PATCH 129/222] fix: Resolved all warnings in PossibleRpgTargetsValue.cpp. --- src/Ai/Base/Value/PossibleRpgTargetsValue.cpp | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp b/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp index f2b6aef105..e0695e825d 100644 --- a/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp +++ b/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp @@ -5,14 +5,16 @@ #include "PossibleRpgTargetsValue.h" -#include "CellImpl.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" +#include "AiObjectContext.h" #include "ObjectGuid.h" -#include "Playerbots.h" #include "ServerFacade.h" #include "SharedDefines.h" #include "NearestGameObjects.h" +#include "GridNotifiers.h" +// Required due to a poor implementation by AC +#include "GridNotifiersImpl.h" +#include "CellImpl.h" +#include "TravelMgr.h" std::vector PossibleRpgTargetsValue::allowedNpcFlags; @@ -73,9 +75,16 @@ bool PossibleRpgTargetsValue::AcceptUnit(Unit* unit) } TravelTarget* travelTarget = context->GetValue("travel target")->Get(); - if (travelTarget && travelTarget->getDestination() && - travelTarget->getDestination()->getEntry() == unit->GetEntry()) + + + if ( + travelTarget != nullptr + && travelTarget->getDestination() + && (uint32_t)travelTarget->getDestination()->getEntry() == unit->GetEntry() + ) + { return true; + } if (urand(1, 100) < 25 && unit->IsFriendlyTo(bot)) return true; From 6b1705aa7058ef87f1a75a006ab9fb8cfb74bee6 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:40:24 +0100 Subject: [PATCH 130/222] fix: Resolved all warnings in SppelIdValue.cpp. --- src/Ai/Base/Value/SpellIdValue.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Ai/Base/Value/SpellIdValue.cpp b/src/Ai/Base/Value/SpellIdValue.cpp index 682c0b3ffd..909a3a3075 100644 --- a/src/Ai/Base/Value/SpellIdValue.cpp +++ b/src/Ai/Base/Value/SpellIdValue.cpp @@ -8,7 +8,6 @@ #include "ChatHelper.h" #include "Playerbots.h" #include "Vehicle.h" -#include "World.h" SpellIdValue::SpellIdValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "spell id", 20 * 1000) {} @@ -31,7 +30,7 @@ uint32 SpellIdValue::Calculate() wstrToLower(wnamepart); char firstSymbol = tolower(namepart[0]); - int spellLength = wnamepart.length(); + size_t spellLength = wnamepart.length(); LocaleConstant loc = LOCALE_enUS; @@ -98,7 +97,7 @@ uint32 SpellIdValue::Calculate() return 0; int32 saveMana = (int32)round(AI_VALUE(double, "mana save level")); - uint32 rank = 1; + int32 rank = 1; uint32 highestRank = 0; uint32 highestSpellId = 0; uint32 lowestRank = 0; @@ -128,21 +127,23 @@ uint32 SpellIdValue::Calculate() // convert the remaining text to an integer int id = atoi(spellName.c_str()); - if (!id) + if (id < 1) { highestSpellId = spellId; continue; } - if (!highestRank || id > highestRank) + const uint32_t unsignedId = id; + + if (!highestRank || unsignedId > highestRank) { - highestRank = id; + highestRank = unsignedId; highestSpellId = spellId; } - if (!lowestRank || (lowestRank && id < lowestRank)) + if (!lowestRank || (lowestRank && unsignedId < lowestRank)) { - lowestRank = id; + lowestRank = unsignedId; lowestSpellId = spellId; } } @@ -193,7 +194,7 @@ uint32 VehicleSpellIdValue::Calculate() wstrToLower(wnamepart); char firstSymbol = tolower(namepart[0]); - int spellLength = wnamepart.length(); + size_t spellLength = wnamepart.length(); const int loc = LocaleConstant::LOCALE_enUS; From e9e95011fed46c937a5365eb7b5ab4a9dc099d11 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:41:40 +0100 Subject: [PATCH 131/222] fix: Resolved all warnings in SnareTargetValue.cpp. --- src/Ai/Base/Value/SnareTargetValue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Value/SnareTargetValue.cpp b/src/Ai/Base/Value/SnareTargetValue.cpp index 7965198aa4..76be6c35de 100644 --- a/src/Ai/Base/Value/SnareTargetValue.cpp +++ b/src/Ai/Base/Value/SnareTargetValue.cpp @@ -5,15 +5,15 @@ #include "SnareTargetValue.h" -#include "Playerbots.h" +#include "AiObjectContext.h" +#include "PlayerbotAI.h" #include "ServerFacade.h" Unit* SnareTargetValue::Calculate() { std::string const spell = qualifier; - GuidVector attackers = botAI->GetAiObjectContext()->GetValue("attackers")->Get(); - Unit* target = botAI->GetAiObjectContext()->GetValue("current target")->Get(); + GuidVector attackers = this->botAI->GetAiObjectContext()->GetValue("attackers")->Get(); for (ObjectGuid const guid : attackers) { Unit* unit = botAI->GetUnit(guid); From 72d5007194e3d2d3d0bf4f1ae914cf56f4a132d8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:44:36 +0100 Subject: [PATCH 132/222] fix: Resolved all warnings in TankTargetValue.cpp. --- src/Ai/Base/Value/TankTargetValue.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Value/TankTargetValue.cpp b/src/Ai/Base/Value/TankTargetValue.cpp index ef2d1e959c..0bda67eae5 100644 --- a/src/Ai/Base/Value/TankTargetValue.cpp +++ b/src/Ai/Base/Value/TankTargetValue.cpp @@ -5,9 +5,10 @@ #include "TankTargetValue.h" +#include "AiObjectContext.h" #include "AttackersValue.h" -#include "PlayerbotAIConfig.h" -#include "Playerbots.h" +#include "Group.h" +#include "PlayerbotAI.h" class FindTargetForTankStrategy : public FindNonCcTargetStrategy { @@ -53,7 +54,7 @@ class FindTankTargetSmartStrategy : public FindTargetStrategy public: FindTankTargetSmartStrategy(PlayerbotAI* botAI) : FindTargetStrategy(botAI) {} - void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override + void CheckAttacker(Unit* attacker, ThreatMgr*) override { if (Group* group = botAI->GetBot()->GetGroup()) { From df8374f40e85125b5818c8d30f72eb2a892a6f8c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:47:23 +0100 Subject: [PATCH 133/222] fix: Resolved all warnings in StatsValue.cpp. --- src/Ai/Base/Value/StatsValues.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Value/StatsValues.cpp b/src/Ai/Base/Value/StatsValues.cpp index 615f39f019..941750d3b4 100644 --- a/src/Ai/Base/Value/StatsValues.cpp +++ b/src/Ai/Base/Value/StatsValues.cpp @@ -4,8 +4,12 @@ */ #include "StatsValues.h" -#include "Playerbots.h" +#include "AiObjectContext.h" +#include "Group.h" +#include "Pet.h" +#include "PlayerbotAIConfig.h" #include "ServerFacade.h" +#include "Player.h" Unit* HealthValue::GetTarget() { @@ -184,7 +188,7 @@ bool IsInCombatValue::Calculate() if (member->IsInCombat() && ServerFacade::instance().IsDistanceLessOrEqualThan(ServerFacade::instance().GetDistance2d(member, bot), - sPlayerbotAIConfig.reactDistance)) + PlayerbotAIConfig::instance().reactDistance)) return true; } } @@ -204,7 +208,6 @@ uint8 BagSpaceValue::Calculate() ++totalused; } - uint32 totalfree = 16 - totalused; for (uint8 bag = INVENTORY_SLOT_BAG_START; bag < INVENTORY_SLOT_BAG_END; ++bag) { const Bag* const pBag = (Bag*)bot->GetItemByPos(INVENTORY_SLOT_BAG_0, bag); @@ -214,7 +217,6 @@ uint8 BagSpaceValue::Calculate() if (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER) { total += pBag->GetBagSize(); - totalfree += pBag->GetFreeSlots(); totalused += pBag->GetBagSize() - pBag->GetFreeSlots(); } } From 44fd0d4c032d2d8387cbf991e7956ecfd5c27948 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:49:04 +0100 Subject: [PATCH 134/222] fix: Resolved all warnings in TargetValue.cpp. --- src/Ai/Base/Value/TargetValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Base/Value/TargetValue.cpp b/src/Ai/Base/Value/TargetValue.cpp index 21621545ea..d7cb84135f 100644 --- a/src/Ai/Base/Value/TargetValue.cpp +++ b/src/Ai/Base/Value/TargetValue.cpp @@ -161,7 +161,7 @@ Unit* FindTargetValue::Calculate() return nullptr; } -void FindBossTargetStrategy::CheckAttacker(Unit* attacker, ThreatMgr* threatManager) +void FindBossTargetStrategy::CheckAttacker(Unit* attacker, ThreatMgr*) { UnitAI* unitAI = attacker->GetAI(); BossAI* bossAI = dynamic_cast(unitAI); From 95ee803b2e9b081b5cd5385abe5e5eaeae8c82a8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 21:49:38 +0100 Subject: [PATCH 135/222] fix: Resolved all warnings in GenericDKNonCombatStrategy.cpp. --- src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp b/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp index edead06755..3b1f18d729 100644 --- a/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp +++ b/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp @@ -5,8 +5,6 @@ #include "GenericDKNonCombatStrategy.h" -#include "Playerbots.h" - class GenericDKNonCombatStrategyActionNodeFactory : public NamedObjectFactory { public: @@ -55,7 +53,7 @@ void GenericDKNonCombatStrategy::InitTriggers(std::vector& trigger new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); } -void DKBuffDpsStrategy::InitTriggers(std::vector& triggers) +void DKBuffDpsStrategy::InitTriggers(std::vector&) { } From 8f61f2f82389615f9eccf65741103414499c78ea Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:38:37 +0100 Subject: [PATCH 136/222] fix: Resolved all warnings in DruidActions.cpp. --- src/Ai/Class/Druid/Action/DruidActions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Class/Druid/Action/DruidActions.cpp b/src/Ai/Class/Druid/Action/DruidActions.cpp index 33b7826bf8..3df3d2d166 100644 --- a/src/Ai/Class/Druid/Action/DruidActions.cpp +++ b/src/Ai/Class/Druid/Action/DruidActions.cpp @@ -28,11 +28,11 @@ Value* CastEntanglingRootsCcAction::GetTargetValue() return context->GetValue("cc target", "entangling roots"); } -bool CastEntanglingRootsCcAction::Execute(Event event) { return botAI->CastSpell("entangling roots", GetTarget()); } +bool CastEntanglingRootsCcAction::Execute(Event) { return botAI->CastSpell("entangling roots", GetTarget()); } Value* CastHibernateCcAction::GetTargetValue() { return context->GetValue("cc target", "hibernate"); } -bool CastHibernateCcAction::Execute(Event event) { return botAI->CastSpell("hibernate", GetTarget()); } +bool CastHibernateCcAction::Execute(Event) { return botAI->CastSpell("hibernate", GetTarget()); } bool CastStarfallAction::isUseful() { if (!CastSpellAction::isUseful()) From d0797234ee1f863e1ef8fa3450948e51f2086036 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:45:30 +0100 Subject: [PATCH 137/222] fix: Resolved all warnings in CatDpsDruidStrategy.cpp. --- src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp index fda1b5f94f..03b3b455ca 100644 --- a/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp +++ b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp @@ -311,4 +311,4 @@ void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) ); } -void CatAoeDruidStrategy::InitTriggers(std::vector& triggers) {} +void CatAoeDruidStrategy::InitTriggers(std::vector&) {} From 93a39d469dfd05c7115ae86231bf5c44c9be00e8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:48:49 +0100 Subject: [PATCH 138/222] fix: Resolved all warnings in DruidShapeshiftActions.cpp. --- src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp index 1f066dc349..f15ea7ea3c 100644 --- a/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp +++ b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp @@ -39,7 +39,7 @@ bool CastCasterFormAction::isUseful() AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig.mediumHealth; } -bool CastCasterFormAction::Execute(Event event) +bool CastCasterFormAction::Execute(Event) { botAI->RemoveShapeshift(); return true; @@ -50,7 +50,7 @@ bool CastCancelTreeFormAction::isUseful() return botAI->HasAura(33891, bot); } -bool CastCancelTreeFormAction::Execute(Event event) +bool CastCancelTreeFormAction::Execute(Event) { botAI->RemoveAura("tree of life"); return true; From fdf59e0f70ac658bfc4a66a98b33861d062361f5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:50:52 +0100 Subject: [PATCH 139/222] fix: Resolved all warnings in HunterActions.h. --- src/Ai/Class/Hunter/Action/HunterActions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Class/Hunter/Action/HunterActions.h b/src/Ai/Class/Hunter/Action/HunterActions.h index 8e21135254..0a252d9c1f 100644 --- a/src/Ai/Class/Hunter/Action/HunterActions.h +++ b/src/Ai/Class/Hunter/Action/HunterActions.h @@ -352,7 +352,7 @@ class CastExplosiveShotRank4Action : public CastDebuffSpellAction public: CastExplosiveShotRank4Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {} - bool Execute(Event event) override { return botAI->CastSpell(60053, GetTarget()); } + bool Execute(Event) override { return botAI->CastSpell(60053, GetTarget()); } bool isUseful() override { Unit* target = GetTarget(); @@ -368,7 +368,7 @@ class CastExplosiveShotRank3Action : public CastDebuffSpellAction public: CastExplosiveShotRank3Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {} - bool Execute(Event event) override { return botAI->CastSpell(60052, GetTarget()); } + bool Execute(Event) override { return botAI->CastSpell(60052, GetTarget()); } bool isUseful() override { Unit* target = GetTarget(); @@ -384,7 +384,7 @@ class CastExplosiveShotRank2Action : public CastDebuffSpellAction public: CastExplosiveShotRank2Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {} - bool Execute(Event event) override { return botAI->CastSpell(60051, GetTarget()); } + bool Execute(Event) override { return botAI->CastSpell(60051, GetTarget()); } bool isUseful() override { Unit* target = GetTarget(); @@ -400,7 +400,7 @@ class CastExplosiveShotRank1Action : public CastDebuffSpellAction public: CastExplosiveShotRank1Action(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "explosive shot", true, 0.0f) {} - bool Execute(Event event) override { return botAI->CastSpell(53301, GetTarget()); } + bool Execute(Event) override { return botAI->CastSpell(53301, GetTarget()); } bool isUseful() override { Unit* target = GetTarget(); From 223d855eb21867f9c95b351f3ebb917127659a62 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:51:22 +0100 Subject: [PATCH 140/222] fix: Resolved all warnings in HunterActions.cpp. --- src/Ai/Class/Hunter/Action/HunterActions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Class/Hunter/Action/HunterActions.cpp b/src/Ai/Class/Hunter/Action/HunterActions.cpp index a1588f8537..4cf55629a9 100644 --- a/src/Ai/Class/Hunter/Action/HunterActions.cpp +++ b/src/Ai/Class/Hunter/Action/HunterActions.cpp @@ -59,7 +59,7 @@ bool CastImmolationTrapAction::isUseful() Value* CastFreezingTrap::GetTargetValue() { return context->GetValue("cc target", "freezing trap"); } -bool FeedPetAction::Execute(Event event) +bool FeedPetAction::Execute(Event) { if (Pet* pet = bot->GetPet()) if (pet->getPetType() == HUNTER_PET && pet->GetHappinessState() != HAPPY) @@ -99,7 +99,7 @@ bool CastDisengageAction::isUseful() Value* CastScareBeastCcAction::GetTargetValue() { return context->GetValue("cc target", "scare beast"); } -bool CastScareBeastCcAction::Execute(Event event) { return botAI->CastSpell("scare beast", GetTarget()); } +bool CastScareBeastCcAction::Execute(Event) { return botAI->CastSpell("scare beast", GetTarget()); } bool CastWingClipAction::isUseful() { return CastSpellAction::isUseful() && !botAI->HasAura(spell, GetTarget()); } From bc99d94d8f7136b4a62e3d0f47634a9fa243a37a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:53:04 +0100 Subject: [PATCH 141/222] fix: Resolved all warnings in GenericHunterStrategy.cpp. --- src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp b/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp index 04afc6f766..bd747416fc 100644 --- a/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp +++ b/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp @@ -5,9 +5,6 @@ #include "GenericHunterStrategy.h" -#include "Playerbots.h" -#include "Strategy.h" - class GenericHunterStrategyActionNodeFactory : public NamedObjectFactory { public: @@ -141,7 +138,7 @@ void AoEHunterStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("light aoe", { NextAction("multi-shot", 21.0f) })); } -void HunterBoostStrategy::InitTriggers(std::vector& triggers) +void HunterBoostStrategy::InitTriggers(std::vector&) { } From b09af73adfd3766cd9326e0934c489a4d65902a9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:54:10 +0100 Subject: [PATCH 142/222] fix: Resolved all warnings in GenericPaladinStrategy.cpp. --- src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp index 62d7dfb10b..ee2a192305 100644 --- a/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp +++ b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp @@ -6,7 +6,6 @@ #include "GenericPaladinStrategy.h" #include "GenericPaladinStrategyActionNodeFactory.h" -#include "Playerbots.h" GenericPaladinStrategy::GenericPaladinStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { @@ -59,7 +58,7 @@ void PaladinCureStrategy::InitTriggers(std::vector& triggers) { NextAction("cleanse magic on party", ACTION_DISPEL + 1) })); } -void PaladinBoostStrategy::InitTriggers(std::vector& triggers) +void PaladinBoostStrategy::InitTriggers(std::vector&) { // triggers.push_back(new TriggerNode("divine favor", { NextAction("divine favor", From 85d8cd03d867af59c06ded4cb1c1aaec4736b160 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:54:55 +0100 Subject: [PATCH 143/222] fix: Resolved all warnings in PriestActions.cpp. --- src/Ai/Class/Priest/Action/PriestActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Class/Priest/Action/PriestActions.cpp b/src/Ai/Class/Priest/Action/PriestActions.cpp index ae55b104dc..53df66d1b9 100644 --- a/src/Ai/Class/Priest/Action/PriestActions.cpp +++ b/src/Ai/Class/Priest/Action/PriestActions.cpp @@ -12,7 +12,7 @@ bool CastRemoveShadowformAction::isUseful() { return botAI->HasAura("shadowform" bool CastRemoveShadowformAction::isPossible() { return true; } -bool CastRemoveShadowformAction::Execute(Event event) +bool CastRemoveShadowformAction::Execute(Event) { botAI->RemoveAura("shadowform"); return true; From 36ea39fa3c529bf903e57be95e0fa413e8f7c8a5 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:58:03 +0100 Subject: [PATCH 144/222] fix: Resolved all warnings in PaladinActions.cpp. --- .../Class/Paladin/Action/PaladinActions.cpp | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/Ai/Class/Paladin/Action/PaladinActions.cpp b/src/Ai/Class/Paladin/Action/PaladinActions.cpp index 190ecb264a..9b09f8b4dd 100644 --- a/src/Ai/Class/Paladin/Action/PaladinActions.cpp +++ b/src/Ai/Class/Paladin/Action/PaladinActions.cpp @@ -8,18 +8,14 @@ #include "AiFactory.h" #include "Event.h" #include "PlayerbotAI.h" -#include "PlayerbotAIConfig.h" -#include "PlayerbotFactory.h" #include "Playerbots.h" #include "SharedDefines.h" #include "../../../../../src/server/scripts/Spells/spell_generic.cpp" #include "GenericBuffUtils.h" -#include "Config.h" #include "Group.h" #include "ObjectAccessor.h" using ai::buff::MakeAuraQualifierForBuff; -using ai::buff::UpgradeToGroupIfAppropriate; // Helper : detect tank role on the target (player bot or not) return true if spec is tank or if the bot have tank strategies (bear/tank/tank face). static inline bool IsTankRole(Player* p) @@ -56,11 +52,6 @@ static inline bool IsOnlyPaladinInGroup(Player* bot) return pals == 1u; } -static inline bool GroupHasTankOfClass(Group* g, uint8 classId) -{ - return GroupHasTankOfClass(g, static_cast(classId)); -} - inline std::string const GetActualBlessingOfMight(Unit* target) { if (!target->ToPlayer()) @@ -167,7 +158,7 @@ Value* CastBlessingOnPartyAction::GetTargetValue() return context->GetValue("party member without aura", MakeAuraQualifierForBuff(spell)); } -bool CastBlessingOfMightAction::Execute(Event event) +bool CastBlessingOfMightAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -188,7 +179,7 @@ Value* CastBlessingOfMightOnPartyAction::GetTargetValue() ); } -bool CastBlessingOfMightOnPartyAction::Execute(Event event) +bool CastBlessingOfMightOnPartyAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -201,7 +192,7 @@ bool CastBlessingOfMightOnPartyAction::Execute(Event event) return botAI->CastSpell(castName, target); } -bool CastBlessingOfWisdomAction::Execute(Event event) +bool CastBlessingOfWisdomAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -222,7 +213,7 @@ Value* CastBlessingOfWisdomOnPartyAction::GetTargetValue() ); } -bool CastBlessingOfWisdomOnPartyAction::Execute(Event event) +bool CastBlessingOfWisdomOnPartyAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -258,7 +249,7 @@ Value* CastBlessingOfSanctuaryOnPartyAction::GetTargetValue() ); } -bool CastBlessingOfSanctuaryOnPartyAction::Execute(Event event) +bool CastBlessingOfSanctuaryOnPartyAction::Execute(Event) { if (!bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY)) return false; @@ -382,7 +373,7 @@ Value* CastBlessingOfKingsOnPartyAction::GetTargetValue() ); } -bool CastBlessingOfKingsOnPartyAction::Execute(Event event) +bool CastBlessingOfKingsOnPartyAction::Execute(Event) { Unit* target = GetTarget(); if (!target) @@ -493,7 +484,7 @@ bool CastDivineSacrificeAction::isUseful() !botAI->HasAura("divine guardian", GetTarget(), false, false, -1, true); } -bool CastCancelDivineSacrificeAction::Execute(Event event) +bool CastCancelDivineSacrificeAction::Execute(Event) { botAI->RemoveAura("divine sacrifice"); return true; From 9d127f91bbdbb923039a4b0bc7f55f01129f2606 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:59:07 +0100 Subject: [PATCH 145/222] fix: Resolved all warnings in RogueActions.cpp. --- src/Ai/Class/Rogue/Action/RogueActions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ai/Class/Rogue/Action/RogueActions.cpp b/src/Ai/Class/Rogue/Action/RogueActions.cpp index fb4975ab33..32759d6d63 100644 --- a/src/Ai/Class/Rogue/Action/RogueActions.cpp +++ b/src/Ai/Class/Rogue/Action/RogueActions.cpp @@ -25,7 +25,7 @@ bool CastStealthAction::isPossible() return !botAI->HasAura(23333, bot) && !botAI->HasAura(23335, bot) && !botAI->HasAura(34976, bot); } -bool UnstealthAction::Execute(Event event) +bool UnstealthAction::Execute(Event) { botAI->RemoveAura("stealth"); // botAI->ChangeStrategy("+dps,-stealthed", BOT_STATE_COMBAT); @@ -33,7 +33,7 @@ bool UnstealthAction::Execute(Event event) return true; } -bool CheckStealthAction::Execute(Event event) +bool CheckStealthAction::Execute(Event) { if (botAI->HasAura("stealth", bot)) { @@ -69,7 +69,7 @@ bool CastTricksOfTheTradeOnMainTankAction::isUseful() return CastSpellAction::isUseful() && AI_VALUE2(float, "distance", GetTargetName()) < 20.0f; } -bool UseDeadlyPoisonAction::Execute(Event event) +bool UseDeadlyPoisonAction::Execute(Event) { std::vector poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""}; std::vector items; @@ -109,7 +109,7 @@ bool UseDeadlyPoisonAction::isPossible() return !items.empty(); } -bool UseInstantPoisonAction::Execute(Event event) +bool UseInstantPoisonAction::Execute(Event) { std::vector poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""}; std::vector items; @@ -148,7 +148,7 @@ bool UseInstantPoisonAction::isPossible() return !items.empty(); } -bool UseInstantPoisonOffHandAction::Execute(Event event) +bool UseInstantPoisonOffHandAction::Execute(Event) { std::vector poison_suffixs = {" IX", " VIII", " VII", " VI", " V", " IV", " III", " II", ""}; std::vector items; From 43bc49667e5e6e7b6f1974e7c392acf51fdef007 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 22:59:36 +0100 Subject: [PATCH 146/222] fix: Resolved all warnings in ShamanACtions.cpp. --- src/Ai/Class/Shaman/Action/ShamanActions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Class/Shaman/Action/ShamanActions.cpp b/src/Ai/Class/Shaman/Action/ShamanActions.cpp index e8ed1234bf..943c10298e 100644 --- a/src/Ai/Class/Shaman/Action/ShamanActions.cpp +++ b/src/Ai/Class/Shaman/Action/ShamanActions.cpp @@ -6,7 +6,6 @@ #include "ShamanActions.h" #include "TotemsShamanStrategy.h" #include "Playerbots.h" -#include "Totem.h" #include "PlayerbotAI.h" #include "Action.h" @@ -71,7 +70,7 @@ bool CastLavaBurstAction::isUseful() // Logic for making a guardian (spirit wolf) use a spell (spirit walk) // There is no existing code for guardians casting spells in the AC/Playerbots repo. -bool CastSpiritWalkAction::Execute(Event event) +bool CastSpiritWalkAction::Execute(Event) { constexpr uint32 SPIRIT_WOLF = 29264; constexpr uint32 SPIRIT_WALK_SPELL = 58875; @@ -93,7 +92,7 @@ bool CastSpiritWalkAction::Execute(Event event) // Set Strategy Assigned Totems (Actions) - First, it checks // the highest-rank spell the bot knows for each totem type, // then adds it to the Call of the Elements bar. -bool SetTotemAction::Execute(Event event) +bool SetTotemAction::Execute(Event) { uint32 totemSpell = 0; for (size_t i = 0; i < totemSpellIdsCount; ++i) From c9f08dd855928ac469b7f739b197a79763092924 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:00:15 +0100 Subject: [PATCH 147/222] fix: Resolved all warnings in ShamanTriggers.cpp. --- src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp index 753edb83fd..c8b36135a9 100644 --- a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp +++ b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp @@ -283,20 +283,6 @@ static uint32 GetRequiredTotemSpellId(PlayerbotAI* ai, const char* strategies[], return 0; // No relevant strategy active, or bot doesn't know any rank } -// Get the spellId of the currently summoned totem in the slot -static uint32 GetSummonedTotemSpellId(Player* bot, uint8 slot) -{ - ObjectGuid guid = bot->m_SummonSlot[slot]; - if (guid.IsEmpty()) - return 0; - - Creature* totem = bot->GetMap()->GetCreature(guid); - if (!totem) - return 0; - - return totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); -} - bool NoEarthTotemTrigger::IsActive() { // Check if the bot has Stoneskin Totem (required level 4) and prevents the trigger firing if it doesn't From a6c4c4ed2c9bb02567b129e24f90c696bb49bb6c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:01:43 +0100 Subject: [PATCH 148/222] fix: Resolved all warnings in WarlockActions.cpp. --- src/Ai/Class/Warlock/Action/WarlockActions.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Ai/Class/Warlock/Action/WarlockActions.cpp b/src/Ai/Class/Warlock/Action/WarlockActions.cpp index 4e09eb6523..a1163894fc 100644 --- a/src/Ai/Class/Warlock/Action/WarlockActions.cpp +++ b/src/Ai/Class/Warlock/Action/WarlockActions.cpp @@ -116,7 +116,7 @@ bool CastSoulshatterAction::isUseful() } // Checks if the bot has enough bag space to create a soul shard, then does so -bool CreateSoulShardAction::Execute(Event event) +bool CreateSoulShardAction::Execute(Event) { Player* bot = botAI->GetBot(); if (!bot) @@ -188,7 +188,7 @@ bool CastCreateSoulstoneAction::isUseful() return hasSpace; } -bool DestroySoulShardAction::Execute(Event event) +bool DestroySoulShardAction::Execute(Event) { // Look for the first soul shard in any bag and destroy it for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -234,7 +234,7 @@ static bool HasSoulstoneAura(Unit* unit) } // Use the soulstone item on the bot itself with nc strategy "ss self" -bool UseSoulstoneSelfAction::Execute(Event event) +bool UseSoulstoneSelfAction::Execute(Event) { std::vector items = AI_VALUE2(std::vector, "inventory items", "soulstone"); if (items.empty()) @@ -266,7 +266,7 @@ void CleanupSoulstoneReservations() } // Use the soulstone item on the bot's master with nc strategy "ss master" -bool UseSoulstoneMasterAction::Execute(Event event) +bool UseSoulstoneMasterAction::Execute(Event) { CleanupSoulstoneReservations(); @@ -300,7 +300,7 @@ bool UseSoulstoneMasterAction::Execute(Event event) } // Use the soulstone item on a tank in the group with nc strategy "ss tank" -bool UseSoulstoneTankAction::Execute(Event event) +bool UseSoulstoneTankAction::Execute(Event) { CleanupSoulstoneReservations(); @@ -368,7 +368,7 @@ bool UseSoulstoneTankAction::Execute(Event event) } // Use the soulstone item on a healer in the group with nc strategy "ss healer" -bool UseSoulstoneHealerAction::Execute(Event event) +bool UseSoulstoneHealerAction::Execute(Event) { CleanupSoulstoneReservations(); @@ -425,7 +425,7 @@ CastCreateFirestoneAction::CastCreateFirestoneAction(PlayerbotAI* botAI) { } -bool CastCreateFirestoneAction::Execute(Event event) +bool CastCreateFirestoneAction::Execute(Event) { for (uint32 spellId : firestoneSpellIds) { From c64ed0007aeff59a84371d7f6c1f445cf01c09fe Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:02:37 +0100 Subject: [PATCH 149/222] fix: Resolved all warnings in TankWarlockStrategy.cpp. --- src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp index c54fd59684..e3573e3be0 100644 --- a/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp @@ -4,7 +4,6 @@ */ #include "TankWarlockStrategy.h" -#include "Playerbots.h" // Combat strategy for a Warlock Tank, for certain bosses like Twin Emperors // Priority is set to spam Searing Pain and use Shadow Ward on CD @@ -42,6 +41,6 @@ std::vector TankWarlockStrategy::getDefaultActions() }; } -void TankWarlockStrategy::InitTriggers(std::vector& triggers) +void TankWarlockStrategy::InitTriggers(std::vector&) { } From 3df6bc0cfaf30d584528af46cce36cd38196c0ae Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:03:18 +0100 Subject: [PATCH 150/222] fix: Resolved all warnings in GenericWarlockStrategy.cpp. --- src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp index 1759776580..e135528e83 100644 --- a/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp @@ -4,8 +4,6 @@ */ #include "GenericWarlockStrategy.h" -#include "Strategy.h" -#include "Playerbots.h" class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory { @@ -126,12 +124,12 @@ void AoEWarlockStrategy::InitTriggers(std::vector& triggers) ); } -void WarlockBoostStrategy::InitTriggers(std::vector& triggers) +void WarlockBoostStrategy::InitTriggers(std::vector&) { // Placeholder for future boost triggers } -void WarlockPetStrategy::InitTriggers(std::vector& triggers) +void WarlockPetStrategy::InitTriggers(std::vector&) { // Placeholder for future pet triggers } From 303694b6f6b55d530a2be17bf53e7814c9a344c9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:04:22 +0100 Subject: [PATCH 151/222] fix: Resolved all warnings in WarriorActions.cpp. --- src/Ai/Class/Warrior/Action/WarriorActions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Class/Warrior/Action/WarriorActions.cpp b/src/Ai/Class/Warrior/Action/WarriorActions.cpp index 9733226a95..f31dd1d9a1 100644 --- a/src/Ai/Class/Warrior/Action/WarriorActions.cpp +++ b/src/Ai/Class/Warrior/Action/WarriorActions.cpp @@ -93,7 +93,7 @@ Unit* CastVigilanceAction::GetTarget() return nullptr; } -bool CastVigilanceAction::Execute(Event event) +bool CastVigilanceAction::Execute(Event) { Unit* target = GetTarget(); if (!target || target == bot) @@ -234,7 +234,7 @@ bool CastShatteringThrowAction::isPossible() return true; } -bool CastShatteringThrowAction::Execute(Event event) +bool CastShatteringThrowAction::Execute(Event) { Unit* target = GetTarget(); if (!target) From 4c9152e54865acac9204007284f938d6dfb9183e Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:05:01 +0100 Subject: [PATCH 152/222] fix Resolved all warnings in ArmsWarriorStrategy.cpp. --- .../Warrior/Strategy/ArmsWarriorStrategy.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp index eba5677e7f..4320563780 100644 --- a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp @@ -5,8 +5,6 @@ #include "ArmsWarriorStrategy.h" -#include "Playerbots.h" - class ArmsWarriorStrategyActionNodeFactory : public NamedObjectFactory { public: @@ -23,7 +21,7 @@ class ArmsWarriorStrategyActionNodeFactory : public NamedObjectFactory Date: Thu, 29 Jan 2026 23:06:00 +0100 Subject: [PATCH 153/222] fix: Resolved all warnings in FuryWarriorStrategy.cpp. --- .../Class/Warrior/Strategy/FuryWarriorStrategy.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp index 6400ee4a8e..3bda643d88 100644 --- a/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp @@ -5,8 +5,6 @@ #include "FuryWarriorStrategy.h" -#include "Playerbots.h" - class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory { public: @@ -20,7 +18,7 @@ class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory Date: Thu, 29 Jan 2026 23:06:53 +0100 Subject: [PATCH 154/222] fix: Resolved all warnings in AzjolNerubActions.cpp. --- src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp b/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp index e31ffd00f5..4d1f061f2f 100644 --- a/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp +++ b/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp @@ -1,9 +1,8 @@ #include "Playerbots.h" #include "AzjolNerubActions.h" -#include "AzjolNerubStrategy.h" bool AttackWebWrapAction::isUseful() { return !botAI->IsHeal(bot); } -bool AttackWebWrapAction::Execute(Event event) +bool AttackWebWrapAction::Execute(Event) { Unit* webWrap = nullptr; @@ -29,7 +28,7 @@ bool AttackWebWrapAction::Execute(Event event) } bool WatchersTargetAction::isUseful() { return !botAI->IsHeal(bot); } -bool WatchersTargetAction::Execute(Event event) +bool WatchersTargetAction::Execute(Event) { // Always prioritise web wraps Unit* currTarget = AI_VALUE(Unit*, "current target"); @@ -95,7 +94,7 @@ bool WatchersTargetAction::Execute(Event event) } bool AnubarakDodgePoundAction::isUseful() { return !AI_VALUE2(bool, "behind", "current target"); } -bool AnubarakDodgePoundAction::Execute(Event event) +bool AnubarakDodgePoundAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "anub'arak"); if (!boss) { return false; } From 662af3b93142eac3ca3caefd867bef3ddc3a04e0 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:07:36 +0100 Subject: [PATCH 155/222] fix: Resolved all warnings in TankWarriorStrategy.cpp. --- .../Warrior/Strategy/TankWarriorStrategy.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp index 05f732c30c..57b44ff16f 100644 --- a/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp @@ -5,8 +5,6 @@ #include "TankWarriorStrategy.h" -#include "Playerbots.h" - class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory { public: @@ -26,7 +24,7 @@ class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory Date: Thu, 29 Jan 2026 23:09:42 +0100 Subject: [PATCH 156/222] fix: Resolved all warnings in CullingOfStratholmeActions.cpp. --- .../Action/CullingOfStratholmeActions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp b/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp index 15121f4a2e..97f27eefff 100644 --- a/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp +++ b/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "CullingOfStratholmeActions.h" -#include "CullingOfStratholmeStrategy.h" -bool ExplodeGhoulSpreadAction::Execute(Event event) +bool ExplodeGhoulSpreadAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "salramm the fleshcrafter"); if (!boss) { return false; } @@ -38,7 +37,7 @@ bool EpochStackAction::isUseful() // else return !(bot->getClass() == CLASS_HUNTER) && AI_VALUE2(float, "distance", "current target") > 5.0f; } -bool EpochStackAction::Execute(Event event) +bool EpochStackAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "chrono-lord epoch"); if (!boss) { return false; } From 67b903a90f192821f1c0e6ebc8d5a64779fd40cf Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:12:02 +0100 Subject: [PATCH 157/222] fix: Resolved all warnings in DrakTharonKeepActions.cpp. --- .../DraktharonKeep/Action/DrakTharonKeepActions.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp b/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp index 8cbbe49c2a..59d0091c4a 100644 --- a/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp +++ b/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "DrakTharonKeepActions.h" -#include "DrakTharonKeepStrategy.h" -bool CorpseExplodeSpreadAction::Execute(Event event) +bool CorpseExplodeSpreadAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "trollgore"); if (!boss) { return false; } @@ -25,7 +24,7 @@ bool CorpseExplodeSpreadAction::Execute(Event event) return false; } -bool AvoidArcaneFieldAction::Execute(Event event) +bool AvoidArcaneFieldAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "novos the summoner"); if (!boss) { return false; } @@ -44,7 +43,7 @@ bool NovosDefaultPositionAction::isUseful() float threshold = 15.0f; return bot->GetDistance(NOVOS_PARTY_POSITION) > threshold; } -bool NovosDefaultPositionAction::Execute(Event event) +bool NovosDefaultPositionAction::Execute(Event) { float clusterDistance = 4.0f; // Only reposition if we're not killing anything @@ -59,7 +58,7 @@ bool NovosDefaultPositionAction::Execute(Event event) return false; } -bool NovosTargetPriorityAction::Execute(Event event) +bool NovosTargetPriorityAction::Execute(Event) { // TODO: This can be improved, some parts are still buggy. // But it works for now and this fight is very easy From bec6d6985b123d764dc8416741de98a7318bad45 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:13:27 +0100 Subject: [PATCH 158/222] fix: Resolved all warnings in ForgeOfSoulsActions.cpp. --- .../ForgeOfSouls/Action/ForgeOfSoulsActions.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp b/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp index e72fe98d5f..a22e5403db 100644 --- a/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp +++ b/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp @@ -1,9 +1,7 @@ #include "Playerbots.h" #include "ForgeOfSoulsActions.h" -#include "ForgeOfSoulsStrategy.h" -#include "SharedDefines.h" -bool MoveFromBronjahmAction::Execute(Event event) +bool MoveFromBronjahmAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm"); if (!boss) @@ -17,13 +15,11 @@ bool MoveFromBronjahmAction::Execute(Event event) return false; } -bool AttackCorruptedSoulFragmentAction::Execute(Event event) +bool AttackCorruptedSoulFragmentAction::Execute(Event) { - Unit* currentTarget = AI_VALUE(Unit*, "current target"); GuidVector targets = AI_VALUE(GuidVector, "possible targets"); // If no valid skull target, search for corrupted soul fragment - Unit* empoweredPrince = nullptr; for (auto i = targets.begin(); i != targets.end(); ++i) { Unit* unit = botAI->GetUnit(*i); @@ -32,8 +28,6 @@ bool AttackCorruptedSoulFragmentAction::Execute(Event event) if (unit->GetEntry() == NPC_CORRUPTED_SOUL_FRAGMENT) { - empoweredPrince = unit; - // Mark corrupted soul fragment with skull if in group and not already marked if (Group* group = bot->GetGroup()) { @@ -51,7 +45,7 @@ bool AttackCorruptedSoulFragmentAction::Execute(Event event) return false; } -bool BronjahmGroupPositionAction::Execute(Event event) +bool BronjahmGroupPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm"); if (!boss) @@ -141,7 +135,7 @@ bool BronjahmGroupPositionAction::Execute(Event event) bool BronjahmGroupPositionAction::isUseful() { return true; } -bool DevourerOfSoulsAction::Execute(Event event) +bool DevourerOfSoulsAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "devourer of souls"); if (!boss) From 731a71eed8ee9f99ccef561ce1cd39cb197034ed Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:14:26 +0100 Subject: [PATCH 159/222] fix: Resolved all warnings in GundrakActions.cpp. --- src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp b/src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp index 4e9910993d..e9ff00ef68 100644 --- a/src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp +++ b/src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "GundrakActions.h" -#include "GundrakStrategy.h" -bool AvoidPoisonNovaAction::Execute(Event event) +bool AvoidPoisonNovaAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran"); if (!boss) { return false; } @@ -19,12 +18,11 @@ bool AvoidPoisonNovaAction::Execute(Event event) return false; } -bool AttackSnakeWrapAction::Execute(Event event) +bool AttackSnakeWrapAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran"); if (!boss) { return false; } - Unit* snakeWrap = nullptr; // Target is not findable from threat table using AI_VALUE2(), // therefore need to search manually for the unit name GuidVector targets = AI_VALUE(GuidVector, "possible targets no los"); @@ -45,7 +43,7 @@ bool AttackSnakeWrapAction::Execute(Event event) return false; } -bool AvoidWhirlingSlashAction::Execute(Event event) +bool AvoidWhirlingSlashAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "gal'darah"); if (!boss) { return false; } From fa9771b04ca1a394ac3353f72cd04da708ad8c75 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:16:29 +0100 Subject: [PATCH 160/222] fix: Resolved all warnings in HallsOfLightningActions.cpp. --- .../Action/HallsOfLightningActions.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp b/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp index 047e0aee13..4613492ae8 100644 --- a/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp +++ b/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "HallsOfLightningActions.h" -#include "HallsOfLightningStrategy.h" -bool BjarngrimTargetAction::Execute(Event event) +bool BjarngrimTargetAction::Execute(Event) { Unit* target = nullptr; @@ -35,7 +34,7 @@ bool BjarngrimTargetAction::Execute(Event event) return Attack(target); } -bool AvoidWhirlwindAction::Execute(Event event) +bool AvoidWhirlwindAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "general bjarngrim"); if (!boss) { return false; } @@ -52,7 +51,7 @@ bool AvoidWhirlwindAction::Execute(Event event) return false; } -bool VolkhanTargetAction::Execute(Event event) +bool VolkhanTargetAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "volkhan"); if (!boss || AI_VALUE(Unit*, "current target") == boss) @@ -63,7 +62,7 @@ bool VolkhanTargetAction::Execute(Event event) return Attack(boss); } -bool StaticOverloadSpreadAction::Execute(Event event) +bool StaticOverloadSpreadAction::Execute(Event) { float radius = 8.0f; float distanceExtra = 2.0f; @@ -86,7 +85,7 @@ bool StaticOverloadSpreadAction::Execute(Event event) return false; } -bool BallLightningSpreadAction::Execute(Event event) +bool BallLightningSpreadAction::Execute(Event) { float radius = 6.0f; float distanceExtra = 1.0f; @@ -108,14 +107,14 @@ bool BallLightningSpreadAction::Execute(Event event) } bool IonarTankPositionAction::isUseful() { return bot->GetExactDist2d(IONAR_TANK_POSITION) > 10.0f; } -bool IonarTankPositionAction::Execute(Event event) +bool IonarTankPositionAction::Execute(Event) { return MoveTo(bot->GetMapId(), IONAR_TANK_POSITION.GetPositionX(), IONAR_TANK_POSITION.GetPositionY(), IONAR_TANK_POSITION.GetPositionZ(), false, false, false, true, MovementPriority::MOVEMENT_COMBAT); } bool DispersePositionAction::isUseful() { return bot->GetExactDist2d(DISPERSE_POSITION) > 8.0f; } -bool DispersePositionAction::Execute(Event event) +bool DispersePositionAction::Execute(Event) { return MoveTo(bot->GetMapId(), DISPERSE_POSITION.GetPositionX(), DISPERSE_POSITION.GetPositionY(), DISPERSE_POSITION.GetPositionZ(), false, false, false, true, MovementPriority::MOVEMENT_COMBAT); @@ -133,7 +132,7 @@ bool LokenStackAction::isUseful() // else return AI_VALUE2(float, "distance", "current target") > 2.0f; } -bool LokenStackAction::Execute(Event event) +bool LokenStackAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "loken"); if (!boss) { return false; } @@ -152,7 +151,7 @@ bool LokenStackAction::Execute(Event event) return false; } -bool AvoidLightningNovaAction::Execute(Event event) +bool AvoidLightningNovaAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "loken"); if (!boss) { return false; } From d086c64757841781e31c97255a596e80209be65e Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:18:35 +0100 Subject: [PATCH 161/222] fix: Resolved all warnings in HallsOfStoneActions.cpp. --- src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp b/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp index 30562f090d..c43e23b66e 100644 --- a/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp +++ b/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "HallsOfStoneActions.h" -#include "HallsOfStoneStrategy.h" -bool ShatterSpreadAction::Execute(Event event) +bool ShatterSpreadAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus"); if (!boss) { return false; } @@ -35,7 +34,7 @@ bool ShatterSpreadAction::Execute(Event event) return false; } -bool AvoidLightningRingAction::Execute(Event event) +bool AvoidLightningRingAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sjonnir the ironshaper"); if (!boss) { return false; } From 367d11525ec57962de9bf16afea40af56f60c661 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:21:14 +0100 Subject: [PATCH 162/222] fix: Resolved all warnings in NexusActions.cpp. --- src/Ai/Dungeon/Nexus/Action/NexusActions.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Ai/Dungeon/Nexus/Action/NexusActions.cpp b/src/Ai/Dungeon/Nexus/Action/NexusActions.cpp index f61a95aef4..fe7feed10d 100644 --- a/src/Ai/Dungeon/Nexus/Action/NexusActions.cpp +++ b/src/Ai/Dungeon/Nexus/Action/NexusActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "NexusActions.h" -#include "NexusStrategy.h" -bool MoveFromWhirlwindAction::Execute(Event event) +bool MoveFromWhirlwindAction::Execute(Event) { Unit* boss = nullptr; uint8 faction = bot->GetTeamId(); @@ -52,7 +51,7 @@ bool MoveFromWhirlwindAction::Execute(Event event) return MoveAway(boss, targetDist - bossDistance); } -bool FirebombSpreadAction::Execute(Event event) +bool FirebombSpreadAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "grand magus telestra"); float radius = 5.0f; @@ -74,7 +73,7 @@ bool FirebombSpreadAction::Execute(Event event) } bool TelestraSplitTargetAction::isUseful() { return !botAI->IsHeal(bot); } -bool TelestraSplitTargetAction::Execute(Event event) +bool TelestraSplitTargetAction::Execute(Event) { GuidVector attackers = AI_VALUE(GuidVector, "attackers"); Unit* splitTargets[3] = {nullptr, nullptr, nullptr}; @@ -121,7 +120,7 @@ bool TelestraSplitTargetAction::Execute(Event event) } bool ChaoticRiftTargetAction::isUseful() { return !botAI->IsHeal(bot); } -bool ChaoticRiftTargetAction::Execute(Event event) +bool ChaoticRiftTargetAction::Execute(Event) { Unit* chaoticRift = nullptr; @@ -152,7 +151,7 @@ bool DodgeSpikesAction::isUseful() return bot->GetExactDist2d(boss) > 0.5f; } -bool DodgeSpikesAction::Execute(Event event) +bool DodgeSpikesAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "ormorok the tree-shaper"); if (!boss) { return false; } @@ -160,7 +159,7 @@ bool DodgeSpikesAction::Execute(Event event) return Move(bot->GetAngle(boss), bot->GetExactDist2d(boss) - 0.3f); } -bool IntenseColdJumpAction::Execute(Event event) +bool IntenseColdJumpAction::Execute(Event) { // This needs improving but maybe it should be done in the playerbot core. // Jump doesn't seem to support zero offset (eg. jump on the spot) so need to add a tiny delta. From c444ed448f85aae9930f2be5203d34251d12bef2 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:37:26 +0100 Subject: [PATCH 163/222] fix: Resolved all warnings in OculusActions.cpp. --- src/Ai/Dungeon/Oculus/Action/OculusActions.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp index 414acc4bc9..74c4029dbd 100644 --- a/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp +++ b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp @@ -1,9 +1,8 @@ #include "Playerbots.h" #include "OculusActions.h" -#include "OculusStrategy.h" #include "LastSpellCastValue.h" -bool AvoidUnstableSphereAction::Execute(Event event) +bool AvoidUnstableSphereAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "drakos the interrogator"); if (!boss) { return false; } @@ -34,7 +33,7 @@ bool AvoidUnstableSphereAction::Execute(Event event) } bool MountDrakeAction::isPossible() { return bot->GetMapId() == OCULUS_MAP_ID; } -bool MountDrakeAction::Execute(Event event) +bool MountDrakeAction::Execute(Event) { std::map drakeAssignments; // Composition can be adjusted - both 3/1/1 and 2/2/1 are good default comps @@ -88,7 +87,7 @@ bool MountDrakeAction::Execute(Event event) } // Correct/update the drake items in inventories incase assignments have changed - for (uint32 itemId : DRAKE_ITEMS) + for (int64_t itemId : DRAKE_ITEMS) { Item* item = bot->GetItemByEntry(itemId); if (!item) { continue; } @@ -109,7 +108,7 @@ bool MountDrakeAction::Execute(Event event) return false; } -bool DismountDrakeAction::Execute(Event event) +bool DismountDrakeAction::Execute(Event) { if (bot->GetVehicle()) { @@ -119,7 +118,7 @@ bool DismountDrakeAction::Execute(Event event) return false; } -bool OccFlyDrakeAction::Execute(Event event) +bool OccFlyDrakeAction::Execute(Event) { Player* master = botAI->GetMaster(); if (!master) { return false; } @@ -160,7 +159,7 @@ bool OccFlyDrakeAction::Execute(Event event) return false; } -bool OccDrakeAttackAction::Execute(Event event) +bool OccDrakeAttackAction::Execute(Event) { vehicleBase = bot->GetVehicleBase(); if (!vehicleBase) { return false; } @@ -319,7 +318,7 @@ bool OccDrakeAttackAction::RubyDrakeAction(Unit* target) return CastDrakeSpellAction(target, SPELL_SEARING_WRATH, 0); } -bool AvoidArcaneExplosionAction::Execute(Event event) +bool AvoidArcaneExplosionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "mage-lord urom"); if (!boss) { return false; } @@ -339,7 +338,7 @@ bool AvoidArcaneExplosionAction::Execute(Event event) return MoveNear(bot->GetMapId(), closestPos->GetPositionX(), closestPos->GetPositionY(), closestPos->GetPositionZ(), 2.0f, MovementPriority::MOVEMENT_COMBAT); } -bool TimeBombSpreadAction::Execute(Event event) +bool TimeBombSpreadAction::Execute(Event) { float radius = 10.0f; float distanceExtra = 2.0f; From 85c442cd2d9cbbdcaaae3e8b4e7229a1c8e796f9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Thu, 29 Jan 2026 23:53:40 +0100 Subject: [PATCH 164/222] fix: Resolved all warnings in OculusMultipliers.cpp and OculusActions.h. --- src/Ai/Dungeon/Oculus/Action/OculusActions.h | 2 -- .../Oculus/Multiplier/OculusMultipliers.cpp | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Ai/Dungeon/Oculus/Action/OculusActions.h b/src/Ai/Dungeon/Oculus/Action/OculusActions.h index 6b26b9ddbc..6616ce884b 100644 --- a/src/Ai/Dungeon/Oculus/Action/OculusActions.h +++ b/src/Ai/Dungeon/Oculus/Action/OculusActions.h @@ -4,8 +4,6 @@ #include "Action.h" #include "AttackAction.h" #include "PlayerbotAI.h" -#include "Playerbots.h" -#include "OculusTriggers.h" #include "UseItemAction.h" #include "GenericSpellActions.h" diff --git a/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp index 7be543ee70..e71067d0ce 100644 --- a/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp +++ b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp @@ -6,6 +6,7 @@ #include "OculusTriggers.h" #include "FollowActions.h" #include "ReachTargetActions.h" +#include "Playerbots.h" float MountingDrakeMultiplier::GetValue(Action* action) { @@ -100,12 +101,22 @@ uint8 UromMultiplier::GetPhaseByCurrentPosition(Unit* unit) float EregosMultiplier::GetValue(Action* action) { - Unit* boss = AI_VALUE2(Unit*, "find target", "ley-guardian eregos"); - if (!boss) { return 1.0f; } + if (action == nullptr) + { + return 1.0f; + } + + const Unit* const boss = this->context->GetValue("find target", "ley-guardian eregos")->Get(); - if (boss->HasAura(SPELL_PLANAR_SHIFT && dynamic_cast(action))) + if (boss == nullptr) + { + return 1.0f; + } + + if (boss->HasAura(SPELL_PLANAR_SHIFT) && action->getName() == "occ drake attack") { return 0.0f; } + return 1.0f; } From 46e12742f7dad6aeee3b68fb74554b880000230f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:01:50 +0100 Subject: [PATCH 165/222] fix: Resolved all warnings in OldKingdomActions.cpp. --- src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp b/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp index 916bf29200..7755617758 100644 --- a/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp +++ b/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "OldKingdomActions.h" -#include "OldKingdomStrategy.h" -bool AttackNadoxGuardianAction::Execute(Event event) +bool AttackNadoxGuardianAction::Execute(Event) { Unit* target = AI_VALUE2(Unit*, "find target", "ahn'kahar guardian"); if (!target || AI_VALUE(Unit*, "current target") == target) @@ -12,7 +11,7 @@ bool AttackNadoxGuardianAction::Execute(Event event) return Attack(target); } -bool AttackJedogaVolunteerAction::Execute(Event event) +bool AttackJedogaVolunteerAction::Execute(Event) { Unit* target = nullptr; // Target is not findable from threat table using AI_VALUE2(), @@ -40,7 +39,7 @@ bool AttackJedogaVolunteerAction::Execute(Event event) return Attack(target); } -bool AvoidShadowCrashAction::Execute(Event event) +bool AvoidShadowCrashAction::Execute(Event) { // Could check all enemy units in range as it's possible to pull multiple of these mobs. // They should really be killed 1 by 1, multipulls are messy so we just handle singles for now From efe489f282c703681cd8a4f5c3bc4c8d977b65af Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:11:29 +0100 Subject: [PATCH 166/222] fix: Resolved all warnings in RaidGruulsLairActions.cpp. --- .../Action/RaidGruulsLairActions.cpp | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp b/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp index 1a98135cac..b4ffd799df 100644 --- a/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp +++ b/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp @@ -9,7 +9,7 @@ using namespace GruulsLairHelpers; // High King Maulgar Actions // Main tank on Maulgar -bool HighKingMaulgarMainTankAttackMaulgarAction::Execute(Event event) +bool HighKingMaulgarMainTankAttackMaulgarAction::Execute(Event) { Unit* maulgar = AI_VALUE2(Unit*, "find target", "high king maulgar"); @@ -52,7 +52,7 @@ bool HighKingMaulgarMainTankAttackMaulgarAction::Execute(Event event) } // First offtank on Olm -bool HighKingMaulgarFirstAssistTankAttackOlmAction::Execute(Event event) +bool HighKingMaulgarFirstAssistTankAttackOlmAction::Execute(Event) { Unit* olm = AI_VALUE2(Unit*, "find target", "olm the summoner"); @@ -92,7 +92,7 @@ bool HighKingMaulgarFirstAssistTankAttackOlmAction::Execute(Event event) } // Second offtank on Blindeye -bool HighKingMaulgarSecondAssistTankAttackBlindeyeAction::Execute(Event event) +bool HighKingMaulgarSecondAssistTankAttackBlindeyeAction::Execute(Event) { Unit* blindeye = AI_VALUE2(Unit*, "find target", "blindeye the seer"); @@ -135,7 +135,7 @@ bool HighKingMaulgarSecondAssistTankAttackBlindeyeAction::Execute(Event event) } // Mage with highest max HP on Krosh -bool HighKingMaulgarMageTankAttackKroshAction::Execute(Event event) +bool HighKingMaulgarMageTankAttackKroshAction::Execute(Event) { Unit* krosh = AI_VALUE2(Unit*, "find target", "krosh firehand"); @@ -189,7 +189,7 @@ bool HighKingMaulgarMageTankAttackKroshAction::Execute(Event event) } // Moonkin with highest max HP on Kiggler -bool HighKingMaulgarMoonkinTankAttackKigglerAction::Execute(Event event) +bool HighKingMaulgarMoonkinTankAttackKigglerAction::Execute(Event) { Unit* kiggler = AI_VALUE2(Unit*, "find target", "kiggler the crazed"); @@ -212,7 +212,7 @@ bool HighKingMaulgarMoonkinTankAttackKigglerAction::Execute(Event event) return false; } -bool HighKingMaulgarAssignDPSPriorityAction::Execute(Event event) +bool HighKingMaulgarAssignDPSPriorityAction::Execute(Event) { // Target priority 1: Blindeye Unit* blindeye = AI_VALUE2(Unit*, "find target", "blindeye the seer"); @@ -336,7 +336,7 @@ bool HighKingMaulgarAssignDPSPriorityAction::Execute(Event event) } // Avoid Whirlwind and Blast Wave and generally try to stay near the center of the room -bool HighKingMaulgarHealerFindSafePositionAction::Execute(Event event) +bool HighKingMaulgarHealerFindSafePositionAction::Execute(Event) { const Location& fightCenter = GruulsLairLocations::MaulgarRoomCenter; const float maxDistanceFromFight = 50.0f; @@ -370,7 +370,7 @@ bool HighKingMaulgarHealerFindSafePositionAction::Execute(Event event) } // Run away from Maulgar during Whirlwind (logic for after all other ogres are dead) -bool HighKingMaulgarRunAwayFromWhirlwindAction::Execute(Event event) +bool HighKingMaulgarRunAwayFromWhirlwindAction::Execute(Event) { Unit* maulgar = AI_VALUE2(Unit*, "find target", "high king maulgar"); @@ -403,7 +403,7 @@ bool HighKingMaulgarRunAwayFromWhirlwindAction::Execute(Event event) return false; } -bool HighKingMaulgarBanishFelstalkerAction::Execute(Event event) +bool HighKingMaulgarBanishFelstalkerAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -436,7 +436,9 @@ bool HighKingMaulgarBanishFelstalkerAction::Execute(Event event) } } - if (warlockIndex >= 0 && warlockIndex < felStalkers.size()) + const int64_t felStalkersSize = felStalkers.size(); + + if (warlockIndex >= 0 && warlockIndex < felStalkersSize) { Unit* assignedFelStalker = felStalkers[warlockIndex]; if (!assignedFelStalker->HasAura(SPELL_BANISH) && botAI->CanCastSpell(SPELL_BANISH, assignedFelStalker, true)) @@ -448,7 +450,7 @@ bool HighKingMaulgarBanishFelstalkerAction::Execute(Event event) // Hunter 1: Misdirect Olm to first offtank and have pet attack Blindeye // Hunter 2: Misdirect Blindeye to second offtank -bool HighKingMaulgarMisdirectOlmAndBlindeyeAction::Execute(Event event) +bool HighKingMaulgarMisdirectOlmAndBlindeyeAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -528,7 +530,7 @@ bool HighKingMaulgarMisdirectOlmAndBlindeyeAction::Execute(Event event) // Gruul the Dragonkiller Actions // Position in center of the room -bool GruulTheDragonkillerMainTankPositionBossAction::Execute(Event event) +bool GruulTheDragonkillerMainTankPositionBossAction::Execute(Event) { Unit* gruul = AI_VALUE2(Unit*, "find target", "gruul the dragonkiller"); @@ -546,7 +548,6 @@ bool GruulTheDragonkillerMainTankPositionBossAction::Execute(Event event) if (distanceToTankPosition > maxDistance) { - float step = std::min(maxDistance, distanceToTankPosition); float moveX = bot->GetPositionX() + (dX / distanceToTankPosition) * maxDistance; float moveY = bot->GetPositionY() + (dY / distanceToTankPosition) * maxDistance; const float moveZ = tankPosition.z; @@ -569,7 +570,7 @@ bool GruulTheDragonkillerMainTankPositionBossAction::Execute(Event event) // Ranged will take initial positions around the middle of the room, 25-40 yards from center // Ranged should spread out 10 yards from each other -bool GruulTheDragonkillerSpreadRangedAction::Execute(Event event) +bool GruulTheDragonkillerSpreadRangedAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -662,7 +663,7 @@ bool GruulTheDragonkillerSpreadRangedAction::Execute(Event event) } // Try to get away from other group members when Ground Slam is cast -bool GruulTheDragonkillerShatterSpreadAction::Execute(Event event) +bool GruulTheDragonkillerShatterSpreadAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) From 10cab87d495a8a2503686c5a6200e202eddb41f2 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:12:34 +0100 Subject: [PATCH 167/222] fix: Resolved all warnings in TrialOfTheChampionStrategy.cpp. --- .../TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp index bbccca71f3..6f19df472d 100644 --- a/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp +++ b/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp @@ -1,5 +1,4 @@ #include "TrialOfTheChampionStrategy.h" -#include "TrialOfTheChampionMultipliers.h" void WotlkDungeonToCStrategy::InitTriggers(std::vector &triggers) { @@ -16,6 +15,6 @@ void WotlkDungeonToCStrategy::InitTriggers(std::vector &triggers) } -void WotlkDungeonToCStrategy::InitMultipliers(std::vector &multipliers) +void WotlkDungeonToCStrategy::InitMultipliers(std::vector&) { } From fd880402463385c29017ef0adaa4ebf317c6debf Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:14:43 +0100 Subject: [PATCH 168/222] fix: Resolved all warnings in PitOfSaronMultipliers.cpp. --- src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp b/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp index be36e480f2..f29fa4245b 100644 --- a/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp +++ b/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp @@ -27,7 +27,7 @@ float IckAndKrickMultiplier::GetValue(Action* action) return 1.0f; } -float GarfrostMultiplier::GetValue(Action* action) +float GarfrostMultiplier::GetValue(Action*) { Unit* boss = AI_VALUE2(Unit*, "find target", "garfrost"); if (!boss) From ed4f1590ea9ba302fa776efdff7c2143e2e35ff8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:32:28 +0100 Subject: [PATCH 169/222] fix: Resolved all the warnings in PitOfSarongActions.cpp. --- .../PitOfSaron/Action/PitOfSaronActions.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp index f34b98462e..7053fc5b0d 100644 --- a/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp +++ b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp @@ -1,9 +1,7 @@ #include "Playerbots.h" #include "PitOfSaronActions.h" -#include "PitOfSaronStrategy.h" -#include "SharedDefines.h" -bool IckAndKrickAction::Execute(Event event) +bool IckAndKrickAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "Ick"); if (!boss) @@ -26,7 +24,14 @@ bool IckAndKrickAction::Execute(Event event) bool pursuit = bot->HasAura(SPELL_PURSUIT) || (!botAI->IsTank(bot) && boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_PURSUIT)); bool poisonNova = boss->HasUnitState(UNIT_STATE_CASTING) && (boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA_POS) || boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA_POS_HC)); - bool explosiveBarrage = orb || boss->HasUnitState(UNIT_STATE_CASTING) && (boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_ICK) || boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_KRICK)); + bool explosiveBarrage = orb + || ( + boss->HasUnitState(UNIT_STATE_CASTING) + && ( + boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_ICK) + || boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_KRICK) + ) + ); bool isTank = botAI->IsTank(bot); if (pursuit && Pursuit(pursuit, boss)) @@ -136,7 +141,7 @@ bool IckAndKrickAction::PoisonNova(bool poisonNova, Unit* boss) return false; } -bool IckAndKrickAction::ExplosiveBarrage(bool explosiveBarrage, Unit* boss) +bool IckAndKrickAction::ExplosiveBarrage(bool, Unit* boss) { std::vector orbs; Unit* closestOrb = nullptr; @@ -269,7 +274,7 @@ bool IckAndKrickAction::ExplosiveBarrage(bool explosiveBarrage, Unit* boss) return false; } -bool TyrannusAction::Execute(Event event) +bool TyrannusAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "scourgelord tyrannus"); if (!boss) From 1e0f65361bb4b5f95cca849c0ea2e9919dc998c8 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:34:25 +0100 Subject: [PATCH 170/222] fix: Resolved all warnings in TrialOfTheChampionActions.cpp. --- .../Action/TrialOfTheChampionActions.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp index 92b687b292..5cdfb4f21a 100644 --- a/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp +++ b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp @@ -1,15 +1,12 @@ #include "Playerbots.h" #include "TrialOfTheChampionActions.h" -#include "TrialOfTheChampionStrategy.h" #include "NearestNpcsValue.h" #include "ObjectAccessor.h" -#include "Timer.h" #include "Vehicle.h" #include "GenericSpellActions.h" #include "GenericActions.h" -#include -bool ToCLanceAction::Execute(Event event) +bool ToCLanceAction::Execute(Event) { // If already has lance equipped, do nothing if (bot->HasItemOrGemWithIdEquipped(ITEM_LANCE, 1)) @@ -58,10 +55,6 @@ bool ToCLanceAction::Execute(Event event) // If we found the lance, equip it if (lanceItem) { - // Store the lance's current position - uint8 srcBag = lanceItem->GetBagSlot(); - uint8 srcSlot = lanceItem->GetSlot(); - // First unequip current weapon if it exists if (oldWeapon) { @@ -105,7 +98,7 @@ bool ToCUELanceAction::Execute(Event event) return false; } -bool ToCMountedAction::Execute(Event event) +bool ToCMountedAction::Execute(Event) { Unit* vehicleBase = bot->GetVehicleBase(); Vehicle* vehicle = bot->GetVehicle(); @@ -179,7 +172,7 @@ bool ToCMountedAction::Execute(Event event) return false; } -bool ToCMountAction::Execute(Event event) +bool ToCMountAction::Execute(Event) { // do not switch vehicles yet if (bot->GetVehicle()) @@ -244,7 +237,7 @@ bool ToCMountAction::EnterVehicle(Unit* vehicleBase, bool moveIfFar) return true; } -bool ToCEadricAction::Execute(Event event) +bool ToCEadricAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "eadric the pure"); if (!boss) From aee131db34ca60e665fd773fcefd5ccb3abde59f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:35:46 +0100 Subject: [PATCH 171/222] fix: Resolved all warnings in UtgardeKeepActions.cpp. --- .../Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp b/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp index 20a5f27b49..81865c750e 100644 --- a/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp +++ b/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp @@ -1,9 +1,8 @@ #include "Playerbots.h" #include "UtgardeKeepActions.h" -#include "UtgardeKeepStrategy.h" bool AttackFrostTombAction::isUseful() { return !botAI->IsHeal(bot); } -bool AttackFrostTombAction::Execute(Event event) +bool AttackFrostTombAction::Execute(Event) { Unit* frostTomb = nullptr; @@ -28,7 +27,7 @@ bool AttackFrostTombAction::Execute(Event event) } // TODO: Possibly add player stacking behaviour close to tank, to prevent Skarvald charging ranged -bool AttackDalronnAction::Execute(Event event) +bool AttackDalronnAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "dalronn the controller"); if (!boss) { return false; } @@ -40,7 +39,7 @@ bool AttackDalronnAction::Execute(Event event) return Attack(boss); } -bool IngvarStopCastingAction::Execute(Event event) +bool IngvarStopCastingAction::Execute(Event) { // Doesn't work, this action gets queued behind the current spell instead of interrupting it Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer"); @@ -64,7 +63,7 @@ bool IngvarStopCastingAction::Execute(Event event) } bool IngvarDodgeSmashAction::isUseful() { return !AI_VALUE2(bool, "behind", "current target"); } -bool IngvarDodgeSmashAction::Execute(Event event) +bool IngvarDodgeSmashAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer"); if (!boss) { return false; } @@ -78,7 +77,7 @@ bool IngvarDodgeSmashAction::Execute(Event event) } bool IngvarSmashReturnAction::isUseful() { return AI_VALUE2(bool, "behind", "current target"); } -bool IngvarSmashReturnAction::Execute(Event event) +bool IngvarSmashReturnAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "ingvar the plunderer"); if (!boss) { return false; } From e003a3f52e07d47f0f55ccc306cbb7466223a1c9 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:36:37 +0100 Subject: [PATCH 172/222] fix: Resolved all warnings in UtgardePinnacleActions.cpp. --- .../UtgardePinnacle/Action/UtgardePinnacleActions.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp b/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp index f084ca15b6..0b09459e71 100644 --- a/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp +++ b/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "UtgardePinnacleActions.h" -#include "UtgardePinnacleStrategy.h" -bool AvoidFreezingCloudAction::Execute(Event event) +bool AvoidFreezingCloudAction::Execute(Event) { Unit* closestTrigger = nullptr; GuidVector objects = AI_VALUE(GuidVector, "nearest hostile npcs"); @@ -36,7 +35,7 @@ bool AvoidFreezingCloudAction::Execute(Event event) return false; } -bool AvoidSkadiWhirlwindAction::Execute(Event event) +bool AvoidSkadiWhirlwindAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "skadi the ruthless"); if (!boss) { return false; } From f267b41d24d82232c7dd5cd133438cd4e998cb05 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:37:24 +0100 Subject: [PATCH 173/222] fix: Resolved all warnings in VioletGoldActions.cpp. --- src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp b/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp index b590642d8b..157e24b2de 100644 --- a/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp +++ b/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp @@ -1,8 +1,7 @@ #include "Playerbots.h" #include "VioletHoldActions.h" -#include "VioletHoldStrategy.h" -bool AttackErekemAction::Execute(Event event) +bool AttackErekemAction::Execute(Event) { // Focus boss first, adds after Unit* boss = AI_VALUE2(Unit*, "find target", "erekem"); @@ -15,7 +14,7 @@ bool AttackErekemAction::Execute(Event event) return false; } -bool AttackIchorGlobuleAction::Execute(Event event) +bool AttackIchorGlobuleAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "ichoron"); if (!boss) { return false; } @@ -60,7 +59,7 @@ bool AttackIchorGlobuleAction::Execute(Event event) return false; } -bool AttackVoidSentryAction::Execute(Event event) +bool AttackVoidSentryAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "zuramat the obliterator"); if (!boss) { return false; } @@ -96,7 +95,7 @@ bool AttackVoidSentryAction::Execute(Event event) return false; } -bool StopAttackAction::Execute(Event event) +bool StopAttackAction::Execute(Event) { return bot->AttackStop(); } From fe04fb400c86a896cf07d68896d546489639aaab Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:49:56 +0100 Subject: [PATCH 174/222] fix: Refactored the AQ20 actions. --- src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp | 95 +++++++++++-------- src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp | 64 ++++++++----- src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp | 44 +++++---- src/Ai/Raid/Aq20/Util/RaidAq20Utils.h | 6 +- 4 files changed, 125 insertions(+), 84 deletions(-) diff --git a/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp index 1bf33147f8..01ae38aa54 100644 --- a/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp +++ b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp @@ -1,48 +1,63 @@ #include "RaidAq20Actions.h" -#include "Playerbots.h" #include "RaidAq20Utils.h" -bool Aq20UseCrystalAction::Execute(Event event) +bool Aq20UseCrystalAction::Execute(Event) { - if (Unit* boss = AI_VALUE2(Unit*, "find target", "ossirian the unscarred")) + Unit* const boss = context->GetValue("find target", "ossirian the unscarred")->Get(); + + if (boss == nullptr) + { + return false; + } + + const GameObject* const crystal = RaidAq20Utils::GetNearestCrystal(*boss); + + if (crystal == nullptr) { - if (GameObject* crystal = RaidAq20Utils::GetNearestCrystal(boss)) - { - float botDist = bot->GetDistance(crystal); - if (botDist > INTERACTION_DISTANCE) - return MoveTo(bot->GetMapId(), - crystal->GetPositionX() + frand(-3.5f, 3.5f), - crystal->GetPositionY() + frand(-3.5f, 3.5f), - crystal->GetPositionZ()); - - // if we're already in range just wait here until it's time to activate crystal - SetNextMovementDelay(500); - - // don't activate crystal if boss too far or its already been activated - if (boss->GetDistance(crystal) > 25.0f || - crystal->HasGameObjectFlag(GO_FLAG_IN_USE)) - return false; - - // don't activate crystal if boss doesn't have buff yet AND isn't going to have it soon - // (though ideally bot should activate it ~5 seconds early due to time it takes for - // crystal to activate and remove buff) - if (!RaidAq20Utils::IsOssirianBuffActive(boss) && - RaidAq20Utils::GetOssirianDebuffTimeRemaining(boss) > 5000) - return false; - - // this makes crystal do its animation (then disappear after) - WorldPacket data1(CMSG_GAMEOBJ_USE); - data1 << crystal->GetGUID(); - bot->GetSession()->HandleGameObjectUseOpcode(data1); - - // this makes crystal actually remove the buff and put on debuff (took a while to figure that out) - WorldPacket data2(CMSG_GAMEOBJ_USE); - data2 << crystal->GetGUID(); - bot->GetSession()->HandleGameobjectReportUse(data2); - - return true; - } + return false; } - return false; + + float botDist = this->bot->GetDistance(crystal); + + if (botDist > INTERACTION_DISTANCE) + { + return MoveTo( + this->bot->GetMapId(), + crystal->GetPositionX() + frand(-3.5f, 3.5f), + crystal->GetPositionY() + frand(-3.5f, 3.5f), + crystal->GetPositionZ() + ); + } + + // if we're already in range just wait here until it's time to activate crystal + this->SetNextMovementDelay(500); + + // don't activate crystal if boss too far or its already been activated + if (boss->GetDistance(crystal) > 25.0f + || crystal->HasGameObjectFlag(GO_FLAG_IN_USE)) + { + return false; + } + + // don't activate crystal if boss doesn't have buff yet AND isn't going to have it soon + // (though ideally bot should activate it ~5 seconds early due to time it takes for + // crystal to activate and remove buff) + if (!RaidAq20Utils::IsOssirianBuffActive(*boss) && + RaidAq20Utils::GetOssirianDebuffTimeRemaining(*boss) > 5000) + { + return false; + } + + // this makes crystal do its animation (then disappear after) + WorldPacket data1(CMSG_GAMEOBJ_USE); + data1 << crystal->GetGUID(); + bot->GetSession()->HandleGameObjectUseOpcode(data1); + + // this makes crystal actually remove the buff and put on debuff (took a while to figure that out) + WorldPacket data2(CMSG_GAMEOBJ_USE); + data2 << crystal->GetGUID(); + bot->GetSession()->HandleGameobjectReportUse(data2); + + return true; } diff --git a/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp index 1a580d6bd3..40f95c9369 100644 --- a/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp +++ b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp @@ -1,36 +1,52 @@ #include "RaidAq20Triggers.h" -#include "SharedDefines.h" #include "RaidAq20Utils.h" bool Aq20MoveToCrystalTrigger::IsActive() { - if (Unit* boss = AI_VALUE2(Unit*, "find target", "ossirian the unscarred")) + Unit* const boss = context->GetValue("find target", "ossirian the unscarred")->Get(); + + if (boss == nullptr) { - if (boss->IsInCombat()) + return false; + } + + if (!boss->IsInCombat()) + { + return false; + } + + // if buff is active move to crystal + if (RaidAq20Utils::IsOssirianBuffActive(*boss)) + { + return true; + } + + // if buff is not active a debuff will be, buff becomes active once debuff expires + // so move to crystal when debuff almost done, or based debuff time left and + // distance bot is from crystal (ie: start moving early enough to make it) + int32_t debuffTimeRemaining = RaidAq20Utils::GetOssirianDebuffTimeRemaining(*boss); + + if (debuffTimeRemaining < 5000) + { + return true; + } + + if (debuffTimeRemaining < 30000) + { + const GameObject* const crystal = RaidAq20Utils::GetNearestCrystal(*boss); + + if (crystal == nullptr) { - // if buff is active move to crystal - if (RaidAq20Utils::IsOssirianBuffActive(boss)) - return true; - - // if buff is not active a debuff will be, buff becomes active once debuff expires - // so move to crystal when debuff almost done, or based debuff time left and - // distance bot is from crystal (ie: start moving early enough to make it) - int32 debuffTimeRemaining = RaidAq20Utils::GetOssirianDebuffTimeRemaining(boss); - if (debuffTimeRemaining < 5000) - return true; - if (debuffTimeRemaining < 30000) - { - if (GameObject* crystal = RaidAq20Utils::GetNearestCrystal(boss)) - { - float botDist = bot->GetDistance(crystal); - float timeToReach = botDist / bot->GetSpeed(MOVE_RUN); - // bot should ideally activate crystal a ~5 seconds early (due to time it takes for crystal - // to activate) so aim to get there in time to do so - return debuffTimeRemaining - 5000 < timeToReach * 1000.0f; - } - } + return false; } + + float botDist = this->bot->GetDistance(crystal); + float timeToReach = botDist / this->bot->GetSpeed(MOVE_RUN); + // bot should ideally activate crystal a ~5 seconds early (due to time it takes for crystal + // to activate) so aim to get there in time to do so + return debuffTimeRemaining - 5000 < timeToReach * 1000.0f; } + return false; } diff --git a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp index 41637af7b4..fe005820a5 100644 --- a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp +++ b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp @@ -6,33 +6,43 @@ uint32 const OSSIRIAN_BUFF = 25176; uint32 const OSSIRIAN_DEBUFFS[] = {25177, 25178, 25180, 25181, 25183}; uint32 const OSSIRIAN_CRYSTAL_GO_ENTRY = 180619; -bool RaidAq20Utils::IsOssirianBuffActive(Unit* ossirian) +bool RaidAq20Utils::IsOssirianBuffActive(Unit& ossirian) { - return ossirian && ossirian->HasAura(OSSIRIAN_BUFF); + return ossirian.HasAura(OSSIRIAN_BUFF); } -int32 RaidAq20Utils::GetOssirianDebuffTimeRemaining(Unit* ossirian) +int32_t RaidAq20Utils::GetOssirianDebuffTimeRemaining(Unit& ossirian) { - int32 retVal = 0xffffff; - if (ossirian) + int32_t retVal = 0xffffff; + + for (uint32_t debuff : OSSIRIAN_DEBUFFS) { - for (uint32 debuff : OSSIRIAN_DEBUFFS) + const AuraApplication* const auraApplication = ossirian.GetAuraApplication(debuff); + + if (auraApplication == nullptr) + { + continue; + } + + const Aura* const aura = auraApplication->GetBase(); + + if (aura == nullptr) { - if (AuraApplication* auraApplication = ossirian->GetAuraApplication(debuff)) - { - if (Aura* aura = auraApplication->GetBase()) - { - int32 duration = aura->GetDuration(); - if (retVal > duration) - retVal = duration; - } - } + continue; + } + + int32_t duration = aura->GetDuration(); + + if (retVal > duration) + { + retVal = duration; } } + return retVal; } -GameObject* RaidAq20Utils::GetNearestCrystal(Unit* ossirian) +GameObject* RaidAq20Utils::GetNearestCrystal(Unit& ossirian) { - return ossirian ? ossirian->FindNearestGameObject(OSSIRIAN_CRYSTAL_GO_ENTRY, 200.0f) : nullptr; + return ossirian.FindNearestGameObject(OSSIRIAN_CRYSTAL_GO_ENTRY, 200.0f); } diff --git a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.h b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.h index b78340d0e1..bfa6e43c48 100644 --- a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.h +++ b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.h @@ -7,9 +7,9 @@ class RaidAq20Utils { public: - static bool IsOssirianBuffActive(Unit* ossirian); - static int32 GetOssirianDebuffTimeRemaining(Unit* ossirian); - static GameObject* GetNearestCrystal(Unit* ossirian); + static bool IsOssirianBuffActive(Unit& ossirian); + static int32 GetOssirianDebuffTimeRemaining(Unit& ossirian); + static GameObject* GetNearestCrystal(Unit& ossirian); }; #endif From 6bb3597ff93a7deb17c69eeb25463945743cb844 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:50:41 +0100 Subject: [PATCH 175/222] fix: Resolved all warnings in RaidBwlActions.cpp. --- src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp index 54b21791e8..795f6c9e89 100644 --- a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp +++ b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp @@ -2,7 +2,7 @@ #include "Playerbots.h" -bool BwlOnyxiaScaleCloakAuraCheckAction::Execute(Event event) +bool BwlOnyxiaScaleCloakAuraCheckAction::Execute(Event) { bot->AddAura(22683, bot); return true; @@ -10,7 +10,7 @@ bool BwlOnyxiaScaleCloakAuraCheckAction::Execute(Event event) bool BwlOnyxiaScaleCloakAuraCheckAction::isUseful() { return !bot->HasAura(22683); } -bool BwlTurnOffSuppressionDeviceAction::Execute(Event event) +bool BwlTurnOffSuppressionDeviceAction::Execute(Event) { GuidVector gos = AI_VALUE(GuidVector, "nearest game objects"); for (GuidVector::iterator i = gos.begin(); i != gos.end(); i++) @@ -29,4 +29,4 @@ bool BwlTurnOffSuppressionDeviceAction::Execute(Event event) return true; } -bool BwlUseHourglassSandAction::Execute(Event event) { return botAI->CastSpell(23645, bot); } +bool BwlUseHourglassSandAction::Execute(Event) { return botAI->CastSpell(23645, bot); } From 505d734e420dc891665b230d161d24e3ce2f1160 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:51:22 +0100 Subject: [PATCH 176/222] fix: Resolved all warnings in RaidEoEActions.cpp. --- src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp b/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp index 3547388426..0f47adda71 100644 --- a/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp +++ b/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp @@ -2,7 +2,7 @@ #include "RaidEoEActions.h" #include "RaidEoETriggers.h" -bool MalygosPositionAction::Execute(Event event) +bool MalygosPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "malygos"); if (!boss) { return false; } @@ -65,7 +65,7 @@ bool MalygosPositionAction::Execute(Event event) return false; } -bool MalygosTargetAction::Execute(Event event) +bool MalygosTargetAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "malygos"); if (!boss) { return false; } @@ -229,7 +229,7 @@ bool EoEFlyDrakeAction::isPossible() Unit* vehicleBase = bot->GetVehicleBase(); return (vehicleBase && vehicleBase->GetEntry() == NPC_WYRMREST_SKYTALON); } -bool EoEFlyDrakeAction::Execute(Event event) +bool EoEFlyDrakeAction::Execute(Event) { Player* master = botAI->GetMaster(); if (!master) { return false; } @@ -279,7 +279,7 @@ bool EoEDrakeAttackAction::isPossible() return (vehicleBase && vehicleBase->GetEntry() == NPC_WYRMREST_SKYTALON); } -bool EoEDrakeAttackAction::Execute(Event event) +bool EoEDrakeAttackAction::Execute(Event) { vehicleBase = bot->GetVehicleBase(); if (!vehicleBase) @@ -367,8 +367,6 @@ bool EoEDrakeAttackAction::DrakeDpsAction(Unit* target) Unit* vehicleBase = bot->GetVehicleBase(); if (!vehicleBase) { return false; } - Vehicle* veh = bot->GetVehicle(); - uint8 comboPoints = vehicleBase->GetComboPoints(target); if (comboPoints >= 2) { From 93b794f3a77764780b1680cb57de0df862c1d948 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:52:08 +0100 Subject: [PATCH 177/222] fix: Resolved all warnings in RaidGruulsLairHelpers.cpp. --- src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp b/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp index 0c8a23a19c..d10c1c1209 100644 --- a/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp +++ b/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp @@ -95,7 +95,7 @@ namespace GruulsLairHelpers } } - bool IsKroshMageTank(PlayerbotAI* botAI, Player* bot) + bool IsKroshMageTank(PlayerbotAI*, Player* bot) { Group* group = bot->GetGroup(); if (!group) @@ -123,7 +123,7 @@ namespace GruulsLairHelpers return highestHpMage == bot; } - bool IsKigglerMoonkinTank(PlayerbotAI* botAI, Player* bot) + bool IsKigglerMoonkinTank(PlayerbotAI*, Player* bot) { Group* group = bot->GetGroup(); if (!group) From f6d38c040ec8613a252819aeacc9ee37d2622090 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:52:44 +0100 Subject: [PATCH 178/222] fix: Resolved all warnings in RaidIccMultipliers.cpp. --- src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp b/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp index fc02d56bea..c7f25e3317 100644 --- a/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp +++ b/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp @@ -15,7 +15,6 @@ #include "RaidIccActions.h" #include "ReachTargetActions.h" #include "RogueActions.h" -#include "ScriptedCreature.h" #include "ShamanActions.h" #include "UseMeetingStoneAction.h" #include "WarriorActions.h" @@ -25,8 +24,6 @@ // LK global variables namespace { -uint32 g_lastPlagueTime = 0; -bool g_plagueAllowedToCure = false; std::map g_plagueTimes; std::map g_allowCure; std::mutex g_plagueMutex; // Lock before accessing shared variables From a6a39cb7a0e286dc58d132bdb24feddce4bf0768 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:55:52 +0100 Subject: [PATCH 179/222] fix: RaidIccTriggers.cpp. --- .../Raid/Icecrown/Trigger/RaidIccTriggers.cpp | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp b/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp index b34fe003fc..8fdef577ec 100644 --- a/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp +++ b/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp @@ -4,14 +4,9 @@ #include "PlayerbotAIConfig.h" #include "ObjectAccessor.h" #include "GenericTriggers.h" -#include "DungeonStrategyUtils.h" -#include "EventMap.h" #include "Playerbots.h" -#include "ScriptedCreature.h" #include "Trigger.h" -#include "CellImpl.h" #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "Vehicle.h" //Lord Marrogwar @@ -564,10 +559,7 @@ bool IccBqlVampiricBiteTrigger::IsActive() bool IccValkyreSpearTrigger::IsActive() { // Check if there's a spear nearby - if (Creature* spear = bot->FindNearestCreature(NPC_SPEAR, 100.0f)) - return true; - - return false; + return bot->FindNearestCreature(NPC_SPEAR, 100.0f) != nullptr; } bool IccSisterSvalnaTrigger::IsActive() @@ -1107,7 +1099,6 @@ bool IccLichKingShadowTrapTrigger::IsActive() // search for all nearby traps GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs"); std::vector nearbyTraps; - bool needToMove = false; for (auto& npc : npcs) { @@ -1151,15 +1142,21 @@ bool IccLichKingWinterTrigger::IsActive() isCasting = true; bool isWinter = false; - if (boss && boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER1) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER2) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER5) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER6) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER3) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER4) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER7) || - boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER8)) + if (boss + && ( + boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER1) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER2) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER5) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER6) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER3) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER4) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER7) + || boss->FindCurrentSpellBySpellId(SPELL_REMORSELESS_WINTER8) + ) + ) + { isWinter = true; + } if (hasWinterAura || hasWinter2Aura) return true; From 04030a6f09b89163c6de9d5a3524ddaad896d2c0 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:56:45 +0100 Subject: [PATCH 180/222] fix: Resolved all warnings in RaidKarazhanHelpers.cpp. --- src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp b/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp index 821cc67019..037bf2e9e6 100644 --- a/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp +++ b/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp @@ -1,5 +1,4 @@ #include "RaidKarazhanHelpers.h" -#include "RaidKarazhanActions.h" #include "Playerbots.h" #include "RtiTargetValue.h" @@ -381,7 +380,7 @@ namespace KarazhanHelpers return voidZones; } - bool IsSafePosition(float x, float y, float z, const std::vector& hazards, float hazardRadius) + bool IsSafePosition(float x, float y, float, const std::vector& hazards, float hazardRadius) { for (Unit* hazard : hazards) { @@ -412,10 +411,8 @@ namespace KarazhanHelpers { float sx = start.GetPositionX(); float sy = start.GetPositionY(); - float sz = start.GetPositionZ(); float tx = target.GetPositionX(); float ty = target.GetPositionY(); - float tz = target.GetPositionZ(); const float totalDist = start.GetExactDist2d(target.GetPositionX(), target.GetPositionY()); if (totalDist == 0.0f) @@ -426,7 +423,6 @@ namespace KarazhanHelpers float t = checkDist / totalDist; float checkX = sx + (tx - sx) * t; float checkY = sy + (ty - sy) * t; - float checkZ = sz + (tz - sz) * t; for (Unit* hazard : hazards) { const float hx = checkX - hazard->GetPositionX(); From bdc7bd763f22ef96624d151c171bbe50657c828e Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:57:22 +0100 Subject: [PATCH 181/222] fix: Resolved all warnings in RaidMagtheriondMultipliers.cpp. --- .../Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp b/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp index 9580fd923a..cfc0ec2abb 100644 --- a/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp +++ b/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp @@ -59,7 +59,6 @@ float MagtheridonWaitToAttackMultiplier::GetValue(Action* action) float MagtheridonDisableOffTankAssistMultiplier::GetValue(Action* action) { Unit* magtheridon = AI_VALUE2(Unit*, "find target", "magtheridon"); - Unit* channeler = AI_VALUE2(Unit*, "find target", "hellfire channeler"); if (!magtheridon) return 1.0f; From f69be974336c5136e992effd7853ae7a3874207c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:58:06 +0100 Subject: [PATCH 182/222] fix: Resolved all warnings in RaidMagtheridonHelpers.cpp. --- src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp b/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp index dc88d2a192..d7113e9b6b 100644 --- a/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp +++ b/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp @@ -174,7 +174,7 @@ namespace MagtheridonHelpers std::unordered_map spreadWaitTimer; std::unordered_map dpsWaitTimer; - bool IsSafeFromMagtheridonHazards(PlayerbotAI* botAI, Player* bot, float x, float y, float z) + bool IsSafeFromMagtheridonHazards(PlayerbotAI* botAI, Player*, float x, float y, float) { // Debris std::vector debrisHazards; From ad7bac82848bb0cda648700dc66f801180bdf403 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:58:36 +0100 Subject: [PATCH 183/222] fix: Resolved all warnings in RaidMcActions.cpp. --- src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp b/src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp index b18c8b8534..f0a2b99cfb 100644 --- a/src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp +++ b/src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp @@ -2,7 +2,6 @@ #include "Playerbots.h" #include "RtiTargetValue.h" -#include "RaidMcTriggers.h" #include "RaidMcHelpers.h" static constexpr float LIVING_BOMB_DISTANCE = 20.0f; @@ -20,12 +19,12 @@ static constexpr float CORE_RAGER_STEP_DISTANCE = 5.0f; using namespace MoltenCoreHelpers; -bool McMoveFromGroupAction::Execute(Event event) +bool McMoveFromGroupAction::Execute(Event) { return MoveFromGroup(LIVING_BOMB_DISTANCE); } -bool McMoveFromBaronGeddonAction::Execute(Event event) +bool McMoveFromBaronGeddonAction::Execute(Event) { if (Unit* boss = AI_VALUE2(Unit*, "find target", "baron geddon")) { @@ -42,7 +41,7 @@ bool McMoveFromBaronGeddonAction::Execute(Event event) return false; } -bool McShazzrahMoveAwayAction::Execute(Event event) +bool McShazzrahMoveAwayAction::Execute(Event) { if (Unit* boss = AI_VALUE2(Unit*, "find target", "shazzrah")) { @@ -53,7 +52,7 @@ bool McShazzrahMoveAwayAction::Execute(Event event) return false; } -bool McGolemaggMarkBossAction::Execute(Event event) +bool McGolemaggMarkBossAction::Execute(Event) { if (Unit* boss = AI_VALUE2(Unit*, "find target", "golemagg the incinerator")) { @@ -115,7 +114,7 @@ bool McGolemaggTankAction::FindCoreRagers(Unit*& coreRager1, Unit*& coreRager2) return coreRager1 != nullptr && coreRager2 != nullptr; } -bool McGolemaggMainTankAttackGolemaggAction::Execute(Event event) +bool McGolemaggMainTankAttackGolemaggAction::Execute(Event) { // At this point, we know we are not the last living tank in the group. if (Unit* boss = AI_VALUE2(Unit*, "find target", "golemagg the incinerator")) From 26828f1f8b642f52ffba0a1cc7a4eaf42b93e90b Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:59:04 +0100 Subject: [PATCH 184/222] fix: Resolved all warnings in RaidOnyxiaStrategy.cpp. --- src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp b/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp index b1217f59eb..8cee2d1df9 100644 --- a/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp +++ b/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp @@ -24,7 +24,7 @@ void RaidOnyxiaStrategy::InitTriggers(std::vector& triggers) "ony whelps spawn", { NextAction("ony kill whelps", ACTION_RAID + 1) })); } -void RaidOnyxiaStrategy::InitMultipliers(std::vector& multipliers) +void RaidOnyxiaStrategy::InitMultipliers(std::vector&) { // Empty for now } From 9324c692e319c3e73b03063828c8536c7b263197 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 00:59:48 +0100 Subject: [PATCH 185/222] fix: Resolved all warnings in RaidOsActions.cpp. --- .../Raid/ObsidianSanctum/Action/RaidOsActions.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp b/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp index 2ee68bca4b..b9a2670e4a 100644 --- a/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp +++ b/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp @@ -3,14 +3,11 @@ #include "Playerbots.h" -bool SartharionTankPositionAction::Execute(Event event) +bool SartharionTankPositionAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sartharion"); if (!boss) { return false; } - // Unit* shadron = AI_VALUE2(Unit*, "find target", "shadron"); - // Unit* tenebron = AI_VALUE2(Unit*, "find target", "tenebron"); - // Unit* vesperon = AI_VALUE2(Unit*, "find target", "vesperon"); Unit* shadron = nullptr; Unit* tenebron = nullptr; Unit* vesperon = nullptr; @@ -84,7 +81,7 @@ bool SartharionTankPositionAction::Execute(Event event) return false; } -bool AvoidTwilightFissureAction::Execute(Event event) +bool AvoidTwilightFissureAction::Execute(Event) { const float radius = 5.0f; @@ -104,7 +101,7 @@ bool AvoidTwilightFissureAction::Execute(Event event) return false; } -bool AvoidFlameTsunamiAction::Execute(Event event) +bool AvoidFlameTsunamiAction::Execute(Event) { // Adjustable, this is the acceptable distance to stack point that will be accepted as "safe" float looseDistance = 4.0f; @@ -167,7 +164,7 @@ bool AvoidFlameTsunamiAction::Execute(Event event) return false; } -bool SartharionAttackPriorityAction::Execute(Event event) +bool SartharionAttackPriorityAction::Execute(Event) { Unit* sartharion = AI_VALUE2(Unit*, "find target", "sartharion"); Unit* shadron = AI_VALUE2(Unit*, "find target", "shadron"); @@ -206,7 +203,7 @@ bool SartharionAttackPriorityAction::Execute(Event event) return false; } -bool EnterTwilightPortalAction::Execute(Event event) +bool EnterTwilightPortalAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "sartharion"); if (!boss || !boss->HasAura(SPELL_GIFT_OF_TWILIGHT_FIRE)) { return false; } @@ -227,7 +224,7 @@ bool EnterTwilightPortalAction::Execute(Event event) return true; } -bool ExitTwilightPortalAction::Execute(Event event) +bool ExitTwilightPortalAction::Execute(Event) { GameObject* portal = bot->FindNearestGameObject(GO_NORMAL_PORTAL, 100.0f); if (!portal) { return false; } From 6b8187a2a645923b9688167b8cbff0e13dc2ee9f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 01:14:14 +0100 Subject: [PATCH 186/222] fix: Resolved a missing include in OculusActions.cpp. --- src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp | 2 +- src/Ai/Base/Actions/StayActions.cpp | 5 ++--- src/Ai/Dungeon/Oculus/Action/OculusActions.cpp | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp index 17f60dc926..2a92715afa 100644 --- a/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp +++ b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp @@ -73,7 +73,7 @@ void AutoMaintenanceOnLevelupAction::LearnSpells(std::ostringstream* out) LearnQuestSpells(out); } -void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream* out) +void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream*) { PlayerbotFactory factory(bot, bot->GetLevel()); factory.InitSkills(); diff --git a/src/Ai/Base/Actions/StayActions.cpp b/src/Ai/Base/Actions/StayActions.cpp index dbc7abd090..94e4290ac5 100644 --- a/src/Ai/Base/Actions/StayActions.cpp +++ b/src/Ai/Base/Actions/StayActions.cpp @@ -39,7 +39,7 @@ bool StayActionBase::Stay() return true; } -bool StayAction::Execute(Event event) { return Stay(); } +bool StayAction::Execute(Event) { return Stay(); } bool StayAction::isUseful() { @@ -47,7 +47,6 @@ bool StayAction::isUseful() PositionInfo stayPosition = AI_VALUE(PositionMap&, "position")["stay"]; if (stayPosition.isSet()) { - const float distance = bot->GetDistance(stayPosition.x, stayPosition.y, stayPosition.z); if (sPlayerbotAIConfig.followDistance) { return false; @@ -64,7 +63,7 @@ bool StayAction::isUseful() return AI_VALUE2(bool, "moving", "self target"); } -bool SitAction::Execute(Event event) +bool SitAction::Execute(Event) { if (bot->isMoving()) return false; diff --git a/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp index 74c4029dbd..1ea8f87618 100644 --- a/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp +++ b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp @@ -1,3 +1,4 @@ +#include "OculusTriggers.h" #include "Playerbots.h" #include "OculusActions.h" #include "LastSpellCastValue.h" From 2f9e55a7cf247dc963a5e71d5f170d59c2e22f5d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 01:17:08 +0100 Subject: [PATCH 187/222] fix: Resolved all warnings in UnlockTradedItemAction.cpp. --- src/Ai/Base/Actions/UnlockTradedItemAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ai/Base/Actions/UnlockTradedItemAction.cpp b/src/Ai/Base/Actions/UnlockTradedItemAction.cpp index 047cd2e201..fbc527c7a5 100644 --- a/src/Ai/Base/Actions/UnlockTradedItemAction.cpp +++ b/src/Ai/Base/Actions/UnlockTradedItemAction.cpp @@ -1,11 +1,11 @@ #include "UnlockTradedItemAction.h" -#include "Playerbots.h" +#include "PlayerbotAI.h" #include "TradeData.h" #include "SpellInfo.h" -#define PICK_LOCK_SPELL_ID 1804 +inline constexpr uint32_t PICK_LOCK_SPELL_ID = 1804; -bool UnlockTradedItemAction::Execute(Event event) +bool UnlockTradedItemAction::Execute(Event) { Player* trader = bot->GetTrader(); if (!trader) From 205df24cadfdf80e2d77584cdc8622c3a907c2cd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 01:21:00 +0100 Subject: [PATCH 188/222] fix: Resolved all warnings in Arrow.h. --- src/Ai/Base/Value/Arrow.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Ai/Base/Value/Arrow.h b/src/Ai/Base/Value/Arrow.h index 7a14fba4d1..220cb370bd 100644 --- a/src/Ai/Base/Value/Arrow.h +++ b/src/Ai/Base/Value/Arrow.h @@ -16,11 +16,13 @@ class UnitPosition { public: UnitPosition(float x, float y) : x(x), y(y) {} - UnitPosition(UnitPosition const& other) - { - x = other.x; - y = other.y; - } + ~UnitPosition() = default; + + UnitPosition(UnitPosition const& other) = default; + UnitPosition& operator=(UnitPosition const& other) = default; + + UnitPosition(UnitPosition&&) = default; + UnitPosition& operator=(UnitPosition&&) = default; float x, y; }; From b30e7a1577bd7f6d0de9064a763349df6e75f786 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 01:28:05 +0100 Subject: [PATCH 189/222] fix: Resolved all warnings in RaidOnyxiaActions.cpp. --- src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp index 9fa4612bf6..aa2eb31229 100644 --- a/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp +++ b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp @@ -1,4 +1,3 @@ -// RaidOnyxiaActions.cpp #include "RaidOnyxiaActions.h" #include "GenericSpellActions.h" @@ -7,7 +6,7 @@ #include "Playerbots.h" #include "PositionAction.h" -bool RaidOnyxiaMoveToSideAction::Execute(Event event) +bool RaidOnyxiaMoveToSideAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "onyxia"); if (!boss) @@ -38,7 +37,7 @@ bool RaidOnyxiaMoveToSideAction::Execute(Event event) return false; } -bool RaidOnyxiaSpreadOutAction::Execute(Event event) +bool RaidOnyxiaSpreadOutAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "onyxia"); @@ -64,7 +63,7 @@ bool RaidOnyxiaSpreadOutAction::Execute(Event event) return MoveFromGroup(9.0f); // move 9 yards } -bool RaidOnyxiaMoveToSafeZoneAction::Execute(Event event) +bool RaidOnyxiaMoveToSafeZoneAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "onyxia"); if (!boss) @@ -105,7 +104,7 @@ bool RaidOnyxiaMoveToSafeZoneAction::Execute(Event event) false, false, false, false, MovementPriority::MOVEMENT_COMBAT); } -bool RaidOnyxiaKillWhelpsAction::Execute(Event event) +bool RaidOnyxiaKillWhelpsAction::Execute(Event) { Unit* currentTarget = AI_VALUE(Unit*, "current target"); // If already attacking a whelp, don't swap targets @@ -129,7 +128,7 @@ bool RaidOnyxiaKillWhelpsAction::Execute(Event event) return false; } -bool OnyxiaAvoidEggsAction::Execute(Event event) +bool OnyxiaAvoidEggsAction::Execute(Event) { Position botPos = Position(bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ()); From 771af96935d620b10e72c9f2f5b554f82663089a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 01:34:51 +0100 Subject: [PATCH 190/222] fix: Resolved all warnings in RaidUlduarActions.cpp. --- .../Raid/Ulduar/Action/RaidUlduarActions.cpp | 124 ++++++++---------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp index b20425d224..8f25582307 100644 --- a/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp +++ b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp @@ -18,16 +18,14 @@ #include "Playerbots.h" #include "Position.h" #include "RaidUlduarBossHelper.h" -#include "RaidUlduarScripts.h" -#include "RaidUlduarStrategy.h" #include "RtiValue.h" -#include "ScriptedCreature.h" #include "ServerFacade.h" #include "SharedDefines.h" #include "Unit.h" #include "Vehicle.h" #include #include +#include "../../../../../../src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h" const std::string ADD_STRATEGY_CHAR = "+"; const std::string REMOVE_STRATEGY_CHAR = "-"; @@ -50,7 +48,7 @@ const Position yoggPortalLoc[] = { {1960.62f, -32.00f, 325.5f}, {1981.98f, -5.69f, 325.5f}, {1982.78f, -45.73f, 325.5f}, {2000.66f, -29.68f, 325.5f}, {1999.88f, -19.61f, 325.5f}, {1961.37f, -19.54f, 325.5f}}; -bool FlameLeviathanVehicleAction::Execute(Event event) +bool FlameLeviathanVehicleAction::Execute(Event) { vehicleBase_ = bot->GetVehicleBase(); vehicle_ = bot->GetVehicle(); @@ -109,7 +107,7 @@ bool FlameLeviathanVehicleAction::MoveAvoidChasing(Unit* target) return false; if (avoidChaseIdx == -1) { - for (int i = 0; i < corners.size(); i++) + for (uint64_t i = 0; i < corners.size(); i++) { if (bot->GetExactDist(corners[i]) > target->GetExactDist(corners[i])) continue; @@ -272,7 +270,7 @@ bool FlameLeviathanVehicleAction::ChopperAction(Unit* target) return false; } -bool FlameLeviathanEnterVehicleAction::Execute(Event event) +bool FlameLeviathanEnterVehicleAction::Execute(Event) { // do not switch vehicles yet if (bot->GetVehicle()) @@ -417,7 +415,7 @@ bool FlameLeviathanEnterVehicleAction::AllMainVehiclesOnUse() return demolisher >= maxC && siege >= maxC; } -bool RazorscaleAvoidDevouringFlameAction::Execute(Event event) +bool RazorscaleAvoidDevouringFlameAction::Execute(Event) { RazorscaleBossHelper razorscaleHelper(botAI); @@ -498,7 +496,7 @@ bool RazorscaleAvoidDevouringFlameAction::isUseful() return false; // No nearby flames or bot is at a safe distance } -bool RazorscaleAvoidSentinelAction::Execute(Event event) +bool RazorscaleAvoidSentinelAction::Execute(Event) { bool isMainTank = botAI->IsMainTank(bot); bool isRanged = botAI->IsRanged(bot); @@ -620,7 +618,7 @@ bool RazorscaleAvoidSentinelAction::isUseful() return false; } -bool RazorscaleAvoidWhirlwindAction::Execute(Event event) +bool RazorscaleAvoidWhirlwindAction::Execute(Event) { if (botAI->IsTank(bot)) { @@ -737,7 +735,7 @@ bool RazorscaleIgnoreBossAction::isUseful() return false; } -bool RazorscaleIgnoreBossAction::Execute(Event event) +bool RazorscaleIgnoreBossAction::Execute(Event) { if (!bot) { @@ -894,7 +892,7 @@ bool RazorscaleGroundedAction::isUseful() return false; } -bool RazorscaleGroundedAction::Execute(Event event) +bool RazorscaleGroundedAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "razorscale"); if (!boss || !boss->IsAlive() || boss->GetPositionZ() > RazorscaleBossHelper::RAZORSCALE_FLYING_Z_THRESHOLD) @@ -977,7 +975,7 @@ bool RazorscaleGroundedAction::Execute(Event event) return false; } -bool RazorscaleHarpoonAction::Execute(Event event) +bool RazorscaleHarpoonAction::Execute(Event) { if (!bot) { @@ -1145,7 +1143,7 @@ bool RazorscaleFuseArmorAction::isUseful() return false; } -bool RazorscaleFuseArmorAction::Execute(Event event) +bool RazorscaleFuseArmorAction::Execute(Event) { // We already know from isUseful() that: // 1) This bot can tank, AND @@ -1164,7 +1162,7 @@ bool IronAssemblyLightningTendrilsAction::isUseful() return ironAssemblyLightningTendrilsTrigger.IsActive(); } -bool IronAssemblyLightningTendrilsAction::Execute(Event event) +bool IronAssemblyLightningTendrilsAction::Execute(Event) { const float radius = 18.0f + 10.0f; // 18 yards + 10 yards for safety @@ -1188,7 +1186,7 @@ bool IronAssemblyOverloadAction::isUseful() return ironAssemblyOverloadTrigger.IsActive(); } -bool IronAssemblyOverloadAction::Execute(Event event) +bool IronAssemblyOverloadAction::Execute(Event) { const float radius = 20.0f + 5.0f; // 20 yards + 5 yards for safety @@ -1212,7 +1210,7 @@ bool IronAssemblyRuneOfPowerAction::isUseful() return ironAssemblyRuneOfPowerTrigger.IsActive(); } -bool IronAssemblyRuneOfPowerAction::Execute(Event event) +bool IronAssemblyRuneOfPowerAction::Execute(Event) { Unit* target = botAI->GetUnit(bot->GetTarget()); if (!target || !target->IsAlive()) @@ -1227,7 +1225,7 @@ bool KologarnMarkDpsTargetAction::isUseful() return kologarnMarkDpsTargetTrigger.IsActive(); } -bool KologarnMarkDpsTargetAction::Execute(Event event) +bool KologarnMarkDpsTargetAction::Execute(Event) { Unit* targetToMark = nullptr; Unit* additionalTargetToMark = nullptr; @@ -1249,7 +1247,6 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) if (!target) continue; - uint32 creatureId = target->GetEntry(); if (target->GetEntry() == NPC_RUBBLE && target->IsAlive()) { targetToMark = target; @@ -1362,7 +1359,7 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) return false; } -bool KologarnFallFromFloorAction::Execute(Event event) +bool KologarnFallFromFloorAction::Execute(Event) { return bot->TeleportTo(bot->GetMapId(), ULDUAR_KOLOGARN_RESTORE_POSITION.GetPositionX(), ULDUAR_KOLOGARN_RESTORE_POSITION.GetPositionY(), @@ -1376,7 +1373,7 @@ bool KologarnFallFromFloorAction::isUseful() return kologarnFallFromFloorTrigger.IsActive(); } -bool KologarnRubbleSlowdownAction::Execute(Event event) +bool KologarnRubbleSlowdownAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -1391,7 +1388,7 @@ bool KologarnRubbleSlowdownAction::Execute(Event event) return botAI->CastSpell("frost trap", currentSkullUnit); } -bool KologarnEyebeamAction::Execute(Event event) +bool KologarnEyebeamAction::Execute(Event) { float distanceToLeftPoint = bot->GetExactDist(ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION); float distanceToRightPoint = bot->GetExactDist(ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION); @@ -1450,7 +1447,7 @@ bool KologarnRtiTargetAction::isUseful() return kologarnRtiTargetTrigger.IsActive(); } -bool KologarnRtiTargetAction::Execute(Event event) +bool KologarnRtiTargetAction::Execute(Event) { if (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0)) { @@ -1473,13 +1470,13 @@ bool KologarnCrunchArmorAction::isUseful() return botAI->HasCheat(BotCheatMask::raid); } -bool KologarnCrunchArmorAction::Execute(Event event) +bool KologarnCrunchArmorAction::Execute(Event) { bot->RemoveAura(SPELL_CRUNCH_ARMOR); return true; } -bool AuriayaFallFromFloorAction::Execute(Event event) +bool AuriayaFallFromFloorAction::Execute(Event) { Player* master = botAI->GetMaster(); @@ -1525,7 +1522,7 @@ bool HodirMoveSnowpackedIcicleAction::isUseful() return true; } -bool HodirMoveSnowpackedIcicleAction::Execute(Event event) +bool HodirMoveSnowpackedIcicleAction::Execute(Event) { Creature* target = bot->FindNearestCreature(NPC_SNOWPACKED_ICICLE, 100.0f); if (!target) @@ -1535,7 +1532,7 @@ bool HodirMoveSnowpackedIcicleAction::Execute(Event event) false, false, true, MovementPriority::MOVEMENT_NORMAL, true); } -bool HodirBitingColdJumpAction::Execute(Event event) +bool HodirBitingColdJumpAction::Execute(Event) { bot->RemoveAurasDueToSpell(SPELL_BITING_COLD_PLAYER_AURA); @@ -1591,7 +1588,7 @@ bool FreyaMoveAwayNatureBombAction::isUseful() return true; } -bool FreyaMoveAwayNatureBombAction::Execute(Event event) +bool FreyaMoveAwayNatureBombAction::Execute(Event) { GameObject* target = bot->FindNearestGameObject(GOBJECT_NATURE_BOMB, 12.0f); if (!target) @@ -1606,7 +1603,7 @@ bool FreyaMarkDpsTargetAction::isUseful() return freyaMarkDpsTargetTrigger.IsActive(); } -bool FreyaMarkDpsTargetAction::Execute(Event event) +bool FreyaMarkDpsTargetAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "freya"); if (!boss || !boss->IsAlive()) @@ -1762,7 +1759,7 @@ bool FreyaMoveToHealingSporeAction::isUseful() return freyaMoveToHealingSporeTrigger.IsActive(); } -bool FreyaMoveToHealingSporeAction::Execute(Event event) +bool FreyaMoveToHealingSporeAction::Execute(Event) { GuidVector targets = AI_VALUE(GuidVector, "nearest npcs"); Creature* nearestSpore = nullptr; @@ -1804,7 +1801,7 @@ bool ThorimUnbalancingStrikeAction::isUseful() return botAI->HasCheat(BotCheatMask::raid); } -bool ThorimUnbalancingStrikeAction::Execute(Event event) +bool ThorimUnbalancingStrikeAction::Execute(Event) { bot->RemoveAura(SPELL_UNBALANCING_STRIKE); return true; @@ -1816,7 +1813,7 @@ bool ThorimMarkDpsTargetAction::isUseful() return thorimMarkDpsTargetTrigger.IsActive(); } -bool ThorimMarkDpsTargetAction::Execute(Event event) +bool ThorimMarkDpsTargetAction::Execute(Event) { Unit* targetToMark = nullptr; @@ -1917,7 +1914,7 @@ bool ThorimArenaPositioningAction::isUseful() return thorimArenaPositioningTrigger.IsActive(); } -bool ThorimArenaPositioningAction::Execute(Event event) +bool ThorimArenaPositioningAction::Execute(Event) { FollowMasterStrategy followMasterStrategy(botAI); @@ -1939,7 +1936,7 @@ bool ThorimGauntletPositioningAction::isUseful() return thorimGauntletPositioningTrigger.IsActive(); } -bool ThorimGauntletPositioningAction::Execute(Event event) +bool ThorimGauntletPositioningAction::Execute(Event) { FollowMasterStrategy followMasterStrategy(botAI); @@ -2113,7 +2110,7 @@ bool ThorimGauntletPositioningAction::Execute(Event event) return false; } -bool ThorimFallFromFloorAction::Execute(Event event) +bool ThorimFallFromFloorAction::Execute(Event) { Player* master = botAI->GetMaster(); @@ -2130,7 +2127,7 @@ bool ThorimFallFromFloorAction::isUseful() return thorimFallFromFloorTrigger.IsActive(); } -bool ThorimPhase2PositioningAction::Execute(Event event) +bool ThorimPhase2PositioningAction::Execute(Event) { Position targetPosition; bool backward = false; @@ -2190,7 +2187,7 @@ bool ThorimPhase2PositioningAction::isUseful() return thorimPhase2PositioningTrigger.IsActive(); } -bool MimironShockBlastAction::Execute(Event event) +bool MimironShockBlastAction::Execute(Event) { Unit* leviathanMkII = nullptr; Unit* vx001 = nullptr; @@ -2264,7 +2261,7 @@ bool MimironShockBlastAction::isUseful() return mimironShockBlastTrigger.IsActive(); } -bool MimironPhase1PositioningAction::Execute(Event event) +bool MimironPhase1PositioningAction::Execute(Event) { SET_AI_VALUE(float, "disperse distance", 6.0f); return true; @@ -2276,7 +2273,7 @@ bool MimironPhase1PositioningAction::isUseful() return mimironPhase1PositioningTrigger.IsActive(); } -bool MimironP3Wx2LaserBarrageAction::Execute(Event event) +bool MimironP3Wx2LaserBarrageAction::Execute(Event) { auto master = botAI->GetMaster(); if (!master || !master->IsAlive()) @@ -2300,7 +2297,7 @@ bool MimironRapidBurstAction::isUseful() return mimironRapidBurstTrigger.IsActive(); } -bool MimironRapidBurstAction::Execute(Event event) +bool MimironRapidBurstAction::Execute(Event) { Unit* leviathanMkII = nullptr; @@ -2407,7 +2404,7 @@ bool MimironRapidBurstAction::Execute(Event event) return true; } -bool MimironAerialCommandUnitAction::Execute(Event event) +bool MimironAerialCommandUnitAction::Execute(Event) { Unit* boss = nullptr; Unit* bombBot = nullptr; @@ -2479,9 +2476,8 @@ bool MimironRocketStrikeAction::isUseful() return mimironRocketStrikeTrigger.IsActive(); } -bool MimironRocketStrikeAction::Execute(Event event) +bool MimironRocketStrikeAction::Execute(Event) { - Unit* leviathanMkII = nullptr; Unit* vx001 = nullptr; Unit* aerialCommandUnit = nullptr; @@ -2493,11 +2489,7 @@ bool MimironRocketStrikeAction::Execute(Event event) if (!target || !target->IsAlive()) continue; - if (target->GetEntry() == NPC_LEVIATHAN_MKII) - { - leviathanMkII = target; - } - else if (target->GetEntry() == NPC_VX001) + if (target->GetEntry() == NPC_VX001) { vx001 = target; } @@ -2540,7 +2532,7 @@ bool MimironRocketStrikeAction::Execute(Event event) } } -bool MimironPhase4MarkDpsAction::Execute(Event event) +bool MimironPhase4MarkDpsAction::Execute(Event) { Unit* leviathanMkII = nullptr; Unit* vx001 = nullptr; @@ -2629,7 +2621,7 @@ bool MimironPhase4MarkDpsAction::Execute(Event event) } } -bool MimironCheatAction::Execute(Event event) +bool MimironCheatAction::Execute(Event) { GuidVector targets = AI_VALUE(GuidVector, "nearest npcs"); for (const ObjectGuid& guid : targets) @@ -2651,7 +2643,7 @@ bool MimironCheatAction::Execute(Event event) return true; } -bool VezaxCheatAction::Execute(Event event) +bool VezaxCheatAction::Execute(Event) { // Restore bot's mana to full uint32 maxMana = bot->GetMaxPower(POWER_MANA); @@ -2663,7 +2655,7 @@ bool VezaxCheatAction::Execute(Event event) return true; } -bool VezaxShadowCrashAction::Execute(Event event) +bool VezaxShadowCrashAction::Execute(Event) { // Find General Vezax boss Unit* boss = AI_VALUE2(Unit*, "find target", "general vezax"); @@ -2707,7 +2699,7 @@ bool VezaxShadowCrashAction::Execute(Event event) true); } -bool VezaxMarkOfTheFacelessAction::Execute(Event event) +bool VezaxMarkOfTheFacelessAction::Execute(Event) { return MoveTo(bot->GetMapId(), ULDUAR_VEZAX_MARK_OF_THE_FACELESS_SPOT.GetPositionX(), ULDUAR_VEZAX_MARK_OF_THE_FACELESS_SPOT.GetPositionY(), @@ -2715,7 +2707,7 @@ bool VezaxMarkOfTheFacelessAction::Execute(Event event) MovementPriority::MOVEMENT_FORCED, true, false); } -bool YoggSaronOminousCloudCheatAction::Execute(Event event) +bool YoggSaronOminousCloudCheatAction::Execute(Event) { YoggSaronTrigger yoggSaronTrigger(botAI); @@ -2735,14 +2727,14 @@ bool YoggSaronOminousCloudCheatAction::Execute(Event event) return true; } -bool YoggSaronGuardianPositioningAction::Execute(Event event) +bool YoggSaronGuardianPositioningAction::Execute(Event) { return MoveTo(bot->GetMapId(), ULDUAR_YOGG_SARON_MIDDLE.GetPositionX(), ULDUAR_YOGG_SARON_MIDDLE.GetPositionY(), ULDUAR_YOGG_SARON_MIDDLE.GetPositionZ(), false, false, false, true, MovementPriority::MOVEMENT_FORCED, true, false); } -bool YoggSaronSanityAction::Execute(Event event) +bool YoggSaronSanityAction::Execute(Event) { Creature* sanityWell = bot->FindNearestCreature(NPC_SANITY_WELL, 200.0f); @@ -2751,7 +2743,7 @@ bool YoggSaronSanityAction::Execute(Event event) true, false); } -bool YoggSaronMarkTargetAction::Execute(Event event) +bool YoggSaronMarkTargetAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -2820,7 +2812,7 @@ bool YoggSaronMarkTargetAction::Execute(Event event) GuidVector targets = AI_VALUE(GuidVector, "nearest npcs"); - int lowestHealth = std::numeric_limits::max(); + uint64_t lowestHealth = std::numeric_limits::max(); Unit* lowestHealthUnit = nullptr; for (const ObjectGuid& guid : targets) { @@ -2880,7 +2872,7 @@ bool YoggSaronMarkTargetAction::Execute(Event event) return false; } -bool YoggSaronBrainLinkAction::Execute(Event event) +bool YoggSaronBrainLinkAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -2900,7 +2892,7 @@ bool YoggSaronBrainLinkAction::Execute(Event event) return false; } -bool YoggSaronMoveToEnterPortalAction::Execute(Event event) +bool YoggSaronMoveToEnterPortalAction::Execute(Event) { Group* group = bot->GetGroup(); if (!group) @@ -2969,7 +2961,7 @@ bool YoggSaronMoveToEnterPortalAction::Execute(Event event) } } -bool YoggSaronFallFromFloorAction::Execute(Event event) +bool YoggSaronFallFromFloorAction::Execute(Event) { std::string rtiMark = AI_VALUE(std::string, "rti"); if (rtiMark == "skull") @@ -3001,7 +2993,7 @@ bool YoggSaronFallFromFloorAction::Execute(Event event) return false; } -bool YoggSaronBossRoomMovementCheatAction::Execute(Event event) +bool YoggSaronBossRoomMovementCheatAction::Execute(Event) { FollowMasterStrategy followMasterStrategy(botAI); if (botAI->HasStrategy(followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT)) @@ -3037,7 +3029,7 @@ bool YoggSaronBossRoomMovementCheatAction::Execute(Event event) currentSkullUnit->GetPositionZ(), bot->GetOrientation()); } -bool YoggSaronUsePortalAction::Execute(Event event) +bool YoggSaronUsePortalAction::Execute(Event) { Creature* assignedPortal = bot->FindNearestCreature(NPC_DESCEND_INTO_MADNESS, 2.0f, true); if (!assignedPortal) @@ -3054,7 +3046,7 @@ bool YoggSaronUsePortalAction::Execute(Event event) return assignedPortal->HandleSpellClick(bot); } -bool YoggSaronIllusionRoomAction::Execute(Event event) +bool YoggSaronIllusionRoomAction::Execute(Event) { YoggSaronTrigger yoggSaronTrigger(botAI); @@ -3176,7 +3168,7 @@ bool YoggSaronIllusionRoomAction::SetBrainRtiTarget(YoggSaronTrigger yoggSaronTr return true; } -bool YoggSaronMoveToExitPortalAction::Execute(Event event) +bool YoggSaronMoveToExitPortalAction::Execute(Event) { GameObject* portal = bot->FindNearestGameObject(GO_FLEE_TO_THE_SURFACE_PORTAL, 100.0f); if (!portal) @@ -3207,7 +3199,7 @@ bool YoggSaronMoveToExitPortalAction::Execute(Event event) return true; } -bool YoggSaronLunaticGazeAction::Execute(Event event) +bool YoggSaronLunaticGazeAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "yogg-saron"); if (!boss || !boss->IsAlive()) @@ -3229,7 +3221,7 @@ bool YoggSaronLunaticGazeAction::Execute(Event event) return true; } -bool YoggSaronPhase3PositioningAction::Execute(Event event) +bool YoggSaronPhase3PositioningAction::Execute(Event) { if (botAI->IsRanged(bot)) { From 076dedb6ab4cb0436022d43068087c1828fb6701 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:28:54 +0100 Subject: [PATCH 191/222] fix: Small refactor of ItemUsageValue.cpp. --- src/Ai/Base/Value/ItemUsageValue.cpp | 115 +++++++++++++++++---------- src/Ai/Base/Value/ItemUsageValue.h | 8 +- 2 files changed, 79 insertions(+), 44 deletions(-) diff --git a/src/Ai/Base/Value/ItemUsageValue.cpp b/src/Ai/Base/Value/ItemUsageValue.cpp index 6f48fa9739..b0dcddb706 100644 --- a/src/Ai/Base/Value/ItemUsageValue.cpp +++ b/src/Ai/Base/Value/ItemUsageValue.cpp @@ -56,7 +56,7 @@ ItemUsage ItemUsageValue::Calculate() if (proto->Class == ITEM_CLASS_TRADE_GOODS || proto->Class == ITEM_CLASS_MISC || proto->Class == ITEM_CLASS_REAGENT) - needItem = IsItemNeededForUsefullSpell(proto, lowBagSpace); + needItem = IsItemNeededForUsefullSpell(*proto, lowBagSpace); else if (proto->Class == ITEM_CLASS_RECIPE) { if (bot->HasSpell(proto->Spells[2].SpellId)) @@ -79,8 +79,10 @@ ItemUsage ItemUsageValue::Calculate() if (proto->Class == ITEM_CLASS_KEY) return ITEM_USAGE_USE; + const uint32_t maxCount = proto->MaxCount; + if (proto->Class == ITEM_CLASS_CONSUMABLE && - (proto->MaxCount == 0 || bot->GetItemCount(itemId, false) < proto->MaxCount)) + (maxCount == 0 || bot->GetItemCount(itemId, false) < maxCount)) { std::string const foodType = GetConsumableType(proto, bot->GetPower(POWER_MANA)); @@ -695,57 +697,86 @@ bool ItemUsageValue::IsItemUsefulForSkill(ItemTemplate const* proto) return false; } -bool ItemUsageValue::IsItemNeededForUsefullSpell(ItemTemplate const* proto, bool checkAllReagents) +bool ItemUsageValue::IsItemNeededForUsefullSpell(const ItemTemplate& itemTemplate, bool checkAllReagents) const { - for (auto spellId : SpellsUsingItem(proto->ItemId, bot)) + for (uint32_t spellId : SpellsUsingItem(itemTemplate.ItemId, bot)) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo) + const SpellInfo* const spellInfo = SpellMgr::instance()->GetSpellInfo(spellId); + + if (spellInfo == nullptr) + { continue; + } - if (checkAllReagents && !HasItemsNeededForSpell(spellId, proto)) + if (checkAllReagents && !this->HasItemsNeededForSpell(spellId, itemTemplate)) + { continue; + } - if (SpellGivesSkillUp(spellId, bot)) + if (this->SpellGivesSkillUp(spellId, bot)) + { return true; + } - uint32 newItemId = spellInfo->Effects[EFFECT_0].ItemType; - if (newItemId && newItemId != proto->ItemId) + const uint32_t newItemId = spellInfo->Effects[EFFECT_0].ItemType; + + if (newItemId == 0 || newItemId == itemTemplate.ItemId) { - ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", newItemId); + continue; + } - if (usage != ITEM_USAGE_REPLACE && usage != ITEM_USAGE_EQUIP && usage != ITEM_USAGE_AMMO && - usage != ITEM_USAGE_QUEST && usage != ITEM_USAGE_SKILL && usage != ITEM_USAGE_USE) - continue; + const ItemUsage usage = this->context->GetValue("item usage", newItemId)->Get(); - return true; + if (usage != ITEM_USAGE_REPLACE + && usage != ITEM_USAGE_EQUIP + && usage != ITEM_USAGE_AMMO + && usage != ITEM_USAGE_QUEST + && usage != ITEM_USAGE_SKILL + && usage != ITEM_USAGE_USE + ) + { + continue; } + + return true; } return false; } -bool ItemUsageValue::HasItemsNeededForSpell(uint32 spellId, ItemTemplate const* proto) +bool ItemUsageValue::HasItemsNeededForSpell(uint32_t spellId, const ItemTemplate& itemTemplate) const { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo) + const SpellInfo* const spellInfo = SpellMgr::instance()->GetSpellInfo(spellId); + + if (spellInfo == nullptr) + { return false; + } - for (uint8 i = 0; i < MAX_SPELL_REAGENTS; i++) - if (spellInfo->ReagentCount[i] > 0 && spellInfo->Reagent[i]) + for (uint8_t i = 0; i < MAX_SPELL_REAGENTS; i++) + { + if (spellInfo->ReagentCount[i] < 1 || spellInfo->Reagent[i] == 0) { - if (proto && proto->ItemId == spellInfo->Reagent[i] && - spellInfo->ReagentCount[i] == 1) // If we only need 1 item then current item does not need to be - // checked since we are looting/buying or already have it. - continue; + continue; + } + + const int64_t itemTemplateId = itemTemplate.ItemId; - ItemTemplate const* reqProto = sObjectMgr->GetItemTemplate(spellInfo->Reagent[i]); + // If we only need 1 item then current item does not need to be + // checked since we are looting/buying or already have it. + if (itemTemplateId == spellInfo->Reagent[i] && spellInfo->ReagentCount[i] == 1) + { + continue; + } - uint32 count = AI_VALUE2(uint32, "item count", reqProto->Name1); + const ItemTemplate* const requiredItemTemplate = ObjectMgr::instance()->GetItemTemplate(spellInfo->Reagent[i]); + const uint32_t count = this->context->GetValue("item count", requiredItemTemplate->Name1)->Get(); - if (count < spellInfo->ReagentCount[i]) - return false; + if (count < spellInfo->ReagentCount[i]) + { + return false; } + } return true; } @@ -809,7 +840,7 @@ float ItemUsageValue::BetterStacks(ItemTemplate const* proto, std::string const return stacks; } -std::vector ItemUsageValue::SpellsUsingItem(uint32 itemId, Player* bot) +std::vector ItemUsageValue::SpellsUsingItem(int64_t itemId, Player* bot) { std::vector retSpells; @@ -854,23 +885,27 @@ inline int32 SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLe return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_ORANGE) * 10; } -bool ItemUsageValue::SpellGivesSkillUp(uint32 spellId, Player* bot) +bool ItemUsageValue::SpellGivesSkillUp(const uint32_t spellId, const Player* const bot) { - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); + const SkillLineAbilityMapBounds bounds = SpellMgr::instance()->GetSkillLineAbilityMapBounds(spellId); - for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) + for (SkillLineAbilityMap::const_iterator spellIterator = bounds.first; spellIterator != bounds.second; ++spellIterator) { - SkillLineAbilityEntry const* skill = _spell_idx->second; - if (skill->SkillLine) + const SkillLineAbilityEntry* const skill = spellIterator->second; + + if (skill->SkillLine == 0) { - uint32 SkillValue = bot->GetPureSkillValue(skill->SkillLine); + continue; + } - uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); + const uint32_t SkillValue = bot->GetPureSkillValue(skill->SkillLine); - if (SkillGainChance(SkillValue, skill->TrivialSkillLineRankHigh, - (skill->TrivialSkillLineRankHigh + skill->TrivialSkillLineRankLow) / 2, - skill->TrivialSkillLineRankLow) > 0) - return true; + if (SkillGainChance(SkillValue, skill->TrivialSkillLineRankHigh, + (skill->TrivialSkillLineRankHigh + skill->TrivialSkillLineRankLow) / 2, + skill->TrivialSkillLineRankLow) > 0 + ) + { + return true; } } diff --git a/src/Ai/Base/Value/ItemUsageValue.h b/src/Ai/Base/Value/ItemUsageValue.h index d50ea1b060..27cc724b72 100644 --- a/src/Ai/Base/Value/ItemUsageValue.h +++ b/src/Ai/Base/Value/ItemUsageValue.h @@ -48,15 +48,15 @@ class ItemUsageValue : public CalculatedValue, public Qualified bool IsItemUsefulForQuest(Player* player, ItemTemplate const* proto); bool IsItemNeededForSkill(ItemTemplate const* proto); bool IsItemUsefulForSkill(ItemTemplate const* proto); - bool IsItemNeededForUsefullSpell(ItemTemplate const* proto, bool checkAllReagents = false); - bool HasItemsNeededForSpell(uint32 spellId, ItemTemplate const* proto); + bool IsItemNeededForUsefullSpell(const ItemTemplate& proto, bool checkAllReagents = false) const; + bool HasItemsNeededForSpell(uint32_t spellId, const ItemTemplate& proto) const; Item* CurrentItem(ItemTemplate const* proto); float CurrentStacks(ItemTemplate const* proto); float BetterStacks(ItemTemplate const* proto, std::string const usageType = ""); public: - static std::vector SpellsUsingItem(uint32 itemId, Player* bot); - static bool SpellGivesSkillUp(uint32 spellId, Player* bot); + static std::vector SpellsUsingItem(int64_t itemId, Player* bot); + static bool SpellGivesSkillUp(const uint32_t spellId, const Player* const bot); static std::string const GetConsumableType(ItemTemplate const* proto, bool hasMana); }; From f1f39d11c999887f118dbcf01a02bc4ae49791f7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:33:31 +0100 Subject: [PATCH 192/222] fix: Resolved all warnings in ShamanTriggers.h and refactored the constructor. --- .../Shaman/Strategy/TotemsShamanStrategy.h | 1 - src/Ai/Class/Shaman/Trigger/ShamanTriggers.h | 41 ++++++++----------- src/Bot/Engine/Trigger/Trigger.h | 1 - 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h index 6d36f4a271..60488740c6 100644 --- a/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h +++ b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h @@ -7,7 +7,6 @@ #define _PLAYERBOT_TOTEMSSHAMANSTRATEGY_H #include "GenericShamanStrategy.h" -#include #include #include diff --git a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h index abf4ed566c..9e1a86aace 100644 --- a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h +++ b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h @@ -10,9 +10,7 @@ #include "GenericTriggers.h" #include "SharedDefines.h" #include "Trigger.h" -#include #include "TotemsShamanStrategy.h" -#include "Player.h" #include "PlayerbotAI.h" #include @@ -361,10 +359,8 @@ class SetTotemTrigger : public Trigger public: // Template constructor: infers N (size of the id array) at compile time template - SetTotemTrigger(PlayerbotAI* ai, std::string const& spellName, uint32 requiredSpellId, - const uint32 (&ids)[N], int actionButtonId) + SetTotemTrigger(PlayerbotAI* ai, std::string const& spellName, const uint32 (&ids)[N], int actionButtonId) : Trigger(ai, "set " + spellName) - , requiredSpellId(requiredSpellId) , totemSpellIds(ids) , totemSpellIdsCount(N) , actionButtonId(actionButtonId) @@ -372,7 +368,6 @@ class SetTotemTrigger : public Trigger bool IsActive() override; private: - uint32 requiredSpellId; uint32 const* totemSpellIds; size_t totemSpellIdsCount; int actionButtonId; @@ -382,119 +377,119 @@ class SetStrengthOfEarthTotemTrigger : public SetTotemTrigger { public: SetStrengthOfEarthTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "strength of earth totem", SPELL_STRENGTH_OF_EARTH_TOTEM_RANK_1, STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + : SetTotemTrigger(ai, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetStoneskinTotemTrigger : public SetTotemTrigger { public: SetStoneskinTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "stoneskin totem", SPELL_STONESKIN_TOTEM_RANK_1, STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + : SetTotemTrigger(ai, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetTremorTotemTrigger : public SetTotemTrigger { public: SetTremorTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "tremor totem", SPELL_TREMOR_TOTEM_RANK_1, TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + : SetTotemTrigger(ai, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetEarthbindTotemTrigger : public SetTotemTrigger { public: SetEarthbindTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "earthbind totem", SPELL_EARTHBIND_TOTEM_RANK_1, EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + : SetTotemTrigger(ai, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetSearingTotemTrigger : public SetTotemTrigger { public: SetSearingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "searing totem", SPELL_SEARING_TOTEM_RANK_1, SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + : SetTotemTrigger(ai, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetMagmaTotemTrigger : public SetTotemTrigger { public: SetMagmaTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "magma totem", SPELL_MAGMA_TOTEM_RANK_1, MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + : SetTotemTrigger(ai, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetFlametongueTotemTrigger : public SetTotemTrigger { public: SetFlametongueTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "flametongue totem", SPELL_FLAMETONGUE_TOTEM_RANK_1, FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + : SetTotemTrigger(ai, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetTotemOfWrathTrigger : public SetTotemTrigger { public: SetTotemOfWrathTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "totem of wrath", SPELL_TOTEM_OF_WRATH_RANK_1, TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} + : SetTotemTrigger(ai, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} }; class SetFrostResistanceTotemTrigger : public SetTotemTrigger { public: SetFrostResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "frost resistance totem", SPELL_FROST_RESISTANCE_TOTEM_RANK_1, FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + : SetTotemTrigger(ai, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetHealingStreamTotemTrigger : public SetTotemTrigger { public: SetHealingStreamTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "healing stream totem", SPELL_HEALING_STREAM_TOTEM_RANK_1, HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} + : SetTotemTrigger(ai, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetManaSpringTotemTrigger : public SetTotemTrigger { public: SetManaSpringTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "mana spring totem", SPELL_MANA_SPRING_TOTEM_RANK_1, MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + : SetTotemTrigger(ai, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetCleansingTotemTrigger : public SetTotemTrigger { public: SetCleansingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "cleansing totem", SPELL_CLEANSING_TOTEM_RANK_1, CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + : SetTotemTrigger(ai, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetFireResistanceTotemTrigger : public SetTotemTrigger { public: SetFireResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "fire resistance totem", SPELL_FIRE_RESISTANCE_TOTEM_RANK_1, FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} + : SetTotemTrigger(ai, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetWrathOfAirTotemTrigger : public SetTotemTrigger { public: SetWrathOfAirTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "wrath of air totem", SPELL_WRATH_OF_AIR_TOTEM_RANK_1, WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} + : SetTotemTrigger(ai, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetWindfuryTotemTrigger : public SetTotemTrigger { public: SetWindfuryTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "windfury totem", SPELL_WINDFURY_TOTEM_RANK_1, WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} + : SetTotemTrigger(ai, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetNatureResistanceTotemTrigger : public SetTotemTrigger { public: SetNatureResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "nature resistance totem", SPELL_NATURE_RESISTANCE_TOTEM_RANK_1, NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} + : SetTotemTrigger(ai, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetGroundingTotemTrigger : public SetTotemTrigger { public: SetGroundingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "grounding totem", SPELL_GROUNDING_TOTEM_RANK_1, GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} + : SetTotemTrigger(ai, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; #endif diff --git a/src/Bot/Engine/Trigger/Trigger.h b/src/Bot/Engine/Trigger/Trigger.h index d32845dc52..8878530f8d 100644 --- a/src/Bot/Engine/Trigger/Trigger.h +++ b/src/Bot/Engine/Trigger/Trigger.h @@ -6,7 +6,6 @@ #pragma once #include "Action.h" -#include "Common.h" class PlayerbotAI; class Unit; From a64b2002ddbf8aae48df5cacf02d7636a2f37745 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:34:38 +0100 Subject: [PATCH 193/222] fix: Resolved all warnings in NewRpgInfo.cpp. --- src/Ai/World/Rpg/NewRpgInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ai/World/Rpg/NewRpgInfo.cpp b/src/Ai/World/Rpg/NewRpgInfo.cpp index 889fb1ff92..895f26306c 100644 --- a/src/Ai/World/Rpg/NewRpgInfo.cpp +++ b/src/Ai/World/Rpg/NewRpgInfo.cpp @@ -66,7 +66,7 @@ void NewRpgInfo::ChangeToIdle() status = RPG_IDLE; } -bool NewRpgInfo::CanChangeTo(NewRpgStatus status) { return true; } +bool NewRpgInfo::CanChangeTo(NewRpgStatus) { return true; } void NewRpgInfo::Reset() { From ec2a6822b00be9e2e2755ad66f237739a9cf1587 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:35:18 +0100 Subject: [PATCH 194/222] fix: Resolved all warnings in RaidUlduarMultipliers.cpp. --- .../Multiplier/RaidUlduarMultipliers.cpp | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp b/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp index 0a51ca407b..28889301b2 100644 --- a/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp +++ b/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp @@ -1,28 +1,6 @@ #include "RaidUlduarMultipliers.h" -#include "ChooseTargetActions.h" -#include "DKActions.h" -#include "DruidActions.h" -#include "DruidBearActions.h" -#include "FollowActions.h" -#include "GenericActions.h" -#include "GenericSpellActions.h" -#include "HunterActions.h" -#include "MageActions.h" -#include "MovementActions.h" -#include "PaladinActions.h" -#include "PriestActions.h" -#include "RaidUlduarActions.h" -#include "ReachTargetActions.h" -#include "RogueActions.h" -#include "ScriptedCreature.h" -#include "ShamanActions.h" -#include "UseMeetingStoneAction.h" -#include "WarriorActions.h" - -float FlameLeviathanMultiplier::GetValue(Action* action) +float FlameLeviathanMultiplier::GetValue(Action*) { - // if (dynamic_cast(action)) - // return 0.0f; return 1.0f; } From 4f9bc100e8beba07c5e3fdf3e50ddad6bbb307f7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:35:59 +0100 Subject: [PATCH 195/222] fix: Resolved all warnings in RaidVoAActions.cpp. --- src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp b/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp index 05d6328e5c..14bd727784 100644 --- a/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp +++ b/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp @@ -10,7 +10,7 @@ const Position VOA_EMALON_RESTORE_POSITION = Position(-221.8f, -243.8f, 96.8f, 4.7f); -bool EmalonMarkBossAction::Execute(Event event) +bool EmalonMarkBossAction::Execute(Event) { Unit* boss = AI_VALUE2(Unit*, "find target", "emalon the storm watcher"); if (!boss || !boss->IsAlive()) @@ -72,7 +72,7 @@ bool EmalonMarkBossAction::isUseful() return emalonMarkBossTrigger.IsActive(); } -bool EmalonLightingNovaAction::Execute(Event event) +bool EmalonLightingNovaAction::Execute(Event) { const float radius = 25.0f; // 20 yards + 5 yard for safety for 10 man. For 25man there is no maximum range but 25 yards should be ok @@ -96,7 +96,7 @@ bool EmalonLightingNovaAction::isUseful() return emalonLightingNovaTrigger.IsActive(); } -bool EmalonOverchargeAction::Execute(Event event) +bool EmalonOverchargeAction::Execute(Event) { // Check if there is any overcharged minion Unit* minion = nullptr; @@ -173,7 +173,7 @@ bool EmalonOverchargeAction::isUseful() return emalonOverchargeTrigger.IsActive(); } -bool EmalonFallFromFloorAction::Execute(Event event) +bool EmalonFallFromFloorAction::Execute(Event) { return bot->TeleportTo(bot->GetMapId(), VOA_EMALON_RESTORE_POSITION.GetPositionX(), VOA_EMALON_RESTORE_POSITION.GetPositionY(), VOA_EMALON_RESTORE_POSITION.GetPositionZ(), From 1f4931f1eec33aac06bc8e508322f4b1d4aff83c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:39:28 +0100 Subject: [PATCH 196/222] fix: Resolved all warnings in RaidUlduarTriggers.cpp. --- src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp index a4bc2cf9a2..e58edb3f6d 100644 --- a/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp +++ b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp @@ -1,19 +1,17 @@ #include "RaidUlduarTriggers.h" -#include "EventMap.h" #include "GameObject.h" #include "Object.h" #include "PlayerbotAI.h" #include "Playerbots.h" #include "RaidUlduarBossHelper.h" -#include "RaidUlduarScripts.h" -#include "ScriptedCreature.h" #include "SharedDefines.h" #include "Trigger.h" #include "Vehicle.h" #include #include #include +#include "../../../../../../../src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h" const std::vector availableVehicles = {NPC_VEHICLE_CHOPPER, NPC_SALVAGED_DEMOLISHER, NPC_SALVAGED_DEMOLISHER_TURRET, NPC_SALVAGED_SIEGE_ENGINE, @@ -350,7 +348,6 @@ bool KologarnMarkDpsTargetTrigger::IsActive() if (!target) continue; - uint32 creatureId = target->GetEntry(); if (target->GetEntry() == NPC_RUBBLE && target->IsAlive()) { return true; // Found a rubble to mark @@ -854,8 +851,6 @@ bool ThorimMarkDpsTargetTrigger::IsActive() Unit* runicColossus = AI_VALUE2(Unit*, "find target", "runic colossus"); Unit* ancientRuneGiant = AI_VALUE2(Unit*, "find target", "ancient rune giant"); - Unit* ironHonorGuard = AI_VALUE2(Unit*, "find target", "iron ring guard"); - Unit* ironRingGuard = AI_VALUE2(Unit*, "find target", "iron honor guard"); if (acolyte && acolyte->IsAlive() && (!currentCrossUnit || currentCrossUnit->GetEntry() != acolyte->GetEntry())) return true; @@ -1094,7 +1089,7 @@ bool ThorimPhase2PositioningTrigger::IsActive() Unit* boss = AI_VALUE2(Unit*, "find target", "thorim"); if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) - return false; + return false; if (!boss->IsAlive()) return false; @@ -1181,8 +1176,6 @@ bool MimironPhase1PositioningTrigger::IsActive() } Unit* leviathanMkII = nullptr; - Unit* vx001 = nullptr; - Unit* aerialCommandUnit = nullptr; GuidVector targets = AI_VALUE(GuidVector, "possible targets"); Unit* target = nullptr; @@ -1796,7 +1789,7 @@ Unit* YoggSaronTrigger::GetIllusionRoomRtiTarget() return nullptr; } - uint8 rtiIndex = RtiTargetValue::GetRtiIndex(AI_VALUE(std::string, "rti")); + int32_t rtiIndex = RtiTargetValue::GetRtiIndex(AI_VALUE(std::string, "rti")); if (rtiIndex == -1) { return nullptr; // Invalid RTI mark From f4305c03c7d20c293b83f8c217209a61cdc40ece Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:40:36 +0100 Subject: [PATCH 197/222] fix: Resolved all warnings in NewRpgAction.cpp. --- src/Ai/World/Rpg/Action/NewRpgAction.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/Ai/World/Rpg/Action/NewRpgAction.cpp b/src/Ai/World/Rpg/Action/NewRpgAction.cpp index 41fec2291c..b56f032caf 100644 --- a/src/Ai/World/Rpg/Action/NewRpgAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgAction.cpp @@ -1,12 +1,10 @@ #include "NewRpgAction.h" #include -#include #include #include "BroadcastHelper.h" #include "ChatHelper.h" -#include "DBCStores.h" #include "G3D/Vector2.h" #include "GossipDef.h" #include "IVMapMgr.h" @@ -20,16 +18,11 @@ #include "PathGenerator.h" #include "Player.h" #include "PlayerbotAI.h" -#include "Playerbots.h" -#include "Position.h" #include "QuestDef.h" #include "Random.h" -#include "RandomPlayerbotMgr.h" #include "SharedDefines.h" -#include "StatsWeightCalculator.h" #include "Timer.h" #include "TravelMgr.h" -#include "World.h" bool TellRpgStatusAction::Execute(Event event) { @@ -61,7 +54,7 @@ bool StartRpgDoQuestAction::Execute(Event event) return false; } -bool NewRpgStatusUpdateAction::Execute(Event event) +bool NewRpgStatusUpdateAction::Execute(Event) { NewRpgInfo& info = botAI->rpgInfo; switch (info.status) @@ -150,7 +143,7 @@ bool NewRpgStatusUpdateAction::Execute(Event event) return false; } -bool NewRpgGoGrindAction::Execute(Event event) +bool NewRpgGoGrindAction::Execute(Event) { if (SearchQuestGiverAndAcceptOrReward()) return true; @@ -158,7 +151,7 @@ bool NewRpgGoGrindAction::Execute(Event event) return MoveFarTo(botAI->rpgInfo.go_grind.pos); } -bool NewRpgGoCampAction::Execute(Event event) +bool NewRpgGoCampAction::Execute(Event) { if (SearchQuestGiverAndAcceptOrReward()) return true; @@ -166,7 +159,7 @@ bool NewRpgGoCampAction::Execute(Event event) return MoveFarTo(botAI->rpgInfo.go_camp.pos); } -bool NewRpgWanderRandomAction::Execute(Event event) +bool NewRpgWanderRandomAction::Execute(Event) { if (SearchQuestGiverAndAcceptOrReward()) return true; @@ -174,7 +167,7 @@ bool NewRpgWanderRandomAction::Execute(Event event) return MoveRandomNear(); } -bool NewRpgWanderNpcAction::Execute(Event event) +bool NewRpgWanderNpcAction::Execute(Event) { NewRpgInfo& info = botAI->rpgInfo; if (!info.wander_npc.npcOrGo) @@ -216,14 +209,12 @@ bool NewRpgWanderNpcAction::Execute(Event event) return true; } -bool NewRpgDoQuestAction::Execute(Event event) +bool NewRpgDoQuestAction::Execute(Event) { if (SearchQuestGiverAndAcceptOrReward()) return true; - NewRpgInfo& info = botAI->rpgInfo; uint32 questId = RPG_INFO(quest, questId); - const Quest* quest = RPG_INFO(quest, quest); uint8 questStatus = bot->GetQuestStatus(questId); switch (questStatus) { @@ -408,7 +399,7 @@ bool NewRpgDoQuestAction::DoCompletedQuest() return false; } -bool NewRpgTravelFlightAction::Execute(Event event) +bool NewRpgTravelFlightAction::Execute(Event) { if (bot->IsInFlight()) { @@ -421,7 +412,6 @@ bool NewRpgTravelFlightAction::Execute(Event event) botAI->rpgInfo.ChangeToIdle(); return true; } - const TaxiNodesEntry* entry = sTaxiNodesStore.LookupEntry(botAI->rpgInfo.flight.toNode); if (bot->GetDistance(flightMaster) > INTERACTION_DISTANCE) { return MoveFarTo(flightMaster); From 0cf76bebdd3dc261942e09779d9b156573c98478 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:48:20 +0100 Subject: [PATCH 198/222] fix: Resolved all warnings in PlayerbotFactory.cpp. --- src/Bot/Factory/PlayerbotFactory.cpp | 45 +++++++++++----------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/src/Bot/Factory/PlayerbotFactory.cpp b/src/Bot/Factory/PlayerbotFactory.cpp index dfefd323c2..b695c51739 100644 --- a/src/Bot/Factory/PlayerbotFactory.cpp +++ b/src/Bot/Factory/PlayerbotFactory.cpp @@ -5,7 +5,6 @@ #include "PlayerbotFactory.h" -#include #include #include "AccountMgr.h" @@ -20,9 +19,7 @@ #include "ItemTemplate.h" #include "ItemVisitors.h" #include "Log.h" -#include "LogCommon.h" #include "LootMgr.h" -#include "MapMgr.h" #include "ObjectMgr.h" #include "PerfMonitor.h" #include "PetDefines.h" @@ -37,7 +34,6 @@ #include "RandomPlayerbotFactory.h" #include "ReputationMgr.h" #include "SharedDefines.h" -#include "SpellAuraDefines.h" #include "StatsWeightCalculator.h" #include "World.h" #include "AiObjectContext.h" @@ -241,16 +237,20 @@ void PlayerbotFactory::Randomize(bool incremental) Prepare(); LOG_DEBUG("playerbots", "Resetting player..."); PerfMonitorOperation* pmo = sPerfMonitor.start(PERF_MON_RNDBOT, "PlayerbotFactory_Reset"); - if (!sPlayerbotAIConfig.equipmentPersistence || level < sPlayerbotAIConfig.equipmentPersistenceLevel) + + const int64_t botLevel = this->level; + + if (!PlayerbotAIConfig::instance().equipmentPersistence || botLevel < PlayerbotAIConfig::instance().equipmentPersistenceLevel) { bot->resetTalents(true); } + if (!incremental) { ClearSkills(); ClearSpells(); ResetQuests(); - if (!sPlayerbotAIConfig.equipmentPersistence || level < sPlayerbotAIConfig.equipmentPersistenceLevel) + if (!PlayerbotAIConfig::instance().equipmentPersistence || botLevel < PlayerbotAIConfig::instance().equipmentPersistenceLevel) { ClearAllItems(); } @@ -817,7 +817,7 @@ void PlayerbotFactory::InitPetTalents() int index = urand(0, spells_row.size() - 1); TalentEntry const* talentInfo = spells_row[index]; int maxRank = 0; - for (int rank = 0; rank < std::min((uint32)MAX_TALENT_RANK, (uint32)pet->GetFreeTalentPoints()); ++rank) + for (uint8_t rank = 0; rank < std::min((uint32)MAX_TALENT_RANK, (uint32)pet->GetFreeTalentPoints()); ++rank) { uint32 spellId = talentInfo->RankID[rank]; if (!spellId) @@ -954,8 +954,6 @@ void PlayerbotFactory::InitPet() continue; if (co->Name.size() > 21) continue; - uint32 guid = map->GenerateLowGuid(); - uint32 pet_number = sObjectMgr->GeneratePetNumber(); if (bot->GetPetStable() && bot->GetPetStable()->CurrentPet) { auto petGuid = bot->GetPetStable()->CurrentPet.value(); // To correct the build warnin in VS @@ -1785,14 +1783,14 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) oldItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - int32 desiredQuality = itemQuality; + uint32_t desiredQuality = itemQuality; if (urand(0, 100) < 100 * sPlayerbotAIConfig.randomGearLoweringChance && desiredQuality > ITEM_QUALITY_NORMAL) { desiredQuality--; } do { - for (uint32 requiredLevel = bot->GetLevel(); requiredLevel > std::max((int32)bot->GetLevel() - delta, 0); + for (uint32 requiredLevel = bot->GetLevel(); requiredLevel > std::max((int32)bot->GetLevel() - delta, 0); requiredLevel--) { for (InventoryType inventoryType : GetPossibleInventoryTypeListBySlot((EquipmentSlots)slot)) @@ -1862,7 +1860,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) float bestScoreForSlot = -1; uint32 bestItemForSlot = 0; - for (int index = 0; index < ids.size(); index++) + for (size_t index = 0; index < ids.size(); index++) { uint32 newItemId = ids[index]; @@ -1916,7 +1914,6 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) if (oldItem) continue; - Item* newItem = bot->EquipNewItem(dest, bestItemForSlot, true); bot->AutoUnequipOffhandIfNeed(); // if (newItem) // { @@ -1947,7 +1944,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) (slot != EQUIPMENT_SLOT_RANGED)) continue; - if (Item* oldItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot) != nullptr) bot->DestroyItem(INVENTORY_SLOT_BAG_0, slot, true); std::vector& ids = items[slot]; @@ -1956,7 +1953,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) float bestScoreForSlot = -1; uint32 bestItemForSlot = 0; - for (int index = 0; index < ids.size(); index++) + for (size_t index = 0; index < ids.size(); index++) { uint32 newItemId = ids[index]; @@ -1985,7 +1982,6 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) { continue; } - Item* newItem = bot->EquipNewItem(dest, bestItemForSlot, true); bot->AutoUnequipOffhandIfNeed(); // if (newItem) // { @@ -2013,7 +2009,7 @@ bool PlayerbotFactory::IsDesiredReplacement(Item* item) // } uint32 delta = 1 + (80 - bot->GetLevel()) / 10; - return proto->Quality < ITEM_QUALITY_RARE || int32(bot->GetLevel() - requiredLevel) > delta; + return proto->Quality < ITEM_QUALITY_RARE || (bot->GetLevel() - requiredLevel) > delta; } inline Item* StoreNewItemInInventorySlot(Player* player, uint32 newItemId, uint32 count) @@ -2162,7 +2158,6 @@ void PlayerbotFactory::InitBags(bool destroyOld) { continue; } - Item* newItem = bot->EquipNewItem(dest, newItemId, true); // if (newItem) // { // newItem->AddToWorld(); @@ -2729,7 +2724,7 @@ void PlayerbotFactory::InitTalents(uint32 specNo) int index = urand(0, spells_row.size() - 1); TalentEntry const* talentInfo = spells_row[index]; int maxRank = 0; - for (int rank = 0; rank < std::min((uint32)MAX_TALENT_RANK, bot->GetFreeTalentPoints()); ++rank) + for (uint32_t rank = 0; rank < std::min((uint32)MAX_TALENT_RANK, bot->GetFreeTalentPoints()); ++rank) { uint32 spellId = talentInfo->RankID[rank]; if (!spellId) @@ -2891,7 +2886,6 @@ void PlayerbotFactory::AddPrevQuests(uint32 questId, std::list& questIds void PlayerbotFactory::InitQuests(std::list& questMap, bool withRewardItem) { - uint32 count = 0; for (std::list::iterator i = questMap.begin(); i != questMap.end(); ++i) { uint32 questId = *i; @@ -3263,7 +3257,7 @@ void PlayerbotFactory::InitFood() } uint32 categories[] = {11, 59}; - for (int i = 0; i < sizeof(categories) / sizeof(uint32); ++i) + for (uint64_t i = 0; i < sizeof(categories) / sizeof(uint32); ++i) { uint32 category = categories[i]; std::vector& ids = items[category]; @@ -3296,7 +3290,6 @@ void PlayerbotFactory::InitFood() void PlayerbotFactory::InitReagents() { - int specTab = AiFactory::GetPlayerSpecTab(bot); std::vector> items; switch (bot->getClass()) { @@ -4282,13 +4275,13 @@ void PlayerbotFactory::ApplyEnchantTemplate(uint8 spec) // const SpellItemEnchantmentEntry* a = sSpellItemEnchantmentStore.LookupEntry(1); } -void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld) +void PlayerbotFactory::ApplyEnchantAndGemsNew(bool) { //int32 bestGemEnchantId[4] = {-1, -1, -1, -1}; // 1, 2, 4, 8 color //not used, line marked for removal. //float bestGemScore[4] = {0, 0, 0, 0}; //not used, line marked for removal. std::vector curCount = GetCurrentGemsCount(); uint8 jewelersCount = 0; - int requiredActive = 2; + const uint8_t requiredActive = 2; std::vector availableGems; for (const uint32& enchantGem : enchantGemIdCache) { @@ -4419,7 +4412,6 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld) continue; } int32 enchantIdChosen = -1; - int32 colorChosen; bool jewelersGemChosen; float bestGemScore = -1; for (uint32& enchantGem : availableGems) @@ -4450,7 +4442,7 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld) if (curCount[0] != 0) { // Ensure meta gem activation - for (int i = 1; i < curCount.size(); i++) + for (size_t i = 1; i < curCount.size(); i++) { if (curCount[i] < requiredActive && (gemProperties->color & (1 << i))) { @@ -4464,7 +4456,6 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld) if (score > bestGemScore) { enchantIdChosen = enchant_id; - colorChosen = gemProperties->color; bestGemScore = score; jewelersGemChosen = isJewelersGem; } From c80e4e9aaf2df759f5d797e75486707410780ee7 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:51:58 +0100 Subject: [PATCH 199/222] fix: Resolved all warnings in NewRpgStrategy.cpp. --- src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp index 030ad6b4fc..3216486593 100644 --- a/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp +++ b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp @@ -5,8 +5,6 @@ #include "NewRpgStrategy.h" -#include "Playerbots.h" - NewRpgStrategy::NewRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} std::vector NewRpgStrategy::getDefaultActions() @@ -69,7 +67,7 @@ void NewRpgStrategy::InitTriggers(std::vector& triggers) ); } -void NewRpgStrategy::InitMultipliers(std::vector& multipliers) +void NewRpgStrategy::InitMultipliers(std::vector&) { } From fbc773f9294be564118779763d2c912b66f6db48 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:53:28 +0100 Subject: [PATCH 200/222] fix: Resolved all warnings in NewRpgBaseAction.cpp. --- src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index 0204a21331..5a1ff2dc46 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -371,7 +371,6 @@ bool NewRpgBaseAction::IsWithinInteractionDist(Object* questGiver) case TYPEID_GAMEOBJECT: { ObjectGuid guid = questGiver->GetGUID(); - GameobjectTypes type = GAMEOBJECT_TYPE_QUESTGIVER; if (GameObject* go = bot->GetMap()->GetGameObject(guid)) { if (go->IsWithinDistInMap(bot)) @@ -557,7 +556,9 @@ bool NewRpgBaseAction::OrganizeQuestLog() continue; const Quest* quest = sObjectMgr->GetQuestTemplate(questId); - if (quest->GetZoneOrSort() < 0 || (quest->GetZoneOrSort() > 0 && quest->GetZoneOrSort() != bot->GetZoneId())) + const int64_t botZoneId = this->bot->GetZoneId(); + + if (quest->GetZoneOrSort() < 0 || (quest->GetZoneOrSort() > 0 && quest->GetZoneOrSort() != botZoneId)) { LOG_DEBUG("playerbots", "[New RPG] {} drop quest {}", bot->GetName(), questId); WorldPacket packet(CMSG_QUESTLOG_REMOVE_QUEST); @@ -820,7 +821,7 @@ bool NewRpgBaseAction::GetQuestPOIPosAndObjectiveIdx(uint32 questId, std::vector continue; bool inComplete = false; - for (uint32 objective : incompleteObjectiveIdx) + for (int64_t objective : incompleteObjectiveIdx) { if (qPoi.ObjectiveIndex == objective) { From c72c2d4443a49395d206e8eb83e189b94b8ddd53 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:55:04 +0100 Subject: [PATCH 201/222] fix: Resolved all warnings in PlayerbotMgr.cpp. --- src/Bot/PlayerbotMgr.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Bot/PlayerbotMgr.cpp b/src/Bot/PlayerbotMgr.cpp index 79850ab24e..7e081a4fc9 100644 --- a/src/Bot/PlayerbotMgr.cpp +++ b/src/Bot/PlayerbotMgr.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include #include @@ -20,11 +19,9 @@ #include "Common.h" #include "Define.h" #include "Group.h" -#include "GroupMgr.h" #include "GuildMgr.h" #include "ObjectAccessor.h" #include "ObjectGuid.h" -#include "ObjectMgr.h" #include "PlayerbotAIConfig.h" #include "PlayerbotRepository.h" #include "PlayerbotFactory.h" @@ -74,7 +71,6 @@ class PlayerbotLoginQueryHolder : public LoginQueryHolder { private: uint32 masterAccountId; - PlayerbotHolder* playerbotHolder; public: PlayerbotLoginQueryHolder(uint32 masterAccount, uint32 accountId, ObjectGuid guid) : LoginQueryHolder(accountId, guid), masterAccountId(masterAccount) @@ -125,8 +121,8 @@ void PlayerbotHolder::AddPlayerBot(ObjectGuid playerGuid, uint32 masterAccountId LOG_DEBUG("playerbots", "PlayerbotMgr not found for master player with GUID: {}", masterPlayer->GetGUID().GetRawValue()); return; } - uint32 count = mgr->GetPlayerbotsCount() + botLoading.size(); - if (count >= sPlayerbotAIConfig.maxAddedBots) + int64_t count = mgr->GetPlayerbotsCount() + botLoading.size(); + if (count >= PlayerbotAIConfig::instance().maxAddedBots) { allowed = false; out << "Failure: You have added too many bots (more than " << sPlayerbotAIConfig.maxAddedBots << ")"; @@ -710,12 +706,11 @@ void PlayerbotHolder::OnBotLogin(Player* const bot) } std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, ObjectGuid guid, ObjectGuid masterguid, - bool admin, uint32 masterAccountId, uint32 masterGuildId) + bool admin, uint32 masterAccountId, uint32) { if (!sPlayerbotAIConfig.enabled || guid.IsEmpty()) return "bot system is disabled"; - uint32 botAccount = sCharacterCache->GetCharacterAccountIdByGuid(guid); //bool isRandomBot = sRandomPlayerbotMgr.IsRandomBot(guid.GetCounter()); //not used, line marked for removal. //bool isRandomAccount = sPlayerbotAIConfig.IsInRandomAccountList(botAccount); //not used, shadowed, line marked for removal. //bool isMasterAccount = (masterAccountId == botAccount); //not used, line marked for removal. @@ -730,13 +725,15 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje { uint32 accountId = sCharacterCache->GetCharacterAccountIdByGuid(guid); if (!accountId) + { return "character not found"; + } - if (!sPlayerbotAIConfig.allowAccountBots && accountId != masterAccountId && - !(sPlayerbotAIConfig.allowTrustedAccountBots && IsAccountLinked(accountId, masterAccountId))) - { - return "you can only add bots from your own account or linked accounts"; - } + if (!sPlayerbotAIConfig.allowAccountBots && accountId != masterAccountId && + !(sPlayerbotAIConfig.allowTrustedAccountBots && IsAccountLinked(accountId, masterAccountId))) + { + return "you can only add bots from your own account or linked accounts"; + } } AddPlayerBot(guid, masterAccountId); @@ -1462,7 +1459,7 @@ std::string const PlayerbotHolder::ListBots(Player* master) return out.str(); } -std::string const PlayerbotHolder::LookupBots(Player* master) +std::string const PlayerbotHolder::LookupBots(Player*) { std::list messages; messages.push_back("Classes Available:"); @@ -1700,7 +1697,7 @@ void PlayerbotMgr::TellError(std::string const botName, std::string const text) errors[text] = names; } -void PlayerbotMgr::CheckTellErrors(uint32 elapsed) +void PlayerbotMgr::CheckTellErrors(uint32) { time_t now = time(nullptr); if ((now - lastErrorTell) < sPlayerbotAIConfig.errorDelay / 1000) From 219f71c7311f03256244db9249624bead81019dd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 10:58:36 +0100 Subject: [PATCH 202/222] fix: Resolved all warnings in Engine.cpp. --- src/Bot/Engine/Engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bot/Engine/Engine.cpp b/src/Bot/Engine/Engine.cpp index bc24baf560..0458d1151c 100644 --- a/src/Bot/Engine/Engine.cpp +++ b/src/Bot/Engine/Engine.cpp @@ -138,7 +138,7 @@ void Engine::Init() } } -bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal) +bool Engine::DoNextAction(Unit*, uint32, bool minimal) { LogAction("--- AI Tick ---"); From 95e0b569c96550a0edb888d02bf4d98e7dc6f4fc Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:00:06 +0100 Subject: [PATCH 203/222] fix: Resolved all warnings in PlayerbotCommandServer.cpp. --- src/Bot/Cmd/PlayerbotCommandServer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Bot/Cmd/PlayerbotCommandServer.cpp b/src/Bot/Cmd/PlayerbotCommandServer.cpp index 1532cc0543..ac6f5a7431 100644 --- a/src/Bot/Cmd/PlayerbotCommandServer.cpp +++ b/src/Bot/Cmd/PlayerbotCommandServer.cpp @@ -10,10 +10,9 @@ #include #include #include -#include +#include "RandomPlayerbotMgr.h" #include "IoContext.h" -#include "Playerbots.h" using boost::asio::ip::tcp; typedef boost::shared_ptr socket_ptr; @@ -27,7 +26,7 @@ bool ReadLine(socket_ptr sock, std::string* buffer, std::string* line) char buf[1025]; boost::system::error_code error; size_t n = sock->read_some(boost::asio::buffer(buf), error); - if (n == -1 || error == boost::asio::error::eof) + if (error == boost::asio::error::eof) return false; else if (error) throw boost::system::system_error(error); // Some other error. @@ -48,7 +47,7 @@ void session(socket_ptr sock) std::string buffer, request; while (ReadLine(sock, &buffer, &request)) { - std::string const response = sRandomPlayerbotMgr.HandleRemoteCommand(request) + "\n"; + std::string const response = RandomPlayerbotMgr::instance().HandleRemoteCommand(request) + "\n"; boost::asio::write(*sock, boost::asio::buffer(response.c_str(), response.size())); request = ""; } From 425390141df027701defa796e797e45f13f9d7bd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:00:49 +0100 Subject: [PATCH 204/222] fix: Resolved all warnings in GlobalPlayerInspector.h. --- src/domain/player/inspector/global/GlobalPlayerInspector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/player/inspector/global/GlobalPlayerInspector.h b/src/domain/player/inspector/global/GlobalPlayerInspector.h index 7b4a7b0164..7d397af66b 100644 --- a/src/domain/player/inspector/global/GlobalPlayerInspector.h +++ b/src/domain/player/inspector/global/GlobalPlayerInspector.h @@ -98,7 +98,7 @@ class GlobalPlayerInspector : public AbstractPlayerInspector std::list targets; - Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(player, 15.0f); + Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(player, range); Acore::UnitListSearcher searcher(player, targets, u_check); Cell::VisitObjects(player, searcher, PlayerbotAIConfig::instance().sightDistance); From c6dfc18074691a9183ea21534f39566683b600be Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:02:36 +0100 Subject: [PATCH 205/222] fix: Resolved all warnings in PlayerbotAI.cpp and PlayerbotAI.h. --- src/Bot/PlayerbotAI.cpp | 4 +--- src/Bot/PlayerbotAI.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Bot/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp index 6ac54a9e1a..5bd1c2f371 100644 --- a/src/Bot/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -24,7 +24,6 @@ #include "GameObjectData.h" #include "GameTime.h" #include "GuildMgr.h" -#include "GuildTaskMgr.h" #include "LFGMgr.h" #include "LastMovementValue.h" #include "LastSpellCastValue.h" @@ -39,7 +38,6 @@ #include "PerfMonitor.h" #include "Player.h" #include "PlayerbotAIConfig.h" -#include "PlayerbotRepository.h" #include "PlayerbotMgr.h" #include "PlayerbotGuildMgr.h" #include "Playerbots.h" @@ -1733,7 +1731,7 @@ bool PlayerbotAI::ContainsStrategy(StrategyType type) bool PlayerbotAI::HasStrategy(std::string const name, BotState type) { return engines[type]->HasStrategy(name); } -void PlayerbotAI::ResetStrategies(bool load) +void PlayerbotAI::ResetStrategies(bool) { for (uint8 i = 0; i < BOT_STATE_MAX; i++) engines[i]->removeAllStrategies(); diff --git a/src/Bot/PlayerbotAI.h b/src/Bot/PlayerbotAI.h index c2d4aeb75b..b7274732b3 100644 --- a/src/Bot/PlayerbotAI.h +++ b/src/Bot/PlayerbotAI.h @@ -6,13 +6,11 @@ #ifndef _PLAYERBOT_PLAYERbotAI_H #define _PLAYERBOT_PLAYERbotAI_H -#include #include #include "Chat.h" #include "ChatFilter.h" #include "ChatHelper.h" -#include "Common.h" #include "CreatureData.h" #include "Event.h" #include "Item.h" From c377c42793f49eaa69428534b344a386c6d8eb03 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:04:54 +0100 Subject: [PATCH 206/222] fix: Resolved all warnings in Trigger.cpp. --- src/Bot/Engine/Trigger/Trigger.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Bot/Engine/Trigger/Trigger.cpp b/src/Bot/Engine/Trigger/Trigger.cpp index 07105be299..3166001c2f 100644 --- a/src/Bot/Engine/Trigger/Trigger.cpp +++ b/src/Bot/Engine/Trigger/Trigger.cpp @@ -5,9 +5,8 @@ #include "Trigger.h" +#include "AiObjectContext.h" #include "Event.h" -#include "Playerbots.h" -#include "Timer.h" Trigger::Trigger(PlayerbotAI* botAI, std::string const name, int32 checkInterval) : AiNamedObject(botAI, name), @@ -28,18 +27,20 @@ Event Trigger::Check() return event; } -Value* Trigger::GetTargetValue() { return context->GetValue(GetTargetName()); } +Value* Trigger::GetTargetValue() { return this->context->GetValue(GetTargetName()); } Unit* Trigger::GetTarget() { return GetTargetValue()->Get(); } bool Trigger::needCheck(uint32 now) { - if (checkInterval < 2) + if (this->checkInterval < 2) return true; - if (!lastCheckTime || now - lastCheckTime >= checkInterval) + const int64_t signedLastCheckTime = this->lastCheckTime; + + if (!this->lastCheckTime || now - signedLastCheckTime >= this->checkInterval) { - lastCheckTime = now; + this->lastCheckTime = now; return true; } From 516508567b3eafa2c4b84bf21baa62e804bb902a Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:06:40 +0100 Subject: [PATCH 207/222] fix: Resolved all warnings in CustomStrategy.cpp. --- src/Bot/Engine/Strategy/CustomStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bot/Engine/Strategy/CustomStrategy.cpp b/src/Bot/Engine/Strategy/CustomStrategy.cpp index d4dd3e514e..db8e8206be 100644 --- a/src/Bot/Engine/Strategy/CustomStrategy.cpp +++ b/src/Bot/Engine/Strategy/CustomStrategy.cpp @@ -35,7 +35,7 @@ std::vector toNextActionArray(const std::string actions) const std::vector tokens = split(actions, ','); std::vector res = {}; - for (const std::string token : tokens) + for (std::string token : tokens) { res.push_back(toNextAction(token)); } From 7d2d135e596b5fc42ad0d4edf96a93cc31e8c76d Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:07:33 +0100 Subject: [PATCH 208/222] fix: Resolved all warnings in PlayerbotRepository.cpp. --- src/Db/PlayerbotRepository.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Db/PlayerbotRepository.cpp b/src/Db/PlayerbotRepository.cpp index 886cebb833..6d2d519d86 100644 --- a/src/Db/PlayerbotRepository.cpp +++ b/src/Db/PlayerbotRepository.cpp @@ -4,10 +4,7 @@ */ #include "PlayerbotRepository.h" - -#include - -#include "Playerbots.h" +#include "AiObjectContext.h" void PlayerbotRepository::Load(PlayerbotAI* botAI) { @@ -68,7 +65,7 @@ void PlayerbotRepository::Save(PlayerbotAI* botAI) SaveValue(guid, "dead", FormatStrategies("dead", botAI->GetStrategies(BOT_STATE_DEAD))); } -std::string const PlayerbotRepository::FormatStrategies(std::string const type, std::vector strategies) +std::string const PlayerbotRepository::FormatStrategies(std::string const, std::vector strategies) { std::ostringstream out; for (std::vector::iterator i = strategies.begin(); i != strategies.end(); ++i) From a2ef6931f3cb64d48eb6eb0f16b79d5d84fe9858 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:11:45 +0100 Subject: [PATCH 209/222] fix: Resolved all warnings in RandomPlayerbotMgr.cpp. --- src/Bot/RandomPlayerbotMgr.cpp | 42 ++++++++++------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/Bot/RandomPlayerbotMgr.cpp b/src/Bot/RandomPlayerbotMgr.cpp index 4707d854ff..ed2de50d16 100644 --- a/src/Bot/RandomPlayerbotMgr.cpp +++ b/src/Bot/RandomPlayerbotMgr.cpp @@ -25,7 +25,6 @@ #include "FleeManager.h" #include "FlightMasterCache.h" #include "GridNotifiers.h" -#include "GuildTaskMgr.h" #include "LFGMgr.h" #include "MapMgr.h" #include "NewRpgInfo.h" @@ -323,7 +322,7 @@ void RandomPlayerbotMgr::LogPlayerLocation() } } -void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) +void RandomPlayerbotMgr::UpdateAIInternal(uint32, bool /*minimal*/) { if (totalPmo) totalPmo->finish(); @@ -995,7 +994,7 @@ void RandomPlayerbotMgr::CheckBgQueue() // Arena logic bool isRated = false; - if (uint8 arenaType = BattlegroundMgr::BGArenaType(queueTypeId)) + if (BattlegroundMgr::BGArenaType(queueTypeId)) { BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(queueTypeId); GroupQueueInfo ginfo; @@ -1082,7 +1081,7 @@ void RandomPlayerbotMgr::CheckBgQueue() BattlegroundData[queueTypeId][bracketId].minLevel = pvpDiff->minLevel; BattlegroundData[queueTypeId][bracketId].maxLevel = pvpDiff->maxLevel; - if (uint8 arenaType = BattlegroundMgr::BGArenaType(queueTypeId)) + if (BattlegroundMgr::BGArenaType(queueTypeId)) { bool isRated = false; BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(queueTypeId); @@ -1663,7 +1662,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector& tlocs.push_back(WorldPosition(loc)); // Do not teleport to maps disabled in config tlocs.erase(std::remove_if(tlocs.begin(), tlocs.end(), - [bot](WorldPosition l) + [](WorldPosition l) { std::vector::iterator i = find(sPlayerbotAIConfig.randomBotMaps.begin(), @@ -1846,7 +1845,7 @@ void RandomPlayerbotMgr::PrepareZone2LevelBracket() void RandomPlayerbotMgr::PrepareTeleportCache() { - uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); + int64_t maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); LOG_INFO("playerbots", "Preparing random teleport caches for {} levels...", maxLevel); @@ -1900,9 +1899,9 @@ void RandomPlayerbotMgr::PrepareTeleportCache() float x = fields[1].Get(); float y = fields[2].Get(); float z = fields[3].Get(); - uint32 min_level = fields[4].Get(); - uint32 max_level = fields[5].Get(); - uint32 level = (min_level + max_level + 1) / 2; + int64_t min_level = fields[4].Get(); + int64_t max_level = fields[5].Get(); + int64_t level = (min_level + max_level + 1) / 2; WorldLocation loc(mapId, x, y, z, 0); collected_locs++; for (int32 l = (int32)level - (int32)sPlayerbotAIConfig.randomBotTeleLowerLevel; @@ -1984,7 +1983,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache() if (zone2LevelBracket.find(zoneId) == zone2LevelBracket.end()) continue; LevelBracket bracket = zone2LevelBracket[zoneId]; - for (int i = bracket.low; i <= bracket.high; i++) + for (uint32_t i = bracket.low; i <= bracket.high; i++) { if (forHorde) { @@ -2487,7 +2486,7 @@ void RandomPlayerbotMgr::Clear(Player* bot) factory.ClearEverything(); } -uint32 RandomPlayerbotMgr::GetZoneLevel(uint16 mapId, float teleX, float teleY, float teleZ) +uint32 RandomPlayerbotMgr::GetZoneLevel(uint16 mapId, float teleX, float teleY, float) { uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); @@ -2680,7 +2679,7 @@ std::vector RandomPlayerbotMgr::GetBgBots(uint32 bracket) } while (result->NextRow()); } - return std::move(BgBots); + return BgBots; } CachedEvent* RandomPlayerbotMgr::FindEvent(uint32 bot, std::string const& event) @@ -2818,7 +2817,7 @@ void RandomPlayerbotMgr::SetValue(Player* bot, std::string const& type, uint32 v SetValue(bot->GetGUID().GetCounter(), type, value, data); } -bool RandomPlayerbotMgr::HandlePlayerbotConsoleCommand(ChatHandler* handler, char const* args) +bool RandomPlayerbotMgr::HandlePlayerbotConsoleCommand(ChatHandler*, char const* args) { if (!sPlayerbotAIConfig.enabled) { @@ -3147,10 +3146,6 @@ void RandomPlayerbotMgr::PrintStats() uint32 heal = 0; uint32 tank = 0; uint32 active = 0; - uint32 update = 0; - uint32 randomize = 0; - uint32 teleport = 0; - uint32 changeStrategy = 0; uint32 dead = 0; uint32 combat = 0; // uint32 revive = 0; //not used, line marked for removal. @@ -3191,19 +3186,6 @@ void RandomPlayerbotMgr::PrintStats() if (botAI->AllowActivity()) ++active; - if (botAI->GetAiObjectContext()->GetValue("random bot update")->Get()) - ++update; - - uint32 botId = bot->GetGUID().GetCounter(); - if (!GetEventValue(botId, "randomize")) - ++randomize; - - if (!GetEventValue(botId, "teleport")) - ++teleport; - - if (!GetEventValue(botId, "change_strategy")) - ++changeStrategy; - if (bot->isDead()) { ++dead; From 26c005a2c9cbb365eecb0086dc76a919c6903417 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:12:39 +0100 Subject: [PATCH 210/222] fix: Resolved all warnings in StatsCollector.cpp. --- src/Mgr/Item/StatsCollector.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Mgr/Item/StatsCollector.cpp b/src/Mgr/Item/StatsCollector.cpp index 4f719fea4e..efc2420889 100644 --- a/src/Mgr/Item/StatsCollector.cpp +++ b/src/Mgr/Item/StatsCollector.cpp @@ -1,18 +1,13 @@ #include "StatsCollector.h" -#include - #include "DBCStores.h" -#include "ItemEnchantmentMgr.h" #include "ItemTemplate.h" -#include "ObjectMgr.h" #include "PlayerbotAI.h" #include "PlayerbotAIAware.h" #include "SharedDefines.h" #include "SpellAuraDefines.h" #include "SpellInfo.h" #include "SpellMgr.h" -#include "UpdateFields.h" #include "Util.h" StatsCollector::StatsCollector(CollectorType type, int32 cls) : type_(type), cls_(cls) { Reset(); } @@ -39,7 +34,7 @@ void StatsCollector::CollectItemStats(ItemTemplate const* proto) } stats[STATS_TYPE_ARMOR] += proto->Armor; stats[STATS_TYPE_BLOCK_VALUE] += proto->Block; - for (int i = 0; i < proto->StatsCount; i++) + for (uint32_t i = 0; i < proto->StatsCount; i++) { const _ItemStat& stat = proto->ItemStat[i]; const int32& val = stat.ItemStatValue; From 72a267c329608ca425fcaaa51f5b8c206162de68 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:13:05 +0100 Subject: [PATCH 211/222] fix: Resolved all warnings in StatsWeightCalculator.cpp. --- src/Mgr/Item/StatsWeightCalculator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mgr/Item/StatsWeightCalculator.cpp b/src/Mgr/Item/StatsWeightCalculator.cpp index 1b3f3dcfcb..777f1fb847 100644 --- a/src/Mgr/Item/StatsWeightCalculator.cpp +++ b/src/Mgr/Item/StatsWeightCalculator.cpp @@ -500,7 +500,7 @@ void StatsWeightCalculator::CalculateItemSetMod(Player* player, ItemTemplate con weight_ *= multiplier; } -void StatsWeightCalculator::CalculateSocketBonus(Player* player, ItemTemplate const* proto) +void StatsWeightCalculator::CalculateSocketBonus(Player*, ItemTemplate const* proto) { uint32 socketNum = 0; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; From bcd38de961843fa04efefd08240429d64f57f658 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:13:28 +0100 Subject: [PATCH 212/222] fix: Resolved all ServerFacade.cpp. --- src/Util/ServerFacade.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/ServerFacade.cpp b/src/Util/ServerFacade.cpp index 12a77de635..8bd8ee60ef 100644 --- a/src/Util/ServerFacade.cpp +++ b/src/Util/ServerFacade.cpp @@ -39,7 +39,7 @@ bool ServerFacade::IsDistanceGreaterOrEqualThan(float dist1, float dist2) { retu bool ServerFacade::IsDistanceLessOrEqualThan(float dist1, float dist2) { return !IsDistanceGreaterThan(dist1, dist2); } -void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool force) +void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool) { if (!bot) return; From 2e47dd3a988106430911982ee793ad397c08b2e3 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:15:07 +0100 Subject: [PATCH 213/222] fix: Resolved all warnings in RandomPlayerbotFactory.cpp. --- src/Bot/Factory/RandomPlayerbotFactory.cpp | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/Bot/Factory/RandomPlayerbotFactory.cpp b/src/Bot/Factory/RandomPlayerbotFactory.cpp index 0fd7e90e21..997182012f 100644 --- a/src/Bot/Factory/RandomPlayerbotFactory.cpp +++ b/src/Bot/Factory/RandomPlayerbotFactory.cpp @@ -8,17 +8,12 @@ #include "AccountMgr.h" #include "ArenaTeamMgr.h" #include "DatabaseEnv.h" -#include "GuildMgr.h" -#include "PlayerbotFactory.h" -#include "Playerbots.h" -#include "PlayerbotGuildMgr.h" +#include "PlayerbotAI.h" #include "ScriptMgr.h" #include "SharedDefines.h" #include "SocialMgr.h" #include "Timer.h" -#include "Guild.h" // EmblemInfo::SaveToDB #include "Log.h" -#include "GuildMgr.h" constexpr RandomPlayerbotFactory::NameRaceAndGender RandomPlayerbotFactory::CombineRaceAndGender(uint8 race, uint8 gender) @@ -244,7 +239,7 @@ std::string const RandomPlayerbotFactory::CreateRandomBotName(NameRaceAndGender botName += (botName.size() < 2) ? groupFormEnd[gender][rand() % 4] : ""; // Replace Catagory value with random Letter from that Catagory's Letter string for a given bot gender - for (int i = 0; i < botName.size(); i++) + for (size_t i = 0; i < botName.size(); i++) { botName[i] = groupLetter[gender][groupCategory.find(botName[i])] [rand() % groupLetter[gender][groupCategory.find(botName[i])].size()]; @@ -277,7 +272,7 @@ std::string const RandomPlayerbotFactory::CreateRandomBotName(NameRaceAndGender botName.clear(); continue; } - return std::move(botName); + return botName; } // TRUE RANDOM NAME GENERATION @@ -302,11 +297,11 @@ std::string const RandomPlayerbotFactory::CreateRandomBotName(NameRaceAndGender botName.clear(); continue; } - return std::move(botName); + return botName; } LOG_ERROR("playerbots", "Random name generation failed."); botName.clear(); - return std::move(botName); + return botName; } // Calculates the total number of required accounts, either using the specified randomBotAccountCount @@ -763,7 +758,7 @@ std::string const RandomPlayerbotFactory::CreateRandomGuildName() if (!result) { LOG_ERROR("playerbots", "No more names left for random guilds"); - return std::move(guildName); + return guildName; } Field* fields = result->Fetch(); @@ -777,13 +772,13 @@ std::string const RandomPlayerbotFactory::CreateRandomGuildName() if (!result) { LOG_ERROR("playerbots", "No more names left for random guilds"); - return std::move(guildName); + return guildName; } fields = result->Fetch(); guildName = fields[0].Get(); - return std::move(guildName); + return guildName; } void RandomPlayerbotFactory::CreateRandomArenaTeams(ArenaType type, uint32 count) @@ -905,7 +900,7 @@ std::string const RandomPlayerbotFactory::CreateRandomArenaTeamName() if (!result) { LOG_ERROR("playerbots", "No more names left for random arena teams"); - return std::move(arenaTeamName); + return arenaTeamName; } Field* fields = result->Fetch(); @@ -920,11 +915,11 @@ std::string const RandomPlayerbotFactory::CreateRandomArenaTeamName() if (!result) { LOG_ERROR("playerbots", "No more names left for random arena teams"); - return std::move(arenaTeamName); + return arenaTeamName; } fields = result->Fetch(); arenaTeamName = fields[0].Get(); - return std::move(arenaTeamName); + return arenaTeamName; } From 989e5af4baea2d662c4744f40c3321de0798e87f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:22:23 +0100 Subject: [PATCH 214/222] fix: Resolved all warnings in RandomItemMgr.cpp. --- src/Mgr/Item/RandomItemMgr.cpp | 46 ++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/Mgr/Item/RandomItemMgr.cpp b/src/Mgr/Item/RandomItemMgr.cpp index 5c0e8c94ab..8939e349b0 100644 --- a/src/Mgr/Item/RandomItemMgr.cpp +++ b/src/Mgr/Item/RandomItemMgr.cpp @@ -7,7 +7,9 @@ #include "ItemTemplate.h" #include "LootValues.h" -#include "Playerbots.h" +#include "Player.h" +#include "PlayerbotAIConfig.h" +#include "SpellMgr.h" char* strstri(char const* str1, char const* str2); std::set RandomItemMgr::itemCache; @@ -176,7 +178,7 @@ RandomItemMgr::~RandomItemMgr() predicates.clear(); } -bool RandomItemMgr::HandleConsoleCommand(ChatHandler* handler, char const* args) +bool RandomItemMgr::HandleConsoleCommand(ChatHandler*, char const* args) { if (!args || !*args) { @@ -1269,7 +1271,7 @@ void RandomItemMgr::BuildItemInfoCache() uint32 RandomItemMgr::CalculateStatWeight(uint8 playerclass, uint8 spec, ItemTemplate const* proto) { - uint32 statWeight = 0; + int64_t statWeight = 0; bool isCasterItem = false; bool isAttackItem = false; bool noCaster = (Classes)playerclass == CLASS_WARRIOR || (Classes)playerclass == CLASS_ROGUE || @@ -1700,7 +1702,7 @@ std::vector RandomItemMgr::GetQuestIdsForItem(uint32 itemId) } } - return std::move(questIds); + return questIds; } uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, uint32 quality, uint32 itemId) @@ -1782,10 +1784,19 @@ uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, u } // skip no stats trinkets - if (info.weights[specId] == 1 && info.slot == EQUIPMENT_SLOT_NECK || info.slot == EQUIPMENT_SLOT_TRINKET1 || - info.slot == EQUIPMENT_SLOT_TRINKET2 || info.slot == EQUIPMENT_SLOT_FINGER1 || - info.slot == EQUIPMENT_SLOT_FINGER2) + if ( + info.weights[specId] == 1 + && ( + info.slot == EQUIPMENT_SLOT_NECK + || info.slot == EQUIPMENT_SLOT_TRINKET1 + || info.slot == EQUIPMENT_SLOT_TRINKET2 + || info.slot == EQUIPMENT_SLOT_FINGER1 + || info.slot == EQUIPMENT_SLOT_FINGER2 + ) + ) + { continue; + } // check if item stat score is the best among class specs uint32 bestSpecId = 0; @@ -1823,16 +1834,15 @@ uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, u } std::vector RandomItemMgr::GetUpgradeList(Player* player, std::string spec, uint8 slot, uint32 quality, - uint32 itemId, uint32 amount) + uint32 itemId, uint32) { std::vector listItems; if (!player) - return std::move(listItems); + return listItems; // get old item statWeight uint32 oldStatWeight = 0; uint32 specId = 0; - uint32 closestUpgrade = 0; uint32 closestUpgradeWeight = 0; std::vector classspecs; @@ -1848,7 +1858,7 @@ std::vector RandomItemMgr::GetUpgradeList(Player* player, std::string sp } if (!specId) - return std::move(listItems); + return listItems; if (itemId && itemInfoCache.find(itemId) != itemInfoCache.end()) { @@ -1933,7 +1943,6 @@ std::vector RandomItemMgr::GetUpgradeList(Player* player, std::string sp // pick closest upgrade if (info.weights[specId] > closestUpgradeWeight) { - closestUpgrade = info.itemId; closestUpgradeWeight = info.weights[specId]; } } @@ -1942,7 +1951,7 @@ std::vector RandomItemMgr::GetUpgradeList(Player* player, std::string sp LOG_INFO("playerbots", "New Items: {}, Old item:%d, New items max: {}", listItems.size(), oldStatWeight, closestUpgradeWeight); - return std::move(listItems); + return listItems; } bool RandomItemMgr::HasStatWeight(uint32 itemId) @@ -2218,7 +2227,7 @@ void RandomItemMgr::BuildEquipCacheNew() if (quest->GetRequiredClasses()) continue; - for (int j = 0; j < quest->GetRewChoiceItemsCount(); j++) + for (uint32_t j = 0; j < quest->GetRewChoiceItemsCount(); j++) if (uint32 itemId = quest->RewardChoiceItemId[j]) { ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); @@ -2229,7 +2238,7 @@ void RandomItemMgr::BuildEquipCacheNew() questItemIds.insert(itemId); } - for (int j = 0; j < quest->GetRewItemsCount(); j++) + for (uint32_t j = 0; j < quest->GetRewItemsCount(); j++) if (uint32 itemId = quest->RewardItemId[j]) { ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); @@ -2374,9 +2383,6 @@ void RandomItemMgr::BuildPotionCache() if (proto->Duration & 0x80000000) continue; - if (proto->AllowableClass != -1) - continue; - bool hybrid = false; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(proto->Spells[0].SpellId); if (!spellInfo) @@ -2767,7 +2773,9 @@ inline bool IsCraftedBySpellInfo(ItemTemplate const* proto, SpellInfo const* spe continue; } - if (proto->ItemId == spellInfo->Reagent[x]) + const int64_t itemTemplateId = proto->ItemId; + + if (itemTemplateId == spellInfo->Reagent[x]) { return true; } From f1101897c2bbeb2ef44a0cddf5510c2b5422fdcd Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:29:29 +0100 Subject: [PATCH 215/222] fix: Resolved all warnings in Playerbots.cpp. --- src/Mgr/Talent/Talentspec.cpp | 22 +++++++++++++++------- src/Mgr/Talent/Talentspec.h | 14 ++++++++------ src/Script/PlayerbotCommandScript.cpp | 2 +- src/Script/Playerbots.cpp | 4 ++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Mgr/Talent/Talentspec.cpp b/src/Mgr/Talent/Talentspec.cpp index 06e70b841c..74106d25bb 100644 --- a/src/Mgr/Talent/Talentspec.cpp +++ b/src/Mgr/Talent/Talentspec.cpp @@ -6,7 +6,9 @@ #include "Talentspec.h" #include "Event.h" -#include "Playerbots.h" +#include "Player.h" +#include "SpellMgr.h" +#include "World.h" uint32 TalentSpec::TalentListEntry::tabPage() const { @@ -140,7 +142,7 @@ bool TalentSpec::CheckTalents(uint32 level, std::ostringstream* out) } // Set the talents for the bots to the current spec. -void TalentSpec::ApplyTalents(Player* bot, std::ostringstream* out) +void TalentSpec::ApplyTalents(Player* bot, std::ostringstream*) { for (auto& entry : talents) { @@ -317,7 +319,7 @@ std::vector TalentSpec::GetTalentTree(uint32 tabpag if (entry.tabPage() == tabpage) retList.push_back(entry); - return std::move(retList); + return retList; } uint32 TalentSpec::GetTalentPoints(int32 tabpage) { return GetTalentPoints(talents, tabpage); }; @@ -330,8 +332,14 @@ uint32 TalentSpec::GetTalentPoints(std::vector& talents, int32 uint32 tPoints = 0; for (auto& entry : talents) - if (entry.tabPage() == tabpage) + { + const int64_t entryTabPage = entry.tabPage(); + + if (entryTabPage == tabpage) + { tPoints = tPoints + entry.rank; + } + } return tPoints; } @@ -368,7 +376,7 @@ std::string const TalentSpec::GetTalentLink() if (treeLink[2] != "0") link = link + "-" + treeLink[2]; - return std::move(link); + return link; } uint32 TalentSpec::highestTree() @@ -395,7 +403,7 @@ uint32 TalentSpec::highestTree() return 0; } -std::string const TalentSpec::FormatSpec(Player* bot) +std::string const TalentSpec::FormatSpec(Player*) { // uint8 cls = bot->getClass(); //not used, (used in lined 403), line marked for removal. @@ -446,7 +454,7 @@ std::vector TalentSpec::SubTalentList(std::vector +#include +#include "Player.h" struct TalentEntry; struct TalentTabEntry; @@ -25,17 +27,17 @@ class TalentSpec public: struct TalentListEntry { - uint32 entry; - uint32 rank; - uint32 maxRank; + uint32_t entry; + uint32_t rank; + uint32_t maxRank; TalentEntry const* talentInfo; TalentTabEntry const* talentTabInfo; - uint32 tabPage() const; + uint32_t tabPage() const; }; TalentSpec(){}; virtual ~TalentSpec() {} - TalentSpec(uint32 classMask); + TalentSpec(uint32_t classMask); TalentSpec(TalentSpec* base, std::string const link); TalentSpec(Player* bot); TalentSpec(Player* bot, std::string const link); diff --git a/src/Script/PlayerbotCommandScript.cpp b/src/Script/PlayerbotCommandScript.cpp index a7a0739528..c12ed50afa 100644 --- a/src/Script/PlayerbotCommandScript.cpp +++ b/src/Script/PlayerbotCommandScript.cpp @@ -72,7 +72,7 @@ class playerbots_commandscript : public CommandScript return GuildTaskMgr::HandleConsoleCommand(handler, args); } - static bool HandlePerfMonCommand(ChatHandler* handler, char const* args) + static bool HandlePerfMonCommand(ChatHandler*, char const* args) { if (!strcmp(args, "reset")) { diff --git a/src/Script/Playerbots.cpp b/src/Script/Playerbots.cpp index 065ccb8719..438e1d6955 100644 --- a/src/Script/Playerbots.cpp +++ b/src/Script/Playerbots.cpp @@ -188,7 +188,7 @@ class PlayerbotsPlayerScript : public PlayerScript return true; } - bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Guild* guild) override + bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Guild*) override { if (type != CHAT_MSG_GUILD) { @@ -437,7 +437,7 @@ class PlayerbotsScript : public PlayerbotScript } } - void OnPlayerbotUpdate(uint32 diff) override + void OnPlayerbotUpdate(uint32) override { sRandomPlayerbotMgr.UpdateSessions(); // Per-bot updates only } From 74ed6fc22a860737d6411267e373293d4e608972 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:41:20 +0100 Subject: [PATCH 216/222] fix: Resolved all warnings in TravelMgr.cpp. --- src/Mgr/Travel/TravelMgr.cpp | 141 +++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 65 deletions(-) diff --git a/src/Mgr/Travel/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp index 84eef9b99e..02f6602b42 100644 --- a/src/Mgr/Travel/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -15,7 +15,6 @@ #include "PathGenerator.h" #include "Playerbots.h" #include "TransportMgr.h" -#include "VMapFactory.h" #include "VMapMgr2.h" #include "Map.h" #include "Corpse.h" @@ -117,16 +116,18 @@ WorldPosition::WorldPosition(std::vector list, WorldPositionConst } } +// We have to disable this Clang rule because the bug resides in AC which we cannot act on. + WorldPosition::WorldPosition(uint32 mapid, GridCoord grid) - : WorldLocation(mapid, (int32(grid.x_coord) - CENTER_GRID_ID - 0.5) * SIZE_OF_GRIDS + CENTER_GRID_OFFSET, - (int32(grid.y_coord) - CENTER_GRID_ID - 0.5) * SIZE_OF_GRIDS + CENTER_GRID_OFFSET, 0, 0) + : WorldLocation(mapid, (int32(grid.x_coord) - CENTER_GRID_ID - 0.5) * SIZE_OF_GRIDS + CENTER_GRID_OFFSET, // NOLINT(bugprone-integer-division) + (int32(grid.y_coord) - CENTER_GRID_ID - 0.5) * SIZE_OF_GRIDS + CENTER_GRID_OFFSET, 0, 0) // NOLINT(bugprone-integer-division) { } WorldPosition::WorldPosition(uint32 mapid, CellCoord cell) : WorldLocation( - mapid, (int32(cell.x_coord) - CENTER_GRID_CELL_ID - 0.5) * SIZE_OF_GRID_CELL + CENTER_GRID_CELL_OFFSET, - (int32(cell.y_coord) - CENTER_GRID_CELL_ID - 0.5) * SIZE_OF_GRID_CELL + CENTER_GRID_CELL_OFFSET, 0, 0) + mapid, (int32(cell.x_coord) - CENTER_GRID_CELL_ID - 0.5) * SIZE_OF_GRID_CELL + CENTER_GRID_CELL_OFFSET, // NOLINT(bugprone-integer-division) + (int32(cell.y_coord) - CENTER_GRID_CELL_ID - 0.5) * SIZE_OF_GRID_CELL + CENTER_GRID_CELL_OFFSET, 0, 0) // NOLINT(bugprone-integer-division) { } @@ -480,10 +481,10 @@ std::string const WorldPosition::getAreaName(bool fullName, bool zoneName) } } - return std::move(areaName); + return areaName; } -std::set WorldPosition::getTransports(uint32 entry) +std::set WorldPosition::getTransports(uint32) { /* if (!entry) @@ -628,60 +629,60 @@ void WorldPosition::loadMapAndVMap(uint32 mapId, uint8 x, uint8 y) { std::string const fileName = "load_map_grid.csv"; - if (isOverworld() && false || false) - { - if (!MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(mapId, x, y)) - if (sPlayerbotAIConfig.hasLog(fileName)) - { - std::ostringstream out; - out << sPlayerbotAIConfig.GetTimestampStr(); - out << "+00,\"mmap\", " << x << "," << y << "," << (TravelMgr::instance().isBadMmap(mapId, x, y) ? "0" : "1") - << ","; - printWKT(fromGridCoord(GridCoord(x, y)), out, 1, true); - sPlayerbotAIConfig.log(fileName, out.str().c_str()); - } - } - else - { + // if (isOverworld() && false || false) + // { + // if (!MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(mapId, x, y)) + // if (sPlayerbotAIConfig.hasLog(fileName)) + // { + // std::ostringstream out; + // out << sPlayerbotAIConfig.GetTimestampStr(); + // out << "+00,\"mmap\", " << x << "," << y << "," << (TravelMgr::instance().isBadMmap(mapId, x, y) ? "0" : "1") + // << ","; + // printWKT(fromGridCoord(GridCoord(x, y)), out, 1, true); + // sPlayerbotAIConfig.log(fileName, out.str().c_str()); + // } + // } + // else + // { // This needs to be disabled or maps will not load. // Needs more testing to check for impact on movement. - if (false) - if (!TravelMgr::instance().isBadVmap(mapId, x, y)) - { - // load VMAPs for current map/grid... - const MapEntry* i_mapEntry = sMapStore.LookupEntry(mapId); - //const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; //not used, (usage are commented out below), line marked for removal. - - int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap( - (sWorld->GetDataPath() + "vmaps").c_str(), mapId, x, y); - switch (vmapLoadResult) - { - case VMAP::VMAP_LOAD_RESULT_OK: - // LOG_ERROR("playerbots", "VMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", - // mapName, mapId, x, y, x, y); - break; - case VMAP::VMAP_LOAD_RESULT_ERROR: - // LOG_ERROR("playerbots", "Could not load VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, - // y:{})", mapName, mapId, x, y, x, y); - TravelMgr::instance().addBadVmap(mapId, x, y); - break; - case VMAP::VMAP_LOAD_RESULT_IGNORED: - TravelMgr::instance().addBadVmap(mapId, x, y); - // LOG_INFO("playerbots", "Ignored VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", - // mapName, mapId, x, y, x, y); - break; - } - - if (sPlayerbotAIConfig.hasLog(fileName)) - { - std::ostringstream out; - out << sPlayerbotAIConfig.GetTimestampStr(); - out << "+00,\"vmap\", " << x << "," << y << ", " << (TravelMgr::instance().isBadVmap(mapId, x, y) ? "0" : "1") - << ","; - printWKT(frommGridCoord(mGridCoord(x, y)), out, 1, true); - sPlayerbotAIConfig.log(fileName, out.str().c_str()); - } - } + // if (false) + // if (!TravelMgr::instance().isBadVmap(mapId, x, y)) + // { + // // load VMAPs for current map/grid... + // const MapEntry* i_mapEntry = sMapStore.LookupEntry(mapId); + // //const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; //not used, (usage are commented out below), line marked for removal. + + // int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap( + // (sWorld->GetDataPath() + "vmaps").c_str(), mapId, x, y); + // switch (vmapLoadResult) + // { + // case VMAP::VMAP_LOAD_RESULT_OK: + // // LOG_ERROR("playerbots", "VMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", + // // mapName, mapId, x, y, x, y); + // break; + // case VMAP::VMAP_LOAD_RESULT_ERROR: + // // LOG_ERROR("playerbots", "Could not load VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, + // // y:{})", mapName, mapId, x, y, x, y); + // TravelMgr::instance().addBadVmap(mapId, x, y); + // break; + // case VMAP::VMAP_LOAD_RESULT_IGNORED: + // TravelMgr::instance().addBadVmap(mapId, x, y); + // // LOG_INFO("playerbots", "Ignored VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", + // // mapName, mapId, x, y, x, y); + // break; + // } + + // if (sPlayerbotAIConfig.hasLog(fileName)) + // { + // std::ostringstream out; + // out << sPlayerbotAIConfig.GetTimestampStr(); + // out << "+00,\"vmap\", " << x << "," << y << ", " << (TravelMgr::instance().isBadVmap(mapId, x, y) ? "0" : "1") + // << ","; + // printWKT(frommGridCoord(mGridCoord(x, y)), out, 1, true); + // sPlayerbotAIConfig.log(fileName, out.str().c_str()); + // } + // } if (!TravelMgr::instance().isBadMmap(mapId, x, y)) { @@ -699,7 +700,7 @@ void WorldPosition::loadMapAndVMap(uint32 mapId, uint8 x, uint8 y) sPlayerbotAIConfig.log(fileName, out.str().c_str()); } } - } + // } } void WorldPosition::loadMapAndVMaps(WorldPosition secondPos) @@ -1208,9 +1209,13 @@ bool QuestObjectiveTravelDestination::isActive(Player* bot) GuidVector targets = AI_VALUE(GuidVector, "possible targets"); for (auto& target : targets) - if (target.GetEntry() == getEntry() && target.IsCreature() && botAI->GetCreature(target) && + { + const int64_t targetEntry = target.GetEntry(); + + if (targetEntry == getEntry() && target.IsCreature() && botAI->GetCreature(target) && botAI->GetCreature(target)->IsAlive()) return true; + } return false; } @@ -1260,7 +1265,9 @@ bool RpgTravelDestination::isActive(Player* bot) for (ObjectGuid const guid : ignoreList) { - if (guid.GetEntry() == getEntry()) + const int64_t guidGetEntry = guid.GetEntry(); + + if (guidGetEntry == getEntry()) { return false; } @@ -1406,9 +1413,13 @@ bool BossTravelDestination::isActive(Player* bot) GuidVector targets = AI_VALUE(GuidVector, "possible targets"); for (auto& target : targets) - if (target.GetEntry() == getEntry() && target.IsCreature() && botAI->GetCreature(target) && + { + const int64_t targetEntry = target.GetEntry(); + + if (targetEntry == getEntry() && target.IsCreature() && botAI->GetCreature(target) && botAI->GetCreature(target)->IsAlive()) return true; + } return false; } @@ -3784,7 +3795,7 @@ uint32 TravelMgr::getDialogStatus(Player* pPlayer, int32 questgiver, Quest const // Selects a random WorldPosition from a list. Use a distance weighted distribution. std::vector TravelMgr::getNextPoint(WorldPosition* center, std::vector points, - uint32 amount) + uint32) { std::vector retVec; @@ -4038,7 +4049,7 @@ std::vector TravelMgr::getRpgTravelDestinations(Player* bot, retTravelLocations.push_back(dest); } - return std::move(retTravelLocations); + return retTravelLocations; } std::vector TravelMgr::getExploreTravelDestinations(Player* bot, bool ignoreFull, From da4d7d8ff2e766de465544ccd81264a984f7a08f Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 11:41:55 +0100 Subject: [PATCH 217/222] fix: Resolved all warnings in TravelNode.cpp. --- src/Mgr/Travel/TravelNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mgr/Travel/TravelNode.cpp b/src/Mgr/Travel/TravelNode.cpp index 5d740075da..0cb88f9b11 100644 --- a/src/Mgr/Travel/TravelNode.cpp +++ b/src/Mgr/Travel/TravelNode.cpp @@ -364,7 +364,7 @@ std::vector TravelNode::getNodeMap(bool importantOnly, std::vector< } } - return std::move(closeList); + return closeList; } bool TravelNode::isUselessLink(TravelNode* farNode) @@ -1135,7 +1135,7 @@ std::vector TravelNodeMap::getNodes(WorldPosition pos, float range) [pos](TravelNode* i, TravelNode* j) { return i->getPosition()->distance(pos) < j->getPosition()->distance(pos); }); - return std::move(retVec); + return retVec; } TravelNode* TravelNodeMap::getNode(WorldPosition pos, [[maybe_unused]] std::vector& ppath, Unit* bot, From e331042b1bc4f7d432854d472605f3611d44bf77 Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 12:18:24 +0100 Subject: [PATCH 218/222] fix: Resolved all warnings in RaidMagtheridonActions.cpp and a circular reference. --- .../Raid/Magtheridon/Action/RaidMagtheridonActions.cpp | 8 ++++---- src/Bot/Engine/AiObjectContext.h | 2 ++ src/Bot/Engine/Value/Value.h | 8 ++++---- src/Bot/Factory/AiFactory.h | 10 +++++----- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp index 1de87d1acb..5ad70ca292 100644 --- a/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp +++ b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp @@ -458,7 +458,7 @@ bool MagtheridonSpreadRangedAction::Execute(Event) uint8 count = members.size(); float angle = 2 * M_PI * botIndex / count; - float radius = static_cast(rand()) / RAND_MAX * maxSpreadRadius; + float radius = static_cast(rand()) / static_cast(RAND_MAX) * maxSpreadRadius; float targetX = centerX + radius * cos(angle); float targetY = centerY + radius * sin(angle); @@ -491,8 +491,8 @@ bool MagtheridonSpreadRangedAction::Execute(Event) if (distToCenter > maxSpreadRadius + radiusBuffer) { - float angle = static_cast(rand()) / RAND_MAX * 2.0f * M_PI; - float radius = static_cast(rand()) / RAND_MAX * maxSpreadRadius; + float angle = static_cast(rand()) / static_cast(RAND_MAX) * 2.0f * M_PI; + float radius = static_cast(rand()) / static_cast(RAND_MAX) * maxSpreadRadius; float targetX = centerX + radius * cos(angle); float targetY = centerY + radius * sin(angle); @@ -600,7 +600,7 @@ bool MagtheridonUseManticronCubeAction::HandleWaitingPhase(const CubeInfo& cubeI } } - float angle = static_cast(rand()) / RAND_MAX * 2.0f * M_PI; + float angle = static_cast(rand()) / static_cast(RAND_MAX) * 2.0f * M_PI; float fallbackX = cubeInfo.x + cos(angle) * safeWaitDistance; float fallbackY = cubeInfo.y + sin(angle) * safeWaitDistance; float fallbackZ = bot->GetPositionZ(); diff --git a/src/Bot/Engine/AiObjectContext.h b/src/Bot/Engine/AiObjectContext.h index 3ffd1850ff..e5e68fc01c 100644 --- a/src/Bot/Engine/AiObjectContext.h +++ b/src/Bot/Engine/AiObjectContext.h @@ -19,6 +19,8 @@ class PlayerbotAI; +class Strategy; + typedef Strategy* (*StrategyCreator)(PlayerbotAI* botAI); typedef Action* (*ActionCreator)(PlayerbotAI* botAI); typedef Trigger* (*TriggerCreator)(PlayerbotAI* botAI); diff --git a/src/Bot/Engine/Value/Value.h b/src/Bot/Engine/Value/Value.h index fe84bb4d79..4ab7b3fbb0 100644 --- a/src/Bot/Engine/Value/Value.h +++ b/src/Bot/Engine/Value/Value.h @@ -154,11 +154,11 @@ class SingleCalculatedValue : public CalculatedValue { this->lastCheckTime = now; - PerfMonitorOperation* pmo = sPerfMonitor.start( - PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); + // PerfMonitorOperation* pmo = sPerfMonitor.start( + // PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); this->value = this->Calculate(); - if (pmo) - pmo->finish(); + // if (pmo) + // pmo->finish(); } return this->value; diff --git a/src/Bot/Factory/AiFactory.h b/src/Bot/Factory/AiFactory.h index 3d11d80aeb..052aefc4b5 100644 --- a/src/Bot/Factory/AiFactory.h +++ b/src/Bot/Factory/AiFactory.h @@ -6,16 +6,16 @@ #ifndef _PLAYERBOT_AIFACTORY_H #define _PLAYERBOT_AIFACTORY_H +#include #include - -#include "Common.h" +#include class AiObjectContext; class Engine; class Player; class PlayerbotAI; -enum BotRoles : uint8; +enum BotRoles : uint8_t; class AiFactory { @@ -28,8 +28,8 @@ class AiFactory static void AddDefaultDeadStrategies(Player* player, PlayerbotAI* const facade, Engine* deadEngine); static void AddDefaultCombatStrategies(Player* player, PlayerbotAI* const facade, Engine* engine); - static uint8 GetPlayerSpecTab(Player* player); - static std::map GetPlayerSpecTabs(Player* player); + static uint8_t GetPlayerSpecTab(Player* player); + static std::map GetPlayerSpecTabs(Player* player); static BotRoles GetPlayerRoles(Player* player); static std::string GetPlayerSpecName(Player* player); }; From 05532f13248d04215c8cba63395e4bcfbeecfa9c Mon Sep 17 00:00:00 2001 From: SmashingQuasar Date: Fri, 30 Jan 2026 14:24:53 +0100 Subject: [PATCH 219/222] fix: Resolved a logic issue within PvpValues.cpp that was introduced during the refactor. --- src/Ai/Base/Value/PvpValues.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Ai/Base/Value/PvpValues.cpp b/src/Ai/Base/Value/PvpValues.cpp index e68a613a9b..7160e1654e 100644 --- a/src/Ai/Base/Value/PvpValues.cpp +++ b/src/Ai/Base/Value/PvpValues.cpp @@ -19,34 +19,31 @@ Player* FlagCarrierValue::GetBattlegroundFlagCarrier(Battleground& battleground) return nullptr; } - const ObjectGuid& flagCarrierGUID = battleground.GetFlagPickerGUID(); + const TeamId botTeamId = this->bot->GetTeamId(); + const TeamId opposedTeamId = botTeamId == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE; - if (flagCarrierGUID.IsEmpty()) + TeamId flagCarrierTeamIdLookup = TEAM_NEUTRAL; + + if (mapId == MAP_EYE_OF_THE_STORM) { - return nullptr; + flagCarrierTeamIdLookup = this->sameTeam ? botTeamId : opposedTeamId; } - Player* const flagCarrier = ObjectAccessor::GetPlayer(battleground.GetBgMap(), flagCarrierGUID); + const ObjectGuid& flagCarrierGUID = battleground.GetFlagPickerGUID(flagCarrierTeamIdLookup); - if (flagCarrier == nullptr) + if (flagCarrierGUID.IsEmpty()) { return nullptr; } - const TeamId& flagCarrierTeamId = flagCarrier->GetTeamId(); - const TeamId& botTeamId = this->bot->GetTeamId(); - - if (!this->sameTeam && flagCarrierTeamId != botTeamId) - { - return flagCarrier; - } + Player* const flagCarrier = ObjectAccessor::GetPlayer(battleground.GetBgMap(), flagCarrierGUID); - if (this->sameTeam && flagCarrierTeamId == botTeamId) + if (flagCarrier == nullptr) { - return flagCarrier; + return nullptr; } - return nullptr; + return flagCarrier; } Unit* FlagCarrierValue::Calculate() From 7f0249453880db5ec824acd9e84621538fb318c8 Mon Sep 17 00:00:00 2001 From: Keleborn <22352763+Celandriel@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:31:14 -0800 Subject: [PATCH 220/222] Revert drink changes. --- src/Ai/Base/ActionContext.h | 1 - src/Ai/Base/Actions/NonCombatActions.cpp | 55 +++++++++ src/Ai/Base/Actions/NonCombatActions.h | 10 ++ .../inspector/abstract/AbstractInspector.h | 19 --- .../abstract/AbstractPlayerInspector.h | 37 ------ .../inspector/global/GlobalPlayerInspector.h | 107 ----------------- .../actions/non-combat/drink/DrinkAction.h | 88 -------------- .../drink/definition/enum/DrinkAuraEnum.h | 110 ------------------ 8 files changed, 65 insertions(+), 362 deletions(-) delete mode 100644 src/domain/core/inspector/abstract/AbstractInspector.h delete mode 100644 src/domain/player/inspector/abstract/AbstractPlayerInspector.h delete mode 100644 src/domain/player/inspector/global/GlobalPlayerInspector.h delete mode 100644 src/strategy/actions/non-combat/drink/DrinkAction.h delete mode 100644 src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h diff --git a/src/Ai/Base/ActionContext.h b/src/Ai/Base/ActionContext.h index 23931f62b6..93bba4afee 100644 --- a/src/Ai/Base/ActionContext.h +++ b/src/Ai/Base/ActionContext.h @@ -43,7 +43,6 @@ #include "MoveToTravelTargetAction.h" #include "MovementActions.h" #include "NonCombatActions.h" -#include "DrinkAction.h" #include "OutfitAction.h" #include "PositionAction.h" #include "DropQuestAction.h" diff --git a/src/Ai/Base/Actions/NonCombatActions.cpp b/src/Ai/Base/Actions/NonCombatActions.cpp index 22e6cd802e..492da8ae6b 100644 --- a/src/Ai/Base/Actions/NonCombatActions.cpp +++ b/src/Ai/Base/Actions/NonCombatActions.cpp @@ -8,6 +8,61 @@ #include "Event.h" #include "Playerbots.h" +bool DrinkAction::Execute(Event event) +{ + if (botAI->HasCheat(BotCheatMask::food)) + { + // if (bot->IsNonMeleeSpellCast(true)) + // return false; + + bot->ClearUnitState(UNIT_STATE_CHASE); + bot->ClearUnitState(UNIT_STATE_FOLLOW); + + if (bot->isMoving()) + { + bot->StopMoving(); + // botAI->SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); + // return false; + } + bot->SetStandState(UNIT_STAND_STATE_SIT); + botAI->InterruptSpell(); + + // float hp = bot->GetHealthPercent(); + float mp = bot->GetPowerPct(POWER_MANA); + float p = mp; + float delay; + + if (!bot->InBattleground()) + delay = 18000.0f * (100 - p) / 100.0f; + else + delay = 12000.0f * (100 - p) / 100.0f; + + botAI->SetNextCheckDelay(delay); + + bot->AddAura(25990, bot); + return true; + // return botAI->CastSpell(24707, bot); + } + + return UseItemAction::Execute(event); +} + +bool DrinkAction::isUseful() +{ + return UseItemAction::isUseful() && + AI_VALUE2(bool, "has mana", "self target") && + AI_VALUE2(uint8, "mana", "self target") < 100; +} + +bool DrinkAction::isPossible() +{ + return !bot->IsInCombat() && + !bot->IsMounted() && + !botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", + "aquatic form","flight form", "swift flight form", nullptr) && + (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible()); +} + bool EatAction::Execute(Event event) { if (botAI->HasCheat(BotCheatMask::food)) diff --git a/src/Ai/Base/Actions/NonCombatActions.h b/src/Ai/Base/Actions/NonCombatActions.h index 86b353cf0a..3156d49921 100644 --- a/src/Ai/Base/Actions/NonCombatActions.h +++ b/src/Ai/Base/Actions/NonCombatActions.h @@ -10,6 +10,16 @@ class PlayerbotAI; +class DrinkAction : public UseItemAction +{ +public: + DrinkAction(PlayerbotAI* botAI) : UseItemAction(botAI, "drink") {} + + bool Execute(Event event) override; + bool isUseful() override; + bool isPossible() override; +}; + class EatAction : public UseItemAction { public: diff --git a/src/domain/core/inspector/abstract/AbstractInspector.h b/src/domain/core/inspector/abstract/AbstractInspector.h deleted file mode 100644 index 7906180f65..0000000000 --- a/src/domain/core/inspector/abstract/AbstractInspector.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -class AbstractInspector -{ -protected: - AbstractInspector() = default; - ~AbstractInspector() = default; - - AbstractInspector(AbstractInspector const&) = default; - AbstractInspector& operator=(AbstractInspector const&) = default; - - AbstractInspector(AbstractInspector&&) = default; - AbstractInspector& operator=(AbstractInspector&&) = default; - - virtual bool isInspectable() const - { - return true; - } -}; diff --git a/src/domain/player/inspector/abstract/AbstractPlayerInspector.h b/src/domain/player/inspector/abstract/AbstractPlayerInspector.h deleted file mode 100644 index 66e5874a08..0000000000 --- a/src/domain/player/inspector/abstract/AbstractPlayerInspector.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include - -#include "ObjectGuid.h" -#include "ObjectAccessor.h" -#include "Player.h" - -#include "AbstractInspector.h" - -class AbstractPlayerInspector : public AbstractInspector -{ -public: - AbstractPlayerInspector( - uint64_t playerGUID - ) : - playerGUID(playerGUID) - {} - - AbstractPlayerInspector& operator=(AbstractPlayerInspector const&) = delete; - - Player* getCurrentPlayer() const - { - const ObjectGuid playerFullGUID = ObjectGuid::Create(this->playerGUID); - Player* const player = ObjectAccessor::FindPlayer(playerFullGUID); - - return player; - } - - bool isInspectable() const override - { - return true; - } - -protected: - const uint64_t playerGUID; -}; diff --git a/src/domain/player/inspector/global/GlobalPlayerInspector.h b/src/domain/player/inspector/global/GlobalPlayerInspector.h deleted file mode 100644 index 7d397af66b..0000000000 --- a/src/domain/player/inspector/global/GlobalPlayerInspector.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -#include - -#include "ObjectAccessor.h" -#include "SharedDefines.h" -#include "Player.h" -#include "GridNotifiers.h" - -#include "AiObjectContext.h" -#include "AiFactory.h" -#include "PlayerbotAI.h" -#include "AbstractPlayerInspector.h" -#include "PlayerbotMgr.h" - -class GlobalPlayerInspector : public AbstractPlayerInspector -{ -public: - GlobalPlayerInspector( - uint64_t playerGUID - ) : - AbstractPlayerInspector(playerGUID) - {} - - bool isDrinking() const - { - const Player* const player = this->getCurrentPlayer(); - - if (player == nullptr) - return false; - - if (!player->IsSitState()) - return false; - - return player->HasAuraType(SPELL_AURA_MOD_POWER_REGEN) || player->HasAuraType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); - } - - bool isEating() const - { - const Player* const player = this->getCurrentPlayer(); - - if (player == nullptr) - return false; - - if (!player->IsSitState()) - return false; - - return player->HasAuraType(SPELL_AURA_MOD_REGEN) || player->HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); - } - - bool shouldBeDrinking(float manaThresholdPercent) const - { - Player* const player = this->getCurrentPlayer(); - - if (player == nullptr) - return false; - - if (!player->HasActivePowerType(POWER_MANA)) - return false; - - if (player->IsInCombat()) - return false; - - if (player->GetPowerPct(POWER_MANA) > manaThresholdPercent) - return false; - - if (player->IsUnderWater()) - return false; - - // Bots must not keep drinking if they have hostile entities close to them! - if (this->hasHostileUnitsInRange(15.0f)) - return false; - - PlayerbotAI* botAI = PlayerbotsMgr::instance().GetPlayerbotAI(player); - - if (botAI == nullptr) - return false; - - AiObjectContext* context = botAI->GetAiObjectContext(); - - if (context == nullptr) - return false; - - bool hasAvailableLoot = context->GetValue("loot target"); - - if (hasAvailableLoot) - return false; - - return true; - } - - bool hasHostileUnitsInRange(float range) const - { - const Player* const player = this->getCurrentPlayer(); - - if (player == nullptr) - return false; - - std::list targets; - - Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(player, range); - Acore::UnitListSearcher searcher(player, targets, u_check); - Cell::VisitObjects(player, searcher, PlayerbotAIConfig::instance().sightDistance); - - return !targets.empty(); - } -}; diff --git a/src/strategy/actions/non-combat/drink/DrinkAction.h b/src/strategy/actions/non-combat/drink/DrinkAction.h deleted file mode 100644 index f0f895cea2..0000000000 --- a/src/strategy/actions/non-combat/drink/DrinkAction.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_DRINK_ACTION_H -#define _PLAYERBOT_DRINK_ACTION_H - -#include - -#include "Event.h" -#include "UseItemAction.h" -#include "GlobalPlayerInspector.h" -#include "DrinkAuraEnum.h" - - -class PlayerbotAI; - -class DrinkAction : public UseItemAction -{ -public: - DrinkAction(PlayerbotAI* botAI) : UseItemAction(botAI, "drink") {} - - bool isPossible() override - { - if (this->bot->IsInCombat()) - { - return false; - } - - if (this->bot->IsMounted()) - { - return false; - } - - if (this->botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form","flight form", "swift flight form", nullptr)) - { - return false; - } - - if (this->bot->IsCrowdControlled()) - { - return false; - } - - return this->botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible(); - } - - bool isUseful() override - { - const GlobalPlayerInspector playerInspector(this->bot->GetGUID().GetRawValue()); - - if (playerInspector.isDrinking()) - return false; - - return playerInspector.shouldBeDrinking(50.0f); - } - - bool Execute(Event event) override - { - std::string name = this->bot->GetName().c_str(); - - this->bot->ClearUnitState(UNIT_STATE_CHASE); - this->bot->ClearUnitState(UNIT_STATE_FOLLOW); - - this->botAI->InterruptSpell(); - - if (this->bot->isMoving()) - this->bot->StopMoving(); - - this->bot->SetStandState(UNIT_STAND_STATE_SIT); - - if (this->botAI->HasCheat(BotCheatMask::food)) - { - this->bot->AddAura(DRINK_AURA_GRACCU_MINCE_MEAT_FRUITCAKE, bot); - - this->botAI->SetNextCheckDelay(1000); - - return true; - } - - this->botAI->SetNextCheckDelay(1000); - - return UseItemAction::Execute(event); - } -}; - -#endif diff --git a/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h b/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h deleted file mode 100644 index 94b5f14f67..0000000000 --- a/src/strategy/actions/non-combat/drink/definition/enum/DrinkAuraEnum.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_DRINK_AURA_ENUM_H -#define _PLAYERBOT_DRINK_AURA_ENUM_H - -enum DrinkAuraEnum { - DRINK_AURA_GRACCU_MINCE_MEAT_FRUITCAKE = 25990, - DRINK_AURA_FISH_FEAST = 57426, - DRINK_AURA_GREAT_FEAST = 57301, - DRINK_AURA_DRAGONFIN_FILET = 57370, - DRINK_AURA_GIGANTIC_FEAST = 58465, - DRINK_AURA_BLACKENED_DRAGONFIN = 57366, - DRINK_AURA_BLACK_JELLY = 64354, - DRINK_AURA_FIRECRACKER_SALMON = 57341, - DRINK_AURA_PURIFIED_DRAENIC_WATER = 27089, - DRINK_AURA_DALARAN_CLAM_CHOWDER = 58067, - DRINK_AURA_HOT_BUTTERED_TROUT = 42309, - DRINK_AURA_KUNGALOOSH = 52911, - DRINK_AURA_CRANBERRY_CHUTNEY = 65420, - DRINK_AURA_BAKED_MANTA_RAY = 57101, - DRINK_AURA_SLOW_ROASTED_TURKEY = 65422, - DRINK_AURA_CONJURED_MANA_STRUDEL = 43523, - DRINK_AURA_CANDIED_SWEET_POTATO = 65418, - DRINK_AURA_SPICE_BREAD_STUFFING = 65419, - DRINK_AURA_SMALL_FEAST = 58474, - DRINK_AURA_SMOKED_SAGEFISH = 25690, - DRINK_AURA_YETI_MILK = 43183, - DRINK_AURA_SNAPPER_EXTREME = 57359, - DRINK_AURA_SMOKED_ROCKFIN = 57070, - DRINK_AURA_POACHED_NETTLEFISH = 57098, - DRINK_AURA_BLACK_COFFEE = 27089, - DRINK_AURA_MOUNTAIN_WATER = 27089, - DRINK_AURA_PUMPKIN_PIE = 65421, - DRINK_AURA_FILTERED_DRAENIC_WATER = 34291, - DRINK_AURA_BITTER_PLASMA = 43182, - DRINK_AURA_WORG_TARTARE = 57359, - DRINK_AURA_CLAMLETTE_MAGNIFIQUE = 64056, - DRINK_AURA_BOUNTIFUL_FEAST = 66476, - DRINK_AURA_GRILLED_SCULPIN = 57085, - DRINK_AURA_CONJURED_MANA_PIE = 61828, - DRINK_AURA_CUTTLESTEAK = 57364, - DRINK_AURA_PUNGENT_SEAL_WHEY = 43182, - DRINK_AURA_IMPERIAL_MANTA_STEAK = 57344, - DRINK_AURA_SWEET_NECTAR = 1133, - DRINK_AURA_BOTTLED_WINTERSPRING_WATER = 1135, - DRINK_AURA_CONJURED_MOUNTAIN_SPRING_WATER = 34291, - DRINK_AURA_HONEYMINT_TEA = 43183, - DRINK_AURA_SAUTEED_GOBY = 57070, - DRINK_AURA_REFRESHING_SPRING_WATER = 430, - DRINK_AURA_ENCHANTED_WATER = 1133, - DRINK_AURA_SMOKED_SALMON = 57096, - DRINK_AURA_GRIZZLEBERRY_JUICE = 27089, - DRINK_AURA_STAR_SORROW = 43183, - DRINK_AURA_PICKLED_FANGTOOTH = 57106, - DRINK_AURA_CONJURED_FRESH_WATER = 431, - DRINK_AURA_MORNING_GLORY_DEW = 1137, - DRINK_AURA_CONJURED_GLACIER_WATER = 27089, - DRINK_AURA_SKULLFISH_SOUP = 43706, - DRINK_AURA_SWEETENED_GOAT_MILK = 27089, - DRINK_AURA_BLACKROCK_FORTIFIED_WATER = 27089, - DRINK_AURA_FIZZY_FAIRE_DRINK = 432, - DRINK_AURA_ENRICHED_TEROCONE_JUICE = 41031, - DRINK_AURA_POACHED_NORTHERN_SCULPIN = 57335, - DRINK_AURA_CRUSADER_WATERSKIN = 43183, - DRINK_AURA_ALTERAC_MANNA_BISCUIT = 23692, - DRINK_AURA_HOT_APPLE_CIDER = 45020, - DRINK_AURA_SPICY_FRIED_HERRING = 57354, - DRINK_AURA_CONJURED_WATER = 430, - DRINK_AURA_CONJURED_MINERAL_WATER = 1135, - DRINK_AURA_CONJURED_CRYSTAL_WATER = 22734, - DRINK_AURA_BUBBLING_WATER = 432, - DRINK_AURA_GRILLED_BONESCALE = 57070, - DRINK_AURA_SPICY_BLUE_NETTLEFISH = 57343, - DRINK_AURA_FRESH_APPLE_JUICE = 43182, - DRINK_AURA_ICE_COLD_MILK = 431, - DRINK_AURA_UNDERSPORE_POD = 33772, - DRINK_AURA_FRESH_SQUEEZED_LIMEADE = 43182, - DRINK_AURA_JILLIAN_GOURMET_FISH_FEAST = 57426, - DRINK_AURA_MELON_JUICE = 432, - DRINK_AURA_GILNEAS_SPARKLING_WATER = 27089, - DRINK_AURA_STAR_LAMENT = 22734, - DRINK_AURA_CONJURED_SPRING_WATER = 1133, - DRINK_AURA_HYJAL_NECTAR = 22734, - DRINK_AURA_BLACKROCK_SPRING_WATER = 1137, - DRINK_AURA_BLACKROCK_MINERAL_WATER = 34291, - DRINK_AURA_ETHERMEAD = 27089, - DRINK_AURA_GOLDTHORN_TEA = 1133, - DRINK_AURA_ENRICHED_MANNA_BISCUIT = 18071, - DRINK_AURA_GREEN_TEA_LEAF = 833, - DRINK_AURA_CONJURED_PURIFIED_WATER = 432, - DRINK_AURA_CONJURED_SPARKLING_WATER = 1137, - DRINK_AURA_STAR_TEAR = 27089, - DRINK_AURA_NAARU_RATION = 44166, - DRINK_AURA_MOONBERRY_JUICE = 1135, - DRINK_AURA_SILVERWINE = 34291, - DRINK_AURA_FULL_MOONSHINE = 438, - DRINK_AURA_DOS_OGRIS = 27089, - DRINK_AURA_ESSENCE_MANGO = 24384, - DRINK_AURA_SENGGIN_ROOT = 2639, - DRINK_AURA_BLENDED_BEAN_BREW = 431, - DRINK_AURA_SAGEFISH_DELIGHT = 25691, - DRINK_AURA_SPARKLING_SOUTHSHORE_CIDER = 27089, - DRINK_AURA_CONJURED_MANA_BISCUIT = 44166, - DRINK_AURA_FROSTBERRY_JUICE = 27089 -}; - -#endif From 9377e00d353837282e08fed96eed185db2526390 Mon Sep 17 00:00:00 2001 From: Keleborn <22352763+Celandriel@users.noreply.github.com> Date: Sat, 31 Jan 2026 15:59:30 -0800 Subject: [PATCH 221/222] Formating and inspector cleanup --- src/Ai/Base/Actions/CastCustomSpellAction.h | 1 + src/Ai/Base/Actions/ChooseTargetActions.cpp | 11 -------- src/Ai/Base/Actions/FishingAction.cpp | 1 - src/Ai/Base/Actions/GenericSpellActions.cpp | 7 ------ src/Ai/Base/Actions/InventoryAction.cpp | 2 -- src/Ai/Base/Actions/LfgActions.cpp | 2 -- src/Ai/Base/Actions/MailAction.cpp | 3 +-- src/Ai/Base/Actions/MoveToRpgTargetAction.cpp | 6 ++--- src/Ai/Base/Actions/MovementActions.cpp | 22 +++++----------- src/Ai/Base/Actions/MovementActions.h | 1 - src/Ai/Base/Actions/OpenItemAction.cpp | 2 -- .../Actions/PassLeadershipToMasterAction.cpp | 6 ----- src/Ai/Base/Actions/ReadyCheckAction.cpp | 9 +++---- .../Actions/RevealGatheringItemAction.cpp | 8 +++--- src/Ai/Base/Actions/SecurityCheckAction.cpp | 4 --- src/Ai/Base/Actions/SetCraftAction.cpp | 12 +++------ src/Ai/Base/Actions/TellReputationAction.cpp | 2 +- src/Ai/Base/Actions/TradeAction.cpp | 4 --- src/Ai/Base/Actions/TradeStatusAction.cpp | 13 ++-------- src/Ai/Base/Actions/TravelAction.cpp | 9 +++---- src/Ai/Base/Actions/UseMeetingStoneAction.cpp | 7 ++---- src/Ai/Base/Actions/WipeAction.cpp | 2 -- src/Ai/Base/Value/CraftValue.h | 1 + src/Ai/Base/Value/ItemCountValue.cpp | 4 +-- src/Ai/Base/Value/ItemUsageValue.cpp | 18 ------------- src/Ai/Base/Value/NearestCorpsesValue.cpp | 3 +-- src/Ai/Base/Value/PositionValue.h | 1 - src/Ai/Base/Value/PvpValues.cpp | 12 ++------- .../Oculus/Multiplier/OculusMultipliers.cpp | 25 +++---------------- .../PitOfSaron/Action/PitOfSaronActions.cpp | 10 ++++---- .../Action/TrialOfTheChampionActions.cpp | 6 ++--- src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp | 4 --- src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp | 10 -------- src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp | 6 ----- .../BlackwingLair/Action/RaidBwlActions.cpp | 5 +++- .../Raid/Ulduar/Action/RaidUlduarActions.cpp | 20 ++------------- .../Ulduar/Trigger/RaidUlduarTriggers.cpp | 8 +++--- src/Ai/World/Rpg/NewRpgInfo.cpp | 5 +++- src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp | 1 - src/Bot/Factory/PlayerbotFactory.cpp | 14 ++++------- src/Bot/PlayerbotAI.cpp | 10 -------- src/Mgr/Guild/PlayerbotGuildMgr.h | 2 +- src/Mgr/Item/RandomItemMgr.cpp | 5 +--- src/Mgr/Talent/Talentspec.cpp | 2 -- src/Mgr/Travel/TravelMgr.cpp | 2 +- 45 files changed, 67 insertions(+), 241 deletions(-) diff --git a/src/Ai/Base/Actions/CastCustomSpellAction.h b/src/Ai/Base/Actions/CastCustomSpellAction.h index 67bbb6ccc5..06b2daabde 100644 --- a/src/Ai/Base/Actions/CastCustomSpellAction.h +++ b/src/Ai/Base/Actions/CastCustomSpellAction.h @@ -49,6 +49,7 @@ class CastRandomSpellAction : public ListSpellsAction bool isUseful() override { return false; } virtual bool AcceptSpell(SpellInfo const* spellInfo); + //TODO Why is this like this? virtual uint32 GetSpellPriority(SpellInfo const*) { return 1; } virtual bool castSpell(uint32 spellId, WorldObject* wo); bool Execute(Event event) override; diff --git a/src/Ai/Base/Actions/ChooseTargetActions.cpp b/src/Ai/Base/Actions/ChooseTargetActions.cpp index 793f61000e..f330134b7d 100644 --- a/src/Ai/Base/Actions/ChooseTargetActions.cpp +++ b/src/Ai/Base/Actions/ChooseTargetActions.cpp @@ -113,23 +113,12 @@ bool AttackAnythingAction::Execute(Event event) bool result = AttackAction::Execute(event); if (!result) - { return false; - } const Unit* const grindTarget = this->GetTarget(); if (grindTarget == nullptr) - { return true; - } - - const std::string& grindTargetName = grindTarget->GetName(); - - if (grindTargetName.empty()) - { - return true; - } this->context->GetValue("pull target")->Set(grindTarget->GetGUID()); this->bot->GetMotionMaster()->Clear(); diff --git a/src/Ai/Base/Actions/FishingAction.cpp b/src/Ai/Base/Actions/FishingAction.cpp index c38cbe576a..a1cc76ae4c 100644 --- a/src/Ai/Base/Actions/FishingAction.cpp +++ b/src/Ai/Base/Actions/FishingAction.cpp @@ -8,7 +8,6 @@ #include "Event.h" #include "GridNotifiers.h" -// Required due to poor AC implementation #include "GridNotifiersImpl.h" #include "ItemPackets.h" #include "LastMovementValue.h" diff --git a/src/Ai/Base/Actions/GenericSpellActions.cpp b/src/Ai/Base/Actions/GenericSpellActions.cpp index 0762bbdaab..e5f23558bf 100644 --- a/src/Ai/Base/Actions/GenericSpellActions.cpp +++ b/src/Ai/Base/Actions/GenericSpellActions.cpp @@ -173,23 +173,16 @@ bool CastAuraSpellAction::isUseful() Unit* const target = this->GetTarget(); if (target == nullptr || !CastSpellAction::isUseful()) - { return false; - } const Aura* const aura = botAI->GetAura(this->spell, target, this->isOwner, this->checkDuration); if (aura == nullptr) - { return true; - } - const int64_t& signedBeforeDuration = this->beforeDuration; if (signedBeforeDuration > 0 && aura->GetDuration() < signedBeforeDuration) - { return true; - } return false; } diff --git a/src/Ai/Base/Actions/InventoryAction.cpp b/src/Ai/Base/Actions/InventoryAction.cpp index aa77bafae6..3ce8c02ec4 100644 --- a/src/Ai/Base/Actions/InventoryAction.cpp +++ b/src/Ai/Base/Actions/InventoryAction.cpp @@ -351,9 +351,7 @@ uint32 InventoryAction::GetItemCount(FindItemVisitor* visitor, IterateItemsMask std::vector& items = visitor->GetResult(); for (Item* item : items) - { count += item->GetCount(); - } return count; } diff --git a/src/Ai/Base/Actions/LfgActions.cpp b/src/Ai/Base/Actions/LfgActions.cpp index 1a3a332715..90db4ae956 100644 --- a/src/Ai/Base/Actions/LfgActions.cpp +++ b/src/Ai/Base/Actions/LfgActions.cpp @@ -185,9 +185,7 @@ bool LfgRoleCheckAction::Execute(Event) const Group* const group = bot->GetGroup(); if (group == nullptr) - { return false; - } const uint8_t newRoles = this->GetRoles(); diff --git a/src/Ai/Base/Actions/MailAction.cpp b/src/Ai/Base/Actions/MailAction.cpp index cbbc6eb6c5..3541360989 100644 --- a/src/Ai/Base/Actions/MailAction.cpp +++ b/src/Ai/Base/Actions/MailAction.cpp @@ -108,9 +108,8 @@ class TakeMailProcessor : public MailProcessor const ItemTemplate* const itemTemplate = ObjectMgr::instance()->GetItemTemplate(i->item_template); if (itemTemplate != nullptr) - { guids.push_back(i->item_guid); - } + } for (std::vector::iterator i = guids.begin(); i != guids.end(); ++i) diff --git a/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp b/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp index 0fbbf6b7e9..f24cb2470d 100644 --- a/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp +++ b/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp @@ -16,14 +16,12 @@ bool MoveToRpgTargetAction::Execute(Event) GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target"); Unit* unit = botAI->GetUnit(guidP); if (unit && !unit->IsInWorld()) - { return false; - } + GameObject* go = botAI->GetGameObject(guidP); if (go && !go->IsInWorld()) - { return false; - } + WorldObject* wo = nullptr; if (unit) diff --git a/src/Ai/Base/Actions/MovementActions.cpp b/src/Ai/Base/Actions/MovementActions.cpp index a052fe2e3f..1aac5fcd9b 100644 --- a/src/Ai/Base/Actions/MovementActions.cpp +++ b/src/Ai/Base/Actions/MovementActions.cpp @@ -64,17 +64,14 @@ bool MovementAction::JumpTo(uint32 mapId, float x, float y, float z, MovementPri { UpdateMovementState(); if (!IsMovingAllowed(mapId, x, y, z)) - { return false; - } + if (IsDuplicateMove(mapId, x, y, z)) - { return false; - } + if (IsWaitingForLastMove(priority)) - { return false; - } + float speed = bot->GetSpeed(MOVE_RUN); MotionMaster& mm = *bot->GetMotionMaster(); mm.Clear(); @@ -1844,9 +1841,7 @@ bool FleeAction::isUseful() bool FleeWithPetAction::Execute(Event) { if (bot->GetPet() != nullptr) - { botAI->PetFollow(); - } return Flee(AI_VALUE(Unit*, "current target")); } @@ -1856,9 +1851,8 @@ bool AvoidAoeAction::isUseful() const int64_t currentMoveTimer = getMSTime() - this->lastMoveTimer; if (currentMoveTimer < this->lastMoveTimer) - { return false; - } + GuidVector traps = AI_VALUE(GuidVector, "nearest trap with damage"); GuidVector triggers = AI_VALUE(GuidVector, "possible triggers"); return AI_VALUE(Aura*, "area debuff") || !traps.empty() || !triggers.empty(); @@ -2290,13 +2284,11 @@ bool CombatFormationMoveAction::isUseful() const int64_t currentMoveTimer = getMSTime() - this->lastMoveTimer; if (currentMoveTimer < this->lastMoveTimer) - { return false; - } + if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) - { return false; - } + return true; } @@ -2889,9 +2881,7 @@ bool MoveAwayFromPlayerWithDebuffAction::Execute(Event) Group* const group = bot->GetGroup(); if (group == nullptr) - { return false; - } std::vector debuffedPlayers; diff --git a/src/Ai/Base/Actions/MovementActions.h b/src/Ai/Base/Actions/MovementActions.h index 046805ccf3..74901d7293 100644 --- a/src/Ai/Base/Actions/MovementActions.h +++ b/src/Ai/Base/Actions/MovementActions.h @@ -333,7 +333,6 @@ class MoveAwayFromPlayerWithDebuffAction : public MovementAction private: uint32 spellId; float range; - bool alive; }; #endif diff --git a/src/Ai/Base/Actions/OpenItemAction.cpp b/src/Ai/Base/Actions/OpenItemAction.cpp index b298aef855..9372afd740 100644 --- a/src/Ai/Base/Actions/OpenItemAction.cpp +++ b/src/Ai/Base/Actions/OpenItemAction.cpp @@ -12,9 +12,7 @@ bool OpenItemAction::Execute(Event) Item* const item = botAI->FindOpenableItem(); if (item == nullptr) - { return false; - } uint8_t bag = item->GetBagSlot(); // Retrieves the bag slot (255 for main inventory) uint8_t slot = item->GetSlot(); // Retrieves the actual slot inside the bag diff --git a/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp b/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp index 5019a9a8ab..89bdabf317 100644 --- a/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp +++ b/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp @@ -14,24 +14,18 @@ bool PassLeadershipToMasterAction::Execute(Event) const Player* const master = this->GetMaster(); if (master == nullptr || master == this->bot) - { return false; - } const Group* const group = this->bot->GetGroup(); if (group == nullptr || !bot->GetGroup()->IsMember(master->GetGUID())) - { return false; - } std::unique_ptr setLeaderOp = std::make_unique(this->bot->GetGUID(), master->GetGUID()); PlayerbotWorldThreadProcessor::instance().QueueOperation(std::move(setLeaderOp)); if (!message.empty()) - { this->botAI->TellMasterNoFacing(message); - } if (RandomPlayerbotMgr::instance().IsRandomBot(this->bot)) { diff --git a/src/Ai/Base/Actions/ReadyCheckAction.cpp b/src/Ai/Base/Actions/ReadyCheckAction.cpp index 671fef37dd..ff91efd6e6 100644 --- a/src/Ai/Base/Actions/ReadyCheckAction.cpp +++ b/src/Ai/Base/Actions/ReadyCheckAction.cpp @@ -14,14 +14,10 @@ std::string_view getColorForThreshold(const float threshold) { if (threshold > 75.0f) - { return "|cff00ff00"; - } if (threshold > 50.0f) - { return "|cffffff00"; - } return "|cffff0000"; } @@ -238,4 +234,7 @@ bool ReadyCheckAction::ReadyCheck() return true; } -bool FinishReadyCheckAction::Execute(Event) { return ReadyCheck(); } +bool FinishReadyCheckAction::Execute(Event) +{ + return ReadyCheck(); +} diff --git a/src/Ai/Base/Actions/RevealGatheringItemAction.cpp b/src/Ai/Base/Actions/RevealGatheringItemAction.cpp index 7c2a3c85ee..c51ba6a5c5 100644 --- a/src/Ai/Base/Actions/RevealGatheringItemAction.cpp +++ b/src/Ai/Base/Actions/RevealGatheringItemAction.cpp @@ -5,16 +5,14 @@ #include "RevealGatheringItemAction.h" +#include "CellImpl.h" #include "ChatHelper.h" #include "Event.h" #include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "PlayerbotAI.h" #include "ServerFacade.h" #include "NearestGameObjects.h" -#include "PlayerbotAI.h" - -// Required due to a poor implementation by AC -#include "CellImpl.h" -#include "GridNotifiersImpl.h" bool RevealGatheringItemAction::Execute(Event) { diff --git a/src/Ai/Base/Actions/SecurityCheckAction.cpp b/src/Ai/Base/Actions/SecurityCheckAction.cpp index b1c5825076..366fc18949 100644 --- a/src/Ai/Base/Actions/SecurityCheckAction.cpp +++ b/src/Ai/Base/Actions/SecurityCheckAction.cpp @@ -21,17 +21,13 @@ bool SecurityCheckAction::Execute(Event) const Group* const group = bot->GetGroup(); if (group == nullptr) - { return false; - } const LootMethod method = group->GetLootMethod(); const ItemQualities threshold = group->GetLootThreshold(); if (method != MASTER_LOOT && method != FREE_FOR_ALL && threshold <= ITEM_QUALITY_UNCOMMON) - { return false; - } if ( (this->botAI->GetGroupLeader()->GetSession()->GetSecurity() == SEC_PLAYER) diff --git a/src/Ai/Base/Actions/SetCraftAction.cpp b/src/Ai/Base/Actions/SetCraftAction.cpp index f062ce5c23..40134821f1 100644 --- a/src/Ai/Base/Actions/SetCraftAction.cpp +++ b/src/Ai/Base/Actions/SetCraftAction.cpp @@ -49,9 +49,7 @@ bool SetCraftAction::Execute(Event event) if (skillSpells.empty()) { for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore) - { skillSpells[skillLine->Spell] = skillLine; - } } data.required.clear(); @@ -68,7 +66,8 @@ bool SetCraftAction::Execute(Event event) if (!spellInfo) continue; - if (SkillLineAbilityEntry const* skillLine = skillSpells[spellId]) + SkillLineAbilityEntry const* skillLine = skillSpells[spellId]; + if (skillLine != nullptr) { for (uint8 i = 0; i < 3; ++i) { @@ -78,9 +77,7 @@ bool SetCraftAction::Execute(Event event) for (uint32 x = 0; x < MAX_SPELL_REAGENTS; ++x) { if (spellInfo->Reagent[x] <= 0) - { continue; - } uint32 itemid = spellInfo->Reagent[x]; uint32 reagentsRequired = spellInfo->ReagentCount[x]; @@ -132,9 +129,8 @@ void SetCraftAction::TellCraft() if (ItemTemplate const* reagent = sObjectMgr->GetItemTemplate(item)) { if (first) - { first = false; - } + else out << ", "; @@ -142,9 +138,7 @@ void SetCraftAction::TellCraft() uint32 given = data.obtained[item]; if (given) - { out << "|cffffff00(x" << given << " given)|r "; - } } } diff --git a/src/Ai/Base/Actions/TellReputationAction.cpp b/src/Ai/Base/Actions/TellReputationAction.cpp index 050a2457a5..90ad3dab35 100644 --- a/src/Ai/Base/Actions/TellReputationAction.cpp +++ b/src/Ai/Base/Actions/TellReputationAction.cpp @@ -6,8 +6,8 @@ #include "TellReputationAction.h" #include "Event.h" -#include "ReputationMgr.h" #include "PlayerbotAI.h" +#include "ReputationMgr.h" bool TellReputationAction::Execute(Event) { diff --git a/src/Ai/Base/Actions/TradeAction.cpp b/src/Ai/Base/Actions/TradeAction.cpp index 84faae89f4..6813b4d090 100644 --- a/src/Ai/Base/Actions/TradeAction.cpp +++ b/src/Ai/Base/Actions/TradeAction.cpp @@ -64,9 +64,7 @@ bool TradeAction::Execute(Event event) const int32_t possibleValue = atoi(text.substr(pos + 1).c_str()); if (possibleValue > 0) - { count = possibleValue; - } } std::vector found = parseItems(text); @@ -117,9 +115,7 @@ bool TradeAction::TradeItem(Item const* item, int8 slot) for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT && tradeSlot == -1; i++) { if (pTrade->GetItem(TradeSlots(i)) == nullptr) - { tradeSlot = i; - } } } diff --git a/src/Ai/Base/Actions/TradeStatusAction.cpp b/src/Ai/Base/Actions/TradeStatusAction.cpp index 72ddb87109..96a7180a85 100644 --- a/src/Ai/Base/Actions/TradeStatusAction.cpp +++ b/src/Ai/Base/Actions/TradeStatusAction.cpp @@ -163,9 +163,7 @@ bool TradeStatusAction::CheckTrade() { Item* item = bot->GetTradeData()->GetItem((TradeSlots)slot); if (item) - { break; - } } bool isGettingItem = false; for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot) @@ -272,14 +270,11 @@ bool TradeStatusAction::CheckTrade() botAI->PlaySound(TEXT_EMOTE_NO); return false; } - success = true; } } else - { success = true; - } if (success) { @@ -336,9 +331,7 @@ int32 TradeStatusAction::CalculateCost(Player* player, bool sell) if (!craftData.IsEmpty()) { if (player == trader && !sell && craftData.IsRequired(proto->ItemId)) - { continue; - } if (player == bot && sell && craftData.itemId == proto->ItemId && craftData.IsFulfilled()) { @@ -348,13 +341,11 @@ int32 TradeStatusAction::CalculateCost(Player* player, bool sell) } if (sell) - { sum += item->GetCount() * proto->SellPrice * sRandomPlayerbotMgr.GetSellMultiplier(bot); - } + else - { sum += item->GetCount() * proto->BuyPrice * sRandomPlayerbotMgr.GetBuyMultiplier(bot); - } + } return sum; diff --git a/src/Ai/Base/Actions/TravelAction.cpp b/src/Ai/Base/Actions/TravelAction.cpp index 0038425f80..40fa9ee2a9 100644 --- a/src/Ai/Base/Actions/TravelAction.cpp +++ b/src/Ai/Base/Actions/TravelAction.cpp @@ -5,11 +5,10 @@ #include "TravelAction.h" -#include "GridNotifiers.h" -#include "Playerbots.h" -// Required due to a poor implementation by AC #include "CellImpl.h" +#include "GridNotifiers.h" #include "GridNotifiersImpl.h" +#include "Playerbots.h" bool TravelAction::Execute(Event) { @@ -66,9 +65,11 @@ bool TravelAction::isUseful() bool MoveToDarkPortalAction::Execute(Event) { if (bot->GetGroup()) + { if (bot->GetGroup()->GetLeaderGUID() != bot->GetGUID() && !GET_PLAYERBOT_AI(GET_PLAYERBOT_AI(bot)->GetGroupLeader())) return false; + } if (bot->GetLevel() > 57) { @@ -134,9 +135,7 @@ bool MoveFromDarkPortalAction::Execute(Event) RESET_AI_VALUE(GuidPosition, "rpg target"); if (bot->GetTeamId() == TEAM_ALLIANCE) - { return MoveTo(530, -319.261f, 1027.213, 54.172638f, false, true); - } return MoveTo(530, -180.444f, 1027.947, 54.181538f, false, true); } diff --git a/src/Ai/Base/Actions/UseMeetingStoneAction.cpp b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp index a676b0cf28..cbcc241b4f 100644 --- a/src/Ai/Base/Actions/UseMeetingStoneAction.cpp +++ b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp @@ -5,15 +5,14 @@ #include "UseMeetingStoneAction.h" +#include "CellImpl.h" #include "Event.h" #include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "NearestGameObjects.h" #include "PlayerbotAIConfig.h" #include "Playerbots.h" #include "PositionValue.h" -// Required because of a poor implementation by AC -#include "GridNotifiersImpl.h" -#include "CellImpl.h" bool UseMeetingStoneAction::Execute(Event event) { @@ -63,9 +62,7 @@ bool SummonAction::Execute(Event) return false; if (bot->GetPet() != nullptr) - { botAI->PetFollow(); - } if (master->GetSession()->GetSecurity() >= SEC_PLAYER) { diff --git a/src/Ai/Base/Actions/WipeAction.cpp b/src/Ai/Base/Actions/WipeAction.cpp index 7101b9f2c0..8d65a26187 100644 --- a/src/Ai/Base/Actions/WipeAction.cpp +++ b/src/Ai/Base/Actions/WipeAction.cpp @@ -12,9 +12,7 @@ bool WipeAction::Execute(Event event) const Player* const master = this->botAI->GetMaster(); if (owner != nullptr && master != nullptr && master->GetGUID() != owner->GetGUID()) - { return false; - } this->bot->Kill(this->bot, this->bot); diff --git a/src/Ai/Base/Value/CraftValue.h b/src/Ai/Base/Value/CraftValue.h index def3352b9c..313baf7d8b 100644 --- a/src/Ai/Base/Value/CraftValue.h +++ b/src/Ai/Base/Value/CraftValue.h @@ -15,6 +15,7 @@ class PlayerbotAI; class CraftData { public: + CraftData() : itemId(0) {} ~CraftData() = default; diff --git a/src/Ai/Base/Value/ItemCountValue.cpp b/src/Ai/Base/Value/ItemCountValue.cpp index 9d4cb729f9..80d8704634 100644 --- a/src/Ai/Base/Value/ItemCountValue.cpp +++ b/src/Ai/Base/Value/ItemCountValue.cpp @@ -4,16 +4,14 @@ */ #include "ItemCountValue.h" - +//todo review uint32_t ItemCountValue::Calculate() { uint32_t count = 0; std::vector items = InventoryAction::parseItems(qualifier); for (const Item* const item : items) - { count += item->GetCount(); - } return count; } diff --git a/src/Ai/Base/Value/ItemUsageValue.cpp b/src/Ai/Base/Value/ItemUsageValue.cpp index b0dcddb706..f536c65644 100644 --- a/src/Ai/Base/Value/ItemUsageValue.cpp +++ b/src/Ai/Base/Value/ItemUsageValue.cpp @@ -704,26 +704,18 @@ bool ItemUsageValue::IsItemNeededForUsefullSpell(const ItemTemplate& itemTemplat const SpellInfo* const spellInfo = SpellMgr::instance()->GetSpellInfo(spellId); if (spellInfo == nullptr) - { continue; - } if (checkAllReagents && !this->HasItemsNeededForSpell(spellId, itemTemplate)) - { continue; - } if (this->SpellGivesSkillUp(spellId, bot)) - { return true; - } const uint32_t newItemId = spellInfo->Effects[EFFECT_0].ItemType; if (newItemId == 0 || newItemId == itemTemplate.ItemId) - { continue; - } const ItemUsage usage = this->context->GetValue("item usage", newItemId)->Get(); @@ -749,33 +741,25 @@ bool ItemUsageValue::HasItemsNeededForSpell(uint32_t spellId, const ItemTemplate const SpellInfo* const spellInfo = SpellMgr::instance()->GetSpellInfo(spellId); if (spellInfo == nullptr) - { return false; - } for (uint8_t i = 0; i < MAX_SPELL_REAGENTS; i++) { if (spellInfo->ReagentCount[i] < 1 || spellInfo->Reagent[i] == 0) - { continue; - } const int64_t itemTemplateId = itemTemplate.ItemId; // If we only need 1 item then current item does not need to be // checked since we are looting/buying or already have it. if (itemTemplateId == spellInfo->Reagent[i] && spellInfo->ReagentCount[i] == 1) - { continue; - } const ItemTemplate* const requiredItemTemplate = ObjectMgr::instance()->GetItemTemplate(spellInfo->Reagent[i]); const uint32_t count = this->context->GetValue("item count", requiredItemTemplate->Name1)->Get(); if (count < spellInfo->ReagentCount[i]) - { return false; - } } return true; @@ -894,9 +878,7 @@ bool ItemUsageValue::SpellGivesSkillUp(const uint32_t spellId, const Player* con const SkillLineAbilityEntry* const skill = spellIterator->second; if (skill->SkillLine == 0) - { continue; - } const uint32_t SkillValue = bot->GetPureSkillValue(skill->SkillLine); diff --git a/src/Ai/Base/Value/NearestCorpsesValue.cpp b/src/Ai/Base/Value/NearestCorpsesValue.cpp index 3e049ea24d..b444fb4628 100644 --- a/src/Ai/Base/Value/NearestCorpsesValue.cpp +++ b/src/Ai/Base/Value/NearestCorpsesValue.cpp @@ -5,9 +5,8 @@ #include "NearestCorpsesValue.h" -#include "GridNotifiers.h" -// Required due to #include "CellImpl.h" +#include "GridNotifiers.h" #include "GridNotifiersImpl.h" class AnyDeadUnitInObjectRangeCheck diff --git a/src/Ai/Base/Value/PositionValue.h b/src/Ai/Base/Value/PositionValue.h index 9e613e1398..866312a57c 100644 --- a/src/Ai/Base/Value/PositionValue.h +++ b/src/Ai/Base/Value/PositionValue.h @@ -20,7 +20,6 @@ class PositionInfo : x(x), y(y), z(z), mapId(mapId), valueSet(valueSet) { } - PositionInfo(PositionInfo const& other) = default; PositionInfo& operator=(PositionInfo const& other) = default; diff --git a/src/Ai/Base/Value/PvpValues.cpp b/src/Ai/Base/Value/PvpValues.cpp index 7160e1654e..29f7b31d9a 100644 --- a/src/Ai/Base/Value/PvpValues.cpp +++ b/src/Ai/Base/Value/PvpValues.cpp @@ -15,9 +15,8 @@ Player* FlagCarrierValue::GetBattlegroundFlagCarrier(Battleground& battleground) const uint32_t mapId = battleground.GetMapId(); if (mapId != MAP_WARSONG_GULCH && mapId != MAP_EYE_OF_THE_STORM) - { return nullptr; - } + const TeamId botTeamId = this->bot->GetTeamId(); const TeamId opposedTeamId = botTeamId == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE; @@ -25,23 +24,18 @@ Player* FlagCarrierValue::GetBattlegroundFlagCarrier(Battleground& battleground) TeamId flagCarrierTeamIdLookup = TEAM_NEUTRAL; if (mapId == MAP_EYE_OF_THE_STORM) - { flagCarrierTeamIdLookup = this->sameTeam ? botTeamId : opposedTeamId; - } const ObjectGuid& flagCarrierGUID = battleground.GetFlagPickerGUID(flagCarrierTeamIdLookup); if (flagCarrierGUID.IsEmpty()) - { return nullptr; - } Player* const flagCarrier = ObjectAccessor::GetPlayer(battleground.GetBgMap(), flagCarrierGUID); if (flagCarrier == nullptr) - { return nullptr; - } + return flagCarrier; } @@ -51,9 +45,7 @@ Unit* FlagCarrierValue::Calculate() Battleground* const battleground = this->bot->GetBattleground(); if (battleground == nullptr) - { return nullptr; - } return this->GetBattlegroundFlagCarrier(*battleground); } diff --git a/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp index e71067d0ce..a43690a0ab 100644 --- a/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp +++ b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp @@ -16,14 +16,14 @@ float MountingDrakeMultiplier::GetValue(Action* action) // It seems like this is due to moving/other actions being processed during the 0.5 secs. // If we suppress everything, they seem to mount properly. A bit of a ham-fisted solution but it works Player* master = botAI->GetMaster(); - if (!master) { return 1.0f; } + if (!master) + return 1.0f; if (bot->GetMapId() != OCULUS_MAP_ID || !master->GetVehicleBase() || bot->GetVehicleBase()) { return 1.0f; } if (!dynamic_cast(action)) - { return 0.0f; - } + return 1.0f; } @@ -33,9 +33,8 @@ float OccFlyingMultiplier::GetValue(Action* action) // Suppresses FollowAction as well as some attack-based movements if (dynamic_cast(action) && !dynamic_cast(action)) - { return 0.0f; - } + return 1.0f; } @@ -45,9 +44,7 @@ float UromMultiplier::GetValue(Action* action) { Unit* target = action->GetTarget(); if (target && target->GetEntry() == NPC_MAGE_LORD_UROM) - { return 0.0f; - } } Unit* boss = AI_VALUE2(Unit*, "find target", "mage-lord urom"); @@ -58,26 +55,20 @@ float UromMultiplier::GetValue(Action* action) boss->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION)) { if (dynamic_cast(action) && !dynamic_cast(action)) - { return 0.0f; - } } // Don't bother avoiding Frostbomb for melee if (botAI->IsMelee(bot)) { if (dynamic_cast(action)) - { return 0.0f; - } } if (bot->HasAura(SPELL_TIME_BOMB)) { if (dynamic_cast(action) && !dynamic_cast(action)) - { return 0.0f; - } } return 1.0f; @@ -92,9 +83,7 @@ uint8 UromMultiplier::GetPhaseByCurrentPosition(Unit* unit) for (uint8 i = 0; i < 3; ++i) { if (unit->GetDistance(uromCoords[i][0], uromCoords[i][1], uromCoords[i][2]) < distance) - { return i; - } } return 3; } @@ -102,21 +91,15 @@ uint8 UromMultiplier::GetPhaseByCurrentPosition(Unit* unit) float EregosMultiplier::GetValue(Action* action) { if (action == nullptr) - { return 1.0f; - } const Unit* const boss = this->context->GetValue("find target", "ley-guardian eregos")->Get(); if (boss == nullptr) - { return 1.0f; - } if (boss->HasAura(SPELL_PLANAR_SHIFT) && action->getName() == "occ drake attack") - { return 0.0f; - } return 1.0f; } diff --git a/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp index 7053fc5b0d..7397b9f0b6 100644 --- a/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp +++ b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp @@ -26,11 +26,11 @@ bool IckAndKrickAction::Execute(Event) bool poisonNova = boss->HasUnitState(UNIT_STATE_CASTING) && (boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA_POS) || boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA_POS_HC)); bool explosiveBarrage = orb || ( - boss->HasUnitState(UNIT_STATE_CASTING) - && ( - boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_ICK) - || boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_KRICK) - ) + boss->HasUnitState(UNIT_STATE_CASTING) && + ( + boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_ICK) || + boss->FindCurrentSpellBySpellId(SPELL_EXPLOSIVE_BARRAGE_KRICK) + ) ); bool isTank = botAI->IsTank(bot); diff --git a/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp index 5cdfb4f21a..20293b4837 100644 --- a/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp +++ b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp @@ -57,13 +57,11 @@ bool ToCLanceAction::Execute(Event) { // First unequip current weapon if it exists if (oldWeapon) - { bot->SwapItem(oldWeapon->GetPos(), lanceItem->GetPos()); - } + else - { bot->EquipItem(EQUIPMENT_SLOT_MAINHAND, lanceItem, true); - } + return true; } diff --git a/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp index 01ae38aa54..dffa9d90b2 100644 --- a/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp +++ b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp @@ -7,16 +7,12 @@ bool Aq20UseCrystalAction::Execute(Event) Unit* const boss = context->GetValue("find target", "ossirian the unscarred")->Get(); if (boss == nullptr) - { return false; - } const GameObject* const crystal = RaidAq20Utils::GetNearestCrystal(*boss); if (crystal == nullptr) - { return false; - } float botDist = this->bot->GetDistance(crystal); diff --git a/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp index 40f95c9369..2a3b623324 100644 --- a/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp +++ b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp @@ -7,20 +7,14 @@ bool Aq20MoveToCrystalTrigger::IsActive() Unit* const boss = context->GetValue("find target", "ossirian the unscarred")->Get(); if (boss == nullptr) - { return false; - } if (!boss->IsInCombat()) - { return false; - } // if buff is active move to crystal if (RaidAq20Utils::IsOssirianBuffActive(*boss)) - { return true; - } // if buff is not active a debuff will be, buff becomes active once debuff expires // so move to crystal when debuff almost done, or based debuff time left and @@ -28,18 +22,14 @@ bool Aq20MoveToCrystalTrigger::IsActive() int32_t debuffTimeRemaining = RaidAq20Utils::GetOssirianDebuffTimeRemaining(*boss); if (debuffTimeRemaining < 5000) - { return true; - } if (debuffTimeRemaining < 30000) { const GameObject* const crystal = RaidAq20Utils::GetNearestCrystal(*boss); if (crystal == nullptr) - { return false; - } float botDist = this->bot->GetDistance(crystal); float timeToReach = botDist / this->bot->GetSpeed(MOVE_RUN); diff --git a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp index fe005820a5..f43e037095 100644 --- a/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp +++ b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp @@ -20,23 +20,17 @@ int32_t RaidAq20Utils::GetOssirianDebuffTimeRemaining(Unit& ossirian) const AuraApplication* const auraApplication = ossirian.GetAuraApplication(debuff); if (auraApplication == nullptr) - { continue; - } const Aura* const aura = auraApplication->GetBase(); if (aura == nullptr) - { continue; - } int32_t duration = aura->GetDuration(); if (retVal > duration) - { retVal = duration; - } } return retVal; diff --git a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp index 795f6c9e89..2856f93875 100644 --- a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp +++ b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp @@ -29,4 +29,7 @@ bool BwlTurnOffSuppressionDeviceAction::Execute(Event) return true; } -bool BwlUseHourglassSandAction::Execute(Event) { return botAI->CastSpell(23645, bot); } +bool BwlUseHourglassSandAction::Execute(Event) +{ + return botAI->CastSpell(23645, bot); +} diff --git a/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp index 8f25582307..0d01e54998 100644 --- a/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp +++ b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp @@ -23,8 +23,8 @@ #include "SharedDefines.h" #include "Unit.h" #include "Vehicle.h" -#include -#include +#include "RtiTargetValue.h" +#include "TankAssistStrategy.h" #include "../../../../../../src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h" const std::string ADD_STRATEGY_CHAR = "+"; @@ -738,21 +738,15 @@ bool RazorscaleIgnoreBossAction::isUseful() bool RazorscaleIgnoreBossAction::Execute(Event) { if (!bot) - { return false; - } Unit* boss = AI_VALUE2(Unit*, "find target", "razorscale"); if (!boss) - { return false; - } Group* group = bot->GetGroup(); if (!group) - { return false; - } // Check if the bot is outside the designated area and move inside first if (bot->GetDistance2d(RazorscaleBossHelper::RAZORSCALE_ARENA_CENTER_X, @@ -765,17 +759,13 @@ bool RazorscaleIgnoreBossAction::Execute(Event) } if (!botAI->IsTank(bot)) - { return false; - } // Check if the boss is already set as the moon marker int8 moonIndex = 4; ObjectGuid currentMoonTarget = group->GetTargetIcon(moonIndex); if (currentMoonTarget == boss->GetGUID()) - { return false; // Moon marker is already correctly set - } // Get the main tank and determine role Unit* mainTankUnit = AI_VALUE(Unit*, "main tank"); @@ -810,9 +800,7 @@ bool RazorscaleGroundedAction::isUseful() { Unit* boss = AI_VALUE2(Unit*, "find target", "razorscale"); if (!boss || !boss->IsAlive() || boss->GetPositionZ() > RazorscaleBossHelper::RAZORSCALE_FLYING_Z_THRESHOLD) - { return false; - } if (botAI->IsMainTank(bot)) { @@ -855,9 +843,7 @@ bool RazorscaleGroundedAction::isUseful() } if (botAI->IsMelee(bot)) - { return false; - } if (botAI->IsRanged(bot)) { @@ -978,9 +964,7 @@ bool RazorscaleGroundedAction::Execute(Event) bool RazorscaleHarpoonAction::Execute(Event) { if (!bot) - { return false; - } RazorscaleBossHelper razorscaleHelper(botAI); diff --git a/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp index e58edb3f6d..3de3f8745f 100644 --- a/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp +++ b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp @@ -8,10 +8,10 @@ #include "SharedDefines.h" #include "Trigger.h" #include "Vehicle.h" -#include -#include -#include -#include "../../../../../../../src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h" +#include "MovementActions.h" +#include "FollowMasterStrategy.h" +#include "RtiTargetValue.h" +#include "../../../../../../src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h" const std::vector availableVehicles = {NPC_VEHICLE_CHOPPER, NPC_SALVAGED_DEMOLISHER, NPC_SALVAGED_DEMOLISHER_TURRET, NPC_SALVAGED_SIEGE_ENGINE, diff --git a/src/Ai/World/Rpg/NewRpgInfo.cpp b/src/Ai/World/Rpg/NewRpgInfo.cpp index 895f26306c..063250b7e2 100644 --- a/src/Ai/World/Rpg/NewRpgInfo.cpp +++ b/src/Ai/World/Rpg/NewRpgInfo.cpp @@ -66,7 +66,10 @@ void NewRpgInfo::ChangeToIdle() status = RPG_IDLE; } -bool NewRpgInfo::CanChangeTo(NewRpgStatus) { return true; } +bool NewRpgInfo::CanChangeTo(NewRpgStatus) +{ + return true; +} void NewRpgInfo::Reset() { diff --git a/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp index 3216486593..f0d0ce5a92 100644 --- a/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp +++ b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp @@ -69,5 +69,4 @@ void NewRpgStrategy::InitTriggers(std::vector& triggers) void NewRpgStrategy::InitMultipliers(std::vector&) { - } diff --git a/src/Bot/Factory/PlayerbotFactory.cpp b/src/Bot/Factory/PlayerbotFactory.cpp index b695c51739..8d402ffed7 100644 --- a/src/Bot/Factory/PlayerbotFactory.cpp +++ b/src/Bot/Factory/PlayerbotFactory.cpp @@ -1785,9 +1785,8 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) uint32_t desiredQuality = itemQuality; if (urand(0, 100) < 100 * sPlayerbotAIConfig.randomGearLoweringChance && desiredQuality > ITEM_QUALITY_NORMAL) - { desiredQuality--; - } + do { for (uint32 requiredLevel = bot->GetLevel(); requiredLevel > std::max((int32)bot->GetLevel() - delta, 0); @@ -1913,7 +1912,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) // fail to store in bag if (oldItem) continue; - + //todo why delete? bot->AutoUnequipOffhandIfNeed(); // if (newItem) // { @@ -2143,21 +2142,18 @@ void PlayerbotFactory::InitBags(bool destroyOld) uint32 newItemId = 51809; Item* old_bag = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); if (old_bag && old_bag->GetTemplate()->ItemId == newItemId) - { continue; - } + uint16 dest; if (!CanEquipUnseenItem(slot, dest, newItemId)) continue; if (old_bag && destroyOld) - { bot->DestroyItem(INVENTORY_SLOT_BAG_0, slot, true); - } + if (old_bag) - { continue; - } + // if (newItem) // { // newItem->AddToWorld(); diff --git a/src/Bot/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp index 5bd1c2f371..7d3e7ec0a5 100644 --- a/src/Bot/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -54,7 +54,6 @@ #include "Unit.h" #include "UpdateTime.h" #include "Vehicle.h" -#include "GlobalPlayerInspector.h" const int SPELL_TITAN_GRIP = 49152; @@ -1452,15 +1451,6 @@ void PlayerbotAI::DoNextAction(bool min) bool minimal = !this->AllowActivity(); - const GlobalPlayerInspector playerInspector(this->bot->GetGUID().GetRawValue()); - - if (!minimal && playerInspector.isDrinking() && playerInspector.shouldBeDrinking(95.0f)) - { - this->SetNextCheckDelay(500); - - return; - } - currentEngine->DoNextAction(nullptr, 0, (minimal || min)); if (minimal) diff --git a/src/Mgr/Guild/PlayerbotGuildMgr.h b/src/Mgr/Guild/PlayerbotGuildMgr.h index 499a33e606..5d85ce9e79 100644 --- a/src/Mgr/Guild/PlayerbotGuildMgr.h +++ b/src/Mgr/Guild/PlayerbotGuildMgr.h @@ -54,4 +54,4 @@ class PlayerbotGuildMgr void PlayerBotsGuildValidationScript(); -#endif \ No newline at end of file +#endif diff --git a/src/Mgr/Item/RandomItemMgr.cpp b/src/Mgr/Item/RandomItemMgr.cpp index 8939e349b0..a65f8415fc 100644 --- a/src/Mgr/Item/RandomItemMgr.cpp +++ b/src/Mgr/Item/RandomItemMgr.cpp @@ -2776,9 +2776,8 @@ inline bool IsCraftedBySpellInfo(ItemTemplate const* proto, SpellInfo const* spe const int64_t itemTemplateId = proto->ItemId; if (itemTemplateId == spellInfo->Reagent[x]) - { return true; - } + } for (uint8 i = 0; i < 3; ++i) @@ -2786,9 +2785,7 @@ inline bool IsCraftedBySpellInfo(ItemTemplate const* proto, SpellInfo const* spe if (spellInfo->Effects[i].Effect == SPELL_EFFECT_CREATE_ITEM) { if (spellInfo->Effects[i].ItemType == proto->ItemId) - { return true; - } } } diff --git a/src/Mgr/Talent/Talentspec.cpp b/src/Mgr/Talent/Talentspec.cpp index 74106d25bb..37904a94bc 100644 --- a/src/Mgr/Talent/Talentspec.cpp +++ b/src/Mgr/Talent/Talentspec.cpp @@ -336,9 +336,7 @@ uint32 TalentSpec::GetTalentPoints(std::vector& talents, int32 const int64_t entryTabPage = entry.tabPage(); if (entryTabPage == tabpage) - { tPoints = tPoints + entry.rank; - } } return tPoints; diff --git a/src/Mgr/Travel/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp index 02f6602b42..7f4b694e64 100644 --- a/src/Mgr/Travel/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -628,7 +628,7 @@ std::vector WorldPosition::frommGridCoord(mGridCoord GridCoord) void WorldPosition::loadMapAndVMap(uint32 mapId, uint8 x, uint8 y) { std::string const fileName = "load_map_grid.csv"; - + //TODO: Code is totally unsused. // if (isOverworld() && false || false) // { // if (!MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(mapId, x, y)) From 3e2da7725e0231262e321ec12d9f9797c6f63014 Mon Sep 17 00:00:00 2001 From: Keleborn <22352763+Celandriel@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:48:49 -0800 Subject: [PATCH 222/222] Naked bots fix, misc other and revert logic delete. --- src/Ai/Base/Actions/ChooseTargetActions.cpp | 4 ++++ src/Ai/Base/Actions/InventoryAction.cpp | 3 +++ src/Ai/Base/Value/PvpValues.cpp | 2 +- src/Bot/Engine/Strategy/CustomStrategy.cpp | 4 +--- src/Bot/Factory/PlayerbotFactory.cpp | 9 +++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Ai/Base/Actions/ChooseTargetActions.cpp b/src/Ai/Base/Actions/ChooseTargetActions.cpp index f330134b7d..589b72e9ef 100644 --- a/src/Ai/Base/Actions/ChooseTargetActions.cpp +++ b/src/Ai/Base/Actions/ChooseTargetActions.cpp @@ -120,6 +120,10 @@ bool AttackAnythingAction::Execute(Event event) if (grindTarget == nullptr) return true; + const std::string& grindTargetName = grindTarget->GetName(); + if (grindTargetName.empty()) + return true; + this->context->GetValue("pull target")->Set(grindTarget->GetGUID()); this->bot->GetMotionMaster()->Clear(); diff --git a/src/Ai/Base/Actions/InventoryAction.cpp b/src/Ai/Base/Actions/InventoryAction.cpp index 3ce8c02ec4..6939ea54d5 100644 --- a/src/Ai/Base/Actions/InventoryAction.cpp +++ b/src/Ai/Base/Actions/InventoryAction.cpp @@ -373,6 +373,9 @@ std::string const InventoryAction::parseOutfitName(std::string const outfit) { const uint64_t pos = outfit.find("="); + if (pos == std::string::npos) + return outfit; + return outfit.substr(0, pos); } diff --git a/src/Ai/Base/Value/PvpValues.cpp b/src/Ai/Base/Value/PvpValues.cpp index 29f7b31d9a..18662d96be 100644 --- a/src/Ai/Base/Value/PvpValues.cpp +++ b/src/Ai/Base/Value/PvpValues.cpp @@ -23,7 +23,7 @@ Player* FlagCarrierValue::GetBattlegroundFlagCarrier(Battleground& battleground) TeamId flagCarrierTeamIdLookup = TEAM_NEUTRAL; - if (mapId == MAP_EYE_OF_THE_STORM) + if (mapId == MAP_WARSONG_GULCH) flagCarrierTeamIdLookup = this->sameTeam ? botTeamId : opposedTeamId; const ObjectGuid& flagCarrierGUID = battleground.GetFlagPickerGUID(flagCarrierTeamIdLookup); diff --git a/src/Bot/Engine/Strategy/CustomStrategy.cpp b/src/Bot/Engine/Strategy/CustomStrategy.cpp index db8e8206be..06f1092c20 100644 --- a/src/Bot/Engine/Strategy/CustomStrategy.cpp +++ b/src/Bot/Engine/Strategy/CustomStrategy.cpp @@ -35,10 +35,8 @@ std::vector toNextActionArray(const std::string actions) const std::vector tokens = split(actions, ','); std::vector res = {}; - for (std::string token : tokens) - { + for (const std::string& token : tokens) res.push_back(toNextAction(token)); - } return res; } diff --git a/src/Bot/Factory/PlayerbotFactory.cpp b/src/Bot/Factory/PlayerbotFactory.cpp index 8d402ffed7..21a9dfe901 100644 --- a/src/Bot/Factory/PlayerbotFactory.cpp +++ b/src/Bot/Factory/PlayerbotFactory.cpp @@ -1913,6 +1913,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) if (oldItem) continue; //todo why delete? + bot->EquipNewItem(dest, bestItemForSlot, true); bot->AutoUnequipOffhandIfNeed(); // if (newItem) // { @@ -1973,14 +1974,13 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance) } if (bestItemForSlot == 0) - { continue; - } + uint16 dest; if (!CanEquipUnseenItem(slot, dest, bestItemForSlot)) - { continue; - } + + bot->EquipNewItem(dest, bestItemForSlot, true); bot->AutoUnequipOffhandIfNeed(); // if (newItem) // { @@ -2154,6 +2154,7 @@ void PlayerbotFactory::InitBags(bool destroyOld) if (old_bag) continue; + bot->EquipNewItem(dest, newItemId, true); // if (newItem) // { // newItem->AddToWorld();