Core/Creatures: Implemented extra flag to use offhand attacks

Port From (https://github.com/TrinityCore/TrinityCore/commit/2a51edc5bcebe40c114e37ef3b24da6c8f095892)
This commit is contained in:
hondacrx
2021-03-04 12:00:39 -05:00
parent 64bafe8d73
commit 2949a2514c
3 changed files with 34 additions and 30 deletions
+2 -2
View File
@@ -467,9 +467,9 @@ namespace Game.Entities
SetEmoteState(Emote.OneshotNone);
}
// delay offhand weapon attack to next attack time
// delay offhand weapon attack by 50% of the base attack time
if (HaveOffhandWeapon() && GetTypeId() != TypeId.Player)
ResetAttackTimer(WeaponAttackType.OffAttack);
SetAttackTimer(WeaponAttackType.OffAttack, Math.Max(GetAttackTimer(WeaponAttackType.OffAttack), GetAttackTimer(WeaponAttackType.BaseAttack) + MathFunctions.CalculatePct(GetBaseAttackTime(WeaponAttackType.BaseAttack), 50)));
if (meleeAttack)
SendMeleeAttackStart(victim);