コード例 #1
0
        public void SpawnWave()
        {
            List <Rectangle2D> zones = new List <Rectangle2D>(SpawnZones);

            for (int j = 0; j < 2; j++)
            {
                Rectangle2D spawnrec = zones[Utility.Random(zones.Count)];
                zones.Remove(spawnrec);

                int count = Utility.RandomMinMax(WaveCountMin, WaveCountMax);
                List <BaseCreature> list = new List <BaseCreature>();

                for (int i = 0; i < count; i++)
                {
                    BaseCreature bc = Activator.CreateInstance(_SpawnTable[(int)InvasionType][Utility.Random(_SpawnTable[(int)InvasionType].Length)]) as BaseCreature;

                    bc.Kills = 100;

                    if (bc.FightMode == FightMode.Evil)
                    {
                        bc.FightMode = FightMode.Aggressor;
                    }

                    XmlSpawner2.XmlAttach.AttachTo(bc, new XmlSpawner2.XmlData("Notoriety", "red"));

                    if (SpawnMobile(bc, spawnrec))
                    {
                        list.Add(bc);
                    }
                    else
                    {
                        bc.Delete();
                    }
                }

                for (int i = 0; i < 3; i++)
                {
                    Invader invader = new Invader(InvasionType);

                    if (SpawnMobile(invader, spawnrec))
                    {
                        list.Add(invader);
                    }
                    else
                    {
                        invader.Delete();
                    }
                }

                InvaderCaptain capt = new InvaderCaptain(InvasionType);
                capt.Blessed = true;

                if (SpawnMobile(capt, spawnrec) || SpawnMobile(capt, new Rectangle2D(Defs[CurrentInvasion].BeaconLoc.X - 10, Defs[CurrentInvasion].BeaconLoc.Y - 10, 20, 20)))
                {
                    Spawn[capt] = list;
                }
            }
        }
コード例 #2
0
		public void SpawnWave()
		{
			List<Rectangle2D> zones = new List<Rectangle2D>(SpawnZones);

			for(int j = 0; j < 2; j++)
			{
				Rectangle2D spawnrec = zones[Utility.Random(zones.Count)];
				zones.Remove(spawnrec);

				int count = Utility.RandomMinMax(WaveCountMin, WaveCountMax);
                List<BaseCreature> list = new List<BaseCreature>();

				for(int i = 0; i < count; i++)
				{
                    BaseCreature bc = Activator.CreateInstance(_SpawnTable[(int)this.InvasionType][Utility.Random(_SpawnTable[(int)this.InvasionType].Length)]) as BaseCreature;

                    Server.Engines.XmlSpawner2.XmlAttach.AttachTo(bc, new Server.Engines.XmlSpawner2.XmlData("Notoriety", "red"));

                    if (SpawnMobile(bc, spawnrec))
                    {
                        list.Add(bc);
                    }
                    else
                    {
                        bc.Delete();
                    }
				}

                for (int i = 0; i < 3; i++)
                {
                    Invader invader = new Invader(this.InvasionType);

                    if (SpawnMobile(invader, spawnrec))
                    {
                        list.Add(invader);
                    }
                    else
                        invader.Delete();
                }

                InvaderCaptain capt = new InvaderCaptain(this.InvasionType);
                capt.Blessed = true;

                if (SpawnMobile(capt, spawnrec) || SpawnMobile(capt, new Rectangle2D(Defs[CurrentInvasion].BeaconLoc.X - 10, Defs[CurrentInvasion].BeaconLoc.Y - 10, 20, 20)))
                {
                    Spawn[capt] = list;
                }
			}
		}