TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PetPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 PetPackets_h__
19 #define PetPackets_h__
20 
21 #include "Packet.h"
22 #include "PacketUtilities.h"
23 #include "ObjectGuid.h"
24 #include "Unit.h"
25 #include "WorldSession.h"
26 
27 namespace WorldPackets
28 {
29  namespace Pet
30  {
31  class DismissCritter final : public ClientPacket
32  {
33  public:
35 
36  void Read() override;
37 
39  };
40 
41  class RequestPetInfo final : public ClientPacket
42  {
43  public:
45 
46  void Read() override { }
47  };
48 
49  class PetAbandon final : public ClientPacket
50  {
51  public:
52  PetAbandon(WorldPacket&& packet) : ClientPacket(CMSG_PET_ABANDON, std::move(packet)) { }
53 
54  void Read() override;
55 
57  };
58 
59  class PetStopAttack final : public ClientPacket
60  {
61  public:
63 
64  void Read() override;
65 
67  };
68 
69  class PetSpellAutocast final : public ClientPacket
70  {
71  public:
73 
74  void Read() override;
75 
78  bool AutocastEnabled = false;
79  };
80 
82  {
86  int Category = 0;
87  };
88 
90  {
94  };
95 
96  class PetSpells final : public ServerPacket
97  {
98  public:
100 
101  WorldPacket const* Write() override;
102 
110 
111  std::array<int, 10> ActionButtons;
112 
113  std::vector<uint32> Actions;
114  std::vector<PetSpellCooldown> Cooldowns;
115  std::vector<PetSpellHistory> SpellHistory;
116  };
117 
119  {
126  std::string PetName;
127  };
128 
129  class PetStableList final : public ServerPacket
130  {
131  public:
133 
134  WorldPacket const* Write() override;
135 
137  std::vector<PetStableInfo> Pets;
138  };
139 
140  class PetLearnedSpells final : public ServerPacket
141  {
142  public:
144 
145  WorldPacket const* Write() override;
146 
147  std::vector<uint32> Spells;
148  };
149 
150  class PetUnlearnedSpells final : public ServerPacket
151  {
152  public:
154 
155  WorldPacket const* Write() override;
156 
157  std::vector<uint32> Spells;
158  };
159 
160 
162  {
165  std::string NewName;
166  bool HasDeclinedNames = false;
168  };
169 
170  class PetNameInvalid final : public ServerPacket
171  {
172  public:
173  PetNameInvalid() : ServerPacket(SMSG_PET_NAME_INVALID, 18 + 4 + 2 + 1 + 5 * 2 + 2) { }
174 
175  WorldPacket const* Write() override;
176 
178 
180  };
181 
182  class PetRename final : public ClientPacket
183  {
184  public:
185  PetRename(WorldPacket&& packet) : ClientPacket(CMSG_PET_RENAME, std::move(packet)) { }
186 
187  void Read() override;
188 
190  };
191 
192  class PetAction final : public ClientPacket
193  {
194  public:
195  PetAction(WorldPacket&& packet) : ClientPacket(CMSG_PET_ACTION, std::move(packet)) { }
196 
197  void Read() override;
198 
203  };
204 
205  class PetSetAction final : public ClientPacket
206  {
207  public:
209 
210  void Read() override;
211 
213 
216  };
217 
218  class PetCancelAura final : public ClientPacket
219  {
220  public:
222 
223  void Read() override;
224 
227  };
228 
229  }
230 }
231 
232 #endif // PetPackets_h__
void Read() override
Definition: PetPackets.cpp:153
uint8 Result
Definition: PetPackets.h:179
Definition: PetPackets.h:89
RequestPetInfo(WorldPacket &&packet)
Definition: PetPackets.h:44
uint32 PetNumber
Definition: PetPackets.h:121
int32 CategoryID
Definition: PetPackets.h:91
uint8 ReactState
Definition: PetPackets.h:107
Definition: Opcodes.h:505
uint32 PetSlot
Definition: PetPackets.h:120
uint32 ExperienceLevel
Definition: PetPackets.h:124
DismissCritter(WorldPacket &&packet)
Definition: PetPackets.h:34
int8_t int8
Definition: Define.h:148
bool AutocastEnabled
Definition: PetPackets.h:78
Definition: Opcodes.h:502
int32 PetNumber
Definition: PetPackets.h:164
ObjectGuid PetGUID
Definition: PetPackets.h:103
std::array< int, 10 > ActionButtons
Definition: PetPackets.h:111
Definition: PetPackets.h:59
void Read() override
Definition: PetPackets.h:46
std::vector< uint32 > Spells
Definition: PetPackets.h:147
std::vector< uint32 > Actions
Definition: PetPackets.h:113
int32 SpellID
Definition: PetPackets.h:83
PetUnlearnedSpells()
Definition: PetPackets.h:153
Action
Definition: boss_balinda.cpp:38
Definition: PetPackets.h:192
void Read() override
Definition: PetPackets.cpp:143
STL namespace.
Definition: Opcodes.h:507
PetStopAttack(WorldPacket &&packet)
Definition: PetPackets.h:62
ObjectGuid Pet
Definition: PetPackets.h:56
void Read() override
Definition: PetPackets.cpp:166
WorldPacket const * Write() override
Definition: PetPackets.cpp:95
PetSpellAutocast(WorldPacket &&packet)
Definition: PetPackets.h:72
PetAction(WorldPacket &&packet)
Definition: PetPackets.h:195
uint32 SpellID
Definition: PetPackets.h:77
uint8 CommandState
Definition: PetPackets.h:108
PetRenameData RenameData
Definition: PetPackets.h:177
Definition: PetPackets.h:129
Definition: Vector3.h:58
uint32 PetFlags
Definition: PetPackets.h:125
int8 ConsumedCharges
Definition: PetPackets.h:93
ObjectGuid CritterGUID
Definition: PetPackets.h:38
void Read() override
Definition: PetPackets.cpp:121
Definition: PetPackets.h:218
uint32 Index
Definition: PetPackets.h:214
Definition: Opcodes.h:492
void Read() override
Definition: PetPackets.cpp:178
PetSpells()
Definition: PetPackets.h:99
Definition: Packet.h:59
std::vector< uint32 > Spells
Definition: PetPackets.h:157
PetRenameData RenameData
Definition: PetPackets.h:189
int32 Duration
Definition: PetPackets.h:84
WorldPacket const * Write() override
Definition: PetPackets.cpp:20
Definition: PetPackets.h:118
Definition: Opcodes.h:1364
void Read() override
Definition: PetPackets.cpp:158
ObjectGuid PetGUID
Definition: PetPackets.h:163
uint16 Flag
Definition: PetPackets.h:109
Definition: PetPackets.h:140
uint32 DisplayID
Definition: PetPackets.h:123
Definition: PetPackets.h:205
Definition: Packet.h:46
void Read() override
Definition: PetPackets.cpp:171
int32 CategoryDuration
Definition: PetPackets.h:85
ObjectGuid TargetGUID
Definition: PetPackets.h:201
Definition: Opcodes.h:491
ObjectGuid PetGUID
Definition: PetPackets.h:66
PetNameInvalid()
Definition: PetPackets.h:173
int32_t int32
Definition: Define.h:146
int Category
Definition: PetPackets.h:86
uint32_t uint32
Definition: Define.h:150
Definition: Opcodes.h:1356
Definition: PetPackets.h:49
PetRename(WorldPacket &&packet)
Definition: PetPackets.h:185
uint16_t uint16
Definition: Define.h:151
Definition: PetPackets.h:150
G3D::Vector3 ActionPosition
Definition: PetPackets.h:202
WorldPacket const * Write() override
Definition: PetPackets.cpp:79
Definition: PetPackets.h:31
PetLearnedSpells()
Definition: PetPackets.h:143
PetAbandon(WorldPacket &&packet)
Definition: PetPackets.h:52
ObjectGuid PetGUID
Definition: PetPackets.h:76
Definition: PetPackets.h:161
Definition: BattlegroundMgr.h:57
Definition: Opcodes.h:254
Definition: Opcodes.h:1361
WorldPacket const * Write() override
Definition: PetPackets.cpp:87
void Read() override
Definition: PetPackets.cpp:183
int32 RecoveryTime
Definition: PetPackets.h:92
ObjectGuid PetGUID
Definition: PetPackets.h:199
Definition: PetPackets.h:81
uint16 Specialization
Definition: PetPackets.h:105
Definition: Opcodes.h:1358
Definition: PetPackets.h:170
uint32 CreatureID
Definition: PetPackets.h:122
std::vector< PetStableInfo > Pets
Definition: PetPackets.h:137
Definition: PetPackets.h:182
Definition: Opcodes.h:504
uint8_t uint8
Definition: Define.h:152
CreatureFamily
Definition: SharedDefines.h:3576
std::vector< PetSpellHistory > SpellHistory
Definition: PetPackets.h:115
PetCancelAura(WorldPacket &&packet)
Definition: PetPackets.h:221
WorldPacket const * Write() override
Definition: PetPackets.cpp:58
bool HasDeclinedNames
Definition: PetPackets.h:166
Definition: Opcodes.h:506
Definition: Opcodes.h:1360
Definition: ObjectGuid.h:189
std::string PetName
Definition: PetPackets.h:126
std::string NewName
Definition: PetPackets.h:165
ObjectGuid PetGUID
Definition: PetPackets.h:225
ObjectGuid StableMaster
Definition: PetPackets.h:136
Definition: Unit.h:1101
Definition: PetPackets.h:69
Definition: Opcodes.h:571
DeclinedName DeclinedNames
Definition: PetPackets.h:167
Definition: WorldPacket.h:26
std::vector< PetSpellCooldown > Cooldowns
Definition: PetPackets.h:114
Definition: PetPackets.h:96
Definition: PetPackets.h:41
Definition: Pet.h:46
int32 SpellID
Definition: PetPackets.h:226
uint32 TimeLimit
Definition: PetPackets.h:106
PetStableList()
Definition: PetPackets.h:132
ObjectGuid PetGUID
Definition: PetPackets.h:212
PetSetAction(WorldPacket &&packet)
Definition: PetPackets.h:208