From 899314b1484843cf2fa293547de6370733a60cac Mon Sep 17 00:00:00 2001 From: Flekz Date: Fri, 13 Oct 2023 11:54:01 +0100 Subject: [PATCH] Prevent druid bots to spam thorns when imp fire shield is on target --- playerbot/strategy/druid/DruidTriggers.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/playerbot/strategy/druid/DruidTriggers.h b/playerbot/strategy/druid/DruidTriggers.h index 85308aae7..159313015 100644 --- a/playerbot/strategy/druid/DruidTriggers.h +++ b/playerbot/strategy/druid/DruidTriggers.h @@ -31,7 +31,13 @@ namespace ai virtual bool IsActive() { Unit* target = GetTarget(); - return BuffOnPartyTrigger::IsActive() && (!target->IsPlayer() || !ai->IsRanged((Player*)target)); + if (BuffOnPartyTrigger::IsActive() && (!target->IsPlayer() || !ai->IsRanged((Player*)target))) + { + // Don't apply thorns if fire shield (conflict) is on the target + return !ai->HasAura("fire shield", target); + } + + return false; } }; @@ -39,6 +45,17 @@ namespace ai { public: ThornsTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "thorns", 4) {} + + bool IsActive() override + { + if (BuffTrigger::IsActive()) + { + // Don't apply thorns if fire shield (conflict) is on the target + return !ai->HasAura("fire shield", GetTarget()); + } + + return false; + } }; class OmenOfClarityTrigger : public BuffTrigger