Esempio n. 1
0
 void OnInterruptable(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
 {
     if (Yasuo.ServerPosition.PointUnderEnemyTurret())
     {
         return;
     }
     if (GetBool("Misc.Interrupter") && TornadoReady && Yasuo.Distance(sender.ServerPosition) <= 500)
     {
         if (args.EndTime >= Spells[Q2].Delay)
         {
             Spells[Q2].Cast(sender.ServerPosition);
         }
     }
 }
Esempio n. 2
0
 void OnGapClose(ActiveGapcloser args)
 {
     if (Yasuo.ServerPosition.PointUnderEnemyTurret())
     {
         return;
     }
     if (GetBool("Misc.AG") && TornadoReady && Yasuo.Distance(args.End) <= 500)
     {
         var pred = Spells[Q2].GetPrediction(args.Sender);
         if (pred.Hitchance >= GetHitChance("Hitchance.Q"))
         {
             Spells[Q2].Cast(pred.CastPosition);
         }
     }
 }
Esempio n. 3
0
        PathResult IsPossibleToDash(AIHeroClient target, int jumpcount)
        {
            var result      = new PathResult();
            var dist        = Yasuo.Distance(target);
            var pos         = Yasuo.ServerPosition.To2D();
            var minionsinbw =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(x => x.Distance(target) <= dist && x.Distance(Yasuo) < dist)
                .OrderBy(x => x.Distance(Yasuo));

            result.foundPath = false;
            foreach (var minion in minionsinbw)
            {
                if (result.numberOfHops > jumpcount)
                {
                    result.foundPath = false;
                    return(result);
                }
                if (pos.Distance(target) <= Yasuo.AttackRange || (target.IsDashable() && pos.Distance(target) <= Spells[E].Range))
                {
                    result.foundPath = true;
                    return(result);
                }

                if (pos.Distance(minion) > Spells[E].Range)
                {
                    continue;
                }

                if (minion.IsDashable(40000))
                {
                    result.numberOfHops++;
                    result.minionPath.Add(minion);
                    pos = GetDashPos(minion);
                }

                else
                {
                    continue;
                }
            }

            return(result);
        }
Esempio n. 4
0
        //minimum amount of minions
        PathResult GetClosestPath(AIHeroClient target, int minioncount)
        {
            var result      = new PathResult();
            var dist        = Yasuo.Distance(target);
            var pos         = Yasuo.ServerPosition.To2D();
            var minionsinbw =
                ObjectManager.Get <Obj_AI_Minion>()
                .Where(x => x.Distance(target) <= dist && x.Distance(Yasuo) < dist)
                .OrderBy(x => x.Distance(Yasuo));

            result.minionPath = new List <Obj_AI_Minion>();
            foreach (var minion in minionsinbw)
            {
                if (result.numberOfHops > minioncount)
                {
                    result.foundPath = false;
                    break;
                }
                if (pos.Distance(target) <= Spells[E].Range)
                {
                    result.foundPath = true;
                    break;
                }

                if (minion.IsDashable(40000) && minion.Distance(pos) <= Spells[E].Range)
                {
                    result.numberOfHops++;
                    result.minionPath.Add(minion);
                    pos = GetDashPos(minion);
                }
                else
                {
                    result.foundPath = false;
                }
            }
            return(result);
        }
Esempio n. 5
0
        void Flee()
        {
            Orbwalker.DisableAttacking = true; // BERB
            if (GetBool("Flee.UseQ2", YasuoMenu.MiscM) && !Yasuo.LSIsDashing() && SpellSlot.Q.IsReady() && TornadoReady)
            {
                var qtarg = TargetSelector.GetTarget(Spells[Q2].Range, DamageType.Physical);
                if (qtarg != null)
                {
                    Spells[Q2].Cast(qtarg.ServerPosition);
                }
            }

            if (FleeMode == FleeType.ToCursor)
            {
                Orbwalker.OrbwalkTo(Game.CursorPos);

                var smart = GetBool("Flee.Smart", YasuoMenu.MiscM);

                if (Spells[E].IsReady())
                {
                    if (smart)
                    {
                        Obj_AI_Base dashTarg;

                        if (Yasuo.ServerPosition.PointUnderEnemyTurret())
                        {
                            var closestturret =
                                ObjectManager.Get <Obj_AI_Turret>()
                                .Where(x => x.IsEnemy)
                                .MinOrDefault(y => y.LSDistance(Yasuo));

                            var potential =
                                ObjectManager.Get <Obj_AI_Base>()
                                .Where(x => x.IsDashable())
                                .MaxOrDefault(x => GetDashPos(x).LSDistance(closestturret));

                            var gdpos = GetDashPos(potential);
                            if (potential != null && gdpos.LSDistance(Game.CursorPos) < Yasuo.LSDistance(Game.CursorPos) && gdpos.LSDistance(closestturret.Position) - closestturret.BoundingRadius > Yasuo.LSDistance(closestturret.Position) - Yasuo.BoundingRadius)
                            {
                                Spells[E].Cast(potential);
                            }
                        }

                        dashTarg = ObjectManager.Get <Obj_AI_Base>()
                                   .Where(x => x.IsDashable())
                                   .MinOrDefault(x => GetDashPos(x).LSDistance(Game.CursorPos));

                        if (dashTarg != null)
                        {
                            var posafdash = GetDashPos(dashTarg);

                            if (posafdash.LSDistance(Game.CursorPos) < Yasuo.LSDistance(Game.CursorPos) &&
                                !posafdash.PointUnderEnemyTurret())
                            {
                                Spells[E].CastOnUnit(dashTarg);
                            }
                        }
                    }

                    else
                    {
                        var dashtarg =
                            ObjectManager.Get <Obj_AI_Minion>()
                            .Where(x => x.IsDashable())
                            .MinOrDefault(x => GetDashPos(x).LSDistance(Game.CursorPos));

                        if (dashtarg != null)
                        {
                            Spells[E].CastOnUnit(dashtarg);
                        }
                    }
                }

                if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady && !Yasuo.LSIsDashing())
                {
                    Obj_AI_Minion qtarg = null;
                    if (!Spells[E].IsReady())
                    {
                        qtarg =
                            ObjectManager.Get <Obj_AI_Minion>()
                            .Find(x => x.LSIsValidTarget(Spells[Q].Range) && MinionManager.IsMinion(x));
                    }
                    else
                    {
                        var etargs =
                            ObjectManager.Get <Obj_AI_Minion>()
                            .Where(
                                x => x.LSIsValidTarget(Spells[E].Range) && MinionManager.IsMinion(x) && x.IsDashable());
                        if (!etargs.Any())
                        {
                            qtarg =
                                ObjectManager.Get <Obj_AI_Minion>()
                                .Find(x => x.LSIsValidTarget(Spells[Q].Range) && MinionManager.IsMinion(x));
                        }
                    }

                    if (qtarg != null)
                    {
                        Spells[Q].Cast(qtarg);
                    }
                }
            }

            if (FleeMode == FleeType.ToNexus)
            {
                var nexus = shop;
                if (nexus != null)
                {
                    Orbwalker.OrbwalkTo(nexus.Position);
                    var bestminion = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsDashable()).MinOrDefault(x => GetDashPos(x).LSDistance(nexus.Position));
                    if (bestminion != null && (!GetBool("Flee.Smart", YasuoMenu.MiscM) || GetDashPos(bestminion).Distance(nexus.Position) < Yasuo.Distance(nexus.Position)))
                    {
                        Spells[E].CastOnUnit(bestminion);
                        if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady)
                        {
                            Spells[Q].Cast(bestminion);
                        }
                    }
                }
            }

            if (FleeMode == FleeType.ToAllies)
            {
                Obj_AI_Base bestally = HeroManager.Allies.Where(x => !x.IsMe && x.CountEnemiesInRange(300) == 0).MinOrDefault(x => x.LSDistance(Yasuo));
                if (bestally == null)
                {
                    bestally =
                        ObjectManager.Get <Obj_AI_Minion>()
                        .Where(x => x.IsValidAlly(3000))
                        .MinOrDefault(x => x.LSDistance(Yasuo));
                }

                if (bestally != null)
                {
                    Orbwalker.OrbwalkTo(bestally.ServerPosition);
                    if (Spells[E].IsReady())
                    {
                        var besttarget =
                            ObjectManager.Get <Obj_AI_Base>()
                            .Where(x => x.IsDashable())
                            .MinOrDefault(x => GetDashPos(x).LSDistance(bestally.ServerPosition));
                        if (besttarget != null)
                        {
                            Spells[E].CastOnUnit(besttarget);
                            if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady)
                            {
                                Spells[Q].Cast(besttarget);
                            }
                        }
                    }
                }

                else
                {
                    var nexus = shop;
                    if (nexus != null)
                    {
                        Orbwalker.OrbwalkTo(nexus.Position);
                        var bestminion = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsDashable()).MinOrDefault(x => GetDashPos(x).LSDistance(nexus.Position));
                        if (bestminion != null && GetDashPos(bestminion).LSDistance(nexus.Position) < Yasuo.LSDistance(nexus.Position))
                        {
                            Spells[E].CastOnUnit(bestminion);
                        }
                    }
                }
            }
        }
