Пример #1
0
 public void AddShadowguardCanal(Item canal)
 {
     if (ShadowguardCanals != null && !ShadowguardCanals.Contains(canal))
     {
         ShadowguardCanals.Add(canal);
     }
 }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Elementals = new List <BaseCreature>();

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                BaseCreature bc = reader.ReadMobile() as BaseCreature;

                if (bc != null)
                {
                    Elementals.Add(bc);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                if (ShadowguardCanals == null)
                {
                    ShadowguardCanals = new List <Item>();
                }

                Item canal = reader.ReadItem();

                if (canal != null)
                {
                    ShadowguardCanals.Add(canal);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                if (FlowCheckers == null)
                {
                    FlowCheckers = new List <FlowChecker>();
                }

                FlowCheckers.Add(new FlowChecker(reader, this));
            }

            if (Elementals == null || Elementals.Count < 8)
            {
                int toSpawn = Elementals == null ? 8 : 8 - Elementals.Count;

                for (int i = 0; i < toSpawn; i++)
                {
                    SpawnRandomElemental();
                }
            }
        }