mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 02:53:48 +00:00
fix(Core/Unit): fix Dual Wield for more creatures, CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK, creature disarm damage (#20015)
* enable CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK * sql set CREATURE_FLAG_EXTRA_USE_OFFHAND * use new HasOffHandWeaponForAttack instead of haveOffhandWeapon no longer requires m_CanDualwield set to use Offhand attack requires non-disarmed weapon in Offhand OR creature_flag_extra enabled Co-authored-by: Ovah <dreadkiller@gmx.de> Co-authored-by: Warlockbugs <warlockbugs@outlook.com> * Make shapeshift forms which dont override attack speed use weapon damage Co-authored-by: killerwife <killerwife@gmail.com> * SetEquipmentSlots turning off damage update when using template default Co-authored-by: killerwife <killerwife@gmail.com> * Setup DualWield & Damage On Equipment Updates, implement Set and GetVirtualItem Co-authored-by: Yatzii <47720837+Yatzii93@users.noreply.github.com> * creature disarm damage set disarm to reduce minmax damage by 50% instead of setting to 0 Co-authored-by: Warlockbugs <warlockbugs@outlook.com> --------- Co-authored-by: Ovah <dreadkiller@gmx.de> Co-authored-by: Warlockbugs <warlockbugs@outlook.com> Co-authored-by: killerwife <killerwife@gmail.com> Co-authored-by: Yatzii <47720837+Yatzii93@users.noreply.github.com>
This commit is contained in:
@@ -512,7 +512,7 @@ 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
|
||||
if (CanDualWield() && HasOffhandWeaponForAttack()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon
|
||||
UpdateDamagePhysical(OFF_ATTACK);
|
||||
if (IsClass(CLASS_SHAMAN, CLASS_CONTEXT_STATS) || IsClass(CLASS_PALADIN, CLASS_CONTEXT_STATS)) // mental quickness
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
@@ -567,7 +567,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
|
||||
float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
|
||||
float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
|
||||
|
||||
if (IsInFeralForm()) // check if player is druid and in cat or bear forms
|
||||
if (IsAttackSpeedOverridenShapeShift()) // forms with no override on attack speed use normal weapon damage
|
||||
{
|
||||
uint8 lvl = GetLevel();
|
||||
if (lvl > 60)
|
||||
@@ -1118,7 +1118,7 @@ void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized,
|
||||
break;
|
||||
}
|
||||
|
||||
if (attType == OFF_ATTACK && !haveOffhandWeapon())
|
||||
if (attType == OFF_ATTACK && !HasOffhandWeaponForAttack())
|
||||
{
|
||||
minDamage = 0.0f;
|
||||
maxDamage = 0.0f;
|
||||
@@ -1128,10 +1128,11 @@ void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized,
|
||||
float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
|
||||
float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
|
||||
|
||||
if (!CanUseAttackType(attType)) // disarm case
|
||||
// Disarm for creatures
|
||||
if (HasWeapon(attType) && !HasWeaponForAttack(attType))
|
||||
{
|
||||
weaponMinDamage = 0.0f;
|
||||
weaponMaxDamage = 0.0f;
|
||||
minDamage *= 0.5f;
|
||||
maxDamage *= 0.5f;
|
||||
}
|
||||
|
||||
float attackPower = GetTotalAttackPowerValue(attType);
|
||||
|
||||
Reference in New Issue
Block a user