diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7148f30b9..9415fa107 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -567,6 +567,7 @@ Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m m_baseFeralAP = 0; m_baseManaRegen = 0; m_armorPenetrationPct = 0.0f; + m_spellPenetrationItemMod = 0; // Honor System m_lastHonorUpdateTime = time(NULL); @@ -7170,6 +7171,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl break; case ITEM_MOD_SPELL_PENETRATION: ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -int32(val), apply); + m_spellPenetrationItemMod += apply ? val : -val; break; case ITEM_MOD_BLOCK_VALUE: HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(val), apply); diff --git a/src/game/Player.h b/src/game/Player.h index d0bb7aa29..8b2161ce8 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2050,6 +2050,7 @@ class MANGOS_DLL_SPEC Player : public Unit void _ApplyAllStatBonuses(); void _RemoveAllStatBonuses(); float GetArmorPenetrationPct() const { return m_armorPenetrationPct; } + int32 GetSpellPenetrationItemMod() const { return m_spellPenetrationItemMod; } void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply); void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply); @@ -2546,6 +2547,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint16 m_baseFeralAP; uint16 m_baseManaRegen; float m_armorPenetrationPct; + int32 m_spellPenetrationItemMod; SpellModList m_spellMods[MAX_SPELLMOD]; int32 m_SpellModRemoveCount; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4935a7e50..7ae6a1842 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1905,6 +1905,9 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM // Ignore resistance by self SPELL_AURA_MOD_TARGET_RESISTANCE aura tmpvalue2 += (float)pCaster->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask); + if (pCaster->GetTypeId() == TYPEID_PLAYER) + tmpvalue2 -= (float)((Player*)pCaster)->GetSpellPenetrationItemMod(); + tmpvalue2 *= (float)(0.15f / getLevel()); if (tmpvalue2 < 0.0f) tmpvalue2 = 0.0f; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a4fc78f15..893914020 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10918" + #define REVISION_NR "10919" #endif // __REVISION_NR_H__