Beispiel #1
0
        public static void OnGameLoad()
        {
            if (ObjectManager.Player.ChampionName != "Twitch")
            {
                return;
            }

            CustomDamageIndicator.Initialize(Extensions.GetPoisonDamage);

            LoadSpells();
            LoadMenu();

            Spellbook.OnCastSpell += (sender, eventArgs) =>
            {
                if (eventArgs.Slot == SpellSlot.Recall && Spells[SpellSlot.Q].IsReady() &&
                    getKeyBindItem(miscOptions, "com.itwitch.misc.recall"))
                {
                    Spells[SpellSlot.Q].Cast();
                    Utility.DelayAction.Add(
                        (int)(Spells[SpellSlot.Q].Delay + 300),
                        () => ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Recall));
                    eventArgs.Process = false;
                    return;
                }

                if (eventArgs.Slot == SpellSlot.R && getCheckBoxItem(miscOptions, "com.itwitch.misc.autoYo"))
                {
                    if (!HeroManager.Enemies.Any(x => ObjectManager.Player.LSDistance(x) <= Spells[SpellSlot.R].Range))
                    {
                        return;
                    }

                    if (Items.HasItem(ItemData.Youmuus_Ghostblade.Id))
                    {
                        Items.UseItem(ItemData.Youmuus_Ghostblade.Id);
                    }
                }

                if (getCheckBoxItem(miscOptions, "com.itwitch.misc.saveManaE") && eventArgs.Slot == SpellSlot.W)
                {
                    if (ObjectManager.Player.Mana <= Spells[SpellSlot.E].ManaCost + 10)
                    {
                        eventArgs.Process = false;
                    }
                }
            };

            Game.OnUpdate                  += OnUpdate;
            Drawing.OnDraw                 += OnDraw;
            Orbwalker.OnPostAttack         += AfterAttack;
            Obj_AI_Base.OnProcessSpellCast += OnProcessSpellCast;
        }
Beispiel #2
0
        public void OnGameLoad(EventArgs args)
        {
            if (ObjectManager.Player.ChampionName != "Twitch")
            {
                return;
            }

            CustomDamageIndicator.Initialize(Extensions.GetPoisonDamage);

            LoadSpells();
            LoadMenu();

            Spellbook.OnCastSpell += (sender, eventArgs) =>
            {
                if (eventArgs.Slot == SpellSlot.Recall && Spells[SpellSlot.Q].IsReady() &&
                    menu.Item("com.itwitch.misc.recall").GetValue <KeyBind>().Active)
                {
                    Spells[SpellSlot.Q].Cast();
                    Utility.DelayAction.Add(
                        (int)(Spells[SpellSlot.Q].Delay + 300),
                        () => ObjectManager.Player.Spellbook.CastSpell(SpellSlot.Recall));
                    eventArgs.Process = false;
                    return;
                }

                if (eventArgs.Slot == SpellSlot.R && menu.Item("com.itwitch.misc.autoYo").GetValue <bool>())
                {
                    if (!HeroManager.Enemies.Any(x => ObjectManager.Player.Distance(x) <= Spells[SpellSlot.R].Range))
                    {
                        return;
                    }

                    if (Items.HasItem(ItemData.Youmuus_Ghostblade.Id))
                    {
                        Items.UseItem(ItemData.Youmuus_Ghostblade.Id);
                    }
                }

                if (menu.Item("com.itwitch.misc.saveManaE").GetValue <bool>() && eventArgs.Slot == SpellSlot.W)
                {
                    if (ObjectManager.Player.Mana <= Spells[SpellSlot.E].ManaCost + 10)
                    {
                        eventArgs.Process = false;
                    }
                }
            };

            Game.OnUpdate  += OnUpdate;
            Drawing.OnDraw += OnDraw;
        }