Пример #1
0
        private static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            if (sender.Type != GameObjectType.obj_AI_Minion)
            {
                return;
            }

/*
 *          if(!sender.Name.ToLower().StartsWith("minion"))
 *          {
 *              Console.WriteLine(sender.Name.ToLower() + " Team: " + sender.Team.ToString());
 *
 *          }
 */

            var mob =
                JungleCreeps.FirstOrDefault(
                    x => x.MobNames.Select(y => y.ToLower()).Any(z => z.Equals(sender.Name.ToLower())));

            if (mob == null)
            {
                return;
            }

            mob.ObjectsAlive.Add(sender.Name);
            mob.ObjectsDead.Remove(sender.Name);

            if (mob.ObjectsAlive.Count != mob.MobNames.Length)
            {
                return;
            }

            mob.Dead            = false;
            mob.NextRespawnTime = 0;
        }
Пример #2
0
        private static void GameObject_OnDelete(GameObject sender, EventArgs args)
        {
            if (sender.Type != GameObjectType.obj_AI_Minion)
            {
                return;
            }

            var mob =
                JungleCreeps.FirstOrDefault(
                    x => x.MobNames.Select(y => y.ToLower()).Any(z => z.Equals(sender.Name.ToLower())));

            if (mob == null)
            {
                return;
            }

            mob.ObjectsDead.Add(sender.Name);
            mob.ObjectsAlive.Remove(sender.Name);

            if (mob.ObjectsDead.Count != mob.MobNames.Length)
            {
                return;
            }

            mob.Dead            = true;
            mob.NextRespawnTime = Environment.TickCount + mob.RespawnTime - 3000;
        }