TrinityCore
WorldPackets::Pet::PetSpells Class Referencefinal

#include <PetPackets.h>

Public Member Functions

 PetSpells ()
 
WorldPacket const * Write () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () override final
 
void Clear ()
 
WorldPacket && Move ()
 
void ShrinkToFit ()
 
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 const * GetRawPacket () 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
 
uint8 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

◆ PetSpells()

WorldPackets::Pet::PetSpells::PetSpells ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.cpp:25
Definition: Opcodes.h:1631
+ Here is the call graph for this function:

Member Function Documentation

◆ Write()

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

Implements WorldPackets::Packet.

21 {
26  _worldPacket << uint16(CommandState | (Flag << 16));
29  _worldPacket << uint32(Actions.size());
30  _worldPacket << uint32(Cooldowns.size());
31  _worldPacket << uint32(SpellHistory.size());
32 
33  for (uint32 action : Actions)
34  _worldPacket << uint32(action);
35 
36  for (PetSpellCooldown const& cooldown : Cooldowns)
37  {
38  _worldPacket << int32(cooldown.SpellID);
39  _worldPacket << int32(cooldown.Duration);
40  _worldPacket << int32(cooldown.CategoryDuration);
41  _worldPacket << float(cooldown.ModRate);
42  _worldPacket << uint16(cooldown.Category);
43  }
44 
45  for (PetSpellHistory const& history : SpellHistory)
46  {
47  _worldPacket << int32(history.CategoryID);
48  _worldPacket << int32(history.RecoveryTime);
49  _worldPacket << float(history.ChargeModRate);
50  _worldPacket << int8(history.ConsumedCharges);
51  }
52 
53  return &_worldPacket;
54 }
uint8 ReactState
Definition: PetPackets.h:111
int8_t int8
Definition: Define.h:141
ObjectGuid PetGUID
Definition: PetPackets.h:107
std::array< int, 10 > ActionButtons
Definition: PetPackets.h:115
WorldPacket _worldPacket
Definition: Packet.h:43
uint8 CommandState
Definition: PetPackets.h:112
Actions
Definition: BattlegroundIC.h:201
Definition: SpellHistory.h:46
uint8 Flag
Definition: PetPackets.h:113
int32_t int32
Definition: Define.h:139
uint32_t uint32
Definition: Define.h:143
uint16_t uint16
Definition: Define.h:144
void append(T value)
Definition: ByteBuffer.h:143
uint16 Specialization
Definition: PetPackets.h:109
uint16 _CreatureFamily
Definition: PetPackets.h:108
uint8_t uint8
Definition: Define.h:145
std::vector< PetSpellCooldown > Cooldowns
Definition: PetPackets.h:118
uint32 TimeLimit
Definition: PetPackets.h:110
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _CreatureFamily

uint16 WorldPackets::Pet::PetSpells::_CreatureFamily = 0
See also
enum CreatureFamily

◆ ActionButtons

std::array<int, 10> WorldPackets::Pet::PetSpells::ActionButtons = { }

◆ Actions

std::vector<uint32> WorldPackets::Pet::PetSpells::Actions

◆ CommandState

uint8 WorldPackets::Pet::PetSpells::CommandState = 0

◆ Cooldowns

std::vector<PetSpellCooldown> WorldPackets::Pet::PetSpells::Cooldowns

◆ Flag

uint8 WorldPackets::Pet::PetSpells::Flag = 0

◆ PetGUID

ObjectGuid WorldPackets::Pet::PetSpells::PetGUID

◆ ReactState

uint8 WorldPackets::Pet::PetSpells::ReactState = 0

◆ Specialization

uint16 WorldPackets::Pet::PetSpells::Specialization = 0

◆ SpellHistory

std::vector<PetSpellHistory> WorldPackets::Pet::PetSpells::SpellHistory

◆ TimeLimit

uint32 WorldPackets::Pet::PetSpells::TimeLimit = 0

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