Core/Packets:
* renamed CMSG_GUILD_BANKER_ACTIVATE to CMSG_GUILD_BANK_ACTIVATE and updated handler to packet class * renamed SMSG_GUILD_BANK_LIST to SMSG_GUILD_BANK_QUERY_RESULTS and updated packets to packet class * Updated CMSG_GUILD_BANK_QUERY_TAB, CMSG_GUILD_BANK_BUY_TAB and CMSG_GUILD_BANK_UPDATE_TAB handlers to packet class * fixed displaying sockets, reforged stats and enchantments for items in the guild bank
This commit is contained in:
1 parent
8da40c3605
commit
d78d787292
11 files changed
+502
-144
No files matched your search
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2019 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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 "ItemPacketsCommon.h"
|
||||
#include "Item.h"
|
||||
#include "Player.h"
|
||||
#include "Loot.h"
|
||||
|
||||
void WorldPackets::Item::ItemInstance::Initialize(::Item const* item)
|
||||
{
|
||||
ItemID = item->GetEntry();
|
||||
RandomPropertiesID = item->GetItemRandomPropertyId();
|
||||
RandomPropertiesSeed = item->GetItemSuffixFactor();
|
||||
}
|
||||
|
||||
bool WorldPackets::Item::ItemInstance::operator==(ItemInstance const& r) const
|
||||
{
|
||||
if (ItemID != r.ItemID || RandomPropertiesID != r.RandomPropertiesID || RandomPropertiesSeed != r.RandomPropertiesSeed)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Item::ItemInstance const& itemInstance)
|
||||
{
|
||||
data << int32(itemInstance.ItemID);
|
||||
data << int32(itemInstance.RandomPropertiesID);
|
||||
data << int32(itemInstance.RandomPropertiesSeed);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Item::ItemInstance& itemInstance)
|
||||
{
|
||||
data >> itemInstance.ItemID;
|
||||
data >> itemInstance.RandomPropertiesID;
|
||||
data >> itemInstance.RandomPropertiesSeed;
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Item::ItemEnchantData const& itemEnchantData)
|
||||
{
|
||||
data << int32(itemEnchantData.ID);
|
||||
data << uint32(itemEnchantData.Expiration);
|
||||
data << int32(itemEnchantData.Charges);
|
||||
data << uint8(itemEnchantData.Slot);
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Item::ItemGemData const& itemGemData)
|
||||
{
|
||||
data << uint32(itemGemData.Slot);
|
||||
data << uint32(itemGemData.EnchantmentId);
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Item::ItemGemData& itemGemData)
|
||||
{
|
||||
data >> itemGemData.Slot;
|
||||
data >> itemGemData.EnchantmentId;
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Item::InvUpdate& invUpdate)
|
||||
{
|
||||
invUpdate.Items.resize(data.ReadBits(2));
|
||||
for (size_t i = 0; i < invUpdate.Items.size(); ++i)
|
||||
{
|
||||
data >> invUpdate.Items[i].ContainerSlot;
|
||||
data >> invUpdate.Items[i].Slot;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
Reference in new issue
Block a user