Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -31571 - Arcane Potency
- class spell_mage_arcane_potency : public SpellScriptLoader
- {
- public:
- spell_mage_arcane_potency () : SpellScriptLoader("spell_mage_arcane_potency") { }
- class spell_mage_arcane_potency_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_mage_arcane_potency_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_1) ||
- !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_2) ||
- !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1) ||
- !sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2))
- return false;
- return true;
- }
- void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
- {
- PreventDefaultAction();
- uint32 spellId = 0;
- if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_1)
- spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1;
- else if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_2)
- spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2;
- if (!spellId)
- return;
- GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
- }
- void Register() override
- {
- OnEffectProc += AuraEffectProcFn(spell_mage_arcane_potency_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
- }
- };
- AuraScript* GetAuraScript() const override
- {
- return new spell_mage_arcane_potency_AuraScript();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement