1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

EquipSlotCategory reverted back or I updated the wrong enum last time? Anyway all values are checked manually and better naming.

This commit is contained in:
collett 2021-02-16 23:51:42 +09:00
parent 3e5b1ae5e9
commit c4effc7e21
4 changed files with 46 additions and 63 deletions

View file

@ -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

View file

@ -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

View file

@ -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();

View file

@ -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: