Jump to content
TrinityCore
Sign in to follow this  
ladiszlai

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

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();
        }
};

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...