Beispiel #1
0
 private static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender.IsMe && args.SData.Name == "gate" && Config.Item("AutoY").GetValue <bool>())
     {
         CardSelector.StartSelecting(Cards.Yellow);
     }
 }
Beispiel #2
0
        public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (sender != null)
            {
                if (sender.IsMe)
                {
                    if (args.Slot == SpellSlot.R)
                    {
                        if (args.SData.Name.ToLowerInvariant() == "gate")
                        {
                            switch (CardSelector.Status)
                            {
                            case SelectStatus.Selecting:
                            {
                                CardSelector.JumpToCard(Cards.Yellow);
                                break;
                            }

                            case SelectStatus.Ready:
                            {
                                CardSelector.StartSelecting(Cards.Yellow);
                                break;
                            }
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
        static void JungleClear()
        {
            var mobs = MinionManager.GetMinions(Player.ServerPosition, Orbwalking.GetRealAutoAttackRange(Player) + 100, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);

            if (mobs.Count <= 0)
            {
                return;
            }

            if (Q.IsReady() && getCheckBoxItem(jungleclearMenu, "jungleclearUseQ") && Player.ManaPercent > getSliderItem(jungleclearMenu, "jungleclearQmana"))
            {
                Q.Cast(mobs[0].Position);
            }

            if (W.IsReady() && getCheckBoxItem(jungleclearMenu, "jungleclearUseW"))
            {
                if (Player.ManaPercent > getSliderItem(jungleclearMenu, "jungleclearbluemana"))
                {
                    if (mobs.Count >= 2)
                    {
                        CardSelector.StartSelecting(Cards.Red);
                    }
                    else
                    {
                        CardSelector.StartSelecting(Cards.Yellow);
                    }
                }
                else
                {
                    CardSelector.StartSelecting(Cards.Blue);
                }
            }
        }
Beispiel #4
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Config.Item("PingLH").GetValue <bool>())
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(h => h.IsValidTarget() && ComboDamage(h) > h.Health))
                {
                    Ping(enemy.Position.To2D());
                }
            }

            var combo = Config.Item("Combo").GetValue <KeyBind>().Active;

            //Select cards.
            if (Config.Item("SelectYellow").GetValue <KeyBind>().Active ||
                combo)
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }

            if (Config.Item("SelectBlue").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Blue);
            }

            if (Config.Item("SelectRed").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Red);
            }

            if (CardSelector.Status == SelectStatus.Selected && combo)
            {
                var target = SOW.GetTarget();
                if (target.IsValidTarget() && target is Obj_AI_Hero && Items.HasItem("DeathfireGrasp") && ComboDamage((Obj_AI_Hero)target) >= target.Health)
                {
                    Items.UseItem("DeathfireGrasp", (Obj_AI_Hero)target);
                }
            }


            //Auto Q
            var autoQI = Config.Item("AutoQI").GetValue <bool>();
            var autoQD = Config.Item("AutoQD").GetValue <bool>();


            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready && (autoQD || autoQI))
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>())
                {
                    if (enemy.IsValidTarget(Q.Range * 2))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if ((pred.Hitchance == HitChance.Immobile && autoQI) ||
                            (pred.Hitchance == HitChance.Dashing && autoQD))
                        {
                            CastQ(enemy, pred.UnitPosition.To2D());
                        }
                    }
                }
            }
        }
Beispiel #5
0
        static void SelectACard(Cards aCard)
        {
            if (PickTick == 0)
            {
                PickTick = Utils.TickCount;
            }

            CardSelector.StartSelecting(aCard);
        }
Beispiel #6
0
        public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsMe && args.SData.Name == "Gate" && Config.IsChecked(Config.Misc, "AutoYAG"))
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }

            if (!sender.IsMe)
            {
            }
        }
Beispiel #7
0
        private static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            if (args.Slot == SpellSlot.R && Config.Item("AutoY").GetValue <bool>())
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }
        }
Beispiel #8
0
        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            if (args.SData.Name.Equals("Gate", StringComparison.InvariantCultureIgnoreCase) && Menus.CardMenu["combo.goldAfterUlt"].Cast <CheckBox>().CurrentValue)
            {
                CardSelector.StartSelecting(Cards.Gold);
            }
        }
Beispiel #9
0
        private static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            if (args.SData.Name.Equals("Gate", StringComparison.InvariantCultureIgnoreCase) && Config.Item("AutoY").GetValue <bool>())
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }
        }
Beispiel #10
0
        private static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            if (args.SData.Name.Equals("Gate", StringComparison.InvariantCultureIgnoreCase) &&
                getCheckBoxItem(r, "AutoY"))
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }
        }
