Esempio n. 1
0
        public static void KSer()
        {
            foreach (var hero in
                     ObjectManager.Get <Obj_AI_Hero>()
                     .Where(
                         h => h.IsEnemy && h.Distance(Player) < (Q.IsReady() ? Q.Range : R.Range) && h.IsValidTarget())
                     .OrderBy(h => h.Health))
            {
                if (LeeUtility.MenuParamBool("useQ1KS"))
                {
                    var predictedHealth = Q.GetHealthPrediction(hero);
                    var q1Damage        = Q.GetDamage(hero, 0);
                    if (Q.IsReady() && predictedHealth <= q1Damage)
                    {
                        Q.Cast(hero);
                    }
                    else if (Q.IsReady() && LeeUtility.MenuParamBool("useQ2KS") &&
                             predictedHealth < q1Damage + Q.GetDamage(hero, 1))
                    {
                        Q.Cast(hero);
                        Utility.DelayAction.Add(
                            (int)(Math.Ceiling(Player.Distance(hero) / Q.Speed * 1000) + 300 + Game.Ping),
                            () => Q.Cast(Player));
                    }
                }
                if (E.IsReady() && LeeUtility.MenuParamBool("useE1KS") &&
                    Vector3.DistanceSquared(Player.ServerPosition, hero.ServerPosition) <= 350 * 350 &&
                    E.GetHealthPrediction(hero) <= W.GetDamage(hero))
                {
                    E.Cast();
                }
                if (R.IsReady() && LeeUtility.MenuParamBool("useRKS") &&
                    Vector3.DistanceSquared(Player.ServerPosition, hero.ServerPosition) <= 375 * 375 &&
                    R.GetHealthPrediction(hero) <=
                    R.GetDamage(hero) * Config.Menu.Item("rOverKill").GetValue <Slider>().Value / 100)
                {
                    R.Cast();
                }
                if (R.IsReady() && LeeUtility.MenuParamBool("useRCollisionKS") &&
                    Vector3.DistanceSquared(Player.ServerPosition, hero.ServerPosition) <= 375 * 375)
                {
                    var hero1    = hero;
                    var startPos = Player.ServerPosition.To2D();
                    var endPos   = Player.ServerPosition.To2D().Extend(hero1.ServerPosition.To2D(), 1200);

                    var polygon = new Polygon(LeeUtility.Rectangle(startPos, endPos, hero1.BoundingRadius));
                    foreach (var victim in
                             ObjectManager.Get <Obj_AI_Hero>()
                             .Where(
                                 h =>
                                 h.IsEnemy && h != hero1 &&
                                 R.GetHealthPrediction(h) <=
                                 R.GetDamage(h) * Config.Menu.Item("rOverKill").GetValue <Slider>().Value / 100))
                    {
                        if (polygon.Contains(victim.ServerPosition.To2D()))
                        {
                            R.Cast(hero1);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void OnDraw(EventArgs args)
        {
            try
            {
                foreach (var spell in Config.SpellList)
                {
                    var menuItem = Config.Menu.Item(spell.Slot + "Draw").GetValue <Circle>();
                    if (menuItem.Active)
                    {
                        Utility.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
                    }
                }
                var insecItem = Config.Menu.Item("drawInsec").GetValue <Circle>();
                if (insecItem.Active && _target.IsValidTarget() && (Config.Menu.Item("insec1").GetValue <KeyBind>().Active ||
                                                                    Config.Menu.Item("insec2").GetValue <KeyBind>().Active))
                {
                    var startPoint     = _target.Position.To2D();
                    var insecPoint     = LeeUtility.GetInsecVector3(_target, false, LeeMethods.Player.Position.To2D()).To2D();
                    var endPoint       = startPoint.Extend(insecPoint, -1200);
                    var insecRectangle = LeeUtility.Rectangle(startPoint, endPoint, _target.BoundingRadius);
                    for (int i = 0; i < insecRectangle.Count; i++)
                    {
                        Drawing.DrawLine(Drawing.WorldToScreen(insecRectangle[i].To3D()), Drawing.WorldToScreen(insecRectangle[i == 3 ? 0 : i + 1].To3D()), 1, insecItem.Color);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

            /*try
             * {
             *  var startPos = LeeMethods.Player.ServerPosition.To2D();
             *  var endPos = LeeMethods.Player.ServerPosition.To2D().Extend(Game.CursorPos.To2D(), 1200);
             *  Utility.DrawCircle(endPos.To3D(),10,Color.Red);
             *  Utility.DrawCircle(startPos.To3D(), 10, Color.Red);
             *
             *  var rectangle = LeeUtility.Rectangle(startPos, endPos, LeeMethods.Player.BoundingRadius);
             *  Utility.DrawCircle(rectangle[0].To3D(), 10, Color.Red);
             *  Utility.DrawCircle(rectangle[1].To3D(), 10, Color.Green);
             *  Utility.DrawCircle(rectangle[2].To3D(), 10, Color.Blue);
             *  Utility.DrawCircle(rectangle[3].To3D(), 10, Color.Black);
             *
             *  Drawing.DrawLine(Drawing.WorldToScreen(rectangle[0].To3D()), Drawing.WorldToScreen(rectangle[1].To3D()), 1, Color.Red);
             *  Drawing.DrawLine(Drawing.WorldToScreen(rectangle[1].To3D()), Drawing.WorldToScreen(rectangle[2].To3D()), 1, Color.Green);
             *  Drawing.DrawLine(Drawing.WorldToScreen(rectangle[2].To3D()), Drawing.WorldToScreen(rectangle[3].To3D()), 1, Color.Blue);
             *  Drawing.DrawLine(Drawing.WorldToScreen(rectangle[3].To3D()), Drawing.WorldToScreen(rectangle[0].To3D()), 1, Color.Black);
             *
             *  var polygon = new Polygon(rectangle);
             *  if (polygon.Contains(Game.CursorPos.To2D()))
             *  {
             *      Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(Game.CursorPos.X, Game.CursorPos.Y)).Process();
             *  }
             * }
             * catch (Exception e)
             * {
             *  Console.WriteLine(e);
             *  throw;
             * }*/
            //var hero1 = hero;

            //Drawing.DrawText(100, 100, Color.White, "Harass Stage: " + LeeMethods.harassStage);
            //Console.WriteLine(ObjectManager.Player.BoundingRadius);
        }