TrinityCore
Loading...
Searching...
No Matches
CombatLogPackets.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "CombatLogPackets.h"
19
21{
31 _worldPacket << uint8(0); // unused
34 _worldPacket << uint8(0); // Debug info
35
36 //if (DebugInfo)
37 //{
38 // if (Flags & SPELL_HIT_TYPE_CRIT_DEBUG)
39 // {
40 // _worldPacket << float(DebugInfo->CritRoll);
41 // _worldPacket << float(DebugInfo->CritNeeded);
42 // }
43 // if (Flags & SPELL_HIT_TYPE_HIT_DEBUG)
44 // {
45 // _worldPacket << float(DebugInfo->HitRoll);
46 // _worldPacket << float(DebugInfo->HitNeeded);
47 // }
48 // if (Flags & SPELL_HIT_TYPE_ATTACK_TABLE_DEBUG)
49 // {
50 // _worldPacket << float(DebugInfo->MissChance);
51 // _worldPacket << float(DebugInfo->DodgeChance);
52 // _worldPacket << float(DebugInfo->ParryChance);
53 // _worldPacket << float(DebugInfo->BlockChance);
54 // _worldPacket << float(DebugInfo->GlanceChance);
55 // _worldPacket << float(DebugInfo->CrushChance);
56 // }
57 //}
58
59 return &_worldPacket;
60}
61
63{
64 _worldPacket << Victim;
65 _worldPacket << uint8(Type);
66 _worldPacket << uint32(Amount);
67 _worldPacket << uint32(Resisted);
68 _worldPacket << uint32(Absorbed);
69
70 return &_worldPacket;
71}
72
74{
75 _worldPacket << uint32(Flags);
76 _worldPacket << AttackerGUID.WriteAsPacked();
77 _worldPacket << VictimGUID.WriteAsPacked();
78 _worldPacket << uint32(Damage);
79 _worldPacket << uint32(OverDamage);
80 _worldPacket << uint8(SubDmgCount);
81
82 for (uint32 i = 0; i < SubDmgCount; ++i)
83 {
84 _worldPacket << uint32(SubDmg[i].SchoolMask);
85 _worldPacket << float(SubDmg[i].FDamage);
86 _worldPacket << uint32(SubDmg[i].Damage);
87 }
88
90 for (uint32 i = 0; i < SubDmgCount; ++i)
91 _worldPacket << uint32(SubDmg[i].Absorbed);
92
94 for (uint32 i = 0; i < SubDmgCount; ++i)
95 _worldPacket << uint32(SubDmg[i].Resisted);
96
97 _worldPacket << uint8(VictimState);
98 _worldPacket << uint32(AttackerState);
99 _worldPacket << uint32(MeleeSpellID);
100
101 if (Flags & HITINFO_BLOCK)
102 _worldPacket << uint32(BlockAmount);
103
104 if (Flags & HITINFO_RAGE_GAIN)
105 _worldPacket << uint32(RageGained);
106
107 if (Flags & HITINFO_UNK1)
108 {
109 _worldPacket << uint32(HitInfo.ArmorReduction);
110 _worldPacket << float(HitInfo.CritRollNeeded);
111 _worldPacket << float(HitInfo.CombatRoll);
112 _worldPacket << float(HitInfo.MissChance);
113 _worldPacket << float(HitInfo.DodgeChance);
114 _worldPacket << float(HitInfo.ParryChance);
115 _worldPacket << float(HitInfo.BlockChance);
116 _worldPacket << float(HitInfo.GlanceChance);
117 _worldPacket << float(HitInfo.CrushChance);
118 _worldPacket << float(HitInfo.MinDamage[0]);
119 _worldPacket << float(HitInfo.MaxDamage[0]);
120 _worldPacket << float(HitInfo.MinDamage[1]);
121 _worldPacket << float(HitInfo.MaxDamage[1]);
122 _worldPacket << uint32(HitInfo.SinceLastSwing);
123 }
124
125 return &_worldPacket;
126}
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
HitInfo
@ HITINFO_PARTIAL_ABSORB
@ HITINFO_FULL_RESIST
@ HITINFO_BLOCK
@ HITINFO_RAGE_GAIN
@ HITINFO_FULL_ABSORB
@ HITINFO_UNK1
@ HITINFO_PARTIAL_RESIST
VictimState
Definition Unit.h:45
PackedGuidWriter WriteAsPacked() const
Definition ObjectGuid.h:152
WorldPacket _worldPacket
Definition Packet.h:42