TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BattlePetPackets.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 BattlePetPackets_h__
19 #define BattlePetPackets_h__
20 
21 #include "Packet.h"
22 #include "ObjectGuid.h"
23 #include "Unit.h"
24 
25 namespace WorldPackets
26 {
27  namespace BattlePet
28  {
29  struct BattlePet
30  {
34  uint32 CollarID = 0; // what's this?
37  uint16 Exp = 0;
44  ObjectGuid Owner; // for non-account wide pets only? (Guild Page, Guild Herald)
45  std::string Name;
46  };
47 
49  {
51  uint32 CollarID = 0; // what's this?
52  uint8 Index = 0;
53  bool Locked = true;
54  };
55 
56  class BattlePetJournal final : public ServerPacket
57  {
58  public:
60 
61  WorldPacket const* Write() override;
62 
63  uint16 Trap = 0;
64  std::vector<BattlePetSlot> Slots;
65  std::vector<BattlePet> Pets;
66  bool HasJournalLock = true;
67  };
68 
70  {
71  public:
73 
74  WorldPacket const* Write() override { return &_worldPacket; }
75  };
76 
78  {
79  public:
81 
82  void Read() override { }
83  };
84 
85  class BattlePetUpdates final : public ServerPacket
86  {
87  public:
89 
90  WorldPacket const* Write() override;
91 
92  std::vector<BattlePet> Pets;
93  bool PetAdded = false;
94  };
95 
96  class PetBattleSlotUpdates final : public ServerPacket
97  {
98  public:
100 
101  WorldPacket const* Write() override;
102 
103  std::vector<BattlePetSlot> Slots;
104  bool AutoSlotted = false;
105  bool NewSlot = false;
106  };
107 
109  {
110  public:
112 
113  void Read() override;
114 
116  uint8 Slot = 0;
117  };
118 
119  class BattlePetModifyName final : public ClientPacket
120  {
121  public:
123 
124  void Read() override;
125 
127  std::string Name;
129  };
130 
131  class BattlePetDeletePet final : public ClientPacket
132  {
133  public:
135 
136  void Read() override;
137 
139  };
140 
141  class BattlePetSetFlags final : public ClientPacket
142  {
143  public:
145 
146  void Read() override;
147 
151  };
152 
153  class CageBattlePet final : public ClientPacket
154  {
155  public:
157 
158  void Read() override;
159 
161  };
162 
163  class BattlePetDeleted final : public ServerPacket
164  {
165  public:
167 
168  WorldPacket const* Write() override;
169 
171  };
172 
173  class BattlePetError final : public ServerPacket
174  {
175  public:
177 
178  WorldPacket const* Write() override;
179 
182  };
183 
184  class BattlePetSummon final : public ClientPacket
185  {
186  public:
188 
189  void Read() override;
190 
192  };
193  }
194 }
195 
196 #endif // BattlePetPackets_h__
std::vector< BattlePetSlot > Slots
Definition: BattlePetPackets.h:64
Definition: BattlePetPackets.h:85
WorldPacket const * Write() override
Definition: BattlePetPackets.cpp:64
BattlePetSummon(WorldPacket &&packet)
Definition: BattlePetPackets.h:187
Definition: BattlePetPackets.h:184
Definition: Opcodes.h:102
void Read() override
Definition: BattlePetPackets.cpp:140
uint8 Quality
Definition: BattlePetPackets.h:43
ObjectGuid PetGuid
Definition: BattlePetPackets.h:170
uint32 Speed
Definition: BattlePetPackets.h:42
WorldPacket const * Write() override
Definition: BattlePetPackets.h:74
BattlePetUpdates()
Definition: BattlePetPackets.h:88
std::string Name
Definition: BattlePetPackets.h:45
uint32 Health
Definition: BattlePetPackets.h:40
bool NewSlot
Definition: BattlePetPackets.h:105
void Read() override
Definition: BattlePetPackets.cpp:168
uint16 Exp
Definition: BattlePetPackets.h:37
Definition: BattlePetPackets.h:108
uint8 Index
Definition: BattlePetPackets.h:52
Definition: Opcodes.h:814
bool PetAdded
Definition: BattlePetPackets.h:93
STL namespace.
bool Locked
Definition: BattlePetPackets.h:53
BattlePetSetFlags(WorldPacket &&packet)
Definition: BattlePetPackets.h:144
BattlePetJournalLockAcquired()
Definition: BattlePetPackets.h:72
ObjectGuid Guid
Definition: BattlePetPackets.h:31
uint32 CollarID
Definition: BattlePetPackets.h:51
void Read() override
Definition: BattlePetPackets.h:82
Definition: BattlePetPackets.h:29
Definition: Opcodes.h:1350
DeclinedName Declined
Definition: BattlePetPackets.h:128
void Read() override
Definition: BattlePetPackets.cpp:110
BattlePetDeletePet(WorldPacket &&packet)
Definition: BattlePetPackets.h:134
std::vector< BattlePet > Pets
Definition: BattlePetPackets.h:65
WorldPacket _worldPacket
Definition: Packet.h:43
bool HasJournalLock
Definition: BattlePetPackets.h:66
BattlePetDeleted()
Definition: BattlePetPackets.h:166
void Read() override
Definition: BattlePetPackets.cpp:135
Definition: Opcodes.h:812
uint8 ControlType
Definition: BattlePetPackets.h:150
std::vector< BattlePet > Pets
Definition: BattlePetPackets.h:92
uint32 Power
Definition: BattlePetPackets.h:39
ObjectGuid PetGuid
Definition: BattlePetPackets.h:191
WorldPacket const * Write() override
Definition: BattlePetPackets.cpp:152
Definition: Packet.h:59
ObjectGuid PetGuid
Definition: BattlePetPackets.h:148
Definition: BattlePetPackets.h:131
uint16 Level
Definition: BattlePetPackets.h:36
Definition: BattlePetPackets.h:56
Definition: Opcodes.h:105
WorldPacket const * Write() override
Definition: BattlePetPackets.cpp:96
Definition: Packet.h:46
BattlePetModifyName(WorldPacket &&packet)
Definition: BattlePetPackets.h:122
WorldPacket const * Write() override
Definition: BattlePetPackets.cpp:82
uint16 Flags
Definition: BattlePetPackets.h:38
Definition: Opcodes.h:820
uint32_t uint32
Definition: Define.h:150
BattlePetRequestJournal(WorldPacket &&packet)
Definition: BattlePetPackets.h:80
uint16_t uint16
Definition: Define.h:151
bool AutoSlotted
Definition: BattlePetPackets.h:104
Definition: BattlePetPackets.h:153
uint8 Result
Definition: BattlePetPackets.h:180
ObjectGuid PetGuid
Definition: BattlePetPackets.h:126
uint32 MaxHealth
Definition: BattlePetPackets.h:41
CageBattlePet(WorldPacket &&packet)
Definition: BattlePetPackets.h:156
BattlePet Pet
Definition: BattlePetPackets.h:50
Definition: Opcodes.h:103
std::string Name
Definition: BattlePetPackets.h:127
Definition: BattlePetPackets.h:119
Definition: BattlegroundMgr.h:57
void Read() override
Definition: BattlePetPackets.cpp:147
uint32 Flags
Definition: BattlePetPackets.h:149
uint8 Slot
Definition: BattlePetPackets.h:116
ObjectGuid PetGuid
Definition: BattlePetPackets.h:115
uint32 CreatureID
Definition: BattlePetPackets.h:33
void Read() override
Definition: BattlePetPackets.cpp:116
Definition: BattlePetPackets.h:173
Definition: BattlePetPackets.h:141
BattlePetJournal()
Definition: BattlePetPackets.h:59
uint32 CollarID
Definition: BattlePetPackets.h:34
Definition: BattlePetPackets.h:48
WorldPacket const * Write() override
Definition: BattlePetPackets.cpp:159
Definition: BattlePetPackets.h:96
Definition: Opcodes.h:813
BattlePetError()
Definition: BattlePetPackets.h:176
ObjectGuid PetGuid
Definition: BattlePetPackets.h:160
ObjectGuid Owner
Definition: BattlePetPackets.h:44
uint8_t uint8
Definition: Define.h:152
uint32 CreatureID
Definition: BattlePetPackets.h:181
Definition: Opcodes.h:811
std::vector< BattlePetSlot > Slots
Definition: BattlePetPackets.h:103
Definition: BattlePetPackets.h:77
uint16 Breed
Definition: BattlePetPackets.h:35
Definition: Opcodes.h:107
Definition: ObjectGuid.h:189
Definition: Opcodes.h:126
Definition: Unit.h:1101
BattlePetSetBattleSlot(WorldPacket &&packet)
Definition: BattlePetPackets.h:111
Definition: Opcodes.h:106
Definition: Opcodes.h:100
Definition: WorldPacket.h:26
Definition: BattlePetPackets.h:163
PetBattleSlotUpdates()
Definition: BattlePetPackets.h:99
uint16 Trap
Definition: BattlePetPackets.h:63
uint32 Species
Definition: BattlePetPackets.h:32
ObjectGuid PetGuid
Definition: BattlePetPackets.h:138