private void OnUnitDash(Obj_AI_Base sender, Dash.DashItem args) { try { var hero = sender as Obj_AI_Hero; if (!sender.IsEnemy || hero == null) { return; } var endTick = Game.Time - Game.Ping / 2000f + (args.EndPos.Distance(args.StartPos) / args.Speed); var wCasted = false; if (HeroListManager.Check("w-gapcloser", hero) && Player.Distance(args.EndPos) <= W.Range && W.IsReady()) { var target = TargetSelector.GetTarget(W.Range * 0.85f, W.DamageType); if (target == null || sender.NetworkId.Equals(target.NetworkId)) { var delay = (int)(endTick - Game.Time - W.Delay - 0.1f); if (delay > 0) { Utility.DelayAction.Add(delay * 1000, () => W.Cast(args.EndPos)); } else { W.Cast(args.EndPos); } wCasted = true; } } if (!wCasted && HeroListManager.Check("q-gapcloser", hero) && Player.Distance(args.EndPos) <= Q.Range && Q.IsReady()) { var delay = (int)(endTick - Game.Time - Q.Delay - 0.1f); if (delay > 0) { Utility.DelayAction.Add(delay * 1000, () => Q.Cast(args.EndPos)); } else { Q.Cast(args.EndPos); } } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
private void OnEnemyGapcloser(ActiveGapcloser args) { try { if (!args.Sender.IsEnemy) { return; } if (UltimateManager.Gapcloser(args.Sender)) { if (args.End.Distance(Player.Position) < R.Range) { R.Cast(args.End); } } var wCasted = false; if (HeroListManager.Check("w-gapcloser", args.Sender) && Player.Distance(args.End) <= W.Range && W.IsReady()) { var target = TargetSelector.GetTarget(W.Range * 0.85f, W.DamageType); if (target == null || args.Sender.NetworkId.Equals(target.NetworkId)) { W.Cast(args.End); wCasted = true; } } if (!wCasted && HeroListManager.Check("q-gapcloser", args.Sender) && Player.Distance(args.End) <= Q.Range && Q.IsReady()) { Q.Cast(args.End); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }