Jump to content

[FIX] Glyph of Barkskin


Guest Most_Mangos

Recommended Posts

Reduces the chance you'll be critically hit by melee attacks by 25% while Barkskin is active.

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index fcbfd05..30c7716 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3392,6 +3392,9 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVict
    // reduce crit chance from Rating for players
    if (attackType != RANGED_ATTACK)
        crit -= pVictim->GetMeleeCritChanceReduction();
+    // Glyph of Barkskin
+    if (pVictim->HasAura(63057) && pVictim->HasAura(22812))
+        crit -= 25.0f;
    else
        crit -= pVictim->GetRangedCritChanceReduction();

Link to comment
Share on other sites

There is a spell for this (http://www.wowhead.com/spell=63058), which should be linked with barkskin if the glyph is active. A bit 'hacky', but working patch:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index be54aa6..95c351c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -4662,7 +4662,28 @@ void Aura::HandleAuraProcTriggerSpell(bool apply, bool Real)
            case 28200:                                     // Ascendance (Talisman of Ascendance trinket)
                SetAuraCharges(6);
                break;
-            default: break;
+            case 22812:                                     // Barkskin
+            {
+                // Linked spell - only if 63057 is active
+                if (m_target->HasAura(63057, EFFECT_INDEX_0))
+                    m_target->CastSpell(GetCaster(), 63058, true, NULL, NULL, GetCasterGUID());
+                break;
+            }
+            default:
+                break;
+        }
+    }
+    else
+    {
+        switch (GetId())
+        {
+            case 22812:                                     // Barkskin
+            {
+                m_target->RemoveAurasDueToSpell(63058);
+                break;
+            }
+            default:
+                break;
        }
    }
}

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