private static void Drawing_OnDraw(System.EventArgs args) { if (DrawReady) { if (DrawQ && Q.IsReady()) { Me.DrawCircle((int)Q.Range, QColor); } if (DrawW && W.IsReady()) { Me.DrawCircle((int)W.Range, WColor); } if (DrawE && E.IsReady()) { Me.DrawCircle((int)E.Range, EColor); } if (DrawR && R.IsReady()) { Me.DrawCircle((int)R.Range, RColor); } } else { if (DrawQ) { Me.DrawCircle((int)Q.Range, QColor); } if (DrawW) { Me.DrawCircle((int)W.Range, WColor); } if (DrawE) { Me.DrawCircle((int)E.Range, EColor); } if (DrawR) { Me.DrawCircle((int)R.Range, RColor); } } if (MyADC.IsValidTarget()) { MyADC.DrawCircle((int)MyADC.BoundingRadius + 50, Color.Aqua, 15f); //PositionManager.Position.DrawCircle(25, SharpDX.Color.AliceBlue, 10); DangerManager.DrawSpells(Color.Black); } foreach (var enemy in EntityManager.Heroes.AllHeroes) { enemy.DrawCircle((int)enemy.BoundingRadius, enemy.IsBeingAutoAttacked() ? Color.Red: Color.Green, 8f); } }
public static Vector3 BestRecallPosition() { var nearestEnemyTower = EntityManager.Turrets.Allies.Where(t => t.Health > 10).OrderBy(t => t.Distance(Me)).FirstOrDefault(); /* * var nearestAllyTower = * EntityManager.Turrets.Allies.Where(t => t.Health > 10 && t.IsInRange(Me, 1500)).OrderBy(t => t.Distance(Me)).FirstOrDefault(); * * * * if (nearestAllyTower != null && nearestEnemyTower != null) * { * return nearestEnemyTower.Position.Extend(nearestAllyTower, nearestEnemyTower.Distance(nearestAllyTower) + 250).To3D(); * } */ if (MyADC.IsValidTarget(1000)) { return(MyADC.Position.Extend(nearestEnemyTower, 250f).To3DWorld()); } var nearestEnemy = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(1500)).OrderBy(e => e.Distance(Me)).FirstOrDefault(); if (nearestEnemy != null) { var nearestBush = Bushes.OrderBy(b => b.Distance(Me)).ThenByDescending(b => b.Distance(nearestEnemy)).FirstOrDefault(); if (nearestBush != null) { return(nearestBush.Position); } } else { var nearestBush = Bushes.OrderBy(b => b.Distance(Me)).FirstOrDefault(); if (nearestBush != null) { return(nearestBush.Position); } } return(Vector3.Zero); }