Exemplo n.º 1
0
        private void Harass()
        {
            Obj_AI_Hero target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);
            float       perc   = config.Item("minmanaH", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc)
            {
                return;
            }
            if (target == null)
            {
                return;
            }
            if (config.Item("useqH", true).GetValue <bool>() && Q.IsReady())
            {
                var miniPred =
                    MinionManager.GetMinions(
                        Orbwalking.GetRealAutoAttackRange(player), MinionTypes.All, MinionTeam.NotAlly)
                    .FirstOrDefault(
                        minion =>
                        minion.Health > 5 &&
                        HealthPrediction.GetHealthPrediction(
                            minion,
                            (int)(player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
                            1000 * (int)player.Distance(minion) / (int)Orbwalking.GetMyProjectileSpeed()) < 0);
                var priortarg = orbwalker.GetTarget();
                var canHArass = priortarg != null && !(priortarg is Obj_AI_Hero);
                if (canHArass || (!canHArass && miniPred == null))
                {
                    var targQ = Q.GetPrediction(target);
                    if (Q.Range - 100 > targQ.CastPosition.Distance(player.Position) &&
                        targQ.Hitchance >= HitChance.High)
                    {
                        Q.Cast(targQ.CastPosition, config.Item("packets").GetValue <bool>());
                    }
                }
            }
            if (config.Item("usewH", true).GetValue <bool>() && W.IsReady())
            {
                var tarPered = W.GetPrediction(target);
                if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position) &&
                    tarPered.Hitchance >= HitChance.High)
                {
                    W.Cast(tarPered.CastPosition, config.Item("packets").GetValue <bool>());
                }
            }
        }