/// <summary> /// Games the object_ on create. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> private static void GameObject_OnCreate(GameObject sender, EventArgs args) { if (sender.Type != GameObjectType.obj_AI_Minion) { return; } var camp = JungleCamps.FirstOrDefault( x => x.MobNames.Select(y => y.ToLower()).Any(z => z.Equals(sender.Name.ToLower()))); if (camp == null) { return; } camp.ObjectsAlive.Add(sender.Name); camp.ObjectsDead.Remove(sender.Name); if (camp.ObjectsAlive.Count != camp.MobNames.Length) { return; } camp.Dead = false; camp.NextRespawnTime = 0; }
/// <summary> /// Games the object_ on delete. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="System.EventArgs" /> instance containing the event data.</param> private void GameObject_OnDelete(GameObject sender, EventArgs args) { if (sender.Type != GameObjectType.obj_AI_Minion) { return; } var camp = JungleCamps.FirstOrDefault( x => x.MobNames.Select(y => y.ToLower()).Any(z => z.Equals(sender.Name.ToLower()))); if (camp == null) { return; } camp.ObjectsDead.Add(sender.Name); camp.ObjectsAlive.Remove(sender.Name); if (camp.ObjectsDead.Count != camp.MobNames.Length && camp.MobsAreChildren) { return; } camp.Dead = true; camp.NextRespawnTime = Game.Time + camp.RespawnTime / 1000f - 3; CampDied?.Invoke(this, camp); }
private static void GameObject_OnDelete(GameObject sender, EventArgs args) { if (!sender.Name.StartsWith(Game.MapId == GameMapId.SummonersRift ? "SRU" : "TT")) { return; } if (Root["enabled"].GetValue <bool>() == false) { return; } if (sender.ObjectType != GameObjectType.obj_AI_Minion) { return; } var camp = JungleCamps.FirstOrDefault( x => x.MobNames.Select(y => y.ToLower()).Any(z => z.Equals(sender.Name.ToLower()))); if (camp == null) { return; } camp.ObjectsDead.Add(sender.Name); camp.ObjectsAlive.Remove(sender.Name); if (camp.ObjectsDead.Count == camp.MobNames.Length) { camp.Dead = true; camp.NextRespawnTime = Environment.TickCount + camp.RespawnTime - 3000; } }
private static void UpdateCamps(int networkID, int campID, byte emptyType) { if (emptyType != 3) { JungleCamps jungleCamp = GetJungleCampByID(campID); if (jungleCamp != null) { jungleCamp.nextRespawnTime = (int)Game.Time + jungleCamp.respawnTime; } } }
public static JungleCamp ClosestCamp(this Unit unit) { return(JungleCamps.FindClosestCamp(unit.Position)); }
private static JungleCamps CheckMeepo(Meepo clone) { var a = new JungleCamps(); return JungleCamps.Where(x => x.meepos != null).Aggregate(a, (current, x) => (x.meepos.Handle == clone.Handle ? x : current)); }
/// <summary> /// The closest camp. /// </summary> /// <param name="entity"> /// The entity. /// </param> /// <returns> /// The <see cref="JungleCamp" />. /// </returns> public static JungleCamp ClosestCamp(this Entity entity) { return(JungleCamps.FindClosestCamp(entity.Position)); }
public void OnLoad() { hero = ObjectManager.LocalHero; heroTeam = hero.Team; jungleCamps = new JungleCamps(heroTeam); Camp.DisplayOverlay = menu.IsEnabled; Camp.Debug = Controllable.Debug = menu.IsDebugEnabled; controllableUnits.Add(new Controllable(hero, true)); sleeper = new Sleeper(); }