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); }