From b29f53e6e9db7e8e594fbf4089bdef83bb5f23ed Mon Sep 17 00:00:00 2001 From: sixsixnine Date: Tue, 12 Jan 2010 14:08:44 +0300 Subject: [PATCH] [9162] Allow SPELL_AURA_PERIODIC_LEECH to crit if able to. This allow DoT crits from 2944 and ranks for example. (based on commit be72957) Also included improvement from Lynx3d for resilence and crit threat affect. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 11 ++++++++++- src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index af0d114fa..840ef3699 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6744,6 +6744,15 @@ void Aura::PeriodicTick() } pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount()); + bool isCrit = IsCritFromAbilityAura(pCaster, pdamage); + + // send critical in hit info for threat calculation + if (isCrit) + { + cleanDamage.hitOutCome = MELEE_HIT_CRIT; + // Resilience - reduce crit damage + pdamage -= m_target->GetSpellCritDamageReduction(pdamage); + } pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist, !(GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)); @@ -6753,7 +6762,7 @@ void Aura::PeriodicTick() sLog.outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId(),absorb); - pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0); + pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0, isCrit); float multiplier = GetSpellProto()->EffectMultipleValue[GetEffIndex()] > 0 ? GetSpellProto()->EffectMultipleValue[GetEffIndex()] : 1; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6d72277cb..d4f420505 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 "9161" + #define REVISION_NR "9162" #endif // __REVISION_NR_H__