예제 #1
0
        public static void OnInterruptableSpell(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (sender.IsMe || sender.IsAlly || !Config.IsChecked("intr.bR"))
            {
                return;
            }

            switch (Config.GetStringListValue("dangerL"))
            {
            case 0:
                wanteDangerLevel = Interrupter2.DangerLevel.Low;
                break;

            case 1:
                wanteDangerLevel = Interrupter2.DangerLevel.Medium;
                break;

            case 2:
                wanteDangerLevel = Interrupter2.DangerLevel.High;
                break;

            default:
                wanteDangerLevel = Interrupter2.DangerLevel.High;
                break;
            }

            if (Spells.R.CanCast() && sender.IsValidTarget(Spells.R.Range) && args.DangerLevel == wanteDangerLevel)
            {
                var delay = Computed.RDelay.Next(100, 120);
                LeagueSharp.Common.Utility.DelayAction.Add(delay, () => Spells.R.Cast(sender));
            }
        }
예제 #2
0
        public static void OnInterruptableSpell(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (sender.IsMe || sender.IsAlly || !Config.IsChecked("interrupt.r"))
            {
                return;
            }

            switch (Config.GetStringListValue("interrupt.danger"))
            {
            case 0:
                wanteDangerLevel = Interrupter2.DangerLevel.Low;
                break;

            case 1:
                wanteDangerLevel = Interrupter2.DangerLevel.Medium;
                break;

            case 2:
                wanteDangerLevel = Interrupter2.DangerLevel.High;
                break;

            default:
                wanteDangerLevel = Interrupter2.DangerLevel.High;
                break;
            }

            if (Spells.R.IsReady() && sender.IsValidTarget(Spells.R.Range) && args.DangerLevel == wanteDangerLevel)
            {
                Spells.R.Cast();
            }
        }
예제 #3
0
        /// <summary>
        ///     Called when [load].
        /// </summary>
        protected override void OnLoad(object sender, FeatureBaseEventArgs eventArgs)
        {
            base.OnLoad(sender, eventArgs);

            // Gets all values as Type[]
            var values = Enum.GetValues(typeof(Interrupter2.DangerLevel));

            // Converts Type[] to string[]
            var stringList = (from object value in values select value.ToString()).ToArray();

            // Puts all values into the Menu
            var minValue =
                this.Menu.AddItem(
                    new MenuItem(this.Path + "." + "minvalue", "Minimal Danger Value").SetValue(
                        new StringList(stringList, (int)Interrupter2.DangerLevel.Medium)));

            minValue.ValueChanged +=
                (o, args) =>
            {
                this.dangerlevel = (Interrupter2.DangerLevel)args.GetNewValue <StringList>().SelectedIndex;
            };

            this.dangerlevel = (Interrupter2.DangerLevel)minValue.GetValue <StringList>().SelectedIndex;
        }