mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
OneHandedWeapon helper;
This commit is contained in:
parent
ed23ff9a60
commit
1ceb4a95a5
2 changed files with 33 additions and 3 deletions
|
@ -439,6 +439,30 @@ bool Core::Inventory::removeCrystal( CrystalType type, uint32_t amount )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Core::Inventory::isOneHandedWeapon( ItemCategory weaponCategory )
|
||||
{
|
||||
switch ( weaponCategory )
|
||||
{
|
||||
case ItemCategory::AlcPri:
|
||||
case ItemCategory::ArmPri:
|
||||
case ItemCategory::BotPri:
|
||||
case ItemCategory::ClnPri:
|
||||
case ItemCategory::CnjWep:
|
||||
case ItemCategory::CrpPri:
|
||||
case ItemCategory::FshPri:
|
||||
case ItemCategory::GlaWep:
|
||||
case ItemCategory::GldPri: // Goldsmith
|
||||
case ItemCategory::LtwPri:
|
||||
case ItemCategory::MinPri:
|
||||
case ItemCategory::ThmWep:
|
||||
case ItemCategory::WvrPri:
|
||||
case ItemCategory::BlmPri: // Blacksmith
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Core::Inventory::isObtainable( uint32_t catalogId, uint8_t quantity )
|
||||
{
|
||||
|
||||
|
@ -846,10 +870,14 @@ uint16_t Core::Inventory::calculateEquippedGearItemLevel()
|
|||
iLvlResult += currItem->getItemLevel();
|
||||
|
||||
// If item is weapon and isn't one-handed
|
||||
if ( currItem->isWeapon() &&
|
||||
( currItem->getCategory() != ItemCategory::CnjWep ||
|
||||
currItem->getCategory() != ItemCategory::ThmWep ) )
|
||||
if ( currItem->isWeapon() && !isOneHandedWeapon( currItem->getCategory() ) )
|
||||
{
|
||||
iLvlResult += currItem->getItemLevel();
|
||||
}
|
||||
else
|
||||
{
|
||||
g_log.debug( "Is one handed" );
|
||||
}
|
||||
}
|
||||
|
||||
it++;
|
||||
|
|
|
@ -153,6 +153,8 @@ public:
|
|||
|
||||
bool updateContainer( uint16_t containerId, uint8_t slotId, ItemPtr pItem );
|
||||
|
||||
/*! heck if weapon category qualifies the weapon as onehanded */
|
||||
bool isOneHandedWeapon( Common::ItemCategory weaponCategory );
|
||||
/*! calculate and return player ilvl based off equipped gear */
|
||||
uint16_t calculateEquippedGearItemLevel();
|
||||
/*! return the current amount of currency of type */
|
||||
|
|
Loading…
Add table
Reference in a new issue