/// <summary> /// Cast the Q /// </summary> /// <param name="target"></param> private static void QCast(AIHeroClient target) { if (!Q.IsReady() || !target.IsValidTarget(Q.Range)) { return; } if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 0) { var pred = Q.GetPrediction(target); if (pred.Hitchance >= GetHitchance()) { Q.Cast(pred.CastPosition); } } if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 1) { var pred = CPrediction.Circle(Q, target, HitChance.VeryHigh, true); if (pred.TotalHits > 0) { Q.Cast(pred.CastPosition); } } else if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 2) { var predictionInput = new SebbyLib.Prediction.PredictionInput { Aoe = false, Collision = false, Speed = int.MaxValue, Delay = 0.7f, Range = 900f - 100f, From = Player.ServerPosition, Radius = 140f - 25f, Unit = target, Type = SebbyLib.Prediction.SkillshotType.SkillshotCircle }; var predictionOutput = SebbyLib.Prediction.Prediction.GetPrediction(predictionInput); if (predictionOutput.Hitchance == (SebbyLib.Prediction.HitChance)(6)) { Q.Cast(predictionOutput.CastPosition); } } }
/// <summary> /// Called when the game updates /// </summary> /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> private static void OnUpdate(EventArgs args) { try { if (Player.IsDead) { return; } switch (Orbwalker.ActiveMode) { case Orbwalking.OrbwalkingMode.Combo: OnCombo(); break; case Orbwalking.OrbwalkingMode.Mixed: OnHarass(); break; case Orbwalking.OrbwalkingMode.LaneClear: OnLaneclear(); break; } if (Menu.Item("Q.Automatically").GetValue <StringList>().SelectedIndex == 1 || (Menu.Item("Q.Automatically").GetValue <StringList>().SelectedIndex == 2 && ComboModeActive)) { if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 1) { var target = Q.GetTarget(); var pred = CPrediction.Circle(Q, target, HitChance.VeryHigh, true); if (pred.TotalHits >= 2 && Q.IsReady()) { Q.Cast(pred.CastPosition); LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast()); } } else if (Menu.Item("Prediction.type").GetValue <StringList>().SelectedIndex == 2) { var target = Q.GetTarget(); var predictionInput = new SebbyLib.Prediction.PredictionInput { Aoe = false, Collision = false, Speed = int.MaxValue, Delay = 0.7f, Range = 900f - 100f, From = Player.ServerPosition, Radius = 140f - 25f, Unit = target, Type = SebbyLib.Prediction.SkillshotType.SkillshotCircle }; var predictionOutput = SebbyLib.Prediction.Prediction.GetPrediction(predictionInput); if (predictionOutput.Hitchance == (SebbyLib.Prediction.HitChance)(6) && predictionOutput.AoeTargetsHitCount >= 2) { Q.Cast(predictionOutput.CastPosition); LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast()); } } else { var target = Q.GetTarget(); var pred = Q.GetPrediction(target); if (pred.AoeTargetsHitCount >= 2 && Q.IsReady()) { Q.Cast(pred.CastPosition); LeagueSharp.Common.Utility.DelayAction.Add(600, () => W.Cast()); } } } if (IsActive("ElZilean.Combo.Focus.Bomb")) { var passiveTarget = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget() && x.HasBuff("ZileanQEnemyBomb")); if (passiveTarget != null) { if (passiveTarget.IsValidTarget(Q.Range + 100)) { TargetSelector.SetTarget(passiveTarget); Orbwalker.ForceTarget(passiveTarget); } } } if (IsActive("ElZilean.Ignite")) { HandleIgnite(); } if (Menu.Item("ElZilean.DoubleBombMouse").GetValue <KeyBind>().Active) { MouseCombo(); } if (Menu.Item("ElZilean.Flee.Key").GetValue <KeyBind>().Active) { OnFlee(); } if (IsActive("ElZilean.E.Slow")) { foreach (var slowedAlly in HeroManager.Allies.Where(x => x.HasBuffOfType(BuffType.Slow) && x.IsValidTarget(Q.Range, false)) ) { if (E.IsReady() && E.IsInRange(slowedAlly)) { E.CastOnUnit(slowedAlly); } } } if (IsActive("ElZilean.Q.Stun")) { var target = HeroManager.Enemies.FirstOrDefault( h => h.IsValidTarget(Q.Range) && h.HasBuffOfType(BuffType.Slow) || h.HasBuffOfType(BuffType.Knockup) || h.HasBuffOfType(BuffType.Charm) || h.HasBuffOfType(BuffType.Stun)); if (target != null) { if (Q.IsReady() && target.IsValidTarget(Q.Range)) { QCast(target); LeagueSharp.Common.Utility.DelayAction.Add(100, () => W.Cast()); } } } foreach (var ally in HeroManager.Allies.Where(a => a.IsValidTarget(R.Range, false))) { if (!Menu.Item($"R{ally.ChampionName}").IsActive() || ally.IsRecalling() || ally.IsInvulnerable || !ally.IsValidTarget(R.Range, false)) { return; } var enemies = ally.CountEnemiesInRange(750f); var totalDamage = IncomingDamageManager.GetDamage(ally) * 1.1f; if (ally.HealthPercent <= Menu.Item("min-health").GetValue <Slider>().Value&& !ally.IsDead && enemies >= 1 && ally.IsValidTarget(R.Range, false)) { if ((int)(totalDamage / ally.Health) > Menu.Item("min-damage").GetValue <Slider>().Value || ally.HealthPercent < Menu.Item("min-health").GetValue <Slider>().Value) { if (ally.Buffs.Any(b => b.DisplayName == "judicatorintervention" || b.DisplayName == "undyingrage" || b.DisplayName == "kindredrnodeathbuff" || b.DisplayName == "zhonyasringshield" || b.DisplayName == "willrevive")) { return; } R.Cast(ally); } } } } catch (Exception exception) { Console.WriteLine(exception); } }