diff --git a/src/servers/sapphire_zone/Inventory/Inventory.cpp b/src/servers/sapphire_zone/Inventory/Inventory.cpp index c3eff997..d3416fc1 100644 --- a/src/servers/sapphire_zone/Inventory/Inventory.cpp +++ b/src/servers/sapphire_zone/Inventory/Inventory.cpp @@ -150,9 +150,7 @@ Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint16_t quantity ItemPtr pItem = make_Item( getNextUId(), catalogId, itemInfo->modelMain, - itemInfo->modelSub, - static_cast< ItemUICategory >( itemInfo->itemUICategory ), - false ); + itemInfo->modelSub ); pItem->setStackSize( itemAmount ); @@ -742,12 +740,13 @@ Core::ItemPtr Core::Inventory::loadItem( uint64_t uId ) { auto itemInfo = pExdData->get< Core::Data::Item >( itemRes->getUInt( 1 ) ); bool isHq = itemRes->getUInt( 3 ) == 1; - ItemPtr pItem( new Item( uId, + + ItemPtr pItem = make_Item( uId, itemRes->getUInt( 1 ), itemInfo->modelMain, itemInfo->modelSub, - static_cast< ItemUICategory >( itemInfo->itemUICategory ), - isHq ) ); + isHq ); + pItem->setStackSize( itemRes->getUInt( 2 ) ); return pItem; diff --git a/src/servers/sapphire_zone/Inventory/Item.cpp b/src/servers/sapphire_zone/Inventory/Item.cpp index b94b8d0b..73727509 100644 --- a/src/servers/sapphire_zone/Inventory/Item.cpp +++ b/src/servers/sapphire_zone/Inventory/Item.cpp @@ -1,47 +1,31 @@ #include #include +#include #include "Framework.h" #include "Item.h" extern Core::Framework g_fw; -Core::Item::Item() -{ - -} - -Core::Item::Item( uint32_t catalogId ) : - m_id( catalogId ), - m_isHq( false ) -{ - -} - -Core::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, Common::ItemUICategory categoryId, bool isHq ) : +Core::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, bool isHq ) : m_id( catalogId ), m_uId( uId ), - m_category( categoryId ), m_model1( model1 ), m_model2( model2 ), m_isHq( isHq ) { auto pExdData = g_fw.get< Data::ExdDataGenerated >(); auto itemInfo = pExdData->get< Core::Data::Item >( catalogId ); - + m_delayMs = itemInfo->delayms; m_physicalDmg = itemInfo->damagePhys; m_magicalDmg = itemInfo->damageMag; m_weaponDmg = ( m_physicalDmg != 0 ) ? m_physicalDmg : m_magicalDmg; m_autoAttackDmg = static_cast< float >( m_weaponDmg * m_delayMs ) / 3000; + m_category = static_cast< Common::ItemUICategory >( itemInfo->itemUICategory ); m_itemLevel = itemInfo->levelItem; } -Core::Item::~Item() -{ - -} - float Core::Item::getAutoAttackDmg() const { return m_autoAttackDmg; diff --git a/src/servers/sapphire_zone/Inventory/Item.h b/src/servers/sapphire_zone/Inventory/Item.h index 97df4937..2801adf4 100644 --- a/src/servers/sapphire_zone/Inventory/Item.h +++ b/src/servers/sapphire_zone/Inventory/Item.h @@ -9,10 +9,8 @@ class Item { public: - Item(); - Item( uint32_t catalogId ); - Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, Common::ItemUICategory categoryId, bool isHq = false ); - ~Item(); + Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t model2, bool isHq = false ); + ~Item() = default; uint32_t getId() const;