mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
Fix armory.
This commit is contained in:
parent
6cb0a7eed2
commit
37fbb35c0a
4 changed files with 56 additions and 54 deletions
|
@ -159,44 +159,46 @@ namespace Sapphire::Common
|
||||||
ModelRing2 = 9
|
ModelRing2 = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EquipSlotCategory : uint8_t
|
enum class EquipSlotCategory : uint8_t
|
||||||
{
|
{
|
||||||
Unequippable = 0,
|
|
||||||
|
|
||||||
// main slots
|
// main slots
|
||||||
|
|
||||||
CharaMainHand = 1,
|
CharaMainHand = 0,
|
||||||
CharaOffHand = 2,
|
CharaOffHand = 1,
|
||||||
CharaHead = 3,
|
CharaHead = 2,
|
||||||
CharaBody = 4,
|
CharaBody = 3,
|
||||||
CharaHands = 5,
|
CharaHands = 4,
|
||||||
CharaWaist = 6,
|
CharaWaist = 5,
|
||||||
CharaLegs = 7,
|
CharaLegs = 6,
|
||||||
CharaFeet = 8,
|
CharaFeet = 7,
|
||||||
CharaEars = 9,
|
CharaEars = 8,
|
||||||
CharaNeck = 10,
|
CharaNeck = 9,
|
||||||
CharaWrist = 11,
|
CharaWrist = 10,
|
||||||
CharaRing = 12,
|
CharaRing = 11,
|
||||||
CharaSoulCrystal = 17,
|
CharaSoulCrystal = 12,
|
||||||
|
|
||||||
// specials
|
/* 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 */
|
/*! Cannot equip gear to offhand slot */
|
||||||
MainTwoHandedWeapon = 13,
|
//MainTwoHandedWeapon = 13,
|
||||||
/*! Can be equipped in either main or offhand slot */
|
/*! Can be equipped in either main or offhand slot */
|
||||||
MainOrOffHand = 14, // unused
|
//MainOrOffHand = 14, // unused
|
||||||
/*! Cannot equip gear to head */
|
/*! Cannot equip gear to head */
|
||||||
BodyDisallowHead = 15,
|
//BodyDisallowHead = 15,
|
||||||
/*! Cannot equip gear to hands, legs and feet slots */
|
/*! Cannot equip gear to hands, legs and feet slots */
|
||||||
BodyDisallowHandsLegsFeet = 16,
|
//BodyDisallowHandsLegsFeet = 16,
|
||||||
/*! Cannot equip gear to feet slot */
|
/*! Cannot equip gear to feet slot */
|
||||||
LegsDisallowFeet = 18,
|
//LegsDisallowFeet = 18,
|
||||||
/*! Cannot equp gear to head, hands, legs, feet slots */
|
/*! Cannot equp gear to head, hands, legs, feet slots */
|
||||||
BodyDisallowAll = 19,
|
//BodyDisallowAll = 19,
|
||||||
/*! Cannot equip gear to hands slot */
|
/*! Cannot equip gear to hands slot */
|
||||||
BodyDisallowHands = 20,
|
//BodyDisallowHands = 20,
|
||||||
/*! Cannot equip gear to legs & feet slots */
|
/*! Cannot equip gear to legs & feet slots */
|
||||||
BodyDisallowLegsFeet = 21,
|
//BodyDisallowLegsFeet = 21,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum InventoryType : uint16_t
|
enum InventoryType : uint16_t
|
||||||
|
@ -226,8 +228,8 @@ namespace Sapphire::Common
|
||||||
ArmoryWaist = 3204,
|
ArmoryWaist = 3204,
|
||||||
ArmoryLegs = 3205,
|
ArmoryLegs = 3205,
|
||||||
ArmoryFeet = 3206,
|
ArmoryFeet = 3206,
|
||||||
ArmoryNeck = 3207,
|
ArmoryEar = 3207,
|
||||||
ArmoryEar = 3208,
|
ArmoryNeck = 3208,
|
||||||
ArmoryWrist = 3209,
|
ArmoryWrist = 3209,
|
||||||
ArmoryRing = 3300,
|
ArmoryRing = 3300,
|
||||||
|
|
||||||
|
|
|
@ -548,7 +548,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::addItem( ItemPtr itemToAdd, bool sil
|
||||||
// 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->isEquippable && getEquipDisplayFlags() & StoreNewItemsInArmouryChest )
|
||||||
{
|
{
|
||||||
auto bag = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( itemInfo->equipSlotCategory );
|
auto bag = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( static_cast< Common::EquipSlotCategory >( itemInfo->equipSlotCategory ) );
|
||||||
|
|
||||||
bags.insert( bags.begin(), bag );
|
bags.insert( bags.begin(), bag );
|
||||||
}
|
}
|
||||||
|
@ -802,7 +802,7 @@ void Sapphire::Entity::Player::swapItem( uint16_t fromInventoryId, uint8_t fromS
|
||||||
&& !World::Manager::ItemMgr::isArmory( fromInventoryId ) )
|
&& !World::Manager::ItemMgr::isArmory( fromInventoryId ) )
|
||||||
{
|
{
|
||||||
updateContainer( fromInventoryId, fromSlotId, nullptr );
|
updateContainer( fromInventoryId, fromSlotId, nullptr );
|
||||||
fromInventoryId = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( toSlot );
|
fromInventoryId = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( static_cast< Common::EquipSlotCategory >( toSlot ) );
|
||||||
fromSlotId = static_cast < uint8_t >( m_storageMap[ fromInventoryId ]->getFreeSlot() );
|
fromSlotId = static_cast < uint8_t >( m_storageMap[ fromInventoryId ]->getFreeSlot() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,56 +27,56 @@ bool Sapphire::World::Manager::ItemMgr::isArmory( uint16_t containerId )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint16_t Sapphire::World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( uint8_t slotId )
|
uint16_t Sapphire::World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( Common::EquipSlotCategory slot )
|
||||||
{
|
{
|
||||||
|
|
||||||
switch( slotId )
|
switch( slot )
|
||||||
{
|
{
|
||||||
case Common::CharaHead:
|
case Common::EquipSlotCategory::CharaHead:
|
||||||
return Common::ArmoryHead;
|
return Common::ArmoryHead;
|
||||||
|
|
||||||
case Common::CharaBody:
|
case Common::EquipSlotCategory::CharaBody:
|
||||||
case Common::BodyDisallowHead:
|
//case Common::EquipSlotCategory::BodyDisallowHead:
|
||||||
case Common::BodyDisallowHandsLegsFeet:
|
//case Common::EquipSlotCategory::BodyDisallowHandsLegsFeet:
|
||||||
case Common::BodyDisallowAll:
|
//case Common::EquipSlotCategory::BodyDisallowAll:
|
||||||
case Common::BodyDisallowHands:
|
//case Common::EquipSlotCategory::BodyDisallowHands:
|
||||||
case Common::BodyDisallowLegsFeet:
|
//case Common::EquipSlotCategory::BodyDisallowLegsFeet:
|
||||||
return Common::ArmoryBody;
|
return Common::ArmoryBody;
|
||||||
|
|
||||||
case Common::CharaEars:
|
case Common::EquipSlotCategory::CharaEars:
|
||||||
return Common::ArmoryEar;
|
return Common::ArmoryEar;
|
||||||
|
|
||||||
case Common::CharaFeet:
|
case Common::EquipSlotCategory::CharaFeet:
|
||||||
return Common::ArmoryFeet;
|
return Common::ArmoryFeet;
|
||||||
|
|
||||||
case Common::CharaHands:
|
case Common::EquipSlotCategory::CharaHands:
|
||||||
return Common::ArmoryHand;
|
return Common::ArmoryHand;
|
||||||
|
|
||||||
case Common::CharaLegs:
|
case Common::EquipSlotCategory::CharaLegs:
|
||||||
case Common::LegsDisallowFeet:
|
//case Common::EquipSlotCategory::LegsDisallowFeet:
|
||||||
return Common::ArmoryLegs;
|
return Common::ArmoryLegs;
|
||||||
|
|
||||||
case Common::CharaMainHand:
|
case Common::EquipSlotCategory::CharaMainHand:
|
||||||
case Common::MainTwoHandedWeapon:
|
//case Common::EquipSlotCategory::MainTwoHandedWeapon:
|
||||||
case Common::MainOrOffHand:
|
//case Common::EquipSlotCategory::MainOrOffHand:
|
||||||
return Common::ArmoryMain;
|
return Common::ArmoryMain;
|
||||||
|
|
||||||
case Common::CharaOffHand:
|
case Common::EquipSlotCategory::CharaOffHand:
|
||||||
return Common::ArmoryOff;
|
return Common::ArmoryOff;
|
||||||
|
|
||||||
case Common::CharaRing:
|
case Common::EquipSlotCategory::CharaRing:
|
||||||
return Common::ArmoryRing;
|
return Common::ArmoryRing;
|
||||||
|
|
||||||
case Common::CharaWaist:
|
case Common::EquipSlotCategory::CharaWaist:
|
||||||
return Common::ArmoryWaist;
|
return Common::ArmoryWaist;
|
||||||
|
|
||||||
case Common::CharaWrist:
|
case Common::EquipSlotCategory::CharaWrist:
|
||||||
return Common::ArmoryWrist;
|
return Common::ArmoryWrist;
|
||||||
|
|
||||||
case Common::CharaNeck:
|
case Common::EquipSlotCategory::CharaNeck:
|
||||||
return Common::ArmoryNeck;
|
return Common::ArmoryNeck;
|
||||||
|
|
||||||
case Common::CharaSoulCrystal:
|
case Common::EquipSlotCategory::CharaSoulCrystal:
|
||||||
return Common::ArmorySoulCrystal;
|
return Common::ArmorySoulCrystal;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Sapphire::World::Manager
|
||||||
static bool isOneHandedWeapon( Common::ItemUICategory weaponCategory );
|
static bool isOneHandedWeapon( Common::ItemUICategory weaponCategory );
|
||||||
static bool isArmory( uint16_t containerId );
|
static bool isArmory( uint16_t containerId );
|
||||||
static bool isEquipment( uint16_t containerId );
|
static bool isEquipment( uint16_t containerId );
|
||||||
static uint16_t getCharaEquipSlotCategoryToArmoryId( uint8_t slotId );
|
static uint16_t getCharaEquipSlotCategoryToArmoryId( Common::EquipSlotCategory slot );
|
||||||
static Common::ContainerType getContainerType( uint32_t containerId );
|
static Common::ContainerType getContainerType( uint32_t containerId );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue