Skip to content

Commit

Permalink
Prevent druid bots to spam thorns when imp fire shield is on target
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete committed Oct 13, 2023
1 parent 03f168f commit 899314b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion playerbot/strategy/druid/DruidTriggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,31 @@ 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;
}
};

class ThornsTrigger : public BuffTrigger
{
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
Expand Down

0 comments on commit 899314b

Please sign in to comment.