示例#1
0
        private static void Fight(Menu mode)
        {
            if (mode == comboMenu && getCheckBoxItem(mode, "E") && E.IsReady())
            {
                if (getCheckBoxItem(mode, "EQ") && getCheckBoxItem(mode, "Q") &&
                    (Player.Mana < E.Instance.SData.Mana + Q.Instance.SData.Mana || (!Q.IsReady() && Q.IsReady(4000))))
                {
                    return;
                }
                var target = E.GetTarget(getCheckBoxItem(mode, "Q") && Q.IsReady() ? 0 : E.Width / 2);
                if (target != null)
                {
                    var predE = E.GetPrediction(target);
                    if (predE.Hitchance >= E.MinHitChance)
                    {
                        E.Cast(
                            predE.UnitPosition.Extend(Player.ServerPosition, -E.Width / (target.IsFacing(Player) ? 2 : 1)),
                            getCheckBoxItem(miscMenu, "Packet"));
                        if (getCheckBoxItem(mode, "Q") && Q.IsReady())
                        {
                            Q.Cast(predE.UnitPosition, getCheckBoxItem(miscMenu, "Packet"));
                        }
                        return;
                    }
                }
            }

            if (getCheckBoxItem(mode, "Q") && Q.IsReady())
            {
                if (mode == comboMenu)
                {
                    if (getCheckBoxItem(mode, "E") && getCheckBoxItem(mode, "EQ") &&
                        Player.Mana >= E.Instance.SData.Mana + Q.Instance.SData.Mana && E.IsReady(2000))
                    {
                        return;
                    }
                    var target = Q2.GetTarget();
                    if (getCheckBoxItem(mode, "E") && target != null &&
                        Flag.Where(
                            i =>
                            Player.LSDistance(i) < getSliderItem(mode, "QFlagRange") &&
                            Q2.WillHit(target, i.ServerPosition))
                        .Any(i => Q.Cast(i.ServerPosition, getCheckBoxItem(miscMenu, "Packet"))))
                    {
                        return;
                    }
                }
                Q.CastOnBestTarget(0, getCheckBoxItem(miscMenu, "Packet"));
            }
            if (mode != comboMenu)
            {
                return;
            }
            if (getCheckBoxItem(mode, "R") && R.IsReady() && !_rCasted)
            {
                var obj = (from i in HeroManager.Enemies.Where(i => i.IsValidTarget(R.Range))
                           let enemy = GetRTarget(i.ServerPosition)
                                       where
                                       (enemy.Count > 1 && R.IsKillable(i)) ||
                                       enemy.Any(a => a.HealthPercent < getSliderItem(mode, "RHpU")) ||
                                       enemy.Count >= getSliderItem(mode, "RCountA")
                                       select i).MaxOrDefault(i => GetRTarget(i.ServerPosition).Count);
                if (obj != null && R.CastOnUnit(obj, getCheckBoxItem(miscMenu, "Packet")))
                {
                    return;
                }
            }
            if (getCheckBoxItem(mode, "W") && W.IsReady() &&
                (Player.HealthPercent < getSliderItem(mode, "WHpU") ||
                 Player.CountEnemiesInRange(W.Range) >= getSliderItem(mode, "WCountA")))
            {
                W.Cast(getCheckBoxItem(miscMenu, "Packet"));
            }
        }