Jump to content

[10669][fix] Spiritual Attunement


Auntie Mangos

Recommended Posts

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

this fix restricts mana gain from this talent when paladin is overhealed

For which repository revision was the patch created?

[10589]

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

http://getmangos.eu/community/viewtopic.php?pid=126095

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

me

patch

diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index 965d264..378bc7a 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -1875,7 +1875,13 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
                        return SPELL_AURA_PROC_FAILED;

                    // heal amount
-                    basepoints[0] = triggerAmount*damage/100;
+                    // dont count overhealing
+                    uint32 diff = GetMaxHealth()-GetHealth();
+                    if (damage > diff)
+                        basepoints[0] = triggerAmount*diff/100;
+					else
+                        basepoints[0] = triggerAmount*damage/100;
+
                    target = this;
                    triggered_spell_id = 31786;
                    break;

Link to comment
Share on other sites

  • 40 years later...
Is it even needed to cast the spell if diff==0?

i think no, this isn't logical...

so should be like this (NTY)

diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index d208b33..8c47c1a 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -1926,11 +1926,16 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
                    if (this == pVictim)
                        return SPELL_AURA_PROC_FAILED;

-                    // heal amount
-                    basepoints[0] = triggerAmount*damage/100;
-                    target = this;
-                    triggered_spell_id = 31786;
-                    break;
+                    // dont count overhealing
+                    uint32 diff = GetMaxHealth()-GetHealth();
+                    if (damage > diff)
+                    {
+                        // heal amount
+                        int32 basepoints = triggerAmount*diff/100;
+                        CastCustomSpell(this, 31786, &basepoints, NULL, NULL, true, NULL, triggeredByAura);
+                        return SPELL_AURA_PROC_OK;
+                    }
+                    return SPELL_AURA_PROC_FAILED;
                }
                // Seal of Vengeance (damage calc on apply aura)
                case 31801:

Link to comment
Share on other sites

More like

diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index d208b33..8c47c1a 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -1926,11 +1926,16 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
                    if (this == pVictim)
                        return SPELL_AURA_PROC_FAILED;

-                    // heal amount
-                    basepoints[0] = triggerAmount*damage/100;
+                    // dont count overhealing
+                    uint32 diff = GetMaxHealth()-GetHealth();
+                    if (!diff)
+                        return SPELL_AURA_PROC_FAILED;
+                    if (damage > diff)
+                        basepoints[0] = triggerAmount*diff/100;
+                    else
+                        basepoints[0] = triggerAmount*damage/100;
                    target = this;
                    triggered_spell_id = 31786;
                    break;
                }
                // Seal of Vengeance (damage calc on apply aura)
                case 31801:

because when it is not overheal, mana is also given.

EDIT: And why to even cast spell with CastCustomSpell in switch?

Link to comment
Share on other sites

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