Esempio n. 1
0
        protected override void LaneClear()
        {
            var q = Menu.Item(Menu.Name + ".lane-clear.q").GetValue <bool>() && Q.IsReady() &&
                    ResourceManager.Check("lane-clear");
            var qMin = Menu.Item(Menu.Name + ".lane-clear.q-min").GetValue <Slider>().Value;
            var w    = Menu.Item(Menu.Name + ".lane-clear.w").GetValue <bool>() && W.IsReady();

            if (q)
            {
                var minions = MinionManager.GetMinions(Q.Range * 1.2f);
                var m       = minions.OrderBy(x => x.Distance(Player)).FirstOrDefault();
                if (m == null)
                {
                    return;
                }
                var best = BestQPosition(null, minions, HitChance.High);
                if (!best.Item2.Equals(Vector3.Zero) && best.Item1 >= qMin)
                {
                    Q.Cast(best.Item2);
                }
            }
            if (w)
            {
                var minions = MinionManager.GetMinions(W.Range * 1.2f);
                if (minions.Any())
                {
                    Cards.Select(!ResourceManager.Check("lane-clear-blue") ? CardColor.Blue : CardColor.Red);
                }
            }
        }
Esempio n. 2
0
        protected override void JungleClear()
        {
            var q = Menu.Item(Menu.Name + ".lane-clear.q").GetValue <bool>() && Q.IsReady() &&
                    (ResourceManager.Check("lane-clear") || ResourceManager.IgnoreJungle("lane-clear"));
            var w = Menu.Item(Menu.Name + ".lane-clear.w").GetValue <bool>() && W.IsReady();

            if (q)
            {
                var minions = MinionManager.GetMinions(
                    Q.Range * 1.2f, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
                var m = minions.OrderBy(x => x.Distance(Player)).FirstOrDefault();
                if (m == null)
                {
                    return;
                }
                var best = BestQPosition(null, minions, HitChance.High);
                if (!best.Item2.Equals(Vector3.Zero) && best.Item1 >= 1)
                {
                    Q.Cast(best.Item2);
                }
            }
            if (w)
            {
                var minions = MinionManager.GetMinions(
                    W.Range * 1.2f, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
                if (minions.Any())
                {
                    Cards.Select(
                        (ResourceManager.Check("lane-clear-blue") || ResourceManager.IgnoreJungle("lane-clear-blue"))
                            ? CardColor.Red
                            : CardColor.Blue);
                }
            }
        }
Esempio n. 3
0
 protected override void OnPostUpdate()
 {
     if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
         Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
     {
         if (Cards.Has(CardColor.Red))
         {
             var range   = Player.AttackRange + Player.BoundingRadius * 1.5f;
             var minions = MinionManager.GetMinions(range, MinionTypes.All, MinionTeam.NotAlly);
             var pred    = MinionManager.GetBestCircularFarmLocation(
                 minions.Select(m => m.Position.To2D()).ToList(), 500, range);
             var target = minions.OrderBy(m => m.Distance(pred.Position)).FirstOrDefault();
             if (target != null)
             {
                 Orbwalker.ForceTarget(target);
             }
         }
     }
     if (!Cards.ShouldWait && Cards.Status != SelectStatus.Selecting && Cards.Status != SelectStatus.Selected)
     {
         Orbwalker.ForceTarget(null);
     }
     if (Cards.Status != SelectStatus.Selected)
     {
         if (Menu.Item(Menu.Name + ".manual.blue").GetValue <KeyBind>().Active)
         {
             Cards.Select(CardColor.Blue);
         }
         if (Menu.Item(Menu.Name + ".manual.red").GetValue <KeyBind>().Active)
         {
             Cards.Select(CardColor.Red);
         }
         if (Menu.Item(Menu.Name + ".manual.gold").GetValue <KeyBind>().Active)
         {
             Cards.Select(CardColor.Gold);
         }
     }
 }
        private static void OnCorePostUpdate(EventArgs args)
        {
            try
            {
                if (_menu == null || !_menu.Item(_menu.Name + ".enabled").GetValue <bool>())
                {
                    return;
                }

                if (Environment.TickCount - _lastTick >= _interval)
                {
                    _lastTick = Environment.TickCount;

                    if (_menu.Item(_menu.Name + ".fountain").GetValue <bool>() && !ObjectManager.Player.InFountain())
                    {
                        return;
                    }

                    if (ObjectManager.Player.ManaPercent >=
                        _menu.Item(_menu.Name + ".min-mana").GetValue <Slider>().Value)
                    {
                        var tearSlot = ObjectManager.Player.GetSpellSlot("TearsDummySpell");
                        if (tearSlot != SpellSlot.Unknown &&
                            Game.Time > ObjectManager.Player.GetSpell(tearSlot).CooldownExpires&&
                            ObjectManager.Player.CountEnemiesInRange(
                                _menu.Item(_menu.Name + ".min-distance").GetValue <Slider>().Value) <= 0)
                        {
                            var spell =
                                _spells.FirstOrDefault(
                                    s => s.IsReady() && _menu.Item(_menu.Name + "." + s.Slot).GetValue <bool>());
                            if (spell != null)
                            {
                                if (spell.IsSkillshot)
                                {
                                    var target =
                                        GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(spell.Range))
                                        .Concat(MinionManager.GetMinions(spell.Range))
                                        .FirstOrDefault();
                                    if (target != null)
                                    {
                                        spell.Cast(target.Position);
                                    }
                                    else
                                    {
                                        var position = ObjectManager.Player.Position.Extend(
                                            Game.CursorPos, Math.Min(1000, spell.Range * 0.8f + Random.Next(1, 26)));
                                        if (position.IsValid())
                                        {
                                            spell.Cast(position);
                                        }
                                    }
                                }
                                else if (spell.Range > 0f)
                                {
                                    if (spell.Speed.Equals(default(float)))
                                    {
                                        spell.Cast();
                                    }
                                    else
                                    {
                                        var target =
                                            GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(spell.Range))
                                            .Concat(MinionManager.GetMinions(spell.Range))
                                            .FirstOrDefault();
                                        if (target != null)
                                        {
                                            spell.Cast(target);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }