TrinityCore
Loading...
Searching...
No Matches
EquipmentSetPackets.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 "EquipmentSetPackets.h"
19#include "PacketOperators.h"
20
22{
31
33{
34 _worldPacket << Size<uint32>(SetData);
35
36 for (EquipmentSetInfo::EquipmentSetData const* equipSet : SetData)
37 {
38 _worldPacket << int32(equipSet->Type);
39 _worldPacket << uint64(equipSet->Guid);
40 _worldPacket << uint32(equipSet->SetID);
41 _worldPacket << uint32(equipSet->IgnoreMask);
42
43 for (std::size_t i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
44 {
45 _worldPacket << equipSet->Pieces[i];
46 _worldPacket << int32(equipSet->Appearances[i]);
47 }
48
49 _worldPacket.append(equipSet->Enchants.data(), equipSet->Enchants.size());
50
51 _worldPacket << int32(equipSet->SecondaryShoulderApparanceID);
52 _worldPacket << int32(equipSet->SecondaryShoulderSlot);
53 _worldPacket << int32(equipSet->SecondaryWeaponAppearanceID);
54 _worldPacket << int32(equipSet->SecondaryWeaponSlot);
55
56 _worldPacket << OptionalInit(equipSet->AssignedSpecIndex);
57 _worldPacket << SizedString::BitsSize<8>(equipSet->SetName);
58 _worldPacket << SizedString::BitsSize<9>(equipSet->SetIcon);
60
61 if (equipSet->AssignedSpecIndex)
62 _worldPacket << int32(*equipSet->AssignedSpecIndex);
63
64 _worldPacket << SizedString::Data(equipSet->SetName);
65 _worldPacket << SizedString::Data(equipSet->SetIcon);
66 }
67
68 return &_worldPacket;
69}
70
102
104{
105 _worldPacket >> ID;
106}
107
109{
110 _worldPacket >> Inv;
111
112 for (uint8 i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
113 {
114 _worldPacket >> Items[i].Item;
115 _worldPacket >> Items[i].ContainerSlot;
116 _worldPacket >> Items[i].Slot;
117 }
118
120}
121
129}
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
#define EQUIPMENT_SET_SLOTS
void append(T value)
Definition ByteBuffer.h:130
void FlushBits()
Definition ByteBuffer.h:141
std::vector< EquipmentSetInfo::EquipmentSetData const * > SetData
EquipmentSetInfo::EquipmentSetData Set
WorldPacket _worldPacket
Definition Packet.h:43
DataWriter< Container > Data(Container const &value)
OptionalInitWriter< T > OptionalInit(Optional< T > const &value)
Data sent in EquipmentSet related packets.
std::array< ObjectGuid, EQUIPMENT_SET_SLOTS > Pieces
uint32 IgnoreMask
Mask of EquipmentSlot.
int32 SecondaryShoulderSlot
Always 2 if secondary shoulder apperance is used.
Optional< int32 > AssignedSpecIndex
Index of character specialization that this set is automatically equipped for.
std::array< int32, 2 > Enchants
SpellItemEnchantmentID.
int32 SecondaryWeaponAppearanceID
For legion artifacts: linked child item appearance.
int32 SecondaryShoulderApparanceID
Secondary shoulder appearance.
std::array< int32, EQUIPMENT_SET_SLOTS > Appearances
ItemModifiedAppearanceID.
int32 SecondaryWeaponSlot
For legion artifacts: which slot is used by child item.