Ejemplo n.º 1
0
		public ChampPlatform( bool bQuiet, ChampEngine spawn )
		{
			m_Spawn = spawn;
			m_quiet = bQuiet;

			for ( int x = -2; x <= 2; ++x )
				for ( int y = -2; y <= 2; ++y )
					AddComponent( 0x750, x, y, -5 );

			for ( int x = -1; x <= 1; ++x )
				for ( int y = -1; y <= 1; ++y )
					AddComponent( 0x750, x, y, 0 );

			for ( int i = -1; i <= 1; ++i )
			{
				AddComponent( 0x751, i, 2, 0 );
				AddComponent( 0x752, 2, i, 0 );

				AddComponent( 0x753, i, -2, 0 );
				AddComponent( 0x754, -2, i, 0 );
			}

			AddComponent( 0x759, -2, -2, 0 );
			AddComponent( 0x75A, 2, 2, 0 );
			AddComponent( 0x75B, -2, 2, 0 );
			AddComponent( 0x75C, 2, -2, 0 );
		}
Ejemplo n.º 2
0
 public ChampAltar(bool bQuiet, ChampEngine spawn)
     : base(bQuiet)
 {
     m_Spawn = spawn;
     m_quiet = bQuiet;
     Visible = true;
 }
Ejemplo n.º 3
0
        public ChampPlatform(bool bQuiet, ChampEngine spawn)
        {
            m_Spawn = spawn;
            m_quiet = bQuiet;

            for (int x = -2; x <= 2; ++x)
            {
                for (int y = -2; y <= 2; ++y)
                {
                    AddComponent(0x750, x, y, -5);
                }
            }

            for (int x = -1; x <= 1; ++x)
            {
                for (int y = -1; y <= 1; ++y)
                {
                    AddComponent(0x750, x, y, 0);
                }
            }

            for (int i = -1; i <= 1; ++i)
            {
                AddComponent(0x751, i, 2, 0);
                AddComponent(0x752, 2, i, 0);

                AddComponent(0x753, i, -2, 0);
                AddComponent(0x754, -2, i, 0);
            }

            AddComponent(0x759, -2, -2, 0);
            AddComponent(0x75A, 2, 2, 0);
            AddComponent(0x75B, -2, 2, 0);
            AddComponent(0x75C, 2, -2, 0);
        }
Ejemplo n.º 4
0
 public ChampSliceTimer(ChampEngine spawn)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Spawn = spawn;
     // update spawn every second
     Priority = TimerPriority.OneSecond;
 }
Ejemplo n.º 5
0
        private int m_AltarHue;                         // allows different base hues

        // ctor
        public ChampGraphics(ChampEngine champ)
        {
            // Create new objects
            m_Champ            = champ;
            m_Platform         = new ChampPlatform(false, m_Champ);
            m_Altar            = new ChampAltar(false, m_Champ);
            m_RedSkulls        = new ArrayList();
            m_WhiteSkulls      = new ArrayList();
            m_Platform.Visible = true;
            m_Altar.Visible    = true;
            m_AltarHue         = 0;
            // move to location of champ spawn
            UpdateLocation();
        }
Ejemplo n.º 6
0
		private int m_AltarHue;						// allows different base hues

		// ctor 
		public ChampGraphics( ChampEngine champ )
		{
			// Create new objects
			m_Champ = champ;
			m_Platform = new ChampPlatform(false, m_Champ );
			m_Altar = new ChampAltar(false, m_Champ );
			m_RedSkulls = new ArrayList();
			m_WhiteSkulls = new ArrayList();
			m_Platform.Visible = true;
			m_Altar.Visible = true;			
			m_AltarHue = 0;
			// move to location of champ spawn
			UpdateLocation();
        }
Ejemplo n.º 7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Spawn = reader.ReadItem() as ChampEngine;

                if (m_Spawn == null)
                {
                    Delete();
                }

                break;
            }
            }
        }
