Core/Creatures: Moved autoattack handling from scripts to game
Port From (https://github.com/TrinityCore/TrinityCore/commit/605e5f94c0d71cad8e83fa5a07eaec4e6bed9cc3)
This commit is contained in:
@@ -134,8 +134,6 @@ namespace Scripts.World.Achievements
|
||||
Unit target = SelectTarget(SelectTargetMethod.MaxThreat, 0, -50.0f, true);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.SummonPlayer);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,12 +107,9 @@ namespace Scripts.World.NpcGuard
|
||||
{
|
||||
me.ResetAttackTimer();
|
||||
DoCastVictim(spellInfo.Id);
|
||||
meleeContext.Repeat();
|
||||
return;
|
||||
}
|
||||
}
|
||||
me.AttackerStateUpdate(victim);
|
||||
me.ResetAttackTimer();
|
||||
meleeContext.Repeat();
|
||||
}).Schedule(TimeSpan.FromSeconds(5), spellContext =>
|
||||
{
|
||||
@@ -183,7 +180,7 @@ namespace Scripts.World.NpcGuard
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
void ScheduleVanish()
|
||||
|
||||
@@ -207,8 +207,7 @@ namespace Scripts.World.NpcsSpecial
|
||||
ResetFlagTimer -= diff;
|
||||
}
|
||||
|
||||
if (UpdateVictim())
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
public override void ReceiveEmote(Player player, TextEmotes emote)
|
||||
|
||||
Reference in New Issue
Block a user