Esempio n. 6
0
        void CastENew()
        {
            if (Yasuo.LSIsDashing())
            {
                return;
            }

            if (isHealthy)
            {
                AIHeroClient best = null;
                TargetSelectorA.TargetSelectionConditionDelegate condition = delegate(AIHeroClient target)
                {
                    return(IsPossibleToDash(target, 3).foundPath);
                };

                best = TargetSelector.GetTarget(Spells[E].Range * 4, DamageType.Physical);

                if (best != null)
                {
                    if (best.Distance(Yasuo) < 0.30 * Orbwalking.GetRealAutoAttackRange(best))
                    {
                        return;
                    }


                    if (best.IsValidTarget(Spells[E].Range))
                    {
                        Spells[E].Cast(best);
                    }

                    else
                    {
                        var getPath = GetClosestPath(best, 3);
                        if (getPath.foundPath)
                        {
                            var min = getPath.minionPath.FirstOrDefault();
                            if (min != null && min.IsValidTarget() && ((GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM)) || !GetDashPos(min).PointUnderEnemyTurret()))
                            {
                                Spells[E].CastOnUnit(min);
                            }
                        }
                    }
                }
            }

            else if (!Yasuo.LSIsDashing() && GetBool("Combo.EToSafety", YasuoMenu.ComboM))
            {
                var bestmin =
                    ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsDashable() && GetDashPos(x).Distance(shop.Position) < Yasuo.Distance(shop.Position)).MinOrDefault(x => GetDashPos(x).Distance(shop.Position));
                if (bestmin != null)
                {
                    Spells[E].Cast(bestmin);
                }
            }
        }
