Beispiel #1
0
        public override void OnTick(EventArgs args)
        {
            if (!Menu["use" + Name].Cast <CheckBox>().CurrentValue || !IsReady())
            {
                return;
            }

            foreach (var hero in Activator.Allies())
            {
                if (Activator.cmenu[Parent.UniqueMenuId + "useon" + hero.Player.NetworkId] == null)
                {
                    continue;
                }
                if (!Activator.cmenu[Parent.UniqueMenuId + "useon" + hero.Player.NetworkId].Cast <CheckBox>().CurrentValue)
                {
                    continue;
                }

                if (hero.Player.LSDistance(Player.ServerPosition) > Range)
                {
                    continue;
                }

                if (hero.ForceQSS)
                {
                    UseItem(hero.Player);
                    hero.MikaelsBuffCount       = 0;
                    hero.MikaelsHighestBuffTime = 0;
                }

                Buffs.CheckMikaels(hero.Player);

                var d = Convert.ToDouble(array[Menu["use" + Name + "time"].Cast <ComboBox>().CurrentValue]);
                if (hero.MikaelsBuffCount >= Menu["use" + Name + "number"].Cast <Slider>().CurrentValue&&
                    hero.MikaelsHighestBuffTime >= d * 1000)
                {
                    if (!Menu["use" + Name + "od"].Cast <CheckBox>().CurrentValue)
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(Game.Ping + Menu["use" + Name + "delay"].Cast <Slider>().CurrentValue, delegate
                        {
                            UseItem(hero.Player, Menu["mode" + Name].Cast <ComboBox>().CurrentValue == 1);
                            hero.MikaelsBuffCount       = 0;
                            hero.MikaelsHighestBuffTime = 0;
                        });
                    }
                }

                if (hero.Player.Health / hero.Player.MaxHealth * 100 <=
                    Menu["selflowhp" + Name + "pct"].Cast <Slider>().CurrentValue)
                {
                    if (hero.IncomeDamage > 0)
                    {
                        UseItem(hero.Player, Menu["mode" + Name].Cast <ComboBox>().CurrentValue == 1);
                        hero.MikaelsBuffCount       = 0;
                        hero.MikaelsHighestBuffTime = 0;
                    }
                }
            }
        }
Beispiel #2
0
        public override void OnTick(EventArgs args)
        {
            if (!Menu.Item("use" + Name).GetValue <bool>() || !IsReady())
            {
                return;
            }

            foreach (var hero in Activator.Allies())
            {
                if (!Parent.Item(Parent.Name + "useon" + hero.Player.NetworkId).GetValue <bool>())
                {
                    continue;
                }

                if (hero.Player.Distance(Player.ServerPosition) > Range)
                {
                    continue;
                }

                if (hero.ForceQSS)
                {
                    UseItem();
                    hero.QSSBuffCount       = 0;
                    hero.QSSHighestBuffTime = 0;
                }

                Buffs.CheckMikaels(hero.Player);

                if (hero.MikaelsBuffCount >= Menu.Item("use" + Name + "number").GetValue <Slider>().Value&&
                    hero.MikaelsHighestBuffTime >= Menu.Item("use" + Name + "time").GetValue <Slider>().Value)
                {
                    if (!Menu.Item("use" + Name + "od").GetValue <bool>())
                    {
                        Utility.DelayAction.Add(Game.Ping + Menu.Item("use" + Name + "delay").GetValue <Slider>().Value, delegate
                        {
                            UseItem(hero.Player, Menu.Item("mode" + Name).GetValue <StringList>().SelectedIndex == 1);
                            hero.MikaelsBuffCount       = 0;
                            hero.MikaelsHighestBuffTime = 0;
                        });
                    }
                }

                if (hero.Player.Health / hero.Player.MaxHealth * 100 <=
                    Menu.Item("selflowhp" + Name + "pct").GetValue <Slider>().Value)
                {
                    if (hero.IncomeDamage > 0)
                    {
                        UseItem(hero.Player, Menu.Item("mode" + Name).GetValue <StringList>().SelectedIndex == 1);
                        hero.MikaelsBuffCount       = 0;
                        hero.MikaelsHighestBuffTime = 0;
                    }
                }
            }
        }