Skip to content

Commit

Permalink
Seed of corruption added for warlock aoe strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete committed Mar 6, 2024
1 parent 5561bed commit 74f9cc2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions playerbot/strategy/warlock/WarlockAiObjectContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ namespace ai
creators["no felguard"] = &TriggerFactoryInternal::no_felguard;
creators["spell lock"] = &TriggerFactoryInternal::spell_lock;
creators["spell lock enemy healer"] = &TriggerFactoryInternal::spell_lock_enemy_healer;
creators["seed of corruption on attacker"] = &TriggerFactoryInternal::seed_of_corruption_on_attacker;
}

private:
Expand Down Expand Up @@ -405,6 +406,7 @@ namespace ai
static Trigger* no_felguard(PlayerbotAI* ai) { return new NoFelguardTrigger(ai); }
static Trigger* spell_lock(PlayerbotAI* ai) { return new SpellLockTrigger(ai); }
static Trigger* spell_lock_enemy_healer(PlayerbotAI* ai) { return new SpellLockEnemyHealerTrigger(ai); }
static Trigger* seed_of_corruption_on_attacker(PlayerbotAI* ai) { return new SeedOfCorruptionOnAttackerTrigger(ai); }
};

class AiObjectContextInternal : public NamedObjectContext<Action>
Expand Down
8 changes: 2 additions & 6 deletions playerbot/strategy/warlock/WarlockStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,12 @@ void WarlockAoeStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
AoeStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"corruption on attacker",
"seed of corruption on attacker",
NextAction::array(0, new NextAction("seed of corruption on attacker", ACTION_HIGH + 2), NULL)));

triggers.push_back(new TriggerNode(
"corruption on attacker",
NextAction::array(0, new NextAction("corruption on attacker", ACTION_HIGH + 1), NULL)));

triggers.push_back(new TriggerNode(
"ranged medium aoe",
NextAction::array(0, new NextAction("rain of fire", ACTION_HIGH), NULL)));
}

void WarlockAoeStrategy::InitNonCombatTriggers(std::list<TriggerNode*>& triggers)
Expand Down Expand Up @@ -1077,7 +1073,7 @@ void WarlockAoeStrategy::InitCombatTriggers(std::list<TriggerNode*>& triggers)
AoeStrategy::InitCombatTriggers(triggers);

triggers.push_back(new TriggerNode(
"corruption on attacker",
"seed of corruption on attacker",
NextAction::array(0, new NextAction("seed of corruption on attacker", ACTION_HIGH + 2), NULL)));

triggers.push_back(new TriggerNode(
Expand Down
18 changes: 16 additions & 2 deletions playerbot/strategy/warlock/WarlockTriggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,22 @@ bool DrainSoulTrigger::IsActive()

bool CorruptionOnAttackerTrigger::IsActive()
{
Unit* target = GetTarget();
return target && target->IsAlive() && !ai->HasAura("corruption", target, false, true) && !ai->HasAura("seed of corruption", target, false, true);
if (DebuffOnAttackerTrigger::IsActive())
{
return !ai->HasAura("seed of corruption", GetTarget(), false, true);
}

return false;
}

bool SeedOfCorruptionOnAttackerTrigger::IsActive()
{
if (DebuffOnAttackerTrigger::IsActive())
{
return AI_VALUE(uint8, "attackers count") >= 3;
}

return false;
}

bool NoCurseTrigger::IsActive()
Expand Down
7 changes: 7 additions & 0 deletions playerbot/strategy/warlock/WarlockTriggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ namespace ai
bool IsActive() override;
};

class SeedOfCorruptionOnAttackerTrigger : public DebuffOnAttackerTrigger
{
public:
SeedOfCorruptionOnAttackerTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "seed of corruption") {}
bool IsActive() override;
};

DEBUFF_TRIGGER(CurseOfAgonyTrigger, "curse of agony");

class CurseOfAgonyOnAttackerTrigger : public DebuffOnAttackerTrigger
Expand Down

0 comments on commit 74f9cc2

Please sign in to comment.