Exemple #1
0
        public static void Initialize()
        {
            #region Initialize Menu
            Config  = EloBuddy.SDK.Menu.MainMenu.AddMenu("SexsiPredictioner", "sexsipredictioner");
            Combo   = Config.Add("COMBOKEY", new KeyBind("Combo", false, KeyBind.BindTypes.HoldActive, 32));
            Harass  = Config.Add("HARASSKEY", new KeyBind("Harass", false, KeyBind.BindTypes.HoldActive, 'C'));
            Enabled = Config.Add("ENABLED", new EloBuddy.SDK.Menu.Values.CheckBox("Enabled"));

            #region Initialize Spells
            skillshots = Config.AddSubMenu("Skillshots", "spredskillshots");
            foreach (var spell in Spells2 /*SpellDatabase.Spells*/)
            {
                if (spell.ChampionName == ObjectManager.Player.CharData.BaseSkinName)
                {
                    Spells[(int)spell.Slot] = new Spell(spell.Slot, spell.Range);
                    Spells[(int)spell.Slot].SetSkillshot(spell.Delay / 1000f, spell.Radius, spell.MissileSpeed, spell.CollisionObjects.Any(), spell.SpellType);//Collisionable, spell.SpellType);
                    skillshots.Add(String.Format("{0}{1}", spell.ChampionName, spell.Slot), new EloBuddy.SDK.Menu.Values.CheckBox("Convert Spell " + spell.Slot.ToString(), true));
                }
            }
            #endregion


            Hitc = Config.Add("Hitchancex", new EloBuddy.SDK.Menu.Values.ComboBox("Hit Chance", 1, Utility.HitchanceNameArray));
            #endregion

            #region Initialize Events
            Spellbook.OnCastSpell   += Spellbook_OnCastSpell;
            Obj_AI_Base.OnSpellCast += AIHeroClient_OnProcessSpellCast;
            #endregion
        }
Exemple #2
0
        public Tracker(Menu mainMenu)
        {
            menu = mainMenu;

            recallTrackerMenu = menu.AddSubMenu("Recall Tracker", "recalltrackermenu");
            recallTrackerMenu.AddGroupLabel("Recall Tracker");

            recallTrackerMenu.Add("xposition", new Slider("X Position", (int)Math.Round(Screen.PrimaryScreen.Bounds.Width * 0.4083333333333333d), 0, Screen.PrimaryScreen.Bounds.Width));
            recallTrackerMenu.Add("yposition", new Slider("Y Position", (int)Math.Round(Screen.PrimaryScreen.Bounds.Height * 0.6953703703703704d), 0, Screen.PrimaryScreen.Bounds.Height));
            recallTrackerMenu.Add("opacity", new Slider("Opacity", 70));
            recallTrackerMenu.AddSeparator(1);
            CheckBox reset = recallTrackerMenu.Add("resetxy", new CheckBox("Reset X/Y to 100", false));

            reset.OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    recallTrackerMenu["xposition"].Cast <Slider>().CurrentValue = 100;
                    recallTrackerMenu["yposition"].Cast <Slider>().CurrentValue = 100;
                    Core.DelayAction(() => reset.CurrentValue = false, 200);
                }
            };

            CheckBox reset2 = recallTrackerMenu.Add("resetoriginal", new CheckBox("Reset X/Y to default", false));

            reset2.OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    recallTrackerMenu["xposition"].Cast <Slider>().CurrentValue = (int)Math.Round(Screen.PrimaryScreen.Bounds.Width * 0.4083333333333333d);
                    recallTrackerMenu["yposition"].Cast <Slider>().CurrentValue = (int)Math.Round(Screen.PrimaryScreen.Bounds.Height * 0.6953703703703704d);
                    Core.DelayAction(() => reset2.CurrentValue = false, 200);
                }
            };

            Text = new Text("", new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold))
            {
                Color = Color.AntiqueWhite
            };

            Teleport.OnTeleport += Teleport_OnTeleport;
            Drawing.OnEndScene  += Drawing_OnEndScene;
            AppDomain.CurrentDomain.DomainUnload += OnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit  += OnDomainUnload;
        }
Exemple #3
0
            static InterrupterMenu()
            {
                var interrupterMenu = Menu.AddSubMenu("Interrupter");

                _enabled = interrupterMenu.Add("InterrupterEnabled", new CheckBox("Enable Interrupter"));
                interrupterMenu.AddSeparator();


                interrupterMenu.AddGroupLabel("Interruptible Spells !");
                interrupterMenu.AddSeparator(5);

                var intt = new Interrupter();

                foreach (
                    var data in
                    EntityManager.Heroes.Enemies.Where(x => Interrupter.Interruptible.ContainsKey(x.Hero))
                    .Select(x => Interrupter.Interruptible.FirstOrDefault(key => key.Key == x.Hero)))
                {
                    var dangerlevel = Interrupter.Interruptible.FirstOrDefault(pair => pair.Key == data.Key);

                    interrupterMenu.AddGroupLabel(data.Key + " " + data.Value.SpellSlot);

                    interrupterMenu.Add("Enabled." + data.Key, new CheckBox("Enabled")).OnValueChange +=
                        delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Enabled = args.NewValue;
                        }
                    };

                    interrupterMenu.Add("DangerLevel." + data.Key, new ComboBox("Danger Level", new[] { "High", "Medium", "Low" }, (int)dangerlevel.Value.DangerLevel)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        }
                    };

                    interrupterMenu.Add("PercentHP." + data.Key, new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.PercentHp = args.NewValue;
                        }
                    };

                    interrupterMenu.Add("EnemiesNear." + data.Key, new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.EnemiesNear = args.NewValue;
                        }
                    };

                    var rand = new Random();

                    interrupterMenu.Add("Delay." + data.Key, new Slider("Humanizer delay", rand.Next(15, 50), 0, 500)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Delay = args.NewValue;
                        }
                    };

                    interrupterMenu.AddSeparator(5);

                    InterrupterMenuValues.Add(new Interrupter.InterrupterMenuInfo
                    {
                        Champion    = data.Key,
                        SpellSlot   = data.Value.SpellSlot,
                        Delay       = interrupterMenu["Delay." + data.Key].Cast <Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)interrupterMenu["DangerLevel." + data.Key].Cast <ComboBox>().CurrentValue,
                        Enabled     = interrupterMenu["Enabled." + data.Key].Cast <CheckBox>().CurrentValue,
                        EnemiesNear = interrupterMenu["EnemiesNear." + data.Key].Cast <Slider>().CurrentValue,
                        PercentHp   = interrupterMenu["PercentHP." + data.Key].Cast <Slider>().CurrentValue
                    });

                    foundinterruptiblespells++;
                }
                if (foundinterruptiblespells == 0)
                {
                    interrupterMenu.AddGroupLabel("No interruptible spells found !");
                }
            }
Exemple #4
0
            static GapcloserMenu()
            {
                var gapcloserMenu = Menu.AddSubMenu("Anti-Gapcloser");

                _enabled = gapcloserMenu.Add("GapclosersEnabled", new CheckBox("Enable Anti-Gapcloser"));
                gapcloserMenu.AddSeparator(5);

                gapcloserMenu.AddGroupLabel("Enemy Gapclosers : ");
                gapcloserMenu.AddSeparator(5);

                foreach (
                    var data in
                    EntityManager.Heroes.Enemies.Where(x => Gapcloser.GapCloserList.Exists(k => k.ChampName == x.ChampionName) && x.Hero != Champion.Ziggs)
                    .Select(x => Gapcloser.GapCloserList.FirstOrDefault(key => key.ChampName == x.ChampionName)))
                {
                    var dangerlevel = Gapclosers.GapcloserDangerLevel.FirstOrDefault(pair => pair.Key == data.ChampName);

                    gapcloserMenu.AddGroupLabel(data.ChampName + " " + data.SpellSlot + " [" + data.SpellName + "]");

                    gapcloserMenu.Add("Enabled." + data.ChampName, new CheckBox("Enabled")).OnValueChange +=
                        delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Enabled = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("DangerLevel." + data.ChampName, new ComboBox("Danger Level", new[] { "High", "Medium", "Low" }, (int)dangerlevel.Value.DangerLevel)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP." + data.ChampName, new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.PercentHp = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("EnemiesNear." + data.ChampName, new Slider("Only if {0} or less enemies are near", dangerlevel.Value.EnemiesNear, 1, 5)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.EnemiesNear = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("Delay." + data.ChampName, new Slider("Humanizer delay", dangerlevel.Value.Delay, 0, 500)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Delay = args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion    = data.ChampName,
                        SpellSlot   = data.SpellSlot,
                        SpellName   = data.SpellName,
                        Delay       = gapcloserMenu["Delay." + data.ChampName].Cast <Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel." + data.ChampName].Cast <ComboBox>().CurrentValue,
                        Enabled     = gapcloserMenu["Enabled." + data.ChampName].Cast <CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear." + data.ChampName].Cast <Slider>().CurrentValue,
                        PercentHp   = gapcloserMenu["PercentHP." + data.ChampName].Cast <Slider>().CurrentValue
                    });
                    foundgapclosers++;
                }

                if (EntityManager.Heroes.Enemies.FirstOrDefault(x => x.Hero == Champion.Nidalee) != null)
                {
                    gapcloserMenu.AddGroupLabel("Nidalee W [Pounce]");

                    gapcloserMenu.Add("Enabled.Nidalee", new CheckBox("Enabled")).OnValueChange +=
                        delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Enabled = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("DangerLevel.Nidalee", new ComboBox("Danger Level", new[] { "High", "Medium", "Low" }, 1)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP.Nidalee", new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.PercentHp = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("EnemiesNear.Nidalee", new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.EnemiesNear = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("Delay.Nidalee", new Slider("Humanizer delay", 0, 0, 500)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Delay = args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion    = "Nidalee",
                        SpellName   = "pounce",
                        Delay       = gapcloserMenu["Delay.Nidalee"].Cast <Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel.Nidalee"].Cast <ComboBox>().CurrentValue,
                        Enabled     = gapcloserMenu["Enabled.Nidalee"].Cast <CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear.Nidalee"].Cast <Slider>().CurrentValue,
                        PercentHp   = gapcloserMenu["PercentHP.Nidalee"].Cast <Slider>().CurrentValue
                    });

                    foundgapclosers++;
                }

                if (EntityManager.Heroes.Enemies.FirstOrDefault(x => x.Hero == Champion.Rengar) != null)
                {
                    gapcloserMenu.AddGroupLabel("Rengar's passive [Leap]");

                    gapcloserMenu.Add("Enabled.Rengar", new CheckBox("Enabled")).OnValueChange +=
                        delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Enabled = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("DangerLevel.Rengar", new ComboBox("Danger Level", new[] { "High", "Medium", "Low" })).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP.Rengar", new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.PercentHp = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("EnemiesNear.Rengar", new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.EnemiesNear = args.NewValue;
                        }
                    };

                    gapcloserMenu.Add("Delay.Rengar", new Slider("Humanizer delay", 0, 0, 500)).OnValueChange +=
                        delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                    {
                        var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                        if (interrupterMenuInfo != null)
                        {
                            interrupterMenuInfo.Delay = args.NewValue;
                        }
                    };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion    = "Rengar",
                        SpellName   = "Rengar_LeapSound.troy",
                        Delay       = gapcloserMenu["Delay.Rengar"].Cast <Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel.Rengar"].Cast <ComboBox>().CurrentValue,
                        Enabled     = gapcloserMenu["Enabled.Rengar"].Cast <CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear.Rengar"].Cast <Slider>().CurrentValue,
                        PercentHp   = gapcloserMenu["PercentHP.Rengar"].Cast <Slider>().CurrentValue
                    });

                    foundgapclosers++;
                }

                if (foundgapclosers == 0)
                {
                    gapcloserMenu.AddGroupLabel("No gapclosers found !");
                }
            }
