refactor(Core/Packet): Combat log (#9673)

This commit is contained in:
IntelligentQuantum
2022-01-09 07:51:41 +03:30
committed by GitHub
parent a331698c5b
commit aaf85d0984
6 changed files with 84 additions and 9 deletions

View File

@@ -35,6 +35,7 @@
#include "Common.h"
#include "ConditionMgr.h"
#include "CreatureAI.h"
#include "CombatLogPackets.h"
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "Formulas.h"
@@ -784,13 +785,13 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
Unit::DealDamageMods(this, damage, &absorb);
WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21));
data << GetGUID();
data << uint8(type != DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
data << uint32(damage);
data << uint32(absorb);
data << uint32(resist);
SendMessageToSet(&data, true);
WorldPackets::CombatLog::EnvironmentalDamageLog packet;
packet.Victim = GetGUID();
packet.Type = type != DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL;
packet.Amount = damage;
packet.Absorbed = absorb;
packet.Resisted = resist;
SendMessageToSet(packet.Write(), true);
uint32 final_damage = Unit::DealDamage(this, this, damage, nullptr, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);