diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Item/ItemTemplate.h | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 13 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/StatSystem.cpp | 6 |
3 files changed, 16 insertions, 6 deletions
diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h index 4d2ec62621c..42a982a4080 100644 --- a/src/server/game/Entities/Item/ItemTemplate.h +++ b/src/server/game/Entities/Item/ItemTemplate.h @@ -259,7 +259,8 @@ enum ItemFlags3 ITEM_FLAG3_UNK12 = 0x00008000, ITEM_FLAG3_UNK13 = 0x00010000, ITEM_FLAG3_UNK14 = 0x00020000, - ITEM_FLAG3_UNK15 = 0x00040000 + ITEM_FLAG3_UNK15 = 0x00040000, + ITEM_FLAG3_DUAL_WIELD_NOT_REQUIRED = 0x00080000 }; enum ItemFlagsCustom diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a66f5807057..f65e58b4d3e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11061,11 +11061,16 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool // Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750) if (type == INVTYPE_WEAPON && pProto->GetSubClass() == ITEM_SUBCLASS_WEAPON_POLEARM) return EQUIP_ERR_2HSKILLNOTFOUND; - else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND) + else if (type == INVTYPE_WEAPON) { if (!CanDualWield()) return EQUIP_ERR_2HSKILLNOTFOUND; } + else if (type == INVTYPE_WEAPONOFFHAND) + { + if (!CanDualWield() && !(pProto->GetFlags3() & ITEM_FLAG3_DUAL_WIELD_NOT_REQUIRED)) + return EQUIP_ERR_2HSKILLNOTFOUND; + } else if (type == INVTYPE_2HWEAPON) { if (!CanDualWield() || !CanTitanGrip()) @@ -24050,8 +24055,10 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/) return; // unequip offhand weapon if player doesn't have dual wield anymore - if (!CanDualWield() && (offItem->GetTemplate()->GetInventoryType() == INVTYPE_WEAPONOFFHAND || offItem->GetTemplate()->GetInventoryType() == INVTYPE_WEAPON)) - force = true; + if (!CanDualWield() + && ((offItem->GetTemplate()->GetInventoryType() == INVTYPE_WEAPONOFFHAND && !(offItem->GetTemplate()->GetFlags3() & ITEM_FLAG3_DUAL_WIELD_NOT_REQUIRED)) + || offItem->GetTemplate()->GetInventoryType() == INVTYPE_WEAPON)) + force = true; // need unequip offhand for 2h-weapon without TitanGrip (in any from hands) if (!force && (CanTitanGrip() || (offItem->GetTemplate()->GetInventoryType() != INVTYPE_2HWEAPON && !IsTwoHandUsed()))) diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index ba355276738..a9514d04470 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -375,8 +375,10 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) else { UpdateDamagePhysical(BASE_ATTACK); - if (CanDualWield() && haveOffhandWeapon()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon - UpdateDamagePhysical(OFF_ATTACK); + if (Item* offhand = GetWeaponForAttack(OFF_ATTACK, true)) + if (CanDualWield() || offhand->GetTemplate()->GetFlags3() & ITEM_FLAG3_DUAL_WIELD_NOT_REQUIRED) + UpdateDamagePhysical(OFF_ATTACK); + if (HasAuraType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER) || HasAuraType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER) || HasAuraType(SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT)) |