Ejemplo n.º 1
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
				{	// all done
					break;
				}

				case 1:
				{
					m_ChampionSpawn = reader.ReadItem() as ChampInvasion; // pla :changed to invasion class
					m_bChampDeadHandled = reader.ReadBool();
					m_bChampComplete = reader.ReadBool();
					goto case 0;
				}
			}
		}
Ejemplo n.º 2
0
		public override void OnEventStartInit()
		{
			// speed up announcements!
			AnnounceDelta = TimeSpan.FromMinutes( 5.0 ); //	every 5 minutes

			foreach (Item ix in World.Items.Values)
			{
				if (ix is ChampInvasion)
				{
					ChampInvasion cs = ix as ChampInvasion;
					if (cs != null )
					{
						m_ChampionSpawn = cs;

						// basic setup
						m_ChampionSpawn.NavPoint = NavDestinations.Britan;	// Britan invasion
						m_ChampionSpawn.PickChamp();										// pick a new random champ type
						
						// old stuff!
						//m_ChampionSpawn.SpawnRange = 30;					// spawn range from spawner						
						//Pla : Changed this to reflect new enum mode of operation for champ spawns
						//m_ChampionSpawn.RandomizeType = true;				// want random
						//m_ChampionSpawn.SpawnMode = ChampionSpawnMode.Random;						
						//m_ChampionSpawn.Type =							// invasion type
						//ChampionSpawnType.VerminHorde;
						// timing
						//m_ChampionSpawn.RestartDelay;		// placeholder
						//m_ChampionSpawn.RestartTime;		// read-only
						//m_ChampionSpawn.ExpireDelay; 		// placeholder
						//m_ChampionSpawn.ExpireTime;  		// placeholder

						// turn off guards
						Region town = Region.GetByName("Britain", Map.Felucca);			// Britain specific
						GuardedRegion reg = town as GuardedRegion;
						if (reg != null)
							reg.IsGuarded = false;

						// tell the champ spawn that we would like to know what's going on
						m_ChampionSpawn.Monitor = this;

						// let the fun begin!
						m_ChampionSpawn.Active = true;		// start the creatures;

						break;								// we only support on invasion at this time
					}
				}
			}

			if (m_ChampionSpawn == null)
			{
				Console.WriteLine("TownInvasionAES: No appropriate Champion Spawn found, aborting event..");
				// tell our base class to stop processing.
				//	the base will also begin cleanup
				ValidState = false;
			}
			else
			{
				string line = String.Format("The Britain guards are nowhere to be found.");	
				World.Broadcast( 0x22, true, line );						// tell the world
			}

			Console.WriteLine("TownInvasionAES: Start event.");
		}