void OnInterruptable(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args) { if (Yasuo.ServerPosition.PointUnderEnemyTurret()) { return; } if (GetBool("Misc.Interrupter", YasuoMenu.MiscM) && TornadoReady && Yasuo.LSDistance(sender.ServerPosition) <= 500) { if (args.EndTime >= Spells[Q2].Delay) { Spells[Q2].Cast(sender.ServerPosition); } } }
void OnGapClose(ActiveGapcloser args) { if (Yasuo.ServerPosition.PointUnderEnemyTurret()) { return; } if (GetBool("Misc.AG", YasuoMenu.MiscM) && TornadoReady && Yasuo.LSDistance(args.End) <= 500) { var pred = Spells[Q2].GetPrediction(args.Sender); if (pred.Hitchance >= GetHitChance("Hitchance.Q")) { Spells[Q2].Cast(pred.CastPosition); } } }
void Flee() { Orbwalker.DisableAttacking = true; // BERB if (GetBool("Flee.UseQ2", YasuoMenu.MiscM) && !Yasuo.LSIsDashing() && SpellSlot.Q.IsReady() && TornadoReady) { var qtarg = TargetSelector.GetTarget(Spells[Q2].Range, DamageType.Physical); if (qtarg != null) { Spells[Q2].Cast(qtarg.ServerPosition); } } if (FleeMode == FleeType.ToCursor) { Orbwalker.OrbwalkTo(Game.CursorPos); var smart = GetBool("Flee.Smart", YasuoMenu.MiscM); if (Spells[E].IsReady()) { if (smart) { Obj_AI_Base dashTarg; if (Yasuo.ServerPosition.PointUnderEnemyTurret()) { var closestturret = ObjectManager.Get <Obj_AI_Turret>() .Where(x => x.IsEnemy) .MinOrDefault(y => y.LSDistance(Yasuo)); var potential = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable()) .MaxOrDefault(x => GetDashPos(x).LSDistance(closestturret)); if (potential != null) { var gdpos = GetDashPos(potential); if (gdpos.LSDistance(Game.CursorPos) < Yasuo.LSDistance(Game.CursorPos) && gdpos.LSDistance(closestturret.Position) - closestturret.BoundingRadius > Yasuo.LSDistance(closestturret.Position) - Yasuo.BoundingRadius) { Spells[E].Cast(potential); } } } dashTarg = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable()) .MinOrDefault(x => GetDashPos(x).LSDistance(Game.CursorPos)); if (dashTarg != null) { var posafdash = GetDashPos(dashTarg); if (posafdash.LSDistance(Game.CursorPos) < Yasuo.LSDistance(Game.CursorPos) && !posafdash.PointUnderEnemyTurret()) { Spells[E].CastOnUnit(dashTarg); } } } else { var dashtarg = ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsDashable()) .MinOrDefault(x => GetDashPos(x).LSDistance(Game.CursorPos)); if (dashtarg != null) { Spells[E].CastOnUnit(dashtarg); } } } if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady && !Yasuo.LSIsDashing()) { Obj_AI_Minion qtarg = null; if (!Spells[E].IsReady()) { qtarg = ObjectManager.Get <Obj_AI_Minion>() .Find(x => x.LSIsValidTarget(Spells[Q].Range) && MinionManager.IsMinion(x)); } else { var etargs = ObjectManager.Get <Obj_AI_Minion>() .Where( x => x.LSIsValidTarget(Spells[E].Range) && MinionManager.IsMinion(x) && x.IsDashable()); if (!etargs.Any()) { qtarg = ObjectManager.Get <Obj_AI_Minion>() .Find(x => x.LSIsValidTarget(Spells[Q].Range) && MinionManager.IsMinion(x)); } } if (qtarg != null) { Spells[Q].Cast(qtarg); } } } if (FleeMode == FleeType.ToNexus) { var nexus = shop; if (nexus != null) { Orbwalker.OrbwalkTo(nexus.Position); var bestminion = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsDashable()).MinOrDefault(x => GetDashPos(x).LSDistance(nexus.Position)); if (bestminion != null && (!GetBool("Flee.Smart", YasuoMenu.MiscM) || GetDashPos(bestminion).LSDistance(nexus.Position) < Yasuo.LSDistance(nexus.Position))) { Spells[E].CastOnUnit(bestminion); if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady) { Spells[Q].Cast(bestminion); } } } } if (FleeMode == FleeType.ToAllies) { Obj_AI_Base bestally = HeroManager.Allies.Where(x => !x.IsMe && x.LSCountEnemiesInRange(300) == 0).MinOrDefault(x => x.LSDistance(Yasuo)); if (bestally == null) { bestally = ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsValidAlly(3000)) .MinOrDefault(x => x.LSDistance(Yasuo)); } if (bestally != null) { Orbwalker.OrbwalkTo(bestally.ServerPosition); if (Spells[E].IsReady()) { var besttarget = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable()) .MinOrDefault(x => GetDashPos(x).LSDistance(bestally.ServerPosition)); if (besttarget != null) { Spells[E].CastOnUnit(besttarget); if (GetBool("Flee.StackQ", YasuoMenu.MiscM) && SpellSlot.Q.IsReady() && !TornadoReady) { Spells[Q].Cast(besttarget); } } } } else { var nexus = shop; if (nexus != null) { Orbwalker.OrbwalkTo(nexus.Position); var bestminion = ObjectManager.Get <Obj_AI_Base>().Where(x => x.IsDashable()).MinOrDefault(x => GetDashPos(x).LSDistance(nexus.Position)); if (bestminion != null && GetDashPos(bestminion).LSDistance(nexus.Position) < Yasuo.LSDistance(nexus.Position)) { Spells[E].CastOnUnit(bestminion); } } } } }
internal void CastENew(AIHeroClient target) { if (!SpellSlot.E.IsReady() || Yasuo.LSIsDashing() || InDash) { return; } var minionsinrange = ObjectManager.Get <Obj_AI_Minion>().Any(x => x.IsDashable()); if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range)) { target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range, DamageType.Physical); } if (target != null && TowerCheck(target, true)) { var dist = Yasuo.LSDistance(target); var pctOutOfRange = dist / Yasuo.AttackRange * 100; if (pctOutOfRange > 0.8f) { if (target.IsDashable()) { if (target.ECanKill()) { return; } if (TornadoReady && target.IsInRange(Spells[E].Range) && targInKnockupRadius(target)) { Spells[E].CastOnUnit(target); } //Stay in range else if (pctOutOfRange > 0.8f) { var bestminion = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); var shouldETarget = bestminion == null || GetDashPos(target).Distance(target) < GetDashPos(bestminion).LSDistance(target); if (shouldETarget && GetDashPos(target).IsCloser(target)) { Spells[E].CastOnUnit(target); } else if (bestminion != null) { Spells[E].CastOnUnit(bestminion); } } } else { var minion = ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsDashable() && x.IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); if (minion != null) { Spells[E].CastOnUnit(minion); } } } } }
//minimum amount of minions internal void CastENew(AIHeroClient target) { if (!SpellSlot.E.IsReady() || Yasuo.LSIsDashing() || InDash) { return; } var minionsinrange = ObjectManager.Get <Obj_AI_Minion>().Any(x => x.IsDashable()); if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range)) { target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range, DamageType.Physical); } if (target != null && TowerCheck(target, true)) { if (!target.IsDashable()) { var bestminion = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); if (bestminion != null) { Spells[E].CastOnUnit(bestminion); return; } } else { var dist = Yasuo.LSDistance(target); var pctOutOfRange = dist / Spells[E].Range * 100; //Stay in range if (pctOutOfRange > 0.8f) { if (TornadoReady && target.IsDashable() && targInKnockupRadius(target)) { Spells[E].CastOnUnit(target); } else { var bestminion = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); if (bestminion != null) { Spells[E].CastOnUnit(bestminion); } else if (target.IsDashable() && GetDashPos(target).IsCloser(target)) { Spells[E].CastOnUnit(target); } } } //Catch up using a minion else if (pctOutOfRange > 1) { var minion = ObjectManager.Get <Obj_AI_Minion>() .Where(x => x.IsDashable() && x.IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); if (minion != null) { Spells[E].CastOnUnit(target); } } //Go for a EQ if target is well within range else { if (Spells[Q].IsReady() && TornadoReady) { if (targInKnockupRadius(target)) { Spells[E].CastOnUnit(target); return; } } if (DashCount == 0) { var bestminion = ObjectManager.Get <Obj_AI_Base>() .Where( x => x.IsDashable() && GetDashPos(x).IsCloser(target) && TowerCheck(x, true)) .MinOrDefault(x => GetDashPos(x).LSDistance(target)); if (bestminion != null) { Spells[E].CastOnUnit(bestminion); } else if (target.IsDashable() && GetDashPos(target).IsCloser(target) && TowerCheck(target, true)) { Spells[E].CastOnUnit(target); } } } } } }
internal void CastEOld(AIHeroClient target, bool force = false) { var minionsinrange = ObjectManager.Get <Obj_AI_Minion>().Any(x => x.IsDashable()); if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range)) { target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range, DamageType.Physical); } if (target != null) { if (SpellSlot.E.IsReady() && isHealthy && target.LSDistance(Yasuo) >= 0.30 * Yasuo.AttackRange) { if (TornadoReady && ((GetBool("Combo.ETower", YasuoMenu.ComboM) && GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM)) || !GetDashPos(target).PointUnderEnemyTurret())) { Spells[E].CastOnUnit(target); return; } if (DashCount >= 1 && GetDashPos(target).IsCloser(target) && target.IsDashable() && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret())) { ETarget = target; Spells[E].CastOnUnit(target); return; } if (DashCount == 0) { var dist = Yasuo.LSDistance(target); var bestminion = ObjectManager.Get <Obj_AI_Base>() .Where( x => x.IsDashable() && GetDashPos(x).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret())) .OrderBy(x => Vector2.Distance(GetDashPos(x), target.ServerPosition.LSTo2D())) .FirstOrDefault(); if (bestminion != null) { ETarget = bestminion; Spells[E].CastOnUnit(bestminion); } else if (target.IsDashable() && GetDashPos(target).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret())) { ETarget = target; Spells[E].CastOnUnit(target); } } else { var minion = ObjectManager.Get <Obj_AI_Base>() .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret())) .OrderBy(x => GetDashPos(x).LSDistance(target.ServerPosition)).FirstOrDefault(); if (minion != null && GetDashPos(minion).IsCloser(target)) { ETarget = minion; Spells[E].CastOnUnit(minion); } } } } }