Beispiel #1
0
            public InternalGump(Mobile from, RevisedChampTicket ticket) : base(50, 50)
            {
                m_From   = from;
                m_Ticket = ticket;

                AddBackground(0, 0, 400, 385, 0xA28);

                AddHtml(30, 45, 340, 70, "Thank you for helping us defeat this vile evil, for your courageousness we have given you a choice of rewards, you may choose only one though!", true, false);

                AddButton(46, 128, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                AddHtml(80, 129, 240, 24, "a 225 stat ball", true, false);
                //AddLabel( 80, 128, 0x489, "a 225 stat ball" );  //# 1test

                //AddButton( 46, 163, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
                //AddHtml(80,164,240,24,"a random blood pentagram part",true,false);
                //AddLabel( 80, 163, 0x489, "a clothing bless deed" );  //# 1test

                AddButton(46, 163, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0);
                AddHtml(80, 164, 240, 24, "a skin tone deed", true, false);

                AddButton(46, 198, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
                AddHtml(80, 199, 240, 24, "a promotional token", true, false);

                AddButton(46, 233, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0);
                AddHtml(80, 234, 240, 24, "an ethereal beetle", true, false);

                AddButton(46, 269, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0);
                AddHtml(80, 269, 240, 24, "an unhatched spider egg", true, false);

                //AddButton( 46, 268, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0 );
                //AddHtml(80,269,240,24,"a Skin Tone Deed",true,false);
                //AddLabel( 80, 268, 0x489, "a skin tone deed" );  //# 1test

                //AddButton( 46, 303, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0 );
                //AddLabel( 50, 320, 0x489, "a wreath deed" );  //# 1test

                AddButton(120, 310, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(154, 312, 100, 35, 1011012, false, false);                   // CANCEL
            }
			public InternalGump( Mobile from, RevisedChampTicket ticket ) : base( 50, 50 )
			{
				m_From = from;
				m_Ticket = ticket;

				AddBackground( 0, 0, 400, 385, 0xA28 );

				AddHtml(30, 45, 340, 70,"Thank you for helping us defeat this vile evil, for your courageousness we have given you a choice of rewards, you may choose only one though!",true,false);

				AddButton( 46, 128, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
				AddHtml(80,129,240,24,"a 225 stat ball",true,false);
				//AddLabel( 80, 128, 0x489, "a 225 stat ball" );  //# 1test

				//AddButton( 46, 163, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
				//AddHtml(80,164,240,24,"a random blood pentagram part",true,false);
				//AddLabel( 80, 163, 0x489, "a clothing bless deed" );  //# 1test

				AddButton(46, 163, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0);
				AddHtml(80, 164, 240, 24, "a skin tone deed", true, false);

				AddButton( 46, 198, 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
				AddHtml(80,199,240,24,"a promotional token",true,false);

				AddButton( 46, 233, 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0 );
				AddHtml(80,234,240,24,"an ethereal beetle",true,false);

				AddButton( 46, 269, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0 );
				AddHtml(80,269,240,24,"an unhatched spider egg",true,false);

				//AddButton( 46, 268, 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0 );
				//AddHtml(80,269,240,24,"a Skin Tone Deed",true,false);
				//AddLabel( 80, 268, 0x489, "a skin tone deed" );  //# 1test

				//AddButton( 46, 303, 0xFA5, 0xFA7, 6, GumpButtonType.Reply, 0 );
				//AddLabel( 50, 320, 0x489, "a wreath deed" );  //# 1test

				AddButton( 120, 310, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 154, 312, 100, 35, 1011012, false, false ); // CANCEL
			}
		public void GivePowerScrolls()
		{
			/*if ( Map != Map.Felucca )
				return;*/

			ArrayList toGive = new ArrayList();

			ArrayList list = Aggressors;
			for ( int i = 0; i < list.Count; ++i )
			{
				AggressorInfo info = (AggressorInfo)list[i];

				if ( info.Attacker.Player && info.Attacker.Alive && (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( info.Attacker ) )
					toGive.Add( info.Attacker );
			}

			list = Aggressed;
			for ( int i = 0; i < list.Count; ++i )
			{
				AggressorInfo info = (AggressorInfo)list[i];

				if ( info.Defender.Player && info.Defender.Alive && (DateTime.Now - info.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( info.Defender ) )
					toGive.Add( info.Defender );
			}

			if ( toGive.Count == 0 )
				return;

			// Randomize
			for ( int i = 0; i < toGive.Count; ++i )
			{
				int rand = Utility.Random( toGive.Count );
				object hold = toGive[i];
				toGive[i] = toGive[rand];
				toGive[rand] = hold;
			}

			for ( int i = 0; i < 6; ++i )
			{
				int level;
				double random = Utility.RandomDouble();

				if ( 0.1 >= random )
					level = 20;
				else if ( 0.4 >= random )
					level = 15;
				else
					level = 10;

				Mobile m = (Mobile)toGive[i % toGive.Count];

				RevisedChampTicket ps  = new RevisedChampTicket();

				m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
				m.AddToBackpack( ps );

				if ( m is PlayerMobile )
				{
					PlayerMobile pm = (PlayerMobile)m;

					for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
					{
						Mobile prot = (Mobile)pm.JusticeProtectors[j];

						if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal )
							continue;

						int chance = 0;

						switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
						{
							case VirtueLevel.Seeker: chance = 60; break;
							case VirtueLevel.Follower: chance = 80; break;
							case VirtueLevel.Knight: chance = 100; break;
						}

						if ( chance > Utility.Random( 100 ) )
						{
							prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
							//prot.AddToBackpack( new PowerScroll( ps.Skill, ps.Value ) );
						}
					}
				}
			}
		}