Exemple #1
0
        protected override void Harass()
        {
            if (Menu.Item(Menu.Name + ".harass.q").GetValue <bool>() && Q.IsReady() && ResourceManager.Check("harass-q") &&
                !Player.IsWindingUp && !Player.IsDashing())
            {
                var target = TargetSelector.GetTarget(Q);
                if (target != null)
                {
                    var prediction = Q.GetPrediction(target);
                    if (prediction.Hitchance >= Q.GetHitChance("harass"))
                    {
                        Q.Cast(prediction.CastPosition);
                    }
                    else if (prediction.Hitchance == HitChance.Collision)
                    {
                        QCollisionCheck(target);
                    }
                }
            }

            if (Menu.Item(Menu.Name + ".harass.e").GetValue <bool>() && E.IsReady() && ResourceManager.Check("harass-e"))
            {
                var target = TargetSelector.GetTarget(E, false);
                if (target != null && Rend.HasBuff(target))
                {
                    if (Rend.IsKillable(target, false))
                    {
                        CastE();
                    }
                    if (target.Distance(Player) > Orbwalking.GetRealAutoAttackRange(target))
                    {
                        if (
                            GameObjects.EnemyMinions.Any(
                                m => m.IsValidTarget(E.Range * 0.95f) && Rend.IsKillable(m, m.HealthPercent < 10)))
                        {
                            CastE();
                        }
                        else
                        {
                            var dashObjects =
                                GameObjects.EnemyMinions.Where(
                                    m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m))).ToList();
                            var minion =
                                dashObjects.FirstOrDefault(
                                    m =>
                                    m.Health > Player.GetAutoAttackDamage(m) * 1.1f &&
                                    m.Health < Player.GetAutoAttackDamage(m) + Rend.GetDamage(m, 1));
                            if (minion != null)
                            {
                                Orbwalker.ForceTarget(minion);
                                if (Orbwalking.CanAttack())
                                {
                                    ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, minion);
                                }
                            }
                        }
                    }
                    else if (E.IsInRange(target))
                    {
                        if (Rend.IsKillable(target, false))
                        {
                            CastE();
                        }
                        else
                        {
                            var buff = Rend.GetBuff(target);
                            if (buff != null &&
                                buff.Count >= Menu.Item(Menu.Name + ".harass.e-min").GetValue <Slider>().Value)
                            {
                                if (target.Distance(Player) > E.Range * 0.8 && !target.IsFacing(Player) ||
                                    buff.EndTime - Game.Time < 0.3)
                                {
                                    CastE();
                                }
                            }
                        }
                    }
                }
            }
        }