Esempio n. 7
0
        internal void CastENew(AIHeroClient target)
        {
            if (!SpellSlot.E.IsReady() || Yasuo.IsDashing() || InDash)
            {
                return;
            }

            var minionsinrange = ObjectManager.Get <Obj_AI_Minion>().Any(x => x.IsDashable());

            if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range))
            {
                target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range,
                                                  TargetSelector.DamageType.Physical);
            }

            if (target != null && TowerCheck(target, true))
            {
                var dist          = Yasuo.Distance(target);
                var pctOutOfRange = dist / Yasuo.AttackRange * 100;

                if (pctOutOfRange > 0.8f)
                {
                    if (target.IsDashable())
                    {
                        if (target.ECanKill())
                        {
                            return;
                        }

                        if (TornadoReady && target.IsInRange(Spells[E].Range) && targInKnockupRadius(target))
                        {
                            Spells[E].CastOnUnit(target);
                        }

                        //Stay in range
                        else if (pctOutOfRange > 0.8f)
                        {
                            var bestminion = ObjectManager.Get <Obj_AI_Base>()
                                             .Where(x =>
                                                    x.IsDashable() &&
                                                    GetDashPos(x).IsCloser(target) && TowerCheck(x, true))
                                             .MinOrDefault(x => GetDashPos(x).Distance(target));

                            var shouldETarget = bestminion == null || GetDashPos(target).Distance(target) <
                                                GetDashPos(bestminion).Distance(target);
                            if (shouldETarget && GetDashPos(target).IsCloser(target))
                            {
                                Spells[E].CastOnUnit(target);
                            }

                            else if (bestminion != null)
                            {
                                Spells[E].CastOnUnit(bestminion);
                            }
                        }
                    }

                    else
                    {
                        var minion = ObjectManager.Get <Obj_AI_Minion>()
                                     .Where(x => x.IsDashable() && x.IsCloser(target) && TowerCheck(x, true))
                                     .MinOrDefault(x => GetDashPos(x).Distance(target));
                        if (minion != null)
                        {
                            Spells[E].CastOnUnit(minion);
                        }
                    }
                }
            }
        }
