private static void OnUpdate() { if (ObjectManager.GetLocalPlayer().IsDead) { return; } if (ObjectManager.GetLocalPlayer().HasBuffOfType(BuffType.SpellImmunity) || ObjectManager.GetLocalPlayer().HasBuffOfType(BuffType.SpellShield)) { return; } if (!MyLogic.W.IsReady(300) && (Wall == null || !MyLogic.E.IsReady(200))) { return; } foreach (var target in DetectedTargets.Where(i => ObjectManager.GetLocalPlayer().Distance(i.Obj.Position) < 700)) { if (MyLogic.E.Ready && Menu["Brian.EvadeTargetMenu.EvadeTargetE"].Enabled && Wall != null && Game.TickCount - MyLogic.lastWTime > 1000 && !GoThroughWall(ObjectManager.GetLocalPlayer().ServerPosition.To2D(), target.Obj.Position.To2D()) && MyLogic.W.IsInRange(target.Obj, 250)) { var obj = new List <Obj_AI_Base>(); obj.AddRange( GameObjects.EnemyMinions.Where( x => x.IsValidTarget(MyLogic.E.Range) && (x.IsMinion() || x.IsMob()))); obj.AddRange(GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(MyLogic.E.Range))); if ( obj.Where( i => MyExtraManager.CanCastE(i) && i.ServerPosition.IsSafePosition() && MyExtraManager.PosAfterE(i).IsSafePosition() && (!MyExtraManager.UnderTower(MyExtraManager.PosAfterE(i)) || Menu["Brian.EvadeTargetMenu.EvadeTargetETower"].Enabled) && GoThroughWall(ObjectManager.GetLocalPlayer().ServerPosition.To2D(), MyExtraManager.PosAfterE(i).To2D())) .OrderBy(i => MyExtraManager.PosAfterE(i).Distance(Game.CursorPos)) .Any(i => MyLogic.E.CastOnUnit(i))) { return; } } if (MyLogic.W.Ready && Menu["Brian.EvadeTargetMenu.EvadeTargetW"].Enabled && MyLogic.W.IsInRange(target.Obj, 500) && MyLogic.W.Cast(ObjectManager.GetLocalPlayer().ServerPosition.Extend(target.Start, 100))) { return; } } }
private static void TryToEvade(List <Skillshot> HitBy, Vector2 Pos) { var dangerLevel = 0; foreach (var skillshot in HitBy) { dangerLevel = Math.Max(dangerLevel, skillshot.GetSlider("DangerLevel")); } foreach (var evadeSpell in EvadeSpellDatabase.Spells) { if (evadeSpell.Enabled && evadeSpell.DangerLevel <= dangerLevel && evadeSpell.IsReady()) { if (evadeSpell.Slot == SpellSlot.E) { var dodgeList = GetEvadeTargets(evadeSpell) .Where( x => IsSafe(MyExtraManager.PosAfterE(x).To2D()).IsSafe&& (!MyExtraManager.UnderTower(MyExtraManager.PosAfterE(x)) || EvadeSpellMenu["ETower"].Enabled)).ToArray(); if (dodgeList.Any()) { var dodgeTarget = dodgeList.Where(x => !x.HasBuff("YasuoDashWrapper")) .MinOrDefault(i => MyExtraManager.PosAfterE(i).Distance(Pos.To3D())); if (dodgeTarget != null && dodgeTarget.DistanceToPlayer() <= MyLogic.E.Range && MyExtraManager.CanCastE(dodgeTarget)) { MyLogic.E.CastOnUnit(dodgeTarget); } } } if (evadeSpell.Slot == SpellSlot.W) { var skillShotList = HitBy.Where( x => x.SpellData.CollisionObjects.Contains(CollisionObjectTypes.YasuoWall)).ToArray(); if (skillShotList.Any()) { var willHitList = skillShotList.Where( x => x.IsAboutToHit( 150 + evadeSpell.Delay, ObjectManager.GetLocalPlayer())).ToArray(); if (willHitList.Any()) { if ( willHitList.OrderByDescending( x => dangerLevel) .Any( x => MyLogic.W.Cast( ObjectManager.GetLocalPlayer().ServerPosition.Extend(x.Start.To3D(), 300)))) { return; } } } } } } }