Exemplo n.º 1
0
        // Cougar Q Logic
        internal static void CastTakedown(Obj_AI_Base target, string mode)
        {
            if (ES.CatForm())
            {
                if (ES.SpellTimer["Takedown"].IsReady() && KN.Root.Item("ndcq" + mode).GetValue <bool>())
                {
                    // temp logic to prevent takdown cast before swipe
                    if (!ES.SpellTimer["Swipe"].IsReady() || ES.NotLearned(ES.Spells["Swipe"]) || !KN.Root.Item("ndce" + mode).GetValue <bool>())
                    {
                        if (target.IsValidTarget(ES.Player.AttackRange + ES.Spells["Takedown"].Range))
                        {
                            ES.Spells["Takedown"].CastOnUnit(ES.Player);

                            // force attack order on target (smoother)
                            if (ES.Player.HasBuff("Takedown", true))
                            {
                                Orbwalking.LastAATick = 0;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        internal static void SwitchForm(Obj_AI_Base target, string mode)
        {
            if (!target.IsValidTarget(ES.Spells["Javelin"].Range))
            {
                return;
            }

            // catform -> human
            if (ES.CatForm() && ES.Spells["Aspect"].IsReady() && KN.Root.Item("ndcr" + mode).GetValue <bool>())
            {
                var radius = ES.Player.AttackRange + ES.Player.Distance(ES.Player.BBox.Minimum) + 1;

                // check valid target in Q range
                if (target.IsValidTarget(ES.Spells["Javelin"].Range))
                {
                    // change form if Q is ready and meets hitchance
                    if (ES.SpellTimer["Javelin"].IsReady())
                    {
                        if (target.IsChampion())
                        {
                            HitChance hitchance;
                            var       objHero = target as Obj_AI_Hero;

                            var pos = SPrediction.Prediction.GetPredictionMethod2(target, ES.Spells["Javelin"],
                                                                                  objHero.GetWaypoints(), objHero.AvgMovChangeTime(), objHero.LastMovChangeTime(),
                                                                                  objHero.AvgPathLenght(), out hitchance, ES.Player.ServerPosition);

                            if (!ES.Spells["Javelin"].DoesCollide(pos) &&
                                hitchance >= (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                            {
                                ES.Spells["Aspect"].Cast();
                            }
                        }
                    }

                    // is jungling
                    if (mode == "jg")
                    {
                        if (Game.CursorPos.Distance(ES.Player.ServerPosition) >= 375 &&
                            !KN.Root.Item("jgsticky").GetValue <bool>())
                        {
                            ES.Spells["Aspect"].Cast();
                        }

                        if (ES.SpellTimer["Bushwhack"].IsReady() || ES.SpellTimer["Javelin"].IsReady() &&
                            !ES.Spells["Javelin"].DoesCollide(target.ServerPosition.To2D()))
                        {
                            if (!ES.SpellTimer["Swipe"].IsReady() && !ES.SpellTimer["Takedown"].IsReady() &&
                                !ES.SpellTimer["Pounce"].IsReady(2))
                            {
                                ES.Spells["Aspect"].Cast();
                            }
                        }
                    }

                    else
                    {
                        // change to human if out of pounce range and can die
                        if (!ES.SpellTimer["Pounce"].IsReady())
                        {
                            if (target.Distance(ES.Player.ServerPosition) > radius)
                            {
                                if (ES.Player.GetAutoAttackDamage(target, true) * 3 >= target.Health)
                                {
                                    ES.Spells["Aspect"].Cast();
                                }
                            }
                        }
                    }
                }
            }

            // human -> catform
            if (!ES.CatForm() && ES.Spells["Aspect"].IsReady() && KN.Root.Item("ndhr" + mode).GetValue <bool>())
            {
                if (mode == "jg" && ES.Counter < 2 && KN.Root.Item("jgaacount").GetValue <bool>())
                {
                    return;
                }

                if (mode == "wc")
                {
                    if (target.IsValidTarget(375) && target.IsMinion)
                    {
                        ES.Spells["Aspect"].Cast();
                        return;
                    }
                }

                if (mode == "gap")
                {
                    if (target.IsValidTarget(375))
                    {
                        ES.Spells["Aspect"].Cast();
                        return;
                    }
                }

                // pounce only hunted
                if (KN.Root.Item("ndhrwh").GetValue <StringList>().SelectedIndex == 1)
                {
                    if (target.IsValidTarget(ES.Spells["ExPounce"].Range) && target.IsHunted())
                    {
                        ES.Spells["Aspect"].Cast();
                    }
                }

                // pounce always any condition
                if (KN.Root.Item("ndhrwh").GetValue <StringList>().SelectedIndex == 2)
                {
                    if (target.IsValidTarget(ES.Spells["ExPounce"].Range) && target.IsHunted())
                    {
                        ES.Spells["Aspect"].Cast();
                    }

                    if (target.IsValidTarget(ES.Spells["Pounce"].Range) && !target.IsHunted())
                    {
                        ES.Spells["Aspect"].Cast();
                    }
                }

                // pounce with my recommended condition
                if (KN.Root.Item("ndhrwh").GetValue <StringList>().SelectedIndex == 0)
                {
                    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")
                        {
                            ES.Spells["Aspect"].Cast();
                            return;
                        }

                        // or check if pounce timer is ready before switch
                        if (ES.SpellTimer["Pounce"].IsReady() && target.IsValidTarget(ES.Spells["ExPounce"].Range))
                        {
                            if (ES.SpellTimer["Takedown"].IsReady() || ES.SpellTimer["Swipe"].IsReady())
                            {
                                ES.Spells["Aspect"].Cast();
                            }
                        }
                    }

                    else
                    {
                        // define our q target
                        var qtarget = TargetSelector.GetTarget(ES.Spells["Javelin"].Range, TargetSelector.DamageType.Magical);

                        if (target.IsValidTarget(ES.Spells["Pounce"].Range + 100))
                        {
                            if (mode == "jg")
                            {
                                if (!ES.SpellTimer["Javelin"].IsReady(2) ||
                                    ES.Spells["Javelin"].DoesCollide(target.ServerPosition.To2D()))
                                {
                                    ES.Spells["Aspect"].Cast();
                                }
                            }

                            if (ES.CatDamage(target) >= target.Health && mode == "co")
                            {
                                ES.Spells["Aspect"].Cast();
                            }

                            // switch if Q is not ready in 2 sec, not learnedm or not enabled, also wait for .4 sec to cast R
                            if (!KN.Root.Item("ndhq" + mode).GetValue <bool>() || ES.NotLearned(ES.Spells["Javelin"]) ||
                                !ES.SpellTimer["Javelin"].IsReady(2) && Utils.GameTimeTickCount - (int)(ES.TimeStamp["Javelin"] * 1000) +
                                ((6 + (6 * ES.Player.PercentCooldownMod)) * 1000) >= 400)
                            {
                                ES.Spells["Aspect"].Cast();
                            }

                            if (qtarget.IsValidTarget(ES.Spells["Javelin"].Range) && target.IsChampion())
                            {
                                if (ES.SpellTimer["Javelin"].IsReady())
                                {
                                    HitChance hitchance;

                                    var pos = SPrediction.Prediction.GetPredictionMethod2(target, ES.Spells["Javelin"],
                                                                                          qtarget.GetWaypoints(), qtarget.AvgMovChangeTime(), qtarget.LastMovChangeTime(),
                                                                                          qtarget.AvgPathLenght(), out hitchance, ES.Player.ServerPosition);

                                    // if we dont meet hitchance on Q target pounce nearest target
                                    if (ES.Spells["Javelin"].DoesCollide(pos) ||
                                        hitchance < (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                    {
                                        ES.Spells["Aspect"].Cast();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal static void Game_OnUpdate(EventArgs args)
        {
            switch (Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Jungle();
                WaveClear();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;
            }

            if (Root.Item("flee").GetValue <KeyBind>().Active)
            {
                Flee();
            }

            // auto bushwack on immobile
            if (Root.Item("ndhwimm").GetValue <bool>() && !ES.CatForm())
            {
                foreach (var unit in HeroManager.Enemies.Where(h => h.IsValidTarget(ES.Spells["Bushwhack"].Range) && ES.Immobile(h)))
                {
                    ES.Spells["Bushwhack"].Cast(unit);
                }
            }

            // auto javelin on immobile
            if (Root.Item("ndhqimm").GetValue <bool>() && !ES.CatForm())
            {
                foreach (var unit in HeroManager.Enemies.Where(h => h.IsValidTarget(ES.Spells["Javelin"].Range) && ES.Immobile(h)))
                {
                    ES.Spells["Javelin"].Cast(unit);
                }
            }

            // auto heal on ally hero
            if (Root.Item("ndheon").GetValue <bool>() && ES.SpellTimer["Primalsurge"].IsReady())
            {
                if (ES.NotLearned(ES.Spells["Primalsurge"]))
                {
                    return;
                }

                if (Player.Spellbook.IsChanneling || Player.IsRecalling())
                {
                    return;
                }

                if (Root.Item("flee").GetValue <KeyBind>().Active&& ES.CatForm())
                {
                    return;
                }

                if (Player.Mana / Player.MaxMana * 100 <
                    Root.Item("ndhemana").GetValue <Slider>().Value)
                {
                    return;
                }

                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.None ||
                    Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear && !ES.CatForm())
                {
                    foreach (
                        var hero in
                        HeroManager.Allies.Where(
                            h => Root.Item("x" + h.ChampionName).GetValue <bool>() &&
                            h.IsValidTarget(ES.Spells["Primalsurge"].Range, false) &&
                            h.Health / h.MaxHealth * 100 <
                            Root.Item("z" + h.ChampionName).GetValue <Slider>().Value))
                    {
                        if (ES.CatForm() == false)
                        {
                            ES.Spells["Primalsurge"].CastOnUnit(hero);
                        }

                        if (ES.CatForm() && Root.Item("ndhesw").GetValue <bool>() && ES.Spells["Aspect"].IsReady())
                        {
                            ES.Spells["Aspect"].Cast();
                        }
                    }
                }
            }
        }