Exemple #1
0
        public static List <Vector2?> GetWsPosition(Vector2 to)
        {
            var posW   = Player.Position.To2D().Extend(to, Program._w.Range);
            var rad    = new double[] { -Math.PI / 2, Math.PI / 2, -Math.PI / 4, Math.PI / 4, 0 };
            var result = new List <Vector2?>();

            foreach (var i in rad)
            {
                result.Add(GetWPosition(GeoAndExten.RotateAround(posW, Player.Position.To2D(), (float)i)));
            }
            return(result);
        }
Exemple #2
0
        private static void Game_OnUpdate(EventArgs args)
        {
            switch (Program.insecmode)
            {
                case 0:
                    var hero = HeroManager.Allies.Where(x => !x.IsMe && !x.IsDead)
                        .OrderByDescending(x => x.Distance(Player.Position)).LastOrDefault();
                    if (hero != null)
                        InsecPoint = hero.Position;
                    break;
                case 1:
                    var turret = GameObjects.AllyTurrets.OrderByDescending(x => x.Distance(Player.Position)).LastOrDefault();
                    if (turret != null)
                        InsecPoint = turret.Position;
                    break;
                case 2:
                    InsecPoint = Game.CursorPos;
                    break;
                case 3:
                    InsecPoint = LastLeftClick;
                    break;
            }
            if (!Program.insec)
                return;
            if (OrbwalkCommands.CanMove())
            {
                OrbwalkCommands.MoveTo(Game.CursorPos);
            }
            if (!InsecPoint.IsValid())
                return;
            var target = TargetSelector.GetSelectedTarget();
            if (!target.IsValidTarget() || target.IsZombie)
                return;
            if (!Program._r2.IsReady())
                return;
            //case 1
            Vector2 start1 = Player.Position.To2D().Extend(InsecPoint.To2D(), -300);
            Vector2 end1 = start1.Extend(Player.Position.To2D(), 750);
            float width1 = Program._r.Level == 3 ? 125 * 6 / 2 :
                        Program._r.Level == 2 ? 125 * 5 / 2 :
                        125 * 4 / 2;
            var Rect1 = new Geometry.Polygon.Rectangle(start1, end1, width1 - 100);
            var Predicted1 = Prediction.GetPrediction(target, Game.Ping / 1000f + 0.25f).UnitPosition;
            if (Rect1.IsInside(target.Position) && Rect1.IsInside(Predicted1))
            {
                Program._r2.Cast(InsecPoint);
                return;
            }
            if (Environment.TickCount - LastJump < 1500)
                return;
            if (!Program._e.IsReady())
                return;
            //case 2
            var sold2 = Soldiers.soldier
                    .Where(x => Player.Distance(x.Position) <= 1100)
                    .OrderBy(x => x.Position.Distance(target.Position)).FirstOrDefault();
            if (sold2 != null)
            {
                if (!Program._q2.IsReady())
                {
                    var time = Player.Position.Distance(sold2.Position) / 1700f;
                    var predicted2 = Prediction.GetPrediction(target, time).UnitPosition;
                    Vector2 start2 = sold2.Position.To2D().Extend(InsecPoint.To2D(), -300);
                    Vector2 end2 = start2.Extend(InsecPoint.To2D(), 750);
                    float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                                Program._r.Level == 2 ? 125 * 5 / 2 :
                                125 * 4 / 2;
                    var Rect2 = new Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                    if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                    {
                        Program._e.Cast(sold2.Position);
                        LastJump = Environment.TickCount;
                        return;
                    }
                }
                if (Program._q2.IsReady() && target.Distance(sold2.Position) <= 875 - 100)
                {
                    var time = (Player.Distance(sold2.Position) + sold2.Position.Distance(target.Position)) / 1700f;
                    var predicted2 = Prediction.GetPrediction(target, time).UnitPosition;
                    Vector2 start2 = target.Position.To2D().Extend(InsecPoint.To2D(), -300);
                    Vector2 end2 = start2.Extend(InsecPoint.To2D(), 750);
                    float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                                Program._r.Level == 2 ? 125 * 5 / 2 :
                                125 * 4 / 2;
                    var Rect2 = new Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                    if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                    {
                        var timetime = sold2.Position.Distance(Player.Position) * 1000 / 1700;
                        Program._e.Cast(sold2.Position);
                        LeagueSharp.Common.Utility.DelayAction.Add((int)timetime - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                        LastJump = Environment.TickCount;
                        return;
                    }
                }
            }
            if(Program._w.IsReady())
            {
                var posWs = GeoAndExten.GetWsPosition(target.Position.To2D()).Where(x => x != null);
                foreach (var posW in posWs)
                {
                    if (!Program._q2.IsReady())
                    {
                        var time = Player.Position.To2D().Distance((Vector2)posW) / 1700f + 0.3f;
                        var predicted2 = Prediction.GetPrediction(target, time).UnitPosition;
                        Vector2 start2 = ((Vector2)posW).Extend(InsecPoint.To2D(), -300);
                        Vector2 end2 = start2.Extend(InsecPoint.To2D(), 750);
                        float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                                    Program._r.Level == 2 ? 125 * 5 / 2 :
                                    125 * 4 / 2;
                        var Rect2 = new Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                        if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                        {
                            var timetime = ((Vector2)posW).Distance(Player.Position) * 1000 / 1700;
                            Program._w.Cast(Player.Position.To2D().Extend((Vector2)posW, Program._w.Range));
                            LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                            LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                            LastJump = Environment.TickCount;
                            return;
                        }
                    }
                    if (Program._q2.IsReady() && target.Distance((Vector2)posW) <= 875 - 100)
                    {
                        var time = (Player.Distance((Vector2)posW) + ((Vector2)posW).Distance(target.Position)) / 1700f + 0.3f;
                        var predicted2 = Prediction.GetPrediction(target, time).UnitPosition;
                        Vector2 start2 = target.Position.To2D().Extend(InsecPoint.To2D(), -300);
                        Vector2 end2 = start2.Extend(InsecPoint.To2D(), 750);
                        float width2 = Program._r.Level == 3 ? 125 * 6 / 2 :
                                    Program._r.Level == 2 ? 125 * 5 / 2 :
                                    125 * 4 / 2;
                        var Rect2 = new Geometry.Polygon.Rectangle(start2, end2, width2 - 100);
                        if (Rect2.IsInside(target.Position) && Rect2.IsInside(predicted2))
                        {
                            var timetime = ((Vector2)posW).Distance(Player.Position) * 1000 / 1700;
                            Program._w.Cast(Player.Position.To2D().Extend((Vector2)posW, Program._w.Range));
                            LeagueSharp.Common.Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW));
                            LeagueSharp.Common.Utility.DelayAction.Add((int)timetime + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(target.Position));
                            LastJump = Environment.TickCount;
                            return;
                        }
                    }
                }
            }

        }
