internal static void Combo2() { var target = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.Distance(Player.ServerPosition) <= 600 && x.IsEnemy && x.IsHPBarRendered && !MinionManager.IsWard(x)).OrderByDescending(x => x.MaxHealth).FirstOrDefault(); Orb(target); if (target == null) { return; } if (Utils.GameTimeTickCount - KL.LastR >= 500 - Game.Ping) { if (!KL.CanUse(KL.Spells["Javelin"], true, "jg") && KL.CanUse(KL.Spells["Swipe"], false, "jg")) { if (KL.CatForm() && target.IsValidTargetLS(KL.Spells["Swipe"].Range)) { KL.Spells["Swipe"].Cast(target.ServerPosition); } } if (!KL.CanUse(KL.Spells["Javelin"], true, "jg") && KL.CanUse(KL.Spells["Bushwhack"], false, "jg")) { if (!KL.CatForm() && target.IsValidTargetLS(KL.Spells["Bushwhack"].Range) && KL.Player.ManaPercent > 40) { KL.Spells["Bushwhack"].Cast(target.ServerPosition); } } if (!KL.CanUse(KL.Spells["Javelin"], true, "jg") && KL.CanUse(KL.Spells["Pounce"], false, "jg")) { var r = target.IsHunted() ? KL.Spells["ExPounce"].Range : KL.Spells["Pounce"].Range; if (KL.CatForm() && target.IsValidTargetLS(r)) { KL.Spells["Pounce"].Cast(target.ServerPosition); } } } if (KL.Spells["Takedown"].Level > 0 && KL.SpellTimer["Takedown"].IsReady() && !KL.CatForm()) { if (KL.Spells["Aspect"].IsReady()) { KL.Spells["Aspect"].Cast(); } } if (KL.Spells["Javelin"].Level > 0 && !KL.SpellTimer["Javelin"].IsReady() && !KL.CatForm()) { if (KL.Spells["Aspect"].IsReady()) { KL.Spells["Aspect"].Cast(); } } }
private bool ShouldAttackMinion(Obj_AI_Minion minion) { if (minion.Name == "WardCorpse" || minion.CharData.BaseSkinName == "jarvanivstandard") { return(false); } if (MinionManager.IsWard(minion)) { return(Menu.Item("AttackWards").IsActive()); } return((Menu.Item("AttackPetsnTraps").GetValue <bool>() || MinionManager.IsMinion(minion)) && minion.CharData.BaseSkinName != "gangplankbarrel"); }
/// <summary> /// Returns if a minion should be attacked /// </summary> /// <param name="minion">The <see cref="Obj_AI_Minion" /></param> /// <param name="includeBarrel">Include Gangplank Barrel</param> /// <returns><c>true</c> if the minion should be attacked; otherwise, <c>false</c>.</returns> private static bool ShouldAttackMinion(Obj_AI_Minion minion) { if (minion.Name == "WardCorpse" || minion.CharData.BaseSkinName == "jarvanivstandard") { return(false); } if (MinionManager.IsWard(minion)) { return(true); } return((true || MinionManager.IsMinion(minion)) && minion.CharData.BaseSkinName != "gangplankbarrel"); }
private bool ShouldAttackMinion(Obj_AI_Base minion, bool includeBarrel = false) { if (minion.Name == "WardCorpse" || minion.CharData.BaseSkinName == "jarvanivstandard") { return(false); } if (minion.Team == GameObjectTeam.Neutral && includeBarrel) { return(true && minion.CharData.BaseSkinName == "gangplankbarrel" && minion.IsHPBarRendered); } var minion2 = minion as Obj_AI_Minion; if (MinionManager.IsWard(minion2)) { return(false); } return((true || MinionManager.IsMinion(minion2)) && minion.CharData.BaseSkinName != "gangplankbarrel"); }
public bool CanCast(Obj_AI_Base unit) { if (CurrentSmiteType == SmiteType.NotChosen || !Smite.IsReady() || !unit.IsInRange(Smite.Range)) { return(false); } if (unit is AIHeroClient) { return(CurrentSmiteType == SmiteType.ChallengingSmite || CurrentSmiteType == SmiteType.ChillingSmite); } var asMinion = unit as Obj_AI_Minion; if (asMinion != null && !MinionManager.IsWard(asMinion)) { return(true); } return(false); }
/// <summary> /// Gets the target. /// </summary> /// <returns>AttackableUnit.</returns> public virtual AttackableUnit GetTarget() { AttackableUnit result = null; if ((ActiveMode == OrbwalkingMode.Mixed || ActiveMode == OrbwalkingMode.LaneClear) && !_config.Item("PriorizeFarm").GetValue <bool>()) { var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical); if (target != null && InAutoAttackRange(target)) { return(target); } } /*Killable Minion*/ if (ActiveMode == OrbwalkingMode.LaneClear || (ActiveMode == OrbwalkingMode.Mixed && _config.Item("LWH").GetValue <bool>()) || ActiveMode == OrbwalkingMode.LastHit) { var minionList = ObjectManager.Get <Obj_AI_Minion>() .Where( minion => minion.IsValidTarget() && InAutoAttackRange(minion)) .OrderByDescending(minion => minion.CharData.BaseSkinName.Contains("Siege")) .ThenBy(minion => minion.CharData.BaseSkinName.Contains("Super")) .ThenBy(minion => minion.Health) .ThenByDescending(minion => minion.MaxHealth); foreach (var minion in minionList) { var t = (int)(_player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)Math.Max(0, _player.Distance(minion) - _player.BoundingRadius) / int.MaxValue; var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay); if (minion.Team != GameObjectTeam.Neutral && (_config.Item("AttackPetsnTraps").GetValue <bool>() && minion.CharData.BaseSkinName != "jarvanivstandard" || MinionManager.IsMinion(minion, _config.Item("AttackWards").GetValue <bool>()))) { if (predHealth <= 0) { FireOnNonKillableMinion(minion); } if (predHealth > 0 && predHealth <= _player.GetAutoAttackDamage(minion, true)) { return(minion); } } if (minion.Team == GameObjectTeam.Neutral && (_config.Item("AttackBarrel").GetValue <bool>() && minion.CharData.BaseSkinName == "gangplankbarrel" && minion.IsHPBarRendered)) { if (minion.Health < 2) { return(minion); } } } } //Forced target if (_forcedTarget.IsValidTarget() && InAutoAttackRange(_forcedTarget)) { return(_forcedTarget); } /* turrets / inhibitors / nexus */ if (ActiveMode == OrbwalkingMode.LaneClear && (!_config.Item("FocusMinionsOverTurrets").GetValue <KeyBind>().Active || !MinionManager.GetMinions(ObjectManager.Player.Position, GetRealAutoAttackRange(ObjectManager.Player)).Any())) { /* turrets */ foreach (var turret in ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsValidTarget() && InAutoAttackRange(t))) { return(turret); } /* inhibitor */ foreach (var turret in ObjectManager.Get <Obj_BarracksDampener>().Where(t => t.IsValidTarget() && InAutoAttackRange(t))) { return(turret); } /* nexus */ foreach (var nexus in ObjectManager.Get <Obj_HQ>().Where(t => t.IsValidTarget() && InAutoAttackRange(t))) { return(nexus); } } /*Champions*/ if (ActiveMode != OrbwalkingMode.LastHit) { var target = TargetSelector.GetTarget(-1, TargetSelector.DamageType.Physical); if (target.IsValidTarget() && InAutoAttackRange(target)) { return(target); } } /*Jungle minions*/ if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed) { var jminions = ObjectManager.Get <Obj_AI_Minion>() .Where( mob => mob.IsValidTarget() && mob.Team == GameObjectTeam.Neutral && this.InAutoAttackRange(mob) && mob.CharData.BaseSkinName != "gangplankbarrel"); result = _config.Item("Smallminionsprio").GetValue <bool>() ? jminions.MinOrDefault(mob => mob.MaxHealth) : jminions.MaxOrDefault(mob => mob.MaxHealth); if (result != null) { return(result); } } /*Lane Clear minions*/ if (ActiveMode == OrbwalkingMode.LaneClear) { if (!ShouldWait()) { if (_prevMinion.IsValidTarget() && InAutoAttackRange(_prevMinion)) { var predHealth = HealthPrediction.LaneClearHealthPrediction( _prevMinion, (int)((_player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay); if (predHealth >= 2 * _player.GetAutoAttackDamage(_prevMinion) || Math.Abs(predHealth - _prevMinion.Health) < float.Epsilon) { return(_prevMinion); } } result = (from minion in ObjectManager.Get <Obj_AI_Minion>() .Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion) && (_config.Item("AttackWards").GetValue <bool>() || !MinionManager.IsWard(minion)) && (_config.Item("AttackPetsnTraps").GetValue <bool>() && minion.CharData.BaseSkinName != "jarvanivstandard" || MinionManager.IsMinion(minion, _config.Item("AttackWards").GetValue <bool>())) && minion.CharData.BaseSkinName != "gangplankbarrel") let predHealth = HealthPrediction.LaneClearHealthPrediction( minion, (int)((_player.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay) where predHealth >= 2 * _player.GetAutoAttackDamage(minion) || Math.Abs(predHealth - minion.Health) < float.Epsilon select minion).MaxOrDefault(m => !MinionManager.IsMinion(m, true) ? float.MaxValue : m.Health); if (result != null) { _prevMinion = (Obj_AI_Minion)result; } } } return(result); }
internal static bool IsValidMinion(this Obj_AI_Minion minion, float range = 50000) { if (minion == null) { return(false); } var name = minion.CharData.BaseSkinName.ToLower(); return(Player.LSDistance(minion) <= range && minion.IsValid && minion.IsVisible && minion.Team != Player.Team && minion.IsHPBarRendered && !MinionManager.IsWard(minion) && !name.Contains("gangplankbarrel")); }
void Waveclear() { List <Obj_AI_Minion> allMinions = ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsValidTarget(W.Range) && !MinionManager.IsWard(x)).ToList(); if (getCheckBoxItem(farm, "UseQFarm") && Q.IsReady()) { var minion = Orbwalker.LastTarget as Obj_AI_Minion; if (minion != null && HealthPrediction.GetHealthPrediction( minion, (int)(Khazix.Distance(minion) * 1000 / 1400)) > 0.35f * Khazix.GetSpellDamage(minion, SpellSlot.Q) && Khazix.Distance(minion) <= Q.Range) { Q.Cast(minion); } else if (minion == null || !minion.IsValid) { foreach (var min in allMinions.Where(x => x.IsValidTarget(Q.Range))) { if (HealthPrediction.GetHealthPrediction( min, (int)(Khazix.Distance(min) * 1000 / 1400)) > 3 * Khazix.GetSpellDamage(min, SpellSlot.Q) && Khazix.Distance(min) <= Q.Range) { Q.Cast(min); break; } } } } if (getCheckBoxItem(farm, "UseWFarm") && W.IsReady() && Khazix.HealthPercent <= getSliderItem(farm, "Farm.WHealth")) { var wmins = EvolvedW ? allMinions.Where(x => x.IsValidTarget(WE.Range)) : allMinions.Where(x => x.IsValidTarget(W.Range)); MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(wmins .Select(minion => minion.ServerPosition.To2D()) .ToList(), EvolvedW ? WE.Width : W.Width, EvolvedW ? WE.Range : W.Range); var distcheck = EvolvedW ? Khazix.Distance(farmLocation.Position) <= WE.Range : Khazix.Distance(farmLocation.Position) <= W.Range; if (distcheck) { W.Cast(farmLocation.Position); } } if (getCheckBoxItem(farm, "UseEFarm") && E.IsReady()) { MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation( MinionManager.GetMinions(Khazix.ServerPosition, E.Range) .Select(minion => minion.ServerPosition.To2D()) .ToList(), E.Width, E.Range); if (Khazix.Distance(farmLocation.Position) <= E.Range) { E.Cast(farmLocation.Position); } } if (getCheckBoxItem(farm, "UseItemsFarm")) { MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation( MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range) .Select(minion => minion.ServerPosition.To2D()) .ToList(), Hydra.Range, Hydra.Range); if (Hydra.IsReady() && Khazix.Distance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3074, Khazix); } if (Tiamat.IsReady() && Khazix.Distance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3077, Khazix); } if (Titanic.IsReady() && Khazix.Distance(farmLocation.Position) <= Titanic.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3748, Khazix); } } }
private void OnUpdate() { if (Player.IsDead) { return; } if (getCheckBoxItem(rMenu, "RStealth") && R.IsReady() && Player.CountEnemiesInRange(RRange) == 0 && R.Cast()) { LastStealthedUlt = Utils.TickCount; return; } var c = Player.IsChannelingImportantSpell(); if (c) { if (getKeyBindItem(rMenu, "RCancelUlt") && Utility.MoveRandomly()) { return; } if (getCheckBoxItem(rMenu, "RCancelNoEnemies") && Player.CountEnemiesInRange(RRange) == 0 && !CancellingUlt && Utils.TickCount - LastStealthedUlt > 2500) { CancellingUlt = true; LeagueSharp.Common.Utility.DelayAction.Add( 300, () => { CancellingUlt = false; if (Player.CountEnemiesInRange(RRange) == 0 && Utility.MoveRandomly()) { } }); } } if (WardJumping) { if (Utils.TickCount - LastWardPlacement < Game.Ping + 100 || E.LastCastedDelay(200)) { return; } if (!E.IsReady()) { WardJumping = false; return; } var ward = ObjectManager.Get <Obj_AI_Minion>() .Where(o => E.IsInRange(o) && MinionManager.IsWard(o) && o.Buffs.Any(b => b.Caster.IsMe)) .OrderBy(o => o.LSDistance(Game.CursorPos)) .ThenByDescending(o => o.DistanceToPlayer()) .FirstOrDefault(); if (ward == null) { WardJumping = false; return; } // stop movement to prevent turning around after e if (EloBuddy.Player.IssueOrder(GameObjectOrder.Stop, Player.ServerPosition)) { E.CastOnUnit(ward); Console.WriteLine("WARD JUMP"); return; } } if (getKeyBindItem(fleeMenu, "FleeEnabled") || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee)) { if (Flee()) { return; } } if (AutoKill()) { return; } if (c) { return; } if (getCheckBoxItem(wMenu, "WAuto") && W.IsReady() && Enemies.Any(h => h.IsValidTarget(W.Range)) && W.Cast()) { Console.WriteLine("AUTO W"); } }
void Waveclear() { List <Obj_AI_Minion> allMinions = ObjectManager.Get <Obj_AI_Minion>().OrderBy(x => x.MaxHealth).Where(x => x.IsValidTarget(W.Range) && !MinionManager.IsWard(x)).ToList(); if (Config.GetBool("UseQFarm") && Q.IsReady() && !Orbwalking.CanAttack()) { bool UsedQ = false; var minion = Orbwalker.GetTarget() as Obj_AI_Minion; if (minion != null) { var hpred = HealthPrediction.GetHealthPrediction(minion, (int)(Khazix.Distance(minion) * 1000 / 1400)); var qdmg = Khazix.GetSpellDamage(minion, SpellSlot.Q); if ((hpred <= qdmg || hpred >= qdmg * 3) && Khazix.Distance(minion) <= Q.Range) { Q.Cast(minion); UsedQ = true; } } if (!UsedQ) { var killable = allMinions.Find(x => x.IsInRange(Q.Range) && HealthPrediction.GetHealthPrediction(x, (int)(Khazix.Distance(x) * 1000 / 1400)) <= Khazix.GetSpellDamage(x, SpellSlot.Q)); if (killable != null) { Q.Cast(killable); } else { foreach (var min in allMinions.Where(x => x.IsValidTarget(Q.Range))) { if (HealthPrediction.GetHealthPrediction( min, (int)(Khazix.Distance(min) * 1000 / 1400)) > 3 * Khazix.GetSpellDamage(min, SpellSlot.Q) && Khazix.Distance(min) <= Q.Range) { Q.Cast(min); break; } } } } } if (Config.GetBool("UseWFarm") && W.IsReady() && Khazix.HealthPercent <= Config.GetSlider("Farm.WHealth")) { var wmins = EvolvedW ? allMinions.Where(x => x.IsValidTarget(WE.Range)) : allMinions.Where(x => x.IsValidTarget(W.Range)); MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation(wmins .Select(minion => minion.ServerPosition.To2D()) .ToList(), EvolvedW ? WE.Width : W.Width, EvolvedW ? WE.Range : W.Range); var distcheck = EvolvedW ? Khazix.Distance(farmLocation.Position) <= WE.Range : Khazix.Distance(farmLocation.Position) <= W.Range; if (distcheck) { W.Cast(farmLocation.Position); } } if (Config.GetBool("UseEFarm") && E.IsReady()) { MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation( MinionManager.GetMinions(Khazix.ServerPosition, E.Range) .Select(minion => minion.ServerPosition.To2D()) .ToList(), E.Width, E.Range); if (Khazix.Distance(farmLocation.Position) <= E.Range) { E.Cast(farmLocation.Position); } } if (Config.GetBool("UseItemsFarm") && !Orbwalking.CanAttack()) { MinionManager.FarmLocation farmLocation = MinionManager.GetBestCircularFarmLocation( MinionManager.GetMinions(Khazix.ServerPosition, Hydra.Range) .Select(minion => minion.ServerPosition.To2D()) .ToList(), Hydra.Range, Hydra.Range); if (Hydra.IsReady() && Khazix.Distance(farmLocation.Position) <= Hydra.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3074, Khazix); } if (Tiamat.IsReady() && Khazix.Distance(farmLocation.Position) <= Tiamat.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3077, Khazix); } if (Titanic.IsReady() && Khazix.Distance(farmLocation.Position) <= Titanic.Range && farmLocation.MinionsHit >= 2) { Items.UseItem(3748, Khazix); } } }
private static void Game_OnUpdate(EventArgs args) { if (BadaoMainVariables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LastHit) { return; } //LastHit if (BadaoYasuoVariables.LastHitQ.GetValue <bool>() && BadaoMainVariables.Q.IsReady() && !ObjectManager.Player.IsDashing()) { var minion = MinionManager.GetMinions(BadaoYasuoHelper.GetQRange()).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion) && BadaoYasuoHelper.GetQDamage(x) >= x.Health).FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.Q.Cast(minion); } } if (BadaoYasuoVariables.LastHitE.GetValue <bool>() && BadaoMainVariables.E.IsReady()) { var minion = MinionManager.GetMinions(BadaoMainVariables.E.Range).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion) && BadaoYasuoHelper.GetEDamage(x) >= x.Health).FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.E.Cast(minion); } } }
public static List <GameObject> GetEVinasun() { List <GameObject> Vinasun = new List <GameObject>(); Vinasun.AddRange(MinionManager.GetMinions(E.Range, MinionTypes.All, MinionTeam.All).Where(x => !((x is Obj_AI_Minion) && MinionManager.IsWard(x as Obj_AI_Minion)))); Vinasun.AddRange(HeroManager.AllHeroes.Where(unit => unit != null && unit.IsValid && !unit.IsDead && unit.IsTargetable && Player.Distance(unit) <= E.Range)); Vinasun.AddRange(Daggers.Select(x => x.Dagger).ToList()); return(Vinasun); }
private static void HarassLogic() { if (Me.ManaPercent >= Menu.Item("HaraassMana", true).GetValue <Slider>().Value) { if (Menu.Item("HaraassQLH", true).GetValue <bool>()) { var minions = MinionManager.GetMinions(Q.Range) .Where(x => x.MaxHealth > 5 && HealthPrediction.GetHealthPrediction(x, 1100) * 0.9 < Me.GetSpellDamage(x, SpellSlot.Q) && HealthPrediction.GetHealthPrediction(x, 1100) * 0.9 > 0); if (minions.Any()) { var min = minions.FirstOrDefault(); Q.Cast(min, true); } } if (Menu.Item("HaraassQ", true).GetValue <bool>() && Q.IsReady()) { var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical); if (target.IsValidTarget()) { if (target.IsValidTarget(Q.Range)) { Q.CastTo(target, true); } } } if (Menu.Item("HaraassE", true).GetValue <bool>() && E.IsReady()) { var minions = ObjectManager.Get <Obj_AI_Minion>() .Where( x => x.IsEnemy && x.Name != "gangplankbarrel" && x.Name != "WardCorpse" && x.Name != "jarvanivstandard" && !MinionManager.IsWard(x) && x.Distance(Me) < E.Range && x.Health < GetEDamage(x)).ToList(); if (minions.Count(x => x.Distance(Me) < E.Range) > 0) { if (Utils.TickCount - CastSpellFarmTime > 1500) { if (E.Instance.ToggleState != 2) { E.Cast(); } } } else { if (E.Instance.ToggleState == 2) { E.Cast(); } } } } }
public static List <Obj_AI_Base> GetQVinasun() { List <Obj_AI_Base> Vinasun = new List <Obj_AI_Base>(); Vinasun.AddRange(MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.All).Where(x => !((x is Obj_AI_Minion) && MinionManager.IsWard(x as Obj_AI_Minion)))); Vinasun.AddRange(HeroManager.AllHeroes.Where(unit => unit != null && unit.IsValid && !unit.IsDead && unit.IsTargetable && Player.Distance(unit) <= Q.Range)); return(Vinasun); }
//E buff : YasuoDashWrapper public static List <Obj_AI_Base> GetETargets() { var targets = new List <Obj_AI_Base>(); targets.AddRange(HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.HasBuff("YasuoDashWrapper") && BadaoMainVariables.E.IsInRange(x)).ToList()); targets.AddRange(ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsValidTarget(BadaoMainVariables.E.Range) && !MinionManager.IsWard(x as Obj_AI_Minion) && x.Team != GameObjectTeam.Unknown) .Where(x => MinionManager.IsMinion(x) || x.Team == GameObjectTeam.Neutral).Where(x => !x.HasBuff("YasuoDashWrapper"))); return(targets.ToList()); }
public static List <Obj_AI_Base> GetEvadeTargets( SpellValidTargets[] validTargets, int speed, int delay, float range, bool isBlink = false, bool onlyGood = false, bool dontCheckForSafety = false) { var badTargets = new List <Obj_AI_Base>(); var goodTargets = new List <Obj_AI_Base>(); var allTargets = new List <Obj_AI_Base>(); foreach (var targetType in validTargets) { switch (targetType) { case SpellValidTargets.AllyChampions: allTargets.AddRange(HeroManager.Allies.Where(i => i.IsValidTarget(range, false) && !i.IsMe)); break; case SpellValidTargets.AllyMinions: allTargets.AddRange( ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsAlly).Where( i => i.IsValidTarget(range, false, ObjectManager.Player.Position) && MinionManager.IsMinion(i))); break; case SpellValidTargets.AllyWards: allTargets.AddRange( ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsAlly && MinionManager.IsWard(x.CharData.BaseSkinName)) .Where(i => i.IsValidTarget(range, false))); break; case SpellValidTargets.EnemyChampions: allTargets.AddRange(HeroManager.Enemies.Where(i => i.IsValidTarget(range))); break; case SpellValidTargets.EnemyMinions: allTargets.AddRange( ObjectManager.Get <Obj_AI_Minion>().Where(x => x.IsEnemy).Where( i => i.IsValidTarget(range, true, ObjectManager.Player.Position) && MinionManager.IsMinion(i))); allTargets.AddRange( ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.Team == GameObjectTeam.Neutral) .Where(i => i.IsValidTarget(range, true, ObjectManager.Player.Position))); break; case SpellValidTargets.EnemyWards: allTargets.AddRange( ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsEnemy && MinionManager.IsWard(x.CharData.BaseSkinName)) .Where(i => i.IsValidTarget(range))); break; } } foreach (var target in allTargets.Where(i => dontCheckForSafety || Evade.IsSafePoint(i.ServerPosition.To2D()).IsSafe)) { if (isBlink) { if (Utils.GameTimeTickCount - Evade.LastWardJumpAttempt < 250 || Evade.IsSafeToBlink(target.ServerPosition.To2D(), Config.EvadingFirstTimeOffset, delay)) { goodTargets.Add(target); } if (Utils.GameTimeTickCount - Evade.LastWardJumpAttempt < 250 || Evade.IsSafeToBlink(target.ServerPosition.To2D(), Config.EvadingSecondTimeOffset, delay)) { badTargets.Add(target); } } else { var pathToTarget = new List <Vector2> { Evade.PlayerPosition, target.ServerPosition.To2D() }; if (Utils.GameTimeTickCount - Evade.LastWardJumpAttempt < 250 || Evade.IsSafePath(pathToTarget, Config.EvadingFirstTimeOffset, speed, delay).IsSafe) { goodTargets.Add(target); } if (Utils.GameTimeTickCount - Evade.LastWardJumpAttempt < 250 || Evade.IsSafePath(pathToTarget, Config.EvadingSecondTimeOffset, speed, delay).IsSafe) { badTargets.Add(target); } } } return(goodTargets.Count > 0 ? goodTargets : (onlyGood ? new List <Obj_AI_Base>() : badTargets)); }
private static void Game_OnUpdate(EventArgs args) { if (BadaoMainVariables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.LaneClear) { return; } //LaneClear if (BadaoYasuoVariables.LaneQ.GetValue <bool>() && BadaoMainVariables.Q.IsReady() && BadaoYasuoVariables.LaneE.GetValue <bool>() && BadaoMainVariables.E.IsReady()) { var minions = MinionManager.GetMinions(BadaoMainVariables.E.Range).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion)); var minion = minions.Where(x => minions.Where(y => y.Distance(BadaoYasuoHelper.GetEDashEnd(x)) <= 250).Count() >= 2) .MaxOrDefault(x => minions.Where(y => y.Distance(BadaoYasuoHelper.GetEDashEnd(x)) <= 250).Count()); if (minion.IsValidTarget()) { BadaoMainVariables.E.Cast(minion); LeagueSharp.Common.Utility.DelayAction.Add(100, () => BadaoMainVariables.Q.Cast(ObjectManager.Player.Position)); } } if (BadaoYasuoVariables.LaneQ.GetValue <bool>() && BadaoMainVariables.Q.IsReady() && !ObjectManager.Player.IsDashing()) { var minions = MinionManager.GetMinions(BadaoYasuoHelper.GetQRange()).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion)); var minion = minions.Where(x => BadaoYasuoHelper.GetQDamage(x) + BadaoYasuoHelper.GetEDamage(x) >= x.Health).FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.Q.Cast(minion); } var farm = MinionManager.GetBestLineFarmLocation(minions.Select(x => x.Position.To2D()).ToList(), 70, BadaoYasuoHelper.GetQRange()); if (farm.MinionsHit >= 2) { BadaoMainVariables.Q.Cast(farm.Position); } } if (BadaoYasuoVariables.LaneE.GetValue <bool>() && BadaoMainVariables.E.IsReady()) { var minion = MinionManager.GetMinions(BadaoMainVariables.E.Range).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion) && BadaoYasuoHelper.GetEDamage(x) >= x.Health).FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.E.Cast(minion); } } // JungleClear if (BadaoYasuoVariables.JungQ.GetValue <bool>() && BadaoMainVariables.Q.IsReady() && BadaoYasuoVariables.JungE.GetValue <bool>() && BadaoMainVariables.E.IsReady()) { var minions = MinionManager.GetMinions(BadaoMainVariables.E.Range, MinionTypes.All, MinionTeam.Neutral).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion)); var minion = minions.Where(x => minions.Where(y => y.Distance(BadaoYasuoHelper.GetEDashEnd(x)) <= 250).Count() >= 2) .MaxOrDefault(x => minions.Where(y => y.Distance(BadaoYasuoHelper.GetEDashEnd(x)) <= 250).Count()); if (minion.IsValidTarget()) { BadaoMainVariables.Q.Cast(minion); } } if (BadaoYasuoVariables.JungQ.GetValue <bool>() && BadaoMainVariables.Q.IsReady() && !ObjectManager.Player.IsDashing()) { var minions = MinionManager.GetMinions(BadaoYasuoHelper.GetQRange(), MinionTypes.All, MinionTeam.Neutral).OrderByDescending(x => x.MaxHealth) .Where(x => !MinionManager.IsWard(x as Obj_AI_Minion)); var minion = minions.FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.Q.Cast(minion); } var farm = MinionManager.GetBestLineFarmLocation(minions.Select(x => x.Position.To2D()).ToList(), 70, BadaoYasuoHelper.GetQRange()); if (farm.MinionsHit >= 2) { BadaoMainVariables.Q.Cast(farm.Position); } } if (BadaoYasuoVariables.JungE.GetValue <bool>() && BadaoMainVariables.E.IsReady()) { var minion = MinionManager.GetMinions(BadaoMainVariables.E.Range, MinionTypes.All, MinionTeam.Neutral).Where(x => !MinionManager.IsWard(x as Obj_AI_Minion) && BadaoYasuoHelper.GetEDamage(x) >= x.Health).FirstOrDefault(); if (minion.IsValidTarget()) { BadaoMainVariables.E.Cast(minion); LeagueSharp.Common.Utility.DelayAction.Add(100, () => BadaoMainVariables.Q.Cast(ObjectManager.Player.Position)); } } }