Core/Items: Implemented spell penetration stat on items and use it from enchantments, original patch by zergtmn
This commit is contained in:
1 parent
8ab453b465
commit
cf62d7b776
4 files changed
+22
-23
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user