2016-07-05 22:07:35 +02:00
|
|
|
/*
|
2020-01-02 06:44:10 +01:00
|
|
|
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
|
2016-07-05 22:07:35 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "TransmogrificationPackets.h"
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Transmogrification::TransmogrifyItem& transmogItem)
|
|
|
|
|
{
|
|
|
|
|
data >> transmogItem.ItemModifiedAppearanceID;
|
|
|
|
|
data >> transmogItem.Slot;
|
|
|
|
|
data >> transmogItem.SpellItemEnchantmentID;
|
2020-11-04 21:39:21 +01:00
|
|
|
data >> transmogItem.SecondaryItemModifiedAppearanceID;
|
2016-07-05 22:07:35 +02:00
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WorldPackets::Transmogrification::TransmogrifyItems::Read()
|
|
|
|
|
{
|
|
|
|
|
Items.resize(_worldPacket.read<uint32>());
|
|
|
|
|
_worldPacket >> Npc;
|
|
|
|
|
for (TransmogrifyItem& item : Items)
|
|
|
|
|
_worldPacket >> item;
|
|
|
|
|
|
|
|
|
|
CurrentSpecOnly = _worldPacket.ReadBit();
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-19 12:44:42 +02:00
|
|
|
WorldPacket const* WorldPackets::Transmogrification::AccountTransmogUpdate::Write()
|
2016-07-05 22:07:35 +02:00
|
|
|
{
|
|
|
|
|
_worldPacket.WriteBit(IsFullUpdate);
|
|
|
|
|
_worldPacket.WriteBit(IsSetFavorite);
|
|
|
|
|
_worldPacket << uint32(FavoriteAppearances.size());
|
2019-10-26 11:17:33 +02:00
|
|
|
_worldPacket << uint32(NewAppearances.size());
|
2018-10-04 18:50:21 +02:00
|
|
|
if (!FavoriteAppearances.empty())
|
|
|
|
|
_worldPacket.append(FavoriteAppearances.data(), FavoriteAppearances.size());
|
2016-07-05 22:07:35 +02:00
|
|
|
|
2019-10-26 11:17:33 +02:00
|
|
|
if (!NewAppearances.empty())
|
|
|
|
|
_worldPacket.append(NewAppearances.data(), NewAppearances.size());
|
|
|
|
|
|
2016-07-05 22:07:35 +02:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2018-04-17 17:10:58 +02:00
|
|
|
|
2020-09-19 12:44:42 +02:00
|
|
|
WorldPacket const* WorldPackets::Transmogrification::TransmogrifyNPC::Write()
|
2018-04-17 17:10:58 +02:00
|
|
|
{
|
|
|
|
|
_worldPacket << Guid;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|