/// <summary> /// Returns whether the hero is in fountain range. /// </summary> /// <param name="hero">The Hero</param> /// <returns>Is Hero in fountain range</returns> public static bool InFountain(this Obj_AI_Hero hero) { float fountainRange = 562500; // 750 * 750 if (Game.MapId == GameMapId.SummonersRift) { fountainRange = 1102500; // 1050 * 1050 } return(hero.IsVisible && GameObjects.AllySpawnPoints.Any(sp => hero.DistanceSquared(sp.Position) < fountainRange)); }
/// <summary> /// Determines whether [is valid target] [the specified hero]. /// </summary> /// <param name="hero">The hero.</param> /// <param name="range">The range.</param> /// <param name="damageType">Type of the damage.</param> /// <param name="ignoreShields">if set to <c>true</c> [ignore shields].</param> /// <param name="from">From.</param> /// <returns></returns> private bool IsValidTarget( Obj_AI_Hero hero, float range, DamageType damageType, bool ignoreShields = true, Vector3 from = default(Vector3)) { return(hero.IsValidTarget() && hero.DistanceSquared(@from.Equals(default(Vector3)) ? GameObjects.Player.ServerPosition : @from) < Math.Pow(range <= 0 ? hero.GetRealAutoAttackRange() : range, 2) && !Invulnerable.Check(hero, damageType, ignoreShields)); }
/// <summary> /// Returns whether the hero is in fountain range. /// </summary> /// <param name="hero">The Hero</param> /// <returns>Is Hero in fountain range</returns> public static bool InFountain(this Obj_AI_Hero hero) { float fountainRange = 562500; // 750 * 750 var map = Map.GetMap(); if (map != null && map.Type == MapType.SummonersRift) { fountainRange = 1102500; // 1050 * 1050 } return(hero.IsVisible && GameObjects.AllySpawnPoints.Any(sp => hero.DistanceSquared(sp.Position) < fountainRange)); }
/// <summary> /// Returns whether the hero is in fountain range. /// </summary> /// <param name="hero">Hero</param> /// <returns>Is Hero in fountain range</returns> public static bool InFountain(this Obj_AI_Hero hero) { float fountainRange = 562500; //750 * 750 var map = Map.GetMap(); if (map != null && map.Type == MapType.SummonersRift) { fountainRange = 1102500; //1050 * 1050 } return(hero.IsVisible && ObjectHandler.GetFast <Obj_SpawnPoint>() .Any(sp => sp.Team == hero.Team && hero.DistanceSquared(sp.Position) < fountainRange)); }
/// <summary> /// Returns whether the hero is in shop range. /// </summary> /// <param name="hero">The Hero</param> /// <returns>Is Hero in shop range</returns> public static bool InShop(this Obj_AI_Hero hero) { return(hero.IsVisible && GameObjects.AllyShops.Any(s => hero.DistanceSquared(s.Position) < 1562500)); }
/// <summary> /// Returns whether the hero is in shop range. /// </summary> /// <param name="hero">Hero</param> /// <returns>Is Hero in shop range</returns> public static bool InShop(this Obj_AI_Hero hero) { return(hero.IsVisible && ObjectHandler.GetFast <Obj_Shop>() .Any(s => s.Team == hero.Team && hero.DistanceSquared(s.Position) < 1562500)); // 1250² }
/// <summary> /// Determines whether [is valid target] [the specified hero]. /// </summary> /// <param name="hero"> /// The hero. /// </param> /// <param name="range"> /// The range. /// </param> /// <param name="damageType"> /// Type of the damage. /// </param> /// <param name="ignoreShields"> /// Indicates whether to ignore shields. /// </param> /// <param name="from">The from location.</param> /// <returns> /// The <see cref="bool" />. /// </returns> private static bool IsValidTarget( Obj_AI_Hero hero, float range, DamageType damageType, bool ignoreShields = true, Vector3 from = default(Vector3)) { return hero.IsValidTarget() && hero.DistanceSquared(@from.Equals(default(Vector3)) ? GameObjects.Player.ServerPosition : @from) < Math.Pow(range <= 0 ? hero.GetRealAutoAttackRange() : range, 2) && !Invulnerable.Check(hero, damageType, ignoreShields); }