TrinityCore
CombatPackets.h
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#ifndef CombatPackets_h__
19#define CombatPackets_h__
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "UnitDefines.h"
24
25class Unit;
26enum Powers : int8;
27
28namespace WorldPackets
29{
30 namespace Combat
31 {
32 class AttackSwing final : public ClientPacket
33 {
34 public:
36
37 void Read() override;
38
40 };
41
42 class AttackSwingError final : public ServerPacket
43 {
44 public:
47
48 WorldPacket const* Write() override;
49
51 };
52
53 class AttackStop final : public ClientPacket
54 {
55 public:
56 AttackStop(WorldPacket&& packet) : ClientPacket(CMSG_ATTACK_STOP, std::move(packet)) { }
57
58 void Read() override { }
59 };
60
61 class AttackStart final : public ServerPacket
62 {
63 public:
65
66 WorldPacket const* Write() override;
67
70 };
71
72 class SAttackStop final : public ServerPacket
73 {
74 public:
76 SAttackStop(Unit const* attacker, Unit const* victim);
77
78 WorldPacket const* Write() override;
79
82 bool NowDead = false;
83 };
84
86 {
89 };
90
91 class ThreatUpdate final : public ServerPacket
92 {
93 public:
95
96 WorldPacket const* Write() override;
97
99 std::vector<ThreatInfo> ThreatList;
100 };
101
103 {
104 public:
106
107 WorldPacket const* Write() override;
108
110 std::vector<ThreatInfo> ThreatList;
112 };
113
114 class ThreatRemove final : public ServerPacket
115 {
116 public:
118
119 WorldPacket const* Write() override;
120
121 ObjectGuid AboutGUID; // Unit to remove threat from (e.g. player, pet, guardian)
122 ObjectGuid UnitGUID; // Unit being attacked (e.g. creature, boss)
123 };
124
125 class AIReaction final : public ServerPacket
126 {
127 public:
129
130 WorldPacket const* Write() override;
131
134 };
135
136 class CancelCombat final : public ServerPacket
137 {
138 public:
140
141 WorldPacket const* Write() override { return &_worldPacket; }
142 };
143
145 {
146 PowerUpdatePower(int32 power, uint8 powerType) : Power(power), PowerType(powerType) { }
147
150 };
151
152 class PowerUpdate final : public ServerPacket
153 {
154 public:
156
157 WorldPacket const* Write() override;
158
160 std::vector<PowerUpdatePower> Powers;
161 };
162
164 {
165 public:
167
168 WorldPacket const* Write() override;
169
171 };
172
173 class SetSheathed final : public ClientPacket
174 {
175 public:
177
178 void Read() override;
179
181 bool Animate = true;
182 };
183
184 class CancelAutoRepeat final : public ServerPacket
185 {
186 public:
188
189 WorldPacket const* Write() override;
190
192 };
193
194 class HealthUpdate final : public ServerPacket
195 {
196 public:
198
199 WorldPacket const* Write() override;
200
203 };
204
205 class ThreatClear final : public ServerPacket
206 {
207 public:
209
210 WorldPacket const* Write() override;
211
213 };
214
215 class PvPCredit final : public ServerPacket
216 {
217 public:
219
220 WorldPacket const* Write() override;
221
226 };
227
228 class BreakTarget final : public ServerPacket
229 {
230 public:
232
233 WorldPacket const* Write() override;
234
236 };
237 }
238}
239
240#endif // CombatPackets_h__
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
Powers
AttackSwingErr
Definition: UnitDefines.h:477
PowerType
Definition: Unit.h:627
WorldPacket const * Write() override
WorldPacket const * Write() override
AttackStop(WorldPacket &&packet)
Definition: CombatPackets.h:56
AttackSwingError(AttackSwingErr reason)
Definition: CombatPackets.h:46
WorldPacket const * Write() override
AttackSwing(WorldPacket &&packet)
Definition: CombatPackets.h:35
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< ThreatInfo > ThreatList
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< PowerUpdatePower > Powers
WorldPacket const * Write() override
WorldPacket const * Write() override
SetSheathed(WorldPacket &&packet)
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< ThreatInfo > ThreatList
Definition: CombatPackets.h:99
WorldPacket const * Write() override
WorldPacket _worldPacket
Definition: Packet.h:43
@ CMSG_ATTACK_STOP
Definition: Opcodes.h:72
@ CMSG_SET_SHEATHED
Definition: Opcodes.h:797
@ CMSG_ATTACK_SWING
Definition: Opcodes.h:73
@ SMSG_CANCEL_COMBAT
Definition: Opcodes.h:1072
@ SMSG_BREAK_TARGET
Definition: Opcodes.h:1042
@ SMSG_PVP_CREDIT
Definition: Opcodes.h:1766
@ SMSG_INTERRUPT_POWER_REGEN
Definition: Opcodes.h:1449
@ SMSG_ATTACK_STOP
Definition: Opcodes.h:956
@ SMSG_THREAT_UPDATE
Definition: Opcodes.h:1996
@ SMSG_HIGHEST_THREAT_UPDATE
Definition: Opcodes.h:1423
@ SMSG_THREAT_CLEAR
Definition: Opcodes.h:1994
@ SMSG_THREAT_REMOVE
Definition: Opcodes.h:1995
@ SMSG_HEALTH_UPDATE
Definition: Opcodes.h:1422
@ SMSG_CANCEL_AUTO_REPEAT
Definition: Opcodes.h:1071
@ SMSG_ATTACK_START
Definition: Opcodes.h:955
@ SMSG_ATTACK_SWING_ERROR
Definition: Opcodes.h:957
@ SMSG_AI_REACTION
Definition: Opcodes.h:930
@ SMSG_POWER_UPDATE
Definition: Opcodes.h:1757
STL namespace.
PowerUpdatePower(int32 power, uint8 powerType)