Пример #1
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            try
            {
                Player = ObjectManager.Player;
                MapId  = (int)Utility.Map.GetMap().Type;
                Rand   = new Random();

                GetSpellsInGame();
                GetSmiteSlot();
                GetGameTroysInGame();
                GetAurasInGame();
                GetHeroesInGame();
                GetComboDamage();
                Helpers.CreateLogPath();

                Origin = new Menu("Activator", "activator", true);

                Menu cmenu = new Menu("Cleansers", "cmenu");
                GetItemGroup("Items.Cleansers").ForEach(t => NewItem((CoreItem)NewInstance(t), cmenu));
                CreateSubMenu(cmenu, false);
                Origin.AddSubMenu(cmenu);

                Menu dmenu = new Menu("Defensives", "dmenu");
                GetItemGroup("Items.Defensives").ForEach(t => NewItem((CoreItem)NewInstance(t), dmenu));
                CreateSubMenu(dmenu, false);
                Origin.AddSubMenu(dmenu);

                Menu smenu = new Menu("Summoners", "smenu");
                GetItemGroup("Summoners").ForEach(t => NewSumm((CoreSum)NewInstance(t), smenu));
                CreateSubMenu(smenu, true, true);
                Origin.AddSubMenu(smenu);

                Menu omenu = new Menu("Offensives", "omenu");
                GetItemGroup("Items.Offensives").ForEach(t => NewItem((CoreItem)NewInstance(t), omenu));
                CreateSubMenu(omenu, true);
                Origin.AddSubMenu(omenu);

                Menu imenu = new Menu("Consumables", "imenu");
                GetItemGroup("Items.Consumables").ForEach(t => NewItem((CoreItem)NewInstance(t), imenu));
                Origin.AddSubMenu(imenu);

                Menu amenu = new Menu("Auto Spells", "amenu");
                GetItemGroup("Spells.Evaders").ForEach(t => NewSpell((CoreSpell)NewInstance(t), amenu));
                GetItemGroup("Spells.Shields").ForEach(t => NewSpell((CoreSpell)NewInstance(t), amenu));
                GetItemGroup("Spells.Health").ForEach(t => NewSpell((CoreSpell)NewInstance(t), amenu));
                GetItemGroup("Spells.Slows").ForEach(t => NewSpell((CoreSpell)NewInstance(t), amenu));
                GetItemGroup("Spells.Heals").ForEach(t => NewSpell((CoreSpell)NewInstance(t), amenu));
                CreateSubMenu(amenu, false);
                Origin.AddSubMenu(amenu);

                GetPriority();

                Menu zmenu = new Menu("Misc/Settings", "settings");

                if (SmiteInGame)
                {
                    Menu ddmenu = new Menu("Drawings", "drawings");
                    ddmenu.AddItem(new MenuItem("drawsmitet", "Draw Smite Text")).SetValue(true);
                    ddmenu.AddItem(new MenuItem("drawfill", "Draw Smite Fill")).SetValue(true);
                    ddmenu.AddItem(new MenuItem("drawsmite", "Draw Smite Range")).SetValue(true);
                    zmenu.AddSubMenu(ddmenu);
                }

                var bbmenu = new Menu("Debug Tools", "bbmenu");
                bbmenu.AddItem(new MenuItem("acdebug", "Debug Income Damage")).SetValue(false);
                bbmenu.AddItem(new MenuItem("acdebug2", "Debug Item Priority")).SetValue(false);
                bbmenu.AddItem(new MenuItem("dumpdata", "Dump Spell Data")).SetValue(false);
                zmenu.AddSubMenu(bbmenu);

                zmenu.AddItem(new MenuItem("autolevelup", "Auto Level Ultimate")).SetValue(true).SetTooltip("Level 6 Only");
                zmenu.AddItem(new MenuItem("autotrinket", "Auto Upgrade Trinket")).SetValue(false);
                zmenu.AddItem(new MenuItem("healthp", "Ally Priority:")).SetValue(new StringList(new[] { "Low HP", "Most AD/AP", "Most HP" }, 1));
                zmenu.AddItem(new MenuItem("weightdmg", "Weight Income Damage (%)"))
                .SetValue(new Slider(115, 100, 150))
                .SetTooltip("Make Activator# think you are taking more damage than calulated.");
                zmenu.AddItem(new MenuItem("lagtolerance", "Lag Tolerance (%)"))
                .SetValue(new Slider(25))
                .SetTooltip("Make Activator# think you are taking damage longer than intended");
                zmenu.AddItem(new MenuItem("usecombo", "Combo (active)")).SetValue(new KeyBind(32, KeyBindType.Press, true)).Permashow();

                Menu uumenu = new Menu("Spell Database", "evadem");
                LoadSpellMenu(uumenu);
                zmenu.AddSubMenu(uumenu);

                Origin.AddSubMenu(zmenu);
                Origin.AddToMainMenu();

                // drawings
                Drawings.Init();

                // handlers

                Projections.Init();
                Trinkets.Init();

                // tracks dangerous or lethal buffs/auras
                Buffs.StartOnUpdate();

                // tracks gameobjects
                Gametroys.StartOnUpdate();

                // on bought item
                Obj_AI_Base.OnPlaceItemInSlot += Obj_AI_Base_OnPlaceItemInSlot;

                // on level up
                Obj_AI_Base.OnLevelUp += Obj_AI_Base_OnLevelUp;

                // on predict damage
                Projections.OnPredictDamage += Projections_OnPredictDamage;

                Game.PrintChat("<b><font color=\"#FF3366\">Activator#</font></b> - Loaded!");
                Updater.UpdateCheck();


                // init valid auto spells
                foreach (CoreSpell autospell in Lists.Spells)
                {
                    if (Player.GetSpellSlot(autospell.Name) != SpellSlot.Unknown)
                    {
                        Game.OnUpdate += autospell.OnTick;
                    }
                }

                // init valid summoners
                foreach (CoreSum summoner in Lists.Summoners)
                {
                    if (summoner.Slot != SpellSlot.Unknown ||
                        summoner.ExtraNames.Any(x => Player.GetSpellSlot(x) != SpellSlot.Unknown))
                    {
                        Game.OnUpdate += summoner.OnTick;
                    }
                }

                // find items (if F5)
                foreach (CoreItem item in Lists.Items)
                {
                    if (!LeagueSharp.Common.Items.HasItem(item.Id))
                    {
                        continue;
                    }

                    if (!Lists.BoughtItems.Contains(item))
                    {
                        if (item.Category.Any())
                        {
                            Game.OnUpdate += item.OnTick;
                        }

                        if (item.Category.Any(t => t == MenuType.Gapcloser))
                        {
                            AntiGapcloser.OnEnemyGapcloser += item.OnEnemyGapcloser;
                        }

                        Lists.BoughtItems.Add(item);
                        Game.PrintChat("<b><font color=\"#FF3366\">Activator#</font></b> - <font color=\"#FFF280\">" + item.Name + "</font> active!");
                    }
                }
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
                Game.PrintChat("Exception thrown at <font color=\"#FFF280\">Activator.OnGameLoad</font>");
            }
        }