コード例 #1
0
ファイル: Program.cs プロジェクト: CONANLXF/AIO
        public static void Game_OnGameLoad()
        {
            Config = MainMenu.AddMenu("Marksman", "Marksman");
            ChampionClass = new Marksman.Champions.Champion();
            Common.CommonGeometry.Init();
            var BaseType = ChampionClass.GetType();

            /* Update this with Activator.CreateInstance or Invoke
               http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
               For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
                case "ashe":
                    ChampionClass = new Ashe();
                    break;
                case "caitlyn":
                    ChampionClass = new Caitlyn();
                    break;
                case "corki":
                    ChampionClass = new Corki();
                    break;
                case "draven":
                    ChampionClass = new Draven();
                    break;
                case "ezreal":
                    ChampionClass = new Ezreal();
                    break;
                case "gnar":
                    ChampionClass = new Gnar();
                    break;
                case "graves":
                    ChampionClass = new Graves();
                    break;
                case "jhin":
                    ChampionClass = new Jhin();
                    break;
                case "jinx":
                    ChampionClass = new Jinx();
                    break;
                case "kalista":
                    ChampionClass = new Kalista();
                    break;
                case "kindred":
                    ChampionClass = new Kindred();
                    break;
                case "kogmaw":
                    ChampionClass = new Kogmaw();
                    break;
                case "lucian":
                    ChampionClass = new Lucian();
                    break;
                case "sivir":
                    ChampionClass = new Sivir();
                    break;
                case "missfortune":
                    ChampionClass = new MissFortune();
                    break;
                case "quinn":
                    ChampionClass = new Quinn();
                    break;
                case "teemo":
                    ChampionClass = new Teemo();
                    break;
                case "tristana":
                    ChampionClass = new Tristana();
                    break;
                case "twitch":
                    ChampionClass = new Twitch();
                    break;
                case "urgot":
                    ChampionClass = new Urgot();
                    break;
                case "vayne":
                    ChampionClass = new Vayne();
                    break;
                case "varus":
                    ChampionClass = new Varus();
                    break;
            }
            Config.DisplayName = "Marksman Lite";

            ChampionClass.Config = Config;

            MenuExtraTools = Config.AddSubMenu("Extra Tools", "ExtraTools");
            {
                MenuExtraTools.AddLabel("Press F5 for Load Extra Tools!");
                MenuExtraTools.Add("ExtraTools.Prediction", new ComboBox("Prediction:", 0, "LeagueSharp Common", "SPrediction (Synx)"));
                MenuExtraTools.Add("ExtraTools.AutoLevel", new CheckBox("Auto Leveler:", false));
                MenuExtraTools.Add("ExtraTools.AutoBush", new CheckBox("Auto Bush Ward:", false));
                MenuExtraTools.Add("ExtraTools.AutoPink", new CheckBox("Auto Pink Ward:", false));
                MenuExtraTools.Add("ExtraTools.Emote", new CheckBox("Emote:", false));
                MenuExtraTools.Add("ExtraTools.BuffTimer", new CheckBox("Buff Time Manager:", false));
                MenuExtraTools.Add("ExtraTools.Potition", new CheckBox("Potition Manager:", false));
                MenuExtraTools.Add("ExtraTools.Summoners", new CheckBox("Summoner Manager:", false));
                MenuExtraTools.Add("ExtraTools.Tracker", new CheckBox("Tracker:", false));
            }

            Common.CommonSettings.Init(Config);

            MenuActivator = Config.AddSubMenu("Activator", "Activator");
            {
                MenuActivator.Add("BOTRK", new CheckBox("BOTRK"));
                MenuActivator.Add("GHOSTBLADE", new CheckBox("Ghostblade"));
                MenuActivator.Add("SWORD", new CheckBox("Sword of the Divine"));
                MenuActivator.Add("MURAMANA", new CheckBox("Muramana"));
                MenuActivator.Add("UseItemsMode", new ComboBox("Use items on", 2, "No", "Mixed mode", "Combo mode", "Both"));

                if (MenuExtraTools["ExtraTools.AutoLevel"].Cast<CheckBox>().CurrentValue)
                {
                    Common.CommonAutoLevel.Init(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.AutoPink"].Cast<CheckBox>().CurrentValue)
                {
                    Common.CommonAutoPink.Initialize(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.AutoBush"].Cast<CheckBox>().CurrentValue)
                {
                    Common.CommonAutoBush.Init(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.Emote"].Cast<CheckBox>().CurrentValue)
                {
                    Common.CommonEmote.Init(MenuActivator);
                }
            }

            // If Champion is supported draw the extra menus
            if (BaseType != ChampionClass.GetType())
            {
                SetSmiteSlot();

                combo = Config.AddSubMenu("Combo", "Combo");
                if (ChampionClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                        combo.Add("ComboSmite", new CheckBox("Use Smite"));
                }

                harass = Config.AddSubMenu("Harass", "Harass");
                if (ChampionClass.HarassMenu(harass))
                {
                    harass.Add("HarassMana", new Slider("Min. Mana Percent", 50, 0, 100));
                }

                laneclear = Config.AddSubMenu("Lane Mode", "LaneClear");
                if (ChampionClass.LaneClearMenu(laneclear))
                {
                    laneclear.Add("Lane.Enabled", new KeyBind(":: Enable Lane Farm!", true, KeyBind.BindTypes.PressToggle, 'L'));

                    laneclear.AddGroupLabel("Min. Mana Settings");
                    {
                        laneclear.Add("LaneMana.Alone", new Slider("If I'm Alone %:", 30, 0, 100));
                        laneclear.Add("LaneMana.Enemy", new Slider("If Enemy Close %:", 60, 0, 100));
                    }
                }

                jungleClear = Config.AddSubMenu("Jungle Mode", "JungleClear");
                if (ChampionClass.JungleClearMenu(jungleClear))
                {
                    jungleClear.AddGroupLabel("Min. Mana Settings");
                    {
                        jungleClear.Add("Jungle.Mana.Ally", new Slider("Ally Mobs %:", 50, 0, 100));
                        jungleClear.Add("Jungle.Mana.Enemy", new Slider("Enemy Mobs %:", 30, 0, 100));
                        jungleClear.Add("Jungle.Mana.BigBoys", new Slider("Baron/Dragon %:", 70, 0, 100));
                    }
                    jungleClear.Add("Jungle.Items", new ComboBox(":: Use Items:", 3, "Off", "Use for Baron", "Use for Baron", "Both"));
                    jungleClear.Add("Jungle.Enabled", new KeyBind(":: Enable Jungle Farm!", true, KeyBind.BindTypes.PressToggle, 'J'));
                }

                /*----------------------------------------------------------------------------------------------------------*/
                /*
                Obj_AI_Base ally = (from aAllies in HeroManager.Allies from aSupportedChampions in new[] { "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard" } where aSupportedChampions == aAllies.ChampionName.ToLower() select aAllies).FirstOrDefault();

                if (ally != null)
                {
                    menuAllies = Config.AddSubMenu("Ally Combo", "Ally.Combo");
                    {
                        AIHeroClient Leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                        if (Leona != null)
                        {
                            menuAllies.Add("Leona.ComboBuff", new CheckBox("Force Focus Marked Enemy for Bonus Damage"));
                        }

                        AIHeroClient Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                        if (Lux != null)
                        {
                            menuAllies.Add("Lux.ComboBuff", new CheckBox("Force Focus Marked Enemy for Bonus Damage"));
                        }

                        AIHeroClient Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                        if (Shen != null)
                        {
                            menuAllies.Add("Shen.ComboBuff", new CheckBox("Force Focus Q Marked Enemy Objects for Heal"));
                            menuAllies.Add("Shen.ComboBuff", new Slider("Minimum Heal:", 80));
                        }

                        AIHeroClient Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                        if (Tahm != null)
                        {
                            menuAllies.Add("Tahm.ComboBuff", new CheckBox("Force Focus Marked Enemy for Stun"));
                        }

                        AIHeroClient Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                        if (Sona != null)
                        {
                            menuAllies.Add("Sona.ComboBuff", new CheckBox("Force Focus to Marked Enemy"));
                        }

                        AIHeroClient Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                        if (Lulu != null)
                        {
                            menuAllies.Add("Lulu.ComboBuff", new CheckBox("Force Focus to Enemy If I have E buff"));
                        }

                        AIHeroClient Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                        if (Nami != null)
                        {
                            menuAllies.Add("Nami.ComboBuff", new CheckBox("Force Focus to Enemy If I have E Buff"));
                        }
                    }
                }
                */
                /*----------------------------------------------------------------------------------------------------------*/

                misc = Config.AddSubMenu("Misc", "Misc");
                if (ChampionClass.MiscMenu(misc))
                {
                    misc.Add("Misc.SaveManaForUltimate", new CheckBox("Save Mana for Ultimate", false));
                }

                marksmanDrawings = Config.AddSubMenu("Drawings", "MDrawings");
                if (ChampionClass.DrawingMenu(marksmanDrawings))
                {
                    //marksmanDrawings.AddSubMenu(drawing);
                }
                marksmanDrawings.AddGroupLabel("Global");
                {
                    marksmanDrawings.Add("Draw.TurnOff", new ComboBox("Drawings", 1, "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both"));
                    marksmanDrawings.Add("Draw.KillableEnemy", new CheckBox("Killable Enemy Text", false));
                    marksmanDrawings.Add("Draw.MinionLastHit", new ComboBox("Minion Last Hit", 2, "Off", "On", "Just Out of AA Range Minions"));
                    marksmanDrawings.Add("Draw.DrawMinion", new CheckBox("Draw Minions Sprite", false));
                    marksmanDrawings.Add("Draw.DrawTarget", new CheckBox("Draw Target Sprite"));
                    marksmanDrawings.AddGroupLabel("Compare me with");
                    {
                        string[] strCompare = new string[HeroManager.Enemies.Count + 1];
                        strCompare[0] = "Off";
                        var i = 1;
                        foreach (var e in HeroManager.Enemies)
                        {
                            strCompare[i] = e.ChampionName;
                            i += 1;
                        }
                        marksmanDrawings.Add("Marksman.Compare.Set", new ComboBox("Set", 1, "Off", "Auto Compare at Startup"));
                        marksmanDrawings.Add("Marksman.Compare", new ComboBox("Compare me with", 0, strCompare));
                    }
                }
            }

            ChampionClass.MainMenu(Config);

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate += Game_OnGameUpdate;
            Game.OnUpdate += eventArgs =>
            {
                if (ChampionClass.LaneClearActive)
                {
                    ExecuteLaneClear();
                }

                if (ChampionClass.JungleClearActive)
                {
                    ExecuteJungleClear();
                }

                PermaActive();
            };

            Orbwalker.OnPostAttack += Orbwalking_AfterAttack;
            Orbwalker.OnPreAttack += Orbwalking_BeforeAttack;
            GameObject.OnCreate += OnCreateObject;
            GameObject.OnDelete += OnDeleteObject;

            Obj_AI_Base.OnBuffGain += Obj_AI_Base_OnBuffAdd;
            Obj_AI_Base.OnBuffLose += Obj_AI_Base_OnBuffRemove;

            Spellbook.OnCastSpell += Spellbook_OnCastSpell;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            Console.Clear();
        }
