1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 23:57:46 +00:00
sapphire/src/world/Network/PacketWrappers/UpdateInventorySlotPacket.h

55 lines
1.4 KiB
C
Raw Normal View History

#ifndef _INVENTORY_SLOT_UPDATE_PACKET_H
#define _INVENTORY_SLOT_UPDATE_PACKET_H
#include <Network/GamePacketNew.h>
#include "Actor/Player.h"
#include "Inventory/Item.h"
#include "Forwards.h"
namespace Sapphire::Network::Packets::Server
{
2018-10-28 21:53:21 +01:00
/**
* @brief The update inventory-slot packet.
*/
class UpdateInventorySlotPacket : public ZoneChannelPacket< FFXIVIpcUpdateInventorySlot >
{
2018-10-28 21:53:21 +01:00
public:
UpdateInventorySlotPacket( uint32_t playerId, uint8_t slot, uint16_t storageId, const Item& item ) :
ZoneChannelPacket< FFXIVIpcUpdateInventorySlot >( playerId, playerId )
{
initialize( slot, storageId, item );
};
private:
void initialize( uint8_t slot, uint16_t storageId, const Item& item )
{
m_data.sequence = 0;
m_data.containerId = storageId;
m_data.slot = slot;
m_data.quantity = item.getStackSize();
m_data.catalogId = item.getId();
m_data.reservedFlag = 0; // no idea
m_data.signatureId = 0;
m_data.hqFlag = item.isHq() ? 1 : 0;
m_data.condition = 60000; // 200%
m_data.spiritBond = 0;
m_data.color = 0;
m_data.glamourCatalogId = 0;
m_data.materia1 = 0;
m_data.materia2 = 0;
m_data.materia3 = 0;
m_data.materia4 = 0;
m_data.materia5 = 0;
//m_data.buffer1;
//uint8_t buffer2;
//uint8_t buffer3;
//uint8_t buffer4;
//uint8_t buffer5;
};
};
}
#endif /*_MODELEQUIPPACKET_H*/