Exemple #5
0
            static InterrupterMenu()
            {
                var interrupterMenu = Menu.AddSubMenu("Interrupter");
                _enabled = interrupterMenu.Add("InterrupterEnabled", new CheckBox("Enable Interrupter"));
                interrupterMenu.AddSeparator();

                interrupterMenu.AddGroupLabel("Interruptible Spells !");
                interrupterMenu.AddSeparator(5);

                var intt = new Interrupter();

                foreach (
                    var data in
                        EntityManager.Heroes.Enemies.Where(x => Interrupter.Interruptible.ContainsKey(x.Hero))
                            .Select(x => Interrupter.Interruptible.FirstOrDefault(key => key.Key == x.Hero)))
                {
                    var dangerlevel = Interrupter.Interruptible.FirstOrDefault(pair => pair.Key == data.Key);

                    interrupterMenu.AddGroupLabel(data.Key + " " + data.Value.SpellSlot);

                    interrupterMenu.Add("Enabled." + data.Key, new CheckBox("Enabled")).OnValueChange +=
                        delegate(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Enabled = args.NewValue;
                        };

                    interrupterMenu.Add("DangerLevel." + data.Key, new ComboBox("Danger Level", new[] {"High", "Medium", "Low"}, (int) dangerlevel.Value.DangerLevel)).OnValueChange +=
                        delegate(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.DangerLevel = (DangerLevel) args.NewValue;
                        };

                    interrupterMenu.Add("PercentHP." + data.Key, new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.PercentHp = args.NewValue;
                        };

                    interrupterMenu.Add("EnemiesNear." + data.Key, new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.EnemiesNear = args.NewValue;
                        };

                    var rand = new Random();

                    interrupterMenu.Add("Delay." + data.Key, new Slider("Humanizer delay", rand.Next(15, 50), 0, 500)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = InterrupterMenuValues.FirstOrDefault(i => i.Champion == data.Key);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Delay = args.NewValue;
                        };

                    interrupterMenu.AddSeparator(5);

                    InterrupterMenuValues.Add(new Interrupter.InterrupterMenuInfo
                    {
                        Champion = data.Key,
                        SpellSlot = data.Value.SpellSlot,
                        Delay = interrupterMenu["Delay." + data.Key].Cast<Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)interrupterMenu["DangerLevel." + data.Key].Cast<ComboBox>().CurrentValue,
                        Enabled = interrupterMenu["Enabled." + data.Key].Cast<CheckBox>().CurrentValue,
                        EnemiesNear = interrupterMenu["EnemiesNear." + data.Key].Cast<Slider>().CurrentValue,
                        PercentHp = interrupterMenu["PercentHP." + data.Key].Cast<Slider>().CurrentValue
                    });

                    foundinterruptiblespells++;
                }
                if (foundinterruptiblespells == 0)
                {
                    interrupterMenu.AddGroupLabel("No interruptible spells found !");
                }
            }
Exemple #6
0
            static GapcloserMenu()
            {
                var gapcloserMenu = Menu.AddSubMenu("Anti-Gapcloser");
                _enabled = gapcloserMenu.Add("GapclosersEnabled", new CheckBox("Enable Anti-Gapcloser"));
                gapcloserMenu.AddSeparator(5);

                gapcloserMenu.AddGroupLabel("Enemy Gapclosers : ");
                gapcloserMenu.AddSeparator(5);

                foreach (
                    var data in
                        EntityManager.Heroes.Enemies.Where(x => Gapcloser.GapCloserList.Exists(k => k.ChampName == x.ChampionName) && x.Hero != Champion.Ziggs)
                            .Select(x => Gapcloser.GapCloserList.FirstOrDefault(key => key.ChampName == x.ChampionName)))
                {
                    var dangerlevel = Gapclosers.GapcloserDangerLevel.FirstOrDefault(pair => pair.Key == data.ChampName);

                    gapcloserMenu.AddGroupLabel(data.ChampName + " " + data.SpellSlot + " [" + data.SpellName + "]");

                    gapcloserMenu.Add("Enabled." + data.ChampName, new CheckBox("Enabled")).OnValueChange +=
                        delegate (ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Enabled = args.NewValue;
                        };

                    gapcloserMenu.Add("DangerLevel." + data.ChampName, new ComboBox("Danger Level", new[] { "High", "Medium", "Low"}, (int)dangerlevel.Value.DangerLevel)).OnValueChange +=
                        delegate(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP." + data.ChampName, new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.PercentHp = args.NewValue;
                        };

                    gapcloserMenu.Add("EnemiesNear." + data.ChampName, new Slider("Only if {0} or less enemies are near", dangerlevel.Value.EnemiesNear, 1, 5)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.EnemiesNear = args.NewValue;
                        };

                    gapcloserMenu.Add("Delay." + data.ChampName, new Slider("Humanizer delay", dangerlevel.Value.Delay, 0, 500)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == data.ChampName);
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Delay = args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion = data.ChampName,
                        SpellSlot = data.SpellSlot,
                        SpellName = data.SpellName,
                        Delay = gapcloserMenu["Delay." + data.ChampName].Cast<Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel." + data.ChampName].Cast<ComboBox>().CurrentValue,
                        Enabled = gapcloserMenu["Enabled." + data.ChampName].Cast<CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear." + data.ChampName].Cast<Slider>().CurrentValue,
                        PercentHp = gapcloserMenu["PercentHP." + data.ChampName].Cast<Slider>().CurrentValue
                    });
                    foundgapclosers++;
                }

                if (EntityManager.Heroes.Enemies.FirstOrDefault(x => x.Hero == Champion.Nidalee) != null)
                {
                    gapcloserMenu.AddGroupLabel("Nidalee W [Pounce]");

                    gapcloserMenu.Add("Enabled.Nidalee", new CheckBox("Enabled")).OnValueChange +=
                        delegate (ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Enabled = args.NewValue;
                        };

                    gapcloserMenu.Add("DangerLevel.Nidalee", new ComboBox("Danger Level", new[] { "High", "Medium", "Low" }, 1)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP.Nidalee", new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.PercentHp = args.NewValue;
                        };

                    gapcloserMenu.Add("EnemiesNear.Nidalee", new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.EnemiesNear = args.NewValue;
                        };

                    gapcloserMenu.Add("Delay.Nidalee", new Slider("Humanizer delay", 0, 0, 500)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Nidalee");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Delay = args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion = "Nidalee",
                        SpellName = "pounce",
                        Delay = gapcloserMenu["Delay.Nidalee"].Cast<Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel.Nidalee"].Cast<ComboBox>().CurrentValue,
                        Enabled = gapcloserMenu["Enabled.Nidalee"].Cast<CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear.Nidalee"].Cast<Slider>().CurrentValue,
                        PercentHp = gapcloserMenu["PercentHP.Nidalee"].Cast<Slider>().CurrentValue
                    });

                    foundgapclosers++;
                }

                if (EntityManager.Heroes.Enemies.FirstOrDefault(x => x.Hero == Champion.Rengar) != null)
                {
                    gapcloserMenu.AddGroupLabel("Rengar's passive [Leap]");

                    gapcloserMenu.Add("Enabled.Rengar", new CheckBox("Enabled")).OnValueChange +=
                        delegate (ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Enabled = args.NewValue;
                        };

                    gapcloserMenu.Add("DangerLevel.Rengar", new ComboBox("Danger Level", new[] { "High", "Medium", "Low" })).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.DangerLevel = (DangerLevel)args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    gapcloserMenu.Add("PercentHP.Rengar", new Slider("Only if Im below of {0} % of my HP", 100)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.PercentHp = args.NewValue;
                        };

                    gapcloserMenu.Add("EnemiesNear.Rengar", new Slider("Only if {0} or less enemies are near", 5, 1, 5)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.EnemiesNear = args.NewValue;
                        };

                    gapcloserMenu.Add("Delay.Rengar", new Slider("Humanizer delay", 0, 0, 500)).OnValueChange +=
                        delegate (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs args)
                        {
                            var interrupterMenuInfo = AntiGapcloserMenuValues.FirstOrDefault(i => i.Champion == "Rengar");
                            if (interrupterMenuInfo != null)
                                interrupterMenuInfo.Delay = args.NewValue;
                        };

                    gapcloserMenu.AddSeparator(5);

                    AntiGapcloserMenuValues.Add(new Gapclosers.GapcloserMenuInfo
                    {
                        Champion = "Rengar",
                        SpellName = "Rengar_LeapSound.troy",
                        Delay = gapcloserMenu["Delay.Rengar"].Cast<Slider>().CurrentValue,
                        DangerLevel = (DangerLevel)gapcloserMenu["DangerLevel.Rengar"].Cast<ComboBox>().CurrentValue,
                        Enabled = gapcloserMenu["Enabled.Rengar"].Cast<CheckBox>().CurrentValue,
                        EnemiesNear = gapcloserMenu["EnemiesNear.Rengar"].Cast<Slider>().CurrentValue,
                        PercentHp = gapcloserMenu["PercentHP.Rengar"].Cast<Slider>().CurrentValue
                    });

                    foundgapclosers++;
                }

                if (foundgapclosers == 0)
                {
                    gapcloserMenu.AddGroupLabel("No gapclosers found !");
                }
            }