Beispiel #11
0
        public static void Harass()
        {
            var target = TargetSelector.GetTarget(Spells.Q.Range, DamageType.Magical);

            if (target == null || !target.IsValidTarget(Spells.Q.Range) ||
                Player.Instance.ManaPercent < Config.GetSliderValue(Config.Harass, "manaToHarass"))
            {
                return;
            }

            var qMana = Player.Instance.Spellbook.GetSpell(SpellSlot.Q).SData.Mana;
            var wMana = Player.Instance.Spellbook.GetSpell(SpellSlot.W).SData.Mana;

            if (target.Distance(Player.Instance.Position) <= Player.Instance.AttackRange + 100 &&
                Player.Instance.Mana >= wMana &&
                Player.Instance.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.Ready &&
                Config.IsChecked(Config.Harass, "useWinHarass"))
            {
                switch (Config.GetComboBoxValue(Config.Harass, "wModeH"))
                {
                case 0:
                    CardSelector.StartSelecting(
                        Player.Instance.ManaPercent < Config.GetSliderValue(Config.Harass, "manaToHarass") + 10
                                ? Cards.Blue
                                : Cards.Yellow);
                    break;

                case 1:
                    CardSelector.StartSelecting(Cards.Yellow);
                    break;

                case 2:
                    CardSelector.StartSelecting(Cards.Blue);
                    break;

                case 3:
                    CardSelector.StartSelecting(Cards.Red);
                    break;
                }
            }

            var qPred = Spells.Q.GetPrediction(target);

            if (Player.Instance.Mana >= qMana && qPred.HitChancePercent >= 90 &&
                Config.IsChecked(Config.Harass, "useQinHarass") && Spells.Q.IsReady())
            {
                Spells.Q.Cast(qPred.CastPosition);
            }
        }
Beispiel #12
0
 private static void SelectCard()
 {
     if (Menus.SelectGoldCard())
     {
         CardSelector.StartSelecting(Cards.Gold);
     }
     else if (Menus.SelectRedCard())
     {
         CardSelector.StartSelecting(Cards.Red);
     }
     else if (Menus.SelectBlueCard())
     {
         CardSelector.StartSelecting(Cards.Blue);
     }
 }
Beispiel #13
0
 private static void Game_GameOnUpdate(EventArgs args)
 {
     #region Select Card
     if (Config.Item("SelectYellow").GetValue <KeyBind>().Active)
     {
         CardSelector.StartSelecting(Cards.Yellow);
     }
     else if (Config.Item("SelectBlue").GetValue <KeyBind>().Active)
     {
         CardSelector.StartSelecting(Cards.Blue);
     }
     else if (Config.Item("SelectRed").GetValue <KeyBind>().Active)
     {
         CardSelector.StartSelecting(Cards.Red);
     }
     #endregion
 }
Beispiel #14
0
        public static void InterruptableSpell_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (Config.UseInterrupter)
            {
                var wMana = ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ManaCost;

                if (sender.IsValidTarget(Spells._w.Range))
                {
                    switch (CardSelector.Status)
                    {
                    case SelectStatus.Selecting:
                    {
                        CardSelector.JumpToCard(Cards.Yellow);
                        break;
                    }

                    case SelectStatus.Ready:
                    {
                        if (ObjectManager.Player.ManaPercent >= wMana)
                        {
                            CardSelector.StartSelecting(Cards.Yellow);
                        }
                        break;
                    }
                    }

                    if (HasGold)
                    {
                        if (SebbyLib.Orbwalking.InAutoAttackRange(sender))
                        {
                            if (SebbyLib.Orbwalking.CanAttack())
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, sender);
                            }
                        }
                    }
                }
            }
        }
Beispiel #15
0
        public static void Gapcloser_OnGapCloser(ActiveGapcloser gapcloser)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (Config.UseAntiGapCloser)
            {
                var wMana = ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ManaCost;

                if (gapcloser.Sender.IsValidTarget(Spells._w.Range))
                {
                    switch (CardSelector.Status)
                    {
                    case SelectStatus.Selecting:
                    {
                        CardSelector.JumpToCard(Cards.Yellow);
                        break;
                    }

                    case SelectStatus.Ready:
                    {
                        if (ObjectManager.Player.ManaPercent >= wMana)
                        {
                            CardSelector.StartSelecting(Cards.Yellow);
                        }
                        break;
                    }
                    }

                    if (HasGold)
                    {
                        if (SebbyLib.Orbwalking.InAutoAttackRange(gapcloser.Sender))
                        {
                            if (SebbyLib.Orbwalking.CanAttack())
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, gapcloser.Sender);
                            }
                        }
                    }
                }
            }
        }
