From 919dc87bac86c23e7b4609ed1cc2a4a08229ca15 Mon Sep 17 00:00:00 2001 From: darkstalker Date: Mon, 13 Sep 2010 03:06:39 +0400 Subject: [PATCH] [10479] Implement heak absorb for periodic heal Also fix SMSG_PERIODICAURALOG for periodic heal for 3.5.5 Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 12 +++++++++--- src/game/Unit.cpp | 1 + src/shared/revision_nr.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f53e3ab78..898eb9bfa 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6742,11 +6742,17 @@ void Aura::PeriodicTick() // This method can modify pdamage bool isCrit = IsCritFromAbilityAura(pCaster, pdamage); - DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", - GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), pdamage, GetId()); + uint32 absorbHeal = 0; + pCaster->CalculateHealAbsorb(pdamage, &absorbHeal); + pdamage -= absorbHeal; + + DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health (absorbed %u) inflicted by %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), pdamage, absorbHeal, GetId()); + + int32 gain = target->ModifyHealth(pdamage); - SpellPeriodicAuraLogInfo pInfo(this, pdamage, (pdamage - uint32(gain)), 0, 0, 0.0f, isCrit); + SpellPeriodicAuraLogInfo pInfo(this, pdamage, (pdamage - uint32(gain)), absorbHeal, 0, 0.0f, isCrit); target->SendPeriodicAuraLog(&pInfo); // Set trigger flag diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4ca27eb73..f26037249 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5077,6 +5077,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo) case SPELL_AURA_OBS_MOD_HEALTH: data << uint32(pInfo->damage); // damage data << uint32(pInfo->overDamage); // overheal? + data << uint32(pInfo->absorb); // absorb data << uint8(pInfo->critical ? 1 : 0); // new 3.1.2 critical flag break; case SPELL_AURA_OBS_MOD_MANA: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3fbf22454..a9ad28f5a 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 "10478" + #define REVISION_NR "10479" #endif // __REVISION_NR_H__