Beispiel #1
0
        public void Game_OnGameUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (Config.spellRMenu["ylm.spellr.auto"].Cast <CheckBox>().CurrentValue)
            {
                LastBreath.AutoUltimate();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                Combo();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                Harass();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                LastHit();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) | Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
            {
                Clear();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee))
            {
                Escape();
            }
        }
Beispiel #2
0
 public static void OnAfterPicked(int actId)
 {
     if (autoLock && champIds.Count == 0)
     {
         LastBreath.LockChamp(actId);
     }
 }
Beispiel #3
0
 public static void OnMatchFound()
 {
     if (autoAccept)
     {
         LastBreath.AcceptMatch();
     }
 }
Beispiel #4
0
        public void Combo()
        {
            if (doingEQCombo)
            {
                if (ObjectManager.Player.IsDashing() &&
                    SteelTempest.Q.IsReady() && SteelTempest.Empowered &&
                    ObjectManager.Player.CountEnemyChampionsInRange(250) > 0)
                {
                    SteelTempest.QDash.Cast();
                    doingEQCombo = false;
                }
                if (doingEQCombo)
                {
                    return;
                }
            }
            var comboTarget = TargetSelector.GetTarget(LastBreath.R.Range, DamageType.Physical);

            if (comboTarget != null && comboTarget.IsValid)
            {
                if (YasuoUtils.DecideKnockup(comboTarget))
                {
                    var bestUnit = YasuoUtils.BestQDashKnockupUnit();
                    if (bestUnit != null)
                    {
                        doingEQCombo = true;
                        SweepingBlade.E.Cast(bestUnit);
                        Core.DelayAction(() => { doingEQCombo = false; }, 100);
                    }
                }
                else
                {
                    SweepingBlade.GapClose(comboTarget);
                }
            }
            else
            {
                SweepingBlade.GapClose();
                return;
            }

            var targetDistance = comboTarget.Distance(ObjectManager.Player, true);

            if (Config.comboMenu["ylm.combo.useq"].Cast <CheckBox>().CurrentValue&& SteelTempest.Q.IsReady() &&
                targetDistance <= SteelTempest.Q.RangeSquared)
            {
                SteelTempest.Q.Cast(comboTarget);
            }

            if (Config.comboMenu["ylm.combo.useq3"].Cast <CheckBox>().CurrentValue&& SteelTempest.Empowered && SteelTempest.Q.IsReady() &&
                targetDistance <= SteelTempest.QEmp.RangeSquared)
            {
                SteelTempest.QEmp.Cast(comboTarget);
            }
            if (Config.comboMenu["ylm.combo.user"].Cast <CheckBox>().CurrentValue&& LastBreath.ShouldUlt(comboTarget))
            {
                LastBreath.CastR(comboTarget);
            }
            //TODO: Items
        }
Beispiel #5
0
        /// <summary>
        ///     Gets all executions around a execution that are in range of lastbreath
        /// </summary>
        /// <param name="execution">
        ///     LastBreath execution object
        /// </param>
        /// <returns></returns>
        public List <LastBreath> GetExecutionsAround(LastBreath execution)
        {
            var result = new List <LastBreath>();

            foreach (var target in execution.AffectedEnemies)
            {
                result.Add(new LastBreath(target));
            }

            return(result);
        }
Beispiel #6
0
 public static void OnChampSelect(int actId)
 {
     if (champIds.Count > 0)
     {
         foreach (var champ in champIds)
         {
             if (LastBreath.PickChamp(actId, champ.id))
             {
                 break;
             }
         }
         if (autoLock)
         {
             LastBreath.LockChamp(actId);
         }
     }
 }
Beispiel #7
0
        // TODO
        /// <summary>
        ///     Returns a bool that determines if it is a good time to use lastbreath or not
        /// </summary>
        /// <param name="execution">The current target</param>
        /// <param name="pathBase">The PathBase to the target</param>
        /// <param name="buffer">a time buffer</param>
        /// <returns></returns>
        public bool ShouldCastNow(LastBreath execution, YasuoPath <Point, ConnectionBase <Point> > pathBase = null, int buffer = 10)
        {
            if (execution == null)
            {
                return(false);
            }

            // Last possible second ultimate
            if (execution.MinRemainingAirboneTime <= 1 + buffer + Game.Ping)
            {
                return(true);
            }

            // if no PathBase is given
            if (pathBase == null)
            {
                var playerpath     = GlobalVariables.Player.GetPath(execution.Target.ServerPosition);
                var playerpathtime = Math.GetPathLenght(playerpath) / GlobalVariables.Player.MoveSpeed;

                // if walking is requires less time than remaining knockup time
                if (playerpathtime <= execution.MinRemainingAirboneTime + buffer + Game.Ping)
                {
                    return(false);
                }

                // Instant Ult in 1 v 1 because armor pen and less time for enemiy to get spells up also you can't gapclose
                if (execution.EndPosition.CountEnemiesInRange(1500) == 0 && !execution.Target.InAutoAttackRange())
                {
                    return(true);
                }
            }

            // if a PathBase is given and the PathBase time is shorter than the knockup time
            else
            {
                if (pathBase.PathCost <= execution.MinRemainingAirboneTime + buffer + Game.Ping)
                {
                    return(false);
                }
            }

            return(execution.MinRemainingAirboneTime <= Game.Ping + buffer);
        }
Beispiel #8
0
        public void Game_OnGameUpdate(EventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (Config.Param <bool>("ylm.spellr.auto"))
            {
                LastBreath.AutoUltimate();
            }

            switch (Config.Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

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

            case Orbwalking.OrbwalkingMode.LastHit:
                LastHit();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Clear();
                break;

            case Orbwalking.OrbwalkingMode.CustomMode:
                if (Config.Param <KeyBind>("ylm.orbwalker.escape").Active)
                {
                    Escape();
                }
                break;
            }
        }
