/// <summary> /// Determines whether the position is not into enemies. /// </summary> /// <param name="position">The position.</param> /// <returns></returns> public static bool IsNotIntoEnemies(this Vector3 position) { if (!Program.smartq && !Program.noqenemies) { return(true); } var enemyPoints = TumbleHelper.GetEnemyPoints(); if (enemyPoints.ToList().Contains(position.LSTo2D()) && !enemyPoints.Contains(ObjectManager.Player.ServerPosition.LSTo2D())) { return(false); } var closeEnemies = HeroManager.Enemies.FindAll( en => en.IsValidTarget(1500f) && !(en.LSDistance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f)); if ( closeEnemies.All( enemy => position.LSCountEnemiesInRange(enemy.AttackRange > 350 ? enemy.AttackRange : 400) == 0)) { return(true); } return(false); }
/// <summary> /// Casts Q (Tumble). /// </summary> /// <param name="Position">The position.</param> /// <param name="target">The target.</param> private void CastTumble(Vector3 Position, Obj_AI_Base target) { var WallQPosition = TumbleHelper.GetQBurstModePosition(); if (WallQPosition != null && ObjectManager.Player.ServerPosition.IsSafeEx() && !(ObjectManager.Player.ServerPosition.UnderTurret(true))) { var V3WallQ = (Vector3)WallQPosition; CastQ(V3WallQ); return; } var TumbleQEPosition = Provider.GetQEPosition(); if (TumbleQEPosition != Vector3.Zero) { CastQ(TumbleQEPosition); return; } Variables.Orbwalker.ForceTarget(target); if (ObjectManager.Player.CountEnemiesInRange(1500f) >= 3) { } CastQ(Position); }
/// <summary> /// Determines whether the position is not into enemies. /// </summary> /// <param name="position">The position.</param> /// <returns></returns> public static bool IsNotIntoEnemies(this Vector3 position) { if (!MenuExtensions.GetItemValue <bool>("solo.vayne.misc.tumble.smartQ") && !MenuExtensions.GetItemValue <bool>("solo.vayne.misc.tumble.noqintoenemies")) { return(true); } var enemyPoints = TumbleHelper.GetEnemyPoints(); if (enemyPoints.ToList().Contains(position.To2D()) && !enemyPoints.Contains(ObjectManager.Player.ServerPosition.To2D())) { return(false); } var closeEnemies = HeroManager.Enemies.FindAll( en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f)); if (closeEnemies.All(enemy => position.CountEnemiesInRange(enemy.AttackRange > 350 ? enemy.AttackRange : 400) == 0)) { return(true); } return(false); }
/// <summary> /// Gets the SOLO Vayne Q position using a patented logic! /// </summary> /// <returns></returns> public static Vector3 GetSOLOVayneQPosition() { #region The Required Variables var positions = TumbleHelper.GetRotatedQPositions(); var enemyPositions = TumbleHelper.GetEnemyPoints(); var safePositions = positions.Where(pos => !enemyPositions.Contains(pos.To2D())).ToList(); var BestPosition = ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f); var AverageDistanceWeight = .60f; var ClosestDistanceWeight = .40f; var bestWeightedAvg = 0f; var highHealthEnemiesNear = HeroManager.Enemies.Where(m => !m.IsMelee && m.IsValidTarget(1300f) && m.HealthPercent > 7).ToList(); var alliesNear = HeroManager.Allies.Count(ally => !ally.IsMe && ally.IsValidTarget(1500f)); var enemiesNear = HeroManager.Enemies.Where(m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m) + 300f + 65f)) .ToList(); #endregion #region 1 Enemy around only if (ObjectManager.Player.CountEnemiesInRange(1500f) <= 1) { //Logic for 1 enemy near var position = ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f); return(position); } #endregion if ( enemiesNear.Any( t => t.Health + 15 < ObjectManager.Player.LSGetAutoAttackDamage(t) * 2 + ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.Q) && t.LSDistance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(t) + 80f)) { var QPosition = ObjectManager.Player.ServerPosition.LSExtend( enemiesNear.OrderBy(t => t.Health).First().ServerPosition, 300f); if (!LeagueSharp.Common.Utility.UnderTurret(QPosition, true)) { return(QPosition); } } #region Alone, 2 Enemies, 1 Killable if (enemiesNear.Count() <= 2) { if ( enemiesNear.Any( t => t.Health + 15 < ObjectManager.Player.LSGetAutoAttackDamage(t) * 2 + ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.Q) && t.LSDistance(ObjectManager.Player) < Orbwalking.GetRealAutoAttackRange(t) + 80f)) { var QPosition = ObjectManager.Player.ServerPosition.LSExtend( highHealthEnemiesNear.OrderBy(t => t.Health).First().ServerPosition, 300f); if (!LeagueSharp.Common.Utility.UnderTurret(QPosition, true)) { return(QPosition); } } } #endregion #region Alone, 2 Enemies, None Killable if (alliesNear == 0 && highHealthEnemiesNear.Count() <= 2) { //Logic for 2 enemies Near and alone //If there is a killable enemy among those. var backwardsPosition = (ObjectManager.Player.ServerPosition.To2D() + 300f * ObjectManager.Player.Direction.To2D()).To3D(); if (!LeagueSharp.Common.Utility.UnderTurret(backwardsPosition, true)) { return(backwardsPosition); } } #endregion #region Already in an enemy's attack range. var closeNonMeleeEnemy = TumbleHelper.GetClosestEnemy(ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f)); if (closeNonMeleeEnemy != null && ObjectManager.Player.LSDistance(closeNonMeleeEnemy) <= closeNonMeleeEnemy.AttackRange - 85 && !closeNonMeleeEnemy.IsMelee) { return(ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f).IsSafeEx() ? ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f) : Vector3.Zero); } #endregion #region Logic for multiple enemies / allies around. foreach (var position in safePositions) { var enemy = TumbleHelper.GetClosestEnemy(position); if (!enemy.LSIsValidTarget()) { continue; } var avgDist = TumbleHelper.GetAvgDistance(position); if (avgDist > -1) { var closestDist = ObjectManager.Player.ServerPosition.LSDistance(enemy.ServerPosition); var weightedAvg = closestDist * ClosestDistanceWeight + avgDist * AverageDistanceWeight; if (weightedAvg > bestWeightedAvg && position.IsSafeEx()) { bestWeightedAvg = weightedAvg; BestPosition = position; } } } #endregion var endPosition = BestPosition.IsSafe() ? BestPosition : Game.CursorPos; #region Couldn't find a suitable position, tumble to nearest ally logic if (endPosition == Vector3.Zero) { //Try to find another suitable position. This usually means we are already near too much enemies turrets so just gtfo and tumble //to the closest ally ordered by most health. var alliesClose = HeroManager.Allies.Where(ally => !ally.IsMe && ally.IsValidTarget(1500f)).ToList(); if (alliesClose.Any() && enemiesNear.Any()) { var closestMostHealth = alliesClose.OrderBy(m => m.LSDistance(ObjectManager.Player)) .ThenByDescending(m => m.Health) .FirstOrDefault(); if (closestMostHealth != null && closestMostHealth.LSDistance( enemiesNear.OrderBy(m => m.LSDistance(ObjectManager.Player)).FirstOrDefault()) > ObjectManager.Player.LSDistance( enemiesNear.OrderBy(m => m.LSDistance(ObjectManager.Player)).FirstOrDefault())) { var tempPosition = ObjectManager.Player.ServerPosition.LSExtend(closestMostHealth.ServerPosition, 300f); if (tempPosition.IsSafeEx()) { endPosition = tempPosition; } } } } #endregion #region Couldn't find an ally, tumble inside bush var AmInBush = NavMesh.IsWallOfGrass(ObjectManager.Player.ServerPosition, 33); var closeEnemies = TumbleVariables.EnemiesClose.ToList(); if (!AmInBush && endPosition == Vector3.Zero) { var PositionsComplete = TumbleHelper.GetCompleteRotatedQPositions(); foreach (var position in PositionsComplete) { if (NavMesh.IsWallOfGrass(position, 33) && closeEnemies.All( m => m.LSDistance(position) > 340f && !NavMesh.IsWallOfGrass(m.ServerPosition, 40)) && !WardTrackerVariables.detectedWards.Any( m => NavMesh.IsWallOfGrass(m.Position, 33) && m.Position.LSDistance(position) < m.WardTypeW.WardVisionRange && !(m.WardTypeW.WardType == WardType.ShacoBox || m.WardTypeW.WardType == WardType.TeemoShroom))) { if (position.IsSafe()) { endPosition = position; break; } } } } #endregion #region Couldn't even tumble to ally, just go to mouse if (endPosition == Vector3.Zero) { var mousePosition = ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f); if (mousePosition.IsSafe()) { endPosition = mousePosition; } } #endregion if (ObjectManager.Player.HealthPercent < 10 && ObjectManager.Player.CountEnemiesInRange(1500) > 1) { var position = ObjectManager.Player.ServerPosition.LSExtend(Game.CursorPos, 300f); return(position.IsSafeEx() ? position : endPosition); } return(endPosition); }