Example #1
0
        private static void InitializeComponent()
        {
            try
            {
                if (!Value.Use("autolvlup.use"))
                {
                    return;
                }

                var parseModule = new ParseModule();
                var sequence    = parseModule._abilitySequence;

                if (sequence == null)
                {
                    return;
                }

                if (sequence.Version != Game.Version)
                {
                    if (!Value.Use("autolvlup.ignoreversion"))
                    {
                        return;
                    }
                }

                if (sequence.Data.FirstOrDefault() == null)
                {
                    return;
                }

                if (
                    sequence.Data.TrueForAll(
                        e =>
                        e.ChampionName == Player.Instance.ChampionName && e.Role == Value.Get("autolvlup.role") &&
                        e.DamageType == Value.Get("autolvlup.damagetype")))
                {
                    Obj_AI_Base.OnLevelUp += LevelUpComponent;
                }
                else
                {
                    Chat.Print("Your Autolvlup Configuration or Champion is not yet Supported!", Color.Red);
                }
            }
            catch (Exception e)
            {
                Chat.Print("JSON parse ERROR: Code INITIALIZECOMPONENT", Color.Red);
                Console.Write(e);
            }
        }
Example #2
0
        private static void LevelUpComponent(Obj_AI_Base sender, Obj_AI_BaseLevelUpEventArgs args)
        {
            try
            {
                var parseModule = new ParseModule();
                var sequence    = parseModule._abilitySequence;

                if (sequence == null)
                {
                    return;
                }

                var seq = sequence.Data.Find(
                    e =>
                    e.ChampionName == Player.Instance.ChampionName && e.Role == Value.Get("autolvlup.role") &&
                    e.DamageType == Value.Get("autolvlup.damagetype")).Sequence;

                var currentLevel = seq[args.Level];

                switch (currentLevel)
                {
                case 1:
                    Player.LevelSpell(SpellSlot.Q);
                    break;

                case 2:
                    Player.LevelSpell(SpellSlot.W);
                    break;

                case 3:
                    Player.LevelSpell(SpellSlot.E);
                    break;

                case 4:
                    Player.LevelSpell(SpellSlot.R);
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                Chat.Print("JSON parse ERROR: Code LEVELUPCOMPONENT", Color.Red);
                Console.Write(e);
            }
        }
Example #3
0
        private static void InitializeComponent()
        {
            try
            {
                if (!Value.Use("autolvlup.use"))
                {
                    return;
                }

                var parseModule = new ParseModule();
                var sequence = parseModule._abilitySequence;

                if (sequence == null)
                    return;

                if (sequence.Version != Game.Version)
                {
                    if (!Value.Use("autolvlup.ignoreversion"))
                        return;
                }

                if (sequence.Data.FirstOrDefault() == null)
                    return;

                if (
                    sequence.Data.TrueForAll(
                        e =>
                            e.ChampionName == Player.Instance.ChampionName && e.Role == Value.Get("autolvlup.role") &&
                            e.DamageType == Value.Get("autolvlup.damagetype")))
                {
                    Obj_AI_Base.OnLevelUp += LevelUpComponent;
                }
                else
                {
                    Chat.Print("Your Autolvlup Configuration or Champion is not yet Supported!", Color.Red);
                }
            }
            catch (Exception e)
            {
                Chat.Print("JSON parse ERROR: Code INITIALIZECOMPONENT", Color.Red);
                Console.Write(e);
            }
        }
Example #4
0
        private static void LevelUpComponent(Obj_AI_Base sender, Obj_AI_BaseLevelUpEventArgs args)
        {
            try
            {
                var parseModule = new ParseModule();
                var sequence = parseModule._abilitySequence;

                if (sequence == null)
                    return;

                var seq = sequence.Data.Find(
                    e =>
                        e.ChampionName == Player.Instance.ChampionName && e.Role == Value.Get("autolvlup.role") &&
                        e.DamageType == Value.Get("autolvlup.damagetype")).Sequence;

                var currentLevel = seq[args.Level];

                switch (currentLevel)
                {
                    case 1:
                        Player.LevelSpell(SpellSlot.Q);
                        break;
                    case 2:
                        Player.LevelSpell(SpellSlot.W);
                        break;
                    case 3:
                        Player.LevelSpell(SpellSlot.E);
                        break;
                    case 4:
                        Player.LevelSpell(SpellSlot.R);
                        break;
                    default:
                        break;
                }
            }
            catch (Exception e)
            {
                Chat.Print("JSON parse ERROR: Code LEVELUPCOMPONENT", Color.Red);
                Console.Write(e);
            }
        }