Esempio n. 8
0
        internal void CastE(AIHeroClient target)
        {
            if (!target.IsInRange(Spells[E].Range))
            {
                target = TargetSelector.GetTarget(Spells[E].Range, DamageType.Physical);
            }

            if (target != null)
            {
                if (SpellSlot.E.IsReady() && isHealthy && target.Distance(Yasuo) >= 0.30 * Yasuo.AttackRange)
                {
                    if (TornadoReady && ((GetBool("Combo.ETower", YasuoMenu.ComboM) && GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM)) || !GetDashPos(target).PointUnderEnemyTurret()))
                    {
                        Spells[E].CastOnUnit(target);
                        return;
                    }

                    if (DashCount >= 1 && GetDashPos(target).IsCloser(target) && target.IsDashable() &&
                        (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret()))
                    {
                        ETarget = target;
                        Spells[E].CastOnUnit(target);
                        return;
                    }

                    if (DashCount == 0)
                    {
                        var dist = Yasuo.Distance(target);

                        var bestminion =
                            ObjectManager.Get <Obj_AI_Base>()
                            .Where(
                                x =>
                                x.IsDashable() &&
                                GetDashPos(x).IsCloser(target) &&
                                (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret()))
                            .OrderBy(x => Vector2.Distance(GetDashPos(x), target.ServerPosition.To2D()))
                            .FirstOrDefault();
                        if (bestminion != null)
                        {
                            ETarget = bestminion;
                            Spells[E].CastOnUnit(bestminion);
                        }

                        else if (target.IsDashable() && GetDashPos(target).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret()))
                        {
                            ETarget = target;
                            Spells[E].CastOnUnit(target);
                        }
                    }


                    else
                    {
                        var minion =
                            ObjectManager.Get <Obj_AI_Base>()
                            .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret()))
                            .OrderBy(x => GetDashPos(x).Distance(target.ServerPosition)).FirstOrDefault();

                        if (minion != null && GetDashPos(minion).IsCloser(target))
                        {
                            ETarget = minion;
                            Spells[E].CastOnUnit(minion);
                        }
                    }
                }
            }
        }
Esempio n. 9
0
        private void Flee()
        {
            //Orbwalker.SetAttack(false);
            Orbwalker.DisableAttacking = true;
            if (YasuoMenu.getCheckBoxItem(YasuoMenu.Flee, "Flee.UseQ2") && !Yasuo.IsDashing() && SpellSlot.Q.IsReady() &&
                TornadoReady)
            {
                var qtarg = TargetSelector.GetTarget(Spells[Q2].Range, DamageType.Physical);
                if (qtarg != null)
                {
                    Spells[Q2].Cast(qtarg.ServerPosition);
                }
            }

            if (FleeMode == FleeType.ToCursor)
            {
                Orbwalker.OrbwalkTo(Game.CursorPos);

                if (Spells[E].IsReady())
                {
                    var dashtarg =
                        ObjectManager.Get <Obj_AI_Base>()
                        .Where(x => x.IsDashable())
                        .MinOrDefault(x => GetDashPos(x).Distance(Game.CursorPos));

                    if (dashtarg != null &&
                        GetDashPos(dashtarg).Distance(Game.CursorPos) < Yasuo.Distance(Game.CursorPos))
                    {
                        Spells[E].CastOnUnit(dashtarg);

                        if (YasuoMenu.getCheckBoxItem(YasuoMenu.Flee, "Flee.StackQ") && SpellSlot.Q.IsReady() &&
                            !TornadoReady)
                        {
                            Spells[Q].Cast(dashtarg.ServerPosition);
                        }
                    }
                }
            }

            if (FleeMode == FleeType.ToNexus)
            {
                var nexus = ObjectManager.Get <Obj_Shop>().FirstOrDefault(x => x.IsAlly);
                if (nexus != null)
                {
                    Orbwalker.OrbwalkTo(nexus.Position);
                    var bestminion =
                        ObjectManager.Get <Obj_AI_Base>()
                        .Where(x => x.IsDashable())
                        .MinOrDefault(x => GetDashPos(x).Distance(nexus.Position));
                    if (bestminion != null &&
                        GetDashPos(bestminion).Distance(nexus.Position) < Yasuo.Distance(nexus.Position))
                    {
                        Spells[E].CastOnUnit(bestminion);
                        if (YasuoMenu.getCheckBoxItem(YasuoMenu.Flee, "Flee.StackQ") && SpellSlot.Q.IsReady() &&
                            !TornadoReady)
                        {
                            Spells[Q].Cast(bestminion.ServerPosition);
                        }
                    }
                }
            }

            if (FleeMode == FleeType.ToAllies)
            {
                Obj_AI_Base bestally =
                    HeroManager.Allies.Where(x => !x.IsMe && x.CountEnemiesInRange(300) == 0)
                    .MinOrDefault(x => x.Distance(Yasuo)) ?? (Obj_AI_Base)ObjectManager.Get <Obj_AI_Minion>()
                    .Where(x => x.IsValidAlly(3000))
                    .MinOrDefault(x => x.Distance(Yasuo));

                if (bestally != null)
                {
                    Orbwalker.OrbwalkTo(bestally.ServerPosition);
                    if (Spells[E].IsReady())
                    {
                        var besttarget =
                            ObjectManager.Get <Obj_AI_Base>()
                            .Where(x => x.IsDashable())
                            .MinOrDefault(x => GetDashPos(x).Distance(bestally.ServerPosition));
                        if (besttarget != null)
                        {
                            Spells[E].CastOnUnit(besttarget);
                            if (YasuoMenu.getCheckBoxItem(YasuoMenu.Flee, "Flee.StackQ") && SpellSlot.Q.IsReady() &&
                                !TornadoReady)
                            {
                                Spells[Q].Cast(besttarget.ServerPosition);
                            }
                        }
                    }
                }

                else
                {
                    var nexus = ObjectManager.Get <Obj_Shop>().FirstOrDefault(x => x.IsAlly);
                    if (nexus != null)
                    {
                        Orbwalker.OrbwalkTo(nexus.Position);
                        var bestminion =
                            ObjectManager.Get <Obj_AI_Base>()
                            .Where(x => x.IsDashable())
                            .MinOrDefault(x => GetDashPos(x).Distance(nexus.Position));
                        if (bestminion != null &&
                            GetDashPos(bestminion).Distance(nexus.Position) < Yasuo.Distance(nexus.Position))
                        {
                            Spells[E].CastOnUnit(bestminion);
                        }
                    }
                }
            }
        }
