Beispiel #1
0
 private bool RLogic(Obj_AI_Hero target,
                     HitChance hitChance,
                     int min,
                     bool q,
                     bool e,
                     UltimateModeType mode = UltimateModeType.Combo)
 {
     try
     {
         if (Q.IsCharging || target == null)
         {
             return(false);
         }
         var pred = R.GetPrediction(target);
         if (pred.Hitchance >= hitChance)
         {
             var hits = GameObjects.EnemyHeroes.Where(x => x.Distance(target) <= _rSpreadRadius).ToList();
             if (UltimateManager.Check(mode, min, hits, hero => CalcComboDamage(hero, q, e, true)))
             {
                 R.Cast(pred.CastPosition);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #2
0
 private bool RLogic(Obj_AI_Hero target, int min, bool q, bool e, bool simulated = false, string mode = "combo")
 {
     try
     {
         if (!R.Instance.Name.Equals("ViktorChaosStorm", StringComparison.OrdinalIgnoreCase))
         {
             return(false);
         }
         var pred = CPrediction.Circle(R, target, HitChance.High, false);
         if (pred.TotalHits > 0 &&
             UltimateManager.Check(mode, min, pred.Hits, hero => CalcComboDamage(hero, q, e, true)))
         {
             if (!simulated)
             {
                 R.Cast(pred.CastPosition);
                 var aaTarget =
                     TargetSelector.GetTargets(Player.AttackRange + Player.BoundingRadius * 3f)
                     .FirstOrDefault(Orbwalking.InAutoAttackRange);
                 if (aaTarget != null)
                 {
                     Player.IssueOrder(GameObjectOrder.AttackUnit, aaTarget);
                 }
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #3
0
 private bool RLogic(UltimateModeType mode, HitChance hitChance, Obj_AI_Hero target)
 {
     try
     {
         if (Q.IsCharging || target == null || !_ultimate.IsActive(mode))
         {
             return(false);
         }
         var pred = R.GetPrediction(target);
         if (pred.Hitchance >= hitChance)
         {
             var hits = GameObjects.EnemyHeroes.Where(x => x.Distance(target) <= _rSpreadRadius).ToList();
             if (_ultimate.Check(mode, hits))
             {
                 R.Cast(pred.CastPosition);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #4
0
 private bool RLogic(HitChance hitChance,
                     int min,
                     bool q,
                     bool w,
                     bool e,
                     UltimateModeType mode = UltimateModeType.Combo)
 {
     try
     {
         foreach (var target in Targets.Where(t => R.CanCast(t)))
         {
             var pred = R.GetPrediction(target, true);
             if (pred.Hitchance >= hitChance)
             {
                 var hits = GameObjects.EnemyHeroes.Where(enemy => R.WillHit(enemy, pred.CastPosition)).ToList();
                 if (UltimateManager.Check(mode, min, hits, hero => CalcComboDamage(hero, q, w, e, true)))
                 {
                     R.Cast(pred.CastPosition);
                     return(true);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #5
0
 private bool RLogic(Obj_AI_Hero target, int min, bool q, UltimateModeType mode = UltimateModeType.Combo)
 {
     try
     {
         var hits = GetRHits(target);
         if (UltimateManager.Check(mode, min, hits.Item2, hero => CalcComboDamage(hero, q, true)))
         {
             R.Cast(hits.Item3);
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #6
0
 private bool RLogic(Obj_AI_Hero target, int min, bool q, bool e, UltimateModeType mode = UltimateModeType.Combo)
 {
     try
     {
         var pred = CPrediction.Circle(R, target, HitChance.High, false);
         if (pred.TotalHits > 0 &&
             UltimateManager.Check(mode, min, pred.Hits, hero => CalcComboDamage(hero, q, e, true)))
         {
             R.Cast(pred.CastPosition);
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #7
0
 private bool RLogic(UltimateModeType mode, Obj_AI_Hero target)
 {
     try
     {
         if (_ultimate.IsActive(mode))
         {
             var pred = CPrediction.Circle(R, target, HitChance.High, false);
             if (pred.TotalHits > 0 && _ultimate.Check(mode, pred.Hits))
             {
                 R.Cast(pred.CastPosition);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #8
0
 private bool RLogic(UltimateModeType mode, Obj_AI_Hero target)
 {
     try
     {
         if (_ultimate.IsActive(mode))
         {
             var hits = GetRHits(target);
             if (_ultimate.Check(mode, hits.Item2))
             {
                 R.Cast(hits.Item3);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(false);
 }
Beispiel #9
0
        /// <summary>
        /// Attempts to cast the ultimate on a group of targets
        /// </summary>
        /// <param name="mode"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        private bool CastUltimate(UltimateModeType mode, Obj_AI_Hero target)
        {
            try
            {
                if (!_ultimateManager.IsActive(mode))
                {
                    return(false);
                }

                var hits = GetUltimateExplosionHits(target);
                if (_ultimateManager.Check(mode, hits.Item2))
                {
                    R.Cast(hits.Item3);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }

            return(false);
        }
        protected override void OnPostUpdate()
        {
            if (_ultimate.IsActive(UltimateModeType.Flash) && R.IsReady() && SummonerManager.Flash.IsReady())
            {
                if (_ultimate.ShouldMove(UltimateModeType.Flash))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }
                var targets =
                    Targets.Where(
                        t =>
                        t.Distance(Player) < (R.Range + R.Width + SummonerManager.Flash.Range) * 1.5f &&
                        !t.IsDashing() &&
                        (t.IsFacing(Player)
                                ? (t.Distance(Player))
                                : (R.GetPrediction(t).UnitPosition.Distance(Player.Position))) > R.Range);
                var backwards = Menu.Item(Menu.Name + ".ultimate.backwards").GetValue <bool>();
                foreach (var target in targets)
                {
                    var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range);
                    var maxHits  = GetMaxRHits(HitChance.High, flashPos);
                    if (maxHits.Item1.Count > 0)
                    {
                        var castPos = backwards
                            ? Player.Position.Extend(maxHits.Item2, -(Player.Position.Distance(maxHits.Item2) * 2))
                            : Player.Position.Extend(maxHits.Item2, Player.Position.Distance(maxHits.Item2));
                        if (_ultimate.Check(UltimateModeType.Flash, maxHits.Item1))
                        {
                            if (R.Cast(castPos))
                            {
                                Utility.DelayAction.Add(
                                    300 + (Game.Ping / 2), () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                        else if (_ultimate.ShouldSingle(UltimateModeType.Flash))
                        {
                            if (
                                maxHits.Item1.Where(hit => _ultimate.CheckSingle(UltimateModeType.Flash, hit))
                                .Any(hit => R.Cast(castPos)))
                            {
                                Utility.DelayAction.Add(
                                    300 + (Game.Ping / 2), () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                    }
                }
            }

            if (_ultimate.IsActive(UltimateModeType.Assisted) && R.IsReady())
            {
                if (_ultimate.ShouldMove(UltimateModeType.Assisted))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }

                if (!RLogic(UltimateModeType.Assisted, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Assisted, R.GetHitChance("combo"), false);
                }
            }

            if (_ultimate.IsActive(UltimateModeType.Auto) && R.IsReady())
            {
                if (!RLogic(UltimateModeType.Auto, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Auto, R.GetHitChance("combo"));
                }
            }

            if (HeroListManager.Enabled("w-immobile") && W.IsReady())
            {
                var target =
                    Targets.FirstOrDefault(
                        t =>
                        HeroListManager.Check("w-immobile", t) && BestTargetOnlyManager.Check("w-immobile", W, t) &&
                        Utils.IsImmobile(t));
                if (target != null)
                {
                    Casting.SkillShot(target, W, HitChance.High);
                }
            }
        }
Beispiel #11
0
        private void OnCorePostUpdate(EventArgs args)
        {
            try
            {
                if (UltimateManager.Flash() && R.IsReady() && SummonerManager.Flash.IsReady())
                {
                    if (Menu.Item(Menu.Name + ".ultimate.flash.move-cursor").GetValue <bool>())
                    {
                        Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                    }
                    var targets =
                        Targets.Where(
                            t =>
                            t.Distance(Player) < R.Range + SummonerManager.Flash.Range && !t.IsDashing() &&
                            (t.IsFacing(Player)
                                    ? (t.Distance(Player))
                                    : (Prediction.GetPrediction(t, R.Delay + 0.3f)
                                       .UnitPosition.Distance(Player.Position))) > R.Range * 1.025f);
                    foreach (var target in targets)
                    {
                        var min      = Menu.Item(Menu.Name + ".ultimate.flash.min").GetValue <Slider>().Value;
                        var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range);
                        var pred     =
                            Prediction.GetPrediction(
                                new PredictionInput
                        {
                            Aoe              = true,
                            Collision        = false,
                            CollisionObjects = new[] { CollisionableObjects.YasuoWall },
                            From             = flashPos,
                            RangeCheckFrom   = flashPos,
                            Delay            = R.Delay + 0.3f,
                            Range            = R.Range,
                            Speed            = R.Speed,
                            Radius           = R.Width,
                            Type             = R.Type,
                            Unit             = target
                        });
                        if (pred.Hitchance >= R.GetHitChance("combo"))
                        {
                            R.UpdateSourcePosition(flashPos, flashPos);
                            var hits =
                                GameObjects.EnemyHeroes.Where(enemy => R.WillHit(enemy, pred.CastPosition)).ToList();
                            if (UltimateManager.Check(
                                    "combo", min, hits,
                                    hero =>
                                    CalcComboDamage(
                                        hero, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true)))
                            {
                                if (
                                    R.Cast(
                                        Player.Position.Extend(
                                            pred.CastPosition, -(Player.Position.Distance(pred.CastPosition) * 2)), true))
                                {
                                    Utility.DelayAction.Add(300, () => SummonerManager.Flash.Cast(flashPos));
                                }
                            }
                            else if (Menu.Item(Menu.Name + ".ultimate.flash.duel").GetValue <bool>())
                            {
                                if (UltimateManager.Check(
                                        "combo", 1, hits,
                                        hero =>
                                        CalcComboDamage(
                                            hero, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true)))
                                {
                                    var cDmg = CalcComboDamage(
                                        target, Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                        Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), true);
                                    if (cDmg - 20 >= target.Health)
                                    {
                                        if (
                                            R.Cast(
                                                Player.Position.Extend(
                                                    pred.CastPosition,
                                                    -(Player.Position.Distance(pred.CastPosition) * 2)), true))
                                        {
                                            Utility.DelayAction.Add(300, () => SummonerManager.Flash.Cast(flashPos));
                                        }
                                    }
                                }
                            }
                            R.UpdateSourcePosition();
                        }
                    }
                }

                if (UltimateManager.Assisted() && R.IsReady())
                {
                    if (Menu.Item(Menu.Name + ".ultimate.assisted.move-cursor").GetValue <bool>())
                    {
                        Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                    }

                    if (
                        !RLogic(
                            R.GetHitChance("combo"),
                            Menu.Item(Menu.Name + ".ultimate.assisted.min").GetValue <Slider>().Value,
                            Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady()))
                    {
                        if (Menu.Item(Menu.Name + ".ultimate.assisted.duel").GetValue <bool>())
                        {
                            RLogicDuel(
                                R.GetHitChance("combo"),
                                Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), false);
                        }
                    }
                }

                if (UltimateManager.Auto() && R.IsReady())
                {
                    if (
                        !RLogic(
                            R.GetHitChance("combo"),
                            Menu.Item(Menu.Name + ".ultimate.auto.min").GetValue <Slider>().Value,
                            Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                            Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                            Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady(), "auto"))
                    {
                        if (Menu.Item(Menu.Name + ".ultimate.auto.duel").GetValue <bool>())
                        {
                            RLogicDuel(
                                R.GetHitChance("combo"),
                                Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady(),
                                Menu.Item(Menu.Name + ".combo.w").GetValue <bool>() && W.IsReady(),
                                Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady());
                        }
                    }
                }

                if (HeroListManager.Enabled("w-stunned") && W.IsReady())
                {
                    var target = Targets.FirstOrDefault(
                        t => HeroListManager.Check("w-stunned", t) && Utils.IsStunned(t));
                    if (target != null)
                    {
                        Casting.SkillShot(target, W, W.GetHitChance("harass"));
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }