A Class Containing Methods that are needed for the Main Program.
Exemplo n.º 1
0
        /// <summary>
        /// Called when a Spell gets Casted
        /// </summary>
        /// <param name="sender">The Sender</param>
        /// <param name="args">The Spell</param>
        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            //var allahAkbarT = Config.MiscMenu["allahAkbarT"].Cast<CheckBox>().CurrentValue;
            var autoE   = Config.MiscMenu["autoE"].Cast <CheckBox>().CurrentValue;
            var eSlider = Config.MiscMenu["eSlider"].Cast <Slider>().CurrentValue;

            /*if (AllahAkbar != null)
             * {
             *  if (allahAkbarT && sender.IsMe && args.SData.Name.Equals("JinxR"))
             *  {
             *      AllahAkbar.Play();
             *  }
             * }*/

            if (!autoE || sender.IsMinion || !E.IsReady())
            {
                return;
            }

            if (sender.IsEnemy && sender.IsValidTarget(E.Range) && Essentials.ShouldUseE(args.SData.Name))
            {
                var prediction = E.GetPrediction(sender);

                if (prediction.HitChancePercent >= eSlider)
                {
                    E.Cast(prediction.CastPosition);
                }
            }

            if (sender.IsAlly && args.SData.Name == "RocketGrab" && E.IsInRange(sender))
            {
                Essentials.GrabTime = Game.Time;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called every time the Game Ticks
        /// </summary>
        /// <param name="args">The Args</param>
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Orbwalker.ForcedTarget != null)
            {
                if (!Player.Instance.IsInAutoAttackRange(Orbwalker.ForcedTarget) ||
                    !Orbwalker.ForcedTarget.IsValidTarget() ||
                    Essentials.HasUndyingBuff(Orbwalker.ForcedTarget as Obj_AI_Base))
                {
                    Orbwalker.ForcedTarget = null;
                }

                var target = TargetSelector.GetTarget(Player.Instance.GetAutoAttackRange(),
                                                      DamageType.Physical);

                if (Orbwalker.ForcedTarget is AIHeroClient && target != null &&
                    ((Orbwalker.ForcedTarget.NetworkId != target.NetworkId) && !Essentials.HasUndyingBuff(target) &&
                     Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)))
                {
                    Orbwalker.ForcedTarget = TargetSelector.GetTarget(Player.Instance.GetAutoAttackRange(),
                                                                      DamageType.Physical);
                }
            }

            if (Player.Instance.IsDead)
            {
                return;
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                StateManager.Combo();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                StateManager.Harass();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                StateManager.LastHit();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                StateManager.LaneClear();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
            {
                StateManager.JungleClear();
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee))
            {
                StateManager.Flee();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Does LaneClear Method
        /// </summary>
        public static void LaneClear()
        {
            var useQ    = Config.LaneClearMenu["useQ"].Cast <CheckBox>().CurrentValue;
            var manaQ   = Config.LaneClearMenu["manaQ"].Cast <Slider>().CurrentValue;
            var lastHit = Config.LaneClearMenu["lastHit"].Cast <CheckBox>().CurrentValue;

            if (useQ && Program.Q.IsReady())
            {
                var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    Player.Instance.ServerPosition,
                    Essentials.FishBonesRange())
                             .Where(
                    t =>
                    t.Health <= Player.Instance.GetAutoAttackDamage(t) * 1.1f &&
                    t.Distance(Player.Instance) > Essentials.MinigunRange)
                             .OrderByDescending(t => t.Health);
                //Orbwalker.LasthittableMinions.Where(t => t.IsValidTarget() && t.Distance(Player.Instance) <= Essentials.FishBonesRange());

                if (Essentials.FishBones())
                {
                    if (!minion.Any())
                    {
                        Program.Q.Cast();
                        return;
                    }
                }

                if (!Essentials.FishBones() && Player.Instance.ManaPercent >= manaQ)
                {
                    var m = minion.FirstOrDefault();

                    if (m == null)
                    {
                        return;
                    }

                    var minionsAoe =
                        EntityManager.MinionsAndMonsters.EnemyMinions.Count(
                            t =>
                            t.IsValidTarget() && t.Distance(m) <= 100 &&
                            t.Health <= (Player.Instance.GetAutoAttackDamage(m) * 1.1f));

                    if (m.Distance(Player.Instance) <= Essentials.FishBonesRange() && m.IsValidTarget() &&
                        minionsAoe >= Config.LaneClearMenu["qCountM"].Cast <Slider>().CurrentValue)
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = m;
                    }
                    else if (m.Distance(Player.Instance) >= Player.Instance.GetAutoAttackRange() &&
                             Orbwalker.LastHitMinionsList.Contains(m) && lastHit)
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = m;
                    }
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Executes the Kill Steal Method
        /// </summary>
        private static void StandaloneKillSteal()
        {
            var useW    = Config.KillStealMenu["useW"].Cast <CheckBox>().CurrentValue;
            var useR    = Config.KillStealMenu["useR"].Cast <CheckBox>().CurrentValue;
            var manaW   = Config.KillStealMenu["manaW"].Cast <Slider>().CurrentValue;
            var manaR   = Config.KillStealMenu["manaR"].Cast <Slider>().CurrentValue;
            var wSlider = Config.KillStealMenu["wSlider"].Cast <Slider>().CurrentValue;
            var rSlider = Config.KillStealMenu["rSlider"].Cast <Slider>().CurrentValue;
            var wRange  = Config.KillStealMenu["wRange"].Cast <Slider>().CurrentValue;

            if (useW && Player.Instance.ManaPercent >= manaW && Program.W.IsReady())
            {
                var selection =
                    EntityManager.Heroes.Enemies.Where(
                        t =>
                        t.IsValidTarget() && !Essentials.HasUndyingBuff(t) && Program.W.IsInRange(t) &&
                        t.Distance(Player.Instance) >= wRange &&
                        Essentials.DamageLibrary.CalculateDamage(t, false, true, false, false) >= t.Health);

                foreach (
                    var pred in
                    selection.Select(enemy => Program.W.GetPrediction(enemy))
                    .Where(pred => pred != null && pred.HitChancePercent >= wSlider && !pred.Collision))
                {
                    Program.W.Cast(pred.CastPosition);
                }
            }

            if (useR && Player.Instance.ManaPercent >= manaR && Program.R.IsReady())
            {
                var selection =
                    EntityManager.Heroes.Enemies.Where(
                        t =>
                        t.IsValidTarget() && !Essentials.HasUndyingBuff(t)
                        &&
                        Player.Instance.Distance(t) <=
                        Config.KillStealMenu["rRange"].Cast <Slider>().CurrentValue&&
                        Player.Instance.Distance(t) >= Config.MiscMenu["rRange"].Cast <Slider>().CurrentValue &&
                        Essentials.DamageLibrary.CalculateDamage(t, false, false, false, true) >= t.Health);

                foreach (
                    var pred in
                    selection.Select(enemy => Program.R.GetPrediction(enemy))
                    .Where(pred => pred != null && pred.HitChancePercent >= rSlider))
                {
                    Program.R.Cast(pred.CastPosition);
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Executes the Kill Steal Method
        /// </summary>
        private static void WR_KillSteal()
        {
            var useW    = Config.KillStealMenu["useW"].Cast <CheckBox>().CurrentValue;
            var useR    = Config.KillStealMenu["useR"].Cast <CheckBox>().CurrentValue;
            var manaW   = Config.KillStealMenu["manaW"].Cast <Slider>().CurrentValue;
            var manaR   = Config.KillStealMenu["manaR"].Cast <Slider>().CurrentValue;
            var wSlider = Config.KillStealMenu["wSlider"].Cast <Slider>().CurrentValue;
            var rSlider = Config.KillStealMenu["rSlider"].Cast <Slider>().CurrentValue;
            var wRange  = Config.KillStealMenu["wRange"].Cast <Slider>().CurrentValue;

            if (useW && useR && Player.Instance.ManaPercent >= manaW && Player.Instance.ManaPercent >= manaR &&
                Program.W.IsReady() && Program.R.IsReady())
            {
                var selection =
                    EntityManager.Heroes.Enemies.Where(
                        t =>
                        t.IsValidTarget() && !Essentials.HasUndyingBuff(t) && Program.W.IsInRange(t) &&
                        Player.Instance.Distance(t) >= wRange &&
                        Player.Instance.Distance(t) <=
                        Config.KillStealMenu["rRange"].Cast <Slider>().CurrentValue&&
                        Player.Instance.Distance(t) >= Config.MiscMenu["rRange"].Cast <Slider>().CurrentValue &&
                        Essentials.DamageLibrary.CalculateDamage(t, false, true, false, true) >= t.Health);

                foreach (var enemy in selection)
                {
                    var pred = Program.W.GetPrediction(enemy);

                    if (pred != null && pred.HitChancePercent >= wSlider && !pred.Collision)
                    {
                        Program.W.Cast(pred.CastPosition);
                        var target = enemy;

                        Core.DelayAction(() =>
                        {
                            var predR    = Program.R.GetPrediction(target);
                            var checkDmg = target.Health <=
                                           Essentials.DamageLibrary.CalculateDamage(target, false, false, false, true);

                            if (predR != null && predR.HitChancePercent >= rSlider && checkDmg)
                            {
                                Program.R.Cast(predR.CastPosition);
                            }
                        }, Program.W.CastDelay + (int)Math.Floor(pred.CastPosition.Distance(Player.Instance) / Program.W.Speed));
                    }
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Called every time the Game Draws
        /// </summary>
        /// <param name="args">The Args</param>
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (Player.Instance.IsDead)
            {
                return;
            }

            var drawQ = Config.DrawingMenu["drawQ"].Cast <CheckBox>().CurrentValue;
            var drawW = Config.DrawingMenu["drawW"].Cast <CheckBox>().CurrentValue;
            var drawE = Config.DrawingMenu["drawE"].Cast <CheckBox>().CurrentValue;
            var predW = Config.DrawingMenu["predW"].Cast <CheckBox>().CurrentValue;
            var predR = Config.DrawingMenu["predR"].Cast <CheckBox>().CurrentValue;

            if (drawQ)
            {
                Circle.Draw(Q.IsReady() ? Color.Green : Color.Red,
                            !Essentials.FishBones() ? Essentials.FishBonesRange() : Essentials.MinigunRange,
                            Player.Instance.Position);
            }

            if (drawW)
            {
                Circle.Draw(W.IsReady() ? Color.Red : Color.Green, W.Range, Player.Instance.Position);
            }

            if (drawE)
            {
                Circle.Draw(E.IsReady() ? Color.Red : Color.Green, E.Range, Player.Instance.Position);
            }

            if (predW)
            {
                var enemy =
                    EntityManager.Heroes.Enemies.Where(t => t.IsValidTarget() && W.IsInRange(t))
                    .OrderBy(t => t.Distance(Player.Instance))
                    .FirstOrDefault();
                if (enemy == null)
                {
                    return;
                }
                var wPred = W.GetPrediction(enemy).CastPosition;
                Essentials.DrawLineRectangle(wPred.To2D(), Player.Instance.Position.To2D(), W.Width, 1,
                                             W.IsReady() ? System.Drawing.Color.YellowGreen : System.Drawing.Color.Red);
            }

            if (predR)
            {
                var enemy =
                    EntityManager.Heroes.Enemies.Where(
                        t =>
                        t.IsValidTarget() &&
                        t.Distance(Player.Instance) >= Config.MiscMenu["rRange"].Cast <Slider>().CurrentValue&&
                        t.Distance(Player.Instance) <= R.Range)
                    .OrderBy(t => t.Distance(Player.Instance))
                    .FirstOrDefault();
                if (enemy == null)
                {
                    return;
                }
                var rPred = R.GetPrediction(enemy).CastPosition;
                Essentials.DrawLineRectangle(rPred.To2D(), Player.Instance.Position.To2D(), R.Width, 1,
                                             R.IsReady() ? System.Drawing.Color.YellowGreen : System.Drawing.Color.Red);
            }
        }
Exemplo n.º 7
0
        /*private static void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
         * {
         *  Chat.Print("Failed Downloading: " + e.Error);
         *  AllahAkbar = new SoundPlayer
         *  {
         *      SoundLocation =
         *          SandboxConfig.DataDirectory + @"\JinXXX\" + "Allahu_Akbar_Sound_Effect_Download_Link.wav"
         *  };
         *  AllahAkbar.Load();
         * }*/

        /// <summary>
        /// Called Before Attack
        /// </summary>
        /// <param name="target">The Target</param>
        /// <param name="args">The Args</param>
        private static void Orbwalker_OnPreAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
        {
            #region Combo

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                var useQ = Config.ComboMenu["useQ"].Cast <CheckBox>().CurrentValue;

                // If the player has the rocket
                if (useQ && Program.Q.IsReady() && Essentials.FishBones())
                {
                    //var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);

                    if (target != null && target.IsValidTarget())
                    {
                        if ((target.Distance(Player.Instance) - target.BoundingRadius - Player.Instance.BoundingRadius) <= Essentials.MinigunRange &&
                            target.CountEnemyChampionsInRange(100) <
                            Config.ComboMenu["qCountC"].Cast <Slider>().CurrentValue)
                        {
                            Program.Q.Cast();
                            Orbwalker.ForcedTarget = target;
                        }
                    }
                }
            }

            #endregion

            #region LastHit

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                var useQ    = Config.LastHitMenu["useQ"].Cast <CheckBox>().CurrentValue;
                var manaQ   = Config.LastHitMenu["manaQ"].Cast <Slider>().CurrentValue;
                var qCountM = Config.LastHitMenu["qCountM"].Cast <Slider>().CurrentValue;

                // Force Minigun if there is a lasthittable minion in minigun range and there is no targets more than the setting amount.
                var kM = Orbwalker.LastHitMinionsList.Where(
                    t => t.IsEnemy &&
                    t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 0.9) && t.IsValidTarget() &&
                    t.Distance(Player.Instance) <= Essentials.MinigunRange);
                if (useQ && Essentials.FishBones() && kM.Count() < qCountM)
                {
                    Program.Q.Cast();
                }
            }

            #endregion

            #region Lane Clear

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    Player.Instance.ServerPosition,
                    Essentials.FishBonesRange()).OrderByDescending(t => t.Health);

                if (Essentials.FishBones())
                {
                    foreach (var m in minion)
                    {
                        var minionsAoe =
                            EntityManager.MinionsAndMonsters.EnemyMinions.Count(
                                t => t.IsValidTarget() && t.Distance(m) <= 100);

                        if (m.Distance(Player.Instance) <= Essentials.MinigunRange && m.IsValidTarget() &&
                            (minionsAoe < Config.LaneClearMenu["qCountM"].Cast <Slider>().CurrentValue ||
                             m.Health > (Player.Instance.GetAutoAttackDamage(m))))
                        {
                            Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                        else if (m.Distance(Player.Instance) <= Essentials.MinigunRange &&
                                 !Orbwalker.LastHitMinionsList.Contains(m))
                        {
                            Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                        else
                        {
                            foreach (
                                var kM in
                                Orbwalker.LastHitMinionsList.Where(
                                    kM =>
                                    kM.IsValidTarget() &&
                                    kM.Health <= (Player.Instance.GetAutoAttackDamage(kM) * 0.9) &&
                                    kM.Distance(Player.Instance) <= Essentials.MinigunRange))
                            {
                                Q.Cast();
                                Orbwalker.ForcedTarget = kM;
                            }
                        }
                    }
                }
            }

            #endregion

            if (Essentials.FishBones() && target.IsStructure() &&
                target.Distance(Player.Instance) <= Essentials.MinigunRange)
            {
                Q.Cast();
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Does JungleClear Method
        /// </summary>
        public static void JungleClear()
        {
            var useQ    = Config.JungleClearMenu["useQ"].Cast <CheckBox>().CurrentValue;
            var useW    = Config.JungleClearMenu["useW"].Cast <CheckBox>().CurrentValue;
            var wRange  = Config.MiscMenu["wRange"].Cast <CheckBox>().CurrentValue;
            var manaQ   = Config.JungleClearMenu["manaQ"].Cast <Slider>().CurrentValue;
            var manaW   = Config.JungleClearMenu["manaW"].Cast <Slider>().CurrentValue;
            var wSlider = Config.JungleClearMenu["wSlider"].Cast <Slider>().CurrentValue;

            if (useQ && Player.Instance.ManaPercent >= manaQ && Program.Q.IsReady())
            {
                if (Essentials.FishBones())
                {
                    var mobs = EntityManager.MinionsAndMonsters.GetJungleMonsters(
                        Player.Instance.ServerPosition,
                        Essentials.FishBonesRange());

                    foreach (
                        var mob in
                        mobs.Where(mob => mob != null && Player.Instance.Distance(mob) <= Essentials.MinigunRange))
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = mob;
                    }
                }
                else if (!Essentials.FishBones())
                {
                    var mobs = EntityManager.MinionsAndMonsters.GetJungleMonsters(
                        Player.Instance.ServerPosition,
                        Essentials.FishBonesRange());

                    foreach (
                        var mob in
                        mobs.Where(mob => mob != null)
                        .Where(
                            mob =>
                            !Player.Instance.IsInAutoAttackRange(mob) &&
                            Player.Instance.Distance(mob) <= Essentials.FishBonesRange()))
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = mob;
                    }
                }
            }

            if (useW && Player.Instance.ManaPercent >= manaW && Program.W.IsReady())
            {
                var target =
                    EntityManager.MinionsAndMonsters.GetJungleMonsters(Player.Instance.ServerPosition, Program.W.Range)
                    .OrderByDescending(t => t.Health)
                    .FirstOrDefault();
                if (target != null)
                {
                    var wPrediction = Program.W.GetPrediction(target);

                    if (!(wPrediction.HitChancePercent >= wSlider))
                    {
                        return;
                    }
                    if (wRange && Player.Instance.IsInAutoAttackRange(target))
                    {
                        Program.W.Cast(wPrediction.CastPosition);
                    }
                    else if (!wRange)
                    {
                        Program.W.Cast(wPrediction.CastPosition);
                    }
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Does Harass Method
        /// </summary>
        public static void Harass()
        {
            #region Variables

            var useQ    = Config.HarassMenu["useQ"].Cast <CheckBox>().CurrentValue;
            var useW    = Config.HarassMenu["useW"].Cast <CheckBox>().CurrentValue;
            var wRange  = Config.MiscMenu["wRange"].Cast <CheckBox>().CurrentValue;
            var wRange2 = Config.HarassMenu["wRange2"].Cast <Slider>().CurrentValue;
            var manaQ   = Config.HarassMenu["manaQ"].Cast <Slider>().CurrentValue;
            var manaW   = Config.HarassMenu["manaW"].Cast <Slider>().CurrentValue;
            var qCountM = Config.HarassMenu["qCountM"].Cast <Slider>().CurrentValue;
            var wSlider = Config.HarassMenu["wSlider"].Cast <Slider>().CurrentValue;

            #endregion

            #region Last Hitting Section

            // Force Minigun if there is a lasthittable minion in minigun range and there is no targets more than the setting amount.
            var kM = Orbwalker.LastHitMinionsList.Where(
                t => t.IsEnemy &&
                t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 0.9090909F) && t.IsValidTarget() &&
                t.Distance(Player.Instance) <= Essentials.MinigunRange);
            if (useQ && Essentials.FishBones() && kM.Count() < qCountM)
            {
                Program.Q.Cast();
            }

            // Out of Range
            if (useQ && Player.Instance.ManaPercent >= manaQ && !Essentials.FishBones())
            {
                var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    Player.Instance.ServerPosition,
                    Essentials.FishBonesRange())
                             .Where(
                    t =>
                    t.Health <= Player.Instance.GetAutoAttackDamage(t) * 1.1f &&
                    t.Distance(Player.Instance) > Essentials.MinigunRange)
                             .OrderByDescending(t => t.Health);

                foreach (var m in from minionOutOfRange in minion
                         where minionOutOfRange != null
                         select EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                Player.Instance.ServerPosition,
                                                                                Essentials.FishBonesRange())
                         .Where(
                             t =>
                             t.Distance(minionOutOfRange
                                        ) <=
                             100 && t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 1.1f)).ToArray()
                         into minion2
                         where minion2.Count() >= qCountM
                         from m in minion2
                         select m)
                {
                    Program.Q.Cast();
                    Orbwalker.ForcedTarget = m;
                }
            }

            // In Range
            if (useQ && Player.Instance.ManaPercent >= manaQ && !Essentials.FishBones())
            {
                var minionInRange = Orbwalker.LastHitMinionsList.FirstOrDefault(
                    m => m.IsValidTarget() && m.Distance(Player.Instance) <= Essentials.MinigunRange);

                if (minionInRange != null)
                {
                    var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                 Player.Instance.ServerPosition,
                                                                                 Essentials.FishBonesRange())
                                 .Where(
                        t =>
                        t.Distance(minionInRange
                                   ) <=
                        100 && t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 1.1f)).ToArray();

                    if (minion.Count() >= qCountM)
                    {
                        foreach (var m in minion)
                        {
                            Program.Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                    }
                }
            }

            #endregion

            #region Harassing Section

            // If the player has a minigun
            if (useQ && Player.Instance.ManaPercent >= manaQ && Program.Q.IsReady() && !Essentials.FishBones())
            {
                var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);

                if (target != null && target.IsValidTarget())
                {
                    if (!Player.Instance.IsInAutoAttackRange(target) &&
                        Player.Instance.Distance(target) <= Essentials.FishBonesRange())
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = target;
                    }

                    if (Player.Instance.IsInAutoAttackRange(target) &&
                        target.CountEnemiesInRange(100) >= Config.HarassMenu["qCountC"].Cast <Slider>().CurrentValue)
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = target;
                    }
                }
            }

            // If the player has the rocket
            if (useQ && Program.Q.IsReady() && Essentials.FishBones())
            {
                var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);

                if (target != null && target.IsValidTarget())
                {
                    if (Player.Instance.Distance(target) <= Essentials.MinigunRange &&
                        target.CountEnemiesInRange(100) < Config.HarassMenu["qCountC"].Cast <Slider>().CurrentValue)
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = target;
                    }
                }
            }

            if (useW && Player.Instance.ManaPercent >= manaW && Program.W.IsReady())
            {
                var target = TargetSelector.GetTarget(Program.W.Range, DamageType.Physical);

                if (target != null && target.IsValidTarget())
                {
                    if (Player.Instance.Distance(target) >= wRange2)
                    {
                        var wPrediction = Program.W.GetPrediction(target);

                        if (wPrediction.HitChancePercent >= wSlider && !wPrediction.Collision)
                        {
                            if (wRange && Player.Instance.IsInAutoAttackRange(target))
                            {
                                Program.W.Cast(wPrediction.CastPosition);
                            }
                            else if (!wRange)
                            {
                                Program.W.Cast(wPrediction.CastPosition);
                            }
                        }
                    }
                }
            }

            #endregion
        }
