Jump to content

[patch][5822] Correct Mod_healing_pct


Guest kamir86

Recommended Posts

* What bug does the patch fix? What features does the patch add?

healing mod pct should work like speed mod

With this patch only the most powerful affect is applied for this aura effect (for example mortal strike and aimedshot on the same player reduces healing taken by 50%)

* For which SubVersion revision was the patch created?

5789

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

me

working, no problem Found

Index: Unit.cpp
===================================================================
--- Unit.cpp        (revision 5789)
+++ Unit.cpp        (working copy)
@@ -7486,9 +7486,14 @@
                modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, heal);

        // Healing taken percent
-        AuraList const& mHealingPct = pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING_PCT);
-        for(AuraList::const_iterator i = mHealingPct.begin();i != mHealingPct.end(); ++i)
-                heal *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
+        float minval = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+        float maxval = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+        if(maxval){
+                heal *= (100.0f + maxval) / 100.0f;
+        }
+        if(minval){
+                heal *= (100.0f + minval) / 100.0f;
+        }

        if (heal < 0) heal = 0;

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