Example #1
0
        private void TryR2Cast()
        {
            /*check min hits (by default 1) => doesnt influence the combo*/
            if (!RivenMenu.Combo["onlyR2ToKs"].Cast <CheckBox>().CurrentValue)
            {
                UltimatePrediction.CheckUltimateHits();
                return;
            }

            /*kill only*/
            var pred = Prediction.Position.PredictUnitPosition(GetTarget, (int)(Spells.R2.CastDelay + GetTarget.Distance(Player.Instance) / Spells.R2.Speed * 1000));

            Spells.ForceR2(me.Position.Extend(pred, 100));
        }
Example #2
0
        public static bool IsSpellForTargetViable_NextSpell(this string s)
        {
            CastType t = (CastType)Enum.Parse(typeof(CastType), s);

            switch (t)
            {
            case CastType.AA: return(true);

            case CastType.Q: return(Spells.Q.IsReady() && IsEnabled("Q"));

            case CastType.W: return(Spells.W.IsReady() && IsEnabled("W"));

            case CastType.E: return(Spells.E.IsReady() && IsEnabled("E") && !Combo["burstKey"].Cast <KeyBind>().CurrentValue);

            case CastType.R1: return(Spells.R1.IsReady() && GetTarget is AIHeroClient && GetTarget.IsValid &&
                                     Player.Instance.Spellbook.GetSpell(SpellSlot.R).Name == "RivenFengShuiEngine" &&
                                     !Combo["burstKey"].Cast <KeyBind>().CurrentValue&& Combo["R1"].Cast <KeyBind>().CurrentValue);

            case CastType.R2:
                var pred = Prediction.Position.PredictUnitPosition(GetTarget,
                                                                   (int)(Spells.R2.CastDelay + GetTarget.Distance(Player.Instance) / Spells.R2.Speed * 1000));

                bool isViable =
                    (Combo["onlyR2ToKs"].Cast <CheckBox>().CurrentValue&& GetRDamage(GetTarget) > GetTarget.Health &&
                     pred.Distance(Player.Instance) <= Spells.R2.Range)
                    ||
                    (UltimatePrediction.GetUltimateHits() >= Combo["minR2Hits"].Cast <Slider>().CurrentValue&&
                     !Combo["onlyR2ToKs"].Cast <CheckBox>().CurrentValue);

                return(Spells.R2.IsReady() && Player.Instance.Spellbook.GetSpell(SpellSlot.R).Name == "RivenIzunaBlade" && isViable && IsEnabled("R2"));

            case CastType.H:
                if (Spells.Hydra.IsOwned())
                {
                    return(Spells.Hydra.IsReady() && IsEnabled("H"));
                }
                if (Spells.Tiamat.IsOwned())
                {
                    return(Spells.Tiamat.IsReady() && IsEnabled("H"));
                }
                break;

            /*Burst Mode Flash after R1*/
            case CastType.F: return(Spells.Flash.IsReady() && Combo["burstKey"].Cast <KeyBind>().CurrentValue);
            }
            return(false);
        }