public EvadePlus(SkillshotDetector detector) { Skillshots = new EvadeSkillshot[] {}; Polygons = new Geometry.Polygon[] {}; ClippedPolygons = new List<Geometry.Polygon>(); PathFinding = new PathFinding(this); StatusText = new Text("EvadePlus Enabled", new Font("Calisto MT", 10F, FontStyle.Bold)); StatusTextShadow = new Text("EvadePlus Enabled", new Font("Calisto MT", 10F, FontStyle.Bold)); SkillshotDetector = detector; SkillshotDetector.OnUpdateSkillshots += OnUpdateSkillshots; SkillshotDetector.OnSkillshotActivation += OnSkillshotActivation; SkillshotDetector.OnSkillshotDetected += OnSkillshotDetected; SkillshotDetector.OnSkillshotDeleted += OnSkillshotDeleted; Player.OnIssueOrder += PlayerOnIssueOrder; Game.OnTick += Ontick; }
public EvadePlus(SkillshotDetector detector) { Skillshots = new EvadeSkillshot[] {}; Polygons = new Geometry.Polygon[] {}; ClippedPolygons = new List <Geometry.Polygon>(); PathFinding = new PathFinding(this); StatusText = new Text("EvadePlus Enabled", new Font("Calisto MT", 10F, FontStyle.Bold)); StatusTextShadow = new Text("EvadePlus Enabled", new Font("Calisto MT", 10F, FontStyle.Bold)); SkillshotDetector = detector; SkillshotDetector.OnUpdateSkillshots += OnUpdateSkillshots; SkillshotDetector.OnSkillshotActivation += OnSkillshotActivation; SkillshotDetector.OnSkillshotDetected += OnSkillshotDetected; SkillshotDetector.OnSkillshotDeleted += OnSkillshotDeleted; Player.OnIssueOrder += PlayerOnIssueOrder; Game.OnTick += Ontick; Drawing.OnDraw += OnDraw; }
public EvadePlus(SkillshotDetector detector) { Skillshots = new EvadeSkillshot[] {}; Polygons = new Geometry.Polygon[] {}; ClippedPolygons = new List <Geometry.Polygon>(); PathFinding = new PathFinding(this); StatusText = new Text("EvadePlus Enabled", new Font("Euphemia", 10F, FontStyle.Bold)); //Calisto MT SkillshotDetector = detector; SkillshotDetector.OnUpdateSkillshots += OnUpdateSkillshots; SkillshotDetector.OnSkillshotActivation += OnSkillshotActivation; SkillshotDetector.OnSkillshotDetected += OnSkillshotDetected; SkillshotDetector.OnSkillshotDeleted += OnSkillshotDeleted; Player.OnIssueOrder += PlayerOnIssueOrder; Obj_AI_Base.OnProcessSpellCast += OnProcessSpellCast; Dash.OnDash += OnDash; Game.OnTick += Ontick; Drawing.OnDraw += OnDraw; }
public EvadePlus(SkillshotDetector detector) { Skillshots = new EvadeSkillshot[] {}; Polygons = new Geometry.Polygon[] {}; ClippedPolygons = new List<Geometry.Polygon>(); PathFinding = new PathFinding(this); StatusText = new Text("EvadePlus Enabled", new Font("Euphemia", 10F, FontStyle.Bold)); //Calisto MT _skillshotPolygonCache = new Dictionary<EvadeSkillshot, Geometry.Polygon>(); SkillshotDetector = detector; SkillshotDetector.OnUpdateSkillshots += OnUpdateSkillshots; SkillshotDetector.OnSkillshotActivation += OnSkillshotActivation; SkillshotDetector.OnSkillshotDetected += OnSkillshotDetected; SkillshotDetector.OnSkillshotDeleted += OnSkillshotDeleted; Player.OnIssueOrder += PlayerOnIssueOrder; Obj_AI_Base.OnProcessSpellCast += OnProcessSpellCast; Dash.OnDash += OnDash; Game.OnTick += Ontick; Drawing.OnDraw += OnDraw; }
public bool DoEvade(Vector3[] desiredPath = null, PlayerIssueOrderEventArgs args = null) { if (!EvadeEnabled || Player.Instance.IsDead || Player.Instance.IsDashing()) { LastEvadeResult = null; AutoPathing.StopPath(); return(false); } var hero = Player.Instance; if (args != null && args.Order == GameObjectOrder.AttackUnit) { if (!hero.IsInAutoAttackRange((AttackableUnit)args.Target)) { desiredPath = hero.GetPath(args.Target.Position, true); } } if (IsHeroInDanger(hero)) { if (LastEvadeResult != null && (!IsPointSafe(LastEvadeResult.EvadePoint) || LastEvadeResult.Expired())) { // LastEvadeResult = null; } var evade = CalculateEvade(LastIssueOrderPos); if (evade.IsValid && evade.EnoughTime) { if (LastEvadeResult == null || (LastEvadeResult.EvadePoint.Distance(evade.EvadePoint, true) > 500.Pow() && AllowRecalculateEvade)) { LastEvadeResult = evade; } } else { if (!evade.EnoughTime && LastEvadeResult == null && !IsHeroPathSafe(evade, desiredPath)) { return(EvadeSpellManager.ProcessFlash(this)); } } if (LastEvadeResult != null) //&& LastEvadeResult.EvadePoint.Distance(hero) > hero.HitBoxRadius() { var isPathSafe = IsHeroPathSafe(evade, desiredPath); if (!hero.IsMovingTowards(LastEvadeResult.WalkPoint) || !isPathSafe) { AutoPathing.StopPath(); MoveTo(LastEvadeResult.WalkPoint, false); } return(true); } } else if (!IsPathSafe(hero.RealPath()) || (desiredPath != null && !IsPathSafe(desiredPath))) { var path = PathFinding.GetPath(hero.Position.To2D(), LastIssueOrderPos); var evade = CalculateEvade(LastIssueOrderPos); if (evade.IsValid) { path = new[] { evade.EvadePoint }.Concat(path).ToArray(); } if (path.Length > 0 && AutoPathing.Destination.Distance(path.Last(), true) > 50.Pow()) { AutoPathing.DoPath(path); } LastEvadeResult = null; return(desiredPath != null); } else { AutoPathing.StopPath(); LastEvadeResult = null; } return(false); }