Ejemplo n.º 1
0
 private static void Loading_OnLoadingComplete(System.EventArgs args)
 {
     LoadPlugin();
     UBCore.CoreMenu.Initialize();
     if (PluginInstance == null)
     {
         Debug.Print("UBAddons not support " + Player.Instance.Hero + " yet", Console_Message.Outdate);
         return;
     }
     else
     {
         TargetSelector.ActiveMode = TargetSelectorMode.LeastHealth;
         UBNotification.ShowNotif("UBAddons Notification", Player.Instance.Hero + " Loaded", "notification");
         Debug.Print(Player.Instance.Hero + " Loaded. Enjoys", Console_Message.Notifications);
         Chat.Print(Variables.Roles);
     }
     Chat.Print("<font = 'Comic Sans MS'>UBAddons: Please report on my thread if its have any bugs</font>", System.Drawing.Color.FromArgb(245, 14, 147));
 }
Ejemplo n.º 2
0
        private static void ShowNotification()
        {
            var CurrentVersion = UpdateChecker.CurrentVersion;

            if (CurrentVersion > typeof(UBAddons).Assembly.GetName().Version)
            {
                Chat.Print("<font = 'Comic Sans MS'>Outdate. Newest verion: " + CurrentVersion + "</font>", System.Drawing.Color.OrangeRed);
                UBNotification.ShowNotif("UBAddons Notification", "Outdate. Newest verion: " + CurrentVersion, "outdate");
                Debug.Print("Outdate. Newest verion: " + CurrentVersion, Console_Message.Outdate);
            }
            if (CurrentVersion == typeof(UBAddons).Assembly.GetName().Version)
            {
                Chat.Print("<font = 'Comic Sans MS'>This is newest version: " + CurrentVersion + "</font>", System.Drawing.Color.LightGreen);
                UBNotification.ShowNotif("UBAddons Notification", "This is newest version: " + CurrentVersion, "update");
                Debug.Print("This is newest version: " + CurrentVersion, Console_Message.Notifications);
            }
            if (CurrentVersion < typeof(UBAddons).Assembly.GetName().Version)
            {
                Chat.Print("Thanks for helping me", System.Drawing.Color.LightGreen);
                UBNotification.ShowNotif("UBAddons Notification", "Thanks for helping me <3", "update");
                Debug.Print("Thanks for helping me <3", Console_Message.Notifications);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// There is Get Priority
        /// </summary>
        /// <param name="champ">Put your champ here</param>
        /// <param name="menu">Load from menu ? If not, give it blank</param>
        /// <returns></returns>
        public static int GetPriority(AIHeroClient champ, Menu menu = null)
        {
            var ChampionHero = champ.Hero;

            Champion[] priorities1 =
            {
                Champion.Alistar, Champion.Amumu, Champion.Bard,      Champion.Blitzcrank, Champion.Braum,   Champion.Chogath,  Champion.DrMundo, Champion.Garen,      Champion.Gnar,
                Champion.Hecarim, Champion.Janna, Champion.JarvanIV,  Champion.Leona,      Champion.Lulu,    Champion.Malphite, Champion.Nami,    Champion.Nasus,      Champion.Nautilus,
                Champion.Nunu,    Champion.Olaf,  Champion.Rammus,    Champion.Renekton,   Champion.Sejuani, Champion.Shen,     Champion.Shyvana, Champion.Singed,     Champion.Sion,
                Champion.Skarner, Champion.Sona,  Champion.Soraka,    Champion.Taric,      Champion.Thresh,  Champion.Volibear, Champion.Warwick, Champion.MonkeyKing, Champion.Yorick,
                Champion.Zac,     Champion.Zyra,  Champion.TahmKench, Champion.Zilean,
            };

            Champion[] priorities2 =
            {
                Champion.Aatrox,  Champion.Darius,     Champion.Elise,   Champion.Evelynn,  Champion.Galio,    Champion.Gangplank, Champion.Gragas, Champion.Irelia, Champion.Jax,
                Champion.LeeSin,  Champion.Maokai,     Champion.Morgana, Champion.Nocturne, Champion.Pantheon, Champion.Poppy,     Champion.Rengar, Champion.Rumble, Champion.Swain,
                Champion.Trundle, Champion.Tryndamere, Champion.Udyr,    Champion.Urgot,    Champion.Vi,       Champion.XinZhao,   Champion.RekSai, Champion.Kled,   Champion.Illaoi,
            };

            Champion[] priorities3 =
            {
                Champion.Akali,   Champion.Diana,  Champion.Ekko,      Champion.FiddleSticks, Champion.Fiora,   Champion.Fizz,  Champion.Heimerdinger, Champion.Jayce,    Champion.Kassadin,
                Champion.Kayle,   Champion.Khazix, Champion.Lissandra, Champion.Mordekaiser,  Champion.Nidalee, Champion.Riven, Champion.Shaco,        Champion.Vladimir, Champion.Yasuo,
                Champion.Camille,
            };

            Champion[] priorities4 =
            {
                Champion.Ahri,        Champion.Anivia,  Champion.Annie,  Champion.Ashe,   Champion.Azir,     Champion.Brand,    Champion.Caitlyn,     Champion.Cassiopeia, Champion.Corki,
                Champion.Draven,      Champion.Ezreal,  Champion.Graves, Champion.Jinx,   Champion.Kalista,  Champion.Karma,    Champion.Karthus,     Champion.Katarina,   Champion.Kennen,
                Champion.KogMaw,      Champion.Leblanc, Champion.Lucian, Champion.Lux,    Champion.Malzahar, Champion.MasterYi, Champion.MissFortune, Champion.Orianna,
                Champion.Quinn,       Champion.Sivir,   Champion.Syndra, Champion.Talon,  Champion.Teemo,    Champion.Tristana, Champion.TwistedFate, Champion.Twitch,     Champion.Varus,
                Champion.Vayne,       Champion.Veigar,  Champion.Velkoz, Champion.Viktor, Champion.Xerath,   Champion.Zed,      Champion.Ziggs,       Champion.Kindred,    Champion.Jhin,
                Champion.AurelionSol, Champion.Taliyah, Champion.Ryze,   Champion.Ivern,
            };

            Champion priority5 = Player.Instance.Hero;

            if (menu != null)
            {
                return(menu.VSliderValue(General.Variables.AddonName + "." + Player.Instance.Hero + ".Saver.Priority." + champ.Hero));
            }
            else if (priority5.Equals(ChampionHero))
            {
                return(5);
            }
            else if (priorities1.Contains(ChampionHero))
            {
                return(1);
            }
            else if (priorities2.Contains(ChampionHero))
            {
                return(2);
            }
            else if (priorities3.Contains(ChampionHero))
            {
                return(3);
            }
            else if (priorities4.Contains(ChampionHero))
            {
                return(4);
            }
            else
            {
                UBNotification.ShowNotif("UBAddons Warning", ChampionHero + "is not has data to get priority", "warn");
                Debug.Print(ChampionHero + " is not avaiable in get priority now, please contact me", General.Console_Message.Notifications);
                return(1);
            }
        }
Ejemplo n.º 4
0
        private static void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args)
        {
            if (sender?.Type != GameObjectType.AIHeroClient)
            {
                return;
            }
            var hero = sender as AIHeroClient;

            if (hero == null || (!hero.IsEnemy && !BaseMenu.VChecked("Tracker.Enabled.Ally")))
            {
                return;
            }

            switch (args.Status)
            {
            case TeleportStatus.Start:
            {
                if (BaseMenu.VChecked("Tracker.Enabled"))
                {
                    var text = args.Type.Equals(TeleportType.Recall) ? "recalling." : "teleporting.";
                    UBNotification.ShowNotif("Recall tracker notification", hero.Hero + " is " + text, "recall", 2500);
                }
                if (Teleporting.ContainsKey(sender.NetworkId))
                {
                    Teleporting[sender.NetworkId] = new Teleport_Infomation(sender, args.Type.Equals(TeleportType.Recall))
                    {
                        Duration = args.Duration, Started = args.Start, End = args.Duration + args.Start
                    };
                }
                else
                {
                    Teleporting.Add(sender.NetworkId, new Teleport_Infomation(sender, args.Type.Equals(TeleportType.Recall))
                        {
                            Duration = args.Duration, Started = args.Start, End = args.Duration + args.Start
                        });
                }
            }
            break;

            case TeleportStatus.Abort:
            {
                if (BaseMenu.VChecked("Tracker.Enabled"))
                {
                    var text = args.Type.Equals(TeleportType.Recall) ? "recall." : "teleport.";
                    UBNotification.ShowNotif("Recall tracker notification", hero.Hero + " canceled " + text, "recall", 2500);
                }
                Teleporting.Remove(hero.NetworkId);
            }
            break;

            case TeleportStatus.Finish:
            {
                if (BaseMenu.VChecked("Tracker.Enabled"))
                {
                    var text = args.Type.Equals(TeleportType.Recall) ? "recall." : "teleport.";
                    UBNotification.ShowNotif("Recall tracker notification", hero.Hero + " finished " + text, "recall", 2500);
                }
                Teleporting.Remove(hero.NetworkId);
            }
            break;

            case TeleportStatus.Unknown:
            {
                Teleporting.Remove(hero.NetworkId);
            }
            break;

            default:
                throw new ArgumentOutOfRangeException(nameof(args.Status));
            }
        }
Ejemplo n.º 5
0
        internal static void CastR(I_To tO, Obj_AI_Base target = null)
        {
            if (target == null)
            {
                target = R.GetTarget();
            }
            switch (tO)
            {
            case I_To.Ally:
            {
                if (target != null)
                {
                    var Ally = EntityManager.Heroes.Allies.Where(x => x.IsValidTarget(1200)).FirstOrDefault();
                    if (Ally != null)
                    {
                        R.Cast(player.Position.Extend(Ally, R.Range).To3DWorld());
                    }
                    else
                    {
                        UBNotification.ShowNotif("UBAddons Warning", "Ally is null", "warn");
                    }
                }
                else
                {
                    UBNotification.ShowNotif("UBAddons Warning", "Target is null", "warn");
                }
            }
            break;

            case I_To.Turret:
            {
                if (target != null)
                {
                    var Turret = EntityManager.Turrets.Allies.Where(x => x.IsValidTarget(900, false, target.Position)).FirstOrDefault();
                    if (Turret != null)
                    {
                        R.Cast(player.Position.Extend(Turret, R.Range).To3DWorld());
                    }
                    else
                    {
                        UBNotification.ShowNotif("UBAddons Warning", "Ally is null", "warn");
                    }
                }
                else
                {
                    UBNotification.ShowNotif("UBAddons Warning", "Target is null", "warn");
                }
            }

            break;

            case I_To.Smart:
                if (target != null)
                {
                    var Turret = EntityManager.Turrets.Allies.Where(x => x.IsValidTarget(900, false, target.Position)).FirstOrDefault();
                    if (Turret != null)
                    {
                        R.Cast(player.Position.Extend(Turret, R.Range).To3DWorld());
                    }
                    else
                    {
                        var Ally = EntityManager.Heroes.Allies.Where(x => x.IsValidTarget(1200)).FirstOrDefault();
                        if (Ally != null)
                        {
                            R.Cast(player.Position.Extend(Ally, R.Range).To3DWorld());
                        }
                    }
                }
                else
                {
                    UBNotification.ShowNotif("UBAddons Warning", "Target is null", "warn");
                }
                break;

            case I_To.Cursor:
            {
                if (target != null)
                {
                    R.Cast(player.Position.Extend(Game.CursorPos, R.Range).To3DWorld());
                }
            }
            break;

            case I_To.Push:
            {
                if (target != null)
                {
                    var pred = R.GetPrediction(target);
                    if (pred.CanNext(R, MenuValue.General.RHitChance, true))
                    {
                        R.Cast(pred.CastPosition);
                    }
                }
            }
            break;

            case I_To.Pull:
            {
                if (target != null)
                {
                    var pred = R.GetPrediction(target);
                    if (pred.CanNext(R, MenuValue.General.RHitChance, true))
                    {
                        R.Cast(pred.CastPosition.Extend(player, player.Distance(pred.CastPosition) + R.Range).To3DWorld());
                    }
                }
            }
            break;

            case I_To.Position:
            {
            }
            break;
            }
        }
Ejemplo n.º 6
0
        static AutoLv()
        {
            if (MainMenu.MenuInstances.FirstOrDefault(x => x.Key.Contains("UBAddons")).Value == null)
            {
                Debug.Print("There's has a problem when trying to inject Auto Level up. Please report to Uzumaki Boruto", Console_Message.Error);
            }
            else
            {
                try
                {
                    FileHandle.Read();
                    var Menu = MainMenu.MenuInstances.FirstOrDefault(x => x.Key.Contains("UBAddons")).Value.FirstOrDefault();
                    LvMenu = Menu.AddSubMenu("AutoLv", "UBAddons.AutoLv", "Auto Level for UBAddons");
                    {
                        LvMenu.Add("Enable", new CheckBox("Enable auto Level up"));
                        var min = LvMenu.Add("Delay.Min", new Slider("Min Delay", 300, 0, 2000));
                        var max = LvMenu.Add("Delay.Max", new Slider("Max Delay", 500, 0, 2000));
                        min.OnValueChange += delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                        {
                            if (args.NewValue > max.CurrentValue)
                            {
                                sender.CurrentValue = args.OldValue;
                                UBNotification.ShowNotif("UBAddons Warning", "Min value cann't be greater than max value", "warn");
                            }
                        };
                        max.OnValueChange += delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                        {
                            if (args.NewValue < min.CurrentValue)
                            {
                                sender.CurrentValue = args.OldValue;
                                UBNotification.ShowNotif("UBAddons Warning", "Max value cann't be less than min value", "warn");
                            }
                        };
                        var reset = LvMenu.Add("Reset", new CheckBox("Tick here to reset"));
                        reset.CurrentValue = false;
                        var fastconfig = LvMenu.Add("Fast", new ComboBox("Fast config", 0, "Choose Here", "R → Q → W → E", "R → Q → E → W", "R → W → Q → E", "R → W → E → Q", "R → E → Q → W", "R → E → W → Q"));
                        fastconfig.CurrentValue = 0;
                        var data  = LvMenu.Add("Data", new ComboBox("Your Data", 0, "Data 1", "Data 2", "Data 3"));
                        var label = LvMenu.Add("Label", new Label(""));
                        label.DisplayName = FileHandle.Preview(data.CurrentValue);
                        var save = LvMenu.Add("Save", new CheckBox("Tick here to save your skillorder"));
                        save.CurrentValue = false;
                        var load = LvMenu.Add("Load", new CheckBox("Tick here to load your skillorder"));
                        load.CurrentValue = false;
                        var delete = LvMenu.Add("Delete", new CheckBox("Tick here to delete your skillorder"));
                        delete.CurrentValue = false;
                        LvMenu.AddGroupLabel("Custom Level Settings");
                        for (int i = 1; i <= 18; i++)
                        {
                            LvMenu.Add(Player.Instance.ChampionName + "." + i, new ComboBox("Level " + i, Database.ConvertToInt(Database.SkillOrder(Player.Instance.Hero))[i - 1], "None", "Q", "W", "E", "R"));
                        }
                        reset.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                        {
                            if (args.NewValue)
                            {
                                for (var i = 1; i <= 18; i++)
                                {
                                    LvMenu[Player.Instance.ChampionName + "." + i].Cast <ComboBox>().CurrentValue = Database.ConvertToInt(Database.SkillOrder(Player.Instance.Hero))[i - 1];
                                }
                                reset.DisplayName = "Reseted";
                                Core.DelayAction(() => reset.DisplayName = "Tick here to reset", 1500);
                                reset.CurrentValue = false;
                            }
                        };
                        fastconfig.OnValueChange += delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                        {
                            if (args.NewValue == 0)
                            {
                                return;
                            }
                            var list = new List <int>();
                            switch (args.NewValue)
                            {
                            case 1:
                            {
                                list = new List <int>()
                                {
                                    1, 2, 3, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3
                                };
                            }
                            break;

                            case 2:
                            {
                                list = new List <int>()
                                {
                                    1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2
                                };
                            }
                            break;

                            case 3:
                            {
                                list = new List <int>()
                                {
                                    2, 1, 3, 2, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3
                                };
                            }
                            break;

                            case 4:
                            {
                                list = new List <int>()
                                {
                                    2, 3, 1, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1
                                };
                            }
                            break;

                            case 5:
                            {
                                list = new List <int>()
                                {
                                    3, 1, 2, 3, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2
                                };
                            }
                            break;

                            case 6:
                            {
                                list = new List <int>()
                                {
                                    3, 2, 1, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1
                                };
                            }
                            break;
                            }
                            fastconfig.SelectedIndex = 0;
                            fastconfig.CurrentValue  = 0;
                            for (var i = 1; i <= 18; i++)
                            {
                                LvMenu[Player.Instance.ChampionName + "." + i].Cast <ComboBox>().CurrentValue = list[i - 1];
                            }
                        };
                        data.OnValueChange += delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs args)
                        {
                            label.DisplayName = FileHandle.Preview(args.NewValue);
                        };
                        save.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                        {
                            if (args.NewValue)
                            {
                                var result = new List <int>();
                                for (var i = 1; i <= 18; i++)
                                {
                                    result.Add(LvMenu.VComboValue(Player.Instance.ChampionName + "." + i));
                                }
                                var skillorder = Database.ConvertToSpellSlot(result);
                                var key        = Player.Instance.ChampionName + ".Data." + (LvMenu.VComboValue("Data") + 1);
                                if (FileHandle.SpellData.Any(x => x.Key.Equals(key)))
                                {
                                    FileHandle.SpellData[FileHandle.SpellData.FindIndex(x => x.Key.Equals(key))].SlotList = skillorder;
                                }
                                else
                                {
                                    FileHandle.SpellData.Add(new SkillOrder_Infomation(key, skillorder));
                                }
                                FileHandle.Write();
                                label.DisplayName = FileHandle.Preview(data.CurrentValue);
                                save.DisplayName  = "Saved";
                                Core.DelayAction(() => save.DisplayName = "Tick here to save your skillorder", 1500);
                                save.CurrentValue = false;
                            }
                        };
                        load.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                        {
                            if (args.NewValue)
                            {
                                var key = Player.Instance.ChampionName + ".Data." + (LvMenu.VComboValue("Data") + 1);
                                if (FileHandle.SpellData.Any(x => x.Key.Equals(key)))
                                {
                                    var spelldata = FileHandle.SpellData.FirstOrDefault(x => x.Key.Equals(key)).SlotList;
                                    var result    = new List <int>();
                                    for (var i = 1; i <= 18; i++)
                                    {
                                        LvMenu[Player.Instance.ChampionName + "." + i].Cast <ComboBox>().CurrentValue = Database.ConvertToInt(spelldata)[i - 1];
                                    }
                                    label.DisplayName = FileHandle.Preview(data.CurrentValue);
                                    load.DisplayName  = "Loaded";
                                    Core.DelayAction(() => load.DisplayName = "Tick here to load your skillorder", 1500);
                                    load.CurrentValue = false;
                                }
                                else
                                {
                                    load.DisplayName = "Couldn't load your data";
                                    Core.DelayAction(() => load.DisplayName = "Tick here to load your skillorder", 1500);
                                    load.CurrentValue = false;
                                }
                            }
                        };
                        delete.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                        {
                            if (args.NewValue)
                            {
                                var key = Player.Instance.ChampionName + ".Data." + (LvMenu.VComboValue("Data") + 1);
                                if (FileHandle.SpellData.Any(x => x.Key.Equals(key)))
                                {
                                    FileHandle.SpellData.RemoveAll(x => x.Key.Equals(key));
                                    label.DisplayName  = FileHandle.Preview(data.CurrentValue);
                                    delete.DisplayName = "Deleted";
                                    Core.DelayAction(() => delete.DisplayName = "Tick here to delete your skillorder", 1500);
                                    delete.CurrentValue = false;
                                }
                                else
                                {
                                    delete.DisplayName = "Your Data already null";
                                    Core.DelayAction(() => delete.DisplayName = "Tick here to load your skillorder", 1500);
                                    label.DisplayName   = FileHandle.Preview(data.CurrentValue);
                                    delete.CurrentValue = false;
                                }
                                FileHandle.Write();
                            }
                        };
                    }
                }
                catch (Exception e)
                {
                    Debug.Print(e.ToString(), Console_Message.Error);
                }
            }
        }