public PCMoongateToll2Gump( Item gate, CityManagementStone outgoingCity, Point3D locdes, Map mapdes ) : base( 50, 50 )
		{
			m_Gate = gate;
			m_Outgoing = outgoingCity;
			m_LocDes = locdes;
			m_MapDes = mapdes;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			int incomingTax = 0;
			int outgoingTax = 0;

			if ( outgoingCity != null && outgoingCity.TravelTax >= 1 )
				outgoingTax = outgoingCity.TravelTax;

			int totalTax = incomingTax + outgoingTax;

			AddBackground(23, 27, 276, 269, 5120);
			AddImageTiled(28, 57, 269, 7, 5121);
			AddHtml( 32, 33, 259, 19, @"<BASEFONT COLOR= WHITE><CENTER>Travel Tax Report</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddHtml( 32, 64, 258, 100, @"<CENTER><B>Taxes Info</B></CENTER><BR><BR>You are being taxed for this trip, This total below includes your incoming and outgoing fees, Incoming fees are taxes for the city you are entering, Outgoing fees are taxes for the city you are leaving, You have to pay these taxes each time you enter or leave a player city if that city has a travel tax in place.", (bool)true, (bool)true);
			AddLabel(35, 170, 1149, @"Incoming Tax: " + incomingTax.ToString() );
			AddLabel(35, 190, 1149, @"Outgoing Tax: " + outgoingTax.ToString() );
			AddLabel(35, 210, 1149, @"Total Amount: " + totalTax.ToString() );
			AddImageTiled(28, 235, 269, 7, 5121);
			AddLabel(86, 235, 1149, @"Do you wish to continue?");
			AddButton(89, 260, 247, 248, 1, GumpButtonType.Reply, 0);
			AddButton(165, 260, 241, 242, 2, GumpButtonType.Reply, 0);

		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			m_stone = (CityManagementStone)reader.ReadItem();
		}
		public ViewInvitedWarsGump( CityManagementStone stone, int listPage, ArrayList list, ArrayList count ) : base( 50, 50 )
		{
			m_Stone = stone;
         		m_List = list;
         		m_ListPage = listPage;   
         		m_CountList = count;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(18, 15, 336, 243, 5120);
			AddImageTiled(25, 20, 323, 196, 2702);
			AddImageTiled(30, 24, 314, 187, 2604);
			AddAlphaRegion(25, 20, 323, 195);

         		if ( m_List == null )
			{
				ArrayList cities = m_Stone.WarsInvited;
				ArrayList a = new ArrayList();

				foreach ( Item i in cities )
				{
					a.Add( i );
				}

				m_List = a;
			}

         		if ( listPage > 0 )
			{
				AddButton(30, 223, 4014, 4015, 1, GumpButtonType.Reply, 0);
				AddLabel(66, 223, 1149, @"Last Page");
			}

         		if ( (listPage + 1) * 7 < m_List.Count )
			{
				AddButton(145, 223, 4005, 4006, 2, GumpButtonType.Reply, 0);
				AddLabel(182, 224, 1149, @"Next Page");
			}

         		int k = 0;

         		for ( int i = 0, j = 0, index=((listPage*7)+k) ; i < 7 && index >= 0 && index < m_List.Count && j >= 0; ++i, ++j, ++index )
         		{
            			Item item = m_List[index] as Item;
				
				if ( item is CityManagementStone )
				{
					CityManagementStone citystone = (CityManagementStone)item;

					int offset = 30 + ( i * 25 );

					AddButton(35, offset, 4017, 4018, 100 + index, GumpButtonType.Reply, 0);
					AddButton(70, offset, 4029, 4030, 1000 + index, GumpButtonType.Reply, 0);
					AddLabel(105, offset, 1149, citystone.CityName.ToString() );
				}
			}
		}
		public SponsorGump( CityManagementStone stone, Mobile from ) : base( 50, 50 )
		{
			m_Stone = stone;
			m_From = from;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(59, 80, 353, 363, 5120);
			AddImageTiled(63, 104, 348, 9, 5121);
			AddLabel(66, 82, 1149, @"You are being offered to join this city.");
			AddLabel(70, 110, 1149, @"City Name: " + stone.CityName.ToString() );
			AddLabel(70, 130, 1149, @"Mayor: " + stone.Mayor.Name.ToString() );
			AddLabel(70, 150, 1149, @"Current Income Tax: " + stone.IncomeTax.ToString() );
			AddLabel(70, 170, 1149, @"Current Property Tax: " + stone.HousingTax.ToString() );
			AddLabel(70, 190, 1149, @"Current Travel Tax: " + stone.TravelTax.ToString() );
			AddHtml( 70, 241, 333, 131, stone.CityRules, (bool)true, (bool)true);
			AddLabel(70, 220, 1149, @"City Rules");
			AddImageTiled(62, 401, 348, 9, 5121);
			AddLabel(70, 375, 1149, @"City URL: " + stone.CityWebURL.ToString() );
			AddButton(70, 409, 4008, 4009, 1, GumpButtonType.Reply, 0);
			AddLabel(104, 409, 1149, @"I accept and wish to join.");
			AddButton(270, 409, 4017, 4018, 2, GumpButtonType.Reply, 0);
			AddLabel(305, 409, 1149, @"I Decline");
		}
		public CityCitizenGump( CityManagementStone stone, Mobile from ) : base( 50, 50 )
		{
			m_Stone = stone;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(25, 26, 409, 363, 5120);
			AddImageTiled(29, 57, 404, 9, 5121);
			AddHtml( 33, 32, 394, 21, @"<BASEFONT COLOR=WHITE><CENTER>City Option Menu</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(35, 70, 4005, 4006, 1, GumpButtonType.Reply, 0);
			AddButton(35, 100, 4005, 4006, 2, GumpButtonType.Reply, 0);
			AddButton(35, 130, 4005, 4006, 3, GumpButtonType.Reply, 0);
			AddButton(35, 160, 4005, 4006, 4, GumpButtonType.Reply, 0);
			AddButton(35, 190, 4005, 4006, 5, GumpButtonType.Reply, 0);
			AddLabel(70, 70, 1149, @"Resign From City");
			AddLabel(70, 100, 1149, @"Depoist To Treasury");
			AddLabel(70, 130, 1149, @"View Waring Cities");
			AddLabel(70, 160, 1149, @"View Allied Cities");
			AddLabel(70, 190, 1149, @"View Citizen List");
			AddLabel(35, 220, 1149, @"Total Citizens: " + stone.Citizens.Count.ToString() );
			AddLabel(35, 240, 1149, @"Treasury Balance: " + stone.CityTreasury.ToString() );
			AddLabel(35, 260, 1149, @"City Level: " + stone.Level.ToString() );
			AddLabel(35, 280, 1149, @"Total Waring Cities: " + stone.Waring.Count.ToString() );
			AddLabel(35, 300, 1149, @"Total Allied Cities: " + stone.Allegiances.Count.ToString() );
			AddLabel(35, 320, 1149, @"Current Income Tax: " + stone.IncomeTax.ToString() );
			AddLabel(35, 340, 1149, @"Current Property Tax: " + stone.HousingTax.ToString() );
			AddLabel(35, 360, 1149, @"Current Travel Tax: " + stone.TravelTax.ToString() );
			AddButton(250, 70, 4005, 4006, 6, GumpButtonType.Reply, 0);
			AddLabel(285, 70, 1149, @"Sponsor A Citizen");

		}
		public ChangeCitizenTitleGump( CityManagementStone stone, int listPage, ArrayList list, ArrayList count ) : base( 50, 50 )
		{
			m_Stone = stone;
         		m_List = list;
         		m_ListPage = listPage;   
         		m_CountList = count;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(18, 15, 336, 243, 5120);
			AddImageTiled(25, 20, 323, 196, 2702);
			AddImageTiled(30, 24, 314, 187, 2604);
			AddAlphaRegion(25, 20, 323, 195);

         		if ( m_List == null )
			{
				ArrayList mobs = m_Stone.Citizens;
				ArrayList a = new ArrayList();

				foreach ( Mobile i in mobs )
				{
					a.Add( i );
				}

				m_List = a;
			}

         		if ( listPage > 0 )
			{
				AddButton(30, 223, 4014, 4015, 1, GumpButtonType.Reply, 0);
				AddLabel(66, 223, 1149, @"Last Page");
			}

         		if ( (listPage + 1) * 7 < m_List.Count )
			{
				AddButton(145, 223, 4005, 4006, 2, GumpButtonType.Reply, 0);
				AddLabel(182, 224, 1149, @"Next Page");
			}

         		int k = 0;

         		for ( int i = 0, j = 0, index=((listPage*7)+k) ; i < 7 && index >= 0 && index < m_List.Count && j >= 0; ++i, ++j, ++index )
         		{
            			Mobile m = m_List[index] as Mobile;
				
				Mobile sponsored = (Mobile)m;

				int offset = 30 + ( i * 25 );

				AddButton(35, offset, 4017, 4018, 100 + index, GumpButtonType.Reply, 0);
				AddLabel(70, offset, 1149, m.Name.ToString() );
			}
		}
		public ConfirmLeaveCityGump( CityManagementStone stone, Mobile from ) : base( 50, 50 )
		{
			m_Stone = stone;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(32, 27, 267, 65, 5120);
			AddLabel(42, 30, 1149, @"Are you sure you want to leave the city?");
			AddButton(175, 55, 247, 248, 2, GumpButtonType.Reply, 0);
			AddButton(85, 55, 242, 243, 1, GumpButtonType.Reply, 0);

		}
		public CityLandLord( CityManagementStone stone, Rectangle3D[] area, CivicSign sign, Point3D p, Map map ) : base( "Marketkeeper")
		{
			Frozen = true;
			Point3D loc = new Point3D( p.X - 4, p.Y, p.Z );
			Location = loc;
			Direction = Direction.South;
			Map = map;		
			m_Stone = stone;
			m_Area = area;
			m_Sign = sign;
			m_vendorlist = new List<Mobile>();
			
			UpdateMarketRegion();
			CreateRandomVendors( loc, map );
		}
		public CityRentedVendor( Mobile landlord, Mobile owner, VendorRentalDuration duration, int rentalPrice, bool landlordRenew, int rentalGold, CityManagementStone stone ) : base( owner, stone )
		{
			m_RentalDuration = duration;
			m_RentalPrice = m_RenewalPrice = rentalPrice;
			m_LandlordRenew = landlordRenew;
			m_RenterRenew = false;
			m_Stone = stone;
			m_Landlord = landlord;
			

			m_RentalGold = rentalGold;

			m_RentalExpireTime = DateTime.Now + duration.Duration;
			m_RentalExpireTimer = new RentalExpireTimer( this, duration.Duration, m_Stone );
			m_RentalExpireTimer.Start();
		}
		public ViewCityMembersGump( CityManagementStone stone, int listPage, ArrayList list, ArrayList count ) : base( 50, 50 )
		{
			m_Stone = stone;
         		m_List = list;
         		m_ListPage = listPage;   
         		m_CountList = count;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
			AddBackground(18, 15, 336, 243, 5120);
			AddImageTiled(25, 20, 323, 196, 2702);
			AddImageTiled(30, 24, 314, 187, 2604);
			AddAlphaRegion(25, 20, 323, 195);

         		if ( m_List == null )
			{
				ArrayList total = new ArrayList( m_Stone.Citizens );
				ArrayList a = new ArrayList();

				foreach ( Mobile person in total )
				{
					a.Add( person );
				}

				m_List = a;
			}

         		if ( listPage > 0 )
			{
				AddButton(30, 223, 4014, 4015, 1, GumpButtonType.Reply, 0);
				AddLabel(66, 223, 1149, @"Last Page");
			}

         		if ( (listPage + 1) * 7 < m_List.Count )
			{
				AddButton(145, 223, 4005, 4006, 2, GumpButtonType.Reply, 0);
				AddLabel(182, 224, 1149, @"Next Page");
			}

         		int k = 0;

         		for ( int i = 0, j = 0, index=((listPage*7)+k) ; i < 7 && index >= 0 && index < m_List.Count && j >= 0; ++i, ++j, ++index )
         		{
            			Mobile mob = m_List[index] as Mobile;
				
				if ( mob is PlayerMobile )
				{
					PlayerMobile m = (PlayerMobile)mob;

					int offset = 30 + ( i * 25 );

               				/*if ( m.AccessLevel != AccessLevel.Player )
               				{
                  				--i;
               				}
               				else
               				{*/
						AddLabel(35, offset, 1149, m.Name.ToString() );
					//}
				}
			}
		}
		public CityLockDownTarget( CityManagementStone stone ) : base( 12, false, TargetFlags.None )
		{
			m_Stone = stone;
		}
		public static bool IsMemberOf( Mobile from, CityManagementStone stone )
		{
			PlayerMobile pm = (PlayerMobile)from;
			if ( pm.City == null )
				return false;
			
			foreach ( Mobile mob in stone.Citizens )
			{
				if ( mob == from )
				{
					return true;
				}
			}
			return false;
		}
		public CityTreasuryWithdrawPrompt( CityManagementStone stone, Mobile from )
		{
			m_Stone = stone;
			m_From = from;
		}
		public CityResFeePrompt( CityManagementStone stone, Mobile from )
		{
			m_Stone = stone;
			m_From = from;
		}
 		public bool IsCitizen( Mobile from, CityManagementStone stone )
 		{
 			 bool citizen = false;
 			
 			if ( from == stone.Mayor || stone.Citizens.Contains( from ) )
 				citizen = true;
 			
 			return citizen;
 			
 			
 		}
			public RentalExpireTimer( CityRentedVendor vendor, TimeSpan delay, CityManagementStone stone ) : base( delay, vendor.RentalDuration.Duration )
			{
				m_Vendor = vendor;
				m_Stone = stone;

				Priority = TimerPriority.OneMinute;
			}
示例#17
0
		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
					{
						m_LandlordRemove = reader.ReadMobile();
						goto case 0;
					}
				
				
				case 0:
				{
					m_toDelete = reader.ReadItemList();
					m_Stone = (CityManagementStone)reader.ReadItem();
					m_Type = (CivicSignType)reader.ReadInt();

					break;
				}
			}
		} 
		public CityManagementGump( CityManagementStone stone, Mobile from ) : base( 50, 50 )
		{
			m_Stone = stone;

			int xLong = 0, yLat = 0;
			int xMins = 0, yMins = 0;
			bool xEast = false, ySouth = false;
			int X = stone.Center.X;
			int Y = stone.Center.Y;
			int Z = 0;
			Point3D loc = new Point3D( X, Y, Z );
			string fmt;

			if ( Sextant.Format( loc, stone.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
				fmt = String.Format( "{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
			else
				fmt = "???";

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			AddImage(396, 160, 10462);
			AddImage(396, 60, 10462);
			AddBackground(15, 20, 407, 380, 5120);
			AddBackground(428, 20, 166, 208, 5120);
			AddButton(440, 50, 5601, 5601, 1, GumpButtonType.Page, 1);
			AddButton(440, 75, 5601, 5601, 2, GumpButtonType.Page, 2);
			AddButton(440, 100, 5601, 5601, 3, GumpButtonType.Page, 3);
			AddButton(440, 125, 5601, 5601, 4, GumpButtonType.Page, 4);
			AddButton(440, 150, 5601, 5601, 5, GumpButtonType.Page, 5);
			AddButton(440, 175, 5601, 5601, 6, GumpButtonType.Page, 6);
			AddButton(440, 200, 5601, 5601, 7, GumpButtonType.Page, 7);
			AddLabel(475, 23, 1149, @"Navigation");
			AddLabel(465, 47, 1149, @"Information");
			AddImageTiled(20, 54, 399, 9, 5121);
			AddLabel(465, 72, 1149, @"General Settings");
			AddLabel(465, 97, 1149, @"Membership");
			AddLabel(465, 123, 1149, @"Treasury Info");
			AddLabel(465, 147, 1149, @"Levy Taxes");
			AddLabel(465, 172, 1149, @"War Dept.");
			AddLabel(465, 197, 1149, @"Misc.");

			AddPage(1);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Information</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddLabel(25, 60, 1149, @"City Name: " + stone.CityName.ToString() );
			AddLabel(25, 80, 1149, @"City Level: " + stone.Level.ToString() );

			int l1offset = PlayerGovernmentSystem.L1CLOffset * 2;
			int l2offset = PlayerGovernmentSystem.L2CLOffset * 2;
			int l3offset = PlayerGovernmentSystem.L3CLOffset * 2;
			int l4offset = PlayerGovernmentSystem.L4CLOffset * 2;
			int l5offset = PlayerGovernmentSystem.L5CLOffset * 2;
			int l6offset = PlayerGovernmentSystem.L6CLOffset * 2;

			if ( stone.Level == 1 )
				AddLabel(25, 100, 1149, @"City Limits: " + l1offset.ToString() + "x" + l1offset.ToString() );
			else if ( stone.Level == 2 )
				AddLabel(25, 100, 1149, @"City Limits: " + l2offset.ToString() + "x" + l2offset.ToString() );
			else if ( stone.Level == 3 )
				AddLabel(25, 100, 1149, @"City Limits: " + l3offset.ToString() + "x" + l3offset.ToString() );
			else if ( stone.Level == 4 )
				AddLabel(25, 100, 1149, @"City Limits: " + l4offset.ToString() + "x" + l4offset.ToString() );
			else if ( stone.Level == 5 )
				AddLabel(25, 100, 1149, @"City Limits: " + l5offset.ToString() + "x" + l5offset.ToString() );
			else if ( stone.Level == 6 )
				AddLabel(25, 100, 1149, @"City Limits: " + l6offset.ToString() + "x" + l6offset.ToString() );
			else
				AddLabel(25, 100, 1149, @"City Limits: ???");

			AddLabel(25, 120, 1149, @"City Population: " + stone.Citizens.Count.ToString() );
			AddLabel(25, 140, 1149, @"City Location: " + fmt );
			AddLabel(25, 160, 1149, @"Treasury Balance: " + stone.CityTreasury.ToString() );

			if ( stone.Level == 1 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title1.ToString() );
			else if ( stone.Level == 2 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title2.ToString() );
			else if ( stone.Level == 3 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title3.ToString() );
			else if ( stone.Level == 4 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title4.ToString() );
			else if ( stone.Level == 5 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title5.ToString() );
			else if ( stone.Level == 6 )
				AddLabel(25, 180, 1149, @"City Rank: " + PlayerGovernmentSystem.Title6.ToString() );
			else
				AddLabel(25, 180, 1149, @"City Rank: ???");

			if ( stone.IsGuarded == true )
				AddLabel(25, 200, 1149, @"City Guards: Enabled");
			else
				AddLabel(25, 200, 1149, @"City Guards: Disabled");

			if ( stone.AllowHousing == true )
				AddLabel(25, 220, 1149, @"House Placement: Enabled");
			else
				AddLabel(25, 220, 1149, @"House Placement: Disabled");

			AddLabel(25, 240, 1149, @"Current Income Tax: " + stone.IncomeTax.ToString() );
			AddLabel(25, 260, 1149, @"Current Property Tax: " + stone.HousingTax.ToString() );
			AddLabel(25, 280, 1149, @"Current Travel Tax: " + stone.TravelTax.ToString() );
			AddLabel(25, 300, 1149, @"Max Decorations: " + stone.MaxDecore.ToString() );
			AddLabel(25, 320, 1149, @"Current Decorations: " + stone.CurrentDecore.ToString() );
			AddLabel(25, 340, 1149, @"Town Vendors: " + stone.Vendors.Count.ToString() );
			AddLabel(25, 360, 1149, @"Town AddOns: " + stone.AddOns.Count.ToString() );

			AddPage(2);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>General Settings</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 60, 4005, 4006, 1, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 2, GumpButtonType.Reply, 0);
			AddButton(30, 120, 4005, 4006, 3, GumpButtonType.Reply, 0);
			AddButton(30, 150, 4005, 4006, 4, GumpButtonType.Reply, 0);
			AddImageTiled(27, 200, 385, 109, 5154);
			AddLabel(31, 177, 1149, @"City Rules, You can use HTML");
			AddTextEntry(27, 200, 385, 109, 0, 1, @"");
			AddButton(210, 60, 4005, 4006, 5, GumpButtonType.Reply, 0);
			AddButton(210, 90, 4005, 4006, 6, GumpButtonType.Reply, 0);
			AddButton(210, 120, 4005, 4006, 7, GumpButtonType.Reply, 0);
			AddButton(210, 150, 4005, 4006, 8, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Change City Name");

			if ( stone.AllowHousing == true )
				AddLabel(70, 90, 1149, @"Housing (ON)");
			else
				AddLabel(70, 90, 1149, @"Housing (Off)");

			if ( stone.IsGuarded == true )
				AddLabel(70, 120, 1149, @"Guards (ON)");
			else
				AddLabel(70, 120, 1149, @"Guards (Off)");

			AddLabel(70, 150, 1149, @"Register City");
			AddLabel(250, 60, 1149, @"Change City URL");
			AddLabel(250, 90, 1149, @"View City Ban List");
			AddLabel(250, 120, 1149, @"Ban Someone From City");
			AddLabel(250, 150, 1149, @"Lift A Ban");
			AddButton(30, 315, 4005, 4006, 9, GumpButtonType.Reply, 0);
			AddLabel(70, 315, 1149, @"Set City Rules");

			AddPage(3);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Membership</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 60, 4005, 4006, 11, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 12, GumpButtonType.Reply, 0);
			AddButton(30, 120, 4005, 4006, 13, GumpButtonType.Reply, 0);
			AddButton(30, 150, 4005, 4006, 14, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Add Citizen");
			AddLabel(70, 90, 1149, @"Remove Citizen");
			AddLabel(70, 120, 1149, @"View Sponsored");
			AddLabel(70, 150, 1149, @"View Citizen List");
			AddLabel(250, 60, 1149, @"Citizens: " + stone.Citizens.Count.ToString() );
			AddLabel(250, 90, 1149, @"Sponsored: " + stone.Sponsored.Count.ToString() );
			AddButton(30, 180, 4005, 4006, 10, GumpButtonType.Reply, 0);
			AddLabel(70, 180, 1149, @"Change A Citizens Title");
			AddLabel( 70, 210, 1149, @"Select an Assistant Mayor");
			AddButton(30, 210, 4005, 4006, 34, GumpButtonType.Reply, 0);
			AddLabel(250, 120, 1149, @"Current Assistant Mayor");
			
			if ( m_Stone.AssistMayor != null )
				AddLabel(250, 150, 1149, m_Stone.AssistMayor.Name );
			else
				AddLabel(250, 150, 1149, @"None" );

			AddPage(4);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Treasury</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 60, 4005, 4006, 15, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 16, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Deposit To Treasury");
			AddLabel(70, 90, 1149, @"Withdraw From Treasury");
			AddLabel(250, 60, 1149, @"Balance: " + stone.CityTreasury.ToString() );

			AddPage(5);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Taxes</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 60, 4005, 4006, 17, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 18, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Set Income Tax");
			AddLabel(70, 90, 1149, @"Set Property Tax");
			AddLabel(250, 60, 1149, @"Income Tax: " + stone.IncomeTax.ToString() );
			AddButton(30, 120, 4005, 4006, 19, GumpButtonType.Reply, 0);
			AddLabel(70, 120, 1149, @"Set Travel Tax");
			AddLabel(250, 90, 1149, @"Property Tax: " + stone.HousingTax.ToString() );
			AddLabel(250, 120, 1149, @"Travel Tax: " + stone.TravelTax.ToString() );
		
			if ( m_Stone.HasHealer == true )
			{
				AddButton(30, 150, 4005, 4006, 32, GumpButtonType.Reply, 0);
				AddButton(30, 180, 4005, 4006, 33, GumpButtonType.Reply, 0);
				AddLabel(70, 150, 1149, @"Set Resurrection Fee");
				AddLabel(250, 150, 1149, @"Ressurrection Fee: " + stone.ResFee.ToString() );
				AddLabel(70, 180, 1149, @"Set Corpse Retrieval Fee");
				AddLabel(250, 180, 1149, @"Retrieval Fee: " + stone.CorpseFee.ToString() );
			}

			AddPage(6);

			AddButton(30, 60, 4005, 4006, 20, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 21, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Declare War!");
			AddLabel(70, 90, 1149, @"View Wars Declared");
			AddLabel(250, 60, 1149, @"Waring: " + stone.Waring.Count.ToString() );
			AddButton(30, 120, 4005, 4006, 22, GumpButtonType.Reply, 0);
			AddLabel(70, 120, 1149, @"View War Invitations");
			AddLabel(250, 90, 1149, @"Wars Declared: " + stone.WarsDeclared.Count.ToString() );
			AddLabel(250, 120, 1149, @"War Invites: " + stone.WarsInvited.Count.ToString() );
			AddButton(30, 150, 4005, 4006, 23, GumpButtonType.Reply, 0);
			AddLabel(70, 150, 1149, @"Declare Peace");
			AddButton(30, 180, 4005, 4006, 24, GumpButtonType.Reply, 0);
			AddLabel(70, 180, 1149, @"View Cities We Are At War With");
			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>War Department</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 210, 4005, 4006, 25, GumpButtonType.Reply, 0);
			AddButton(30, 240, 4005, 4006, 26, GumpButtonType.Reply, 0);
			AddButton(30, 270, 4005, 4006, 27, GumpButtonType.Reply, 0);
			AddButton(30, 300, 4005, 4006, 28, GumpButtonType.Reply, 0);
			AddButton(30, 330, 4005, 4006, 29, GumpButtonType.Reply, 0);
			AddLabel(70, 210, 1149, @"Declare Allegiance");
			AddLabel(70, 240, 1149, @"View Allegiances Proposed");
			AddLabel(70, 270, 1149, @"View Allegiances Invited");
			AddLabel(70, 300, 1149, @"Cancel An Allegiance");
			AddLabel(70, 330, 1149, @"View Cities We Are Allied With");
			AddLabel(250, 210, 1149, @"Allegiances: " + stone.Allegiances.Count.ToString() );
			AddLabel(250, 240, 1149, @"Allegiances Declared: " + stone.AllegiancesDeclared.Count.ToString() );
			AddLabel(250, 270, 1149, @"Allegiances Invites: " + stone.AllegiancesInvited.Count.ToString() );

			AddPage(7);

			AddHtml( 22, 27, 393, 21, @"<BASEFONT COLOR=WHITE><CENTER>Misc.</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddButton(30, 60, 4005, 4006, 30, GumpButtonType.Reply, 0);
			AddButton(30, 90, 4005, 4006, 31, GumpButtonType.Reply, 0);
			AddLabel(70, 60, 1149, @"Disband City");
			AddLabel(70, 90, 1149, @"View Maintenance Report");
		}
		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 

			int version = reader.ReadInt(); 

			switch ( version )
			{
				case 0:
				{
					m_Time = reader.ReadDeltaTime();
					m_Mob1 = reader.ReadMobile();
					m_Mob2 = reader.ReadMobile();
					m_Votes1 = reader.ReadInt();
					m_Votes2 = reader.ReadInt();
					m_Voters = reader.ReadMobileList();
					m_Stone = (CityManagementStone)reader.ReadItem();

					m_Timer = new CityElectionTimer( m_Time, this );
					m_Timer.Start();

					break;
				}
			}
		} 
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			m_vendorlist = reader.ReadStrongMobileList();
			m_Sign = (CivicSign)reader.ReadItem();
			m_Stone = (CityManagementStone)reader.ReadItem();
			m_Area = Server.Items.CityManagementStone.ReadRect3DArray( reader );
			
			Frozen = true;
			
			foreach ( Mobile m in m_vendorlist )
			{
				m.Frozen = true;
			}
			
			UpdateMarketRegion();
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			switch ( version )
			{
				case 29:
				{
					m_Bioenginer = reader.ReadBool();
					NextTamingBulkOrder = reader.ReadTimeSpan();
					goto case 28;
				}
				case 28:
				{
					m_ShowRadar = reader.ReadBool();
					goto case 27;
				}
				case 27:
				{
					m_TamingBOBFilter = new Engines.BulkOrders.TamingBOBFilter( reader );
					goto case 26;
				}
				case 26:
				{
					m_City = (CityManagementStone)reader.ReadItem();
					m_CityTitle = reader.ReadString();
					m_ShowCityTitle = reader.ReadBool();
					m_OwesBackTaxes = reader.ReadBool();
					m_BackTaxesAmount = reader.ReadInt();
					goto case 25;
				}
				case 25:
				{
					int recipeCount = reader.ReadInt();

					if( recipeCount > 0 )
					{
						m_AcquiredRecipes = new Dictionary<int, bool>();

						for( int i = 0; i < recipeCount; i++ )
						{
							int r = reader.ReadInt();
							if( reader.ReadBool() )	//Don't add in recipies which we haven't gotten or have been removed
								m_AcquiredRecipes.Add( r, true );
						}
					}
					goto case 24;
				}
				case 24:
				{
					m_LastHonorLoss = reader.ReadDeltaTime();
					goto case 23;
				}
				case 23:
				{
					m_ChampionTitles = new ChampionTitleInfo( reader );
					goto case 22;
				}
				case 22:
				{
					m_LastValorLoss = reader.ReadDateTime();
					goto case 21;
				}
				case 21:
				{
					m_ToTItemsTurnedIn = reader.ReadEncodedInt();
					m_ToTTotalMonsterFame = reader.ReadInt();
					goto case 20;
				}
				case 20:
				{
					m_AllianceMessageHue = reader.ReadEncodedInt();
					m_GuildMessageHue = reader.ReadEncodedInt();

					goto case 19;
				}
				case 19:
				{
					int rank = reader.ReadEncodedInt();
					int maxRank = Guilds.RankDefinition.Ranks.Length -1;
					if( rank > maxRank )
						rank = maxRank;

					m_GuildRank = Guilds.RankDefinition.Ranks[rank];
					m_LastOnline = reader.ReadDateTime();
					goto case 18;
				}
				case 18:
				{
					m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt();

					goto case 17;
				}
				case 17: // changed how DoneQuests is serialized
				case 16:
				{
					m_Quest = QuestSerializer.DeserializeQuest( reader );

					if ( m_Quest != null )
						m_Quest.From = this;

					int count = reader.ReadEncodedInt();

					if ( count > 0 )
					{
						m_DoneQuests = new List<QuestRestartInfo>();

						for ( int i = 0; i < count; ++i )
						{
							Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader );
							DateTime restartTime;

							if ( version < 17 )
								restartTime = DateTime.MaxValue;
							else
								restartTime = reader.ReadDateTime();

							m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) );
						}
					}

					m_Profession = reader.ReadEncodedInt();
					goto case 15;
				}
				case 15:
				{
					m_LastCompassionLoss = reader.ReadDeltaTime();
					goto case 14;
				}
				case 14:
				{
					m_CompassionGains = reader.ReadEncodedInt();

					if ( m_CompassionGains > 0 )
						m_NextCompassionDay = reader.ReadDeltaTime();

					goto case 13;
				}
				case 13: // just removed m_PayedInsurance list
				case 12:
				{
					m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
					goto case 11;
				}
				case 11:
				{
					if ( version < 13 )
					{
						List<Item> payed = reader.ReadStrongItemList();

						for ( int i = 0; i < payed.Count; ++i )
							payed[i].PayedInsurance = true;
					}

					goto case 10;
				}
				case 10:
				{
					if ( reader.ReadBool() )
					{
						m_HairModID = reader.ReadInt();
						m_HairModHue = reader.ReadInt();
						m_BeardModID = reader.ReadInt();
						m_BeardModHue = reader.ReadInt();

						// We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
						Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
					}

					goto case 9;
				}
				case 9:
				{
					SavagePaintExpiration = reader.ReadTimeSpan();

					if ( SavagePaintExpiration > TimeSpan.Zero )
					{
						BodyMod = ( Female ? 184 : 183 );
						HueMod = 0;
					}

					goto case 8;
				}
				case 8:
				{
					m_NpcGuild = (NpcGuild)reader.ReadInt();
					m_NpcGuildJoinTime = reader.ReadDateTime();
					m_NpcGuildGameTime = reader.ReadTimeSpan();
					goto case 7;
				}
				case 7:
				{
					m_PermaFlags = reader.ReadStrongMobileList();
					goto case 6;
				}
				case 6:
				{
					NextTailorBulkOrder = reader.ReadTimeSpan();
					goto case 5;
				}
				case 5:
				{
					NextSmithBulkOrder = reader.ReadTimeSpan();
					goto case 4;
				}
				case 4:
				{
					m_LastJusticeLoss = reader.ReadDeltaTime();
					m_JusticeProtectors = reader.ReadStrongMobileList();
					goto case 3;
				}
				case 3:
				{
					m_LastSacrificeGain = reader.ReadDeltaTime();
					m_LastSacrificeLoss = reader.ReadDeltaTime();
					m_AvailableResurrects = reader.ReadInt();
					goto case 2;
				}
				case 2:
				{
					m_Flags = (PlayerFlag)reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_LongTermElapse = reader.ReadTimeSpan();
					m_ShortTermElapse = reader.ReadTimeSpan();
					m_GameTime = reader.ReadTimeSpan();
					goto case 0;
				}
				case 0:
				{
					break;
				}
			}

			// Professions weren't verified on 1.0 RC0
			if ( !CharacterCreation.VerifyProfession( m_Profession ) )
				m_Profession = 0;

			if ( m_PermaFlags == null )
				m_PermaFlags = new List<Mobile>();

			if ( m_JusticeProtectors == null )
				m_JusticeProtectors = new List<Mobile>();

			if ( m_BOBFilter == null )
				m_BOBFilter = new Engines.BulkOrders.BOBFilter();

			if ( m_TamingBOBFilter == null )
				m_TamingBOBFilter = new Engines.BulkOrders.TamingBOBFiler();
			
			if( m_GuildRank == null )
				m_GuildRank = Guilds.RankDefinition.Member;	//Default to member if going from older verstion to new version (only time it should be null)

			if( m_LastOnline == DateTime.MinValue && Account != null )
				m_LastOnline = ((Account)Account).LastLogin;

			if( m_ChampionTitles == null )
				m_ChampionTitles = new ChampionTitleInfo();

			List<Mobile> list = this.Stabled;

			for ( int i = 0; i < list.Count; ++i )
			{
				BaseCreature bc = list[i] as BaseCreature;

				if ( bc != null )
					bc.IsStabled = true;
			}

			CheckAtrophies( this );


			if( Hidden )	//Hiding is the only buff where it has an effect that's serialized.
				AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) );
		}
		public CityTaxesPropertyPrompt( CityManagementStone stone, Mobile from )
		{
			m_Stone = stone;
			m_From = from;
		}
		public PlayerCityRegion( CityManagementStone stone, Map map, Rectangle3D[] area ) : base( PickRegionName(), map, DefaultPriority, area )
		{
			//LoadFromXml = false;

			m_Stone = stone;
			
			
		}
		public MaintenanceReportGump( CityManagementStone stone ) : base( 50, 50 )
		{
			m_Stone = stone;

			int cost = 0;

			int hallCost = 5000 * m_Stone.Level;

			cost += hallCost;

			int citizensCost = m_Stone.Citizens.Count * 2;
			cost += citizensCost;

			int decoreCost = m_Stone.CurrentDecore * 3;
			cost += decoreCost;
			
			int addoncost = m_Stone.AddOns.Count * 100;
			cost += addoncost;

			if ( m_Stone.IsGuarded == true )
				cost += 1000;

			if ( m_Stone.IsRegistered == true )
				cost += 1000;

			if ( m_Stone.HasBank == true )	
				cost += 1000;

			if ( m_Stone.HasTavern == true )
				cost += 1000;

			if ( m_Stone.HasHealer == true )
				cost += 1000;

			if ( m_Stone.HasMoongate == true )
				cost += 1000;

			if ( m_Stone.HasStable == true )
				cost += 1000;
			
			if ( m_Stone.HasMarket == true )
				cost += 1000;
			

			int gardenCost = m_Stone.Gardens.Count * 1000;
			cost += gardenCost;
			
			int parkCost = m_Stone.Parks.Count * 1000;
			cost += parkCost;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			AddBackground(30, 29, 289, 360, 5120);
			AddImageTiled(35, 58, 280, 10, 5121);
			AddHtml( 37, 34, 276, 19, @"<BASEFONT COLOR=WHITE><CENTER>Maintenance Report</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddLabel(45, 65, 1149, @"Citizen Cost: " + citizensCost.ToString() );
			AddLabel(45, 85, 1149, @"Decore Cost: " + decoreCost.ToString() );
			AddLabel(45, 105, 1149, @"City Hall Cost: " + hallCost.ToString() );

			if ( m_Stone.HasBank == true )	
				AddLabel(45, 125, 1149, @"Bank Cost: 1000");
			else
				AddLabel(45, 125, 1149, @"Bank Cost: 0");

			if ( m_Stone.HasHealer == true )
				AddLabel(45, 145, 1149, @"Healer Cost: 1000");
			else
				AddLabel(45, 145, 1149, @"Healer Cost: 0");

			if ( m_Stone.HasTavern == true )
				AddLabel(45, 165, 1149, @"Tavern Cost: 1000");
			else
				AddLabel(45, 165, 1149, @"Tavern Cost: 0");

			if ( m_Stone.HasMoongate == true )
				AddLabel(45, 185, 1149, @"Moongate Cost: 1000");
			else
				AddLabel(45, 185, 1149, @"Moongate Cost: 0");

			if ( m_Stone.HasStable == true )
				AddLabel(45, 205, 1149, @"Stable Cost: 1000");
			else
				AddLabel(45, 205, 1149, @"Stable Cost: 0");

			if ( m_Stone.IsGuarded == true )
				AddLabel(45, 225, 1149, @"Guards Cost: 1000" );
			else
				AddLabel(45, 225, 1149, @"Guards Cost: 0" );

			if ( m_Stone.IsRegistered == true )
				AddLabel(45, 245, 1149, @"Registration Cost: 1000");
			else
				AddLabel(45, 245, 1149, @"Registration Cost: 0");

			AddLabel(45, 265, 1149, @"Gardens Cost: " + gardenCost.ToString() );

			AddLabel(45, 285, 1149, @"Parks Cost: " + parkCost.ToString() );
			AddLabel( 45, 305, 1149, @"AddOn Cost: " + addoncost.ToString() );
			
			if ( m_Stone.HasMarket )
				AddLabel( 45, 325, 1149, @"Market Cost: 1000");
			else
				AddLabel( 45, 325, 1149, @"Market Cost: 0");

			AddImageTiled(35, 343, 280, 10, 5121);

			AddLabel(45, 350, 1149, @"Total Maintenance: " + cost.ToString() );
		}
		public CityReleaseTarget( CityManagementStone stone ) : base( 12, false, TargetFlags.None )
		{
			m_Stone = stone;
		}
		public CityMarketRegion( CityManagementStone stone, CityLandLord lord, Map map, Rectangle3D[] area, CivicSign sign ) : base( PickRegionName(), map, MarketPriority, area )
		{
			m_Stone = stone;
			m_LandLord = lord;
			m_Sign = sign;
		}
		public CityTreasuryDepoistPrompt( CityManagementStone stone, Mobile from )
		{
			m_Stone = stone;
			m_From = from;
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

			m_Stone = (CityManagementStone)reader.ReadItem();
			m_Landlord = reader.ReadMobile();
			int durationID = reader.ReadEncodedInt();
			if ( durationID < VendorRentalDuration.Instances.Length )
				m_RentalDuration = VendorRentalDuration.Instances[durationID];
			else
				m_RentalDuration = VendorRentalDuration.Instances[0];

			m_RentalPrice = reader.ReadInt();
			m_LandlordRenew = reader.ReadBool();
			m_RenterRenew = reader.ReadBool();
			m_RenewalPrice = reader.ReadInt();

			m_RentalGold = reader.ReadInt();

			m_RentalExpireTime = reader.ReadDeltaTime();

			TimeSpan delay = m_RentalExpireTime - DateTime.Now;
			m_RentalExpireTimer = new RentalExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero, m_Stone );
			m_RentalExpireTimer.Start();
		}
		public JoinCityTarget( CityManagementStone stone ) : base( 12, false, TargetFlags.None )
		{
			m_Stone = stone;
		}
		public CitizenTitleChangePrompt( CityManagementStone stone, Mobile citizen, Mobile mayor )
		{
			m_Stone = stone;
			m_Citizen = citizen;
			m_Mayor = mayor;
		}