Beispiel #16
0
        static void LaneClear()
        {
            if (Q.IsReady() && getCheckBoxItem(laneclearMenu, "laneclearUseQ") && Player.ManaPercent > getSliderItem(laneclearMenu, "laneclearQmana"))
            {
                var allMinionsQ = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.Enemy);
                var locQ        = Q.GetLineFarmLocation(allMinionsQ);

                if (locQ.MinionsHit >= getSliderItem(laneclearMenu, "laneclearQmc"))
                {
                    Q.Cast(locQ.Position);
                }
            }

            if (W.IsReady() && getCheckBoxItem(laneclearMenu, "laneclearUseW"))
            {
                var minioncount = MinionManager.GetMinions(Player.Position, 1500).Count;

                if (minioncount > 0)
                {
                    if (Player.ManaPercent > getSliderItem(laneclearMenu, "laneclearbluemana"))
                    {
                        if (minioncount >= getSliderItem(laneclearMenu, "laneclearredmc"))
                        {
                            CardSelector.StartSelecting(Cards.Red);
                        }
                        else
                        {
                            CardSelector.StartSelecting(Cards.Blue);
                        }
                    }
                    else
                    {
                        CardSelector.StartSelecting(Cards.Blue);
                    }
                }
            }
        }
Beispiel #17
0
        /// <summary>
        /// 释放W技能逻辑.
        /// </summary>
        private static void SmartWLogic()
        {
            //==================黄牌逻辑
            if (_config.Item("SelectYellow").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }
            else if (_config.Item("SelectBlue").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Blue);
            }
            else if (_config.Item("SelectRed").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Red);
            }
            else
            {
                switch (_sow.ActiveMode)
                {
                case Orbwalking.OrbwalkingMode.Combo:
                    var tmpTarget = TargetSelector.GetTarget(_player.AttackRange * 2,
                                                             TargetSelector.DamageType.Physical);
                    if (tmpTarget.IsValid)
                    {
                        CardSelector.StartSelecting(Cards.Yellow);
                    }

                    break;

                case Orbwalking.OrbwalkingMode.LaneClear:

                case Orbwalking.OrbwalkingMode.Mixed:
                    CardSelector.StartSelecting(HeroManager.Player.ManaPercent < 80 ? Cards.Blue : Cards.Red);
                    break;
                }
            }
        }
Beispiel #18
0
        public static void PermActive()
        {
            if (Config.IsChecked(Config.Misc, "autoQonCC"))
            {
                AutoCcq();
            }

            var wMana = Player.Instance.Spellbook.GetSpell(SpellSlot.W).SData.Mana;

            if (Player.Instance.Mana >= wMana)
            {
                if (Config.IsKeyPressed(Config.CardSelectorMenu, "csYellow") &&
                    (!Keyboard.IsKeyDown(Key.LeftShift) && !Keyboard.IsKeyDown(Key.LeftCtrl) &&
                     !Keyboard.IsKeyDown(Key.LeftAlt)))
                {
                    CardSelector.StartSelecting(Cards.Yellow);
                }

                if (Config.IsKeyPressed(Config.CardSelectorMenu, "csBlue") &&
                    (!Keyboard.IsKeyDown(Key.LeftShift) && !Keyboard.IsKeyDown(Key.LeftCtrl) &&
                     !Keyboard.IsKeyDown(Key.LeftAlt)))
                {
                    CardSelector.StartSelecting(Cards.Blue);
                }

                if (Config.IsKeyPressed(Config.CardSelectorMenu, "csRed") &&
                    (!Keyboard.IsKeyDown(Key.LeftShift) && !Keyboard.IsKeyDown(Key.LeftCtrl) &&
                     !Keyboard.IsKeyDown(Key.LeftAlt)))
                {
                    CardSelector.StartSelecting(Cards.Red);
                }
            }

            var qMana = Player.Instance.Spellbook.GetSpell(SpellSlot.Q).SData.Mana;

            if (Config.IsChecked(Config.Misc, "qKillsteal") && Player.Instance.Mana >= qMana && Spells.Q.IsReady())
            {
                var entKs =
                    EntityManager.Heroes.Enemies.FirstOrDefault(
                        h =>
                        h.IsValidTarget(Spells.Q.Range) && h.Health < Player.Instance.GetSpellDamage(h, SpellSlot.Q));
                if (entKs != null)
                {
                    Spells.Q.Cast(entKs);
                }
            }

            if (Config.IsChecked(Config.Harass, "autoQ") && Player.Instance.Mana >= qMana &&
                Player.Instance.ManaPercent >= Config.GetSliderValue(Config.Harass, "manaToAHarass") &&
                Spells.Q.IsReady() && (Orbwalker.LastHitMinion != null && Orbwalker.IsAutoAttacking))
            {
                var target = TargetSelector.GetTarget(Spells.Q.Range, DamageType.Magical);
                if (target.IsValidTarget(Spells.Q.Range))
                {
                    var qPred = Spells.Q.GetPrediction(target);
                    if (qPred.HitChancePercent >= 90)
                    {
                        Spells.Q.Cast(qPred.CastPosition);
                    }
                }
            }
        }
