RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Same Parameter Types Error

Packer898

Knight
Anytime. I just wish I had looked at the error more closely and saw it was deed not gump myself.




*notetoself - check errors more carefully.... =)-
 

Krystyl_Rose

Wanderer
ok this is soooo frustrating.... I had it up it compiled and loaded, but as soon as I tried using the deed the server crashed :(

heres the crash log:

Code:
Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 9/12/2005 7:53:09 PM
Mobiles: 11427
Items: 105676
Clients:
- Count: 2

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Gumps.EtherealMountGump.OnResponse(NetState state, RelayInfo info)
   at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)



any ideas?
 

Krystyl_Rose

Wanderer
Oh geez I am sorry I think My brain went down with the shard ROFL

here is both scripts (just in case)

EtherealMountDeed
Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;

namespace Server.Items
{
	public class EtherealMountDeed : Item
	{
		
		[Constructable]
		public EtherealMountDeed() : base ( 0x14F0 )
		{
			Name = "Ethereal Mount Deed";
			Weight = 1.0;
			LootType = LootType.Blessed;
			Hue = 1150;
		}
		public EtherealMountDeed ( Serial serial ) : base ( serial )
		{
		}

      		public override void OnDoubleClick( Mobile from ) 
      		{
			if ( !IsChildOf( from.Backpack ) )
			{
				 from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{ 
				from.SendGump( new EtherealMountGump( from, this ) );
			}
		}

		public override void Serialize ( GenericWriter writer)
		{
			base.Serialize ( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize ( reader );

			int version = reader.ReadInt();
		}
	}
}

EtherealMountDeedGump
Code:
using System;
using System.Net;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network; 

namespace Server.Gumps
{ 
	public class EtherealMountGump : Gump
	{ 
		private Mobile m_Mobile;
		private Item m_Deed;

		public EtherealMountGump( Mobile from, Item deed ) : base( 30, 20 ) 
		{


			AddPage ( 1 );
		
	 AddBackground( 0, 0, 300, 400, 5054 ); 
	 AddBackground( 8, 8, 284, 384, 3000 ); 

	 AddLabel( 40, 12, 0, "Ethereal List" ); 

	 AddLabel( 52, 40, 0, "Ethereal Horse" ); 
	 AddButton( 12, 40, 4005, 4007, 1, GumpButtonType.Reply, 1 ); 
	 AddLabel( 52, 60, 0, "Ethereal Llama" ); 
	 AddButton( 12, 60, 4005, 4007, 2, GumpButtonType.Reply, 2 ); 
	 AddLabel( 52, 80, 0, "Ethereal Ostard" ); 
	 AddButton( 12, 80, 4005, 4007, 3, GumpButtonType.Reply, 3 ); 
	 AddLabel( 52, 100, 0, "Ethereal Ridgeback" ); 
	 AddButton( 12, 100, 4005, 4007, 4, GumpButtonType.Reply, 4 ); 
	 AddLabel( 52, 120, 0, "Ethereal Unicorn" ); 
	 AddButton( 12, 120, 4005, 4007, 5, GumpButtonType.Reply, 5 ); 
	 AddLabel( 52, 140, 0, "Ethereal Beetle" ); 
	 AddButton( 12, 140, 4005, 4007, 6, GumpButtonType.Reply, 6 ); 
	 AddLabel( 52, 160, 0, "Ethereal Ki-Rin" ); 
	 AddButton( 12, 160, 4005, 4007, 7, GumpButtonType.Reply, 7 ); 
	 AddLabel( 52, 180, 0, "Ethereal Swamp Dragon" ); 
	 AddButton( 12, 180, 4005, 4007, 8, GumpButtonType.Reply, 8 ); 
	 AddLabel( 52, 200, 0, "Ethereal Hiryu" ); 
	 AddButton( 12, 200, 4005, 4007, 9, GumpButtonType.Reply, 9 ); 
	 AddLabel( 52, 220, 0, "Close" ); 
	 AddButton( 12, 220, 4005, 4007, 0, GumpButtonType.Reply, 0 ); 
      }