Exemple #3
0
 private static void Game_OnUpdate(EventArgs args)
 {
     //Game.PrintChat(Player.Distance(Game.CursorPos).ToString());
     //Game.PrintChat(GameObjects.EnemyMinions.Count().ToString());
     if (!Program.eqmouse)
     {
         return;
     }
     if (OrbwalkCommands.CanMove())
     {
         OrbwalkCommands.MoveTo(Game.CursorPos);
     }
     if (Environment.TickCount - LastJump < 500)
     {
         return;
     }
     if (Program.Eisready && Program.Qisready())
     {
         var position = Game.CursorPos;
         var distance = Player.Position.Distance(position);
         var sold     = Soldiers.soldier
                        .Where(x => Player.Distance(x.Position) <= 1100)
                        .OrderBy(x => x.Position.Distance(Game.CursorPos)).FirstOrDefault();
         var posWs = GeoAndExten.GetWsPosition(position.To2D()).Where(x => x != null);
         // case 1
         if (sold != null && sold.Position.Distance(position) <= 875)
         {
             var time = sold.Position.Distance(Player.Position) * 1000 / 1700;
             Program._e.Cast(sold.Position);
             Utility.DelayAction.Add((int)time - 150 - Program.EQdelay, () => Program._q2.Cast(position));
             LastJump = Environment.TickCount;
             return;
         }
         // case 2
         var posW2 = posWs.FirstOrDefault(x => ((Vector2)x).Distance(position) <= 875);
         if (Program._w.IsReady() && posW2 != null)
         {
             var time = ((Vector2)posW2).Distance(Player.Position) * 1000 / 1700;
             Program._w.Cast(Player.Position.To2D().Extend((Vector2)posW2, Program._w.Range));
             Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW2));
             Utility.DelayAction.Add((int)time + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(position));
             LastJump = Environment.TickCount;
             return;
         }
         // case 3
         var posW3 = posWs.OrderBy(x => ((Vector2)x).Distance(position)).FirstOrDefault();
         if (sold != null && (posW3 == null || sold.Position.Distance(position) <= ((Vector2)posW3).Distance(position)))
         {
             var time = sold.Position.Distance(Player.Position) * 1000 / 1700;
             Program._e.Cast(sold.Position);
             Utility.DelayAction.Add((int)time - 150 - Program.EQdelay, () => Program._q2.Cast(position));
             LastJump = Environment.TickCount;
             return;
         }
         if (Program._w.IsReady() && posW3 != null)
         {
             var time = ((Vector2)posW3).Distance(Player.Position) * 1000 / 1700;
             Program._w.Cast(Player.Position.To2D().Extend((Vector2)posW3, Program._w.Range));
             Utility.DelayAction.Add(0, () => Program._e.Cast((Vector2)posW3));
             Utility.DelayAction.Add((int)time + 300 - 150 - Program.EQdelay, () => Program._q2.Cast(position));
             LastJump = Environment.TickCount;
             return;
         }
     }
 }