Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-09-17 23:15:28 +08:00
25 changed files with 373 additions and 96 deletions

View File

@@ -12437,6 +12437,14 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
if (!CanDualWield() && (offItem->GetTemplate()->InventoryType == INVTYPE_WEAPONOFFHAND || offItem->GetTemplate()->InventoryType == INVTYPE_WEAPON))
force = true;
// unequip offhand weapon if player main hand weapon is a polearm or staff or fishing pole
if (Item* mhWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
if (ItemTemplate const* mhWeaponProto = mhWeapon->GetTemplate())
if (mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM ||
mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF ||
mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE)
force = true;
// need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
if (!force && (CanTitanGrip() || (offItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed())))
{