Example #1
0
        public static bool OkToQ(Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
                return false;
            var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
            var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
            var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();

            if (enemies == 1) //It's a 1v1, safe to assume I can E
            {
                return true;
            }

            //Adding 1 for the Player
            return (allies + 1 > enemies - lhEnemies);
        }
Example #2
0
 private bool IsDangerousPosition(Vector3 pos)
 {
     return ValidTargets.Any(e => e.IsMelee && e.Distance(pos) < 375) ||
            (pos.UnderTurret(true) && !EloBuddy.ObjectManager.Player.ServerPosition.UnderTurret(true));
 }
Example #3
0
        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (Config.Item("WallCheck", true).GetValue<bool>())
            {
                float segment = DashSpell.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            if (Config.Item("TurretCheck", true).GetValue<bool>())
            {
                if(dashPos.UnderTurret(true))
                    return false;
            }

            var enemyCheck = Config.Item("EnemyCheck", true).GetValue<Slider>().Value;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if(enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
Example #4
0
 bool isUnderEnemyTurret(Vector3 Position)
 {
     return Position.UnderTurret(true);
 }
Example #5
0
        /// <summary>
        ///     Checks the Condemn
        /// </summary>
        /// <param name="fromPosition">
        ///     From Position
        /// </param>
        /// <param name="target">
        ///     The target
        /// </param>
        /// <returns>
        ///     The <see cref="bool"/>.
        /// </returns>
        private bool CheckCondemn(Vector3 fromPosition, out Obj_AI_Hero target)
        {
            if (fromPosition.UnderTurret(true) || !this.spells[SpellSlot.E].IsReady())
            {
                target = null;
                return false;
            }

            if (
                !HeroManager.Enemies.Any(
                    h =>
                        h.IsValidTarget(this.spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) &&
                        !h.HasBuffOfType(BuffType.SpellImmunity)))
            {
                target = null;
                return false;
            }

            foreach (var unit in
                HeroManager.Enemies.Where(
                    h =>
                    h.IsValidTarget(this.spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield)
                    && !h.HasBuffOfType(BuffType.SpellImmunity)
                    && !this.GetItemValue<bool>("com.iseries.vayne.noe." + h.ChampionName.ToLowerInvariant())))
            {
                const int PushDistance = 400;
                var targetPosition = unit.ServerPosition;
                var endPosition = targetPosition.Extend(ObjectManager.Player.ServerPosition, -PushDistance);
                for (var i = 0; i < PushDistance; i += (int)unit.BoundingRadius)
                {
                    var extendedPosition = targetPosition.Extend(ObjectManager.Player.ServerPosition, -i);
                    if (extendedPosition.IsWall() || endPosition.IsWall())
                    {
                        target = unit;
                        return true;
                    }
                }
            }

            target = null;
            return false;
        }
Example #6
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec, bool checkTarget = true)
        {
            if (DontSafeCheck)
                return vec;

            if (checkTarget)
            {
                if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange)
                {
                    if (vec.CountEnemiesInRange(1000) > 1)
                        return Vector3.Zero;
                    else if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange / 2f)
                        return SCommon.Maths.Geometry.Deviation(ObjectManager.Player.ServerPosition.To2D(), target.ServerPosition.To2D(), 60).To3D();
                }

                if (((DontQIntoEnemies || target.IsMelee) && HeroManager.Enemies.Any(p => p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + ObjectManager.Player.BoundingRadius + (p.IsMelee ? 100 : 0))) || vec.UnderTurret(true))
                    return Vector3.Zero;
            }
            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + (p.IsMelee ? 50 : 0)) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Example #7
