Jump to content
TrinityCore

How can I make a spell aura only triggers when procs?


ladiszlai
 Share

Recommended Posts

reflect the spell if the aura owner is in front of the caster where the spell comes from.

I have tried it with procs and made the if statement if(GetTarget()->isInFront(eventInfo.GetProcTarget()), but I could not find the correct way to make the aura only reflect when it procs.

My code so far:

class spell_custom_reflect : public SpellScriptLoader
{
    public:
    spell_custom_reflect() : SpellScriptLoader("spell_custom_reflect") { }

        class spell_custom_reflect_AuraScript : public AuraScript
        {
            PrepareAuraScript(spell_custom_reflect_AuraScript);

            bool CheckProc(ProcEventInfo& eventInfo)
            {
                return if(GetTarget()->isInFront(eventInfo.GetProcTarget()))
            }

            void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
            {
                // I want to reflect only when the aura effect procs.
            }

            void Register()
            {
                DoCheckProc += AuraCheckProcFn(spell_custom_reflect_AuraScript::CheckProc);
                OnEffectProc += AuraEffectProcFn(spell_custom_reflect_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
            }
        };

        AuraScript* GetAuraScript() const
        {
            return new spell_custom_reflect_AuraScript();
        }
};
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...