From 7019a9439d41dc03c62bc0998d4e30020c2637dc Mon Sep 17 00:00:00 2001 From: bo Date: Fri, 20 Feb 2026 21:22:43 -0600 Subject: [PATCH 1/3] Better Bot Gather Ignoring --- .../strategy/actions/AddLootAction.cpp | 17 ++++++++++++++--- .../playerbot/strategy/actions/AddLootAction.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/modules/Bots/playerbot/strategy/actions/AddLootAction.cpp b/src/modules/Bots/playerbot/strategy/actions/AddLootAction.cpp index e538e673a..47980ca33 100644 --- a/src/modules/Bots/playerbot/strategy/actions/AddLootAction.cpp +++ b/src/modules/Bots/playerbot/strategy/actions/AddLootAction.cpp @@ -71,16 +71,27 @@ bool AddGatheringLootAction::AddLoot(ObjectGuid guid) return false; } + return AddAllLootAction::AddLoot(guid); +} + +bool AddGatheringLootAction::isUseful() +{ + // Don't gather in dungeons or raids + if (bot->GetMap()->IsDungeon()) + { + return false; + } + // NC gathering is a problem if you are supposed to be following Player* master = ai->GetMaster(); - if (master && ai->HasStrategy("follow master", BOT_STATE_NON_COMBAT)) + if (master && bot->GetGroup()) { float masterDist = bot->GetDistance(master); - if (masterDist > sPlayerbotAIConfig.reactDistance / 2) + if (masterDist > sPlayerbotAIConfig.reactDistance) { return false; } } - return AddAllLootAction::AddLoot(guid); + return AddAllLootAction::isUseful(); } diff --git a/src/modules/Bots/playerbot/strategy/actions/AddLootAction.h b/src/modules/Bots/playerbot/strategy/actions/AddLootAction.h index 402c50ad4..9effb0cf3 100644 --- a/src/modules/Bots/playerbot/strategy/actions/AddLootAction.h +++ b/src/modules/Bots/playerbot/strategy/actions/AddLootAction.h @@ -24,6 +24,7 @@ namespace ai class AddGatheringLootAction : public AddAllLootAction { public: AddGatheringLootAction(PlayerbotAI* ai) : AddAllLootAction(ai, "add gathering loot") {} + virtual bool isUseful(); protected: virtual bool AddLoot(ObjectGuid guid); From 3896fa06082f11b3ce151e800d4649f5e4284060 Mon Sep 17 00:00:00 2001 From: bo Date: Sat, 28 Feb 2026 23:43:15 -0600 Subject: [PATCH 2/3] bot_gather_cancel_in_combat --- src/modules/Bots/playerbot/PlayerbotAI.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/modules/Bots/playerbot/PlayerbotAI.cpp b/src/modules/Bots/playerbot/PlayerbotAI.cpp index fb7cf20ba..991329106 100644 --- a/src/modules/Bots/playerbot/PlayerbotAI.cpp +++ b/src/modules/Bots/playerbot/PlayerbotAI.cpp @@ -179,9 +179,20 @@ void PlayerbotAI::UpdateAI(uint32 elapsed) } } - if (nextAICheckDelay > sPlayerbotAIConfig.maxWaitForMove && bot->IsInCombat() && !bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + if (nextAICheckDelay > sPlayerbotAIConfig.maxWaitForMove && + !bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { - nextAICheckDelay = sPlayerbotAIConfig.maxWaitForMove; + if (bot->IsInCombat()) + nextAICheckDelay = sPlayerbotAIConfig.maxWaitForMove; + else + { + Player* master = GetMaster(); + if (master && master->IsInCombat()) + { + InterruptSpell(); + nextAICheckDelay = sPlayerbotAIConfig.maxWaitForMove; + } + } } PlayerbotAIBase::UpdateAI(elapsed); From 43152c2549c559e752c52368f81318b556624f28 Mon Sep 17 00:00:00 2001 From: bo Date: Sun, 1 Mar 2026 14:05:13 -0600 Subject: [PATCH 3/3] bot_gather_fix_n --- src/modules/Bots/playerbot/LootObjectStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Bots/playerbot/LootObjectStack.cpp b/src/modules/Bots/playerbot/LootObjectStack.cpp index 442980249..4a86dc3b7 100644 --- a/src/modules/Bots/playerbot/LootObjectStack.cpp +++ b/src/modules/Bots/playerbot/LootObjectStack.cpp @@ -87,7 +87,7 @@ void LootObject::Refresh(Player* bot, ObjectGuid guid) } GameObject* go = ai->GetGameObject(guid); - if (go && go->isSpawned()) + if (go && go->isSpawned() && go->getLootState() == GO_READY) { uint32 lockId = go->GetGOInfo()->GetLockId(); LockEntry const *lockInfo = sLockStore.LookupEntry(lockId);