0
        /// <summary>
        /// Checks if a position is safe
        /// </summary>
        /// <param name="position">
        /// The Position
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        private bool IsSafe(Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
            {
                return false;
            }

            var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
            var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
            var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();

            if (enemies == 1)
            {
                // It's a 1v1, safe to assume I can E
                return true;
            }

            // Adding 1 for the Player
            return allies + 1 > enemies - lhEnemies;
        }
        /// <summary>
        /// The E logic checker method.
        /// </summary>
        /// <param name="fromPosition">The start position</param>
        /// <param name="tg">The target which can be condemned.</param>
        /// <returns>Whether the target is condemnable or not.</returns>
        private static bool CondemnCheck(Vector3 fromPosition, out Obj_AI_Hero tg)
        {
            if (Environment.TickCount - _lastCondemnCheck < 150)
            {
                tg = null;
                return false;
            }
            _lastCondemnCheck = Environment.TickCount;

            if ((fromPosition.UnderTurret(true) && MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.noeturret"))|| !_spells[SpellSlot.E].IsReady())
            {
                tg = null;
                return false;
            }
            if (
                !HeroManager.Enemies.Any(
                    h =>
                        h.IsValidTarget(_spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) &&
                        !h.HasBuffOfType(BuffType.SpellImmunity)))
            {
                tg = null;
                return false;
            }
            switch (Menu.Item("dz191.vhr.misc.condemn.condemnmethod").GetValue<StringList>().SelectedIndex)
            {
                case 0:
                    //VHReborn Condemn Code
                    foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) && !h.HasBuffOfType(BuffType.SpellImmunity)))
                    {
                        var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                        var targetPosition = target.ServerPosition;
                        var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                        var numberOfChecks = (float)Math.Ceiling(pushDistance / 30f);

                        if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !target.Equals(Orbwalker.GetTarget()))
                        {
                            continue;
                        }

                        for (var i = 1; i <= 30; i++)
                        {
                            var v3 = (targetPosition - fromPosition).Normalized();
                            var extendedPosition = targetPosition + v3 * (numberOfChecks * i);
                            //var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (Helpers.UnderAllyTurret(finalPosition) || Helpers.IsFountain(finalPosition));
                            var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(extendedPosition, target));
                            if ((extendedPosition.IsWall() || j4Flag) && (target.Path.Count() < 2) && !target.IsDashing())
                            {

                                if (target.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(target) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (extendedPosition.UnderTurret(true))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.trinketbush") &&
                                    NavMesh.IsWallOfGrass(extendedPosition,25) && trinketSpell != null)
                                {
                                    var wardPosition = ObjectManager.Player.ServerPosition.Extend(
                                        extendedPosition,
                                        ObjectManager.Player.ServerPosition.Distance(extendedPosition) - 25f);
                                    LeagueSharp.Common.Utility.DelayAction.Add(250,() => trinketSpell.Cast(wardPosition));
                                }

                                CondemnNotification.Text = "Condemned " + target.ChampionName;
                                _predictedEndPosition = extendedPosition;
                                _predictedPosition = targetPosition;

                                tg = target;
                                return true;
                            }
                        }
                    }
                    break;
                case 1:
                    //Marksman/Gosu Condemn Code
                    foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range)))
                    {
                        var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                        var targetPosition = _spells[SpellSlot.E].GetPrediction(target).UnitPosition;
                        var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                        var finalPosition2 = targetPosition.Extend(fromPosition, -(pushDistance/2f));
                        var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (finalPosition.UnderTurret(false) || Helpers.IsFountain(finalPosition));
                        var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(finalPosition, target) || Helpers.IsJ4FlagThere(finalPosition2, target));
                        if (finalPosition.IsWall() || finalPosition2.IsWall() || underTurret || j4Flag)
                        {
                            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !target.Equals(Orbwalker.GetTarget()))
                            {
                                tg = null;
                                return false;
                            }

                            if (target.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(target) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                            {
                                tg = null;
                                return false;
                            }

                            tg = target;
                            return true;
                        }
                    }
                    break;
                case 2:
                    //Vayne Hunter Rework
                    foreach (var en in ObjectManager.Get<Obj_AI_Hero>().Where(hero => hero.IsEnemy && hero.IsValidTarget() && hero.Distance(Player.Position)<= _spells[SpellSlot.E].Range))
                    {
                        var ePred = _spells[SpellSlot.E].GetPrediction(en);
                        int pushDist = Menu.Item("dz191.vhr.misc.condemn.pushdistance").GetValue<Slider>().Value;
                        for (int i = 0; i < pushDist; i += (int)en.BoundingRadius)
                        {
                            Vector3 loc3 = ePred.UnitPosition.To2D().Extend(fromPosition.To2D(), -i).To3D();
                            var orTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && Helpers.UnderAllyTurret(loc3);
                            if (loc3.IsWall() || orTurret)
                            {
                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !en.Equals(Orbwalker.GetTarget()))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (en.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(en) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.trinketbush") &&
                                    NavMesh.IsWallOfGrass(loc3, 25) && trinketSpell != null)
                                {
                                    var wardPosition = ObjectManager.Player.ServerPosition.Extend(
                                        loc3,
                                        ObjectManager.Player.ServerPosition.Distance(loc3) - 25f);
                                    LeagueSharp.Common.Utility.DelayAction.Add(250, () => trinketSpell.Cast(wardPosition));
                                }

                                tg = en;
                                return true;
                            }
                        }
                    }
                    break;
            }
            tg = null;
            return false;
        }
