Jump to content

[patch] Periodic Stacks


Guest rj686

Recommended Posts

* What bug does the patch fix? What features does the patch add? Combines stacks from the same caster GUID so they don't heal, DoT seperately.

* For which SubVersion revision was the patch created? 6442

* Is there a thread in the bug report section? If yes, please add a link to the thread.

I'll link when i have more time

* Who has been writing this patch? Please include either forum user names or email addresses.

Zombie from mangos.ru, I just updated it.

Index: src/game/SpellAuras.h
===================================================================
--- src/game/SpellAuras.h        (revision 6442)
+++ src/game/SpellAuras.h        (working copy)
@@ -255,10 +255,13 @@
                bool IsPositive() { return m_positive; }
                void SetNegative() { m_positive = false; }
                void SetPositive() { m_positive = true; }
+                
+                bool IsPeriodic() { return m_isPeriodic; }
+                void SetPeriodic ( bool set) {m_isPeriodic = set;}

                bool IsPermanent() const { return m_permanent; }
                bool IsAreaAura() const { return m_isAreaAura; }
-                bool IsPeriodic() const { return m_isPeriodic; }
+
                bool IsTrigger() const { return m_isTrigger; }
                bool IsPassive() const { return m_isPassive; }
                bool IsPersistent() const { return m_isPersistent; }
Index: src/game/Unit.cpp
===================================================================
--- src/game/Unit.cpp        (revision 6442)
+++ src/game/Unit.cpp        (working copy)
@@ -3593,7 +3593,33 @@
                        // replace aura if next will > spell StackAmount
                        if(aurSpellInfo->StackAmount)
                        {
-                                if(m_Auras.count(spair) >= aurSpellInfo->StackAmount)
+                                uint32 c = m_Auras.count(spair);
+                                switch(Aur->GetModifier()->m_auraname)
+                                {
+                                        case SPELL_AURA_PERIODIC_DAMAGE:
+                                        case SPELL_AURA_PERIODIC_HEAL:
+                                        case SPELL_AURA_PERIODIC_ENERGIZE:
+                                        case SPELL_AURA_PERIODIC_LEECH:
+                                        case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
+                                        case SPELL_AURA_PERIODIC_MANA_FUNNEL:
+                                        case SPELL_AURA_PERIODIC_MANA_LEECH:
+                                        case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
+                                        {
+                                                if( c >= Aur->GetSpellProto()->StackAmount )
+                                                        Aur->GetModifier()->m_amount *= c;
+                                                else
+                                                        Aur->GetModifier()->m_amount *= c + 1;
+                                                AuraMap::iterator itr = i;
+                                                for( itr = m_Auras.begin(); itr != m_Auras.end(); ++itr )
+                                                {
+                                                        if( spellEffectPair((*itr).second->GetId(), (*itr).second->GetEffIndex()) != spair || (*itr).second->GetCasterGUID() != Aur->GetCasterGUID() )
+                                                                continue;
+                                                        (*itr).second->SetPeriodic(false);
+                                                }
+                                        } break;
+                                        default: break;
+                                }
+                                if(m_Auras.count(spair) >= aurSpellInfo->StackAmount)
                                        RemoveAura(i);
                        }
                        // if StackAmount==0 not allow auras from same caster
\\

The issue is that it doesn't take into account spell damage / healing for healing spells. If anyone with more knowledge than me could take a look at it i'd appreciate it.

Link to comment
Share on other sites

×
×
  • 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