Skip to content

Commit

Permalink
fix(Scripts/Hyjal): Fix Azgalor Doom targetting tanks since its an Ao…
Browse files Browse the repository at this point in the history
…E spell (azerothcore#19012)

* fix(Scripts/Hyjal): Fix Azgalor Doom targetting tanks since its an AoE spell

* Update boss_azgalor.cpp
  • Loading branch information
Nyeriah authored Jun 5, 2024
1 parent c77f9b0 commit 79ec83d
Showing 1 changed file with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct boss_azgalor : public BossAI
context.Repeat(18s, 20s);
}).Schedule(45s, 55s, [this](TaskContext context)
{
DoCastRandomTarget(SPELL_DOOM, 1, 100.f, true, false, false);
DoCastAOE(SPELL_DOOM);
Talk(SAY_DOOM);
context.Repeat();
}).Schedule(10min, [this](TaskContext context)
Expand Down Expand Up @@ -118,9 +118,27 @@ struct boss_azgalor : public BossAI
bool _recentlySpoken;
};

class spell_azgalor_doom : public AuraScript
class spell_azgalor_doom : public SpellScript
{
PrepareAuraScript(spell_azgalor_doom);
PrepareSpellScript(spell_azgalor_doom);

void FilterTargets(std::list<WorldObject*>& targets)
{
if (Unit* victim = GetCaster()->GetVictim())
{
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
}
}

void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_azgalor_doom::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};

class spell_azgalor_doom_aura : public AuraScript
{
PrepareAuraScript(spell_azgalor_doom_aura);

void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Expand All @@ -133,12 +151,12 @@ class spell_azgalor_doom : public AuraScript

void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};

void AddSC_boss_azgalor()
{
RegisterHyjalAI(boss_azgalor);
RegisterSpellScript(spell_azgalor_doom);
RegisterSpellAndAuraScriptPair(spell_azgalor_doom, spell_azgalor_doom_aura);
}

0 comments on commit 79ec83d

Please sign in to comment.