Example #9
0
File: Ekko.cs Project: myo/LSharp
        private bool ShouldE(Vector3 vec)
        {
            var maxEnemies = menu.Item("Do_Not_E", true).GetValue<Slider>().Value;

            if (!menu.Item("E_If_UnderTurret", true).GetValue<KeyBind>().Active && vec.UnderTurret(true))
                return false;

            if (Player.HealthPercent <= menu.Item("Do_Not_E_HP", true).GetValue<Slider>().Value)
                return false;

            if (vec.CountEnemiesInRange(600) >= maxEnemies)
                return false;

            return true;
        }
Example #10
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec)
        {
            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.BasicAttack.CastRange) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Example #11
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec)
        {
            if (DontSafeCheck)
                return vec;

            if (DontQIntoEnemies && HeroManager.Enemies.Any(p => p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + ObjectManager.Player.BoundingRadius + (p.IsMelee ? 100 : 0)) || vec.UnderTurret(true))
                return Vector3.Zero;

            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.AttackRange + (p.IsMelee ? 50 : 0)) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Example #12
0
 bool CaitlynIsSafePosition(Vector3 position)
 {
     //If the enemies in range - the low health enemies in range are equal to zero and our Health % is >= 40% then we can go in
     return (position.CountEnemiesInRange(450f) - HeroHelper.GetLhEnemiesNearPosition(position,450f).Count == 0) && (ObjectManager.Player.HealthPercentage() >= 40) && (!position.UnderTurret(true));
 }
Example #13
0
        public static bool IsSafePosition(Vector3 position) // cradits to Asuna & ijabba
        {
            if (position.UnderTurret(true) && !Player.UnderTurret(true))
            {
                return false;
            }
            var allies = position.CountAlliesInRange(Orbwalking.GetRealAutoAttackRange(Player));
            var enemies = position.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(Player));
            var lhEnemies = GetLhEnemiesNearPosition(position, Orbwalking.GetRealAutoAttackRange(Player)).Count();

            if (enemies == 1) 
            {
                return true;
            }

           
            return (allies + 1 > enemies - lhEnemies);
        }
Example #14
0
        public static Vector3 IsSafe(Obj_AI_Hero target, Vector3 vec)
        {
            if (target.ServerPosition.To2D().Distance(vec) <= target.AttackRange && vec.CountEnemiesInRange(1000) > 1)
                return Vector3.Zero;

            if (HeroManager.Enemies.Any(p => p.NetworkId != target.NetworkId && p.ServerPosition.To2D().Distance(vec) <= p.AttackRange) || vec.UnderTurret(true))
                return Vector3.Zero;

            return vec;
        }
Example #15
0
 private bool DashCheck(Vector3 dash)
 {
     if (
         !Player.Position.Extend(dash, Q.Range).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 100).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 200).IsWall()
         && !Player.Position.Extend(dash, Q.Range - 300).IsWall()
         && (!dash.UnderTurret(true) || Program.Combo))
         return true;
     else
         return false;
 }
