/// <summary> /// Invokes after attack event /// </summary> /// <param name="instance">Orbwalker instance</param> /// <param name="target">Target</param> /// <returns></returns> public static AfterAttackArgs FireAfterAttack(LSOrbwalker instance, AttackableUnit target) { if (instance != null) { instance.ForceTarget(null); } AfterAttackArgs args = new AfterAttackArgs(); args.Instance = instance; args.Target = target; if (AfterAttack != null) { AfterAttack(args); } if (args.ResetAATimer) { instance.ResetAutoAttackTimer(); instance.reset = true; } return(args); }
/// <summary> /// Invokes before attack event /// </summary> /// <param name="instance">Orbwalker instance</param> /// <param name="target">Target</param> /// <returns></returns> public static BeforeAttackArgs FireBeforeAttack(LSOrbwalker instance, AttackableUnit target) { BeforeAttackArgs args = new BeforeAttackArgs(); args.Instance = instance; args.Target = target; if (BeforeAttack != null) { BeforeAttack(args); } return(args); }
/// <summary> /// Invokes on attack event /// </summary> /// <param name="instance">Orbwalker instance</param> /// <param name="target">Target</param> /// <returns></returns> public static OnAttackArgs FireOnAttack(LSOrbwalker instance, AttackableUnit target) { OnAttackArgs args = new OnAttackArgs(); args.Instance = instance; args.Target = target; if (OnAttack != null) { OnAttack(args); } if (args.Cancel) { EloBuddy.Player.IssueOrder(GameObjectOrder.Stop, ObjectManager.Player); } return(args); }