Esempio n. 10
0
        internal void CastENew(Obj_AI_Hero target)
        {
            if (!SpellSlot.E.IsReady() || Yasuo.IsDashing() || InDash)
            {
                return;
            }

            var minionsinrange = ObjectManager.Get <Obj_AI_Minion>().Any(x => x.IsDashable());

            if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range))
            {
                target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range,
                                                  TargetSelector.DamageType.Physical);
            }

            if (target != null && TowerCheck(target, true))
            {
                if (!target.IsDashable())
                {
                    var bestminion = ObjectManager.Get <Obj_AI_Base>()
                                     .Where(x =>
                                            x.IsDashable() &&
                                            GetDashPos(x).IsCloser(target) && TowerCheck(x, true))
                                     .MinOrDefault(x => GetDashPos(x).Distance(target));

                    if (bestminion != null)
                    {
                        Spells[E].CastOnUnit(bestminion);
                        return;
                    }
                }

                else
                {
                    var dist          = Yasuo.Distance(target);
                    var pctOutOfRange = dist / Spells[E].Range * 100;

                    //Stay in range
                    if (pctOutOfRange > 0.8f)
                    {
                        if (TornadoReady && target.IsDashable() && targInKnockupRadius(target))
                        {
                            Spells[E].CastOnUnit(target);
                        }
                        else
                        {
                            var bestminion = ObjectManager.Get <Obj_AI_Base>()
                                             .Where(x =>
                                                    x.IsDashable() &&
                                                    GetDashPos(x).IsCloser(target) && TowerCheck(x, true))
                                             .MinOrDefault(x => GetDashPos(x).Distance(target));

                            if (bestminion != null)
                            {
                                Spells[E].CastOnUnit(bestminion);
                            }

                            else if (target.IsDashable() && GetDashPos(target).IsCloser(target))
                            {
                                Spells[E].CastOnUnit(target);
                            }
                        }
                    }

                    //Catch up using a minion
                    else if (pctOutOfRange > 1)
                    {
                        var minion =
                            ObjectManager.Get <Obj_AI_Minion>()
                            .Where(x => x.IsDashable() && x.IsCloser(target) && TowerCheck(x, true))
                            .MinOrDefault(x => GetDashPos(x).Distance(target));
                        if (minion != null)
                        {
                            Spells[E].CastOnUnit(target);
                        }
                    }

                    //Go for a EQ if target is well within range
                    else
                    {
                        if (Spells[Q].IsReady() && TornadoReady)
                        {
                            if (targInKnockupRadius(target))
                            {
                                Spells[E].CastOnUnit(target);
                                return;
                            }
                        }


                        if (DashCount == 0)
                        {
                            var bestminion =
                                ObjectManager.Get <Obj_AI_Base>()
                                .Where(
                                    x =>
                                    x.IsDashable() &&
                                    GetDashPos(x).IsCloser(target) && TowerCheck(x, true))
                                .MinOrDefault(x => GetDashPos(x).Distance(target));

                            if (bestminion != null)
                            {
                                Spells[E].CastOnUnit(bestminion);
                            }

                            else if (target.IsDashable() && GetDashPos(target).IsCloser(target) &&
                                     TowerCheck(target, true))
                            {
                                Spells[E].CastOnUnit(target);
                            }
                        }
                    }
                }
            }
        }