Beispiel #19
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Config.Item("PingLH").GetValue <bool>())
            {
                foreach (
                    var enemy in
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(
                        h =>
                        ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready &&
                        h.IsValidTarget() && ComboDamage(h) > h.Health))
                {
                    Ping(enemy.Position.To2D());
                }
            }

            if (Config.Item("CastQ").GetValue <KeyBind>().Active)
            {
                CastQTick = Utils.TickCount;
            }
            var qTarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            if (Utils.TickCount - CastQTick < 500)
            {
                if (qTarget != null)
                {
                    Q.Cast(qTarget);
                }
            }

            var combo = Config.Item("Combo").GetValue <KeyBind>().Active;

            //Select cards.
            if (Environment.TickCount - timeChangeW > 120)
            {
                timeChangeW = Environment.TickCount;
                if (Config.Item("ChangeCard").GetValue <KeyBind>().Active)
                {
                    var oldCard = Config.Item("SelectCard").GetValue <Slider>().Value;
                    if (oldCard != 2)
                    {
                        Config.Item("SelectCard").SetValue(new Slider(oldCard + 1, 0, 2));
                    }
                    else
                    {
                        Config.Item("SelectCard").SetValue(new Slider(0, 0, 2));
                    }
                }
            }

            if (Environment.TickCount - timeToggleGold > 120)
            {
                timeToggleGold = Environment.TickCount;
                if (Config.Item("ToggleGold").GetValue <KeyBind>().Active)
                {
                    var CardToggle = Config.Item("AlwaysGold").GetValue <bool>();
                    Config.Item("AlwaysGold").SetValue(!CardToggle);
                    Config.Item("ToggleGold").SetValue(new KeyBind(Config.Item("ToggleGold").GetValue <KeyBind>().Key, KeyBindType.Toggle));
                }
            }

            if (combo)
            {
                if (!Config.Item("AlwaysGold").GetValue <bool>())
                {
                    switch (Config.Item("SelectCard").GetValue <Slider>().Value)
                    {
                    case 0:
                        CardSelector.StartSelecting(Cards.Blue);
                        break;

                    case 1:
                        CardSelector.StartSelecting(Cards.Red);
                        break;

                    case 2:
                        CardSelector.StartSelecting(Cards.Yellow);
                        break;
                    }
                }
                else
                {
                    CardSelector.StartSelecting(Cards.Yellow);
                }

                if (qTarget != null && (qTarget.MoveSpeed < 250 || qTarget.IsStunned || !qTarget.CanMove || qTarget.IsRooted ||
                                        qTarget.IsCharmed || qTarget.Distance(Player) < 400))
                {
                    Q.Cast(qTarget);
                }
            }

            if (Config.Item("WFarm").GetValue <KeyBind>().Active)
            {
                if (Player.ManaPercent < Config.Item("AlwaysBlue").GetValue <Slider>().Value)
                {
                    CardSelector.StartSelecting(Cards.Blue);
                }
                else
                {
                    switch (Config.Item("SelectCard").GetValue <Slider>().Value)
                    {
                    case 0:
                        CardSelector.StartSelecting(Cards.Blue);
                        break;

                    case 1:
                        if (
                            MinionManager.GetMinions(SOW.GetTarget().Position, 125f, MinionTypes.All,
                                                     MinionTeam.Enemy).Count > Config.Item("RedMinions").GetValue <Slider>().Value)
                        {
                            CardSelector.StartSelecting(Cards.Red);
                        }
                        break;

                    case 2:
                        if (
                            MinionManager.GetMinions(SOW.GetTarget().Position, 125f, MinionTypes.All,
                                                     MinionTeam.Enemy).Count > Config.Item("RedMinions").GetValue <Slider>().Value)
                        {
                            CardSelector.StartSelecting(Cards.Red);
                        }
                        break;
                    }
                }
            }

            //if (Config.Item("SelectYellow").GetValue<KeyBind>().Active ||
            //    combo)
            //{
            //    CardSelector.StartSelecting(Cards.Yellow);
            //}

            //if (Config.Item("SelectBlue").GetValue<KeyBind>().Active)
            //{
            //    CardSelector.StartSelecting(Cards.Blue);
            //}

            //if (Config.Item("SelectRed").GetValue<KeyBind>().Active)
            //{
            //    CardSelector.StartSelecting(Cards.Red);
            //}

            /*
             *          if (CardSelector.Status == SelectStatus.Selected && combo)
             *          {
             *              var target = SOW.GetTarget();
             *              if (target.IsValidTarget() && target is Obj_AI_Hero && Items.HasItem("DeathfireGrasp") && ComboDamage((Obj_AI_Hero)target) >= target.Health)
             *              {
             *                  Items.UseItem("DeathfireGrasp", (Obj_AI_Hero) target);
             *              }
             *          }
             */

            //Auto Q
            var autoQI = Config.Item("AutoQI").GetValue <bool>();
            var autoQD = Config.Item("AutoQD").GetValue <bool>();


            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready && (autoQD || autoQI))
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>())
                {
                    if (enemy.IsValidTarget(Q.Range * 2))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if ((pred.Hitchance == HitChance.Immobile && autoQI) ||
                            (pred.Hitchance == HitChance.Dashing && autoQD))
                        {
                            CastQ(enemy, pred.UnitPosition.To2D());
                        }
                    }
                }
            }


            var useItemModes = Config.Item("itemMode").GetValue <StringList>().SelectedIndex;

            if (
                !((SOW.ActiveMode == Orbwalking.OrbwalkingMode.Combo &&
                   (useItemModes == 2 || useItemModes == 3))
                  ||
                  (SOW.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                   (useItemModes == 1 || useItemModes == 3))))
            {
                return;
            }

            var botrk  = Config.Item("itemBotrk").GetValue <bool>();
            var youmuu = Config.Item("itemYoumuu").GetValue <bool>();
            var target = SOW.GetTarget() as Obj_AI_Base;

            if (botrk)
            {
                if (target != null && target.Type == ObjectManager.Player.Type &&
                    target.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 450)
                {
                    var hasCutGlass = Items.HasItem(3144);
                    var hasBotrk    = Items.HasItem(3153);

                    if (hasBotrk || hasCutGlass)
                    {
                        var itemId = hasCutGlass ? 3144 : 3153;
                        var damage = ObjectManager.Player.GetItemDamage(target, Damage.DamageItems.Botrk);
                        if (hasCutGlass ||
                            ObjectManager.Player.Health + damage < ObjectManager.Player.MaxHealth &&
                            Items.CanUseItem(itemId))
                        {
                            Items.UseItem(itemId, target);
                        }
                    }
                }
            }

            if (youmuu && target != null && target.Type == ObjectManager.Player.Type &&
                Orbwalking.InAutoAttackRange(target) && Items.CanUseItem(3142))
            {
                Items.UseItem(3142);
            }
        }
Beispiel #20
0
        public static void OnBeforeAttack(SebbyLib.Orbwalking.BeforeAttackEventArgs args)
        {
            if (ObjectManager.Player.IsDead)
            {
                return;
            }

            if (Mainframe.Orbwalker.ActiveMode == SebbyLib.Orbwalking.OrbwalkingMode.Combo)
            {
                if (CardSelector.Status == SelectStatus.Selecting ||
                    CardSelector.Status == SelectStatus.Ready)
                {
                    args.Process = false;
                }
            }
            else if (Mainframe.Orbwalker.ActiveMode == SebbyLib.Orbwalking.OrbwalkingMode.Mixed)
            {
                if (CardSelector.Status == SelectStatus.Selecting)
                {
                    args.Process = false;
                }
            }

            if (Mainframe.Orbwalker.ActiveMode == SebbyLib.Orbwalking.OrbwalkingMode.Mixed)
            {
                if (HasACard != "empty")
                {
                    if (!HeroManager.Enemies.Contains(args.Target))
                    {
                        foreach (var enemy in HeroManager.Enemies.Where(e => !e.IsDead))
                        {
                            if (enemy.IsValidTarget(Spells._q.Range))
                            {
                                if ((ObjectManager.Player.Distance(enemy) <= SebbyLib.Orbwalking.GetRealAutoAttackRange(ObjectManager.Player) + 100))
                                {
                                    args.Process = false;

                                    if (SebbyLib.Orbwalking.InAutoAttackRange(enemy))
                                    {
                                        if (SebbyLib.Orbwalking.CanAttack())
                                        {
                                            ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, enemy);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else if (Mainframe.Orbwalker.ActiveMode == SebbyLib.Orbwalking.OrbwalkingMode.LaneClear)
            {
                if (HasACard != "none" && HasRed)
                {
                    args.Process = false;

                    IDictionary <Obj_AI_Minion, int> creeps = new Dictionary <Obj_AI_Minion, int>();

                    foreach (var x in ObjectManager.Get <Obj_AI_Minion>().Where(x => x.Team != ObjectManager.Player.Team && x.Team != GameObjectTeam.Neutral && SebbyLib.Orbwalking.InAutoAttackRange(x)))
                    {
                        creeps.Add(x, ObjectManager.Get <Obj_AI_Minion>().Count(y => y.Team != ObjectManager.Player.Team && y.Team != GameObjectTeam.Neutral && y.IsValidTarget() && y.Distance(x.Position) <= 300));
                    }

                    foreach (var x in ObjectManager.Get <Obj_AI_Minion>().Where(x => x.Team == GameObjectTeam.Neutral && SebbyLib.Orbwalking.InAutoAttackRange(x)))
                    {
                        creeps.Add(x, ObjectManager.Get <Obj_AI_Minion>().Count(y => y.Team == GameObjectTeam.Neutral && y.IsValidTarget() && y.Distance(x.Position) <= 300));
                    }

                    var sbire = creeps.OrderByDescending(x => x.Value).FirstOrDefault();

                    ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, sbire.Key);
                }
                else if (args.Target is Obj_AI_Turret)
                {
                    if (ObjectManager.Player.CountEnemiesInRange(900) == 0)
                    {
                        if (Spells._w.IsReadyPerfectly() && CardSelector.Status == SelectStatus.Ready)
                        {
                            CardSelector.StartSelecting(Cards.Blue);

                            if (CardSelector.Status == SelectStatus.Selected && SebbyLib.Orbwalking.InAutoAttackRange(args.Target))
                            {
                                ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, args.Target);
                            }
                        }
                    }
                }
            }
        }
Beispiel #21
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (getCheckBoxItem(misc, "PingLH"))
            {
                foreach (
                    var enemy in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        h =>
                        ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready &&
                        h.IsValidTarget() && ComboDamage(h) > h.Health))
                {
                    Ping(enemy.Position.To2D());
                }
            }

            if (getKeyBindItem(q, "CastQ"))
            {
                CastQTick = Utils.TickCount;
            }

            if (Utils.TickCount - CastQTick < 500)
            {
                var qTarget = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
                if (qTarget != null)
                {
                    Q.Cast(qTarget);
                }
            }

            var combo = Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo);

            //Select cards.
            if (getKeyBindItem(w, "SelectYellow") || combo)
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }

            if (getKeyBindItem(w, "SelectBlue"))
            {
                CardSelector.StartSelecting(Cards.Blue);
            }

            if (getKeyBindItem(w, "SelectRed"))
            {
                CardSelector.StartSelecting(Cards.Red);
            }

            //Auto Q
            var autoQI = getCheckBoxItem(q, "AutoQI");
            var autoQD = getCheckBoxItem(q, "AutoQD");


            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready && (autoQD || autoQI))
            {
                foreach (var enemy in ObjectManager.Get <AIHeroClient>())
                {
                    if (enemy.IsValidTarget(Q.Range * 2))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if ((pred.Hitchance == HitChance.Immobile && autoQI) ||
                            (pred.Hitchance == HitChance.Dashing && autoQD))
                        {
                            CastQ(enemy, pred.UnitPosition.To2D());
                        }
                    }
                }
            }


            var useItemModes = getBoxItem(menuItems, "itemMode");

            if (
                !((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) &&
                   (useItemModes == 2 || useItemModes == 3)) ||
                  (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
                   (useItemModes == 1 || useItemModes == 3))))
            {
                return;
            }

            var botrk  = getCheckBoxItem(menuItems, "itemBotrk");
            var youmuu = getCheckBoxItem(menuItems, "itemYoumuu");
            var target = Orbwalker.LastTarget as Obj_AI_Base;

            if (botrk)
            {
                if (target != null && target.Type == ObjectManager.Player.Type &&
                    target.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 450)
                {
                    var hasCutGlass = Items.HasItem(3144);
                    var hasBotrk    = Items.HasItem(3153);

                    if (hasBotrk || hasCutGlass)
                    {
                        var itemId = hasCutGlass ? 3144 : 3153;
                        var damage = ObjectManager.Player.GetItemDamage(target, Damage.DamageItems.Botrk);
                        if (hasCutGlass ||
                            ObjectManager.Player.Health + damage < ObjectManager.Player.MaxHealth &&
                            Items.CanUseItem(itemId))
                        {
                            Items.UseItem(itemId, target);
                        }
                    }
                }
            }

            if (youmuu && target != null && target.Type == ObjectManager.Player.Type &&
                Orbwalking.InAutoAttackRange(target) && Items.CanUseItem(3142))
            {
                Items.UseItem(3142);
            }
        }
Beispiel #22
0
        public static void LaneClear()
        {
            if (Player.Instance.ManaPercent < Config.GetSliderValue(Config.LaneClear, "manaToLC"))
            {
                return;
            }

            if (Orbwalker.LaneClearMinion != null && Config.IsChecked(Config.LaneClear, "useWinLC"))
            {
                var target =
                    EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                        x => x.NetworkId == Orbwalker.LaneClearMinion.NetworkId);
                if (target != null)
                {
                    switch (Config.GetComboBoxValue(Config.LaneClear, "wModeLC"))
                    {
                    case 0:
                        var combinedManaPercent = Player.Instance.MaxMana
                                                  / (Player.Instance.Spellbook.GetSpell(SpellSlot.W).SData.Mana
                                                     + Player.Instance.Spellbook.GetSpell(SpellSlot.Q).SData.Mana);
                        if (Player.Instance.ManaPercent
                            >= Math.Max(
                                45,
                                Config.GetSliderValue(Config.LaneClear, "manaToLC") + 10 + combinedManaPercent))
                        {
                            var targetAoE =
                                EntityManager.MinionsAndMonsters.EnemyMinions.Count(a => a.Distance(target) <= 250);
                            if (targetAoE > 2)
                            {
                                CardSelector.StartSelecting(Cards.Red);
                            }
                        }
                        else
                        {
                            CardSelector.StartSelecting(Cards.Blue);
                        }

                        break;

                    case 1:
                        CardSelector.StartSelecting(Cards.Yellow);
                        break;

                    case 2:
                        CardSelector.StartSelecting(Cards.Blue);
                        break;

                    case 3:
                        CardSelector.StartSelecting(Cards.Red);
                        break;
                    }
                }
            }

            var minions = EntityManager.MinionsAndMonsters.EnemyMinions.Where(x => x.IsValidTarget(Spells.Q.Range));

            if (minions.Any() && Config.IsChecked(Config.LaneClear, "useQinLC") && Spells.Q.IsReady())
            {
                var farm = EntityManager.MinionsAndMonsters.GetLineFarmLocation(
                    minions,
                    Spells.Q.Width,
                    (int)Spells.Q.Range);
                if (farm.HitNumber >= Config.GetSliderValue(Config.LaneClear, "qTargetsLC"))
                {
                    Spells.Q.Cast(farm.CastPosition);
                }
            }
        }
Beispiel #23
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Config.Item("PingLH").GetValue <bool>())
            {
                foreach (
                    var enemy in
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(
                        h =>
                        ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready &&
                        h.IsValidTarget() && ComboDamage(h) > h.Health))
                {
                    Ping(enemy.Position.To2D());
                }
            }

            if (Config.Item("CastQ").GetValue <KeyBind>().Active)
            {
                CastQTick = Utils.TickCount;
            }

            if (Utils.TickCount - CastQTick < 500)
            {
                var qTarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
                if (qTarget != null)
                {
                    Q.Cast(qTarget);
                }
            }

            var combo = Config.Item("Combo").GetValue <KeyBind>().Active;

            //Select cards.
            if (Config.Item("SelectYellow").GetValue <KeyBind>().Active ||
                combo)
            {
                CardSelector.StartSelecting(Cards.Yellow);
            }

            if (Config.Item("SelectBlue").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Blue);
            }

            if (Config.Item("SelectRed").GetValue <KeyBind>().Active)
            {
                CardSelector.StartSelecting(Cards.Red);
            }

/*
 *          if (CardSelector.Status == SelectStatus.Selected && combo)
 *          {
 *              var target = SOW.GetTarget();
 *              if (target.IsValidTarget() && target is Obj_AI_Hero && Items.HasItem("DeathfireGrasp") && ComboDamage((Obj_AI_Hero)target) >= target.Health)
 *              {
 *                  Items.UseItem("DeathfireGrasp", (Obj_AI_Hero) target);
 *              }
 *          }
 */

            //Auto Q
            var autoQI = Config.Item("AutoQI").GetValue <bool>();
            var autoQD = Config.Item("AutoQD").GetValue <bool>();


            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.Q) == SpellState.Ready && (autoQD || autoQI))
            {
                foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>())
                {
                    if (enemy.IsValidTarget(Q.Range * 2))
                    {
                        var pred = Q.GetPrediction(enemy);
                        if ((pred.Hitchance == HitChance.Immobile && autoQI) ||
                            (pred.Hitchance == HitChance.Dashing && autoQD))
                        {
                            CastQ(enemy, pred.UnitPosition.To2D());
                        }
                    }
                }
            }


            var useItemModes = Config.Item("itemMode").GetValue <StringList>().SelectedIndex;

            if (
                !((SOW.ActiveMode == Orbwalking.OrbwalkingMode.Combo &&
                   (useItemModes == 2 || useItemModes == 3))
                  ||
                  (SOW.ActiveMode == Orbwalking.OrbwalkingMode.Mixed &&
                   (useItemModes == 1 || useItemModes == 3))))
            {
                return;
            }

            var botrk  = Config.Item("itemBotrk").GetValue <bool>();
            var youmuu = Config.Item("itemYoumuu").GetValue <bool>();
            var target = SOW.GetTarget() as Obj_AI_Base;

            if (botrk)
            {
                if (target != null && target.Type == ObjectManager.Player.Type &&
                    target.ServerPosition.Distance(ObjectManager.Player.ServerPosition) < 450)
                {
                    var hasCutGlass = Items.HasItem(3144);
                    var hasBotrk    = Items.HasItem(3153);

                    if (hasBotrk || hasCutGlass)
                    {
                        var itemId = hasCutGlass ? 3144 : 3153;
                        var damage = ObjectManager.Player.GetItemDamage(target, Damage.DamageItems.Botrk);
                        if (hasCutGlass ||
                            ObjectManager.Player.Health + damage < ObjectManager.Player.MaxHealth &&
                            Items.CanUseItem(itemId))
                        {
                            Items.UseItem(itemId, target);
                        }
                    }
                }
            }

            if (youmuu && target != null && target.Type == ObjectManager.Player.Type &&
                Orbwalking.InAutoAttackRange(target) && Items.CanUseItem(3142))
            {
                Items.UseItem(3142);
            }
        }
Beispiel #24
0
        public static void JungleClear()
        {
            var jungle =
                EntityManager.MinionsAndMonsters.Monsters.Where(
                    x => x.Distance(Player.Instance.Position) <= Player.Instance.AttackRange + 200)
                .OrderByDescending(x => x.MaxHealth);

            if (!jungle.Any() || Player.Instance.ManaPercent < Config.GetSliderValue(Config.JungleClear, "manaToJC") ||
                jungle.FirstOrDefault() == null)
            {
                return;
            }

            switch (Config.GetComboBoxValue(Config.JungleClear, "wModeJC"))
            {
            case 0:
                if (jungle.Any(x => x.Name.StartsWith("SRU_Baron") || x.Name.StartsWith("SRU_Dragon")))
                {
                    CardSelector.StartSelecting(Cards.Blue);
                }
                else
                {
                    var combinedManaPercent = Player.Instance.MaxMana
                                              / (Player.Instance.Spellbook.GetSpell(SpellSlot.W).SData.Mana
                                                 + Player.Instance.Spellbook.GetSpell(SpellSlot.Q).SData.Mana);
                    if (Player.Instance.ManaPercent
                        >= Math.Max(
                            45,
                            Config.GetSliderValue(Config.JungleClear, "manaToJC") + 10 + combinedManaPercent))
                    {
                        var targetAoE = jungle.Count(x => x.Distance(jungle.FirstOrDefault()) <= 250);
                        if (targetAoE > 2)
                        {
                            CardSelector.StartSelecting(Cards.Red);
                        }
                        else
                        {
                            // ReSharper disable once PossibleNullReferenceException
                            if (jungle.FirstOrDefault().HealthPercent >= 40 && Player.Instance.HealthPercent < 75)
                            {
                                CardSelector.StartSelecting(Cards.Yellow);
                            }
                            else
                            {
                                CardSelector.StartSelecting(Cards.Blue);
                            }
                        }

                        // CardSelector.StartSelecting(targetAoE > 2 ? Cards.Red : Cards.Yellow);
                    }
                    else
                    {
                        CardSelector.StartSelecting(Cards.Blue);
                    }
                }

                break;

            case 1:
                CardSelector.StartSelecting(Cards.Yellow);
                break;

            case 2:
                CardSelector.StartSelecting(Cards.Blue);
                break;

            case 3:
                CardSelector.StartSelecting(Cards.Red);
                break;
            }

            if (Config.IsChecked(Config.JungleClear, "useQinJC") && Spells.Q.IsReady())
            {
                var target = jungle.FirstOrDefault(x => x.IsValidTarget(Spells.Q.Range));
                if (target != null)
                {
                    Spells.Q.Cast(target);
                }
            }
        }