diff --git a/Source/Game/AI/CoreAI/UnitAI.cs b/Source/Game/AI/CoreAI/UnitAI.cs index 933c46f8d..91e24d029 100644 --- a/Source/Game/AI/CoreAI/UnitAI.cs +++ b/Source/Game/AI/CoreAI/UnitAI.cs @@ -79,21 +79,13 @@ namespace Game.AI //Make sure our attack is ready and we aren't currently casting before checking distance if (me.IsAttackReady()) { - if (ShouldSparWith(victim)) - me.FakeAttackerStateUpdate(victim); - else - me.AttackerStateUpdate(victim); - + me.AttackerStateUpdate(victim); me.ResetAttackTimer(); } if (me.HaveOffhandWeapon() && me.IsAttackReady(WeaponAttackType.OffAttack)) { - if (ShouldSparWith(victim)) - me.FakeAttackerStateUpdate(victim, WeaponAttackType.OffAttack); - else - me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack); - + me.AttackerStateUpdate(victim, WeaponAttackType.OffAttack); me.ResetAttackTimer(WeaponAttackType.OffAttack); } } diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index 4136f66b5..d88a6bfee 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -574,52 +574,6 @@ namespace Game.Entities } } - public void FakeAttackerStateUpdate(Unit victim, WeaponAttackType attType = WeaponAttackType.BaseAttack) - { - if (HasUnitState(UnitState.CannotAutoattack) || HasUnitFlag(UnitFlags.Pacified)) - return; - - if (!victim.IsAlive()) - return; - - if ((attType == WeaponAttackType.BaseAttack || attType == WeaponAttackType.OffAttack) && !IsWithinLOSInMap(victim)) - return; - - AttackedTarget(victim, true); - RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Attacking); - - if (attType != WeaponAttackType.BaseAttack && attType != WeaponAttackType.OffAttack) - return; // ignore ranged case - - if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.Possessed) && !HasUnitFlag2(UnitFlags2.DisableTurn)) - SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) - - CalcDamageInfo damageInfo = new(); - damageInfo.Attacker = this; - damageInfo.Target = victim; - - damageInfo.DamageSchoolMask = (uint)GetMeleeDamageSchoolMask(); - damageInfo.OriginalDamage = 0; - damageInfo.Damage = 0; - damageInfo.Absorb = 0; - damageInfo.Resist = 0; - - damageInfo.AttackType = attType; - damageInfo.CleanDamage = 0; - damageInfo.Blocked = 0; - - damageInfo.TargetState = VictimState.Hit; - damageInfo.HitInfo = HitInfo.AffectsVictim | HitInfo.NormalSwing | HitInfo.FakeDamage; - if (attType == WeaponAttackType.OffAttack) - damageInfo.HitInfo |= HitInfo.OffHand; - - damageInfo.ProcAttacker = ProcFlags.None; - damageInfo.ProcVictim = ProcFlags.None; - damageInfo.HitOutCome = MeleeHitOutcome.Normal; - - SendAttackStateUpdate(damageInfo); - } - public void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[(int)attType][(int)damageRange] = value; } public Unit GetMeleeHitRedirectTarget(Unit victim, SpellInfo spellInfo = null) diff --git a/Source/Scripts/World/NpcGuard.cs b/Source/Scripts/World/NpcGuard.cs index 9a1c2d72d..c11996949 100644 --- a/Source/Scripts/World/NpcGuard.cs +++ b/Source/Scripts/World/NpcGuard.cs @@ -142,10 +142,8 @@ namespace Scripts.World.NpcGuard return; } } - if (ShouldSparWith(victim)) - me.FakeAttackerStateUpdate(victim); - else - me.AttackerStateUpdate(victim); + + me.AttackerStateUpdate(victim); me.ResetAttackTimer(); task.Repeat(); });