Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private static void OnDelete(GameObject obj, EventArgs args)
        {
            if (obj.Type != GameObjectType.AIMinionClient)
            {
                return;
            }

            var camp = jungleCamps.FirstOrDefault(x => x.Names.Select(y => y.ToLower()).Any(z => z.Equals(obj.Name.ToLower())));

            if (camp == null)
            {
                return;
            }

            camp.ObjectsDead.Add(obj.Name);
            camp.ObjectsAlive.Remove(obj.Name);

            if (camp.ObjectsDead.Count != camp.Names.Length && camp.ChildrenMobs)
            {
                return;
            }

            camp.Dead            = true;
            camp.NextRespawnTime = Game.Time + camp.RespawnTime / 1000f - 3;
            CampDied?.Invoke(obj, camp);
        }