コード例 #2
0
        public static void Game_OnGameLoad()
        {
            Config        = MainMenu.AddMenu("Marksman", "Marksman");
            ChampionClass = new Marksman.Champions.Champion();
            Common.CommonGeometry.Init();
            var BaseType = ChampionClass.GetType();

            /* Update this with Activator.CreateInstance or Invoke
             * http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
             * For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
            case "ashe":
                ChampionClass = new Ashe();
                break;

            case "caitlyn":
                ChampionClass = new Caitlyn();
                break;

            case "corki":
                ChampionClass = new Corki();
                break;

            case "draven":
                ChampionClass = new Draven();
                break;

            case "ezreal":
                ChampionClass = new Ezreal();
                break;

            case "gnar":
                ChampionClass = new Gnar();
                break;

            case "graves":
                ChampionClass = new Graves();
                break;

            case "jhin":
                ChampionClass = new Jhin();
                break;

            case "jinx":
                ChampionClass = new Jinx();
                break;

            case "kalista":
                ChampionClass = new Kalista();
                break;

            case "kindred":
                ChampionClass = new Kindred();
                break;

            case "kogmaw":
                ChampionClass = new Kogmaw();
                break;

            case "lucian":
                ChampionClass = new Lucian();
                break;

            case "sivir":
                ChampionClass = new Sivir();
                break;

            case "missfortune":
                ChampionClass = new MissFortune();
                break;

                /*
                 * case "quinn":
                 * ChampionClass = new Quinn();
                 * break;
                 * case "teemo":
                 * ChampionClass = new Teemo();
                 * break;
                 * case "tristana":
                 * ChampionClass = new Tristana();
                 * break;
                 * case "twitch":
                 * ChampionClass = new Twitch();
                 * break;
                 * case "urgot":
                 * ChampionClass = new Urgot();
                 * break;
                 * case "vayne":
                 * ChampionClass = new Vayne();
                 * break;
                 * case "varus":
                 * ChampionClass = new Varus();
                 * break;
                 */
            }
            Config.DisplayName = "Marksman Lite";

            ChampionClass.Config = Config;

            MenuExtraTools = Config.AddSubMenu("Extra Tools", "ExtraTools");
            {
                MenuExtraTools.AddLabel("Press F5 for Load Extra Tools!");
                MenuExtraTools.Add("ExtraTools.Prediction", new ComboBox("Prediction:", 0, "LeagueSharp Common", "SPrediction (Synx)"));
                MenuExtraTools.Add("ExtraTools.AutoLevel", new CheckBox("Auto Leveler:", false));
                MenuExtraTools.Add("ExtraTools.AutoBush", new CheckBox("Auto Bush Ward:", false));
                MenuExtraTools.Add("ExtraTools.AutoPink", new CheckBox("Auto Pink Ward:", false));
                MenuExtraTools.Add("ExtraTools.Emote", new CheckBox("Emote:", false));
                MenuExtraTools.Add("ExtraTools.BuffTimer", new CheckBox("Buff Time Manager:", false));
                MenuExtraTools.Add("ExtraTools.Potition", new CheckBox("Potition Manager:", false));
                MenuExtraTools.Add("ExtraTools.Summoners", new CheckBox("Summoner Manager:", false));
                MenuExtraTools.Add("ExtraTools.Tracker", new CheckBox("Tracker:", false));
            }

            Common.CommonSettings.Init(Config);

            MenuActivator = Config.AddSubMenu("Activator", "Activator");
            {
                MenuActivator.Add("BOTRK", new CheckBox("BOTRK"));
                MenuActivator.Add("GHOSTBLADE", new CheckBox("Ghostblade"));
                MenuActivator.Add("SWORD", new CheckBox("Sword of the Divine"));
                MenuActivator.Add("MURAMANA", new CheckBox("Muramana"));
                MenuActivator.Add("UseItemsMode", new ComboBox("Use items on", 2, "No", "Mixed mode", "Combo mode", "Both"));

                if (MenuExtraTools["ExtraTools.AutoLevel"].Cast <CheckBox>().CurrentValue)
                {
                    Common.CommonAutoLevel.Init(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.AutoPink"].Cast <CheckBox>().CurrentValue)
                {
                    Common.CommonAutoPink.Initialize(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.AutoBush"].Cast <CheckBox>().CurrentValue)
                {
                    Common.CommonAutoBush.Init(MenuActivator);
                }

                if (MenuExtraTools["ExtraTools.Emote"].Cast <CheckBox>().CurrentValue)
                {
                    Common.CommonEmote.Init(MenuActivator);
                }
            }

            // If Champion is supported draw the extra menus
            if (BaseType != ChampionClass.GetType())
            {
                SetSmiteSlot();

                combo = Config.AddSubMenu("Combo", "Combo");
                if (ChampionClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                    {
                        combo.Add("ComboSmite", new CheckBox("Use Smite"));
                    }
                }

                harass = Config.AddSubMenu("Harass", "Harass");
                if (ChampionClass.HarassMenu(harass))
                {
                    harass.Add("HarassMana", new Slider("Min. Mana Percent", 50, 0, 100));
                }

                laneclear = Config.AddSubMenu("Lane Mode", "LaneClear");
                if (ChampionClass.LaneClearMenu(laneclear))
                {
                    laneclear.Add("Lane.Enabled", new KeyBind(":: Enable Lane Farm!", true, KeyBind.BindTypes.PressToggle, 'L'));

                    laneclear.AddGroupLabel("Min. Mana Settings");
                    {
                        laneclear.Add("LaneMana.Alone", new Slider("If I'm Alone %:", 30, 0, 100));
                        laneclear.Add("LaneMana.Enemy", new Slider("If Enemy Close %:", 60, 0, 100));
                    }
                }

                jungleClear = Config.AddSubMenu("Jungle Mode", "JungleClear");
                if (ChampionClass.JungleClearMenu(jungleClear))
                {
                    jungleClear.AddGroupLabel("Min. Mana Settings");
                    {
                        jungleClear.Add("Jungle.Mana.Ally", new Slider("Ally Mobs %:", 50, 0, 100));
                        jungleClear.Add("Jungle.Mana.Enemy", new Slider("Enemy Mobs %:", 30, 0, 100));
                        jungleClear.Add("Jungle.Mana.BigBoys", new Slider("Baron/Dragon %:", 70, 0, 100));
                    }
                    jungleClear.Add("Jungle.Items", new ComboBox(":: Use Items:", 3, "Off", "Use for Baron", "Use for Baron", "Both"));
                    jungleClear.Add("Jungle.Enabled", new KeyBind(":: Enable Jungle Farm!", true, KeyBind.BindTypes.PressToggle, 'J'));
                }

                /*----------------------------------------------------------------------------------------------------------*/
                Obj_AI_Base ally = (from aAllies in HeroManager.Allies from aSupportedChampions in new[] { "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard" } where aSupportedChampions == aAllies.ChampionName.ToLower() select aAllies).FirstOrDefault();

                if (ally != null)
                {
                    menuAllies = Config.AddSubMenu("Ally Combo", "Ally.Combo");
                    {
                        AIHeroClient Leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                        if (Leona != null)
                        {
                            menuAllies.Add("Leona.ComboBuff", new CheckBox("Force Focus Marked Enemy for Bonus Damage"));
                        }

                        AIHeroClient Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                        if (Lux != null)
                        {
                            menuAllies.Add("Lux.ComboBuff", new CheckBox("Force Focus Marked Enemy for Bonus Damage"));
                        }

                        AIHeroClient Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                        if (Shen != null)
                        {
                            menuAllies.Add("Shen.ComboBuff", new CheckBox("Force Focus Q Marked Enemy Objects for Heal"));
                            menuAllies.Add("Shen.ComboBuff", new Slider("Minimum Heal:", 80));
                        }

                        AIHeroClient Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                        if (Tahm != null)
                        {
                            menuAllies.Add("Tahm.ComboBuff", new CheckBox("Force Focus Marked Enemy for Stun"));
                        }

                        AIHeroClient Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                        if (Sona != null)
                        {
                            menuAllies.Add("Sona.ComboBuff", new CheckBox("Force Focus to Marked Enemy"));
                        }

                        AIHeroClient Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                        if (Lulu != null)
                        {
                            menuAllies.Add("Lulu.ComboBuff", new CheckBox("Force Focus to Enemy If I have E buff"));
                        }

                        AIHeroClient Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                        if (Nami != null)
                        {
                            menuAllies.Add("Nami.ComboBuff", new CheckBox("Force Focus to Enemy If I have E Buff"));
                        }
                    }
                }
                /*----------------------------------------------------------------------------------------------------------*/

                misc = Config.AddSubMenu("Misc", "Misc");
                if (ChampionClass.MiscMenu(misc))
                {
                    misc.Add("Misc.SaveManaForUltimate", new CheckBox("Save Mana for Ultimate", false));
                }

                marksmanDrawings = Config.AddSubMenu("Drawings", "MDrawings");
                if (ChampionClass.DrawingMenu(marksmanDrawings))
                {
                    //marksmanDrawings.AddSubMenu(drawing);
                }
                marksmanDrawings.AddGroupLabel("Global");
                {
                    marksmanDrawings.Add("Draw.TurnOff", new ComboBox("Drawings", 1, "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both"));
                    marksmanDrawings.Add("Draw.KillableEnemy", new CheckBox("Killable Enemy Text", false));
                    marksmanDrawings.Add("Draw.MinionLastHit", new ComboBox("Minion Last Hit", 2, "Off", "On", "Just Out of AA Range Minions"));
                    marksmanDrawings.Add("Draw.DrawMinion", new CheckBox("Draw Minions Sprite", false));
                    marksmanDrawings.Add("Draw.DrawTarget", new CheckBox("Draw Target Sprite"));
                    marksmanDrawings.AddGroupLabel("Compare me with");
                    {
                        string[] strCompare = new string[HeroManager.Enemies.Count + 1];
                        strCompare[0] = "Off";
                        var i = 1;
                        foreach (var e in HeroManager.Enemies)
                        {
                            strCompare[i] = e.ChampionName;
                            i            += 1;
                        }
                        marksmanDrawings.Add("Marksman.Compare.Set", new ComboBox("Set", 1, "Off", "Auto Compare at Startup"));
                        marksmanDrawings.Add("Marksman.Compare", new ComboBox("Compare me with", 0, strCompare));
                    }
                }
            }

            ChampionClass.MainMenu(Config);

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate  += Game_OnGameUpdate;
            Game.OnUpdate  += eventArgs =>
            {
                if (ChampionClass.LaneClearActive)
                {
                    ExecuteLaneClear();
                }

                if (ChampionClass.JungleClearActive)
                {
                    ExecuteJungleClear();
                }

                PermaActive();
            };

            Orbwalker.OnPostAttack += Orbwalking_AfterAttack;
            Orbwalker.OnPreAttack  += Orbwalking_BeforeAttack;
            GameObject.OnCreate    += OnCreateObject;
            GameObject.OnDelete    += OnDeleteObject;

            Obj_AI_Base.OnBuffGain += Obj_AI_Base_OnBuffAdd;
            Obj_AI_Base.OnBuffLose += Obj_AI_Base_OnBuffRemove;

            Spellbook.OnCastSpell          += Spellbook_OnCastSpell;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            Console.Clear();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: bongy97/Marksman
        private static void Game_OnGameLoad(EventArgs args)
        {
            Config = new Menu("Marksman", "Marksman", true);
            CClass = new Champion();
            AActivator = new Activator();

            var BaseType = CClass.GetType();

            /* Update this with Activator.CreateInstance or Invoke
               http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
               For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
                case "ashe":
                    CClass = new Ashe();
                    break;
                case "caitlyn":
                    CClass = new Caitlyn();
                    break;
                case "corki":
                    CClass = new Corki();
                    break;
                case "draven":
                    CClass = new Draven();
                    break;
                case "ezreal":
                    CClass = new Ezreal();
                    break;
                case "graves":
                    CClass = new Graves();
                    break;
                case "gnar":
                    CClass = new Gnar();
                    break;
                case "jinx":
                    CClass = new Jinx();
                    break;
                case "kalista":
                    CClass = new Kalista();
                    break;
                case "kogmaw":
                    CClass = new Kogmaw();
                    break;
                case "lucian":
                    CClass = new Lucian();
                    break;
                case "missfortune":
                    CClass = new MissFortune();
                    break;
                case "quinn":
                    CClass = new Quinn();
                    break;
                case "sivir":
                    CClass = new Sivir();
                    break;
                case "teemo":
                    CClass = new Teemo();
                    break;
                case "tristana":
                    CClass = new Tristana();
                    break;
                case "twitch":
                    CClass = new Twitch();
                    break;
                case "urgot":
                    CClass = new Urgot();
                    break;
                case "vayne":
                    CClass = new Vayne();
                    break;
                case "varus":
                    CClass = new Varus();
                    break;
            }

            CClass.Id = ObjectManager.Player.CharData.BaseSkinName;
            CClass.Config = Config;

            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");
            TargetSelector.AddToMenu(targetSelectorMenu);
            Config.AddSubMenu(targetSelectorMenu);

            OrbWalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            CClass.Orbwalker = new Orbwalking.Orbwalker(OrbWalking);

            OrbWalking.AddItem(new MenuItem("Orb.AutoWindUp", "Marksman - Auto Windup").SetValue(false)).ValueChanged +=
                (sender, argsEvent) => { if (argsEvent.GetNewValue<bool>()) CheckAutoWindUp(); };

            /* Menu Summoners */
            var summoners = Config.AddSubMenu(new Menu("Summoners", "Summoners"));
            var summonersHeal = summoners.AddSubMenu(new Menu("Heal", "Heal"));
            {
                summonersHeal.AddItem(new MenuItem("SUMHEALENABLE", "Enable").SetValue(true));
                summonersHeal.AddItem(new MenuItem("SUMHEALSLIDER", "Min. Heal Per.").SetValue(new Slider(20, 99, 1)));
            }

            var summonersBarrier = summoners.AddSubMenu(new Menu("Barrier", "Barrier"));
            {
                summonersBarrier.AddItem(new MenuItem("SUMBARRIERENABLE", "Enable").SetValue(true));
                summonersBarrier.AddItem(
                    new MenuItem("SUMBARRIERSLIDER", "Min. Heal Per.").SetValue(new Slider(20, 99, 1)));
            }

            var summonersIgnite = summoners.AddSubMenu(new Menu("Ignite", "Ignite"));
            {
                summonersIgnite.AddItem(new MenuItem("SUMIGNITEENABLE", "Enable").SetValue(true));
            }
            /* Menu Items */
            var items = Config.AddSubMenu(new Menu("Items", "Items"));
            items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(true));
            items.AddItem(new MenuItem("GHOSTBLADE", "Ghostblade").SetValue(true));
            items.AddItem(new MenuItem("SWORD", "Sword of the Divine").SetValue(true));
            items.AddItem(new MenuItem("MURAMANA", "Muramana").SetValue(true));
            QuickSilverMenu = new Menu("QSS", "QuickSilverSash");
            items.AddSubMenu(QuickSilverMenu);
            QuickSilverMenu.AddItem(new MenuItem("AnyStun", "Any Stun").SetValue(true));
            QuickSilverMenu.AddItem(new MenuItem("AnySlow", "Any Slow").SetValue(true));
            QuickSilverMenu.AddItem(new MenuItem("AnySnare", "Any Snare").SetValue(true));
            QuickSilverMenu.AddItem(new MenuItem("AnyTaunt", "Any Taunt").SetValue(true));
            foreach (var t in AActivator.BuffList)
            {
                foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(enemy => enemy.IsEnemy))
                {
                    if (t.ChampionName == enemy.ChampionName)
                        QuickSilverMenu.AddItem(new MenuItem(t.BuffName, t.DisplayName).SetValue(t.DefaultValue));
                }
            }
            items.AddItem(
                new MenuItem("UseItemsMode", "Use items on").SetValue(
                    new StringList(new[] {"No", "Mixed mode", "Combo mode", "Both"}, 2)));

            //var Extras = Config.AddSubMenu(new Menu("Extras", "Extras"));
            //new PotionManager(Extras);

            // If Champion is supported draw the extra menus
            if (BaseType != CClass.GetType())
            {
                SetSmiteSlot();

                var combo = new Menu("Combo", "Combo");
                if (CClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                        combo.AddItem(new MenuItem("ComboSmite", "Use Smite").SetValue(true));

                    Config.AddSubMenu(combo);
                }

                var harass = new Menu("Harass", "Harass");
                if (CClass.HarassMenu(harass))
                {
                    harass.AddItem(new MenuItem("HarassMana", "Min. Mana Percent").SetValue(new Slider(50, 100, 0)));
                    Config.AddSubMenu(harass);
                }

                var laneclear = new Menu("LaneClear", "LaneClear");
                if (CClass.LaneClearMenu(laneclear))
                {
                    laneclear.AddItem(
                        new MenuItem("LaneClearMana", "Min. Mana Percent").SetValue(new Slider(50, 100, 0)));
                    Config.AddSubMenu(laneclear);
                }

                var misc = new Menu("Misc", "Misc");
                if (CClass.MiscMenu(misc))
                {
                    Config.AddSubMenu(misc);
                }

                var extras = new Menu("Extras", "Extras");
                if (CClass.ExtrasMenu(extras))
                {
                    new PotionManager(extras);
                    Config.AddSubMenu(extras);
                }

                var drawing = new Menu("Drawings", "Drawings");
                if (CClass.DrawingMenu(drawing))
                {
                    drawing.AddItem(new MenuItem("Marksman.Drawings", "Marksman Default Draw Options"));
                    drawing.AddItem(new MenuItem("Draw.ToD", MenuSpace + "Turn Off Drawings On Team Fight").SetValue(false));
                    drawing.AddItem(new MenuItem("Draw.ToDControlRange", MenuSpace + MenuSpace + "Control Range:").SetValue(new Slider(1200, 1600, 600)));
                    drawing.AddItem(new MenuItem("Draw.ToDControlRangeColor", MenuSpace + MenuSpace + "Draw Control Range:").SetValue(new Circle(false, Color.GreenYellow)));
                    drawing.AddItem(new MenuItem("Draw.ToDMinEnemy", MenuSpace + MenuSpace + "Min. Enemy Count:").SetValue(new Slider(3, 5, 0)));

                    drawing.AddItem(new MenuItem("drawMinionLastHit", MenuSpace + "Minion Last Hit").SetValue(new Circle(false,Color.GreenYellow)));
                    drawing.AddItem(new MenuItem("drawMinionNearKill", MenuSpace + "Minion Near Kill").SetValue(new Circle(false,Color.Gray)));
                    drawing.AddItem(
                        new MenuItem("drawJunglePosition", MenuSpace + "Jungle Farm Position").SetValue(false));
                    drawing.AddItem(new MenuItem("Draw.DrawMinion", MenuSpace + "Draw Minions Sprite").SetValue(false));
                    drawing.AddItem(new MenuItem("Draw.DrawTarget", MenuSpace + "Draw Target Sprite").SetValue(false));
                    //drawing.AddItem(new MenuItem("Draw.DrawSTarget", MenuSpace + "Draw Selected Target", true).SetValue(new Circle(false,Color.GreenYellow)));
                    Config.AddSubMenu(drawing);
                }
            }

            CClass.MainMenu(Config);
            Config.AddToMainMenu();
            Sprite.Load();

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate += Game_OnGameUpdate;
            Orbwalking.AfterAttack += Orbwalking_AfterAttack;
            Orbwalking.BeforeAttack += Orbwalking_BeforeAttack;
            //Game.OnWndProc += Game_OnWndProc;
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Deprive/Private
        private static void Game_OnGameLoad(EventArgs args)
        {
            Config = new Menu("Marksman", "Marksman", true).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
            CClass = new Champion();

            var BaseType = CClass.GetType();

            /* Update this with Activator.CreateInstance or Invoke
               http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string 
               For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
                case "ashe":
                    CClass = new Ashe();
                    break;
                case "caitlyn":
                    CClass = new Caitlyn();
                    break;
                case "corki":
                    CClass = new Corki();
                    break;
                case "draven":
                    CClass = new Draven();
                    break;
                case "ezreal":
                    CClass = new Ezreal();
                    break;
                case "graves":
                    CClass = new Graves();
                    break;
                case "gnar":
                    CClass = new Gnar();
                    break;
                case "jinx":
                    CClass = new Jinx();
                    break;
                case "kalista":
                    CClass = new Kalista();
                    break;
                case "kindred":
                    CClass = new Kindred();
                    break;
                case "kogmaw":
                    CClass = new Kogmaw();
                    break;
                case "lucian":
                    CClass = new Lucian();
                    break;
                case "missfortune":
                    CClass = new MissFortune();
                    break;
                case "quinn":
                    CClass = new Quinn();
                    break;
                case "sivir":
                    CClass = new Sivir();
                    break;
                case "teemo":
                    CClass = new Teemo();
                    break;
                case "tristana":
                    CClass = new Tristana();
                    break;
                case "twitch":
                    CClass = new Twitch();
                    break;
                case "urgot":
                    CClass = new Urgot();
                    break;
                case "vayne":
                    CClass = new Vayne();
                    break;
                case "varus":
                    CClass = new Varus();
                    break;
            }
            Config.DisplayName = "Marksman | " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName);

            CClass.Id = ObjectManager.Player.CharData.BaseSkinName;
            CClass.Config = Config;

            OrbWalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            CClass.Orbwalker = new Marksman.Utils.Orbwalking.Orbwalker(OrbWalking);

            OrbWalking.AddItem(new MenuItem("Orb.AutoWindUp", "Marksman - Auto Windup").SetValue(false)).ValueChanged +=
                (sender, argsEvent) => { if (argsEvent.GetNewValue<bool>()) CheckAutoWindUp(); };
            AActivator = new Activator();

            MenuActivator = new Menu("Activator", "Activator").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aqua);
            {
                AutoLevel = new Utils.AutoLevel();
                AutoPink = new Utils.AutoPink();
                AutoPink.Initialize();
                IncomingDangerous.Initialize();
                ExecutedTime.Initialize();
                AutoBushRevealer = new AutoBushRevealer();
                //EarlyEvade = new Utils.EarlyEvade();
                //MenuActivator.AddSubMenu(EarlyEvade.MenuLocal);

                /* Menu Items */
                var items = MenuActivator.AddSubMenu(new Menu("Items", "Items"));
                items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(false));
                items.AddItem(new MenuItem("GHOSTBLADE", "Ghostblade").SetValue(false));
                items.AddItem(new MenuItem("SWORD", "Sword of the Divine").SetValue(false));
                items.AddItem(new MenuItem("MURAMANA", "Muramana").SetValue(false));
                QuickSilverMenu = new Menu("QSS", "QuickSilverSash");
                items.AddSubMenu(QuickSilverMenu);
                QuickSilverMenu.AddItem(new MenuItem("AnyStun", "Any Stun").SetValue(false));
                QuickSilverMenu.AddItem(new MenuItem("AnySlow", "Any Slow").SetValue(false));
                QuickSilverMenu.AddItem(new MenuItem("AnySnare", "Any Snare").SetValue(false));
                QuickSilverMenu.AddItem(new MenuItem("AnyTaunt", "Any Taunt").SetValue(false));
                foreach (var t in AActivator.BuffList)
                {
                    foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(enemy => enemy.IsEnemy))
                    {
                        if (t.ChampionName == enemy.ChampionName)
                            QuickSilverMenu.AddItem(new MenuItem(t.BuffName, t.DisplayName).SetValue(t.DefaultValue));
                    }
                }
                items.AddItem(
                    new MenuItem("UseItemsMode", "Use items on").SetValue(
                        new StringList(new[] { "No", "Mixed mode", "Combo mode", "Both" }, 2)));

                new PotionManager(MenuActivator);

                /* Menu Summoners */
                var summoners = MenuActivator.AddSubMenu(new Menu("Summoners", "Summoners"));
                {
                    var summonersHeal = summoners.AddSubMenu(new Menu("Heal", "Heal"));
                    {
                        summonersHeal.AddItem(new MenuItem("SUMHEALENABLE", "Enable").SetValue(false));
                        summonersHeal.AddItem(
                            new MenuItem("SUMHEALSLIDER", "Min. Heal Per.").SetValue(new Slider(20, 99, 1)));
                    }

                    var summonersBarrier = summoners.AddSubMenu(new Menu("Barrier", "Barrier"));
                    {
                        summonersBarrier.AddItem(new MenuItem("SUMBARRIERENABLE", "Enable").SetValue(false));
                        summonersBarrier.AddItem(
                            new MenuItem("SUMBARRIERSLIDER", "Min. Heal Per.").SetValue(new Slider(20, 99, 1)));
                    }

                    var summonersIgnite = summoners.AddSubMenu(new Menu("Ignite", "Ignite"));
                    {
                        summonersIgnite.AddItem(new MenuItem("SUMIGNITEENABLE", "Enable").SetValue(false));
                    }
                }
            }
            Config.AddSubMenu(MenuActivator);
            //var Extras = Config.AddSubMenu(new Menu("Extras", "Extras"));
            //new PotionManager(Extras);

            // If Champion is supported draw the extra menus
            if (BaseType != CClass.GetType())
            {
                SetSmiteSlot();

                var combo = new Menu("Combo", "Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                if (CClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                        combo.AddItem(new MenuItem("ComboSmite", "Use Smite").SetValue(true));

                    Config.AddSubMenu(combo);
                }

                var harass = new Menu("Harass", "Harass");
                if (CClass.HarassMenu(harass))
                {
                    harass.AddItem(new MenuItem("HarassMana", "Min. Mana Percent").SetValue(new Slider(40, 100, 0)));
                    Config.AddSubMenu(harass);
                }

                var laneclear = new Menu("Lane Mode", "LaneClear");
                if (CClass.LaneClearMenu(laneclear))
                {
                    laneclear.AddItem(new MenuItem("Lane.Enabled", ":: Enable Lane Farm!").SetValue(new KeyBind("v".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marsman | Enable Lane Farm", SharpDX.Color.Aqua);

                    var minManaMenu = new Menu("Min. Mana Settings", "Lane.MinMana.Title");
                    {
                        minManaMenu.AddItem(new MenuItem("LaneMana.Alone", "If I'm Alone %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, Color.LightSkyBlue);
                        minManaMenu.AddItem(new MenuItem("LaneMana.Enemy", "If Enemy Close %:").SetValue(new Slider(50, 100, 0))).SetFontStyle(FontStyle.Regular, Color.IndianRed);
                        laneclear.AddSubMenu(minManaMenu);
                    }
                    Config.AddSubMenu(laneclear);
                }

                var jungleClear = new Menu("Jungle Mode", "JungleClear");
                if (CClass.JungleClearMenu(jungleClear))
                {
                    var minManaMenu = new Menu("Min. Mana Settings", "Jungle.MinMana.Title");
                    {
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Ally", "Ally Mobs %:").SetValue(new Slider(50, 100, 0))).SetFontStyle(FontStyle.Regular, Color.LightSkyBlue);
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Enemy", "Enemy Mobs %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, Color.IndianRed);
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.BigBoys", "Baron/Dragon %:").SetValue(new Slider(70, 100, 0))).SetFontStyle(FontStyle.Regular, Color.HotPink);
                        jungleClear.AddSubMenu(minManaMenu);
                    }
                    jungleClear.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] { "Off", "Use for Baron", "Use for Baron", "Both" }, 3)));
                    jungleClear.AddItem(new MenuItem("Jungle.Enabled", ":: Enable Jungle Farm!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marsman | Enable Jungle Farm", SharpDX.Color.Aqua);
                    Config.AddSubMenu(jungleClear);
                }

                /*----------------------------------------------------------------------------------------------------------*/
                Obj_AI_Base ally = (from aAllies in HeroManager.Allies
                                    from aSupportedChampions in
                                        new[]
                                            {
                                                "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard"
                                            }
                                    where aSupportedChampions == aAllies.ChampionName.ToLower()
                                    select aAllies).FirstOrDefault();

                if (ally != null)
                {
                    var menuAllies = new Menu("Ally Combo", "Ally.Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.Crimson);
                    {
                        Obj_AI_Hero Leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                        if (Leona != null)
                        {
                            var menuLeona = new Menu("Leona", "Leona");
                            menuLeona.AddItem(new MenuItem("Leona.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                            menuAllies.AddSubMenu(menuLeona);
                        }

                        Obj_AI_Hero Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                        if (Lux != null)
                        {
                            var menuLux = new Menu("Lux", "Lux");
                            menuLux.AddItem(new MenuItem("Lux.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                            menuAllies.AddSubMenu(menuLux);
                        }

                        Obj_AI_Hero Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                        if (Shen != null)
                        {
                            var menuShen = new Menu("Shen", "Shen");
                            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Force Focus Q Marked Enemy Objects for Heal").SetValue(true));
                            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Minimum Heal:").SetValue(new Slider(80)));
                            menuAllies.AddSubMenu(menuShen);
                        }

                        Obj_AI_Hero Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                        if (Tahm != null)
                        {
                            var menuTahm = new Menu("Tahm", "Tahm");
                            menuTahm.AddItem(new MenuItem("Tahm.ComboBuff", "Force Focus Marked Enemy for Stun").SetValue(true));
                            menuAllies.AddSubMenu(menuTahm);
                        }

                        Obj_AI_Hero Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                        if (Sona != null)
                        {
                            var menuSona = new Menu("Sona", "Sona");
                            menuSona.AddItem(new MenuItem("Sona.ComboBuff", "Force Focus to Marked Enemy").SetValue(true));
                            menuAllies.AddSubMenu(menuSona);
                        }

                        Obj_AI_Hero Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                        if (Lulu != null)
                        {
                            var menuLulu = new Menu("Lulu", "Lulu");
                            menuLulu.AddItem(new MenuItem("Lulu.ComboBuff", "Force Focus to Enemy If I have E buff").SetValue(true));
                            menuAllies.AddSubMenu(menuLulu);
                        }

                        Obj_AI_Hero Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                        if (Nami != null)
                        {
                            var menuNami = new Menu("Nami", "Nami");
                            menuNami.AddItem(new MenuItem("Nami.ComboBuff", "Force Focus to Enemy If I have E Buff").SetValue(true));
                            menuAllies.AddSubMenu(menuNami);
                        }
                    }
                    Config.AddSubMenu(menuAllies);
                }
                /*----------------------------------------------------------------------------------------------------------*/

                var misc = new Menu("Misc", "Misc").SetFontStyle(FontStyle.Regular, SharpDX.Color.DarkOrange);
                if (CClass.MiscMenu(misc))
                {
                    misc.AddItem(new MenuItem("Misc.SaveManaForUltimate", "Save Mana for Ultimate").SetValue(false));                    
                    Config.AddSubMenu(misc);
                }
                /*
                                var extras = new Menu("Extras", "Extras");
                                if (CClass.ExtrasMenu(extras))
                                {
                                    Config.AddSubMenu(extras);
                                }
                 */

                var marksmanDrawings = new Menu("Drawings", "MDrawings");
                Config.AddSubMenu(marksmanDrawings);

                var drawing = new Menu(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName), "Drawings").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aquamarine);
                if (CClass.DrawingMenu(drawing))
                {
                    marksmanDrawings.AddSubMenu(drawing);
                }

                var GlobalDrawings = new Menu("Global", "GDrawings");
                {
                    marksmanDrawings.AddItem(new MenuItem("Draw.TurnOff", "Drawings").SetValue(new StringList(new[] { "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both" }, 1)));
                    var menuCompare = new Menu("Compare me with", "Menu.Compare");
                    {
                        string[] strCompare = new string[HeroManager.Enemies.Count + 1];
                        strCompare[0] = "Off";
                        var i = 1;
                        foreach (var e in HeroManager.Enemies)
                        {
                            strCompare[i] = e.ChampionName;
                            i += 1;
                        }
                        menuCompare.AddItem(new MenuItem("Marksman.Compare.Set", "Set").SetValue(new StringList(new[] { "Off", "Auto Compare at Startup" }, 1)));
                        menuCompare.AddItem(new MenuItem("Marksman.Compare", "Compare me with").SetValue(new StringList(strCompare, 0)));
                        GlobalDrawings.AddSubMenu(menuCompare);
                    }

                    GlobalDrawings.AddItem(new MenuItem("Draw.KillableEnemy", "Killable Enemy Text").SetValue(false));
                    GlobalDrawings.AddItem(new MenuItem("Draw.MinionLastHit", "Minion Last Hit").SetValue(new StringList(new[] { "Off", "On", "Just Out of AA Range Minions" }, 2)));



                    //GlobalDrawings.AddItem(new MenuItem("Draw.JunglePosition", "Jungle Farm Position").SetValue(new StringList(new[] { "Off", "If I'm Close to Mobs", "If Jungle Clear Active" }, 2)));
                    GlobalDrawings.AddItem(new MenuItem("Draw.DrawMinion", "Draw Minions Sprite").SetValue(false));
                    GlobalDrawings.AddItem(new MenuItem("Draw.DrawTarget", "Draw Target Sprite").SetValue(true));
                    marksmanDrawings.AddSubMenu(GlobalDrawings);

                }
            }

            if (Config.Item("Marksman.Compare.Set").GetValue<StringList>().SelectedIndex == 1)
            {
                LoadDefaultCompareChampion();
            }

            CClass.MainMenu(Config);

            if (championName == "sivir")
            {
                Evade.Evade.Initiliaze();
                Evade.Config.Menu.DisplayName = "E";
                Config.AddSubMenu(Evade.Config.Menu);
            }

            //Evade.Evade.Initiliaze();
            //Config.AddSubMenu(Evade.Config.Menu);

            Config.AddToMainMenu();

            foreach (var i in Config.Children.Cast<Menu>().SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }

            Sprite.Load();
            CheckAutoWindUp();

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate += Game_OnGameUpdate;
            Game.OnUpdate += eventArgs =>
            {

                if (CClass.FleeActive)
                {
                    ExecuteFlee();
                }

                if (CClass.LaneClearActive)
                {
                    ExecuteLaneClear();
                }

                if (CClass.JungleClearActive)
                {
                    ExecuteJungleClear();
                }

                PermaActive();
            };

            Marksman.Utils.Orbwalking.AfterAttack += Orbwalking_AfterAttack;
            Marksman.Utils.Orbwalking.BeforeAttack += Orbwalking_BeforeAttack;
            GameObject.OnCreate += OnCreateObject;
            GameObject.OnDelete += OnDeleteObject;

            Obj_AI_Base.OnBuffAdd += Obj_AI_Base_OnBuffAdd;
            Obj_AI_Base.OnBuffRemove += Obj_AI_Base_OnBuffRemove;

            Spellbook.OnCastSpell += Spellbook_OnCastSpell;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            AsmLoadingTime = Game.Time;
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: CjShu/xQx-LeagueSharp
        private static void Game_OnGameLoad(EventArgs args)
        {
            Config = new Menu("Marksman", "Marksman", true).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
            ChampionClass = new Champion();
            Common.CommonGeometry.Init();
            var BaseType = ChampionClass.GetType();

            /* Update this with Activator.CreateInstance or Invoke
               http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
               For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
                case "ashe":
                    ChampionClass = new Ashe();
                    break;
                case "caitlyn":
                    ChampionClass = new Caitlyn();
                    break;
                case "corki":
                    ChampionClass = new Corki();
                    break;
                case "draven":
                    ChampionClass = new Draven();
                    break;
                case "ezreal":
                    ChampionClass = new Ezreal();
                    break;
                case "graves":
                    ChampionClass = new Graves();
                    break;
                case "gnar":
                    ChampionClass = new Gnar();
                    break;
                case "jinx":
                    ChampionClass = new Jinx();
                    break;
                case "kalista":
                    ChampionClass = new Kalista();
                    break;
                case "kindred":
                    ChampionClass = new Kindred();
                    break;
                case "kogmaw":
                    ChampionClass = new Kogmaw();
                    break;
                case "lucian":
                    ChampionClass = new Lucian();
                    break;
                case "missfortune":
                    ChampionClass = new MissFortune();
                    break;
                case "quinn":
                    ChampionClass = new Quinn();
                    break;
                case "sivir":
                    ChampionClass = new Sivir();
                    break;
                case "teemo":
                    ChampionClass = new Teemo();
                    break;
                case "tristana":
                    ChampionClass = new Tristana();
                    break;
                case "twitch":
                    ChampionClass = new Twitch();
                    break;
                case "urgot":
                    ChampionClass = new Urgot();
                    break;
                case "vayne":
                    ChampionClass = new Vayne();
                    break;
                case "varus":
                    ChampionClass = new Varus();
                    break;
            }
            //Config.DisplayName = "Marksman Lite | " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName);
            Config.DisplayName = "Marksman Lite";

            ChampionClass.Id = ObjectManager.Player.CharData.BaseSkinName;
            ChampionClass.Config = Config;

            MenuExtraTools = new Menu("Extra Tools", "ExtraTools").SetFontStyle(FontStyle.Regular, Color.Aqua);
            {
                var nMenuExtraToolsPackets = new Menu("Available Tools", "MenuExtraTools.Available");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Orbwalker", "Orbwalker:")).SetValue(new StringList(new[] { "LeagueSharp Common", "Marksman Orbwalker (With Attack Speed Limiter)" })).SetFontStyle(FontStyle.Regular, Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Prediction", "Prediction:")).SetValue(new StringList(new[] { "LeagueSharp Common", "SPrediction (Synx)"})).SetFontStyle(FontStyle.Regular, Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoLevel", "Auto Leveller:")).SetValue(false);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoBush", "Auto Bush Ward:")).SetValue(false);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoPink", "Auto Pink Ward:")).SetValue(false).SetTooltip("For rengar / vayne / shaco etc.");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Skin", "Skin Manager:")).SetValue(false);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Emote", "Emote:")).SetValue(false);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.BuffTimer", "Buff Time Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Potition", "Potition Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Summoners", "Summoner Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Tracker", "Tracker:")).SetValue(false).SetFontStyle(FontStyle.Regular, Color.Gray);

                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Reload", "Press F5 for Load Extra Tools!")).SetFontStyle(FontStyle.Bold, Color.GreenYellow);

                MenuExtraTools.AddSubMenu(nMenuExtraToolsPackets);

                MenuExtraToolsActivePackets = new Menu("Installed Tools", "MenuExtraTools.Installed").SetFontStyle(FontStyle.Regular, Color.GreenYellow);
                MenuExtraTools.AddSubMenu(MenuExtraToolsActivePackets);
            }
            Config.AddSubMenu(MenuExtraTools);

            Common.CommonSettings.Init(Config);

            OrbWalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            ChampionClass.Orbwalker = new Orb.Orbwalking.Orbwalker(OrbWalking);
            //Orb.Orbwalking.Orbwalker Orbwalker = new Orb.Orbwalking.Orbwalker(OrbWalking);

            //if (MenuExtraTools.Item("ExtraTools.Orbwalker").GetValue<StringList>().SelectedIndex == 0)
            //{
            //    ChampionClass.OrbwalkerM = new Orbwalking.Orbwalker(OrbWalking);
            //    Orbwalking.Orbwalker OrbwalkerM = new Orbwalking.Orbwalker(OrbWalking);
            //}

            //if (MenuExtraTools.Item("ExtraTools.Orbwalker").GetValue<StringList>().SelectedIndex == 1)
            //{
            //    ChampionClass.Orbwalker = new Orb.Orbwalking.Orbwalker(OrbWalking);
            //    Orb.Orbwalking.Orbwalker Orbwalker = new Orb.Orbwalking.Orbwalker(OrbWalking);
            //}

            MenuActivator = new Menu("Activator", "Activator").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aqua);
            {
                if (MenuExtraTools.Item("ExtraTools.AutoLevel").GetValue<bool>())
                {
                    Common.CommonAutoLevel.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoPink").GetValue<bool>())
                {
                    Common.CommonAutoPink.Initialize(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoBush").GetValue<bool>())
                {
                    Common.CommonAutoBush.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Skin").GetValue<bool>())
                {
                    Common.CommonSkinManager.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Emote").GetValue<bool>())
                {
                    Common.CommonEmote.Init(MenuExtraToolsActivePackets);
                }

                /* Menu Items */
                var items = MenuActivator.AddSubMenu(new Menu("Items", "Items"));
                items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(true));
                items.AddItem(new MenuItem("GHOSTBLADE", "Ghostblade").SetValue(true));
                items.AddItem(new MenuItem("SWORD", "Sword of the Divine").SetValue(true));
                items.AddItem(new MenuItem("MURAMANA", "Muramana").SetValue(true));
                items.AddItem(
                    new MenuItem("UseItemsMode", "Use items on").SetValue(
                        new StringList(new[] { "No", "Mixed mode", "Combo mode", "Both" }, 2)));
            }
            Config.AddSubMenu(MenuActivator);

            // If Champion is supported draw the extra menus
            if (BaseType != ChampionClass.GetType())
            {
                SetSmiteSlot();

                var combo = new Menu("Combo", "Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                if (ChampionClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                        combo.AddItem(new MenuItem("ComboSmite", "Use Smite").SetValue(true));

                    Config.AddSubMenu(combo);
                }

                var harass = new Menu("Harass", "Harass");
                if (ChampionClass.HarassMenu(harass))
                {
                    harass.AddItem(new MenuItem("HarassMana", "Min. Mana Percent").SetValue(new Slider(50, 100, 0)));
                    Config.AddSubMenu(harass);
                }

                var laneclear = new Menu("Lane Mode", "LaneClear");
                if (ChampionClass.LaneClearMenu(laneclear))
                {
                    laneclear.AddItem(new MenuItem("Lane.Enabled", ":: Enable Lane Farm!").SetValue(new KeyBind("L".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Lane Farm", SharpDX.Color.Aqua);

                    var minManaMenu = new Menu("Min. Mana Settings", "Lane.MinMana.Title");
                    {
                        minManaMenu.AddItem(new MenuItem("LaneMana.Alone", "If I'm Alone %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, Color.LightSkyBlue);
                        minManaMenu.AddItem(new MenuItem("LaneMana.Enemy", "If Enemy Close %:").SetValue(new Slider(60, 100, 0))).SetFontStyle(FontStyle.Regular, Color.IndianRed);
                        laneclear.AddSubMenu(minManaMenu);
                    }
                    Config.AddSubMenu(laneclear);
                }

                var jungleClear = new Menu("Jungle Mode", "JungleClear");
                if (ChampionClass.JungleClearMenu(jungleClear))
                {
                    var minManaMenu = new Menu("Min. Mana Settings", "Jungle.MinMana.Title");
                    {
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Ally", "Ally Mobs %:").SetValue(new Slider(50, 100, 0))).SetFontStyle(FontStyle.Regular, Color.LightSkyBlue);
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Enemy", "Enemy Mobs %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, Color.IndianRed);
                        minManaMenu.AddItem(new MenuItem("Jungle.Mana.BigBoys", "Baron/Dragon %:").SetValue(new Slider(70, 100, 0))).SetFontStyle(FontStyle.Regular, Color.HotPink);
                        jungleClear.AddSubMenu(minManaMenu);
                    }
                    jungleClear.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] { "Off", "Use for Baron", "Use for Baron", "Both" }, 3)));
                    jungleClear.AddItem(new MenuItem("Jungle.Enabled", ":: Enable Jungle Farm!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Jungle Farm", SharpDX.Color.Aqua);
                    Config.AddSubMenu(jungleClear);
                }

                /*----------------------------------------------------------------------------------------------------------*/
                Obj_AI_Base ally = (from aAllies in HeroManager.Allies
                    from aSupportedChampions in
                        new[]
                        {
                            "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard"
                        }
                    where aSupportedChampions == aAllies.ChampionName.ToLower()
                    select aAllies).FirstOrDefault();

                if (ally != null)
                {
                    var menuAllies = new Menu("Ally Combo", "Ally.Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.Crimson);
                    {
                        Obj_AI_Hero Leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                        if (Leona != null)
                        {
                            var menuLeona = new Menu("Leona", "Leona");
                            menuLeona.AddItem(new MenuItem("Leona.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                            menuAllies.AddSubMenu(menuLeona);
                        }

                        Obj_AI_Hero Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                        if (Lux != null)
                        {
                            var menuLux = new Menu("Lux", "Lux");
                            menuLux.AddItem(new MenuItem("Lux.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                            menuAllies.AddSubMenu(menuLux);
                        }

                        Obj_AI_Hero Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                        if (Shen != null)
                        {
                            var menuShen = new Menu("Shen", "Shen");
                            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Force Focus Q Marked Enemy Objects for Heal").SetValue(true));
                            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Minimum Heal:").SetValue(new Slider(80)));
                            menuAllies.AddSubMenu(menuShen);
                        }

                        Obj_AI_Hero Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                        if (Tahm != null)
                        {
                            var menuTahm = new Menu("Tahm", "Tahm");
                            menuTahm.AddItem(new MenuItem("Tahm.ComboBuff", "Force Focus Marked Enemy for Stun").SetValue(true));
                            menuAllies.AddSubMenu(menuTahm);
                        }

                        Obj_AI_Hero Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                        if (Sona != null)
                        {
                            var menuSona = new Menu("Sona", "Sona");
                            menuSona.AddItem(new MenuItem("Sona.ComboBuff", "Force Focus to Marked Enemy").SetValue(true));
                            menuAllies.AddSubMenu(menuSona);
                        }

                        Obj_AI_Hero Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                        if (Lulu != null)
                        {
                            var menuLulu = new Menu("Lulu", "Lulu");
                            menuLulu.AddItem(new MenuItem("Lulu.ComboBuff", "Force Focus to Enemy If I have E buff").SetValue(true));
                            menuAllies.AddSubMenu(menuLulu);
                        }

                        Obj_AI_Hero Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                        if (Nami != null)
                        {
                            var menuNami = new Menu("Nami", "Nami");
                            menuNami.AddItem(new MenuItem("Nami.ComboBuff", "Force Focus to Enemy If I have E Buff").SetValue(true));
                            menuAllies.AddSubMenu(menuNami);
                        }
                    }
                    Config.AddSubMenu(menuAllies);
                }
                /*----------------------------------------------------------------------------------------------------------*/

                var misc = new Menu("Misc", "Misc").SetFontStyle(FontStyle.Regular, SharpDX.Color.DarkOrange);
                if (ChampionClass.MiscMenu(misc))
                {
                    misc.AddItem(new MenuItem("Misc.SaveManaForUltimate", "Save Mana for Ultimate").SetValue(false));
                    Config.AddSubMenu(misc);
                }
                /*
                                var extras = new Menu("Extras", "Extras");
                                if (ChampionClass.ExtrasMenu(extras))
                                {
                                    Config.AddSubMenu(extras);
                                }
                 */

                var marksmanDrawings = new Menu("Drawings", "MDrawings");
                Config.AddSubMenu(marksmanDrawings);

                var drawing = new Menu(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName), "Drawings").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aquamarine);
                if (ChampionClass.DrawingMenu(drawing))
                {
                    marksmanDrawings.AddSubMenu(drawing);
                }

                var GlobalDrawings = new Menu("Global", "GDrawings");
                {
                    marksmanDrawings.AddItem(new MenuItem("Draw.TurnOff", "Drawings").SetValue(new StringList(new[] { "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both" }, 1)));
                    var menuCompare = new Menu("Compare me with", "Menu.Compare");
                    {
                        string[] strCompare = new string[HeroManager.Enemies.Count + 1];
                        strCompare[0] = "Off";
                        var i = 1;
                        foreach (var e in HeroManager.Enemies)
                        {
                            strCompare[i] = e.ChampionName;
                            i += 1;
                        }
                        menuCompare.AddItem(new MenuItem("Marksman.Compare.Set", "Set").SetValue(new StringList(new[] { "Off", "Auto Compare at Startup" }, 1)));
                        menuCompare.AddItem(new MenuItem("Marksman.Compare", "Compare me with").SetValue(new StringList(strCompare, 0)));
                        GlobalDrawings.AddSubMenu(menuCompare);
                    }

                    GlobalDrawings.AddItem(new MenuItem("Draw.KillableEnemy", "Killable Enemy Text").SetValue(false));
                    GlobalDrawings.AddItem(new MenuItem("Draw.MinionLastHit", "Minion Last Hit").SetValue(new StringList(new[] { "Off", "On", "Just Out of AA Range Minions" }, 2)));

                    //GlobalDrawings.AddItem(new MenuItem("Draw.JunglePosition", "Jungle Farm Position").SetValue(new StringList(new[] { "Off", "If I'm Close to Mobs", "If Jungle Clear Active" }, 2)));
                    GlobalDrawings.AddItem(new MenuItem("Draw.DrawMinion", "Draw Minions Sprite").SetValue(false));
                    GlobalDrawings.AddItem(new MenuItem("Draw.DrawTarget", "Draw Target Sprite").SetValue(true));
                    marksmanDrawings.AddSubMenu(GlobalDrawings);

                }
            }

            ChampionClass.MainMenu(Config);

            //Evade.Evade.Initiliaze();
            //Config.AddSubMenu(Evade.Config.Menu);

            Config.AddToMainMenu();

            foreach (var i in Config.Children.Cast<Menu>().SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }

            //CheckAutoWindUp();

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate += Game_OnGameUpdate;
            Game.OnUpdate += eventArgs =>
            {
                if (ChampionClass.LaneClearActive)
                {
                    ExecuteLaneClear();
                }

                if (ChampionClass.JungleClearActive)
                {
                    ExecuteJungleClear();
                }

                PermaActive();
            };

            Orb.Orbwalking.AfterAttack += Orbwalking_AfterAttack;
            Orb.Orbwalking.BeforeAttack += Orbwalking_BeforeAttack;
            GameObject.OnCreate += OnCreateObject;
            GameObject.OnDelete += OnDeleteObject;

            Obj_AI_Base.OnBuffAdd += Obj_AI_Base_OnBuffAdd;
            Obj_AI_Base.OnBuffRemove += Obj_AI_Base_OnBuffRemove;

            Spellbook.OnCastSpell += Spellbook_OnCastSpell;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            Console.Clear();
        }
コード例 #6
0
        public static void Game_OnGameLoad()
        {
            Config        = new Menu("Marksman", "Marksman", true).SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
            ChampionClass = new Marksman.Champions.Champion();
            CommonGeometry.Init();
            var baseType = ChampionClass.GetType();

            igniteSlot = ObjectManager.Player.GetSpellSlot("summonerdot");

            /* Update this with Activator.CreateInstance or Invoke
             * http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
             * For now stays cancer.
             */
            var championName = ObjectManager.Player.ChampionName.ToLowerInvariant();

            switch (championName)
            {
            case "ashe":
                ChampionClass = new Ashe();
                break;

            case "caitlyn":
                ChampionClass = new Caitlyn();
                break;

            case "corki":
                ChampionClass = new Corki();
                break;

            case "draven":
                ChampionClass = new Draven();
                break;

            case "ezreal":
                ChampionClass = new Ezreal();
                break;

            case "graves":
                ChampionClass = new Graves();
                break;

            case "gnar":
                ChampionClass = new Champions.Gnar();
                break;

            case "jhin":
                ChampionClass = new Jhin();
                break;

            case "jinx":
                ChampionClass = new Jinx();
                break;

            case "kalista":
                ChampionClass = new Kalista();
                break;

            case "kindred":
                ChampionClass = new Kindred();
                break;

            case "kogmaw":
                ChampionClass = new Kogmaw();
                break;

            case "lucian":
                ChampionClass = new Lucian();
                break;

            case "missfortune":
                ChampionClass = new MissFortune();
                break;

            case "quinn":
                ChampionClass = new Quinn();
                break;

            case "sivir":
                ChampionClass = new Sivir();
                break;

            case "teemo":
                ChampionClass = new Teemo();
                break;

            case "tristana":
                ChampionClass = new Tristana();
                break;

            case "twitch":
                ChampionClass = new Twitch();
                break;

            case "urgot":
                ChampionClass = new Urgot();
                break;

            case "vayne":
                ChampionClass = new Vayne();
                break;

            case "varus":
                ChampionClass = new Varus();
                break;

            default:
                Chat.Print(ObjectManager.Player.CharData.BaseSkinName + " Doesn't support from Marksman!");
                break;
            }
            //Config.DisplayName = "Marksman Lite | " + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName);
            Config.DisplayName = "Marksman II - " + ObjectManager.Player.ChampionName;

            ChampionClass.Id         = ObjectManager.Player.CharData.BaseSkinName;
            ChampionClass.Config     = Config;
            ChampionClass.MenuLane   = MenuLane;
            ChampionClass.MenuJungle = MenuJungle;

            MenuExtraTools = new Menu("Marksman II - Tools", "ExtraTools", true).SetFontStyle(FontStyle.Regular,
                                                                                              SharpDX.Color.GreenYellow);
            {
                var nMenuExtraToolsPackets = new Menu("Available Tools", "MenuExtraTools.Available");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Orbwalker", "Orbwalker:")).SetValue(new StringList(new[] { "LeagueSharp Common", "Marksman Orbwalker (With Attack Speed Limiter)" })).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Prediction", "Prediction:")).SetValue(new StringList(new[] { "LeagueSharp Common", "SPrediction (Synx)" })).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoLevel", "Auto Leveller:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoBush", "Auto Bush Ward:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AutoPink", "Auto Pink Ward:")).SetValue(true).SetTooltip("For rengar / vayne / shaco etc.");
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.WarningSpells", "Warning Spells [NEW]:")).SetValue(true).SetTooltip("For Rengar R / Shaco Q etc.").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Skin", "Skin Manager:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Emote", "Emote:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.AllySupport", "Ally Support:")).SetValue(true);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.BuffTimer", "Buff Time Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Potition", "Potition Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Summoners", "Summoner Manager:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);
                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Tracker", "Tracker:")).SetValue(false).SetFontStyle(FontStyle.Regular, SharpDX.Color.Gray);

                nMenuExtraToolsPackets.AddItem(new MenuItem("ExtraTools.Reload", "Press F5 for Load Extra Tools!")).SetFontStyle(FontStyle.Bold, SharpDX.Color.GreenYellow);

                MenuExtraTools.AddSubMenu(nMenuExtraToolsPackets);

                MenuExtraToolsActivePackets = new Menu("Installed Tools", "MenuExtraTools.Installed").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);

                MenuExtraTools.AddSubMenu(MenuExtraToolsActivePackets);
            }

            CommonSettings.Init(Config);

            OrbWalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            ChampionClass.Orbwalker = new Orbwalking.Orbwalker(OrbWalking);

            MenuActivator = new Menu("Activator", "Activator").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aqua);
            {
                if (MenuExtraTools.Item("ExtraTools.AutoLevel").GetValue <bool>())
                {
                    CommonAutoLevel.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoPink").GetValue <bool>())
                {
                    CommonAutoPink.Initialize(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.WarningSpells").GetValue <bool>())
                {
                    CommonWarningSpelss.Initialize(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AutoBush").GetValue <bool>())
                {
                    CommonAutoBush.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Skin").GetValue <bool>())
                {
                    CommonSkinManager.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.Emote").GetValue <bool>())
                {
                    CommonEmote.Init(MenuExtraToolsActivePackets);
                }

                if (MenuExtraTools.Item("ExtraTools.AllySupport").GetValue <bool>())
                {
                    CommonAlly.Init(MenuExtraToolsActivePackets);
                }

                /* Menu Items */
                var items = MenuActivator.AddSubMenu(new Menu("Items", "Items"));
                items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(true));
                items.AddItem(new MenuItem("GHOSTBLADE", "Ghostblade").SetValue(true));
                items.AddItem(new MenuItem("SWORD", "Sword of the Divine").SetValue(true));
                items.AddItem(new MenuItem("MURAMANA", "Muramana").SetValue(true));
                items.AddItem(new MenuItem("UseItemsMode", "Use items on").SetValue(new StringList(new[] { "No", "Mixed mode", "Combo mode", "Both" }, 2)));
            }
            Config.AddSubMenu(MenuActivator);

            // If Champion is supported draw the extra menus
            if (baseType != ChampionClass.GetType())
            {
                SetSmiteSlot();

                var combo = new Menu("Combo", "Combo").SetFontStyle(FontStyle.Regular, SharpDX.Color.GreenYellow);
                if (ChampionClass.ComboMenu(combo))
                {
                    if (SmiteSlot != SpellSlot.Unknown)
                    {
                        combo.AddItem(new MenuItem("ComboSmite", "Use Smite").SetValue(true));
                    }

                    Config.AddSubMenu(combo);
                }

                var harass = new Menu("Harass", "Harass");
                if (ChampionClass.HarassMenu(harass))
                {
                    harass.AddItem(new MenuItem("HarassMana", "Min. Mana Percent").SetValue(new Slider(50, 100, 0)));
                    Config.AddSubMenu(harass);
                }

                var menuClear = new Menu("Farm / Jungle", "Mode.Clear");
                {
                    MenuLane = new Menu("Lane", "Mode.Lane");
                    {
                        if (ChampionClass.LaneClearMenu(MenuLane))
                        {
                            MenuLane.AddItem(new MenuItem("Lane.Min.Mana", ":: Min. Mana %:").SetValue(new Slider(60, 100, 0)));
                        }
                        menuClear.AddSubMenu(MenuLane);
                    }

                    MenuJungle = new Menu("Jungle", "Mode.Jungle");
                    {
                        if (ChampionClass.JungleClearMenu(MenuJungle))
                        {
                            MenuJungle.AddItem(new MenuItem("Jungle.Min.Mana", ":: Min. Mana %:").SetValue(new Slider(30, 100, 0)));
                            MenuJungle.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] { "Off", "Use for Baron", "Use for Baron", "Both" }, 3)));
                            menuClear.AddSubMenu(MenuJungle);
                        }
                    }

                    menuClear.AddItem(new MenuItem("Farm.Active", ":: Farm Active!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Farm", SharpDX.Color.Aqua);
                    menuClear.AddItem(new MenuItem("Farm.Min.Mana.Control", ":: Min. Mana Control!").SetValue(new KeyBind("M".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Farm Min. Mana Control", SharpDX.Color.Aqua);
                    Config.AddSubMenu(menuClear);
                }


                //var laneclear = new Menu("Lane Mode", "LaneClear");
                //if (ChampionClass.LaneClearMenu(laneclear))
                //{
                //    laneclear.AddItem(new MenuItem("Lane.Enabled", ":: Enable Lane Farm!").SetValue(new KeyBind("L".ToCharArray()[0],KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Lane Farm", SharpDX.Color.Aqua);

                //    var minManaMenu = new Menu("Min. Mana Settings", "Lane.MinMana.Title");
                //    {
                //        minManaMenu.AddItem(new MenuItem("LaneMana.Alone", "If I'm Alone %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.LightSkyBlue);
                //        minManaMenu.AddItem(new MenuItem("LaneMana.Enemy", "If Enemy Close %:").SetValue(new Slider(60, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.IndianRed);
                //        laneclear.AddSubMenu(minManaMenu);
                //    }
                //    Config.AddSubMenu(laneclear);
                //}

                //var jungleClear = new Menu("Jungle Mode", "JungleClear");
                //if (ChampionClass.JungleClearMenu(jungleClear))
                //{
                //    var minManaMenu = new Menu("Min. Mana Settings", "Jungle.MinMana.Title");
                //    {
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Ally", "Ally Mobs %:").SetValue(new Slider(50, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.LightSkyBlue);
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.Enemy", "Enemy Mobs %:").SetValue(new Slider(30, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.IndianRed);
                //        minManaMenu.AddItem(new MenuItem("Jungle.Mana.BigBoys", "Baron/Dragon %:").SetValue(new Slider(70, 100, 0))).SetFontStyle(FontStyle.Regular, SharpDX.Color.HotPink);
                //        jungleClear.AddSubMenu(minManaMenu);
                //    }
                //    jungleClear.AddItem(new MenuItem("Jungle.Items", ":: Use Items:").SetValue(new StringList(new[] {"Off", "Use for Baron", "Use for Baron", "Both"}, 3)));
                //    jungleClear.AddItem(new MenuItem("Jungle.Enabled", ":: Enable Jungle Farm!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle, true))).Permashow(true, "Marksman | Enable Jungle Farm", SharpDX.Color.Aqua);
                //    Config.AddSubMenu(jungleClear);
                //}

                /*----------------------------------------------------------------------------------------------------------*/
                //Obj_AI_Base ally = (from aAllies in HeroManager.Allies
                //    from aSupportedChampions in
                //        new[]
                //        {
                //            "janna", "tahm", "leona", "lulu", "lux", "nami", "shen", "sona", "braum", "bard"
                //        }
                //    where aSupportedChampions == aAllies.ChampionName.ToLower()
                //    select aAllies).FirstOrDefault();

                //if (ally != null)
                //{
                //    var menuAllies = new Menu("Ally Combo", "Ally.Combo").SetFontStyle(FontStyle.Regular, Color.Crimson);
                //    {
                //        AIHeroClient leona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "leona");
                //        if (leona != null)
                //        {
                //            var menuLeona = new Menu("Leona", "Leona");
                //            menuLeona.AddItem(new MenuItem("Leona.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                //            menuAllies.AddSubMenu(menuLeona);
                //        }

                //        AIHeroClient Lux = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "lux");
                //        if (Lux != null)
                //        {
                //            var menuLux = new Menu("Lux", "Lux");
                //            menuLux.AddItem(new MenuItem("Lux.ComboBuff", "Force Focus Marked Enemy for Bonus Damage").SetValue(true));
                //            menuAllies.AddSubMenu(menuLux);
                //        }

                //        AIHeroClient Shen = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "shen");
                //        if (Shen != null)
                //        {
                //            var menuShen = new Menu("Shen", "Shen");
                //            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Force Focus Q Marked Enemy Objects for Heal").SetValue(true));
                //            menuShen.AddItem(new MenuItem("Shen.ComboBuff", "Minimum Heal:").SetValue(new Slider(80)));
                //            menuAllies.AddSubMenu(menuShen);
                //        }

                //        AIHeroClient Tahm = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Tahm");
                //        if (Tahm != null)
                //        {
                //            var menuTahm = new Menu("Tahm", "Tahm");
                //            menuTahm.AddItem(new MenuItem("Tahm.ComboBuff", "Force Focus Marked Enemy for Stun").SetValue(true));
                //            menuAllies.AddSubMenu(menuTahm);
                //        }

                //        AIHeroClient Sona = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Sona");
                //        if (Sona != null)
                //        {
                //            var menuSona = new Menu("Sona", "Sona");
                //            menuSona.AddItem(new MenuItem("Sona.ComboBuff", "Force Focus to Marked Enemy").SetValue(true));
                //            menuAllies.AddSubMenu(menuSona);
                //        }

                //        AIHeroClient Lulu = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "Lulu");
                //        if (Lulu != null)
                //        {
                //            var menuLulu = new Menu("Lulu", "Lulu");
                //            menuLulu.AddItem(new MenuItem("Lulu.ComboBuff", "Force Focus to Enemy If I have E buff").SetValue(true));
                //            menuAllies.AddSubMenu(menuLulu);
                //        }

                //        AIHeroClient Nami = HeroManager.Allies.Find(e => e.ChampionName.ToLower() == "nami");
                //        if (Nami != null)
                //        {
                //            var menuNami = new Menu("Nami", "Nami");
                //            menuNami.AddItem(new MenuItem("Nami.ComboBuff", "Force Focus to Enemy If I have E Buff").SetValue(true));
                //            menuAllies.AddSubMenu(menuNami);
                //        }
                //    }
                //    Config.AddSubMenu(menuAllies);
                //}
                /*----------------------------------------------------------------------------------------------------------*/

                var misc = new Menu("Misc", "Misc").SetFontStyle(FontStyle.Regular, SharpDX.Color.DarkOrange);
                if (ChampionClass.MiscMenu(misc))
                {
                    misc.AddItem(new MenuItem("Misc.SaveManaForUltimate", "Save Mana for Ultimate").SetValue(false));
                    Config.AddSubMenu(misc);
                }

                /*
                 *              var extras = new Menu("Extras", "Extras");
                 *              if (ChampionClass.ExtrasMenu(extras))
                 *              {
                 *                  Config.AddSubMenu(extras);
                 *              }
                 */

                var marksmanDrawings = new Menu("Drawings", "MDrawings");
                Config.AddSubMenu(marksmanDrawings);

                var drawing = new Menu(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(championName), "Drawings").SetFontStyle(FontStyle.Regular, SharpDX.Color.Aquamarine);
                if (ChampionClass.DrawingMenu(drawing))
                {
                    marksmanDrawings.AddSubMenu(drawing);
                }

                var globalDrawings = new Menu("Global", "GDrawings");
                {
                    marksmanDrawings.AddItem(new MenuItem("Draw.TurnOff", "Drawings").SetValue(new StringList(new[] { "Disable", "Enable", "Disable on Combo Mode", "Disable on Lane/Jungle Mode", "Both" }, 1)));
                    globalDrawings.AddItem(new MenuItem("Draw.MinionLastHit", "Minion Last Hit").SetValue(new StringList(new[] { "Off", "On", "Just Out of AA Range Minions" }, 2)));
                    globalDrawings.AddItem(new MenuItem("Draw.KillableEnemy", "Killable Enemy Text").SetValue(false));
                    //GlobalDrawings.AddItem(new MenuItem("Draw.JunglePosition", "Jungle Farm Position").SetValue(new StringList(new[] { "Off", "If I'm Close to Mobs", "If Jungle Clear Active" }, 2)));
                    marksmanDrawings.AddSubMenu(globalDrawings);
                }

                //CreateButtons();
            }

            ChampionClass.MainMenu(Config);
            ChampionClass.ToolsMenu(MenuExtraTools);

            //Evade.Evade.Initiliaze();
            //Config.AddSubMenu(Evade.Config.Menu);
            //var y = new Common.CommonObjectDetector();
            Config.AddToMainMenu();
            MenuExtraTools.AddToMainMenu();

            foreach (var i in Config.Children.SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }

            foreach (var i in MenuExtraTools.Children.SelectMany(GetChildirens))
            {
                i.DisplayName = ":: " + i.DisplayName;
            }


            //CheckAutoWindUp();

            Drawing.OnDraw     += Drawing_OnDraw;
            Drawing.OnEndScene += eventArgs =>
            {
                //DrawButtons();
                if (Config.Item("Draw.KillableEnemy").GetValue <bool>())
                {
                    foreach (var e in HeroManager.Enemies.Where(e => e.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) * 2)))
                    {
                        var x = (int)Math.Ceiling(e.Health / ObjectManager.Player.GetAutoAttackDamage(e));
                        //Utils.Utils.DrawText(CommonGeometry.Text, $"{x} x AA = Kill", (int)e.HPBarPosition.X + 20, (int)e.HPBarPosition.Y + 17, SharpDX.Color.White);
                        CommonGeometry.Text.DrawTextLeft(string.Format("{0} x AA Kill", x), (int)e.HPBarPosition.X + 5, (int)e.HPBarPosition.Y + 25, SharpDX.Color.White);
                    }
                    //var t = KillableEnemyAa;
                    //if (t.Key != null && t.Key.IsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 1000) &&
                    //    t.Value > 0)
                    //{
                    //    Utils.Utils.DrawText(CommonGeometry.Text, string.Format("{0} x AA Damage = Kill", t.Value), (int)t.Key.HPBarPosition.X + 30, (int)t.Key.HPBarPosition.Y + 5, SharpDX.Color.White);


                    //}
                }
            };
            Game.OnUpdate += GameOnUpdate;
            Game.OnUpdate += delegate(EventArgs eventArgs) { ChampionClass.GameOnUpdate(eventArgs); };

            Game.OnUpdate += eventArgs =>
            {
                if (ChampionClass.ComboActive)
                {
                    ChampionClass.ExecuteCombo();
                }
                if (ChampionClass.LaneClearActive)
                {
                    ChampionClass.ExecuteLane();
                }
                if (ChampionClass.JungleClearActive)
                {
                    ChampionClass.ExecuteJungle();
                }
                ChampionClass.PermaActive();
            };

            Orbwalking.OnAttack += (unit, target) =>
            {//
             // if (unit.IsMe)
             //   Chat.Print("Attack");
            };
            Orbwalking.AfterAttack  += (unit, target) => { ChampionClass.Orbwalking_AfterAttack(unit, target); };
            Orbwalking.BeforeAttack += (eventArgs) => { ChampionClass.Orbwalking_BeforeAttack(eventArgs); };


            GameObject.OnCreate += (sender, eventArgs) => { ChampionClass.OnCreateObject(sender, eventArgs); };
            GameObject.OnDelete += (sender, eventArgs) => { ChampionClass.OnDeleteObject(sender, eventArgs); };

            Drawing.OnEndScene += eventArgs => { ChampionClass.DrawingOnEndScene(eventArgs); };

            Obj_AI_Base.OnBuffGain         += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnBuffAdd(sender, eventArgs); };
            Obj_AI_Base.OnBuffLose         += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnBuffLose(sender, eventArgs); };
            Obj_AI_Base.OnProcessSpellCast += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnProcessSpellCast(sender, eventArgs); };
            Obj_AI_Base.OnPlayAnimation    += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnPlayAnimation(sender, eventArgs); };

            AntiGapcloser.OnEnemyGapcloser += (gapcloser) => { ChampionClass.AntiGapcloser_OnEnemyGapcloser(gapcloser); };

            Spellbook.OnCastSpell += (sender, eventArgs) => { ChampionClass.Spellbook_OnCastSpell(sender, eventArgs); };

            Interrupter2.OnInterruptableTarget += (sender, eventArgs) => { ChampionClass.Interrupter2_OnInterruptableTarget(sender, eventArgs); };

            Obj_AI_Base.OnPlayAnimation += (sender, eventArgs) => { ChampionClass.Obj_AI_Base_OnPlayAnimation(sender, eventArgs); };

            Console.Clear();
        }