diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b35ddb939..1e9b87cf1 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6569,7 +6569,8 @@ void Aura::PeriodicTick() pdamage = (pdamage <= absorb + resist) ? 0 : (pdamage - absorb - resist); - SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, absorb, resist, 0.0f, isCrit); + uint32 overkill = pdamage > target->GetHealth() ? pdamage - target->GetHealth() : 0; + SpellPeriodicAuraLogInfo pInfo(this, pdamage, overkill, absorb, resist, 0.0f, isCrit); target->SendPeriodicAuraLog(&pInfo); if (pdamage) @@ -6648,9 +6649,6 @@ void Aura::PeriodicTick() target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED)); - if(target->GetHealth() < pdamage) - pdamage = uint32(target->GetHealth()); - DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %s health leech of %s for %u dmg inflicted by %u abs is %u", GetCasterGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str(), pdamage, GetId(),absorb); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 727567637..2fb7cf6a3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1755,12 +1755,15 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) pVictim->DealDamageMods(this,damage,NULL); + uint32 targetHealth = GetHealth(); + uint32 overkill = damage > targetHealth ? damage - targetHealth : 0; + WorldPacket data(SMSG_SPELLDAMAGESHIELD,(8+8+4+4+4+4)); data << pVictim->GetObjectGuid(); data << GetObjectGuid(); data << uint32(i_spellProto->Id); data << uint32(damage); // Damage - data << uint32(0); // Overkill + data << uint32(overkill); // Overkill data << uint32(i_spellProto->SchoolMask); pVictim->SendMessageToSet(&data, true ); @@ -5072,12 +5075,15 @@ void Unit::RemoveAllGameObjects() void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log) { + uint32 targetHealth = log->target->GetHealth(); + uint32 overkill = log->damage > targetHealth ? log->damage - targetHealth : 0; + WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16+4+4+4+1+4+4+1+1+4+4+1)); // we guess size data << log->target->GetPackGUID(); data << log->attacker->GetPackGUID(); data << uint32(log->SpellID); data << uint32(log->damage); // damage amount - data << uint32(log->overkill); // overkill + data << uint32(overkill); // overkill data << uint8 (log->schoolMask); // damage school data << uint32(log->absorb); // AbsorbedDamage data << uint32(log->resist); // resist @@ -5179,13 +5185,16 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) { DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); + uint32 targetHealth = damageInfo->target->GetHealth(); + uint32 overkill = damageInfo->damage > targetHealth ? damageInfo->damage - targetHealth : 0; + uint32 count = 1; WorldPacket data(SMSG_ATTACKERSTATEUPDATE, 16 + 45); // we guess size data << uint32(damageInfo->HitInfo); data << damageInfo->attacker->GetPackGUID(); data << damageInfo->target->GetPackGUID(); data << uint32(damageInfo->damage); // Full damage - data << uint32(0); // overkill value + data << uint32(overkill); // overkill value data << uint8(count); // Sub damage count for(uint32 i = 0; i < count; ++i) @@ -10785,4 +10794,4 @@ bool Unit::IsAllowedDamageInArea(Unit* pVictim) const return false; return true; -} +} \ No newline at end of file diff --git a/src/game/Unit.h b/src/game/Unit.h index de0764b5d..5dd55d224 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -905,7 +905,7 @@ struct CalcDamageInfo // Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode struct SpellNonMeleeDamage{ SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, SpellSchoolMask _schoolMask) - : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask), + : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), schoolMask(_schoolMask), absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0) {} @@ -913,7 +913,6 @@ struct SpellNonMeleeDamage{ Unit *attacker; uint32 SpellID; uint32 damage; - uint32 overkill; SpellSchoolMask schoolMask; uint32 absorb; uint32 resist; @@ -2134,4 +2133,4 @@ inline void Unit::SendMonsterMoveByPath(Path const& path, uint32 star SendMessageToSet(&data, true); } -#endif +#endif \ No newline at end of file diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e241be80d..49c9cf551 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 "10766" + #define REVISION_NR "10767" #endif // __REVISION_NR_H__