From 0d8e8fbd61a62bfaefad2a48939eb765e67b5b74 Mon Sep 17 00:00:00 2001 From: Spargel Date: Sun, 27 Jul 2025 02:29:07 -0500 Subject: [PATCH] Second pass for adding 'healer dps' check based on map ID. Now works when teleporting in addition to on init. --- src/PlayerbotAI.cpp | 12 ++++++++++++ src/PlayerbotAI.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index d2e0f293..635c675d 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -722,6 +722,7 @@ void PlayerbotAI::HandleTeleportAck() // SetNextCheckDelay(urand(2000, 5000)); if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId(), true); + EvaluateHealerDpsStrategy(); Reset(true); } @@ -6390,3 +6391,14 @@ void PlayerbotAI::AddTimedEvent(std::function callback, uint32 delayMs) // Every Player already owns an EventMap called m_Events bot->m_Events.AddEvent(new LambdaEvent(std::move(callback)), bot->m_Events.CalculateTime(delayMs)); } + +void PlayerbotAI::EvaluateHealerDpsStrategy() +{ + if (!IsHeal(bot, true)) + return; + + if (sPlayerbotAIConfig->IsRestrictedHealerDPSMap(bot->GetMapId())) + ChangeStrategy("-healer dps", BOT_STATE_COMBAT); + else + ChangeStrategy("+healer dps", BOT_STATE_COMBAT); +} diff --git a/src/PlayerbotAI.h b/src/PlayerbotAI.h index 89326e08..758f05ba 100644 --- a/src/PlayerbotAI.h +++ b/src/PlayerbotAI.h @@ -401,6 +401,7 @@ public: void ClearStrategies(BotState type); std::vector GetStrategies(BotState type); void ApplyInstanceStrategies(uint32 mapId, bool tellMaster = false); + void EvaluateHealerDpsStrategy(); bool ContainsStrategy(StrategyType type); bool HasStrategy(std::string const name, BotState type); BotState GetState() { return currentState; };