Core/Scripts: Fixed Enervating Brand in Baltharus encounter

Closes #21027
By Mihapro

(cherry picked from commit 6598c5d2f3)
This commit is contained in:
Keader
2017-12-04 08:55:15 -03:00
committed by funjoker
parent c1ad297a72
commit 2630a5288a

View File

@@ -334,16 +334,22 @@ class spell_baltharus_enervating_brand_trigger : public SpellScriptLoader
{
PrepareSpellScript(spell_baltharus_enervating_brand_trigger_SpellScript);
void CheckDistance()
bool Validate(SpellInfo const* /*spell*/) override
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
return ValidateSpellInfo({ SPELL_SIPHONED_MIGHT });
}
void HandleSiphonedMight()
{
if (SpellInfo const* spellInfo = GetTriggeringSpell())
if (Aura* triggerAura = GetCaster()->GetAura(spellInfo->Id))
if (Unit* caster = triggerAura->GetCaster())
GetHitUnit()->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
void Register() override
{
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger_SpellScript::CheckDistance);
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger_SpellScript::HandleSiphonedMight);
}
};