Exemple #1
0
        private static void DoCombo(bool useR = true)
        {
            var target = TargetSelector.GetTarget(Riven.EWRange, TargetSelector.DamageType.Physical);

            if (!target.IsValidTarget())
            {
                Riven.Orbwalker.SetOrbwalkingPoint(new Vector3());
                return;
            }

            Riven.LastTarget = target;

            if (Riven.GetBool("FollowTarget") && Orbwalking.CanMove(0))
            {
                Riven.Orbwalker.SetOrbwalkingPoint(
                    target.Distance(Riven.Player) < Orbwalking.GetRealAutoAttackRange(Riven.Player)
                        ? new Vector3()
                        : target.ServerPosition);
            }

            if (Ghostblade.IsReady())
            {
                Ghostblade.Cast();
            }

            if (Riven.RActivated && Riven.CanWindSlash && useR)
            {
                UseWindSlash(target);
            }

            // Use R logic
            if (CanHardEngage(target) && !Riven.RActivated && Riven.R.IsReady() &&
                target.HealthPercentage() > Riven.Menu.Item("UseRPercent").GetValue <Slider>().Value&& useR &&
                Riven.GetBool("UseR" + Riven.Orbwalker.ActiveMode))
            {
                NotificationHandler.ShowInfo("Using R!");

                // E -> R
                if (Riven.E.IsReady())
                {
                    var distE = Riven.Player.ServerPosition.Extend(target.Position, Riven.E.Range);

                    if (Riven.GetBool("DontEIntoWall") && distE.IsWall())
                    {
                        return;
                    }

                    Riven.E.Cast(target.ServerPosition);
                    Riven.R.Cast(Riven.Player);
                }
                // Q -> Q -> E -> R -> Q
                else if (Riven.QCount == 2 && Riven.Q.IsReady() && Riven.E.IsReady())
                {
                    Riven.E.Cast();
                    Riven.R.Cast(target);
                }
                // R -> W
                else if (Riven.W.IsReady() && ObjectManager.Get <AIHeroClient>().Any(x => x.IsValidTarget(Riven.W.Range)))
                {
                    Riven.R.Cast(Riven.Player);
                    Riven.W.Cast();
                }
                else if (Riven.GetBool("UseRIfCantCancel"))
                {
                    Riven.R.Cast(Riven.Player);
                }
                else
                {
                    NotificationHandler.ShowInfo("Could not use R! (CD)");
                }
            }

            if (target.Distance(Riven.Player) < Riven.EWRange &&
                (!Riven.Q.IsReady() || target.Distance(Riven.Player) > Riven.Q.Range) && Riven.E.IsReady() &&
                Riven.W.IsReady() && Riven.GetBool("UseE" + Riven.Orbwalker.ActiveMode) &&
                Riven.GetBool("UseW" + Riven.Orbwalker.ActiveMode))
            {
                var distE = Riven.Player.ServerPosition.Extend(target.Position, Riven.E.Range);

                if (Riven.GetBool("DontEIntoWall") && distE.IsWall())
                {
                    return;
                }

                Riven.E.Cast(target.Position);
                CastCircleThing();
                CastW();
            }
            else if ((Hydra.IsReady() || Tiamat.IsReady()) && Riven.W.IsReady() &&
                     Riven.GetBool("UseW" + Riven.Orbwalker.ActiveMode))
            {
                CastCircleThing();
                CastW();
            }
            else if (Riven.W.IsReady() && Riven.GetBool("UseW" + Riven.Orbwalker.ActiveMode))
            {
                CastW();
            }
            else if (Riven.E.IsReady() && Riven.GetBool("GapcloseE"))
            {
                if (target.Distance(Riven.Player) < Orbwalking.GetRealAutoAttackRange(Riven.Player) &&
                    Riven.GetBool("DontEInAARange"))
                {
                    return;
                }

                var distE = Riven.Player.ServerPosition.Extend(target.Position, Riven.E.Range);

                if (Riven.GetBool("DontEIntoWall") && distE.IsWall())
                {
                    return;
                }

                Riven.E.Cast(target.Position);
            }
            else if (Riven.Q.IsReady() && Environment.TickCount - Riven.LastQ >= 2000 &&
                     Riven.Player.Distance(target) > Riven.Q.Range && Riven.GetBool("GapcloseQ"))
            {
                Riven.Q.Cast(target.Position);
            }
        }