Exemple #1
0
        private static void CastQE(Obj_AI_Base target)
        {
            var CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;

            var predInput2 = new PredictionInput
            {
                Aoe       = false,
                Collision = EQ.Collision,
                Speed     = EQ.Speed,
                Delay     = EQ.Delay,
                Range     = EQ.Range,
                From      = Player.ServerPosition,
                Radius    = EQ.Width,
                Unit      = target,
                Type      = CoreType2
            };

            var poutput2 = Prediction.GetPrediction(predInput2);

            if (OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
            {
                return;
            }

            var castQpos = poutput2.CastPosition;

            if (Player.Distance(castQpos) > Q.Range)
            {
                castQpos = Player.Position.LSExtend(castQpos, Q.Range);
            }

            if (Program.getSliderItem("HitChance") == 0)
            {
                if (poutput2.Hitchance >= SebbyLib.Prediction.HitChance.VeryHigh)
                {
                    EQcastNow = true;
                    Q.Cast(castQpos);
                }
            }
            else if (Program.getSliderItem("HitChance") == 1)
            {
                if (poutput2.Hitchance >= SebbyLib.Prediction.HitChance.High)
                {
                    EQcastNow = true;
                    Q.Cast(castQpos);
                }
            }
            else if (Program.getSliderItem("HitChance") == 2)
            {
                if (poutput2.Hitchance >= SebbyLib.Prediction.HitChance.Medium)
                {
                    EQcastNow = true;
                    Q.Cast(castQpos);
                }
            }
        }
        private static void AutoHarass()
        {
            if (Player.ManaPercent < Menu.Item("autoharassminimumMana").GetValue <Slider>().Value)
            {
                return;
            }
            var m = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Magical);

            if ((m == null) || !m.IsValidTarget())
            {
                return;
            }

            #region SebbyPrediction

            //SebbyPrediction
            var PredSkillShotType = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
            var Aoe10             = true;

            var predictioninput = new PredictionInput
            {
                Aoe       = Aoe10,
                Collision = Q.Collision,
                Speed     = Q.Speed,
                Delay     = Q.Delay,
                Range     = Q.Range,
                From      = Player.ServerPosition,
                Radius    = Q.Width,
                Unit      = m,
                Type      = PredSkillShotType
            };
            //SebbyPrediction END

            #endregion

            // Input = 'var predictioninput'
            var predpos = Prediction.GetPrediction(predictioninput);
            if ((m != null) && Menu.Item("autoharass").GetValue <bool>())
            {
                E.CastOnUnit(m);
            }
            if ((m != null) && Menu.Item("autoharassuseQ").GetValue <bool>())
            {
                if (predpos.Hitchance >= HitChance.High)
                {
                    Q.Cast(predpos.CastPosition);
                }
            }
        }
        private static void SebbySpell(Spell QWER, Obj_AI_Base target)
        {
            var CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;
            var aoe2      = false;

            if (QWER.Type == SkillshotType.SkillshotCircle)
            {
                CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
                aoe2      = true;
            }

            if ((QWER.Width > 80) && !QWER.Collision)
            {
                aoe2 = true;
            }

            var predInput2 = new PredictionInput
            {
                Aoe       = aoe2,
                Collision = QWER.Collision,
                Speed     = QWER.Speed,
                Delay     = QWER.Delay,
                Range     = QWER.Range,
                From      = Player.ServerPosition,
                Radius    = QWER.Width,
                Unit      = target,
                Type      = CoreType2
            };
            var poutput2 = Prediction.GetPrediction(predInput2);

            //var poutput2 = QWER.GetPrediction(target);

            if ((QWER.Speed != float.MaxValue) &&
                OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
            {
                return;
            }

            if (poutput2.Hitchance >= HitChance.High)
            {
                QWER.Cast(poutput2.CastPosition);
            }
        }
Exemple #4
0
        private static void CastW(Obj_AI_Base t)
        {
            var CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;

            var predInput2 = new PredictionInput
            {
                Aoe       = false,
                Collision = W.Collision,
                Speed     = W.Speed,
                Delay     = W.Delay,
                Range     = W.Range,
                From      = Player.ServerPosition,
                Radius    = W.Width,
                Unit      = t,
                Type      = CoreType2
            };

            var poutput2 = Prediction.GetPrediction(predInput2);

            if (poutput2.Hitchance >= HitChance.High)
            {
                W.Cast(poutput2.CastPosition);
            }
        }
Exemple #5
0
        internal static void CastJavelin(Obj_AI_Base target, string mode)
        {
            // if not harass mode ignore mana check
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Javelin"], true, mode))
            {
                if (mode != "ha" || KL.Player.ManaPercent > 65)
                {
                    if (target.LSIsValidTarget(KL.Spells["Javelin"].Range))
                    {
                        if (target.IsChampion())
                        {
                            var qoutput = KL.Spells["Javelin"].GetPrediction(target);

                            if (getCheckBoxItem(qHMenu, "ndhqcheck"))
                            {
                                switch (getBoxItem(KN.Root, "ppred"))
                                {
                                case 1:
                                    var pi = new PredictionInput
                                    {
                                        Aoe       = false,
                                        Collision = true,
                                        Speed     = 1300f,
                                        Delay     = 0.25f,
                                        Range     = 1500f,
                                        From      = KN.Player.ServerPosition,
                                        Radius    = 40f,
                                        Unit      = target,
                                        Type      = SkillshotType.SkillshotLine
                                    };

                                    var po = Prediction.GetPrediction(pi);
                                    if (po.Hitchance == (SebbyLib.Prediction.HitChance)(getBoxItem(KN.Root, "ndhqch") + 3))
                                    {
                                        KL.Spells["Javelin"].Cast(po.CastPosition);
                                    }

                                    break;

                                case 2:
                                    var so = KL.Spells["Javelin"].GetPrediction((AIHeroClient)target);
                                    if (so.Hitchance == (HitChance)(getBoxItem(KN.Root, "ndhqch") + 3))
                                    {
                                        KL.Spells["Javelin"].Cast(so.CastPosition);
                                    }
                                    break;

                                case 0:
                                    var co = KL.Spells["Javelin"].GetPrediction(target);
                                    if (co.Hitchance == (HitChance)(getBoxItem(KN.Root, "ndhqch") + 3))
                                    {
                                        KL.Spells["Javelin"].Cast(co.CastPosition);
                                    }
                                    break;
                                }
                            }

                            if (qoutput.Hitchance == HitChance.Collision && KL.Smite.IsReady())
                            {
                                if (getCheckBoxItem(KN.qHMenu, "qsmcol") && target.Health <= KL.CatDamage(target) * 3)
                                {
                                    if (qoutput.CollisionObjects.All(i => i.NetworkId != KL.Player.NetworkId))
                                    {
                                        if (qoutput.CollisionObjects.Cast <AIHeroClient>().Any())
                                        {
                                            return;
                                        }
                                        var obj = qoutput.CollisionObjects.Cast <Obj_AI_Minion>().ToList();
                                        if (obj.Count == 1)
                                        {
                                            if (obj.Any(i => i.Health <= KL.Player.GetSummonerSpellDamage(i, Damage.SummonerSpell.Smite) && KL.Player.LSDistance(i) < 500 && KL.Player.Spellbook.CastSpell(KL.Smite, obj.First())))
                                            {
                                                KL.Spells["Javelin"].Cast(qoutput.CastPosition);
                                                return;
                                            }
                                        }
                                    }
                                }
                            }

                            if (!getCheckBoxItem(qHMenu, "ndhqcheck"))
                            {
                                KL.Spells["Javelin"].Cast(target);
                            }
                        }
                        else
                        {
                            KL.Spells["Javelin"].Cast(target);
                        }
                    }
                }
            }
        }
Exemple #6
0
        private static void SebbySpell(Spell Q, Obj_AI_Base target)
        {
            var CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine;
            var aoe2      = false;

            if (Q.Type == SkillshotType.SkillshotCircle)
            {
                CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
                aoe2      = true;
            }

            if ((Q.Width > 80) && !Q.Collision)
            {
                aoe2 = true;
            }

            var predInput2 = new PredictionInput
            {
                Aoe       = aoe2,
                Collision = Q.Collision,
                Speed     = Q.Speed,
                Delay     = Q.Delay,
                Range     = Q.Range,
                From      = Player.ServerPosition,
                Radius    = Q.Width,
                Unit      = target,
                Type      = CoreType2
            };
            var poutput2 = Prediction.GetPrediction(predInput2);

            if (OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
            {
                return;
            }

            if ((Q.Speed != float.MaxValue) && OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
            {
                return;
            }

            if (Menu.Item("HitChance").GetValue <StringList>().SelectedIndex == 0)
            {
                if (poutput2.Hitchance >= HitChance.Medium)
                {
                    Q.Cast(poutput2.CastPosition);
                }
            }
            else if (Menu.Item("HitChance").GetValue <StringList>().SelectedIndex == 1)
            {
                if (poutput2.Hitchance >= HitChance.High)
                {
                    Q.Cast(poutput2.CastPosition);
                }
            }
            else if (Menu.Item("HitChance").GetValue <StringList>().SelectedIndex == 2)
            {
                if (poutput2.Hitchance >= HitChance.VeryHigh)
                {
                    Q.Cast(poutput2.CastPosition);
                }
            }
        }
Exemple #7
0
        // Human/Couger R
        internal static void SwitchForm(Obj_AI_Base target, string mode)
        {
            if (!target.IsValidTarget(KL.Spells["Javelin"].Range))
            {
                return;
            }

            if (KN.Root.Item("noR").GetValue <bool>() && mode == "jg" &&
                KN.Player.Level < KN.Root.Item("noRLevel").GetValue <Slider>().Value)
            {
                return;
            }

            // catform -> human
            if (KL.CatForm() && KL.CanUse(KL.Spells["Aspect"], false, mode))
            {
                // dont switch if have Q buff and near target
                if (KL.CanUse(KL.Spells["Takedown"], false, mode))
                {
                    if (KL.Player.HasBuff("Takedown") && Orbwalking.InAutoAttackRange(target))
                    {
                        return;
                    }
                }

                // change form if Q is ready and meets hitchance
                if (target.IsChampion())
                {
                    if (KL.SpellTimer["Javelin"].IsReady())
                    {
                        switch (KN.Root.Item("ppred").GetValue <StringList>().SelectedValue)
                        {
                        case "OKTW":
                            PredictionInput pi;
                            pi           = new PredictionInput();
                            pi.Aoe       = false;
                            pi.Collision = true;
                            pi.Speed     = 1300f;
                            pi.Delay     = 0.25f;
                            pi.Range     = 1500f;
                            pi.From      = KN.Player.ServerPosition;
                            pi.Radius    = 40f;
                            pi.Unit      = target;
                            pi.Type      = SkillshotType.SkillshotLine;

                            var po = Prediction.GetPrediction(pi);
                            if (po.Hitchance >= (SebbyLib.Prediction.HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            break;

                        case "SPrediction":
                            var so = KL.Spells["Javelin"].GetSPrediction((Obj_AI_Hero)target);
                            if (so.HitChance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            break;

                        case "Common":
                            var co = KL.Spells["Javelin"].GetPrediction(target);
                            if (co.Hitchance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            break;
                        }
                    }
                }

                // is jungling
                if (mode == "jg")
                {
                    if (KL.CanUse(KL.Spells["Bushwhack"], true, mode) ||
                        KL.CanUse(KL.Spells["Javelin"], true, mode))
                    {
                        if ((!KL.SpellTimer["Pounce"].IsReady(2) || !KL.CanUse(KL.Spells["Pounce"], false, mode)) &&
                            (!KL.SpellTimer["Swipe"].IsReady() || !KL.CanUse(KL.Spells["Swipe"], false, mode)) &&
                            (!KL.SpellTimer["Takedown"].IsReady() || !KL.CanUse(KL.Spells["Takedown"], false, mode)) ||

                            !(KL.Player.Distance(target.ServerPosition) <= 355) ||
                            !KN.Root.Item("jgaacount").GetValue <KeyBind>().Active)
                        {
                            if (KL.Spells["Javelin"].Cast(target) != Spell.CastStates.Collision &&
                                KL.SpellTimer["Javelin"].IsReady())
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            else if (!KL.CanUse(KL.Spells["Javelin"], true, mode))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                    }
                }
            }

            // human -> catform
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Aspect"], true, mode))
            {
                switch (mode)
                {
                case "jg":
                    if (KL.Counter < KN.Root.Item("aareq").GetValue <Slider>().Value&&
                        KN.Root.Item("jgaacount").GetValue <KeyBind>().Active)
                    {
                        return;
                    }
                    break;

                case "gap":
                    if (target.IsValidTarget(375))
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }
                    break;

                case "wc":
                    if (target.IsValidTarget(375) && target.IsMinion)
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }
                    break;
                }

                if (target.IsHunted())
                {
                    // force switch no swipe/takedown req
                    if (!KN.Root.Item("ndhrcreq").GetValue <bool>() && mode == "co" ||
                        !KN.Root.Item("ndhrjreq").GetValue <bool>() && mode == "jg")
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }

                    // dis b for level 1 nid
                    // stop form switch when W is not leveled or disabled.
                    if (!KL.CanUse(KL.Spells["Pounce"], false, mode))
                    {
                        // block the form switch if greater than couger Q range
                        if (target.Distance(KL.Player) > KL.Spells["Takedown"].Range + 50)
                        {
                            return;
                        }
                    }

                    // or check if pounce timer is ready before switch
                    if (KL.Spells["Aspect"].IsReady() && target.IsValidTarget(KL.Spells["ExPounce"].Range))
                    {
                        // dont change form if swipe or takedown isn't ready
                        if ((KL.SpellTimer["Takedown"].IsReady() || KL.SpellTimer["Swipe"].IsReady()) &&
                            KL.SpellTimer["Pounce"].IsReady(1))
                        {
                            KL.Spells["Aspect"].Cast();
                        }
                    }
                }
                else
                {
                    // check if in pounce range
                    if (target.IsValidTarget(KL.Spells["Pounce"].Range + 95))
                    {
                        if (mode != "jg")
                        {
                            // switch to cougar if can kill target
                            if (KL.CatDamage(target) * 3 >= target.Health)
                            {
                                if (mode == "co" && target.IsValidTarget(KL.Spells["Pounce"].Range + 200))
                                {
                                    if (!KL.CanUse(KL.Spells["Javelin"], true, "co") ||
                                        KL.Spells["Javelin"].Cast(target) == Spell.CastStates.Collision)
                                    {
                                        KL.Spells["Aspect"].Cast();
                                    }
                                }
                            }

                            // switch if Q disabled in menu or not ready
                            if (!KL.CanUse(KL.Spells["Javelin"], true, mode))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            else if (Utils.GameTimeTickCount - (int)(KL.TimeStamp["Javelin"] * 1000) +
                                     ((6 + (6 * KL.Player.PercentCooldownMod)) * 1000) >= 500 &&
                                     !KL.SpellTimer["Javelin"].IsReady(2))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                        else
                        {
                            if (KL.Spells["Javelin"].Cast(target) == Spell.CastStates.Collision &&
                                KN.Root.Item("spcol").GetValue <bool>())
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }

                            if ((!KL.SpellTimer["Bushwhack"].IsReady() || !KL.CanUse(KL.Spells["Bushwhack"], true, mode)) &&
                                (!KL.SpellTimer["Javelin"].IsReady(3) || !KL.CanUse(KL.Spells["Javelin"], true, mode)))
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }
                        }
                    }


                    if (KN.Target.IsValidTarget(KL.Spells["Javelin"].Range) && target.IsChampion())
                    {
                        if (KL.SpellTimer["Javelin"].IsReady())
                        {
                            // check if in pounce range.
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 100f)
                            {
                                // if we dont meet hitchance on Q target pounce nearest target
                                var poutput = KL.Spells["Javelin"].GetPrediction(KN.Target);
                                if (poutput.Hitchance < (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    if (KL.Spells["Aspect"].IsReady())
                                    {
                                        KL.Spells["Aspect"].Cast();
                                    }
                                }
                            }
                        }

                        if (KN.Target.IsHunted() && KN.Target.Distance(KL.Player.ServerPosition) > KL.Spells["ExPounce"].Range + 100)
                        {
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 25)
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }
                        }

                        if (!KL.SpellTimer["Javelin"].IsReady())
                        {
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 125)
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                    }
                }
            }
        }
Exemple #8
0
        // Cougar E Logic
        internal static void CastSwipe(Obj_AI_Base target, string mode)
        {
            if (KL.CatForm() && KL.CanUse(KL.Spells["Swipe"], false, mode))
            {
                if (target.IsValidTarget(KL.Spells["Swipe"].Range))
                {
                    if (target.IsChampion())
                    {
                        if (KN.Root.Item("ndcecheck").GetValue <bool>())
                        {
                            switch (KN.Root.Item("ppred").GetValue <StringList>().SelectedValue)
                            {
                            case "OKTW":
                                PredictionInput pi;
                                pi           = new PredictionInput();
                                pi.Aoe       = true;
                                pi.Collision = false;
                                pi.Speed     = float.MaxValue;
                                pi.Delay     = 0.25f;
                                pi.Range     = 300f;
                                pi.From      = KN.Player.ServerPosition;
                                pi.Radius    = 300f;
                                pi.Unit      = target;
                                pi.Type      = SkillshotType.SkillshotCone;

                                var po = Prediction.GetPrediction(pi);
                                if (po.Hitchance >= (SebbyLib.Prediction.HitChance)(KN.Root.Item("ndcech").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Swipe"].Cast(po.CastPosition);
                                }
                                break;

                            case "SPrediction":
                                var so = KL.Spells["Swipe"].GetSPrediction((Obj_AI_Hero)target);
                                if (so.HitChance >= (HitChance)(KN.Root.Item("ndcech").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Swipe"].Cast(so.CastPosition);
                                }
                                break;

                            case "Common":
                                var co = KL.Spells["Swipe"].GetPrediction(target);
                                if (co.Hitchance >= (HitChance)(KN.Root.Item("ndcech").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Swipe"].Cast(co.CastPosition);
                                }
                                break;
                            }
                        }
                        else
                        {
                            KL.Spells["Swipe"].Cast(target.ServerPosition);
                        }
                    }
                    else
                    {
                        // try aoe swipe if menu item > 1
                        var minhit = KN.Root.Item("ndcenum").GetValue <Slider>().Value;
                        if (minhit > 1 && mode == "wc")
                        {
                            KL.CastSmartSwipe();
                        }

                        // or cast normal
                        else
                        {
                            KL.Spells["Swipe"].Cast(target.ServerPosition);
                        }
                    }
                }
            }

            // check valid target in range
        }
Exemple #9
0
        // Cougar W Logic
        internal static void CastPounce(Obj_AI_Base target, string mode)
        {
            // check the actual spell timer and if we have it enabled in our menu
            if (!KL.CatForm() || !KL.CanUse(KL.Spells["Pounce"], false, mode))
            {
                return;
            }

            // check if target is hunted in 750 range
            if (!target.IsValidTarget(KL.Spells["ExPounce"].Range))
            {
                return;
            }

            if (target.IsHunted())
            {
                // get hitbox
                var radius = KL.Player.AttackRange + KL.Player.Distance(KL.Player.BBox.Minimum) + 1;

                // force pounce if menu item enabled
                if (target.IsHunted() && KN.Root.Item("ndcwhunt").GetValue <bool>() ||

                    // or of target is greater than my attack range
                    target.Distance(KL.Player.ServerPosition) > radius ||

                    // or is jungling or waveclearing (without farm distance check)
                    mode == "jg" || mode == "wc" && !KN.Root.Item("ndcwdistwc").GetValue <bool>() ||

                    // or combo mode and ignoring distance check
                    !target.IsHunted() && mode == "co" && !KN.Root.Item("ndcwdistco").GetValue <bool>())
                {
                    if (KN.Root.Item("kitejg").GetValue <bool>() && mode == "jg")
                    {
                        if (target.Distance(Game.CursorPos) > 600 && target.Distance(KL.Player.ServerPosition) <= 300)
                        {
                            KL.Spells["Pounce"].Cast(Game.CursorPos);
                            return;
                        }
                    }

                    KL.Spells["Pounce"].Cast(target.ServerPosition);
                }
            }

            // if target is not hunted
            else
            {
                // check if in the original pounce range
                if (target.Distance(KL.Player.ServerPosition) > KL.Spells["Pounce"].Range)
                {
                    return;
                }

                // get hitbox
                var radius = KL.Player.AttackRange + KL.Player.Distance(KL.Player.BBox.Minimum) + 1;

                // if greater than our hitbox radius pounce!
                if (target.Distance(KL.Player.ServerPosition) > radius ||

                    // or is jungling or waveclearing (without distance checking)
                    mode == "jg" || mode == "wc" && !KN.Root.Item("ndcwdistwc").GetValue <bool>() ||

                    // or combo mode with no distance checking
                    mode == "co" && !KN.Root.Item("ndcwdistco").GetValue <bool>())
                {
                    if (target.IsChampion())
                    {
                        if (KN.Root.Item("ndcwcheck").GetValue <bool>())
                        {
                            switch (KN.Root.Item("ppred").GetValue <StringList>().SelectedValue)
                            {
                            case "OKTW":
                                PredictionInput pi;
                                pi           = new PredictionInput();
                                pi.Aoe       = false;
                                pi.Collision = true;
                                pi.Speed     = 1300f;
                                pi.Delay     = 0.25f;
                                pi.Range     = 1500f;
                                pi.From      = KN.Player.ServerPosition;
                                pi.Radius    = 40f;
                                pi.Unit      = target;
                                pi.Type      = SkillshotType.SkillshotLine;

                                var po = Prediction.GetPrediction(pi);
                                if (po.Hitchance >= (SebbyLib.Prediction.HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Javelin"].Cast(po.CastPosition);
                                }
                                break;

                            case "SPrediction":
                                var so = KL.Spells["Javelin"].GetSPrediction((Obj_AI_Hero)target);
                                if (so.HitChance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Javelin"].Cast(so.CastPosition);
                                }
                                break;

                            case "Common":
                                var co = KL.Spells["Javelin"].GetPrediction(target);
                                if (co.Hitchance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    KL.Spells["Javelin"].Cast(co.CastPosition);
                                }
                                break;
                            }
                        }
                        else
                        {
                            KL.Spells["Pounce"].Cast(target.ServerPosition);
                        }
                    }
                    else
                    {
                        // check pouncing near enemies
                        if (mode == "wc" && KN.Root.Item("ndcwene").GetValue <bool>() &&
                            target.ServerPosition.CountEnemiesInRange(550) > 0)
                        {
                            return;
                        }

                        // check pouncing under turret
                        if (mode == "wc" && KN.Root.Item("ndcwtow").GetValue <bool>() &&
                            target.ServerPosition.UnderTurret(true))
                        {
                            return;
                        }

                        KL.Spells["Pounce"].Cast(target.ServerPosition);
                    }
                }
            }
        }
Exemple #10
0
        // Human Q Logic
        internal static void CastJavelin(Obj_AI_Base target, string mode)
        {
            // if not harass mode ignore mana check
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Javelin"], true, mode))
            {
                if (mode == "ha" && KL.Player.ManaPercent <= 65)
                {
                    return;
                }

                if (!target.IsValidTarget(KL.Spells["Javelin"].Range))
                {
                    return;
                }

                // try prediction on champion
                if (target.IsChampion() && target is Obj_AI_Hero) // double check
                {
                    if (KN.Root.Item("ndhqcheck").GetValue <bool>())
                    {
                        switch (KN.Root.Item("ppred").GetValue <StringList>().SelectedValue)
                        {
                        case "OKTW":
                            PredictionInput pi;
                            pi           = new PredictionInput();
                            pi.Aoe       = false;
                            pi.Collision = true;
                            pi.Speed     = 1300f;
                            pi.Delay     = 0.25f;
                            pi.Range     = 1500f;
                            pi.From      = KN.Player.ServerPosition;
                            pi.Radius    = 40f;
                            pi.Unit      = target;
                            pi.Type      = SkillshotType.SkillshotLine;

                            var po = Prediction.GetPrediction(pi);
                            if (po.Hitchance >= (SebbyLib.Prediction.HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Javelin"].Cast(po.CastPosition);
                            }
                            break;

                        case "SPrediction":
                            var so = KL.Spells["Javelin"].GetSPrediction((Obj_AI_Hero)target);
                            if (so.HitChance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Javelin"].Cast(so.CastPosition);
                            }
                            break;

                        case "Common":
                            var co = KL.Spells["Javelin"].GetPrediction(target);
                            if (co.Hitchance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                KL.Spells["Javelin"].Cast(co.CastPosition);
                            }
                            break;
                        }
                    }

                    if (!KN.Root.Item("ndhqcheck").GetValue <bool>())
                    {
                        KL.Spells["Javelin"].Cast(target.ServerPosition);
                    }
                }
                else
                {
                    KL.Spells["Javelin"].Cast(target);
                }
            }
        }
Exemple #11
0
        /// <summary>
        ///     General Usage of Spells
        /// </summary>
        /// <param name="QWER"></param>
        /// <param name="target"></param>

        #region SebbySpell
        public static void SebbySpellMain(Spell QWER, Obj_AI_Base target)
        {
            if (RootConfig.SelectedPrediction.GetValue <StringList>().SelectedIndex == 1)
            {
                var CoreType2 = SkillshotType.SkillshotLine;
                var aoe2      = false;

                if (QWER.Type == LeagueSharp.Common.SkillshotType.SkillshotCircle)
                {
                    CoreType2 = SkillshotType.SkillshotCircle;
                    aoe2      = true;
                }

                if ((QWER.Width > 80) && !QWER.Collision)
                {
                    aoe2 = true;
                }

                var predInput2 = new PredictionInput
                {
                    Aoe       = aoe2,
                    Collision = QWER.Collision,
                    Speed     = QWER.Speed,
                    Delay     = QWER.Delay,
                    Range     = QWER.Range,
                    From      = Player.ServerPosition,
                    Radius    = QWER.Width,
                    Unit      = target,
                    Type      = CoreType2
                };
                var poutput2 = Prediction.GetPrediction(predInput2);

                if (OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                {
                    return;
                }

                if ((QWER.Speed != float.MaxValue) &&
                    OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                {
                    return;
                }
                // LastPoint - Save | Make sure to replace the HitChances with VeryHigh/Medium - Invert them
                if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 0)
                {
                    if (poutput2.Hitchance >= HitChance.Medium)
                    {
                        QWER.Cast(poutput2.CastPosition);
                    }
                    else if (predInput2.Aoe && (poutput2.AoeTargetsHitCount > 1) && (poutput2.Hitchance >= HitChance.Medium))
                    {
                        QWER.Cast(poutput2.CastPosition);
                    }
                }
                else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 1)
                {
                    if (poutput2.Hitchance >= HitChance.High)
                    {
                        QWER.Cast(poutput2.CastPosition);
                    }
                }
                else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 2)
                {
                    if (poutput2.Hitchance >= HitChance.VeryHigh)
                    {
                        QWER.Cast(poutput2.CastPosition);
                    }
                }
            }
            else if (RootConfig.SelectedPrediction.GetValue <StringList>().SelectedIndex == 0)
            {
                if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 0)
                {
                    QWER.CastIfHitchanceEquals(target, LeagueSharp.Common.HitChance.Medium);
                }
                else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 1)
                {
                    QWER.CastIfHitchanceEquals(target, LeagueSharp.Common.HitChance.High);
                }
                else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 2)
                {
                    QWER.CastIfHitchanceEquals(target, LeagueSharp.Common.HitChance.VeryHigh);
                }
            }
            else if (RootConfig.SelectedPrediction.GetValue <StringList>().SelectedIndex == 2)
            {
                if (target is Obj_AI_Hero && target.IsValid)
                {
                    var t = target as Obj_AI_Hero;
                    if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 0)
                    {
                        QWER.SPredictionCast(t, LeagueSharp.Common.HitChance.Medium);
                    }
                    else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 1)
                    {
                        QWER.SPredictionCast(t, LeagueSharp.Common.HitChance.High);
                    }
                    else if (RootConfig.SelectedHitChance.GetValue <StringList>().SelectedIndex == 2)
                    {
                        QWER.SPredictionCast(t, LeagueSharp.Common.HitChance.VeryHigh);
                    }
                }
                else
                {
                    QWER.CastIfHitchanceEquals(target, LeagueSharp.Common.HitChance.High);
                }
            }
        }
        //Burst
        public static void Oneshot()
        {
            // If player doesn't have mana don't execute the OneShot Combo
            if (Player.Mana < Q.ManaCost + W.ManaCost + E.ManaCost + R.ManaCost)
            {
                return;
            }


            if (Player.IsChannelingImportantSpell() || (Game.Time - Rtime < 2.5) || Player.HasBuff("malzaharrsound"))
            {
                Orbwalker.SetAttack(false);
                Orbwalker.SetMovement(false);
                return;
            }
            Orbwalker.SetAttack(true);
            Orbwalker.SetMovement(true);

            Orbwalking.MoveTo(Game.CursorPos);
            var m = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            if (!m.IsValidTarget())
            {
                return;
            }

            #region SebbyPrediction

            //SebbyPrediction
            var PredSkillShotType = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
            var Aoe10             = true;

            var predictioninput = new PredictionInput
            {
                Aoe       = Aoe10,
                Collision = Q.Collision,
                Speed     = Q.Speed,
                Delay     = Q.Delay,
                Range     = Q.Range,
                From      = Player.ServerPosition,
                Radius    = Q.Width,
                Unit      = m,
                Type      = PredSkillShotType
            };
            //SebbyPrediction END

            #endregion

            // Input = 'var predictioninput'
            var predpos = Prediction.GetPrediction(predictioninput);
            // var pred = Q.GetSPrediction(m);
            if (Q.IsReady() && Q.IsInRange(m))
            {
                if (m.CanMove && (predpos.Hitchance >= HitChance.High))
                {
                    Q.Cast(predpos.CastPosition);
                }
                else if (!m.CanMove)
                {
                    Q.Cast(m.Position);
                }
            }
            if (E.IsReady() && E.IsInRange(m))
            {
                E.CastOnUnit(m);
            }
            if (W.IsReady())
            {
                W.Cast(m);
            }
            Player.Spellbook.CastSpell(igniteSlot, m);
            if (R.IsReady() && !E.IsReady() && !W.IsReady() && R.IsInRange(m))
            {
                R.CastOnUnit(m);
            }
        }
        //Combo
        private static void Combo()
        {
            var useQ = Menu.Item("useQ").GetValue <bool>();
            var useW = Menu.Item("useW").GetValue <bool>();
            var useE = Menu.Item("useE").GetValue <bool>();
            var useR = Menu.Item("useR").GetValue <bool>();
            var m    = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            if ((m == null) || !m.IsValidTarget())
            {
                return;
            }

            #region SebbyPrediction

            //SebbyPrediction
            var PredSkillShotType = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
            var Aoe10             = true;

            var predictioninput = new PredictionInput
            {
                Aoe       = Aoe10,
                Collision = Q.Collision,
                Speed     = Q.Speed,
                Delay     = Q.Delay,
                Range     = Q.Range,
                From      = Player.ServerPosition,
                Radius    = Q.Width,
                Unit      = m,
                Type      = PredSkillShotType
            };
            //SebbyPrediction END

            #endregion

            // Input = 'var predictioninput'
            var predpos = Prediction.GetPrediction(predictioninput);
            if (Player.Mana > E.ManaCost + W.ManaCost + R.ManaCost)
            {
                if (useQ && Q.IsReady() && (Player.Mana > Q.ManaCost) && Q.IsInRange(m))
                {
                    if (m.CanMove && (predpos.Hitchance >= HitChance.High))
                    {
                        Q.Cast(predpos.CastPosition);
                    }
                    else if (!m.CanMove)
                    {
                        Q.Cast(m.Position);
                    }
                }
                if (useW && W.IsReady())
                {
                    W.Cast(m);
                }
                if (useE && E.IsReady() && E.IsInRange(m))
                {
                    E.CastOnUnit(m);
                }
                if (useR && R.IsReady() && !W.IsReady() && !E.IsReady() && (m != null) && E.IsInRange(m))
                {
                    R.CastOnUnit(m);
                }
            }
            else
            {
                if (useE && E.IsReady() && E.IsInRange(m))
                {
                    E.CastOnUnit(m);
                }
                if (useQ && Q.IsReady() && (Player.Mana > Q.ManaCost) && Q.IsInRange(m))
                {
                    if (m.CanMove && (predpos.Hitchance >= HitChance.High))
                    {
                        Q.Cast(predpos.CastPosition);
                    }
                    else if (!m.CanMove)
                    {
                        Q.Cast(m.Position);
                    }
                }
                if (useW && W.IsReady() && (Player.Mana > W.ManaCost) && W.IsInRange(m))
                {
                    W.Cast(m);
                }
            }
            if (Menu.Item("useIgniteInCombo").GetValue <bool>())
            {
                if (m.Health < Player.GetSummonerSpellDamage(m, Damage.SummonerSpell.Ignite))
                {
                    Player.Spellbook.CastSpell(igniteSlot, m);
                }
            }
        }
        private static void OnUpdate(EventArgs args)
        {
            if (Player.IsDead || Player.IsRecalling())
            {
                return;
            }

            if (Player.IsChannelingImportantSpell() || (Game.Time - Rtime < 2.5) || Player.HasBuff("malzaharrsound"))
            {
                Orbwalker.SetAttack(false);
                Orbwalker.SetMovement(false);
                return;
            }
            Orbwalker.SetAttack(true);
            Orbwalker.SetMovement(true);
            if (E.IsReady() && Menu.Item("ksE").GetValue <bool>())
            {
                foreach (
                    var h in
                    HeroManager.Enemies.Where(
                        h =>
                        h.IsValidTarget(E.Range) &&
                        (h.Health < OktwCommon.GetKsDamage(h, E) + OktwCommon.GetEchoLudenDamage(h))))
                {
                    E.Cast(h);
                }
            }
            if (Q.IsReady() && Menu.Item("ksQ").GetValue <bool>())
            {
                foreach (
                    var h in
                    HeroManager.Enemies.Where(
                        h =>
                        h.IsValidTarget(Q.Range) &&
                        (h.Health < OktwCommon.GetKsDamage(h, Q) + OktwCommon.GetEchoLudenDamage(h))))
                {
                    #region SebbyPrediction

                    //SebbyPrediction
                    var PredSkillShotType = SebbyLib.Prediction.SkillshotType.SkillshotCircle;
                    var Aoe10             = true;

                    var predictioninput = new PredictionInput
                    {
                        Aoe       = Aoe10,
                        Collision = Q.Collision,
                        Speed     = Q.Speed,
                        Delay     = Q.Delay,
                        Range     = Q.Range,
                        From      = Player.ServerPosition,
                        Radius    = Q.Width,
                        Unit      = h,
                        Type      = PredSkillShotType
                    };
                    //SebbyPrediction END

                    #endregion

                    // Input = 'var predictioninput'
                    var predpos = Prediction.GetPrediction(predictioninput);
                    if (predpos.Hitchance >= HitChance.High)
                    {
                        Q.Cast(predpos.CastPosition);
                    }
                }
            }
            //Combo
            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                if (Menu.Item("DontAAInCombo").GetValue <bool>())
                {
                    Orbwalker.SetAttack(false);
                }
                else
                {
                    Orbwalker.SetAttack(true);
                }
                Combo();
            }
            //Burst
            if (Menu.Item("oneshot").GetValue <KeyBind>().Active)
            {
                Oneshot();
            }
            //Lane
            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                JungleClear();
                Lane();
            }
            //AutoHarass
            if (Menu.Item("autoharassenabled").GetValue <bool>())
            {
                AutoHarass();
            }
        }