internal static void LaneClear() { var minions = EntityManager.MinionsAndMonsters.EnemyMinions; var objAiMinions = minions as Obj_AI_Minion[] ?? minions.ToArray(); if (!objAiMinions.Any() || minions == null || Player.Instance.ManaPercent < Config.GetSliderValue(Config.LaneClear, "manaToLC")) { return; } if (Config.IsChecked(Config.LaneClear, "useQInLC") && Spells.Q.IsReady() && (Orbwalker.LastHitMinion == null && !Orbwalker.IsAutoAttacking)) { var qFarmLoc = Computed.GetBestCircularFarmLocation( objAiMinions.Where(m => m.Distance(Player.Instance) <= Spells.Q.Range) .Select(mx => mx.ServerPosition.To2D()) .ToList(), Spells.Q.Width, Spells.Q.Range); if (qFarmLoc.MinionsHit >= Config.GetSliderValue(Config.LaneClear, "minQInLC")) { Spells.Q.Cast(qFarmLoc.Position.To3D()); } } if (Config.IsChecked(Config.LaneClear, "useWInLC") && Spells.W.IsReady() && (Orbwalker.LastHitMinion == null && !Orbwalker.IsAutoAttacking)) { var wFarmLoc = Computed.GetBestCircularFarmLocation( objAiMinions.Where(m => m.Distance(Player.Instance) <= Spells.W.Range) .Select(mx => mx.ServerPosition.To2D()) .ToList(), Spells.W.Width, Spells.W.Range); if (wFarmLoc.MinionsHit >= Config.GetSliderValue(Config.LaneClear, "minWInLC") && wFarmLoc.Position.To3D().Distance(Player.Instance.Position) >= Spells.WMinRange) { Spells.W.Cast(wFarmLoc.Position.To3D()); } } if (Config.IsChecked(Config.LaneClear, "useEInLC") && Spells.E.IsReady()) { var minToE = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault( m => m.IsValidTarget(Spells.E.Range) && Player.Instance.GetSpellDamage(m, SpellSlot.E) > m.Health && ((!Config.IsChecked(Config.LaneClear, "laneEonP") || m.HasBuffOfType(BuffType.Poison)) || (Config.IsChecked(Config.LaneClear, "useManaEInLC") && Player.Instance.ManaPercent <= Config.GetSliderValue(Config.LaneClear, "manaEInLC")))); if (minToE != null) { Spells.E.Cast(minToE); } } }
internal static void JungleClear() { var minions = EntityManager.MinionsAndMonsters.Monsters.OrderByDescending(x => x.MaxHealth); if (!minions.Any() || Player.Instance.ManaPercent < Config.GetSliderValue(Config.JungleClear, "manaToJC")) { return; } if (Config.IsChecked(Config.JungleClear, "useQInJC") && Spells.Q.IsReady()) { var qFarmLoc = Computed.GetBestCircularFarmLocation( minions.Where(m => m.Distance(Player.Instance) <= Spells.Q.Range) .Select(mx => mx.ServerPosition.To2D()) .ToList(), Spells.Q.Width, Spells.Q.Range); if (qFarmLoc.MinionsHit > 0) { Spells.Q.Cast(qFarmLoc.Position.To3D()); } } if (Config.IsChecked(Config.JungleClear, "useWInJC") && Spells.W.IsReady()) { var wFarmLoc = Computed.GetBestCircularFarmLocation( minions.Where(m => m.Distance(Player.Instance) <= Spells.W.Range) .Select(mx => mx.ServerPosition.To2D()) .ToList(), Spells.W.Width, Spells.W.Range); if (wFarmLoc.MinionsHit >= Config.GetSliderValue(Config.LaneClear, "minWInLC") && wFarmLoc.Position.To3D().Distance(Player.Instance.Position) >= Spells.WMinRange) { Spells.W.Cast(wFarmLoc.Position.To3D()); } } if (Config.IsChecked(Config.JungleClear, "useEInJC") && Spells.E.IsReady()) { var jngToE = EntityManager.MinionsAndMonsters.Monsters.OrderByDescending(x => x.MaxHealth) .FirstOrDefault( m => m.IsValidTarget(Spells.E.Range) && (!Config.IsChecked(Config.JungleClear, "jungEonP") || m.HasBuffOfType(BuffType.Poison))); if (jngToE != null) { Spells.E.Cast(jngToE); } } }