TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Pet::PetSpells Class Referencefinal

#include <PetPackets.h>

Public Member Functions

 PetSpells ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

ObjectGuid PetGUID
 
uint16 CreatureFamily = 0
 
uint16 Specialization = 0
 
uint32 TimeLimit = 0
 
uint8 ReactState = 0
 
uint8 CommandState = 0
 
uint16 Flag = 0
 
std::array< int, 10 > ActionButtons
 
std::vector< uint32Actions
 
std::vector< PetSpellCooldownCooldowns
 
std::vector< PetSpellHistorySpellHistory
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Pet::PetSpells::PetSpells ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1360

Member Function Documentation

WorldPacket const * WorldPackets::Pet::PetSpells::Write ( )
overridevirtual

Implements WorldPackets::Packet.

21 {
26 
27  uint32 petModeAndOrders = ReactState + (CommandState << 8) + (Flag << 16);
28  _worldPacket << uint32(petModeAndOrders);
29 
30  for (uint32 actionButton : ActionButtons)
31  _worldPacket << int32(actionButton);
32 
33  _worldPacket << int32(Actions.size());
34  _worldPacket << int32(Cooldowns.size());
35  _worldPacket << int32(SpellHistory.size());
36 
37  for (uint32 action : Actions)
38  _worldPacket << action;
39 
40  for (PetSpellCooldown const& cooldown : Cooldowns)
41  {
42  _worldPacket << int32(cooldown.SpellID);
43  _worldPacket << int32(cooldown.Duration);
44  _worldPacket << int32(cooldown.CategoryDuration);
45  _worldPacket << int16(cooldown.Category);
46  }
47 
48  for (PetSpellHistory const& history : SpellHistory)
49  {
50  _worldPacket << int32(history.CategoryID);
51  _worldPacket << int32(history.RecoveryTime);
52  _worldPacket << int8(history.ConsumedCharges);
53  }
54 
55  return &_worldPacket;
56 }
uint8 ReactState
Definition: PetPackets.h:107
int16_t int16
Definition: g3dmath.h:165
ObjectGuid PetGUID
Definition: PetPackets.h:103
std::array< int, 10 > ActionButtons
Definition: PetPackets.h:111
int8_t int8
Definition: g3dmath.h:163
WorldPacket _worldPacket
Definition: Packet.h:43
uint8 CommandState
Definition: PetPackets.h:108
Actions
Definition: BattlegroundIC.h:203
Definition: SpellHistory.h:42
uint16 Flag
Definition: PetPackets.h:109
uint32_t uint32
Definition: Define.h:150
uint16 Specialization
Definition: PetPackets.h:105
int32_t int32
Definition: g3dmath.h:167
CreatureFamily
Definition: SharedDefines.h:3576
uint32_t uint32
Definition: g3dmath.h:168
std::vector< PetSpellCooldown > Cooldowns
Definition: PetPackets.h:114
uint32 TimeLimit
Definition: PetPackets.h:106

Member Data Documentation

std::array<int, 10> WorldPackets::Pet::PetSpells::ActionButtons
std::vector<uint32> WorldPackets::Pet::PetSpells::Actions
uint8 WorldPackets::Pet::PetSpells::CommandState = 0
std::vector<PetSpellCooldown> WorldPackets::Pet::PetSpells::Cooldowns
uint16 WorldPackets::Pet::PetSpells::CreatureFamily = 0
uint16 WorldPackets::Pet::PetSpells::Flag = 0
ObjectGuid WorldPackets::Pet::PetSpells::PetGUID
uint8 WorldPackets::Pet::PetSpells::ReactState = 0
uint16 WorldPackets::Pet::PetSpells::Specialization = 0
std::vector<PetSpellHistory> WorldPackets::Pet::PetSpells::SpellHistory
uint32 WorldPackets::Pet::PetSpells::TimeLimit = 0

The documentation for this class was generated from the following files: