Jump to content

[fix][7500] Spell stack on target


Auntie Mangos

Recommended Posts

Aura Stacking + Getmaxmodifier patch should have fixed this. An alternate patch was added by DiSlord in rev. 7049. I wonder what happend? Was it reverted?

??? This patch not change way for stacking. It _not_ allow stacking in some cases.

You can check without patch spell 19742 and rabks casted by 2 casters at same target. Without patch you will have 2 auars, with patch 1 with highest rank.

Link to comment
Share on other sites

  • 39 years later...

2

1

2

1

2

1

diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 124448f..f3d5d4c 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -255,6 +255,19 @@ bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2)
    }
}

+bool IsSingleFromSpellSpecificRanksPerTarget(uint32 spellId_spec, uint32 i_spellId_spec)
+{
+    switch(spellId_spec)
+    {
+        case SPELL_BLESSING:
+        case SPELL_AURA:
+        case SPELL_CURSE:
+            return spellId_spec==i_spellId_spec;
+        default:
+            return false;
+    }
+}
+
bool IsPositiveTarget(uint32 targetA, uint32 targetB)
{
    // non-positive targets
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 2f0a6af..f4c6ff8 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -146,6 +146,7 @@ inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)

int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2);
+bool IsSingleFromSpellSpecificRanksPerTarget(uint32 spellId_spec, uint32 i_spellId_spec);
bool IsPassiveSpell(uint32 spellId);

inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 839ebe2..9b4f867 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3561,6 +3561,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
        SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);

        bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
+        bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellId_spec,i_spellId_spec);

        if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
        {
@@ -3582,6 +3583,25 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
            else
                next =  m_Auras.begin();
        }
+        else if( is_sspt && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId) )
+        {
+            // cannot remove higher rank
+            if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
+                return false;
+
+            // Its a parent aura (create this aura in ApplyModifier)
+            if ((*i).second->IsInUse())
+            {
+                sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
+                continue;
+            }
+            RemoveAurasDueToSpell(i_spellId);
+
+            if( m_Auras.empty() )
+                break;
+            else
+                next =  m_Auras.begin();
+        }
        else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
        {
            // Its a parent aura (create this aura in ApplyModifier)

Patchfile

Link to comment
Share on other sites

More details so... for example

http://www.wowhead.com/?search=nature+resist+totem

Now if you have 2 shamans on raid, and 1st one will summons Rank 6 and the 2nd one summons Rank 5 of this totem, they will give you 130+85 nature resist, but i think they shouldnt stack. More shamans, more totems.

And I'm not sure about hunters aspects and paladins auras. I havent tested it yet, but i think when 2 hunters with http://www.wowhead.com/?search=aspect+of+the+wild ( low level hunter and high level hunter, for example hunter level 56 with rank 2 and hunter level 68 with rank 3 ) they will stack but again i think they shouldnt.

I hope I explained it better now.

Link to comment
Share on other sites

on offy, resist auras couldn't stack, there's some list on the wow forums about which class buffs/auras dont' stack with each other. I'll keep my eyes out for it.

There should already be a report by me about Resistance aura which are exclusive, in fact resistance auras that won't stack are called aura Mod Resist Exclusive.

But now lets avoid to post anymore in this topic.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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