public static bool Check(string uniqueId, Spell spell, Obj_AI_Hero hero) { try { if (hero == null || !Enabled(uniqueId)) { return(true); } var bestTarget = TargetSelector.GetTarget(spell); if (bestTarget == null || hero.NetworkId.Equals(bestTarget.NetworkId)) { return(true); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } return(false); }
protected void ItemsSummonersLogic(Obj_AI_Hero ultimateTarget, bool single = true) { try { var range = Math.Max( 600, Math.Max( SummonerManager.SummonerSpells.Where(s => s.CastType == CastType.Target).Max(s => s.Range), ItemManager.Items.Where( i => i.EffectFlags.HasFlag(EffectFlags.Damage) && i.Flags.HasFlag(ItemFlags.Offensive)) .Max(i => i.Range))); if (ultimateTarget == null || Ultimate == null || !ultimateTarget.IsValidTarget(range)) { var target = TargetSelector.GetTarget(range); if (target != null) { if (ItemManager.CalculateComboDamage(target) + SummonerManager.CalculateComboDamage(target) > target.Health) { ItemManager.UseComboItems(target); SummonerManager.UseComboSummoners(target); } } } else { if (Ultimate.GetDamage(ultimateTarget, UltimateModeType.Combo, single ? 1 : 5) > ultimateTarget.Health) { ItemManager.UseComboItems(ultimateTarget); SummonerManager.UseComboSummoners(ultimateTarget); } } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public static void TargetSkill(Spell spell) { TargetSkill(TargetSelector.GetTarget(spell), spell); }
public static void SkillShot(Spell spell, HitChance hitChance, bool boundingRadius = true, bool maxRange = true) { SkillShot(TargetSelector.GetTarget(spell), spell, hitChance); }
protected override void Harass() { if (Menu.Item(Menu.Name + ".harass.q").GetValue <bool>() && Q.IsReady() && ResourceManager.Check("harass-q") && !Player.IsWindingUp && !Player.IsDashing()) { var target = TargetSelector.GetTarget(Q); if (target != null) { var prediction = Q.GetPrediction(target); if (prediction.Hitchance >= Q.GetHitChance("harass")) { Q.Cast(prediction.CastPosition); } else if (prediction.Hitchance == HitChance.Collision) { QCollisionCheck(target); } } } if (Menu.Item(Menu.Name + ".harass.e").GetValue <bool>() && E.IsReady() && ResourceManager.Check("harass-e")) { var target = TargetSelector.GetTarget(E, false); if (target != null && Rend.HasBuff(target)) { if (Rend.IsKillable(target, false)) { CastE(); } if (target.Distance(Player) > Orbwalking.GetRealAutoAttackRange(target)) { if ( GameObjects.EnemyMinions.Any( m => m.IsValidTarget(E.Range * 0.95f) && Rend.IsKillable(m, m.HealthPercent < 10))) { CastE(); } else { var dashObjects = GameObjects.EnemyMinions.Where( m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m))).ToList(); var minion = dashObjects.FirstOrDefault( m => m.Health > Player.GetAutoAttackDamage(m) * 1.1f && m.Health < Player.GetAutoAttackDamage(m) + Rend.GetDamage(m, 1)); if (minion != null) { Orbwalker.ForceTarget(minion); if (Orbwalking.CanAttack()) { ObjectManager.Player.IssueOrder(GameObjectOrder.AttackUnit, minion); } } } } else if (E.IsInRange(target)) { if (Rend.IsKillable(target, false)) { CastE(); } else { var buff = Rend.GetBuff(target); if (buff != null && buff.Count >= Menu.Item(Menu.Name + ".harass.e-min").GetValue <Slider>().Value) { if (target.Distance(Player) > E.Range * 0.8 && !target.IsFacing(Player) || buff.EndTime - Game.Time < 0.3) { CastE(); } } } } } } }