public static Obj_AI_Base Nearby1HPBarrel(this AIHeroClient self, List <Obj_AI_Base> enemies, float range, int hitNumber, bool KS, bool KSWithQ) { if (KS && !KSWithQ) { enemies = enemies.Where(a => a.Health <= Program.Gangplank.GetAutoAttackDamage(a)).ToList(); } else if (KS) { enemies = enemies.Where(a => a.Health <= Calculations.Q(a)).ToList(); } Barrel b = Program.barrels.Where(a => a.barrel.MeetsCriteria() && self.IsInRange(a.barrel, range) && a.barrel.Health == 1 && a.EHitNumber(enemies) >= hitNumber).FirstOrDefault(); if (b != null) { return(b.barrel); } return(null); }
//working and tested private static void CastQOnBestBarrel(List <Obj_AI_Base> enemies, bool ks, int enemiesHit) { if (ks) { enemies = enemies.Where(a => a.Health <= Calculations.E(a, true)).ToList(); } if ((!Program.Q.IsReady() || !Program.Q.IsLearned) || didActionThisTick || !Program.barrels.Any(a => a.barrel.IsInRange(Gangplank, Program.Q.Range)) || enemies.Count == 0) { return; } Barrel b = Calculations.getBestBarrel(enemies, true, 1, ks); if (enemies.Count >= 1 && b != null && Calculations.EnemiesHitByBarrel(b, enemies, true) >= enemiesHit) { didActionThisTick = Program.Q.Cast(b.barrel); } }
public static int EnemiesHitByBarrel(Barrel barrel, List <Obj_AI_Base> enemies, bool usingQ) { Menu menu = MenuHandler.mainMenu; if (menu.GetComboBoxText("Prediction Type:") == "EloBuddy") { if (usingQ) { return(enemies.Where(a => a.Position((int)(CalculateQTimeToTarget(barrel.barrel) * 1000)).IsInRangeOfBarrels(ChainedBarrels(barrel))).Count()); } else { return(enemies.Where(a => a.Position(250).IsInRangeOfBarrels(ChainedBarrels(barrel))).Count()); } } else if (menu.GetComboBoxText("Prediction Type:") == "Current Position") { return(enemies.Where(a => a.IsInRangeOfBarrels(ChainedBarrels(barrel))).Count()); } Chat.Print("This type of prediction doesn't exist!"); return(0); }
public static int EHitNumber(this Barrel self, List <Obj_AI_Base> enemies) { return(enemies.Count(a => self.barrel.IsInRange(a.Position(250), Program.barrelRadius))); }
//working and tested public static void Combo() { List <Obj_AI_Base> enemies = EntityManager.Heroes.Enemies.ToList().ToObj_AI_BaseList(); Menu menu = MenuHandler.Combo; if (menu.GetCheckboxValue("Use Q")) { if (menu.GetCheckboxValue("Use Q to kill barrels") && Gangplank.NearbyBarrelCount(Program.Q.Range) >= 1) { CastQOnBestBarrel(enemies, false, menu.GetSliderValue("Enemies to use Q on Barrel")); } if (menu.GetCheckboxValue("Use Q on enemies")) { if (menu.GetCheckboxValue("Use Q on enemies only if no barrels around") && Gangplank.NearbyBarrelCount(Program.Q.Range) == 0) { CastQ(enemies, false); } else if (!menu.GetCheckboxValue("Use Q on enemies only if no barrels around") || Gangplank.NearbyBarrelCount(Program.Q.Range) != 0) { CastQ(enemies, false); } } } if (menu.GetCheckboxValue("Use W")) { if (menu.GetCheckboxValue("Use W to remove CC") && Gangplank.CanCancleCC(false)) { CastW(); } if (menu.GetCheckboxValue("Use W to remove slows") && Gangplank.CanCancleCC(true)) { CastW(); } } if (menu.GetCheckboxValue("Use E")) { if (menu.GetCheckboxValue("Chain Barrels")) { CastEOnBestBarrelChainPosition(enemies, menu.GetSliderValue("Enemies to use Barrel"), false); } if (menu.GetCheckboxValue("Create First Barrel") && Gangplank.NearbyBarrelCount(Program.E.Range) == 0) { CastEOnBestPosition(enemies, menu.GetSliderValue("Enemies to use Barrel"), false); } } if (menu.GetCheckboxValue("Use R")) { CastR(enemies, menu.GetSliderValue("Enemies to use R"), false); } if (menu.GetCheckboxValue("Use Items")) { CastItems(enemies, false); } if (menu.GetCheckboxValue("Auto-Attack Barrels if Q on cooldown") && (!Program.Q.IsReady() || !Program.Q.IsLearned) && Orbwalker.CanAutoAttack) { Barrel b = Calculations.getBestBarrel(enemies, false, menu.GetSliderValue("Enemies to Auto-Attack Barrel"), false); if (b != null && b.EHitNumber(enemies) >= menu.GetSliderValue("Enemies to Auto-Attack Barrel")) { Orbwalker.ForcedTarget = b.barrel; didActionThisTick = true; } } }
//working and tested public static void KS() { List <Obj_AI_Base> enemies = EntityManager.Heroes.Enemies.ToList().ToObj_AI_BaseList(); Menu menu = MenuHandler.Killsteal; if (menu.GetCheckboxValue("Use Q")) { if (menu.GetCheckboxValue("Use Q to kill barrels") && Gangplank.NearbyBarrelCount(Program.Q.Range) >= 1) { CastQOnBestBarrel(enemies, true, 1); } if (menu.GetCheckboxValue("Use Q on enemies")) { if (menu.GetCheckboxValue("Use Q on enemies only if no barrels around") && Gangplank.NearbyBarrelCount(Program.Q.Range) == 0) { CastQ(enemies, true); } else if (!menu.GetCheckboxValue("Use Q on enemies only if no barrels around") || Gangplank.NearbyBarrelCount(Program.Q.Range) != 0) { CastQ(enemies, true); } } } if (menu.GetCheckboxValue("Use E")) { if (menu.GetCheckboxValue("Chain Barrels")) { CastEOnBestBarrelChainPosition(enemies, 1, true); } if (menu.GetCheckboxValue("Create First Barrel") && Gangplank.NearbyBarrelCount(Program.E.Range) == 0) { CastEOnBestPosition(enemies, 1, true); } } if (menu.GetCheckboxValue("Use R")) { CastR(enemies, 1, true); } if (menu.GetCheckboxValue("Use Ignite")) { CastIgnite(enemies, true); } if (menu.GetCheckboxValue("Use Items")) { CastItems(enemies, true); } if (menu.GetCheckboxValue("Auto-Attack Barrels if Q on cooldown") && (!Program.Q.IsReady() || !Program.Q.IsLearned) && Orbwalker.CanAutoAttack) { Barrel b = Calculations.getBestBarrel(enemies, false, 1, true); if (b != null && b.EHitNumber(enemies.Where(a => a.Health <= Calculations.E(a, false)).ToList()) >= 1) { Orbwalker.ForcedTarget = b.barrel; didActionThisTick = true; } } }
public static List <Barrel> ChainedBarrels(Barrel barrel) { return(Program.barrels.Where(a => barrel != null && a.barrel.MeetsCriteria() && a.barrel.IsInRange(barrel.barrel, Program.barrelDiameter)).ToList()); }