	public override void OnResponse( NetState state, RelayInfo info )
      { 
		Mobile from = state.Mobile;
         BaseCreature mount;
		switch ( info.ButtonID )
		{
			case 0: //Close Gump 
			{
			from.CloseGump( typeof( EtherealMountGump ) ); 
			break; 
	    } 
	    case 1: // Ethereal Horse
	    { 
	       Item item = new EtherealHorse();
	       from.SendMessage( "An Ethereal Horse has been placed into your backpack." );
	       from.AddToBackpack( item );
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 2: // Ethereal Llama 
	    { 
	       Item item = new EtherealLlama();
	       from.SendMessage( "An Ethereal Llama has been placed into your backpack." );
	       from.AddToBackpack( item );
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 3: // Ethereal Ostard
	    { 
	       Item item = new EtherealOstard();
           from.SendMessage( "An Ethereal Ostard has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 4: // Ethereal Ridgeback
	   	{ 
	       Item item = new EtherealRidgeback();
	       from.SendMessage( "An Ethereal Ridgeback has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 5: // Ethereal Unicorn
	    { 
	       Item item = new EtherealUnicorn();
	       from.SendMessage( "An Ethereal Unicorn has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 6: //Ethereal Beetle
	    { 
	       Item item = new EtherealBeetle();
	       from.SendMessage( "An Ethereal Beetle has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 7: //Ethereal Ki-Rin
	    { 
	       Item item = new EtherealKirin();
	       from.SendMessage( "An Ethereal Ki-Rin has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    } 
	    case 8: //Ethereal Swamp Dragon
	    { 
	       Item item = new EtherealSwampDragon();
	       from.SendMessage( "An Ethereal Swamp Dragon has been placed into your backpack." );
	       from.AddToBackpack( item ); 
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
	    }
	    case 9: //Ethereal Hiryu
	    { 
	       Item item = new EtherealHiryu();
	       from.SendMessage( "An Ethereal Hiryu has been placed into your backpack." );
	       from.AddToBackpack( item );
	       from.CloseGump( typeof( EtherealMountGump ) );
	       m_Deed.Delete(); 
	       break; 
           } 
         }
      }
   }
}
 

Packer898

Knight
Here actually just try this copy of ehterealdeedgump.cs and see if you still get errors...


Code:
using System;
using System.Net;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server.Gumps
{
	public class EtherealMountGump : Gump
	{
		private Mobile m_Mobile;
		private Item m_Deed;
		
		public EtherealMountGump( Mobile from, Item deed ) : base( 30, 20 )
		{
			
			
			AddPage ( 1 );
			
			AddBackground( 0, 0, 300, 400, 5054 );
			AddBackground( 8, 8, 284, 384, 3000 );
			
			AddLabel( 40, 12, 0, "Ethereal List" );
			
			AddLabel( 52, 40, 0, "Ethereal Horse" );
			AddButton( 12, 40, 4005, 4007, 1, GumpButtonType.Reply, 1 );
			AddLabel( 52, 60, 0, "Ethereal Llama" );
			AddButton( 12, 60, 4005, 4007, 2, GumpButtonType.Reply, 2 );
			AddLabel( 52, 80, 0, "Ethereal Ostard" );
			AddButton( 12, 80, 4005, 4007, 3, GumpButtonType.Reply, 3 );
			AddLabel( 52, 100, 0, "Ethereal Ridgeback" );
			AddButton( 12, 100, 4005, 4007, 4, GumpButtonType.Reply, 4 );
			AddLabel( 52, 120, 0, "Ethereal Unicorn" );
			AddButton( 12, 120, 4005, 4007, 5, GumpButtonType.Reply, 5 );
			AddLabel( 52, 140, 0, "Ethereal Beetle" );
			AddButton( 12, 140, 4005, 4007, 6, GumpButtonType.Reply, 6 );
			AddLabel( 52, 160, 0, "Ethereal Ki-Rin" );
			AddButton( 12, 160, 4005, 4007, 7, GumpButtonType.Reply, 7 );
			AddLabel( 52, 180, 0, "Ethereal Swamp Dragon" );
			AddButton( 12, 180, 4005, 4007, 8, GumpButtonType.Reply, 8 );
			AddLabel( 52, 200, 0, "Ethereal Hiryu" );
			AddButton( 12, 200, 4005, 4007, 9, GumpButtonType.Reply, 9 );
			AddLabel( 52, 220, 0, "Close" );
			AddButton( 12, 220, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
		
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			
			switch ( info.ButtonID )
			{
				case 0: //Close Gump
					{
						from.CloseGump( typeof( EtherealMountGump ) );
						break;
					}
				case 1: // Ethereal Horse
					{
						from.AddToBackpack( new EtherealHorse() );
						from.SendMessage( "An Ethereal Horse has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 2: // Ethereal Llama
					{
						from.AddToBackpack( new EtherealLlama() );
						from.SendMessage( "An Ethereal Llama has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 3: // Ethereal Ostard
					{
						from.AddToBackpack( new EtherealOstard() );
						from.SendMessage( "An Ethereal Ostard has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 4: // Ethereal Ridgeback
					{
						from.AddToBackpack( new EtherealRidgeback() );
						from.SendMessage( "An Ethereal Ridgeback has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 5: // Ethereal Unicorn
					{
						from.AddToBackpack( new EtherealUnicorn() );
						from.SendMessage( "An Ethereal Unicorn has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 6: //Ethereal Beetle
					{
						from.AddToBackpack( new EtherealBeetle() );
						from.SendMessage( "An Ethereal Beetle has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 7: //Ethereal Ki-Rin
					{
						from.AddToBackpack( new EtherealKirin() );
						from.SendMessage( "An Ethereal Ki-Rin has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 8: //Ethereal Swamp Dragon
					{
						from.AddToBackpack( new EtherealSwampDragon() );
						from.SendMessage( "An Ethereal Swamp Dragon has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 9: //Ethereal Hiryu
					{
						from.AddToBackpack( new EtherealHiryu() );
						from.SendMessage( "An Ethereal Hiryu has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
			}
		}
	}
}
 

Krystyl_Rose

Wanderer
ok it crashed again and this is the crash log

Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 9/12/2005 8:19:00 PM
Mobiles: 11426
Items: 105661
Clients:
- Count: 1

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.EtherealMountGump.OnResponse(NetState state, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Krystyl_Rose

Wanderer
ok I tried the repost you put up.... it crashed.... I tried the commenting out of the close gump.... it crashed.... and I dont know if this helps much, but when it crashes is when I select it to give me the ethereal not when it goes to close the gump as far as I can tell... because it never does give me the ethereal horse... *ponders*
 

Packer898

Knight
Try this...
Code:
using System;
using System.Net;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server.Gumps
{
	public class EtherealMountGump : Gump
	{
		private Mobile m_From;
		private Item m_Deed;
		
		public EtherealMountGump( Mobile owner ) : base( 30, 20 )
		{
			
			
			AddPage ( 1 );
			
			AddBackground( 0, 0, 300, 400, 5054 );
			AddBackground( 8, 8, 284, 384, 3000 );
			
			AddLabel( 40, 12, 0, "Ethereal List" );
			
			AddLabel( 52, 40, 0, "Ethereal Horse" );
			AddButton( 12, 40, 4005, 4007, 1, GumpButtonType.Reply, 1 );
			AddLabel( 52, 60, 0, "Ethereal Llama" );
			AddButton( 12, 60, 4005, 4007, 2, GumpButtonType.Reply, 2 );
			AddLabel( 52, 80, 0, "Ethereal Ostard" );
			AddButton( 12, 80, 4005, 4007, 3, GumpButtonType.Reply, 3 );
			AddLabel( 52, 100, 0, "Ethereal Ridgeback" );
			AddButton( 12, 100, 4005, 4007, 4, GumpButtonType.Reply, 4 );
			AddLabel( 52, 120, 0, "Ethereal Unicorn" );
			AddButton( 12, 120, 4005, 4007, 5, GumpButtonType.Reply, 5 );
			AddLabel( 52, 140, 0, "Ethereal Beetle" );
			AddButton( 12, 140, 4005, 4007, 6, GumpButtonType.Reply, 6 );
			AddLabel( 52, 160, 0, "Ethereal Ki-Rin" );
			AddButton( 12, 160, 4005, 4007, 7, GumpButtonType.Reply, 7 );
			AddLabel( 52, 180, 0, "Ethereal Swamp Dragon" );
			AddButton( 12, 180, 4005, 4007, 8, GumpButtonType.Reply, 8 );
			AddLabel( 52, 200, 0, "Ethereal Hiryu" );
			AddButton( 12, 200, 4005, 4007, 9, GumpButtonType.Reply, 9 );
			AddLabel( 52, 220, 0, "Close" );
			AddButton( 12, 220, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
		
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			
			switch ( info.ButtonID )
			{
				case 0: //Close Gump
					{
						from.CloseGump( typeof( EtherealMountGump ) );
						break;
					}
				case 1: // Ethereal Horse
					{
						from.AddToBackpack( new EtherealHorse() );
						from.SendMessage( "An Ethereal Horse has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 2: // Ethereal Llama
					{
						from.AddToBackpack( new EtherealLlama() );
						from.SendMessage( "An Ethereal Llama has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 3: // Ethereal Ostard
					{
						from.AddToBackpack( new EtherealOstard() );
						from.SendMessage( "An Ethereal Ostard has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 4: // Ethereal Ridgeback
					{
						from.AddToBackpack( new EtherealRidgeback() );
						from.SendMessage( "An Ethereal Ridgeback has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 5: // Ethereal Unicorn
					{
						from.AddToBackpack( new EtherealUnicorn() );
						from.SendMessage( "An Ethereal Unicorn has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 6: //Ethereal Beetle
					{
						from.AddToBackpack( new EtherealBeetle() );
						from.SendMessage( "An Ethereal Beetle has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 7: //Ethereal Ki-Rin
					{
						from.AddToBackpack( new EtherealKirin() );
						from.SendMessage( "An Ethereal Ki-Rin has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 8: //Ethereal Swamp Dragon
					{
						from.AddToBackpack( new EtherealSwampDragon() );
						from.SendMessage( "An Ethereal Swamp Dragon has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 9: //Ethereal Hiryu
					{
						from.AddToBackpack( new EtherealHiryu() );
						from.SendMessage( "An Ethereal Hiryu has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
			}
		}
	}
}

I think the problem is that you are trying to delete the deed and it doesnt know whats going on. If this doesnt work then comment out the m_Deed.Delete(); out of each case and see if it errors.
 

Krystyl_Rose

Wanderer
Grr I am convinced that the fates are against me this evening LOL its errored

RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 17 warnings)
- Error: Scripts\Customs\MountDeed\EtherealMountDeed.cs: CS1501: (line 31, colu
mn 20) No overload for method 'EtherealMountGump' takes '2' arguments
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Packer898

Knight
LOL Im locking up here at work and heading home. Ill be back in once I get home and I will help you get this fixed. Gimme 45 minutes to get home etc... =)-
 
Is the problem still unsolved? otherwise look at the line in the script, where the compiler tells you you see there something like:
EtherealMountGump( anyinstance, maybeanotherinstance )
and you got your script for the EtherealMountGump looking like:
public EtherealMountGump( Mobile owner ) : base( 30, 20 )
then you need are only required to deliver only one instance of a Mobile to the new EtherealMountGump...
Short: Just put in the required instances. :p
 

Krystyl_Rose

Wanderer
ok I tried the suggestion Kamuflaro gave (as best I understood it anyway) and it didnt work... I think I may not have understood correctly or something what I did was to change
public EtherealMountGump( Mobile owner ) : base( 30, 20 )
to
public EtherealMountGump( Mobile owner ) : base( 20 )
 

Packer898

Knight
Here try this... tell me if it works. I just combined the two so I could see what was happening a little better. In the deed you defined the gump as(from; this) and I had you delete that from the gump which is why the errors.

Anyway try this should work now. Remove both of the other two files. EtherealDeed.cs and EtherealMountGUmp.cs first.
Code:
using System;
using System.Net;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
	public class EtherealMountDeed : Item
	{
		
		[Constructable]
		public EtherealMountDeed() : base ( 0x14F0 )
		{
			Name = "Ethereal Mount Deed";
			Weight = 1.0;
			LootType = LootType.Blessed;
			Hue = 1150;
		}
		public EtherealMountDeed ( Serial serial ) : base ( serial )
		{
		}
		
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				from.SendGump( new EtherealMountGump( from ) );
			}
		}
		
		public override void Serialize ( GenericWriter writer)
		{
			base.Serialize ( writer );
			
			writer.Write( (int) 0 ); // version
		}
		
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize ( reader );
			
			int version = reader.ReadInt();
		}
	}
	
	public class EtherealMountGump : Gump
	{
		private Mobile m_From;
		private EtherealMountDeed m_Deed;
		
		public EtherealMountGump( Mobile owner ) : base( 30, 20 )
		{
			
			
			AddPage ( 1 );
			
			AddBackground( 0, 0, 300, 400, 5054 );
			AddBackground( 8, 8, 284, 384, 3000 );
			
			AddLabel( 40, 12, 0, "Ethereal List" );
			
			AddLabel( 52, 40, 0, "Ethereal Horse" );
			AddButton( 12, 40, 4005, 4007, 1, GumpButtonType.Reply, 1 );
			AddLabel( 52, 60, 0, "Ethereal Llama" );
			AddButton( 12, 60, 4005, 4007, 2, GumpButtonType.Reply, 2 );
			AddLabel( 52, 80, 0, "Ethereal Ostard" );
			AddButton( 12, 80, 4005, 4007, 3, GumpButtonType.Reply, 3 );
			AddLabel( 52, 100, 0, "Ethereal Ridgeback" );
			AddButton( 12, 100, 4005, 4007, 4, GumpButtonType.Reply, 4 );
			AddLabel( 52, 120, 0, "Ethereal Unicorn" );
			AddButton( 12, 120, 4005, 4007, 5, GumpButtonType.Reply, 5 );
			AddLabel( 52, 140, 0, "Ethereal Beetle" );
			AddButton( 12, 140, 4005, 4007, 6, GumpButtonType.Reply, 6 );
			AddLabel( 52, 160, 0, "Ethereal Ki-Rin" );
			AddButton( 12, 160, 4005, 4007, 7, GumpButtonType.Reply, 7 );
			AddLabel( 52, 180, 0, "Ethereal Swamp Dragon" );
			AddButton( 12, 180, 4005, 4007, 8, GumpButtonType.Reply, 8 );
			AddLabel( 52, 200, 0, "Ethereal Hiryu" );
			AddButton( 12, 200, 4005, 4007, 9, GumpButtonType.Reply, 9 );
			AddLabel( 52, 220, 0, "Close" );
			AddButton( 12, 220, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
		
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			
			switch ( info.ButtonID )
			{
				case 0: //Close Gump
					{
						from.CloseGump( typeof( EtherealMountGump ) );
						break;
					}
				case 1: // Ethereal Horse
					{
						from.AddToBackpack( new EtherealHorse() );
						from.SendMessage( "An Ethereal Horse has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 2: // Ethereal Llama
					{
						from.AddToBackpack( new EtherealLlama() );
						from.SendMessage( "An Ethereal Llama has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 3: // Ethereal Ostard
					{
						from.AddToBackpack( new EtherealOstard() );
						from.SendMessage( "An Ethereal Ostard has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 4: // Ethereal Ridgeback
					{
						from.AddToBackpack( new EtherealRidgeback() );
						from.SendMessage( "An Ethereal Ridgeback has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 5: // Ethereal Unicorn
					{
						from.AddToBackpack( new EtherealUnicorn() );
						from.SendMessage( "An Ethereal Unicorn has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 6: //Ethereal Beetle
					{
						from.AddToBackpack( new EtherealBeetle() );
						from.SendMessage( "An Ethereal Beetle has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 7: //Ethereal Ki-Rin
					{
						from.AddToBackpack( new EtherealKirin() );
						from.SendMessage( "An Ethereal Ki-Rin has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 8: //Ethereal Swamp Dragon
					{
						from.AddToBackpack( new EtherealSwampDragon() );
						from.SendMessage( "An Ethereal Swamp Dragon has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
				case 9: //Ethereal Hiryu
					{
						from.AddToBackpack( new EtherealHiryu() );
						from.SendMessage( "An Ethereal Hiryu has been placed into your backpack." );
						from.CloseGump( typeof( EtherealMountGump ) );
						m_Deed.Delete();
						break;
					}
			}
		}
	}
}
 

Krystyl_Rose

Wanderer
nope crashed again..... it compiles and everything just isnt usable for some reason
I think I will have to rename my shard Yo-Yo ROFL
 

Krystyl_Rose

Wanderer
oops sorry I actually meant to post that

Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 9/12/2005 10:59:44 PM
Mobiles: 11426
Items: 105661
Clients:
- Count: 1

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.EtherealMountGump.OnResponse(NetState state, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Packer898

Knight
Herer try this.
Code:
using System;
using System.Net;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Prompts;
using Server.Targeting;

namespace Server.Items
{
	public class EtherealMountDeed : Item
	{
		
		[Constructable]
		public EtherealMountDeed() : base ( 0x14F0 )
		{
			Name = "Ethereal Mount Deed";
			Weight = 1.0;
			LootType = LootType.Blessed;
			Hue = 1150;
		}
		public EtherealMountDeed ( Serial serial ) : base ( serial )
		{
		}
		
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				from.SendGump( new EtherealMountGump( from ) );
				this.Delete();
			}
		}
		
		public override void Serialize ( GenericWriter writer)
		{
			base.Serialize ( writer );
			
			writer.Write( (int) 0 ); // version
		}
		
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize ( reader );
			
			int version = reader.ReadInt();
		}
	}
	
	public class EtherealMountGump : Gump
	{
		private Mobile m_From;
		private EtherealMountDeed m_Deed;
		
		public EtherealMountGump( Mobile owner ) : base( 30, 20 )
		{
			
			
			AddPage ( 1 );
			
			AddBackground( 0, 0, 300, 400, 5054 );
			AddBackground( 8, 8, 284, 384, 3000 );
			
			AddLabel( 40, 12, 0, "Ethereal List" );
			
			AddLabel( 52, 40, 0, "Ethereal Horse" );
			AddButton( 12, 40, 4005, 4007, 1, GumpButtonType.Reply, 1 );
			AddLabel( 52, 60, 0, "Ethereal Llama" );
			AddButton( 12, 60, 4005, 4007, 2, GumpButtonType.Reply, 2 );
			AddLabel( 52, 80, 0, "Ethereal Ostard" );
			AddButton( 12, 80, 4005, 4007, 3, GumpButtonType.Reply, 3 );
			AddLabel( 52, 100, 0, "Ethereal Ridgeback" );
			AddButton( 12, 100, 4005, 4007, 4, GumpButtonType.Reply, 4 );
			AddLabel( 52, 120, 0, "Ethereal Unicorn" );
			AddButton( 12, 120, 4005, 4007, 5, GumpButtonType.Reply, 5 );
			AddLabel( 52, 140, 0, "Ethereal Beetle" );
			AddButton( 12, 140, 4005, 4007, 6, GumpButtonType.Reply, 6 );
			AddLabel( 52, 160, 0, "Ethereal Ki-Rin" );
			AddButton( 12, 160, 4005, 4007, 7, GumpButtonType.Reply, 7 );
			AddLabel( 52, 180, 0, "Ethereal Swamp Dragon" );
			AddButton( 12, 180, 4005, 4007, 8, GumpButtonType.Reply, 8 );
			AddLabel( 52, 200, 0, "Ethereal Hiryu" );
			AddButton( 12, 200, 4005, 4007, 9, GumpButtonType.Reply, 9 );
			AddLabel( 52, 220, 0, "Close" );
			AddButton( 12, 220, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
		
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			
			switch ( info.ButtonID )
			{
				case 0: //Close Gump
					{
						from.AddToBackpack( new EtherealMountDeed () );
                                                from.SendMessage( "You decide not to select an ethereal mount, the deed has been replaced." );
						break;
					}
				case 1: // Ethereal Horse
					{
						from.AddToBackpack( new EtherealHorse() );
						from.SendMessage( "An Ethereal Horse has been placed into your backpack." );
						break;
					}
				case 2: // Ethereal Llama
					{
						from.AddToBackpack( new EtherealLlama() );
						from.SendMessage( "An Ethereal Llama has been placed into your backpack." );
						break;
					}
				case 3: // Ethereal Ostard
					{
						from.AddToBackpack( new EtherealOstard() );
						from.SendMessage( "An Ethereal Ostard has been placed into your backpack." );
						break;
					}
				case 4: // Ethereal Ridgeback
					{
						from.AddToBackpack( new EtherealRidgeback() );
						from.SendMessage( "An Ethereal Ridgeback has been placed into your backpack." );
						break;
					}
				case 5: // Ethereal Unicorn
					{
						from.AddToBackpack( new EtherealUnicorn() );
						from.SendMessage( "An Ethereal Unicorn has been placed into your backpack." );
						break;
					}
				case 6: //Ethereal Beetle
					{
						from.AddToBackpack( new EtherealBeetle() );
						from.SendMessage( "An Ethereal Beetle has been placed into your backpack." );
						break;
					}
				case 7: //Ethereal Ki-Rin
					{
						from.AddToBackpack( new EtherealKirin() );
						from.SendMessage( "An Ethereal Ki-Rin has been placed into your backpack." );
						break;
					}
				case 8: //Ethereal Swamp Dragon
					{
						from.AddToBackpack( new EtherealSwampDragon() );
						from.SendMessage( "An Ethereal Swamp Dragon has been placed into your backpack." );
						break;
					}
				case 9: //Ethereal Hiryu
					{
						from.AddToBackpack( new EtherealHiryu() );
						from.SendMessage( "An Ethereal Hiryu has been placed into your backpack." );
						break;
					}
			}
		}
	}
}
 
Top