Exemplo n.º 10
0
        /// <summary>
        /// Does Combo Method
        /// </summary>
        public static void Combo()
        {
            #region Q Logic

            var useQ  = Config.ComboMenu["useQ"].Cast <CheckBox>().CurrentValue;
            var manaQ = Config.ComboMenu["manaQ"].Cast <Slider>().CurrentValue;

            // If the player has a minigun
            if (useQ && Player.Instance.ManaPercent >= manaQ && Program.Q.IsReady() && !Essentials.FishBones())
            {
                var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);

                if (target != null && target.IsValidTarget())
                {
                    if (!Player.Instance.IsInAutoAttackRange(target) &&
                        Player.Instance.Distance(target) <= Essentials.FishBonesRange())
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = target;
                    }

                    if (Player.Instance.IsInAutoAttackRange(target) &&
                        target.CountEnemiesInRange(100) >= Config.ComboMenu["qCountC"].Cast <Slider>().CurrentValue)
                    {
                        Program.Q.Cast();
                        Orbwalker.ForcedTarget = target;
                    }
                }
            }

            #endregion

            #region Spell Logic

            var useW    = Config.ComboMenu["useW"].Cast <CheckBox>().CurrentValue;
            var useE    = Config.ComboMenu["useE"].Cast <CheckBox>().CurrentValue;
            var useR    = Config.ComboMenu["useR"].Cast <CheckBox>().CurrentValue;
            var wRange  = Config.MiscMenu["wRange"].Cast <CheckBox>().CurrentValue;
            var wRange2 = Config.ComboMenu["wRange2"].Cast <Slider>().CurrentValue;
            var eRange  = Config.ComboMenu["eRange"].Cast <Slider>().CurrentValue;
            var manaW   = Config.ComboMenu["manaW"].Cast <Slider>().CurrentValue;
            var manaE   = Config.ComboMenu["manaE"].Cast <Slider>().CurrentValue;
            var manaR   = Config.ComboMenu["manaR"].Cast <Slider>().CurrentValue;
            var wSlider = Config.ComboMenu["wSlider"].Cast <Slider>().CurrentValue;
            var eSlider = Config.ComboMenu["eSlider"].Cast <Slider>().CurrentValue;
            var rSlider = Config.ComboMenu["rSlider"].Cast <Slider>().CurrentValue;
            var rCountC = Config.ComboMenu["rCountC"].Cast <Slider>().CurrentValue;

            if (useW && Player.Instance.ManaPercent >= manaW && Program.W.IsReady())
            {
                var target = TargetSelector.GetTarget(Program.W.Range, DamageType.Physical);

                if (target != null && target.IsValidTarget())
                {
                    if (Player.Instance.Distance(target) >= wRange2)
                    {
                        var wPrediction = Program.W.GetPrediction(target);

                        if (wPrediction != null && !wPrediction.Collision && wPrediction.HitChancePercent >= wSlider)
                        {
                            if (wRange && Player.Instance.IsInAutoAttackRange(target))
                            {
                                Program.W.Cast(wPrediction.CastPosition);
                            }
                            else if (!wRange)
                            {
                                Program.W.Cast(wPrediction.CastPosition);
                            }
                        }
                    }
                }
            }

            if (useE && Player.Instance.ManaPercent >= manaE && Program.E.IsReady())
            {
                var target = TargetSelector.GetTarget(Config.ComboMenu["eRange2"].Cast <Slider>().CurrentValue,
                                                      DamageType.Physical);

                if (target != null)
                {
                    if (Player.Instance.Distance(target) >= eRange)
                    {
                        var ePrediction = Program.E.GetPrediction(target);

                        if (ePrediction != null && ePrediction.HitChancePercent >= eSlider)
                        {
                            Program.E.Cast(ePrediction.CastPosition);
                        }
                    }
                }
            }

            if (useR && Player.Instance.ManaPercent >= manaR && Program.R.IsReady())
            {
                var rRange  = Config.MiscMenu["rRange"].Cast <Slider>().CurrentValue;
                var rRange2 = Config.ComboMenu["rRange2"].Cast <Slider>().CurrentValue;
                var target  = TargetSelector.GetTarget(rRange2, DamageType.Physical);

                if (target != null)
                {
                    if (Player.Instance.Distance(target) >= rRange)
                    {
                        var rPrediction = Program.R.GetPrediction(target);

                        if (rPrediction != null && rPrediction.HitChancePercent >= rSlider &&
                            EntityManager.Heroes.Enemies.Count(
                                t => t.IsValidTarget() && t.Distance(rPrediction.CastPosition) <= 200) >= rCountC)
                        {
                            Program.R.Cast(rPrediction.CastPosition);
                        }
                    }
                }
            }

            #endregion
        }
