public SpawnerTarget(List <Spawner> spawnerMemory, ChampEngine champ, int toReplace)
     : base(-1, true, TargetFlags.None)
 {
     m_SpawnerMemory = spawnerMemory;
     m_Champ         = champ;
     m_toReplace     = toReplace;
 }
Пример #2
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;
            }
            }
        }
        //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)
 {
 }