diff --git a/src/common/Common.h b/src/common/Common.h index e642b4d8..a2e9f834 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -161,44 +161,27 @@ namespace Sapphire::Common enum class EquipSlotCategory : uint8_t { - // main slots - - CharaMainHand = 0, - CharaOffHand = 1, - CharaHead = 2, - CharaBody = 3, - CharaHands = 4, - CharaWaist = 5, - CharaLegs = 6, - CharaFeet = 7, - CharaEars = 8, - CharaNeck = 9, - CharaWrist = 10, - CharaRing = 11, - CharaSoulCrystal = 12, - - /* following slots not seem to exist any more. - when multi-slot gear is moved into equipment slot, normal slot listed above is used. - client will move any incompatible gears into armory but no InventoryModifiyHandler is sent. - server need to move those silently in order to sync with client. - */ - - /*! Cannot equip gear to offhand slot */ - //MainTwoHandedWeapon = 13, - /*! Can be equipped in either main or offhand slot */ - //MainOrOffHand = 14, // unused - /*! Cannot equip gear to head */ - //BodyDisallowHead = 15, - /*! Cannot equip gear to hands, legs and feet slots */ - //BodyDisallowHandsLegsFeet = 16, - /*! Cannot equip gear to feet slot */ - //LegsDisallowFeet = 18, - /*! Cannot equp gear to head, hands, legs, feet slots */ - //BodyDisallowAll = 19, - /*! Cannot equip gear to hands slot */ - //BodyDisallowHands = 20, - /*! Cannot equip gear to legs & feet slots */ - //BodyDisallowLegsFeet = 21, + MainHand = 1, + OffHand = 2, + Head = 3, + Body = 4, + Hands = 5, + Waist = 6, + Legs = 7, + Feet = 8, + Ears = 9, + Neck = 10, + Wrist = 11, + Ring = 12, + MainTwoHandedWeapon = 13, + //MainOrOffHand = 14, // unused + BodyDisallowHead = 15, + BodyDisallowHandsLegsFeet = 16, + SoulCrystal = 17, + LegsDisallowFeet = 18, + BodyDisallowAll = 19, + BodyDisallowHands = 20, + BodyDisallowLegsFeet = 21, }; enum InventoryType : uint16_t diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index 0e4c7ea7..69c988af 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -66,7 +66,7 @@ namespace Sapphire::Network::Packets Logout = 0x012A, // updated 5.45 hotfix CFNotify = 0x026E, // updated 5.45 hotfix CFMemberStatus = 0x0079, - CFDutyInfo = 0x0193, // updated 5.35 hotfix + CFDutyInfo = 0xF193, // updated 5.35 hotfix CFPlayerInNeed = 0xF07F, CFPreferredRole = 0x012E, // updated 5.45 hotfix CFCancel = 0x00EC, // updated 5.35 hotfix @@ -80,7 +80,7 @@ namespace Sapphire::Network::Packets LogMessage = 0x00D0, - Chat = 0x0349, // updated 5.35 hotfix + Chat = 0x01BA, // updated 5.45 hotfix PartyChat = 0x0065, WorldVisitList = 0xF0FE, // added 4.5 diff --git a/src/world/Actor/PlayerInventory.cpp b/src/world/Actor/PlayerInventory.cpp index f94d0237..2d4763fc 100644 --- a/src/world/Actor/PlayerInventory.cpp +++ b/src/world/Actor/PlayerInventory.cpp @@ -580,9 +580,9 @@ Sapphire::ItemPtr Sapphire::Entity::Player::addItem( ItemPtr itemToAdd, bool sil bool foundFreeSlot = false; std::vector< uint16_t > bags = { Bag0, Bag1, Bag2, Bag3 }; - + sendDebug( "adding item: {}, equipSlotCategory: {}, stackSize: {}", itemToAdd->getId(), itemInfo->equipSlotCategory, itemInfo->stackSize ); // add the related armoury bag to the applicable bags and try and fill a free slot there before falling back to regular inventory - if( itemInfo->isEquippable && getEquipDisplayFlags() & StoreNewItemsInArmouryChest ) + if( itemInfo->equipSlotCategory > 0 && getEquipDisplayFlags() & StoreNewItemsInArmouryChest ) { auto bag = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( static_cast< Common::EquipSlotCategory >( itemInfo->equipSlotCategory ) ); @@ -601,7 +601,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::addItem( ItemPtr itemToAdd, bool sil auto item = storage->getItem( slot ); // add any items that are stackable - if( canMerge && item && !itemInfo->isEquippable && item->getId() == itemToAdd->getId() ) + if( canMerge && item && item->getMaxStackSize() > 1 && item->getId() == itemToAdd->getId() ) { uint32_t count = item->getStackSize(); uint32_t maxStack = item->getMaxStackSize(); diff --git a/src/world/Manager/ItemMgr.cpp b/src/world/Manager/ItemMgr.cpp index 3c08d82d..c8331dac 100644 --- a/src/world/Manager/ItemMgr.cpp +++ b/src/world/Manager/ItemMgr.cpp @@ -32,51 +32,51 @@ uint16_t Sapphire::World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( switch( slot ) { - case Common::EquipSlotCategory::CharaHead: + case Common::EquipSlotCategory::Head: return Common::ArmoryHead; - case Common::EquipSlotCategory::CharaBody: - //case Common::EquipSlotCategory::BodyDisallowHead: - //case Common::EquipSlotCategory::BodyDisallowHandsLegsFeet: - //case Common::EquipSlotCategory::BodyDisallowAll: - //case Common::EquipSlotCategory::BodyDisallowHands: - //case Common::EquipSlotCategory::BodyDisallowLegsFeet: + case Common::EquipSlotCategory::Body: + case Common::EquipSlotCategory::BodyDisallowHead: + case Common::EquipSlotCategory::BodyDisallowHandsLegsFeet: + case Common::EquipSlotCategory::BodyDisallowAll: + case Common::EquipSlotCategory::BodyDisallowHands: + case Common::EquipSlotCategory::BodyDisallowLegsFeet: return Common::ArmoryBody; - case Common::EquipSlotCategory::CharaEars: + case Common::EquipSlotCategory::Ears: return Common::ArmoryEar; - case Common::EquipSlotCategory::CharaFeet: + case Common::EquipSlotCategory::Feet: return Common::ArmoryFeet; - case Common::EquipSlotCategory::CharaHands: + case Common::EquipSlotCategory::Hands: return Common::ArmoryHand; - case Common::EquipSlotCategory::CharaLegs: - //case Common::EquipSlotCategory::LegsDisallowFeet: + case Common::EquipSlotCategory::Legs: + case Common::EquipSlotCategory::LegsDisallowFeet: return Common::ArmoryLegs; - case Common::EquipSlotCategory::CharaMainHand: - //case Common::EquipSlotCategory::MainTwoHandedWeapon: + case Common::EquipSlotCategory::MainHand: + case Common::EquipSlotCategory::MainTwoHandedWeapon: //case Common::EquipSlotCategory::MainOrOffHand: return Common::ArmoryMain; - case Common::EquipSlotCategory::CharaOffHand: + case Common::EquipSlotCategory::OffHand: return Common::ArmoryOff; - case Common::EquipSlotCategory::CharaRing: + case Common::EquipSlotCategory::Ring: return Common::ArmoryRing; - case Common::EquipSlotCategory::CharaWaist: + case Common::EquipSlotCategory::Waist: return Common::ArmoryWaist; - case Common::EquipSlotCategory::CharaWrist: + case Common::EquipSlotCategory::Wrist: return Common::ArmoryWrist; - case Common::EquipSlotCategory::CharaNeck: + case Common::EquipSlotCategory::Neck: return Common::ArmoryNeck; - case Common::EquipSlotCategory::CharaSoulCrystal: + case Common::EquipSlotCategory::SoulCrystal: return Common::ArmorySoulCrystal; default: