private static bool UseE(Obj_AI_Base enemy) { foreach (var orb in OrbManager.GetAllOrbs()) { if (Vector3.Distance(_Player.ServerPosition, orb.ServerPosition) < Program.Q.Range) { var startPoint = _Player.ServerPosition.To2D();// orb.ServerPosition.To2D();//.Extend(_Player.ServerPosition.To2D(), 100); //_Player.ServerPosition.To2D();// var endPoint = _Player.ServerPosition.To2D() .Extend(orb.ServerPosition.To2D(), Program.EQ.Range /*Vector3.Distance(_Player.Position, orb) > 200 ? 1300 : 1000*/); //Program.EQ.CastDelay = (int)Program.E.CastDelay;// +(int)(_Player.Distance(enemy) / Program.EQ.Speed * 1000);//(int)Vector3.Distance(_Player.Position, orb) / Program.E.Speed; Program.EQ.SourcePosition = _Player.ServerPosition;//orb; var enemyPred = Program.EQ.GetPrediction(enemy); if (debug) { Chat.Print(enemy.Name + " E PREDICTION RESULT: " + enemyPred.HitChance); Chat.Print("EQ delay = " + Program.EQ.CastDelay); } if ((enemyPred.HitChance == HitChance.High || enemyPred.HitChance == HitChance.Collision || enemyPred.HitChance == HitChance.Medium) && enemyPred.UnitPosition.To2D().Distance(startPoint, endPoint, false) < Program.EQ.Width + enemy.BoundingRadius) { //preventing reverse E,hopefully double deltaY = enemyPred.UnitPosition.Y - _Player.Position.Y; double deltaX = enemyPred.UnitPosition.X - _Player.Position.X; double angleInDegreesEnemy = Math.Atan2(deltaY, deltaX) * 180 / Math.PI; deltaY = orb.ServerPosition.Y - _Player.Position.Y; deltaX = orb.ServerPosition.X - _Player.Position.X; double angleInDegreesOrb = Math.Atan2(deltaY, deltaX) * 180 / Math.PI; angleInDegreesEnemy += 360; angleInDegreesOrb += 360; angleInDegreesEnemy %= 360; angleInDegreesOrb %= 360; if (Math.Abs(angleInDegreesEnemy - angleInDegreesOrb) > 45) { if (debug) { Chat.Print("Prevented a weird angle E: " + Math.Abs(angleInDegreesEnemy - angleInDegreesOrb)); } continue; } Program.QECombo = Program.tickCount; if (debug) { Chat.Print("Use E " + enemy.Name + " " + Program.EQ.Range); } Program.E.Cast(orb.ServerPosition); qe = orb.ServerPosition; qeb = true; return(true); } } } return(false); }
private static void Drawing_OnDraw(EventArgs args) { if (Config.Drawing.DrawQ) { new Circle() { Color = Color.Red, BorderWidth = 1, Radius = Q.Range }.Draw(Player.Instance.Position); } if (Config.Drawing.DrawW) { new Circle() { Color = Color.Blue, BorderWidth = 1, Radius = W.Range }.Draw(Player.Instance.Position); } if (Config.Drawing.DrawQE) { new Circle() { Color = Color.Purple, BorderWidth = 1, Radius = EQ.Range }.Draw(Player.Instance.Position); } if (Config.Modes.Harass.AutoHarass && !Config.Drawing.RemoveHarassText) { Drawing.DrawText(Drawing.WorldToScreen(Player.Instance.Position) - new SharpDX.Vector2(30, 11), System.Drawing.Color.White, "自动骚扰", 15); } if (Config.Modes.Harass.AutoAaHarass && !Config.Drawing.RemoveHarassText) { Drawing.DrawText(Drawing.WorldToScreen(Player.Instance.Position) - new SharpDX.Vector2(30, 22), System.Drawing.Color.White, "敌人普攻时骚扰", 15); } if (OrbManager.Get_Current_Orb() != null) { Drawing.DrawCircle(OrbManager.Get_Current_Orb().Position, W.Width, Color.Green); } if (StateHandler.debug) { Drawing.DrawCircle(StateHandler.qe, 80, Color.Red); } if (Config.Drawing.DrawQELines) { foreach (var orb in OrbManager.GetAllOrbs()) { if (!orb.Equals(OrbManager.Get_Current_Orb()) && SharpDX.Vector3.Distance(Player.Instance.Position, orb.ServerPosition) < Q.Range) { Drawing.DrawCircle(orb.Position, W.Width, Color.Red); //var startPoint = orb.ServerPosition.To2D();//.Extend(_Player.ServerPosition.To2D(), 100); //_Player.ServerPosition.To2D();// var endPoint = Player.Instance.ServerPosition.To2D() .Extend(orb.ServerPosition.To2D(), EQ.Range /*Vector3.Distance(_Player.Position, orb) > 200 ? 1300 : 1000*/); //Program.EQ.CastDelay = (int)Program.E.CastDelay;// +(int)(_Player.Distance(enemy) / Program.EQ.Speed * 1000);//(int)Vector3.Distance(_Player.Position, orb) / Program.E.Speed; //EQ.SourcePosition = Player.Instance.ServerPosition;//orb; Drawing.DrawLine(Player.Instance.Position.WorldToScreen(), endPoint.To3D().WorldToScreen(), 5, Color.Black); } } /*foreach (var enemy in ObjectManager.Get<AIHeroClient>().Where(a => a.IsEnemy == true)) * if (enemy.IsValidTarget(EQ.Range)) * { * Program.EQ.SourcePosition = Player.Instance.ServerPosition;//orb; * var enemyPred = Program.EQ.GetPrediction(enemy); * Drawing.DrawCircle(enemyPred.UnitPosition, enemy.BoundingRadius, Color.Black); * Drawing.DrawCircle(enemyPred.UnitPosition, enemy.BoundingRadius-1, Color.Black); * Drawing.DrawCircle(enemyPred.UnitPosition, enemy.BoundingRadius-2, Color.Black); * * }*/ } }