Scripts/Spells Refactored dh & dh spells to use the new macros (#26200)

This commit is contained in:
Matan Shukry
2021-03-05 23:23:56 +02:00
committed by GitHub
parent 1d7590072c
commit c0f3452286
2 changed files with 491 additions and 724 deletions

View File

@@ -32,39 +32,28 @@ enum DemonHunterSpells
};
// 197125 - Chaos Strike
class spell_dh_chaos_strike : public SpellScriptLoader
class spell_dh_chaos_strike : public AuraScript
{
public:
spell_dh_chaos_strike() : SpellScriptLoader("spell_dh_chaos_strike") { }
PrepareAuraScript(spell_dh_chaos_strike);
class spell_dh_chaos_strike_AuraScript : public AuraScript
{
PrepareAuraScript(spell_dh_chaos_strike_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CHAOS_STRIKE_ENERGIZE });
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CHAOS_STRIKE_ENERGIZE });
}
void HandleEffectProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastCustomSpell(SPELL_CHAOS_STRIKE_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
}
void HandleEffectProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastCustomSpell(SPELL_CHAOS_STRIKE_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dh_chaos_strike_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_dh_chaos_strike_AuraScript();
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dh_chaos_strike::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
void AddSC_demon_hunter_spell_scripts()
{
new spell_dh_chaos_strike();
RegisterAuraScript(spell_dh_chaos_strike);
}

File diff suppressed because it is too large Load Diff