Jump to content

[Fix] auras of the same resistance


Auntie Mangos

Recommended Posts

on this side ( the source of wowwikki ) http://www.mmo-champion.com/news-2/patch-3-0-2-on-debuffs-buffs-and-raid-stacking/?PHPSESSID=16a956e7a491531dd78969c0de67d429

Mark of Wild is in one extra case, and my fix was for mangos 0.12, but I could not find anything.

The line with Mark of the Wild talks about the stats, not about resistances. There are no resistances at all on the mmo page. Mark of the Wild should keep as the buff for stats all the time, but should not count to resistance when there is higher resistence buff for any school of magic. For example: I have the highest ranks of Mark of the Wild and Aspect of the Wild buffs, so I get 750 armor, all attributes increased by 37 and all resistances except nature resistance by 54 for 30 min and 130 nature resistance from the Aspect

Link to comment
Share on other sites

where are the codes?^^

this is the final code of Emme and Sarjuuk

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index b7cb5aa..1890261 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -4470,11 +4502,21 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool /*Real*/)
{
    for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
    {
+        int32 oldMaxValue = 0;
        if(m_modifier.m_miscvalue & int32(1<<x))
        {
-            m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount), apply);
+            // no same resistance auras stack together
+            Unit::AuraList const& REAuras = m_target->GetAurasByType(SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE);
+            for (Unit::AuraList::const_iterator i = REAuras.begin(); i != REAuras.end(); ++i)
+                if (((*i)->GetMiscValue() & int32(1<<x))  && (*i)->GetSpellProto()->Id != GetSpellProto()->Id)
+                    if (oldMaxValue < (*i)->GetModifier()->m_amount)
+                        oldMaxValue = (*i)->GetModifier()->m_amount;
+
+            float value = (m_modifier.m_amount > oldMaxValue) ? m_modifier.m_amount - oldMaxValue : 0.0f;
+
+            m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, value, apply);
            if(m_target->GetTypeId() == TYPEID_PLAYER)
-                m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply);
+                m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, value, apply);
        }
    }
}

Link to comment
Share on other sites

  • 2 weeks later...
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