Ejemplo n.º 8
0
        // Cosntructor called from ChampEngie.Deserialize() to recreate gfx
        public ChampGraphics(ChampEngine champ, GenericReader reader)
        {
            int ver = reader.ReadInt();

            switch (ver)
            {
            case 0:
            {
                //Alows re-creation of serialised graphics
                m_Champ       = champ;
                m_Platform    = reader.ReadItem() as ChampPlatform;
                m_Altar       = reader.ReadItem() as ChampAltar;
                m_RedSkulls   = reader.ReadItemList();
                m_WhiteSkulls = reader.ReadItemList();
                m_AltarHue    = reader.ReadInt();
                //rehue
                m_Altar.Hue = m_AltarHue;
                break;
            }
            }
        }
Ejemplo n.º 9
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Spawn = reader.ReadItem() as ChampEngine;

					if ( m_Spawn == null )
						Delete();

					break;
				}
			}
		}
Ejemplo n.º 10
0
		public ChampAltar( bool bQuiet, ChampEngine spawn ) : base( bQuiet )
		{
			m_Spawn = spawn;
			m_quiet = bQuiet;
			Visible =  true;
		}
Ejemplo n.º 11
0
			public ChampRestartTimer( ChampEngine spawn, TimeSpan delay ) : base( delay )
			{
				m_Spawn = spawn;
				Priority = TimerPriority.FiveSeconds;
			}
Ejemplo n.º 12
0
        // Cosntructor called from ChampEngie.Deserialize() to recreate gfx
		public ChampGraphics( ChampEngine champ, GenericReader reader )
		{	
			int ver = reader.ReadInt();

			switch( ver )
			{
				case 0 :
				{
					//Alows re-creation of serialised graphics		
					m_Champ = champ;
					m_Platform = reader.ReadItem() as ChampPlatform;			
					m_Altar = reader.ReadItem() as ChampAltar;			
					m_RedSkulls = reader.ReadItemList();
					m_WhiteSkulls = reader.ReadItemList();				
					m_AltarHue = reader.ReadInt();
					//rehue
					m_Altar.Hue = m_AltarHue;
					break;
				}
			}
		}
		//Ctor to continue an prevoius gump's state
		public ChampMobileFactoryGump(ChampEngine champSpawner, List<Spawner> memory)
			: base(50, 50)
		{
			m_ChampSpawn = champSpawner;

			//If a previous state was passed, restore it, else create a new memory list
			if (memory == null)
			{
				m_SpawnerMemory = new List<Spawner>();
				//Populate memory list with contents of the champ spawn's item collection
				foreach (Item i in m_ChampSpawn.Items)
					if (i is Spawner)
						m_SpawnerMemory.Add(i as Spawner);
			}
			else
			{
				m_SpawnerMemory = memory;
			}

			AddPage(0);

			AddBackground(0, 0, 348, 350, 5054);

			AddLabel(85, 1, 0, "Mobile Factory Spawner List");

			AddButton(310, 325, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
			AddLabel(272, 325, 0x384, "Cancel");

			AddButton(140, 325, 0xFBD, 0xFBF, 2, GumpButtonType.Reply, 0);
			AddLabel(173, 325, 0x384, "Refresh");

			AddButton(5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
			AddLabel(38, 325, 0x384, "Okay");

			for (int i = 0; i < 13; i++)
			{
				AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 4), GumpButtonType.Reply, 0);		//Add
				AddButton(38, (22 * i) + 20, 0xFB1, 0xFB3, 5 + (i * 4), GumpButtonType.Reply, 0);		//Delete

				//If a spawner with this index exists and the mobile is not on the internal map then add a selected button
				if (i < m_SpawnerMemory.Count && (m_SpawnerMemory[i].TemplateMobile != null && m_SpawnerMemory[i].TemplateMobile.Map != Map.Internal))
					AddButton(71, (22 * i) + 20, 0xFA9, 0xFAA, 6 + (i * 4), GumpButtonType.Reply, 0);		//Show/hide template mobile (selected)
				//Else just add the normal button
				else
					AddButton(71, (22 * i) + 20, 0xFA8, 0xFAA, 6 + (i * 4), GumpButtonType.Reply, 0);		//Show/hide template mobile
				
				AddButton(310, (22 * i) + 20, 0xFAB, 0xFAD, 7 + (i * 4), GumpButtonType.Reply, 0);	//view spawner properties

				AddImageTiled(108, (22 * i) + 20, 199, 23, 0x52);
				AddImageTiled(108, (22 * i) + 21, 197, 21, 0xBBC);

				string str = string.Empty;
							
				//read the spawner data from the memory list
				if (i < m_SpawnerMemory.Count)
				{
					str = m_SpawnerMemory[i].Serial + " ";
					if (m_SpawnerMemory[i].TemplateMobile != null)
						str += m_SpawnerMemory[i].TemplateMobile.GetType().Name;
				}
				
				AddLabel(112, (22 * i) + 21,0, str);
			}
		}
		//Base ctor for new gump
		public ChampMobileFactoryGump(ChampEngine spawner)
			: this(spawner, null)
		{

		}
			public SpawnerTarget(List<Spawner> spawnerMemory, ChampEngine champ, int toReplace)
				: base(-1, true, TargetFlags.None)
			{
				m_SpawnerMemory = spawnerMemory;
				m_Champ = champ;
				m_toReplace = toReplace;
			}
