From b4c7a2514d9844fccc46fc78aee0b34d1b26161e Mon Sep 17 00:00:00 2001 From: maximius Date: Fri, 9 Oct 2009 20:48:55 -0700 Subject: *Blackfathom Deeps - Event: Aku'mai, by Tartalo *Split Personality Achivement, by Destalker *Halls of Lightning Fixes, by Destalker Volkhan fixes + Achievement Ionar Fix - without this he resets each time he is invisible, spamming sparks Arcing Burn - should be a debuff (and stackable, stackable part NYI :/) *Naxxramas - Thaddius - the aura shall affect only the character without the proper aura, by Trazom *Naxxramas - Kelthuzad - some timer adjustments (may need verification or tweaking) by Cass *Merges by Stryker, thanks to all authors and testers. [8458] Re-implement SPELL_AURA_MOD_TARGET_ARMOR_PCT in more porper way for weapon dependent cases. Author: VladimirMangos [8459] Avoid mutiply apply weapon dependent armor penetration bonus for each weapon. Author: VladimirMangos [8529] check rune cost only if spell has PowerType == POWER_RUNE. Patch provided by yavi. Author: Ambal [8532] Fixed situation where some items like 42947 were not giving spell power bonus. By: Ambal [8533] Not remove timed quest and correctly fail when time runs out. Add function to remove timed quest instead of direct access to set. Author: NoFantasy [8536] Fixed spell 62776. By: Ambal [8539] Check pet aura range at area aura update. By: Ambal [8546] Implement battleground bonusweekends call to arms. Also fix typo in auctionmgr. Author: balrok [8547] Implemented scriptcall: CorpseRemoved(uint32 & /*respawnDelay*/) it will be called when the corpse of the scripted creature get's removed, it's possible to adjust the next respawn inside the script. Author: balrok [8561] Replace another auras code call by explicit code [8566] avoid singleton-lock when accessing BattleGroundMGR::isBGWeekend() Proposed by vladimir. Comitter: balrok --HG-- branch : trunk --- src/game/StatSystem.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/game/StatSystem.cpp') diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 56bde0e5442..b662769b77f 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -151,6 +151,7 @@ bool Player::UpdateAllStats() UpdateAllSpellCritChances(); UpdateDefenseBonusesMod(); UpdateShieldBlockValue(); + UpdateArmorPenetration(); UpdateSpellDamageAndHealingBonus(); UpdateManaRegen(); UpdateExpertise(BASE_ATTACK); @@ -625,13 +626,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); @@ -687,6 +688,33 @@ 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; -- cgit v1.2.3