TrinityCore
Loading...
Searching...
No Matches
InspectPackets.cpp
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#include "InspectPackets.h"
19#include "Item.h"
20
22{
24{
26}
27
29{
30 data << uint32(item.ItemID);
31 data << uint16(item.EnchantSlots.to_ulong());
32
33 if (!item.Enchants.empty())
34 data.append(item.Enchants.data(), item.Enchants.size());
35
36 data << int16(item.RandomPropertiesID);
37 data << item.CreatorGUID.WriteAsPacked();
38 data << uint32(item.RandomPropertiesSeed);
39
40 return data;
41}
42
44{
46
47 ItemID = item->GetEntry();
50
51 for (uint8 i = 0; i < MAX_ENCHANTMENT_SLOT; ++i)
52 {
54 {
55 EnchantSlots[i] = true;
56 Enchants.push_back(enchId);
57 }
58 }
59}
60
62{
65 _worldPacket << uint32(ItemSlots.to_ulong());
66
67 for (InspectItemData const& item : Items)
68 _worldPacket << item;
69
70 return &_worldPacket;
71}
72}
uint8_t uint8
Definition Define.h:135
int16_t int16
Definition Define.h:130
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
EnchantmentSlot
@ MAX_ENCHANTMENT_SLOT
@ ITEM_FIELD_CREATOR
void append(T value)
Definition ByteBuffer.h:129
Definition Item.h:62
uint32 GetEnchantmentId(EnchantmentSlot slot) const
Definition Item.h:148
int32 GetItemRandomPropertyId() const
Definition Item.h:140
uint32 GetItemSuffixFactor() const
Definition Item.h:141
PackedGuidWriter WriteAsPacked() const
Definition ObjectGuid.h:152
uint32 GetEntry() const
Definition Object.h:81
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:281
WorldPacket const * Write() override
std::vector< InspectItemData > Items
Talent::TalentInfoUpdate TalentInfo
WorldPacket _worldPacket
Definition Packet.h:42
ByteBuffer & operator<<(ByteBuffer &data, InspectItemData const &item)