Jump to content

[patch] Aura 259


Guest qsa
 Share

Recommended Posts

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

Implementing aura 259 - SPELL_AURA_MOD_PERIODIC_HEAL

Currently used only in Shadow Embrace spell and ranks.

For which repository revision was the patch created?

8542

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

Me

diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 602a305..0695384 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -301,7 +301,7 @@ enum AuraType
    SPELL_AURA_NO_REAGENT_USE = 256,
    SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257,
    SPELL_AURA_258 = 258,
-    SPELL_AURA_259 = 259,
+    SPELL_AURA_MOD_PERIODIC_HEAL = 259,
    SPELL_AURA_SCREEN_EFFECT = 260,
    SPELL_AURA_PHASE = 261,
    SPELL_AURA_262 = 262,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index ff6d791..b3f2d5e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -309,7 +309,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleNoReagentUseAura,                          //256 SPELL_AURA_NO_REAGENT_USE Use SpellClassMask for spell select
    &Aura::HandleNULL,                                      //257 SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS Use SpellClassMask for spell select
    &Aura::HandleNULL,                                      //258 SPELL_AURA_MOD_SPELL_VISUAL
-    &Aura::HandleNULL,                                      //259 corrupt healing over time spell
+    &Aura::HandleNoImmediateEffect,                         //259 SPELL_AURA_MOD_PERIODIC_HEAL                    implemented in Unit::SpellHealingBonus
    &Aura::HandleNoImmediateEffect,                         //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code
    &Aura::HandlePhase,                                     //261 SPELL_AURA_PHASE undetactable invisibility?     implemented in Unit::isVisibleForOrDetect
    &Aura::HandleNULL,                                      //262
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 141e8b6..b0038ac 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8871,10 +8871,16 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint

    // Healing taken percent
    float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+    if (damagetype == DOT)
+    {
+        float minDotVal = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_PERIODIC_HEAL);
+        minval = (minDotVal < minval) ? minDotVal : minval;
+    }
    if(minval)
        TakenTotalMod *= (100.0f + minval) / 100.0f;

    float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+    // can SPELL_AURA_MOD_PERIODIC_HEAL be positive?
    if(maxval)
        TakenTotalMod *= (100.0f + maxval) / 100.0f;

Link to comment
Share on other sites

  • 2 weeks later...
Kung Fu Bump!:eek:

Kung FU Bump:)

btw this code part is correct for impleting:confused:

   float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+    // can SPELL_AURA_MOD_PERIODIC_HEAL be positive?
    if(maxval)
        TakenTotalMod *= (100.0f + maxval) / 100.0f

Link to comment
Share on other sites

Kung FU Bump:)

btw this code part is correct for impleting:confused:

   float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+    // can SPELL_AURA_MOD_PERIODIC_HEAL be positive?
    if(maxval)
        TakenTotalMod *= (100.0f + maxval) / 100.0f

It is just comment. You can add it if you like - wont change anything.

I wasn't able to figure out from current spells which use this aura if it can be positive. For now (313) it is only used as negative.

Link to comment
Share on other sites

  • 1 year later...
 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