public static bool CanCastE(Obj_AI_Base target, bool ignoreMenu = false) { var endPos = EndPos(target); if ((endPos.IsUnderTurret() && YasuoUtils.DangerousTurret(YasuoUtils.GetNearestTurret(endPos))) || target.Distance(ObjectManager.Player, true) >= E.RangeSquared || target.HasBuff("YasuoDashWrapper")) { return(false); } if (!Config.spellEMenu["ylm.spelle.range"].Cast <CheckBox>().CurrentValue || ignoreMenu) { return(true); } var eRangeC = Config.spellEMenu["ylm.spelle.rangeslider"].Cast <Slider>().CurrentValue; return(target.Distance(endPos, true) < eRangeC * eRangeC); }
public static bool CanCastE(Obj_AI_Base target, bool ignoreMenu = false) { var endPos = EndPos(target); if ((endPos.UnderTurret(true) && YasuoUtils.DangerousTurret(YasuoUtils.GetNearestTurret(endPos))) || target.Distance(ObjectManager.Player, true) >= E.RangeSqr || target.HasBuff("YasuoDashWrapper")) { return(false); } if (!Config.Param <bool>("ylm.spelle.range") || ignoreMenu) { return(true); } var eRangeC = Config.Param <Slider>("ylm.spelle.rangeslider").Value; return(target.Distance(endPos, true) < eRangeC * eRangeC); }
public static void GapClose(Obj_AI_Base target = null, bool escape = false) { if (!Config.gapcloseMenu["ylm.gapclose.on"].Cast <CheckBox>().CurrentValue || (Config.gapcloseMenu["ylm.gapclose.hpcheck"].Cast <CheckBox>().CurrentValue&& Config.gapcloseMenu["ylm.gapclose.hpcheck2"].Cast <Slider>().CurrentValue > ObjectManager.Player.HealthPercent)) { return; } if (target == null) { target = TargetSelector.GetTarget(Config.gapcloseMenu["ylm.gapclose.limit"].Cast <Slider>().CurrentValue, DamageType.Magical); if (target == null) { return; } } if (ObjectManager.Player.IsDashing() && Config.gapcloseMenu["ylm.gapclose.stackQ"].Cast <CheckBox>().CurrentValue&& !SteelTempest.Empowered && !CanCastE(target)) { SteelTempest.QDash.Cast(); } var distTarget = ObjectManager.Player.Distance(target, true); if (!E.IsReady()) { return; } if (escape) { E.Cast(target); } if (distTarget <= ObjectManager.Player.AttackRange * ObjectManager.Player.AttackRange) { return; } /*var dashUnit = (from o in ObjectManager.Get<Obj_AI_Base>() * where o.IsValidTarget() && o.IsEnemy && (o.IsMinion || o is AIHeroClient) * let distance = o.Distance(ObjectManager.Player, true) * let endPos = EndPos(o.ServerPosition) * where * distance < E.RangeSquared && !endPos.UnderTurret(true) && o.Distance(target, true) < distance * && endPos.Distance(target.ServerPosition, true) < distTarget && !o.HasBuff("YasuoDashWrapper") * select o).FirstOrDefault();*/ foreach ( var unit in ObjectManager.Get <Obj_AI_Base>() .Where(o => o.IsEnemy && o.IsValidTarget() && (o.IsMinion || o is AIHeroClient))) { var distance = unit.Distance(ObjectManager.Player, true); var endPos = EndPos(unit.ServerPosition); if (distance < E.RangeSquared && (!endPos.IsUnderTurret() || !YasuoUtils.DangerousTurret(YasuoUtils.GetNearestTurret(endPos))) && unit.Distance(target, true) < distance && endPos.Distance(target.ServerPosition, true) < distTarget && !unit.HasBuff("YasuoDashWrapper")) { E.Cast(unit); return; } } }