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
20
WorldPacket
const
*
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Write
()
21
{
22
_worldPacket
<<
Me
.
WriteAsPacked
();
23
_worldPacket
<<
CasterGUID
.
WriteAsPacked
();
24
_worldPacket
<<
int32
(
SpellID
);
25
_worldPacket
<<
int32
(
Damage
);
26
_worldPacket
<<
int32
(
Overkill
);
27
_worldPacket
<<
uint8
(
SchoolMask
);
28
_worldPacket
<<
uint32
(
Absorbed
);
29
_worldPacket
<<
uint32
(
Resisted
);
30
_worldPacket
<<
uint8
(
Periodic
);
31
_worldPacket
<<
uint8
(0);
// unused
32
_worldPacket
<<
uint32
(
ShieldBlock
);
33
_worldPacket
<<
uint32
(
Flags
);
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
62
WorldPacket
const
*
WorldPackets::CombatLog::EnvironmentalDamageLog::Write
()
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
73
WorldPacket
const
*
WorldPackets::CombatLog::AttackerStateUpdate::Write
()
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
89
if
(Flags & (
HITINFO_FULL_ABSORB
|
HITINFO_PARTIAL_ABSORB
))
90
for
(
uint32
i
= 0;
i
< SubDmgCount; ++
i
)
91
_worldPacket <<
uint32
(SubDmg[
i
].Absorbed);
92
93
if
(Flags & (
HITINFO_FULL_RESIST
|
HITINFO_PARTIAL_RESIST
))
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
}
CombatLogPackets.h
uint8
uint8_t uint8
Definition
Define.h:135
int32
int32_t int32
Definition
Define.h:129
uint32
uint32_t uint32
Definition
Define.h:133
HitInfo
HitInfo
Definition
UnitDefines.h:360
HITINFO_PARTIAL_ABSORB
@ HITINFO_PARTIAL_ABSORB
Definition
UnitDefines.h:368
HITINFO_FULL_RESIST
@ HITINFO_FULL_RESIST
Definition
UnitDefines.h:369
HITINFO_BLOCK
@ HITINFO_BLOCK
Definition
UnitDefines.h:375
HITINFO_RAGE_GAIN
@ HITINFO_RAGE_GAIN
Definition
UnitDefines.h:385
HITINFO_FULL_ABSORB
@ HITINFO_FULL_ABSORB
Definition
UnitDefines.h:367
HITINFO_UNK1
@ HITINFO_UNK1
Definition
UnitDefines.h:362
HITINFO_PARTIAL_RESIST
@ HITINFO_PARTIAL_RESIST
Definition
UnitDefines.h:370
VictimState
VictimState
Definition
Unit.h:45
ObjectGuid::WriteAsPacked
PackedGuidWriter WriteAsPacked() const
Definition
ObjectGuid.h:152
WorldPacket
Definition
WorldPacket.h:27
WorldPackets::Array
Definition
PacketUtilities.h:120
WorldPackets::CombatLog::AttackerStateUpdate::Write
WorldPacket const * Write() override
Definition
CombatLogPackets.cpp:73
WorldPackets::CombatLog::EnvironmentalDamageLog::Write
WorldPacket const * Write() override
Definition
CombatLogPackets.cpp:62
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Periodic
bool Periodic
Definition
CombatLogPackets.h:43
WorldPackets::CombatLog::SpellNonMeleeDamageLog::SpellID
int32 SpellID
Definition
CombatLogPackets.h:37
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Absorbed
int32 Absorbed
Definition
CombatLogPackets.h:44
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Damage
int32 Damage
Definition
CombatLogPackets.h:38
WorldPackets::CombatLog::SpellNonMeleeDamageLog::SchoolMask
uint8 SchoolMask
Definition
CombatLogPackets.h:40
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Flags
int32 Flags
Definition
CombatLogPackets.h:45
WorldPackets::CombatLog::SpellNonMeleeDamageLog::CasterGUID
ObjectGuid CasterGUID
Definition
CombatLogPackets.h:36
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Me
ObjectGuid Me
Definition
CombatLogPackets.h:35
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Overkill
int32 Overkill
Definition
CombatLogPackets.h:39
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Write
WorldPacket const * Write() override
Definition
CombatLogPackets.cpp:20
WorldPackets::CombatLog::SpellNonMeleeDamageLog::ShieldBlock
int32 ShieldBlock
Definition
CombatLogPackets.h:41
WorldPackets::CombatLog::SpellNonMeleeDamageLog::Resisted
int32 Resisted
Definition
CombatLogPackets.h:42
WorldPackets::Packet::_worldPacket
WorldPacket _worldPacket
Definition
Packet.h:42
server
game
Server
Packets
CombatLogPackets.cpp
Generated by
1.9.8