diff --git a/src/world/Inventory/HousingItem.cpp b/src/world/Inventory/HousingItem.cpp index b0134125..99f903ff 100644 --- a/src/world/Inventory/HousingItem.cpp +++ b/src/world/Inventory/HousingItem.cpp @@ -4,6 +4,7 @@ Sapphire::Inventory::HousingItem::HousingItem( uint64_t uId, uint32_t catalogId Sapphire::Item( uId, catalogId, false ) { m_stackSize = 1; + m_spiritBond = 1; } uint16_t Sapphire::Inventory::HousingItem::getRot() const diff --git a/src/world/Inventory/Item.cpp b/src/world/Inventory/Item.cpp index ac2016e8..98c546b7 100644 --- a/src/world/Inventory/Item.cpp +++ b/src/world/Inventory/Item.cpp @@ -12,7 +12,8 @@ Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, bool isHq ) : m_uId( uId ), m_isHq( isHq ), m_stain( 0 ), - m_durability( 30000 ) + m_durability( 30000 ), + m_spiritBond( 0 ) { auto pExdData = g_fw.get< Data::ExdDataGenerated >(); auto itemInfo = pExdData->get< Sapphire::Data::Item >( catalogId ); @@ -160,3 +161,13 @@ uint32_t Sapphire::Item::getAdditionalData() const { return m_additionalData; } + +uint16_t Sapphire::Item::getSpiritbond() const +{ + return m_spiritBond; +} + +void Sapphire::Item::setSpiritbond( uint16_t spiritbond ) +{ + m_spiritBond = spiritbond; +} diff --git a/src/world/Inventory/Item.h b/src/world/Inventory/Item.h index f2b17ad1..018956b9 100644 --- a/src/world/Inventory/Item.h +++ b/src/world/Inventory/Item.h @@ -64,6 +64,9 @@ namespace Sapphire uint32_t getAdditionalData() const; + void setSpiritbond( uint16_t spiritbond ); + uint16_t getSpiritbond() const; + protected: uint32_t m_id; @@ -89,6 +92,7 @@ namespace Sapphire uint16_t m_itemLevel; uint16_t m_durability; uint16_t m_stain; + uint16_t m_spiritBond; uint32_t m_additionalData; diff --git a/src/world/Manager/InventoryMgr.cpp b/src/world/Manager/InventoryMgr.cpp index 81c117e0..7405a0eb 100644 --- a/src/world/Manager/InventoryMgr.cpp +++ b/src/world/Manager/InventoryMgr.cpp @@ -49,8 +49,8 @@ void Sapphire::World::Manager::InventoryMgr::sendInventoryContainer( Sapphire::E itemInfoPacket->data().quantity = itM->second->getStackSize(); itemInfoPacket->data().catalogId = itM->second->getId(); itemInfoPacket->data().condition = itM->second->getDurability(); - itemInfoPacket->data().spiritBond = 0; - itemInfoPacket->data().hqFlag = itM->second->isHq() ? 1 : 0; + itemInfoPacket->data().spiritBond = itM->second->getSpiritbond(); + itemInfoPacket->data().hqFlag = static_cast< uint8_t >( itM->second->isHq() ? 1 : 0 ); itemInfoPacket->data().stain = itM->second->getStain(); player.queuePacket( itemInfoPacket ); diff --git a/src/world/Network/Handlers/ClientTriggerHandler.cpp b/src/world/Network/Handlers/ClientTriggerHandler.cpp index 5c9cee52..ee915f0d 100644 --- a/src/world/Network/Handlers/ClientTriggerHandler.cpp +++ b/src/world/Network/Handlers/ClientTriggerHandler.cpp @@ -427,7 +427,6 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX { uint8_t plot = ( param12 & 0xFF ); - auto housingMgr = g_fw.get< HousingMgr >(); if( !housingMgr ) break; diff --git a/src/world/Network/PacketWrappers/UpdateInventorySlotPacket.h b/src/world/Network/PacketWrappers/UpdateInventorySlotPacket.h index 312b7abf..1dbe2474 100644 --- a/src/world/Network/PacketWrappers/UpdateInventorySlotPacket.h +++ b/src/world/Network/PacketWrappers/UpdateInventorySlotPacket.h @@ -33,7 +33,7 @@ namespace Sapphire::Network::Packets::Server m_data.signatureId = 0; m_data.hqFlag = item.isHq() ? 1 : 0; m_data.condition = 60000; // 200% - m_data.spiritBond = 0; + m_data.spiritBond = item.getSpiritbond(); m_data.color = 0; m_data.glamourCatalogId = 0; m_data.materia1 = 0;