Example #1
0
        private void SpawnRandomLiquor()
        {
            int         row = Utility.Random(4);
            Rectangle2D rec = SpawnRecs[Utility.Random(SpawnRecs.Length)];

            ConvertOffset(ref rec);

            int x = Utility.RandomMinMax(rec.X, rec.X + rec.Width);
            int y = Utility.RandomMinMax(rec.Y, rec.Y + rec.Height);
            int z = -14;

            x = x + (9 * row);

            ShadowguardBottleOfLiquor bottle = new ShadowguardBottleOfLiquor(this);

            bottle.MoveToWorld(new Point3D(x, y, z), Map.TerMur);

            Bottles.Add(bottle);
        }
Example #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Pirates = new List <Mobile>();
            Bottles = new List <ShadowguardBottleOfLiquor>();

            Wave = reader.ReadInt();

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                Mobile p = reader.ReadMobile();
                if (p != null)
                {
                    Pirates.Add(p);
                }
            }

            count = reader.ReadInt();
            for (int i = 0; i < count; i++)
            {
                ShadowguardBottleOfLiquor b = reader.ReadItem() as ShadowguardBottleOfLiquor;
                if (b != null)
                {
                    Bottles.Add(b);
                }
            }

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

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