Пример #1
0
        protected virtual void AddHelper(BaseCreature bc, bool initial)
        {
            if (initial)
            {
                if (InitialSpawn == null)
                {
                    InitialSpawn = new List <BaseCreature>();
                }

                if (!InitialSpawn.Contains(bc))
                {
                    InitialSpawn.Add(bc);
                }
            }
            else
            {
                if (SummonedHelpers == null)
                {
                    SummonedHelpers = new List <BaseCreature>();
                }

                if (!SummonedHelpers.Contains(bc))
                {
                    SummonedHelpers.Add(bc);
                }
            }
        }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            SpawnLocation = reader.ReadPoint3D();

            int count = reader.ReadInt();

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

                    if (summon != null)
                    {
                        if (SummonedHelpers == null)
                        {
                            SummonedHelpers = new List <BaseCreature>();
                        }

                        SummonedHelpers.Add(summon);
                    }
                }
            }

            count = reader.ReadInt();

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

                    if (summon != null)
                    {
                        if (InitialSpawn == null)
                        {
                            InitialSpawn = new List <BaseCreature>();
                        }

                        InitialSpawn.Add(summon);
                    }
                }
            }

            _NextSpecial = DateTime.UtcNow;
        }