TrinityCore
Loading...
Searching...
No Matches
SpellPackets.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 TRINITYCORE_SPELL_PACKETS_H
19#define TRINITYCORE_SPELL_PACKETS_H
20
21#include "MovementInfo.h"
22#include "ObjectGuid.h"
23#include "Optional.h"
24#include "Packet.h"
25#include "Position.h"
26#include "SharedDefines.h"
27
28namespace WorldPackets
29{
30 namespace Spells
31 {
33 {
34 public:
36
37 void Read() override;
38
40 };
41
43 {
44 public:
46
47 void Read() override { }
48 };
49
51 {
52 public:
54
55 void Read() override;
56
58 };
59
61 {
62 public:
64
65 void Read() override { }
66 };
67
69 {
70 public:
72
73 void Read() override { }
74 };
75
77 {
78 public:
80
81 void Read() override;
82
85 };
86
88 {
90 uint16 ActionBarSlot = 0; // unused on client
91 };
92
102
104 {
105 public:
106 explicit InitialSpells() : ServerPacket(SMSG_INITIAL_SPELLS, 1 + 2 + 2) { }
107
108 WorldPacket const* Write() override;
109
110 bool InitialLogin = false;
111 std::vector<InitialSpell> Spells;
112 std::vector<SpellHistoryEntry> SpellHistory;
113 };
114
116 {
117 public:
118 static std::size_t constexpr NumActionButtons = 144;
119
121
122 WorldPacket const* Write() override;
123
124 std::array<uint32, NumActionButtons> ActionButtons = { };
126 /*
127 Reason can be 0, 1, 2
128 0 - Sends initial action buttons, client does not validate if we have the spell or not
129 1 - Used used after spec swaps, client validates if a spell is known.
130 2 - Clears the action bars client sided. This is sent during spec swap before unlearning and before sending the new buttons
131 */
132 };
133
135 {
136 public:
138
139 void Read() override;
140
143 };
144
146 {
147 public:
149
150 WorldPacket const* Write() override;
151
152 std::vector<uint32> Spells;
153 };
154
165
171
173 {
174 public:
176
177 WorldPacket const* Write() override;
178
181 };
182
184 {
185 public:
187
188 WorldPacket const* Write() override;
189
191 std::vector<AuraInfo> Auras;
192 };
193
199
209
211 {
212 float Pitch = 0.0f;
213 float Speed = 0.0f;
215 };
216
225
227 {
228 public:
230
231 void Read() override;
232
234 };
235
237 {
238 public:
240
241 void Read() override;
242
245 };
246
253
254 struct RuneData
255 {
258 std::vector<uint8> Cooldowns;
259 };
260
262 {
264 float Pitch = 0.0f;
265 };
266
272
274 {
277 };
278
298
300 {
301 public:
303
304 WorldPacket const* Write() override;
305
307 };
308
310 {
311 public:
313 {
314 Cast.HitTargets.emplace();
315 Cast.MissStatus.emplace();
316 }
317
318 WorldPacket const* Write() override;
319
321 };
322
324 {
325 public:
327
328 WorldPacket const* Write() override;
329
331 uint16 ActionBarSlot = 0; // unused on client
332 };
333
335 {
336 public:
337 explicit SpellFailure() : ServerPacket(SMSG_SPELL_FAILURE, 8 + 1 + 4 + 1) { }
338
339 WorldPacket const* Write() override;
340
345 };
346
348 {
349 public:
351
352 WorldPacket const* Write() override;
353
358 };
359
361 {
362 public:
363 explicit CastFailed() : ServerPacket(SMSG_CAST_FAILED, 1 + 4 + 1 + 4 + 4) { }
364
365 WorldPacket const* Write() override;
366
367 uint8 CastID = 0;
368 int32 SpellID = 0;
369 uint8 Reason = 0;
372 };
373
375 {
376 public:
377 explicit PetCastFailed() : ServerPacket(SMSG_PET_CAST_FAILED, 1 + 4 + 1 + 4 + 4) { }
378
379 WorldPacket const* Write() override;
380
381 uint8 CastID = 0;
382 int32 SpellID = 0;
383 uint8 Reason = 0;
386 };
387
394
396 {
397 public:
399
400 WorldPacket const* Write() override;
401
403 };
404
406 {
407 public:
409
410 WorldPacket const* Write() override;
411
413 };
414
425
427 {
428 public:
430
431 void Read() override;
432
435 };
436
438 {
441 };
442
444 {
445 public:
447
448 WorldPacket const* Write() override;
449
451 std::vector<ResyncRune> Runes;
452 };
453
455 {
456 public:
458
459 WorldPacket const* Write() override;
460
462 };
463 }
464}
465
466#endif // TRINITYCORE_SPELL_PACKETS_H
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
InventoryType
Spells
Definition PlayerAI.cpp:32
RuneType
Definition Player.h:289
#define MAX_RUNES
Action
std::vector< AuraInfo > Auras
WorldPacket const * Write() override
WorldPacket const * Write() override
CancelAura(WorldPacket &&packet)
CancelCast(WorldPacket &&packet)
CancelChannelling(WorldPacket &&packet)
CancelGrowthAura(WorldPacket &&packet)
CancelMountAura(WorldPacket &&packet)
CastSpell(WorldPacket &&packet)
std::vector< InitialSpell > Spells
std::vector< SpellHistoryEntry > SpellHistory
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
PetCancelAura(WorldPacket &&packet)
PetCastSpell(WorldPacket &&packet)
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< ResyncRune > Runes
WorldPacket const * Write() override
SetActionButton(WorldPacket &&packet)
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
static std::size_t constexpr NumActionButtons
std::array< uint32, NumActionButtons > ActionButtons
Opcodes
Definition Opcodes.h:29
@ CMSG_PET_CAST_SPELL
Definition Opcodes.h:525
@ CMSG_CANCEL_AURA
Definition Opcodes.h:339
@ SMSG_PLAY_SPELL_VISUAL
Definition Opcodes.h:528
@ SMSG_SPELL_FAILURE
Definition Opcodes.h:336
@ CMSG_CANCEL_GROWTH_AURA
Definition Opcodes.h:696
@ SMSG_AURA_UPDATE
Definition Opcodes.h:1203
@ CMSG_CANCEL_CAST
Definition Opcodes.h:332
@ SMSG_ACTION_BUTTONS
Definition Opcodes.h:326
@ SMSG_REMOVED_SPELL
Definition Opcodes.h:544
@ SMSG_PLAY_SPELL_IMPACT
Definition Opcodes.h:532
@ SMSG_INITIAL_SPELLS
Definition Opcodes.h:327
@ SMSG_CAST_FAILED
Definition Opcodes.h:333
@ SMSG_SPELL_GO
Definition Opcodes.h:335
@ CMSG_SET_ACTION_BUTTON
Definition Opcodes.h:325
@ SMSG_RESYNC_RUNES
Definition Opcodes.h:1188
@ SMSG_SPELL_FAILED_OTHER
Definition Opcodes.h:707
@ CMSG_CANCEL_CHANNELLING
Definition Opcodes.h:344
@ CMSG_CANCEL_AUTO_REPEAT_SPELL
Definition Opcodes.h:650
@ SMSG_SEND_UNLEARN_SPELLS
Definition Opcodes.h:1083
@ CMSG_PET_CANCEL_AURA
Definition Opcodes.h:648
@ SMSG_PET_CAST_FAILED
Definition Opcodes.h:341
@ SMSG_SPELL_START
Definition Opcodes.h:334
@ CMSG_CAST_SPELL
Definition Opcodes.h:331
@ SMSG_AURA_UPDATE_ALL
Definition Opcodes.h:1202
@ SMSG_LEARNED_SPELL
Definition Opcodes.h:328
@ CMSG_CANCEL_MOUNT_AURA
Definition Opcodes.h:914
@ SMSG_MOUNT_RESULT
Definition Opcodes.h:395
STL namespace.
Optional< AuraDataInfo > AuraData
std::vector< uint8 > Cooldowns
Optional< std::vector< SpellMissStatus > > MissStatus
Optional< RuneData > RemainingRunes
Optional< std::vector< ObjectGuid > > HitTargets
Optional< CreatureImmunities > Immunities
Optional< MissileTrajectoryResult > MissileTrajectory
Optional< std::vector< TargetLocation > > TargetPoints
Optional< MissileTrajectoryRequest > MissileTrajectory
Optional< TargetLocation > SrcLocation
Optional< std::array< char, 128 > > Name
Optional< TargetLocation > DstLocation
TaggedPosition< Position::XYZ > Location