Jump to content

[BUG] Glyphs of Power Word: Shield


Recommended Posts

Posted

try this

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 0b9cd98..daaef3e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6550,6 +6550,26 @@ 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:
+                    // Power Word: Shield
+                    if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
+                    {
+                        // Glyph of Power Word: Shield
+                        if(Aura* glyph = caster->GetAura(55672,0))
+                        {
+                            // instant heal glyph m_amount% of the absorbed amount
+                            int32 heal = (glyph->GetModifier()->m_amount * m_modifier.m_amount)/100;
+                            caster->CastCustomSpell(m_target, 56160, &heal, NULL, NULL, true, 0, this);
+                        }
+                    }
+                    break;
+                default:
+                    break;
+            }
        }
    }
    else
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 89b4c08..ab3eb1f 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1859,17 +1859,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
                    preventDeathAmount = (*i)->GetModifier()->m_amount;
                    continue;
                }
-                // Power Word: Shield
-                if (spellProto->SpellFamilyFlags & UI64LIT(00000001) && spellProto->Mechanic == MECHANIC_SHIELD)
-                {
-                    // Glyph of Power Word: Shield
-                    if (Aura *glyph = pVictim->GetAura(55672,0))
-                    {
-                        int32 heal = int32(glyph->GetModifier()->m_amount *
-                            (RemainingDamage >= currentAbsorb ? currentAbsorb : RemainingDamage) / 100);
-                        pVictim->CastCustomSpell(pVictim, 56160, &heal, NULL, NULL, true, 0, *i);
-                    }
-                }
+
                // Reflective Shield
                if (spellProto->SpellFamilyFlags == 0x1 && canReflect)
                {

because it works good with old code. Glyph should heal target at APPLY, not at damage taken

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