From f1266ebec3cec67e8f6af569018dd428149b0063 Mon Sep 17 00:00:00 2001 From: thenecromancer Date: Fri, 19 Mar 2010 08:30:39 +0100 Subject: Update player damage reduction by resilience combat rating Apply crit damage reduction to periodic crit damage --HG-- branch : trunk --- src/game/SpellAuraEffects.cpp | 3 +++ src/game/Unit.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 4042f5f8af4..f3e607537c7 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -1268,7 +1268,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const bool crit = IsPeriodicTickCrit(target, caster); if (crit) + { damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, target); + damage -= target->GetSpellCritDamageReduction(damage); + } // only from players if (IS_PLAYER_GUID(GetCasterGUID())) diff --git a/src/game/Unit.h b/src/game/Unit.h index 5e40703fd74..67c45ad3605 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1308,9 +1308,9 @@ class Unit : public WorldObject uint32 GetSpellCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.2f, 33.0f, damage); } // player or player's pet resilience (-1%), cap 100% - uint32 GetMeleeDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 1.0f, 100.0f, damage); } - uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 1.0f, 100.0f, damage); } - uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 1.0f, 100.0f, damage); } + uint32 GetMeleeDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 2.0f, 100.0f, damage); } + uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 2.0f, 100.0f, damage); } + uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 2.0f, 100.0f, damage); } float MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; SpellMissInfo MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell); -- cgit v1.2.3