Jump to content

[Feature][8512] support Glyph of Power Word: Shield


Recommended Posts

Posted

What features does the patch add?

supports the heal bonus given by the Glyph of Power Word: Shield (20% of damage taken)

link: http://www.wowhead.com/?item=42408

For which repository revision was the patch created?

master [7635]

Is there a thread in the bug report section or at lighthouse?

None I know

Who has been writing this patch?

Myself

The glyph adds an aura with amount=20 and misc value 23. The implementation checks this misc value. and heals the amount (%) of damage absorbed

Revision 1 (8 April):

- use spell 56160

- instant heal when PW:S is cast on target.

---
src/game/SpellAuras.cpp |   31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index c60809e..1d4a35c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5651,6 +5651,37 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
            DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());

            m_modifier.m_amount += (int32)DoneActualBenefit;
+
+            // now that the correct amount is computed, apply caster aura, if any
+            switch(m_spellProto->SpellFamilyName)
+            {
+                case SPELLFAMILY_PRIEST:
+                    if (m_spellProto->SpellFamilyFlags == 0x1) //PW:S
+                    {
+                        Unit::AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_DUMMY);
+                        for(Unit::AuraList::const_iterator k = vOverRideCS.begin(); k != vOverRideCS.end(); ++k)
+                        {
+                            switch((*k)->GetModifier()->m_miscvalue)
+                            {
+                                case 23: // Glyph: PW:S
+                                    // instant heal glyph m_amount% of the absorbed amount
+                                    int32 heal;
+
+                                    heal = ((*k)->GetModifier()->m_amount * m_modifier.m_amount)/100;
+                                    caster->CastCustomSpell(m_target, 56160, &heal, NULL, NULL, true, 0, this);
+                                    break;
+                                default: 
+                                    break;
+                            }
+                        }
+
+
+                        break;
+                    }
+                    break;
+                default:
+                    break;
+            }
        }
    }
}
-- 

Posted

I thought it worked that way too, but seems like it should heal oncast instead that onabsorb... Or so I was told

Besides it should use spell 56160 to heal the target.

Posted

It gets mentioned about 5 times on the linked wowhead page that it's an instant heal, and is again clarified that health is not funneled while damage is absorbed. Also the heal can crit according to the comments...so apparently "simply" a secondary spell casted when you cast a Power Word:Shield on someone.

But i don't have any first hand experience either...

Posted

Thanks guys, you're correct. Checked by a friend on offi: instant heal when the PW:S is applied. And this heal can crit.

Code revised to take this into account and using spell 56160 (revision 1). also rebase to [7635].

  • 5 months later...
Posted

if this normal cast spell then maybe better use normla spell event proc triggering functionality.

[added]Ok, i see problem with like way. So return to look at suggested by you version ;)

misc == 23 is wrong check. Exist many spells that have same (auratype=4,misc=23) combionation.

[added2]With this fix added in [8512]. Thank you :)

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