Example #16
0
 private bool DashCheck(Vector3 dash)
 {
     if ((!dash.UnderTurret(true) || Program.Combo))
         return true;
     else
         return false;
 }
        /// <summary>
        /// The E logic checker method.
        /// </summary>
        /// <param name="fromPosition">The start position</param>
        /// <param name="tg">The target which can be condemned.</param>
        /// <returns>Whether the target is condemnable or not.</returns>
        private static bool CondemnCheck(Vector3 fromPosition, out Obj_AI_Hero tg)
        {
            if (Environment.TickCount - _lastCondemnCheck < 150)
            {
                tg = null;
                return false;
            }
            _lastCondemnCheck = Environment.TickCount;

            if ((fromPosition.UnderTurret(true) && MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.noeturret"))|| !_spells[SpellSlot.E].IsReady())
            {
                tg = null;
                return false;
            }
            if (
                !HeroManager.Enemies.Any(
                    h =>
                        h.IsValidTarget(_spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) &&
                        !h.HasBuffOfType(BuffType.SpellImmunity)))
            {
                tg = null;
                return false;
            }
            switch (Menu.Item("dz191.vhr.misc.condemn.condemnmethod").GetValue<StringList>().SelectedIndex)
            {
                case 0:
                    //VH revolution
                    var HeroList =
                                HeroManager.Enemies.Where(
                                    h =>
                                        h.IsValidTarget(_spells[SpellSlot.E].Range) &&
                                        !h.HasBuffOfType(BuffType.SpellShield) &&
                                        !h.HasBuffOfType(BuffType.SpellImmunity));
                    var NumberOfChecks = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.rev.predictionNumber");
                    //dz191.vhr.misc.condemn.rev.accuracy
                    //dz191.vhr.misc.condemn.rev.nextprediction
                    var MinChecksPercent = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.rev.accuracy");
                    var PushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                    var NextPrediction = (MenuHelper.getSliderValue("dz191.vhr.misc.condemn.rev.nextprediction"));
                    var interval = NextPrediction / NumberOfChecks;
                    var currentInterval = interval;
                    var LastUnitPosition = Vector3.Zero;

                    if (ObjectManager.Player.ServerPosition.UnderTurret(true))
                    {
                        tg = null;
                        return false;
                    }

                    foreach (var Hero in HeroList)
                    {
                        var finalPosition = Hero.ServerPosition.Extend(fromPosition, -PushDistance);

                        if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                   Hero.NetworkId != Orbwalker.GetTarget().NetworkId)
                        {
                            continue;
                        }

                        if (Hero.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(Hero) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                        {
                            continue;
                        }

                        var PredictionsList = new List<Vector3>();

                        PredictionsList.Add(Hero.ServerPosition);

                        for (var i = 0; i < NumberOfChecks; i++)
                        {
                            var Prediction = LeagueSharp.Common.Prediction.GetPrediction(Hero, currentInterval);
                            var UnitPosition = Prediction.UnitPosition;
                            if (UnitPosition.Distance(LastUnitPosition, true) >=
                                (Hero.BoundingRadius / 2f) * (Hero.BoundingRadius / 2f))
                            {
                                PredictionsList.Add(UnitPosition);
                                LastUnitPosition = UnitPosition;
                                currentInterval += interval;
                            }
                        }

                        var ExtendedList = new List<Vector3>();

                        foreach (var position in PredictionsList)
                        {
                            ExtendedList.Add(position.Extend(fromPosition, -PushDistance / 4f));
                            ExtendedList.Add(position.Extend(fromPosition, -PushDistance / 2f));
                            ExtendedList.Add(position.Extend(fromPosition, -(PushDistance * 0.75f)));
                            ExtendedList.Add(position.Extend(fromPosition, -PushDistance));
                        }

                        var WallListCount = ExtendedList.Count(h => h.IsWall() || IsJ4Flag(h, Hero));
                        //Console.WriteLine("Actual Preds: {0} Walllist count: {1} TotalList: {2} Percent: {3}", PredictionsList.Count, WallListCount, ExtendedList.Count, ((float)WallListCount / (float)ExtendedList.Count));

                        if (((float)WallListCount / (float)ExtendedList.Count) >= MinChecksPercent / 100f)
                        {
                            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.trinketbush") &&
                                    NavMesh.IsWallOfGrass(finalPosition, 25) && trinketSpell != null)
                            {
                                var wardPosition = ObjectManager.Player.ServerPosition.Extend(
                                    finalPosition,
                                    ObjectManager.Player.ServerPosition.Distance(finalPosition) - 25f);
                                LeagueSharp.Common.Utility.DelayAction.Add(250, () => trinketSpell.Cast(wardPosition));
                            }

                            tg = Hero;
                            return true;
                        }
                    }
                    break;
                case 1:
                    //VHReborn Condemn Code
                    foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range) && !h.HasBuffOfType(BuffType.SpellShield) && !h.HasBuffOfType(BuffType.SpellImmunity)))
                    {
                        var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                        var targetPosition = target.ServerPosition;
                        var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                        var numberOfChecks = (float)Math.Ceiling(pushDistance / 30f);

                        if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !target.Equals(Orbwalker.GetTarget()))
                        {
                            continue;
                        }

                        for (var i = 1; i <= 30; i++)
                        {
                            var v3 = (targetPosition - fromPosition).Normalized();
                            var extendedPosition = targetPosition + v3 * (numberOfChecks * i);
                            //var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (Helpers.UnderAllyTurret(finalPosition) || Helpers.IsFountain(finalPosition));
                            var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(extendedPosition, target));
                            if ((extendedPosition.IsWall() || j4Flag) && (target.Path.Count() < 2) && !target.IsDashing())
                            {

                                if (target.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(target) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (extendedPosition.UnderTurret(true))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.trinketbush") &&
                                    NavMesh.IsWallOfGrass(extendedPosition,25) && trinketSpell != null)
                                {
                                    var wardPosition = ObjectManager.Player.ServerPosition.Extend(
                                        extendedPosition,
                                        ObjectManager.Player.ServerPosition.Distance(extendedPosition) - 25f);
                                    LeagueSharp.Common.Utility.DelayAction.Add(250,() => trinketSpell.Cast(wardPosition));
                                }

                                CondemnNotification.Text = "Condemned " + target.ChampionName;
                                _predictedEndPosition = extendedPosition;
                                _predictedPosition = targetPosition;

                                tg = target;
                                return true;
                            }
                        }
                    }
                    break;
                case 2:
                    //Marksman/Gosu Condemn Code
                    foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range)))
                    {
                        var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                        var targetPosition = _spells[SpellSlot.E].GetPrediction(target).UnitPosition;
                        var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                        var finalPosition2 = targetPosition.Extend(fromPosition, -(pushDistance/2f));
                        var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (finalPosition.UnderTurret(false) || Helpers.IsFountain(finalPosition));
                        var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(finalPosition, target) || Helpers.IsJ4FlagThere(finalPosition2, target));
                        if (finalPosition.IsWall() || finalPosition2.IsWall() || underTurret || j4Flag)
                        {
                            if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !target.Equals(Orbwalker.GetTarget()))
                            {
                                tg = null;
                                return false;
                            }

                            if (target.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(target) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                            {
                                tg = null;
                                return false;
                            }

                            tg = target;
                            return true;
                        }
                    }
                    break;
                case 3:
                    //Vayne Hunter Rework
                    foreach (var en in ObjectManager.Get<Obj_AI_Hero>().Where(hero => hero.IsEnemy && hero.IsValidTarget() && hero.Distance(Player.Position)<= _spells[SpellSlot.E].Range))
                    {
                        var ePred = _spells[SpellSlot.E].GetPrediction(en);
                        int pushDist = Menu.Item("dz191.vhr.misc.condemn.pushdistance").GetValue<Slider>().Value;
                        for (int i = 0; i < pushDist; i += (int)en.BoundingRadius)
                        {
                            Vector3 loc3 = ePred.UnitPosition.To2D().Extend(fromPosition.To2D(), -i).To3D();
                            var orTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && Helpers.UnderAllyTurret(loc3);
                            if (loc3.IsWall() || orTurret)
                            {
                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.onlystuncurrent") &&
                                    !en.Equals(Orbwalker.GetTarget()))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (en.Health + 10 <=
                                    ObjectManager.Player.GetAutoAttackDamage(en) *
                                    MenuHelper.getSliderValue("dz191.vhr.misc.condemn.noeaa"))
                                {
                                    tg = null;
                                    return false;
                                }

                                if (MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.trinketbush") &&
                                    NavMesh.IsWallOfGrass(loc3, 25) && trinketSpell != null)
                                {
                                    var wardPosition = ObjectManager.Player.ServerPosition.Extend(
                                        loc3,
                                        ObjectManager.Player.ServerPosition.Distance(loc3) - 25f);
                                    LeagueSharp.Common.Utility.DelayAction.Add(250, () => trinketSpell.Cast(wardPosition));
                                }

                                tg = en;
                                return true;
                            }
                        }
                    }
                    break;
            }
            tg = null;
            return false;
        }
Example #18
0
 private bool IsDangerousPosition(Vector3 pos)
 {
     return GameObjects.EnemyHeroes.Any(
         e => e.IsHPBarRendered && e.IsMelee &&
              (e.Distance(pos) < 375)) ||
            (pos.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true));
 }
Example #19
0
 bool CondemnCheck(Vector3 fromPosition, out Obj_AI_Hero tg)
 {
     if (fromPosition.UnderTurret(true) && MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.noeturret"))
     {
         tg = null;
         return false;
     }
     switch (Menu.Item("dz191.vhr.misc.condemn.condemnmethod").GetValue<StringList>().SelectedIndex)
     {
         case 0:
             //VHReborn Condemn Code
             foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range)))
             {
                 var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                 var targetPosition = _spells[SpellSlot.E].GetPrediction(target).UnitPosition;
                 var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                 var numberOfChecks = Math.Ceiling(pushDistance / target.BoundingRadius);
                 for (var i = 0; i < numberOfChecks; i++)
                 {
                     var extendedPosition = targetPosition.Extend(fromPosition, -(float)(numberOfChecks * target.BoundingRadius));
                     var extendedPosition2 = targetPosition.Extend(fromPosition, -(float)(numberOfChecks * target.BoundingRadius + target.BoundingRadius/4));
                     var extendedPosition3 = targetPosition.Extend(fromPosition, -(float)(numberOfChecks * target.BoundingRadius - target.BoundingRadius/4));
                     var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (finalPosition.UnderTurret(false) || Helpers.IsFountain(finalPosition));
                     var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(extendedPosition, target) || Helpers.IsJ4FlagThere(extendedPosition2, target) || Helpers.IsJ4FlagThere(extendedPosition3, target));
                     if (extendedPosition.IsWall() || extendedPosition2.IsWall() || extendedPosition3.IsWall() || underTurret || j4Flag || finalPosition.IsWall())
                     {
                         tg = target;
                         return true;
                     }
                 }
             }
             break;
         case 1:
             //Marksman/Gosu Condemn Code
             foreach (var target in HeroManager.Enemies.Where(h => h.IsValidTarget(_spells[SpellSlot.E].Range)))
             {
                 var pushDistance = MenuHelper.getSliderValue("dz191.vhr.misc.condemn.pushdistance");
                 var targetPosition = _spells[SpellSlot.E].GetPrediction(target).UnitPosition;
                 var finalPosition = targetPosition.Extend(fromPosition, -pushDistance);
                 var finalPosition2 = targetPosition.Extend(fromPosition, -(pushDistance/2));
                 var underTurret = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnturret") && (finalPosition.UnderTurret(false) || Helpers.IsFountain(finalPosition));
                 var j4Flag = MenuHelper.isMenuEnabled("dz191.vhr.misc.condemn.condemnflag") && (Helpers.IsJ4FlagThere(finalPosition, target) || Helpers.IsJ4FlagThere(finalPosition2, target));
                 if (finalPosition.IsWall() || finalPosition2.IsWall() || underTurret || j4Flag)
                 {
                     tg = target;
                     return true;
                 }
             }
             break;
     }
     tg = null;
     return false;
 }