Ejemplo n.º 16
0
 public ChampRestartTimer(ChampEngine spawn, TimeSpan delay)
     : base(delay)
 {
     m_Spawn  = spawn;
     Priority = TimerPriority.FiveSeconds;
 }
Ejemplo n.º 17
0
			public ChampSliceTimer( ChampEngine spawn ) : base( TimeSpan.FromSeconds( 1.0 ),  TimeSpan.FromSeconds( 1.0 ) )
			{
				m_Spawn = spawn;
				// update spawn every second
				Priority = TimerPriority.OneSecond;
			}
Ejemplo n.º 18
0
//		public static void Initialize()
//		{
//			Commands.Register( "ChampAdmin", AccessLevel.GameMaster, new CommandEventHandler( ChampAdmin_OnCommand ) );
//		}

//		[Usage( "ChampAdmin" )]
//		[Description( "Opens an interface providing access to all Champion Spawn settings." )]
//		public static void ChampAdmin_OnCommand( CommandEventArgs e )
//		{
//			e.Mobile.SendGump( new ChampGump( e.Mobile, ChampGumpPage.SpawnLevels, 0, null, null, null ) );
//		}

//		public static int GetHueFor( Mobile m )
//		{
//			if ( m == null )
//				return LabelHue;
//
//			switch ( m.AccessLevel )
//			{
//				case AccessLevel.Owner: return 0x35;
//				case AccessLevel.Administrator: return 0x516;
//				case AccessLevel.Seer: return 0x144;
//				case AccessLevel.GameMaster: return 0x21;
//				case AccessLevel.Counselor: return 0x2;
//				case AccessLevel.FightBroker: return 0x8AB;
//				case AccessLevel.Reporter: return 0x979;
//				case AccessLevel.Player: default:
//				{
//					if ( m.Kills >= 5 )
//						return 0x21;
//					else if ( m.Criminal )
//						return 0x3B1;
//
//					return 0x58;
//				}
//			}
//		}
//
////		private static string[] m_AccessLevelStrings = new string[]
////			{
////				"Player",
////				"Counselor",
////				"Game Master",
////				"Seer",
////				"Administrator"
////			};
////
////		public static string FormatAccessLevel( AccessLevel level )
////		{
////			int v = (int)level;
////
////			if ( v >= 0 && v < m_AccessLevelStrings.Length )
////				return m_AccessLevelStrings[v];
////
////			return "Unknown";
////		}
//
		public ChampGump( Mobile from, ChampEngine spawn, ChampGumpPage pageType ) : base( 50, 40 )
		{
			from.CloseGump( typeof( ChampGump ) );

			m_From = from;
			m_Spawn = spawn;
			m_PageType = pageType;
			//m_ListPage = 0;
			//m_State = null;
			//m_List = null;

			AddPage( 0 );

			AddBackground( 0, 0, 420, 440, 5054 );

			AddBlackAlpha( 10, 10, 170, 100 );
			AddBlackAlpha( 190, 10, 220, 100 );
			AddBlackAlpha( 10, 120, 400, 260 );
			AddBlackAlpha( 10, 390, 400, 40 );

			//AddPageButton( 10, 10, GetButtonID( 0, 0 ), "Spawn and Loot Levels", ChampGumpPage.SpawnAndLootLevels );
            //pla: changed this as removed spawn amounts 
            AddPageButton(10, 10, GetButtonID(0, 0), "Loot Levels", ChampGumpPage.SpawnAndLootLevels);

//			if ( notice != null )
//				AddHtml( 12, 392, 396, 36, Color( notice, LabelColor32 ), false, false );

			int paramwidth = 250;
			int valuewidth = 50;
			int paramx = 12;
			int valuemin = paramx + paramwidth + 2;
			int valuemax = valuemin + valuewidth + 2;
			int y = 128;
			int height = 20;

			switch ( pageType )
			{
				case ChampGumpPage.SpawnAndLootLevels:
				{
					// Spawn Levels
                   
					AddLabelCropped(paramx, y, paramwidth, height, LabelHue, "Spawn Level" );
					y += (height+2);

					AddLabelCropped(paramx, y, paramwidth, height, LabelHue, "Amount of Spawn for Level 1" );
					AddTextField(valuemax, y, valuewidth, height, 0, string.Format("{0}", CoreChamp.Level1SpawnAmount));
					y += (height+2);
					
					AddLabelCropped(paramx, y, paramwidth, height, LabelHue, "Amount of Spawn for Level 2" );
					AddTextField(valuemax, y, valuewidth, height, 1, string.Format("{0}", CoreChamp.Level2SpawnAmount));
					y += (height+2);

					AddLabelCropped(paramx, y, paramwidth, height, LabelHue, "Amount of Spawn for Level 3" );
					AddTextField(valuemax, y, valuewidth, height, 2, string.Format("{0}", CoreChamp.Level3SpawnAmount));
					y += (height+2);

					AddLabelCropped(paramx, y, paramwidth, height, LabelHue, "Amount of Spawn for Level 4" );
					AddTextField(valuemax, y, valuewidth, height, 3, string.Format("{0}", CoreChamp.Level4SpawnAmount));
					y += (2*height+2);
                    
					// Loot	Levels
					AddLabelCropped( valuemin, y, valuewidth, height, LabelHue, "Min" );
					AddLabelCropped( valuemax, y, valuewidth, height, LabelHue, "Max" );
					y += (height+2);

					AddLabelCropped( paramx, y, paramwidth, height, LabelHue, "Magic Loot Level (1=Ruin, 5=Vanq)" );
					AddTextField( valuemin, y, valuewidth, height, 4, string.Format("{0}", CoreChamp.MinMagicDropLevel));
					AddTextField( valuemax, y, valuewidth, height, 5, string.Format("{0}", CoreChamp.MaxMagicDropLevel));
					y += (height+2);
					
					AddLabelCropped( paramx, y, paramwidth, height, LabelHue, "Amount Of Magic Items to Drop" );
					AddTextField( valuemax, y, valuewidth, height, 6, string.Format("{0}", CoreChamp.AmountOfMagicLoot));
					y += (2*height+2);

					AddButtonLabeled( paramx, y, GetButtonID( 1, 0 ), "Set" );

					break;
				}
				default:
				{
					//Huh?
					break;
				}
			}
		}