2018-07-26 14:09:09 +02:00
|
|
|
#ifndef _INVENTORY_SLOT_UPDATE_PACKET_H
|
|
|
|
#define _INVENTORY_SLOT_UPDATE_PACKET_H
|
|
|
|
|
2019-03-08 15:34:38 +01:00
|
|
|
#include <Network/GamePacket.h>
|
2018-07-26 14:09:09 +02:00
|
|
|
#include "Actor/Player.h"
|
|
|
|
#include "Inventory/Item.h"
|
|
|
|
#include "Forwards.h"
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire::Network::Packets::Server
|
2018-07-26 14:09:09 +02:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/**
|
|
|
|
* @brief The update inventory-slot packet.
|
|
|
|
*/
|
|
|
|
class UpdateInventorySlotPacket : public ZoneChannelPacket< FFXIVIpcUpdateInventorySlot >
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
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();
|
2018-12-28 17:12:24 +11:00
|
|
|
m_data.reservedFlag = item.getReservedFlag(); // no idea
|
2018-10-28 21:53:21 +01:00
|
|
|
m_data.signatureId = 0;
|
|
|
|
m_data.hqFlag = item.isHq() ? 1 : 0;
|
|
|
|
m_data.condition = 60000; // 200%
|
2018-12-28 15:48:13 +11:00
|
|
|
m_data.spiritBond = item.getSpiritbond();
|
2018-10-28 21:53:21 +01:00
|
|
|
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;
|
|
|
|
};
|
2018-08-29 21:40:59 +02:00
|
|
|
};
|
2018-07-26 14:09:09 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /*_MODELEQUIPPACKET_H*/
|