Example #1
0
        public static void OrbwalkToPassive(Obj_AI_Hero target)
        {
            if (Menu.Item("OrbwalkAA").IsActive() && Orbwalking.CanAttack() &&
                target.IsValidTarget(FioraAutoAttackRange))
            {
                return;
            }

            if (Menu.Item("OrbwalkQ").IsActive() && Q.IsReady())
            {
                return;
            }

            var passive = target.GetNearestPassive();

            if (passive == null ||
                (Menu.Item("Orbwalk" + passive.Passive) == null || !Menu.Item("Orbwalk" + passive.Passive).IsActive()))
            {
                return;
            }

            var pos = passive.OrbwalkPosition; //PassivePosition;
            var underTurret = Menu.Item("OrbwalkTurret").IsActive() && pos.UnderTurret(true);
            var outsideAARange = Menu.Item("OrbwalkAARange").IsActive() && Player.Distance(pos) > FioraAutoAttackRange;
            if (underTurret || outsideAARange)
            {
                return;
            }

            var path = Player.GetPath(pos);
            var point = path.Length < 3 ? pos : path.Skip(path.Length / 2).FirstOrDefault();
            //  Console.WriteLine(path.Length);
            //Console.WriteLine("ORBWALK TO PASSIVE: " + Player.Distance(pos));
            Orbwalker.SetOrbwalkingPoint(target.IsMoving ? point : pos);
        }