/*
 *      private static bool IsInStandRange()
 *      {
 *          return (Vector3.Distance(Game.CursorPos,Player.Position)<220);
 *      }
 */

        /// <summary>
        ///     Orbwalker to catch the axes.
        /// </summary>
        /// <param name="safeZone">Heroes safe zone,def 100</param>
        /// <param name="retSafeZone">Reticle safe zone, def 100</param>
        private static void OrbWalkToReticle(int safeZone, int retSafeZone)
        {
            Reticle closestRet = null;
            var     qRadius    = Menu.Item("QRadius").GetValue <Slider>().Value;

            foreach (var r in ReticleList.Where(r => !r.GetObj().IsValid))
            {
                ReticleList.Remove(r);
            }

            if (ReticleList.Count > 0)
            {
                float[] closestDist = { float.MaxValue };

                foreach (var r in
                         ReticleList.Where(
                             r =>
                             r.GetPosition().Distance(Game.CursorPos) <= qRadius &&
                             Player.Distance(r.GetPosition()) < closestDist[0])
                         .Where(r => IsZoneSafe(r.GetPosition(), retSafeZone) && IsZoneSafe(Player.Position, safeZone)))
                {
                    closestRet     = r;
                    closestDist[0] = Player.Distance(r.GetPosition());
                }
            }

            if (closestRet == null || RetInTurretRange(closestRet.GetPosition()))
            {
                return;
            }

            var qDist1            = Player.GetPath(closestRet.GetPosition()).ToList().To2D().PathLength();
            var canReachRet       = (qDist1 / Player.MoveSpeed + Game.Time) < (closestRet.GetEndTime());
            var canReachRetWBonus = (qDist1 / (Player.MoveSpeed + (Player.MoveSpeed * (GetMoveSpeedBonusW() / 100))) +
                                     Game.Time) < (closestRet.GetEndTime());
            var wNeeded = false;

            if (canReachRetWBonus && !canReachRet)
            {
                W.Cast();
                wNeeded = true;
            }
            if ((!canReachRet && !wNeeded))
            {
                return;
            }

            if (Player.Distance(closestRet.GetPosition()) >= 100)
            {
                Orbwalker.SetOrbwalkingPoint(
                    closestRet.GetPosition() != Game.CursorPos ? closestRet.GetPosition() : Game.CursorPos);
            }

            Console.WriteLine("Orbwalking to " + closestRet.GetPosition());
        }
Example #2
0
        /// <summary>
        /// Orbwalker to catch the axes.
        /// </summary>
        /// <param name="SafeZone">Heroes safe zone,def 100</param>
        /// <param name="RetSafeZone">Reticle safe zone, def 100</param>
        private static void OrbWalkToReticle(int SafeZone, int RetSafeZone)
        {
            bool    toggle     = isEn("UseAARet");
            var     target     = ClosestHero(900f);
            Reticle ClosestRet = null;
            var     QRadius    = menu.Item("QRadius").GetValue <Slider>().Value;

            foreach (Reticle r in reticleList)
            {
                if (!r.getObj().IsValid)
                {
                    reticleList.Remove(r);
                }
            }
            if (reticleList.Count > 0)
            {
                float closestDist = float.MaxValue;

                foreach (Reticle r in reticleList)
                {
                    if (r.getPosition().Distance(Game.CursorPos) <= QRadius && player.Distance(r.getPosition()) < closestDist)
                    {
                        if (IsZoneSafe(r.getPosition(), RetSafeZone) && IsZoneSafe(player.Position, SafeZone))
                        {
                            ClosestRet  = r;
                            closestDist = player.Distance(r.getPosition());
                        }
                    }
                }
            }

            if (ClosestRet != null && !RetInTurretRange(ClosestRet.getPosition()))
            {
                float myHitbox          = 65;
                float QDist             = Vector2.Distance(ClosestRet.getPosition().To2D(), player.ServerPosition.To2D()) - myHitbox;
                float QDist1            = player.GetPath(ClosestRet.getPosition()).ToList().To2D().PathLength();
                bool  CanReachRet       = (QDist1 / player.MoveSpeed + Game.Time) < (ClosestRet.getEndTime());
                bool  CanReachRetWBonus = (QDist1 / (player.MoveSpeed + (player.MoveSpeed * (getMoveSpeedBonusW() / 100))) + Game.Time) < (ClosestRet.getEndTime());
                bool  WNeeded           = false;
                if (CanReachRetWBonus && !CanReachRet)
                {
                    W.Cast();
                    WNeeded = true;
                }
                if ((CanReachRet || WNeeded))
                {
                    WNeeded = false;

                    if (player.Distance(ClosestRet.getPosition()) >= 100)
                    {
                        if (ClosestRet.getPosition() != Game.CursorPos)
                        {
                            Orbwalker.SetOrbwalkingPoint(ClosestRet.getPosition());
                        }
                        else
                        {
                            Orbwalker.SetOrbwalkingPoint(Game.CursorPos);
                        }
                    }

                    Console.WriteLine("Orbwalking to " + ClosestRet.getPosition().ToString());
                }
            }
        }