1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 22:37:45 +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 enum class EquipSlotCategory : uint8_t
{ {
// main slots MainHand = 1,
OffHand = 2,
CharaMainHand = 0, Head = 3,
CharaOffHand = 1, Body = 4,
CharaHead = 2, Hands = 5,
CharaBody = 3, Waist = 6,
CharaHands = 4, Legs = 7,
CharaWaist = 5, Feet = 8,
CharaLegs = 6, Ears = 9,
CharaFeet = 7, Neck = 10,
CharaEars = 8, Wrist = 11,
CharaNeck = 9, Ring = 12,
CharaWrist = 10, MainTwoHandedWeapon = 13,
CharaRing = 11, //MainOrOffHand = 14, // unused
CharaSoulCrystal = 12, BodyDisallowHead = 15,
BodyDisallowHandsLegsFeet = 16,
/* following slots not seem to exist any more. SoulCrystal = 17,
when multi-slot gear is moved into equipment slot, normal slot listed above is used. LegsDisallowFeet = 18,
client will move any incompatible gears into armory but no InventoryModifiyHandler is sent. BodyDisallowAll = 19,
server need to move those silently in order to sync with client. BodyDisallowHands = 20,
*/ BodyDisallowLegsFeet = 21,
/*! 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,
}; };
enum InventoryType : uint16_t enum InventoryType : uint16_t

View file

@ -66,7 +66,7 @@ namespace Sapphire::Network::Packets
Logout = 0x012A, // updated 5.45 hotfix Logout = 0x012A, // updated 5.45 hotfix
CFNotify = 0x026E, // updated 5.45 hotfix CFNotify = 0x026E, // updated 5.45 hotfix
CFMemberStatus = 0x0079, CFMemberStatus = 0x0079,
CFDutyInfo = 0x0193, // updated 5.35 hotfix CFDutyInfo = 0xF193, // updated 5.35 hotfix
CFPlayerInNeed = 0xF07F, CFPlayerInNeed = 0xF07F,
CFPreferredRole = 0x012E, // updated 5.45 hotfix CFPreferredRole = 0x012E, // updated 5.45 hotfix
CFCancel = 0x00EC, // updated 5.35 hotfix CFCancel = 0x00EC, // updated 5.35 hotfix
@ -80,7 +80,7 @@ namespace Sapphire::Network::Packets
LogMessage = 0x00D0, LogMessage = 0x00D0,
Chat = 0x0349, // updated 5.35 hotfix Chat = 0x01BA, // updated 5.45 hotfix
PartyChat = 0x0065, PartyChat = 0x0065,
WorldVisitList = 0xF0FE, // added 4.5 WorldVisitList = 0xF0FE, // added 4.5

View file

@ -580,9 +580,9 @@ Sapphire::ItemPtr Sapphire::Entity::Player::addItem( ItemPtr itemToAdd, bool sil
bool foundFreeSlot = false; bool foundFreeSlot = false;
std::vector< uint16_t > bags = { Bag0, Bag1, Bag2, Bag3 }; 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 // 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 ) ); 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 ); auto item = storage->getItem( slot );
// add any items that are stackable // 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 count = item->getStackSize();
uint32_t maxStack = item->getMaxStackSize(); uint32_t maxStack = item->getMaxStackSize();

View file

@ -32,51 +32,51 @@ uint16_t Sapphire::World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId(
switch( slot ) switch( slot )
{ {
case Common::EquipSlotCategory::CharaHead: case Common::EquipSlotCategory::Head:
return Common::ArmoryHead; return Common::ArmoryHead;
case Common::EquipSlotCategory::CharaBody: case Common::EquipSlotCategory::Body:
//case Common::EquipSlotCategory::BodyDisallowHead: case Common::EquipSlotCategory::BodyDisallowHead:
//case Common::EquipSlotCategory::BodyDisallowHandsLegsFeet: case Common::EquipSlotCategory::BodyDisallowHandsLegsFeet:
//case Common::EquipSlotCategory::BodyDisallowAll: case Common::EquipSlotCategory::BodyDisallowAll:
//case Common::EquipSlotCategory::BodyDisallowHands: case Common::EquipSlotCategory::BodyDisallowHands:
//case Common::EquipSlotCategory::BodyDisallowLegsFeet: case Common::EquipSlotCategory::BodyDisallowLegsFeet:
return Common::ArmoryBody; return Common::ArmoryBody;
case Common::EquipSlotCategory::CharaEars: case Common::EquipSlotCategory::Ears:
return Common::ArmoryEar; return Common::ArmoryEar;
case Common::EquipSlotCategory::CharaFeet: case Common::EquipSlotCategory::Feet:
return Common::ArmoryFeet; return Common::ArmoryFeet;
case Common::EquipSlotCategory::CharaHands: case Common::EquipSlotCategory::Hands:
return Common::ArmoryHand; return Common::ArmoryHand;
case Common::EquipSlotCategory::CharaLegs: case Common::EquipSlotCategory::Legs:
//case Common::EquipSlotCategory::LegsDisallowFeet: case Common::EquipSlotCategory::LegsDisallowFeet:
return Common::ArmoryLegs; return Common::ArmoryLegs;
case Common::EquipSlotCategory::CharaMainHand: case Common::EquipSlotCategory::MainHand:
//case Common::EquipSlotCategory::MainTwoHandedWeapon: case Common::EquipSlotCategory::MainTwoHandedWeapon:
//case Common::EquipSlotCategory::MainOrOffHand: //case Common::EquipSlotCategory::MainOrOffHand:
return Common::ArmoryMain; return Common::ArmoryMain;
case Common::EquipSlotCategory::CharaOffHand: case Common::EquipSlotCategory::OffHand:
return Common::ArmoryOff; return Common::ArmoryOff;
case Common::EquipSlotCategory::CharaRing: case Common::EquipSlotCategory::Ring:
return Common::ArmoryRing; return Common::ArmoryRing;
case Common::EquipSlotCategory::CharaWaist: case Common::EquipSlotCategory::Waist:
return Common::ArmoryWaist; return Common::ArmoryWaist;
case Common::EquipSlotCategory::CharaWrist: case Common::EquipSlotCategory::Wrist:
return Common::ArmoryWrist; return Common::ArmoryWrist;
case Common::EquipSlotCategory::CharaNeck: case Common::EquipSlotCategory::Neck:
return Common::ArmoryNeck; return Common::ArmoryNeck;
case Common::EquipSlotCategory::CharaSoulCrystal: case Common::EquipSlotCategory::SoulCrystal:
return Common::ArmorySoulCrystal; return Common::ArmorySoulCrystal;
default: default: