mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10919] Actually use spell penetration gained by items in calculations
This commit is contained in:
parent
a13f8714f2
commit
14c1329ea5
4 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10918"
|
||||
#define REVISION_NR "10919"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue