Exemple #1
0
        public void Jump(Vector3 pos, bool juke = false, bool castq = true)
        {
            Orbwalker.Orbwalk(null, pos);
            if (Math.Abs(Spells[E].Cooldown) < 0.00001)
            {
                var extended = ObjectManager.Player.ServerPosition.To2D().Extend(pos.To2D(), 800f);
                if (!JumpTo.IsValid())
                {
                    JumpTo = pos.To2D();
                }

                if (Spells[W].IsReady() && Helpers.SoldierMgr.ActiveSoldiers.Count == 0)
                {
                    if (juke)
                    {
                        var outRadius = 250 / (float)Math.Cos(2 * Math.PI / 12);

                        for (int i = 1; i <= 12; i++)
                        {
                            var   angle = i * 2 * Math.PI / 12;
                            float x     = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                            float y     = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                            if (NavMesh.GetCollisionFlags(x, y).HasFlag(CollisionFlags.Wall) && !ObjectManager.Player.ServerPosition.To2D().Extend(new Vector2(x, y), 500f).IsWall())
                            {
                                Spells[W].Cast(ObjectManager.Player.ServerPosition.To2D().Extend(new Vector2(x, y), 800f));
                                return;
                            }
                        }
                    }
                    Spells[W].Cast(extended);
                }

                if (Helpers.SoldierMgr.ActiveSoldiers.Count > 0 && Spells[Q].IsReady())
                {
                    var closestSoldier = Helpers.SoldierMgr.ActiveSoldiers.MinOrDefault(s => s.Position.To2D().Distance(extended, true));
                    CastELocation = closestSoldier.Position.To2D();
                    CastQLocation = closestSoldier.Position.To2D().Extend(JumpTo, 800f);

                    if (CastELocation.Distance(JumpTo) > ObjectManager.Player.ServerPosition.To2D().Distance(JumpTo) && !juke && castq)
                    {
                        CastQLocation = extended;
                        CastET        = Utils.TickCount + 250;
                        Spells[Q].Cast(CastQLocation);
                    }
                    else
                    {
                        Spells[E].Cast(CastELocation, true);
                        if (ObjectManager.Player.ServerPosition.To2D().Distance(CastELocation) < 700 && castq)
                        {
                            LeagueSharp.Common.Utility.DelayAction.Add(250, () => Spells[Q].Cast(CastQLocation, true));
                        }
                    }
                }
            }
            else
            {
                if (Spells[Q].IsReady() && CastELocation.Distance(ObjectManager.Player.ServerPosition) <= 200 && castq)
                {
                    Spells[Q].Cast(CastQLocation, true);
                }

                JumpTo = Vector2.Zero;
            }
        }
Exemple #2
0
        public static void Jump(Vector3 pos, bool juke = false, bool castq = true)
        {
            if (Math.Abs(Program._e.Cooldown) < 0.00001)
            {
                var extended = ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(pos.LSTo2D(), 800f);
                if (!JumpTo.IsValid())
                {
                    JumpTo = pos.LSTo2D();
                }

                if (Program._w.IsReady() && SoldierMgr.ActiveSoldiers.Count == 0)
                {
                    if (juke)
                    {
                        var outRadius = 250 / (float)Math.Cos(2 * Math.PI / 12);

                        for (var i = 1; i <= 12; i++)
                        {
                            var angle = i * 2 * Math.PI / 12;
                            var x     = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                            var y     = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                            if (NavMesh.GetCollisionFlags(x, y).HasFlag(CollisionFlags.Wall) && !ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(new Vector2(x, y), 500f).LSIsWall())
                            {
                                Program._w.Cast(ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(new Vector2(x, y), 800f));
                                return;
                            }
                        }
                    }
                    Program._w.Cast(extended);
                }

                if (SoldierMgr.ActiveSoldiers.Count > 0 && Program._q.IsReady())
                {
                    var closestSoldier = SoldierMgr.ActiveSoldiers.MinOrDefault(s => s.Position.LSTo2D().LSDistance(extended, true));
                    CastELocation = closestSoldier.Position.LSTo2D();
                    CastQLocation = closestSoldier.Position.LSTo2D().LSExtend(JumpTo, 800f);

                    if (CastELocation.LSDistance(JumpTo) > ObjectManager.Player.ServerPosition.LSTo2D().LSDistance(JumpTo) && !juke && castq)
                    {
                        CastQLocation = extended;
                        CastET        = Utils.TickCount + 250;
                        Program._q.Cast(CastQLocation);
                    }
                    else
                    {
                        Program._e.Cast(CastELocation, true);
                        if (ObjectManager.Player.ServerPosition.LSTo2D().LSDistance(CastELocation) < 700 && castq)
                        {
                            LeagueSharp.Common.Utility.DelayAction.Add(250, () => Program._q.Cast(CastQLocation, true));
                        }
                    }
                }
            }
            else
            {
                if (Program._q.IsReady() && CastELocation.LSDistance(ObjectManager.Player.ServerPosition) <= 200 && castq)
                {
                    Program._q.Cast(CastQLocation, true);
                }

                JumpTo = Vector2.Zero;
            }
        }