aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player
diff options
context:
space:
mode:
authorShauren <krzysiek.7.5.4@gmail.com>2010-12-31 22:59:36 +0100
committerShauren <krzysiek.7.5.4@gmail.com>2010-12-31 22:59:36 +0100
commitcf62d7b776dcc29a9da2fadfd209c8445f6a9e6b (patch)
tree81954ba6b19296c00aaac6f21b600a921e53e61c /src/server/game/Entities/Player
parent8ab453b4659da09126c329d00210ec189d3dee9b (diff)
Core/Items: Implemented spell penetration stat on items and use it from enchantments, original patch by zergtmn
Diffstat (limited to 'src/server/game/Entities/Player')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp12
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9a102de874f..d063f4ba112 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -567,6 +567,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_baseFeralAP = 0;
m_baseManaRegen = 0;
m_baseHealthRegen = 0;
+ m_spellPenetrationItemMod = 0;
// Honor System
m_lastHonorUpdateTime = time(NULL);
@@ -7566,7 +7567,11 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
case ITEM_MOD_HEALTH_REGEN:
ApplyHealthRegenBonus(int32(val), apply);
break;
- // depricated item mods
+ case ITEM_MOD_SPELL_PENETRATION:
+ ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -val, apply);
+ m_spellPenetrationItemMod += apply ? val : -val;
+ break;
+ // deprecated item mods
case ITEM_MOD_SPELL_HEALING_DONE:
case ITEM_MOD_SPELL_DAMAGE_DONE:
break;
@@ -7575,18 +7580,14 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
// Apply Spell Power from ScalingStatValue if set
if (ssv)
- {
if (int32 spellbonus = ssv->getSpellBonus(proto->ScalingStatValue))
ApplySpellPowerBonus(spellbonus, apply);
- }
// If set ScalingStatValue armor get it or use item armor
uint32 armor = proto->Armor;
if (ssv)
- {
if (uint32 ssvarmor = ssv->getArmorMod(proto->ScalingStatValue))
armor = ssvarmor;
- }
if (armor)
{
@@ -13488,6 +13489,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
break;
case ITEM_MOD_SPELL_PENETRATION:
ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, enchant_amount, apply);
+ m_spellPenetrationItemMod += apply ? int32(enchant_amount) : -int32(enchant_amount);
sLog->outDebug("+ %u SPELL_PENETRATION", enchant_amount);
break;
case ITEM_MOD_BLOCK_VALUE:
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 7d9838001e4..a1c57d4bb55 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1801,6 +1801,7 @@ class Player : public Unit, public GridObject<Player>
float GetRatingCoefficient(CombatRating cr) const;
float GetRatingBonusValue(CombatRating cr) const;
uint32 GetBaseSpellPowerBonus() { return m_baseSpellPower; }
+ int32 GetSpellPenetrationItemMod() const { return m_spellPenetrationItemMod; }
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const;
void UpdateBlockPercentage();
@@ -2539,6 +2540,7 @@ class Player : public Unit, public GridObject<Player>
uint32 m_baseFeralAP;
uint32 m_baseManaRegen;
uint32 m_baseHealthRegen;
+ int32 m_spellPenetrationItemMod;
SpellModList m_spellMods[MAX_SPELLMOD];
//uint32 m_pad;