Beispiel #9
0
    static void Main()
    {
#if DEBUG
        AllocConsole();
#endif
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
        {
            WindowsPrincipal principal = new WindowsPrincipal(identity);
            if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
            {
                MessageBox.Show("Please reopen program as an Administrator!",
                                "Yasharp", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }

        LastBreath.Intend();
        LastBreath.Resolve();

        if (!LastBreath.IsConnected)
        {
            MessageBox.Show("Could not connect to League, the application will be closed!",
                            "Yasharp", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        else
        {
            Task.Run(() => MessageBox.Show("Successfully connected to League!\n" +
                                           "Please goto chat box and type /help or /?.\n\n" +
                                           "Notice: creating a new dummy club is recommended.",
                                           "Yasharp", MessageBoxButtons.OK, MessageBoxIcon.Information));

            Application.Run();
        }
    }
Beispiel #10
0
    public static void OnCommand(string cmd, string[] args)
    {
        if (cmd.Equals("lang"))
        {
            if (args.Length > 0)
            {
                SetLanguage(args[0]);
                Send(msgLangChanged);
            }
        }
        else if (cmd.Equals("help"))
        {
            Send(msgHelp);
        }
        else if (cmd.Equals("?"))
        {
            if (args.Length == 0)
            {
                Send(msgHelp);
            }
            else
            {
                cmd = args[0].Replace("/", "");
                ShowHelp(cmd);
            }
        }
        else if (cmd.Equals("exit") || cmd.Equals("q"))
        {
            Send(msgExited);
            LastBreath.Quit();
        }
        else if (cmd.Equals("auto"))
        {
            if (args.Length == 0)
            {
                autoAccept = !autoAccept;
            }
            else if (args[0].Equals("on"))
            {
                autoAccept = true;
            }
            else if (args[0].Equals("off"))
            {
                autoAccept = false;
            }

            Send(autoAccept ? msgAutoAcceptIsOn : msgAutoAcceptIsOff);
        }
        else if (cmd.Equals("lock"))
        {
            if (args.Length == 0)
            {
                autoLock = !autoLock;
            }
            else if (args[0].Equals("on"))
            {
                autoLock = true;
            }
            else if (args[0].Equals("off"))
            {
                autoLock = false;
            }

            Send(autoLock ? msgAutoLockIsOn : msgAutoLockIsOff);
        }
        else if (cmd.Equals("pick"))
        {
            champIds.Clear();

            if (args.Length > 0)
            {
                var champs = LastBreath.GetPlayableChamps();
                foreach (var _n in args)
                {
                    var name  = DecodeName(_n);
                    var champ = GetChampFromList(champs, name);
                    if (champ != null)
                    {
                        champIds.Add(champ);
                        Send(msgChampOK + champ.name + ".");
                    }
                    else
                    {
                        Send(msgChampNotFound + $"'{_n}'.");
                    }
                }
            }
        }
        else if (cmd.Equals("status") || cmd.Equals("stt"))
        {
            string stt = (autoAccept ? msgAutoAcceptIsOn : msgAutoAcceptIsOff);
            stt += "\\n" + (autoLock ? msgAutoLockIsOn : msgAutoLockIsOff);

            foreach (var champ in champIds)
            {
                stt += "\\n" + (msgChampOK + champ.name + ".");
            }

            Send(stt);
        }
        else
        {
            Send(msgUnknow);
        }
    }
Beispiel #11
0
 private static void Send(string msg = "")
 {
     LastBreath.Echo($"[Bot] {msg}");
 }
Beispiel #12
0
        public void Combo()
        {
            if (doingEQCombo)
            {
                if (ObjectManager.Player.IsDashing() &&
                    SteelTempest.Q.IsReady() && SteelTempest.Empowered &&
                    ObjectManager.Player.CountEnemiesInRange(250) > 0)
                {
                    SteelTempest.QDash.Cast();
                    doingEQCombo = false;
                }
                if (doingEQCombo)
                {
                    return;
                }
            }
            var comboTarget = TargetSelector.GetTarget(LastBreath.R.Range, TargetSelector.DamageType.Physical);

            if (comboTarget != null && comboTarget.IsValid)
            {
                if (YasuoUtils.DecideKnockup(comboTarget))
                {
                    var bestUnit = YasuoUtils.BestQDashKnockupUnit();
                    if (bestUnit != null)
                    {
                        doingEQCombo = true;
                        SweepingBlade.E.Cast(bestUnit);
                        LeagueSharp.Common.Utility.DelayAction.Add(100, () => { doingEQCombo = false; });
                    }
                }
                else
                {
                    SweepingBlade.GapClose(comboTarget);
                }
            }
            else
            {
                SweepingBlade.GapClose();
                return;
            }

            var targetDistance = comboTarget.Distance(ObjectManager.Player, true);

            if (Config.Param <bool>("ylm.combo.useq") && SteelTempest.Q.IsReady() &&
                targetDistance <= SteelTempest.Q.RangeSqr)
            {
                SteelTempest.Q.Cast(comboTarget);
            }

            if (Config.Param <bool>("ylm.combo.useq3") && SteelTempest.Empowered && SteelTempest.Q.IsReady() &&
                targetDistance <= SteelTempest.QEmp.RangeSqr)
            {
                SteelTempest.QEmp.Cast(comboTarget);
            }

            if (Config.Param <bool>("ylm.combo.user") && LastBreath.ShouldUlt(comboTarget))
            {
                LastBreath.CastR(comboTarget);
            }
            //TODO: Items
        }