Exemplo n.º 11
0
        /// <summary>
        /// Does LastHit Method
        /// </summary>
        public static void LastHit()
        {
            var useQ    = Config.LastHitMenu["useQ"].Cast <CheckBox>().CurrentValue;
            var manaQ   = Config.LastHitMenu["manaQ"].Cast <Slider>().CurrentValue;
            var qCountM = Config.LastHitMenu["qCountM"].Cast <Slider>().CurrentValue;

            // In Range
            if (useQ && Player.Instance.ManaPercent >= manaQ && !Essentials.FishBones())
            {
                var minionInRange =
                    EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                        m =>
                        m.Health <= (Player.Instance.GetAutoAttackDamage(m) * 1.1f) &&
                        m.Distance(Player.Instance) <= Essentials.MinigunRange);

                if (minionInRange != null)
                {
                    var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                 Player.Instance.ServerPosition,
                                                                                 Essentials.FishBonesRange())
                                 .Where(
                        t =>
                        t.Distance(minionInRange
                                   ) <=
                        100 && t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 1.1f)).ToArray();

                    if (minion.Count() >= qCountM)
                    {
                        foreach (var m in minion)
                        {
                            Program.Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                    }
                }
            }

            // Out of Range
            if (useQ && Player.Instance.ManaPercent >= manaQ && !Essentials.FishBones())
            {
                var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    Player.Instance.ServerPosition,
                    Essentials.FishBonesRange())
                             .Where(
                    t =>
                    t.Health <= Player.Instance.GetAutoAttackDamage(t) * 1.1f &&
                    t.Distance(Player.Instance) > Essentials.MinigunRange)
                             .OrderByDescending(t => t.Health);

                foreach (var m in from minionOutOfRange in minion where minionOutOfRange != null select EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                                                                                        Player.Instance.ServerPosition,
                                                                                                                                                        Essentials.FishBonesRange())
                         .Where(
                             t =>
                             t.Distance(minionOutOfRange
                                        ) <=
                             100 && t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 1.1f)).ToArray() into minion2 where minion2.Count() >= qCountM from m in minion2 select m)
                {
                    Program.Q.Cast();
                    Orbwalker.ForcedTarget = m;
                }
            }
        }