TrinityCore
Loading...
Searching...
No Matches
MovementPackets.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_MOVEMENT_PACKETS_H
19#define TRINITYCORE_MOVEMENT_PACKETS_H
20
21#include "Packet.h"
22#include "MovementInfo.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25
26namespace Movement
27{
28 class MoveSpline;
29}
30
31namespace WorldPackets
32{
33 namespace Movement
34 {
36 {
37 public:
39
40 void Read() override;
41
43 };
44
46 {
47 public:
49
50 WorldPacket const* Write() override;
51
52 MovementInfo* Status = nullptr;
53 };
54
56 {
57 float JumpGravity = 0.0f;
59 };
60
66
68 {
69 uint32 Flags = 0; // Spline flags
70 uint8 Face = 0; // Movement direction (see MonsterMoveType enum)
72 std::vector<TaggedPosition<Position::XYZ>> Points; // Spline path
73 std::vector<TaggedPosition<Position::PackedXYZ>> PackedDeltas;
76 float FaceDirection = 0.0f;
79 };
80
86
92
94 {
95 public:
97 };
98
114
116 {
117 public:
119
120 WorldPacket const* Write() override;
121
123 float SplineDist = 0.0f;
124 };
125
127 {
128 public:
130
131 WorldPacket const* Write() override;
132
134 float Speed = 1.0f;
135 };
136
138 {
139 public:
140 explicit MoveSetSpeed(OpcodeServer opcode) : ServerPacket(opcode, 8 + 4 + 1 + 4) { }
141
142 WorldPacket const* Write() override;
143
146 float Speed = 1.0f;
147 bool Unknown = true;
148 };
149
151 {
152 public:
154
155 WorldPacket const* Write() override;
156
158 float Speed = 1.0f;
159 };
160
162 {
163 public:
165
166 WorldPacket const* Write() override;
167
169 };
170
172 {
173 public:
175
176 WorldPacket const* Write() override;
177
180 };
181
183 {
184 uint32 ID = 0;
186 };
187
189 {
190 public:
192
193 WorldPacket const* Write() override;
194
197 };
198
200 {
201 public:
203
204 WorldPacket const* Write() override;
205
209 };
210
212 {
213 public:
214 explicit NewWorld() : ServerPacket(SMSG_NEW_WORLD, 4 + 4 + 4 + 4 + 4) { }
215
216 WorldPacket const* Write() override;
217
220 };
221
223 {
224 public:
226
227 void Read() override { }
228 };
229
231 {
232 public:
234
235 WorldPacket const* Write() override;
236
239 };
240
242 {
243 public:
245
246 WorldPacket const* Write() override;
247
249 };
250
252 {
253 public:
255
256 void Read() override;
257
261 };
262 }
263}
264
265ByteBuffer& operator<<(ByteBuffer& data, MovementInfo const& movementInfo);
266ByteBuffer& operator>>(ByteBuffer& data, MovementInfo& movementInfo);
267
268#endif // TRINITYCORE_MOVEMENT_PACKETS_H
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
int8_t int8
Definition Define.h:131
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
ByteBuffer & operator<<(ByteBuffer &data, MovementInfo const &movementInfo)
ByteBuffer & operator>>(ByteBuffer &data, MovementInfo &movementInfo)
AnimTier
Definition UnitDefines.h:85
static void WriteCreateObjectSplineDataBlock(::Movement::MoveSpline const &moveSpline, ByteBuffer &data)
WorldPacket const * Write() override
WorldPacket const * Write() override
TaggedPosition< Position::XYZ > Pos
Optional< MovementSplineTransport > Transport
void InitializeSplineData(::Movement::MoveSpline const &moveSpline)
uint32 SequenceIndex
Unit movement packet index, incremented each time.
WorldPacket const * Write() override
uint32 SequenceIndex
Unit movement packet index, incremented each time.
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
MoveUpdate(OpcodeServer opcode=MSG_MOVE_HEARTBEAT)
WorldPacket const * Write() override
WorldPacket const * Write() override
Optional< ShipTransferPending > Ship
WorldPacket const * Write() override
Opcodes
Definition Opcodes.h:29
@ SMSG_NEW_WORLD
Definition Opcodes.h:91
@ SMSG_MONSTER_MOVE
Definition Opcodes.h:250
@ SMSG_TRANSFER_PENDING
Definition Opcodes.h:92
@ MSG_MOVE_HEARTBEAT
Definition Opcodes.h:267
@ MSG_MOVE_TELEPORT
Definition Opcodes.h:226
@ MSG_MOVE_TELEPORT_ACK
Definition Opcodes.h:228
@ MSG_MOVE_WORLDPORT_ACK
Definition Opcodes.h:249
@ SMSG_FLIGHT_SPLINE_SYNC
Definition Opcodes.h:933
@ SMSG_TRANSFER_ABORTED
Definition Opcodes.h:93
STL namespace.
std::vector< TaggedPosition< Position::XYZ > > Points
Optional< MonsterSplineJumpExtraData > JumpExtraData
std::vector< TaggedPosition< Position::PackedXYZ > > PackedDeltas
Optional< MonsterSplineAnimTierTransition > AnimTierTransition
TaggedPosition< Position::XYZ > FaceSpot
uint32 ID
gameobject_template.entry of the transport the player is teleporting on
int32 OriginMapID
Map id the player is currently on (before teleport)