Example #1
0
        public static void Player_OnLevelUp(Obj_AI_Base sender, Obj_AI_BaseLevelUpEventArgs args)
        {
            Core.DelayAction(() =>
            {
                if (User.Level < 5)
                {
                    switch (User.Level)
                    {
                    case 1:
                        switch (Menu["lvl1ability"].Cast <ComboBox>().SelectedText)
                        {
                        case "Q":
                            Abilities.LevelSpell(SpellSlot.Q);
                            break;

                        case "W":
                            Abilities.LevelSpell(SpellSlot.W);
                            break;

                        case "E":
                            Abilities.LevelSpell(SpellSlot.E);
                            break;
                        }
                        break;

                    case 2:
                        switch (Menu["lvl2ability"].Cast <ComboBox>().SelectedText)
                        {
                        case "Q":
                            Abilities.LevelSpell(SpellSlot.Q);
                            break;

                        case "W":
                            Abilities.LevelSpell(SpellSlot.W);
                            break;

                        case "E":
                            Abilities.LevelSpell(SpellSlot.E);
                            break;
                        }
                        break;

                    case 3:
                        switch (Menu["lvl3ability"].Cast <ComboBox>().SelectedText)
                        {
                        case "Q":
                            Abilities.LevelSpell(SpellSlot.Q);
                            break;

                        case "W":
                            Abilities.LevelSpell(SpellSlot.W);
                            break;

                        case "E":
                            Abilities.LevelSpell(SpellSlot.E);
                            break;
                        }
                        break;

                    case 4:
                        switch (Menu["lvl4ability"].Cast <ComboBox>().SelectedText)
                        {
                        case "Q":
                            Abilities.LevelSpell(SpellSlot.Q);
                            break;

                        case "W":
                            Abilities.LevelSpell(SpellSlot.W);
                            break;

                        case "E":
                            Abilities.LevelSpell(SpellSlot.E);
                            break;
                        }
                        break;
                    }
                }
                if (User.Level > 4)
                {
                    switch (Menu["after4"].Cast <ComboBox>().SelectedText)
                    {
                    case "R>Q>W>E":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        break;

                    case "R>Q>E>W":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        break;

                    case "R>W>Q>E":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        break;

                    case "R>W>E>Q":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        break;

                    case "R>E>Q>W":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        break;

                    case "R>E>W>Q":
                        if (Abilities.CanSpellBeUpgraded(SpellSlot.R))
                        {
                            Abilities.LevelSpell(SpellSlot.R);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.E))
                        {
                            Abilities.LevelSpell(SpellSlot.E);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.W))
                        {
                            Abilities.LevelSpell(SpellSlot.W);
                        }
                        else if (Abilities.CanSpellBeUpgraded(SpellSlot.Q))
                        {
                            Abilities.LevelSpell(SpellSlot.Q);
                        }
                        break;
                    }
                }
            }, Menu["delay"].Cast <Slider>().CurrentValue);
        }