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

#include <LootPackets.h>

Public Member Functions

 LootResponse ()
 
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 LootObj
 
ObjectGuid Owner
 
uint8 Threshold = 2
 
uint8 LootMethod = 0
 
uint8 AcquireReason = 0
 
uint8 FailureReason = 17
 
uint32 Coins = 0
 
std::vector< LootItemDataItems
 
std::vector< LootCurrencyCurrencies
 
bool PersonalLooting = false
 
bool Acquired = false
 
bool AELooting = false
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Loot::LootResponse::LootResponse ( )
inline
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:1206

Member Function Documentation

WorldPacket const * WorldPackets::Loot::LootResponse::Write ( )
overridevirtual

Implements WorldPackets::Packet.

26 {
34  _worldPacket << uint32(Items.size());
35  _worldPacket << uint32(Currencies.size());
36 
37  for (LootItemData const& item : Items)
38  {
39  _worldPacket.WriteBits(item.Type, 2);
40  _worldPacket.WriteBits(item.UIType, 3);
41  _worldPacket.WriteBit(item.CanTradeToTapList);
43 
44  _worldPacket << item.Quantity;
45  _worldPacket << item.LootItemType;
46  _worldPacket << item.LootListID;
47  _worldPacket << item.Loot; // WorldPackets::Item::ItemInstance
48  }
49 
50  for (LootCurrency const& currency : Currencies)
51  {
52  _worldPacket << currency.CurrencyID;
53  _worldPacket << currency.Quantity;
54  _worldPacket << currency.LootListID;
55  _worldPacket.WriteBits(currency.UIType, 3);
57  }
58 
63 
64  return &_worldPacket;
65 }
uint8 LootMethod
Definition: LootPackets.h:68
uint8 AcquireReason
Definition: LootPackets.h:69
std::vector< LootCurrency > Currencies
Definition: LootPackets.h:73
ObjectGuid Owner
Definition: LootPackets.h:66
std::vector< LootItemData > Items
Definition: LootPackets.h:72
bool Acquired
Definition: LootPackets.h:75
uint8 Threshold
Definition: LootPackets.h:67
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
uint32 Coins
Definition: LootPackets.h:71
bool AELooting
Definition: LootPackets.h:76
ObjectGuid LootObj
Definition: LootPackets.h:65
bool PersonalLooting
Definition: LootPackets.h:74
uint8 FailureReason
Definition: LootPackets.h:70
uint32_t uint32
Definition: g3dmath.h:168
void WriteBits(T value, int32 bits)
Definition: ByteBuffer.h:198

Member Data Documentation

bool WorldPackets::Loot::LootResponse::Acquired = false
uint8 WorldPackets::Loot::LootResponse::AcquireReason = 0
bool WorldPackets::Loot::LootResponse::AELooting = false
uint32 WorldPackets::Loot::LootResponse::Coins = 0
std::vector<LootCurrency> WorldPackets::Loot::LootResponse::Currencies
uint8 WorldPackets::Loot::LootResponse::FailureReason = 17
std::vector<LootItemData> WorldPackets::Loot::LootResponse::Items
uint8 WorldPackets::Loot::LootResponse::LootMethod = 0
ObjectGuid WorldPackets::Loot::LootResponse::LootObj
ObjectGuid WorldPackets::Loot::LootResponse::Owner
bool WorldPackets::Loot::LootResponse::PersonalLooting = false
uint8 WorldPackets::Loot::LootResponse::Threshold = 2

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