diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index bd1913867..02519e375 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -327,7 +327,7 @@ enum AuraType SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells SPELL_AURA_284, - SPELL_AURA_285, + SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, SPELL_AURA_286, SPELL_AURA_DEFLECT_SPELLS, SPELL_AURA_288, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2c45612ae..f7c639591 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -335,7 +335,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT &Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus &Aura::HandleUnused, //284 not used by any spells (3.08a) - &Aura::HandleUnused, //285 not used by any spells (3.08a) + &Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage &Aura::HandleUnused, //286 not used by any spells (3.08a) &Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult &Aura::HandleUnused, //288 not used by any spells (3.09) except 1 test spell. @@ -5053,6 +5053,16 @@ void Aura::HandleAuraModAttackPowerOfStatPercent(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateAttackPowerAndDamage(false); } +void Aura::HandleAuraModAttackPowerOfArmor(bool /*apply*/, bool Real) +{ + // spells required only Real aura add/remove + if(!Real) + return; + + // Recalculate bonus + if(m_target->GetTypeId() == TYPEID_PLAYER) + ((Player*)m_target)->UpdateAttackPowerAndDamage(false); +} /********************************/ /*** DAMAGE BONUS ***/ /********************************/ @@ -6407,19 +6417,6 @@ void Aura::PeriodicDummyTick() // return; break; } - case SPELLFAMILY_WARRIOR: - { - // Armored to the Teeth - if (spell->SpellIconID == 3516) - { - // Increases your attack power by $s1 for every $s2 armor value you have. - // Calculate AP bonus (from 1 efect of this spell) - int32 apBonus = m_modifier.m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target); - m_target->CastCustomSpell(m_target, 61217, &apBonus, &apBonus, NULL, true, NULL, this); - return; - } - break; - } case SPELLFAMILY_DRUID: { switch (spell->Id) diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index a691c7535..1588992d3 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -184,6 +184,7 @@ class MANGOS_DLL_SPEC Aura void HandleAuraModRangedAttackPowerPercent(bool apply, bool Real); void HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real); void HandleAuraModAttackPowerOfStatPercent(bool apply, bool Real); + void HandleAuraModAttackPowerOfArmor(bool apply, bool Real); void HandleSpiritOfRedemption(bool apply, bool Real); void HandleModManaRegen(bool apply, bool Real); void HandleComprehendLanguage(bool apply, bool Real); diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index b22ccd03f..2e512c35c 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -125,9 +125,9 @@ bool Player::UpdateAllStats() SetStat(Stats(i), (int32)value); } - UpdateAttackPowerAndDamage(); - UpdateAttackPowerAndDamage(true); UpdateArmor(); + // calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR + UpdateAttackPowerAndDamage(true); UpdateMaxHealth(); for(int i = POWER_MANA; i < MAX_POWERS; ++i) @@ -188,6 +188,8 @@ void Player::UpdateArmor() Pet *pet = GetPet(); if(pet) pet->UpdateArmor(); + + UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR } float Player::GetHealthBonusFromStamina() @@ -353,6 +355,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged ) AuraList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT); for(AuraList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i) attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f); + + AuraList const& mAPbyArmor = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR); + for(AuraList::const_iterator iter = mAPbyArmor.begin(); iter != mAPbyArmor.end(); ++iter) + // always: ((*i)->GetModifier()->m_miscvalue == 1 == SPELL_SCHOOL_MASK_NORMAL) + attPowerMod += int32(GetArmor() / (*iter)->GetModifier()->m_amount); } float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ad20c3eec..2b5077d50 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 "8023" + #define REVISION_NR "8024" #endif // __REVISION_NR_H__