TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LootPackets.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 LootPackets_h__
19 #define LootPackets_h__
20 
21 #include "Packet.h"
22 #include "ObjectGuid.h"
23 #include "ItemPackets.h"
24 
25 namespace WorldPackets
26 {
27  namespace Loot
28  {
29  class LootUnit final : public ClientPacket
30  {
31  public:
32  LootUnit(WorldPacket&& packet) : ClientPacket(CMSG_LOOT_UNIT, std::move(packet)) { }
33 
34  void Read() override;
35 
37  };
38 
39  struct LootItemData
40  {
41  uint8 Type = 0;
46  bool CanTradeToTapList = false;
48  };
49 
50  struct LootCurrency
51  {
56  };
57 
58  class LootResponse final : public ServerPacket
59  {
60  public:
62 
63  WorldPacket const* Write() override;
64 
67  uint8 Threshold = 2; // Most common value, 2 = Uncommon
70  uint8 FailureReason = 17; // Most common value
72  std::vector<LootItemData> Items;
73  std::vector<LootCurrency> Currencies;
74  bool PersonalLooting = false;
75  bool Acquired = false;
76  bool AELooting = false;
77  };
78 
79  struct LootRequest
80  {
83  };
84 
85  // PlayerCliLootItem
86  class LootItem final : public ClientPacket
87  {
88  public:
89  LootItem(WorldPacket&& packet) : ClientPacket(CMSG_LOOT_ITEM, std::move(packet)) { }
90 
91  void Read() override;
92 
93  std::vector<LootRequest> Loot;
94  };
95 
96  class LootRemoved final : public ServerPacket
97  {
98  public:
100 
101  WorldPacket const* Write() override;
102 
106  };
107 
108  class LootRelease final : public ClientPacket
109  {
110  public:
111  LootRelease(WorldPacket&& packet) : ClientPacket(CMSG_LOOT_RELEASE, std::move(packet)) { }
112 
113  void Read() override;
114 
116  };
117 
118  class LootMoney final : public ClientPacket
119  {
120  public:
121  LootMoney(WorldPacket&& packet) : ClientPacket(CMSG_LOOT_MONEY, std::move(packet)) { }
122 
123  void Read() override { }
124  };
125 
126  class LootMoneyNotify final : public ServerPacket
127  {
128  public:
130 
131  WorldPacket const* Write() override;
132 
134  bool SoleLooter = false;
135  };
136 
137  class CoinRemoved final : public ServerPacket
138  {
139  public:
141 
142  WorldPacket const* Write() override;
143 
145  };
146 
147  class LootRoll final : public ClientPacket
148  {
149  public:
150  LootRoll(WorldPacket&& packet) : ClientPacket(CMSG_LOOT_ROLL, std::move(packet)) { }
151 
152  void Read() override;
153 
157  };
158 
159  class LootReleaseResponse final : public ServerPacket
160  {
161  public:
163 
164  WorldPacket const* Write() override;
165 
168  };
169 
170  class LootList final : public ServerPacket
171  {
172  public:
174 
175  WorldPacket const* Write() override;
176 
180  };
181 
182  class SetLootSpecialization final : public ClientPacket
183  {
184  public:
186 
187  void Read() override;
188 
190  };
191  }
192 }
193 
194 #endif // LootPackets_h__
RollType
Definition: LootMgr.h:40
ObjectGuid LootObj
Definition: LootPackets.h:103
uint8 AcquireReason
Definition: LootPackets.h:69
Definition: Opcodes.h:1201
Definition: LootPackets.h:108
Definition: Opcodes.h:623
ObjectGuid Unit
Definition: LootPackets.h:36
Definition: LootPackets.h:50
void Read() override
Definition: LootPackets.cpp:89
std::vector< LootCurrency > Currencies
Definition: LootPackets.h:73
uint8 LootItemType
Definition: LootPackets.h:44
ObjectGuid Owner
Definition: LootPackets.h:66
uint32 Quantity
Definition: LootPackets.h:53
SetLootSpecialization(WorldPacket &&packet)
Definition: LootPackets.h:185
Definition: Opcodes.h:917
LootMoney(WorldPacket &&packet)
Definition: LootPackets.h:121
std::vector< LootItemData > Items
Definition: LootPackets.h:72
Definition: LootPackets.h:86
uint8 LootListID
Definition: LootPackets.h:82
WorldPacket const * Write() override
Definition: LootPackets.cpp:25
bool Acquired
Definition: LootPackets.h:75
uint8 LootListID
Definition: LootPackets.h:105
Definition: LootPackets.h:79
LootRoll(WorldPacket &&packet)
Definition: LootPackets.h:150
uint8 Threshold
Definition: LootPackets.h:67
bool CanTradeToTapList
Definition: LootPackets.h:46
Optional< ObjectGuid > Master
Definition: LootPackets.h:178
void Read() override
Definition: LootPackets.cpp:67
Definition: Opcodes.h:393
STL namespace.
Definition: LootPackets.h:137
uint8 LootListID
Definition: LootPackets.h:45
LootItem(WorldPacket &&packet)
Definition: LootPackets.h:89
Definition: LootPackets.h:126
WorldPacket const * Write() override
Definition: LootPackets.cpp:80
LootRemoved()
Definition: LootPackets.h:99
uint32 Money
Definition: LootPackets.h:133
WorldPacket const * Write() override
Definition: LootPackets.cpp:94
LootRelease(WorldPacket &&packet)
Definition: LootPackets.h:111
Definition: Opcodes.h:1203
uint32 Coins
Definition: LootPackets.h:71
ObjectGuid LootObj
Definition: LootPackets.h:154
LootMoneyNotify()
Definition: LootPackets.h:129
ObjectGuid LootObj
Definition: LootPackets.h:144
CoinRemoved()
Definition: LootPackets.h:140
bool AELooting
Definition: LootPackets.h:76
Definition: LootPackets.h:159
Definition: LootPackets.h:182
ObjectGuid LootObj
Definition: LootPackets.h:65
Definition: Packet.h:59
Definition: LootPackets.h:39
Definition: LootPackets.h:96
Definition: LootPackets.h:170
ObjectGuid Owner
Definition: LootPackets.h:167
void Read() override
Definition: LootPackets.cpp:110
Definition: Opcodes.h:1206
Definition: LootMgr.h:314
Definition: Packet.h:46
void Read() override
Definition: LootPackets.h:123
Definition: LootPackets.h:147
ObjectGuid Object
Definition: LootPackets.h:81
void Read() override
Definition: LootPackets.cpp:143
ObjectGuid Unit
Definition: LootPackets.h:115
uint8 UIType
Definition: LootPackets.h:55
Definition: Opcodes.h:395
uint32_t uint32
Definition: Define.h:150
ObjectGuid LootObj
Definition: LootPackets.h:166
ObjectGuid Owner
Definition: LootPackets.h:104
LootList()
Definition: LootPackets.h:173
bool PersonalLooting
Definition: LootPackets.h:74
LootUnit(WorldPacket &&packet)
Definition: LootPackets.h:32
boost::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Common.h:170
Definition: Opcodes.h:392
LootResponse()
Definition: LootPackets.h:61
uint8 FailureReason
Definition: LootPackets.h:70
Definition: BattlegroundMgr.h:57
uint8 LootListID
Definition: LootPackets.h:54
uint32 CurrencyID
Definition: LootPackets.h:52
Definition: Opcodes.h:1205
WorldPacket const * Write() override
Definition: LootPackets.cpp:117
WorldPackets::Item::ItemInstance Loot
Definition: LootPackets.h:47
Definition: LootPackets.h:118
Definition: Opcodes.h:394
ObjectGuid Owner
Definition: LootPackets.h:177
Definition: LootPackets.h:58
uint32 SpecID
Definition: LootPackets.h:189
uint8 UIType
Definition: LootPackets.h:42
LootMethod
Definition: LootMgr.h:65
LootReleaseResponse()
Definition: LootPackets.h:162
uint32 Quantity
Definition: LootPackets.h:43
uint8_t uint8
Definition: Define.h:152
Definition: ItemPackets.h:40
WorldPacket const * Write() override
Definition: LootPackets.cpp:125
Definition: LootPackets.h:29
std::vector< LootRequest > Loot
Definition: LootPackets.h:93
Definition: ObjectGuid.h:189
void Read() override
Definition: LootPackets.cpp:20
Optional< ObjectGuid > RoundRobinWinner
Definition: LootPackets.h:179
Type
Type of JSON value.
Definition: rapidjson.h:642
bool SoleLooter
Definition: LootPackets.h:134
Definition: WorldPacket.h:26
WorldPacket const * Write() override
Definition: LootPackets.cpp:103
Definition: Opcodes.h:1202
uint8 LootListID
Definition: LootPackets.h:155
Definition: Opcodes.h:396