private static void SemiAutomaticE() { if (E.IsReady() && Config.Menu["Key"]["key.e"].GetValue <MenuKeyBind>().Active) { if (Config.Menu["Key"]["key.emode"].GetValue <MenuList>().Index == 1) { float lowest = 1600; Vector3 bPos = Vector3.Zero; foreach (Barrel barrel in AllBarrel) { if (barrel.GetBarrel().Distance(Game.CursorPos) < lowest) { bPos = barrel.GetBarrel().Position; lowest = barrel.GetBarrel().Distance(Game.CursorPos); } } if (lowest != 1600f) { E.Cast(bPos.Extend(Game.CursorPos, Math.Min(685, lowest))); } } else if (Config.Menu["Key"]["key.emode"].GetValue <MenuList>().Index == 2 && Q.IsReady()) { IEnumerable <Barrel> toExplode = AllBarrel.Where(b => b.CanQNow() && b.GetBarrel().Distance(Player) <= Q.Range); if (toExplode.Any()) { float lowest = 1600; Barrel bar = null; foreach (Barrel barrel in AllBarrel) { if (barrel.GetBarrel().Distance(Game.CursorPos) < lowest) { bar = barrel; lowest = barrel.GetBarrel().Distance(Game.CursorPos); } } if (bar != null) { E.Cast(bar.GetBarrel().Position.Extend(Game.CursorPos, Math.Min(685, lowest))); QDelay.Delay(bar.GetBarrel()); } } } } }
private static void InvokeTriplePlacement(Barrel connectingBarrel, IEnumerable <Barrel> hitTest) { if (!E.IsReady()) { return; } IEnumerable <AIHeroClient> invokedEnemies = GameObjects.EnemyHeroes.Where(e => e.Position.Distance(connectingBarrel.GetBarrel().Position) < 1370 && !hitTest.Any(b => b.GetBarrel().Position.Distance(e.Position) < 340)); foreach (AIHeroClient enemy in invokedEnemies) { //Nice Algorithm with Bad Coding Style following //DRY - Do Repeat Yourself Vector3 tryPosition = enemy.Position; if (tryPosition.Distance(connectingBarrel.GetBarrel().Position) <= 685 && tryPosition.Distance(Player.Position) <= 1000) { TriplePlacement(enemy, tryPosition); return; } tryPosition = Player.Position.ExtendToMaxRange(enemy.Position, 1000); if (tryPosition.Distance(connectingBarrel.GetBarrel().Position) <= 685) { TriplePlacement(enemy, tryPosition); return; } tryPosition = connectingBarrel.GetBarrel().Position.ExtendToMaxRange(enemy.Position, 685); if (tryPosition.Distance(Player.Position) <= 1000) { TriplePlacement(enemy, tryPosition); return; } List <Vector2> optimalPositions = Helper.IntersectCircles(Player.Position.ToVector2(), 995, connectingBarrel.GetBarrel().Position.ToVector2(), 680); if (optimalPositions.Count == 2) { TriplePlacement(enemy, optimalPositions[0].ToVector3().Distance(enemy.Position) < optimalPositions[1].ToVector3().Distance(enemy.Position) ? optimalPositions[0].ToVector3() : optimalPositions[1].ToVector3()); } } }
private static void OnProcessSpellCast(AIBaseClient sender, AIBaseClientProcessSpellCastEventArgs args) { if (sender.IsMe && args.Slot == SpellSlot.Q && E.IsReady(200) && args.Target.Name == "Barrel") { Barrel attackedBarrel = AllBarrel.Find(b => b.GetNetworkID() == args.Target.NetworkId); List <Barrel> barrelsInRange = GetBarrelsInRange(attackedBarrel).ToList(); if (Config.Menu["Combo"]["combo.triplee"].GetValue <MenuBool>().Enabled&& barrelsInRange.Any()) { //Triple-Logic foreach (Barrel barrel in barrelsInRange) { DelayAction.Add(Helper.GetQTime(args.Target.Position) - 100 - Game.Ping / 2, () => InvokeTriplePlacement(barrel, AllBarrel)); } foreach (var enemy in GameObjects.EnemyHeroes) { if (enemy.Position.Distance(args.Target.Position) >= 350 && !barrelsInRange.Any(b => b.GetBarrel().Distance(enemy) <= 350) && barrelsInRange.Any(b => b.GetBarrel().Distance(enemy) <= 850)) { DelayAction.Add(400 + Game.Ping / 2, () => ForceCast(enemy, barrelsInRange.First(b => b.GetBarrel().Distance(enemy) >= 350 && b.GetBarrel().Distance(enemy) <= 850).GetBarrel().Position)); } } } if (Config.Menu["Combo"]["combo.doublee"].GetValue <MenuBool>().Enabled&& attackedBarrel.GetBarrel().Distance(Player) >= 610) { //Double Logic foreach (var enemy in GameObjects.EnemyHeroes) { if (args.Target.Position.Distance(enemy.Position) >= 350 && args.Target.Position.Distance(enemy.Position) <= 850) { DelayAction.Add(200 + Game.Ping / 2, () => ForceCast(enemy, args.Target.Position)); } } } } }
private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (sender.IsMe && args.Slot == SpellSlot.Q && E.IsReady(200) && args.Target.Name == "Barrel") { Barrel attackedBarrel = AllBarrel.Find(b => b.GetNetworkID() == args.Target.NetworkId); List <Barrel> barrelsInRange = GetBarrelsInRange(attackedBarrel).ToList(); if (Config.Item("combo.triplee").GetValue <bool>() && barrelsInRange.Any()) { //Triple-Logic foreach (Barrel barrel in barrelsInRange) { LeagueSharp.Common.Utility.DelayAction.Add(Helper.GetQTime(args.Target.Position) - 100 - Game.Ping / 2, () => InvokeTriplePlacement(barrel, AllBarrel)); } //foreach (var enemy in HeroManager.Enemies) //{ // if (enemy.Position.Distance(args.Target.Position) >= 350 && // !barrelsInRange.Any(b => b.GetBarrel().Distance(enemy) <= 350) && // barrelsInRange.Any(b => b.GetBarrel().Distance(enemy) <= 850)) // { // LeagueSharp.Common.Utility.DelayAction.Add(400 + Game.Ping/2, () => ForceCast(enemy,barrelsInRange.First(b => b.GetBarrel().Distance(enemy) >= 350 && b.GetBarrel().Distance(enemy) <= 850).GetBarrel().Position)); // } //} } if (Config.Item("combo.doublee").GetValue <bool>() && attackedBarrel.GetBarrel().Distance(Player) >= 610) { //Double Logic foreach (var enemy in HeroManager.Enemies) { if (args.Target.Position.Distance(enemy.Position) >= 350 && args.Target.Position.Distance(enemy.Position) <= 850) { LeagueSharp.Common.Utility.DelayAction.Add(200 + Game.Ping / 2, () => ForceCast(enemy, args.Target.Position)); } } } } }
private static IEnumerable <Barrel> GetBarrelsInRange(Barrel initalBarrel) { return(AllBarrel.Where(b => b.GetBarrel().Position.Distance(initalBarrel.GetBarrel().Position) <= 685 && b != initalBarrel)); }
private static IEnumerable<Barrel> GetBarrelsInRange(Barrel initalBarrel) { return AllBarrel.Where(b => b.GetBarrel().Position.Distance(initalBarrel.GetBarrel().Position) <= 685 && b != initalBarrel); }