TrinityCore
Loading...
Searching...
No Matches
ItemPacketsCommon.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
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 TRINITYCORE_ITEM_PACKETS_COMMON_H
19#define TRINITYCORE_ITEM_PACKETS_COMMON_H
20
21#include "ItemDefines.h"
22#include "PacketUtilities.h"
23#include "Optional.h"
24#include <vector>
25
26class ByteBuffer;
27class Item;
28struct LootItem;
29struct VoidStorageItem;
30enum class ItemContext : uint8;
31
32namespace UF
33{
34 struct SocketedGem;
35}
36
37namespace WorldPackets
38{
39 namespace Item
40 {
42 {
44 std::vector<int32> BonusListIDs;
45
46 bool operator==(ItemBonuses const& r) const;
47 };
48
49 struct ItemMod
50 {
53
54 friend bool operator==(ItemMod const& left, ItemMod const& right) = default;
55 };
56
58 {
60
61 bool operator==(ItemModList const& r) const;
62 };
63
65 {
66 void Initialize(::Item const* item);
67 void Initialize(UF::SocketedGem const* gem);
68 void Initialize(::LootItem const& lootItem);
69
73
74 bool operator==(ItemInstance const& r) const;
75 };
76
78 {
80 std::vector<int32> BonusListIDs;
81 std::vector<ItemMod> Modifications;
82
83 bool operator==(ItemBonusKey const& right) const;
84 };
85
87 {
88 ItemEnchantData(int32 id, uint32 expiration, int32 charges, uint8 slot) : ID(id), Expiration(expiration), Charges(charges), Slot(slot) { }
89 int32 ID = 0;
93 };
94
100
102 {
103 struct InvItem
104 {
107 };
108
109 std::vector<InvItem> Items;
110 };
111
113 {
116 };
117
118 ByteBuffer& operator<<(ByteBuffer& data, ItemEnchantData const& itemEnchantData);
119
120 ByteBuffer& operator<<(ByteBuffer& data, ItemGemData const& itemGemInstanceData);
121 ByteBuffer& operator>>(ByteBuffer& data, ItemGemData& itemGemInstanceData);
122
123 ByteBuffer& operator<<(ByteBuffer& data, ItemInstance const& itemInstance);
124 ByteBuffer& operator>>(ByteBuffer& data, ItemInstance& itemInstance);
125
126 ByteBuffer& operator<<(ByteBuffer& data, ItemBonusKey const& itemBonusKey);
127
128 ByteBuffer& operator>>(ByteBuffer& data, InvUpdate& invUpdate);
129
130 ByteBuffer& operator<<(ByteBuffer& data, UiEventToast const& uiEventToast);
131 }
132}
133
134#endif // TRINITYCORE_ITEM_PACKETS_COMMON_H
ItemContext
Definition DBCEnums.h:1315
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
ItemModifier
@ MAX_ITEM_MODIFIERS
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
Definition Item.h:179
ByteBuffer & operator<<(ByteBuffer &data, ItemPurchaseRefundItem &refundItem)
ByteBuffer & operator>>(ByteBuffer &data, ItemBonuses &itemBonusInstanceData)
bool operator==(ItemBonusKey const &right) const
std::vector< ItemMod > Modifications
bool operator==(ItemBonuses const &r) const
ItemEnchantData(int32 id, uint32 expiration, int32 charges, uint8 slot)
Optional< ItemBonuses > ItemBonus
bool operator==(ItemInstance const &r) const
void Initialize(::Item const *item)
bool operator==(ItemModList const &r) const
Array< ItemMod, MAX_ITEM_MODIFIERS > Values
friend bool operator==(ItemMod const &left, ItemMod const &right)=default