* Backout a part of the latest Mangos merge, armor penetration related. Please first check whether or not we need the code, then test it, then push to repo, one change per commit.
--HG-- branch : trunk
This commit is contained in:
+5
-17
@@ -449,7 +449,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
||||
m_baseSpellPower = 0;
|
||||
m_baseFeralAP = 0;
|
||||
m_baseManaRegen = 0;
|
||||
m_armorPenetrationPct = 0.0f;
|
||||
|
||||
// Honor System
|
||||
m_lastHonorUpdateTime = time(NULL);
|
||||
@@ -5288,7 +5287,7 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
|
||||
break;
|
||||
case CR_ARMOR_PENETRATION:
|
||||
if(affectStats)
|
||||
UpdateArmorPenetration();
|
||||
UpdateArmorPenetration(amount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -11051,15 +11050,10 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
||||
// update expertise and armor penetration - passive auras may need it
|
||||
|
||||
if( slot == EQUIPMENT_SLOT_MAINHAND )
|
||||
{
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
UpdateArmorPenetration();
|
||||
}
|
||||
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
{
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
UpdateArmorPenetration();
|
||||
}
|
||||
|
||||
switch(slot)
|
||||
{
|
||||
@@ -11209,7 +11203,6 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
|
||||
}
|
||||
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
UpdateArmorPenetration();
|
||||
}
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
@@ -11219,7 +11212,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
UpdateArmorPenetration();
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -11336,21 +11329,16 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
|
||||
case EQUIPMENT_SLOT_MAINHAND:
|
||||
case EQUIPMENT_SLOT_OFFHAND:
|
||||
case EQUIPMENT_SLOT_RANGED:
|
||||
UpdateArmorPenetration();
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if( slot == EQUIPMENT_SLOT_MAINHAND )
|
||||
{
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
UpdateArmorPenetration();
|
||||
}
|
||||
|
||||
else if( slot == EQUIPMENT_SLOT_OFFHAND )
|
||||
{
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
UpdateArmorPenetration();
|
||||
}
|
||||
|
||||
// equipment visual show
|
||||
SetVisibleItemSlot(slot, NULL);
|
||||
|
||||
+2
-4
@@ -1701,7 +1701,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||
|
||||
void UpdateAllSpellCritChances();
|
||||
void UpdateSpellCritChance(uint32 school);
|
||||
void UpdateArmorPenetration();
|
||||
void UpdateArmorPenetration(int32 amount);
|
||||
void UpdateExpertise(WeaponAttackType attType);
|
||||
void ApplyManaRegenBonus(int32 amount, bool apply);
|
||||
void UpdateManaRegen();
|
||||
@@ -1870,8 +1870,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||
float GetTotalPercentageModValue(BaseModGroup modGroup) const { return m_auraBaseMod[modGroup][FLAT_MOD] + m_auraBaseMod[modGroup][PCT_MOD]; }
|
||||
void _ApplyAllStatBonuses();
|
||||
void _RemoveAllStatBonuses();
|
||||
float GetArmorPenetrationPct() const { return m_armorPenetrationPct; }
|
||||
|
||||
|
||||
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
|
||||
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
|
||||
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
|
||||
@@ -2365,7 +2364,6 @@ Spell * m_spellModTakingSpell;
|
||||
uint16 m_baseSpellPower;
|
||||
uint16 m_baseFeralAP;
|
||||
uint16 m_baseManaRegen;
|
||||
float m_armorPenetrationPct;
|
||||
|
||||
SpellModList m_spellMods[MAX_SPELLMOD];
|
||||
uint32 m_pad;
|
||||
|
||||
@@ -325,7 +325,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
|
||||
SPELL_AURA_MOD_DISARM_RANGED = 278,
|
||||
SPELL_AURA_INITIALIZE_IMAGES = 279,
|
||||
SPELL_AURA_MOD_TARGET_ARMOR_PCT = 280,
|
||||
SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280,
|
||||
SPELL_AURA_MOD_HONOR_GAIN_PCT = 281,
|
||||
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
|
||||
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
|
||||
|
||||
+1
-10
@@ -333,7 +333,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||
&Aura::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap
|
||||
&Aura::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
|
||||
&Aura::HandleAuraInitializeImages, //279 SPELL_AURA_INITIALIZE_IMAGES
|
||||
&Aura::HandleModTargetArmorPct, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
||||
&Aura::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
||||
&Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
|
||||
&Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
|
||||
&Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
|
||||
@@ -7013,12 +7013,3 @@ bool AuraEffect::IsPeriodicTickCrit(Unit const * pCaster) const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModTargetArmorPct(bool apply, bool Real, bool changeAmount)
|
||||
{
|
||||
if(m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
((Player*)m_target)->UpdateArmorPenetration();
|
||||
}
|
||||
|
||||
|
||||
@@ -333,7 +333,6 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleAuraLinked(bool Apply, bool Real, bool changeAmount);
|
||||
void HandleModTargetArmorPct(bool Apply, bool Real, bool changeAmount);
|
||||
|
||||
void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount);
|
||||
int32 CalculateCrowdControlAuraAmount(Unit * caster);
|
||||
|
||||
+2
-30
@@ -151,7 +151,6 @@ bool Player::UpdateAllStats()
|
||||
UpdateAllSpellCritChances();
|
||||
UpdateDefenseBonusesMod();
|
||||
UpdateShieldBlockValue();
|
||||
UpdateArmorPenetration();
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
UpdateManaRegen();
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
@@ -626,13 +625,13 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
// Store crit value
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
|
||||
}
|
||||
/*
|
||||
|
||||
void Player::UpdateArmorPenetration(int32 amount)
|
||||
{
|
||||
// Store Rating Value
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
|
||||
}
|
||||
*/
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
{
|
||||
m_modMeleeHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
|
||||
@@ -688,33 +687,6 @@ void Player::UpdateExpertise(WeaponAttackType attack)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration()
|
||||
{
|
||||
m_armorPenetrationPct = GetRatingBonusValue(CR_ARMOR_PENETRATION);
|
||||
|
||||
AuraEffectList const& armorAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
|
||||
for(AuraEffectList::const_iterator itr = armorAuras.begin(); itr != armorAuras.end(); ++itr)
|
||||
{
|
||||
// affects all weapons
|
||||
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
|
||||
{
|
||||
m_armorPenetrationPct += (*itr)->GetAmount();
|
||||
continue;
|
||||
}
|
||||
|
||||
// dependent on weapon class
|
||||
for(uint8 i = 0; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
Item *weapon = GetWeaponForAttack(WeaponAttackType(i));
|
||||
if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
|
||||
{
|
||||
m_armorPenetrationPct += (*itr)->GetAmount();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::ApplyManaRegenBonus(int32 amount, bool apply)
|
||||
{
|
||||
m_baseManaRegen+= apply ? amount : -amount;
|
||||
|
||||
+2
-4
@@ -1653,7 +1653,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
|
||||
|
||||
if ( GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
|
||||
AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
|
||||
for(AuraEffectList::const_iterator itr = ResIgnoreAuras.begin();itr != ResIgnoreAuras.end(); ++itr)
|
||||
{
|
||||
// item neutral spell
|
||||
@@ -1691,11 +1691,9 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
|
||||
float armorPen = maxArmorPen*((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;
|
||||
// Got the value, apply it
|
||||
armor -= armorPen;
|
||||
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
||||
}
|
||||
|
||||
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
||||
armor *= 1.0f - ((Player*)this)->GetArmorPenetrationPct() / 100.0f;
|
||||
|
||||
if (armor < 0.0f)
|
||||
armor = 0.0f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user