Jump to content

[patch] Fix Another Bug Of Periodic Trigger Aura


Auntie Mangos
 Share

Recommended Posts

  • 38 years later...

Example: 43149 periodic trigger 43150. 43150 is a target_type 6 spell. In current rev, 43150 will be cast on caster itself, but it is supposed to cast on victim.

Index: SpellAuras.cpp
===================================================================
--- SpellAuras.cpp        (revision 6412)
+++ SpellAuras.cpp        (working copy)
@@ -1200,6 +1200,19 @@
        }
}

+Unit* Aura::GetTriggerTarget() const
+{
+        if(!m_target) return NULL;
+        uint32 triggeredSpellId = GetSpellProto()->EffectTriggerSpell[m_effIndex];
+        SpellEntry const* triggredSpellInfo = sSpellStore.LookupEntry(triggeredSpellId);
+        if (triggredSpellInfo)
+                for (int i = 0; i < 3; ++i)
+                        if (GetSpellMaxRange(sSpellRangeStore.LookupEntry(triggredSpellInfo->rangeIndex)))
+                                return ObjectAccessor::GetUnit(*m_target, m_target->GetTypeId()==TYPEID_PLAYER ? 
+                                ((Player*)m_target)->GetSelection() : m_target->GetUInt64Value(UNIT_FIELD_TARGET));
+        return m_target; 
+}
+
void Aura::TriggerSpell()
{
        Unit* caster = GetCaster();
Index: SpellAuras.h
===================================================================
--- SpellAuras.h        (revision 6412)
+++ SpellAuras.h        (working copy)
@@ -288,7 +288,7 @@

                int32 m_procCharges;

-                virtual Unit* GetTriggerTarget() const { return m_target; }
+                virtual Unit* GetTriggerTarget() const;

                // add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
                void HandleShapeshiftBoosts(bool apply);

Link to comment
Share on other sites

  • 2 years later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use