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!

UO: SE Question

UO: SE Question

Now that UO: SE is out, I assume (I know, dangerous word) that we can post stuff on that topic. My question is, I installed UO: SE on a test server, but can't access the new map. How would I go about making that part of my "World" so that I and players can access it? I thought it was in the mapdefinitions.cs file, but after several attempts at editing it, it has become clear that

a. I don't understand what the numbers mean or
b. I'm looking in the wrong place, or
c. RunUO 1.0 will not support SE at this time.

Anyone have any suggestions on this?


Thanks,
Ghosthunter
 

dstarz20

Sorceror
You need to edit your mapdefinitions file. It should look like this:

RegisterMap( 0, 0, 0, 6144, 4096, 4, "Felucca", MapRules.FeluccaRules );
RegisterMap( 1, 1, 0, 6144, 4096, 0, "Trammel", MapRules.TrammelRules );
RegisterMap( 2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.FeluccaRules );
RegisterMap( 3, 3, 3, 2560, 2048, 1, "Malas", MapRules.FeluccaRules );
RegisterMap( 4, 4, 4, 1448, 1448, 1, "Samurais", MapRules.FeluccaRules );

4th one beign the new map. If your players don't have the map in their client, they won't be ble to see it.
 
Sounds like I was on the right track, just didn't know the specifics. I see now where I went wrong. Thanks a ton for your help!

Ghosthunter
 

Protius73

Sorceror
Ghost have you gotten this to work?? ive done the mapdefinitions file... but unsure how to get teh moongates to allow activation!! What all did you change??
If ya dont mind sharing that is =)
 

Karmageddon

Sorceror
Ok I must be doing something wrong with my Moongate script because I cannot get it to work with the new map. Here is the code that is pertanent to the problem:
Code:
[Usage( "MoonGen" )]
[Description( "Generates public moongates. Removes all old moongates." )]
	public static void MoonGen_OnCommand( CommandEventArgs e )
	{
		DeleteAll();

		int count = 0;

		count += MoonGen( PMList.Dungeons );
		count += MoonGen( PMList.Felucca );
		count += MoonGen( PMList.Ilshenar );
		count += MoonGen( PMList.IlshenarDungeons );
		count += MoonGen( PMList.Malas );
		count += MoonGen( PMList.Samurais );

	World.Broadcast( 0x35, true, "{0} moongates generated.", count );

Code:
	public static readonly PMList Samurais =
	new PMList( "Tokuno", "Tokuno", Map.Samurais, new PMEntry[]
		{
		new PMEntry( new Point3D( 1169,  998, 41 ), "Isamu-Jima" ), 
		new PMEntry( new Point3D( 802,  1204, 25 ), "Makoto-Jima" ),
		new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" )  
		} );

I have added the new map to the mapdefenition file as such:
Code:
RegisterMap( 0, 0, 0, 6144, 4096, 0, "Felucca",  MapRules.FeluccaRules );
RegisterMap( 1, 1, 0, 6144, 4096, 0, "Trammel",  MapRules.TrammelRules );
RegisterMap( 2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.FeluccaRules );
RegisterMap( 3, 3, 3, 2560, 2048, 1, "Malas",    MapRules.TrammelRules );
RegisterMap( 4, 4, 4, 1448, 1448, 1, "Samurais",   MapRules.TrammelRules );

And these are the errors I am getting:
- Error: Scripts\Items\Misc\PublicMoongate.cs: CS0117: (line 271, column 36) 'S
erver.Map' does not contain a definition for 'Samurais'
- Error: Scripts\Items\Misc\PublicMoongate.cs: CS0103: (line 280, column 114) T
he name 'Tokuno' does not exist in the class or namespace 'Server.Items.PMList'
- Error: Scripts\Items\Misc\PublicMoongate.cs: CS0103: (line 282, column 114) T
he name 'Tokuno' does not exist in the class or namespace 'Server.Items.PMList'

Can anybody tell me what is wrong with what I have done?
Ok I reread the errors and figured out the last 2 errors, which were my mistake because I did not change them..... lol
 

Chandral

Wanderer
I get the same error, that there is no definition in server.map. I'm thinking along the lines that it must be in something other than the mapdest.cs file. Like maybe in the core of the RunUO itself.

Sure hope someone can figure this out. I don't know enough to even know where to begin looking for it.

BYW, if anyone knows where the dungeons are in these lands, Id sure like to find out the coords on those. Or is it such that we are gonna have to build the inside of these dungeons by hand? Oh I hope not!
 

CrazyJester

Wanderer
You can't edit the core Map enum, so you can't use Map.WhateverYouCalledItInRegisterMap but you can refer to it as Map.Maps[4]
 
I know this is kind of cheesey, but I don't have a world of time right now. I just set up teleporters between the islands and Malas for the time being. I don't even have time to inhabit the island. Its just to give my players an opportunity to see the new map and get an idea of the lay of the land before the next release. I don't plan on getting too ahead of myself, as Phantom says the next release will have "most, if not all" of what I need to set up the islands.
This may seem like the lazy way to do it, but I just became a single dad, as well as having a sick mother in the hospital, and I don't have enough time right now to mess with it.

Sorry I couldn't have been more help.

Ghosthunter
 

Ace2082

Wanderer
Ok i did what you said with the mapdest.cs i try to add it to the pub moongate. and got 9 errors and 4 warnnings. if any one can help with the code for adding it to the pub moongates please let me know. i try the map.maps[4] and i got errors on the PMEntries. it would help if i could get the PMList and PMEntry code. thanks
 

Phantom

Knight
Ace2082 said:
Ok i did what you said with the mapdest.cs i try to add it to the pub moongate. and got 9 errors and 4 warnnings. if any one can help with the code for adding it to the pub moongates please let me know. i try the map.maps[4] and i got errors on the PMEntries. it would help if i could get the PMList and PMEntry code. thanks

Post the errors, otherwise we cannot fix them.

Might want to pose the code too...You better have actually tried to do this yourself.
 

Karmageddon

Sorceror
If you look at the code snippets in my post there is only one thing that needs to be changed to get it to work.
Code:
new PMList( "Tokuno", "Tokuno", Map.Samurais, new PMEntry[]

This line needs to be changed to this:
Code:
new PMList( "Tokuno", "Tokuno", Map.Maps[4], new PMEntry[]

And it should work fine as long as you have your publicmoongate scripted to accept strings instead of int.
 

LordHogFred

Knight
I tried this and still got erros concerning the PMList. something to do with not being able to convert int to string and using 2 varibles. I dont have the erros with me right now but thats what I know I got.
 

Ace2082

Wanderer
Ok this is the PublicMoongate.cs Script
Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
	public class PublicMoongate : Item
	{
		[Constructable]
		public PublicMoongate() : base( 0xF6C )
		{
			Movable = false;
			Light = LightType.Circle300;
		}

		public PublicMoongate( Serial serial ) : base( serial )
		{
		}

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.Player )
				return;

			if ( from.InRange( GetWorldLocation(), 1 ) )
				UseGate( from );
			else
				from.SendLocalizedMessage( 500446 ); // That is too far away.
		}

		public override bool OnMoveOver( Mobile m )
		{
			return !m.Player || UseGate( m );
		}

		public bool UseGate( Mobile m )
		{
			if ( m.Criminal )
			{
				m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
				return false;
			}
			else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
			{
				m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
				return false;
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
				return false;
			}
			else
			{
				m.CloseGump( typeof( MoongateGump ) );
				m.SendGump( new MoongateGump( m, this ) );

				Effects.PlaySound( m.Location, m.Map, 0x20E );
				return true;
			}
		}

		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 static void Initialize()
		{
			Server.Commands.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) );
		}

		[Usage( "MoonGen" )]
		[Description( "Generates public moongates. Removes all old moongates." )]
		public static void MoonGen_OnCommand( CommandEventArgs e )
		{
			DeleteAll();

			int count = 0;

			count += MoonGen( PMList.Trammel );
			count += MoonGen( PMList.Felucca );
			count += MoonGen( PMList.Ilshenar );
			count += MoonGen( PMList.Malas );
			count += MoonGen( PMList.Samurais );

			World.Broadcast( 0x35, true, "{0} moongates generated.", count );
		}

		private static void DeleteAll()
		{
			ArrayList list = new ArrayList();

			foreach ( Item item in World.Items.Values )
			{
				if ( item is PublicMoongate )
					list.Add( item );
			}

			foreach ( Item item in list )
				item.Delete();

			if ( list.Count > 0 )
				World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count );
		}

		private static int MoonGen( PMList list )
		{
			foreach ( PMEntry entry in list.Entries )
			{
				Item item = new PublicMoongate();

				item.MoveToWorld( entry.Location, list.Map );

				if ( entry.Number == 1060642 ) // Umbra
					item.Hue = 0x497;
			}

			return list.Entries.Length;
		}
	}

	public class PMEntry
	{
		private Point3D m_Location;
		private int m_Number;

		public Point3D Location
		{
			get
			{
				return m_Location;
			}
		}

		public int Number
		{
			get
			{
				return m_Number;
			}
		}

		public PMEntry( Point3D loc, int number )
		{
			m_Location = loc;
			m_Number = number;
		}
	}

	public class PMList
	{
		private int m_Number, m_SelNumber;
		private Map m_Map;
		private PMEntry[] m_Entries;

		public int Number
		{
			get
			{
				return m_Number;
			}
		}

		public int SelNumber
		{
			get
			{
				return m_SelNumber;
			}
		}

		public Map Map
		{
			get
			{
				return m_Map;
			}
		}

		public PMEntry[] Entries
		{
			get
			{
				return m_Entries;
			}
		}

		public PMList( int number, int selNumber, Map map, PMEntry[] entries )
		{
			m_Number = number;
			m_SelNumber = selNumber;
			m_Map = map;
			m_Entries = entries;
		}

		public static readonly PMList Trammel =
			new PMList( 1012000, 1012012, Map.Trammel, new PMEntry[]
				{
					new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
					new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
					new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
					new PMEntry( new Point3D(  771,  752, 5 ), 1012006 ), // Yew
					new PMEntry( new Point3D( 2701,  692, 5 ), 1012007 ), // Minoc
					new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
					new PMEntry( new Point3D(  643, 2067, 5 ), 1012009 ), // Skara Brae
					new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
					new PMEntry( new Point3D( 3763, 2771, 50), 1046259 )  // Haven
				} );

		public static readonly PMList Felucca =
			new PMList( 1012001, 1012013, Map.Felucca, new PMEntry[]
				{
					new PMEntry( new Point3D( 4467, 1283, 5 ), 1012003 ), // Moonglow
					new PMEntry( new Point3D( 1336, 1997, 5 ), 1012004 ), // Britain
					new PMEntry( new Point3D( 1499, 3771, 5 ), 1012005 ), // Jhelom
					new PMEntry( new Point3D(  771,  752, 5 ), 1012006 ), // Yew
					new PMEntry( new Point3D( 2701,  692, 5 ), 1012007 ), // Minoc
					new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
					new PMEntry( new Point3D(  643, 2067, 5 ), 1012009 ), // Skara Brae
					new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
					new PMEntry( new Point3D( 2711, 2234, 0 ), 1019001 )  // Buccaneer's Den
				} );

		public static readonly PMList Ilshenar =
			new PMList( 1012002, 1012014, Map.Ilshenar, new PMEntry[]
				{
					new PMEntry( new Point3D( 1215,  467, -13 ), 1012015 ), // Compassion
					new PMEntry( new Point3D(  722, 1366, -60 ), 1012016 ), // Honesty
					new PMEntry( new Point3D(  744,  724, -28 ), 1012017 ), // Honor
					new PMEntry( new Point3D(  281, 1016,   0 ), 1012018 ), // Humility
					new PMEntry( new Point3D(  987, 1011, -32 ), 1012019 ), // Justice
					new PMEntry( new Point3D( 1174, 1286, -30 ), 1012020 ), // Sacrifice
					new PMEntry( new Point3D( 1532, 1340, - 3 ), 1012021 ), // Spirituality
					new PMEntry( new Point3D(  528,  216, -45 ), 1012022 ), // Valor
					new PMEntry( new Point3D( 1721,  218,  96 ), 1019000 )  // Chaos
				} );

		public static readonly PMList Malas =
			new PMList( 1060643, 1062039, Map.Malas, new PMEntry[]
				{
					new PMEntry( new Point3D( 1015,  527, -65 ), 1060641 ), // Luna
					new PMEntry( new Point3D( 1997, 1386, -85 ), 1060642 )  // Umbra
				} );

		public static readonly PMList Samurais =
			new PMList( "Tokuno", "Tokuno", Map.Maps[4], new PMEntry[]
				{
					new PMEntry( new Point3D( 1169, 998, 41 ), Tokuno ) // Ismau-Jima
				} );

		public static readonly PMList[] UORLists = new PMList[]{ Trammel, Felucca };
		public static readonly PMList[] LBRLists = new PMList[]{ Trammel, Felucca, Ilshenar };
		public static readonly PMList[] AOSLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas };
		public static readonly PMList[] RedLists = new PMList[]{ Felucca };
	}

	public class MoongateGump : Gump
	{
		private Mobile m_Mobile;
		private Item m_Moongate;
		private PMList[] m_Lists;

		public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 )
		{
			m_Mobile = mobile;
			m_Moongate = moongate;

			PMList[] checkLists;

			if ( mobile.Player )
			{
				if ( mobile.Kills >= 5 )
				{
					checkLists = PMList.RedLists;
				}
				else
				{
					int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;

					if ( Core.AOS && (flags & 0x8) != 0 )
						checkLists = PMList.AOSLists;
					else if ( (flags & 0x4) != 0 )
						checkLists = PMList.LBRLists;
					else
						checkLists = PMList.UORLists;
				}
			}
			else
			{
				checkLists = PMList.AOSLists;
			}

			m_Lists = new PMList[checkLists.Length];

			for ( int i = 0; i < m_Lists.Length; ++i )
				m_Lists[i] = checkLists[i];

			for ( int i = 0; i < m_Lists.Length; ++i )
			{
				if ( m_Lists[i].Map == mobile.Map )
				{
					PMList temp = m_Lists[i];

					m_Lists[i] = m_Lists[0];
					m_Lists[0] = temp;

					break;
				}
			}

			AddPage( 0 );

			AddBackground( 0, 0, 380, 280, 5054 );

			AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY

			AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL

			AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:

			for ( int i = 0; i < checkLists.Length; ++i )
			{
				AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
				AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false );
			}

			for ( int i = 0; i < m_Lists.Length; ++i )
				RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
		}

		private void RenderPage( int index, int offset )
		{
			PMList list = m_Lists[index];

			AddPage( index + 1 );

			AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
			AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false );

			PMEntry[] entries = list.Entries;

			for ( int i = 0; i < entries.Length; ++i )
			{
				AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
				AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false );
			}
		}

		public override void OnResponse( NetState state, RelayInfo info )
		{
			if ( info.ButtonID == 0 ) // Cancel
				return;
			else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
				return;

			int[] switches = info.Switches;

			if ( switches.Length == 0 )
				return;

			int switchID = switches[0];
			int listIndex = switchID / 100;
			int listEntry = switchID % 100;

			if ( listIndex < 0 || listIndex >= m_Lists.Length )
				return;

			PMList list = m_Lists[listIndex];

			if ( listEntry < 0 || listEntry >= list.Entries.Length )
				return;

			PMEntry entry = list.Entries[listEntry];

			if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map )
			{
				m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
			}
			else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca )
			{
				m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m_Mobile.Criminal )
			{
				m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
			}
			else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
			{
				m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
			}
			else if ( m_Mobile.Spell != null )
			{
				m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
			else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
			{
				m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
			}
			else
			{
	BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );

				m_Mobile.Combatant = null;
				m_Mobile.Warmode = false;
	m_Mobile.Hidden = true;

	m_Mobile.MoveToWorld( entry.Location, list.Map );

	Effects.PlaySound( entry.Location, list.Map, 0x1FE );
			}
		}
	}
}

ok now there is (4 errors, 4 warnings)
some scripts it's listing that i know is fine so i would have to say that there is 2 errors and 2 warnings where is the pub moongate error code

Code:
- Error: Scripts\Items\Misc\PublicMoongate.cs: CS0103: (line 261, column 49) the name'Tokuno' dose not exist in the class or namespace 'sever.Items.PMList'
- Error: Scripts\items\misc\publicmoongate.cs : CS1503: ( line 259, column 4) the best overloaded method match for 'sever.items.pmlist.pmlist(int, int, sever.map, sever.items.pmentry[]' has some invalid arguments
- Erros: Scripts\items\misc\publicmoongate.cs: cs1503: (line 259, column 16) Argument '1' : canot convert from 'string' to 'int'
-Error: Script\Itmes\misc\publicmoongate.cs: CS1503: (line 259, column 26) Argument '2': cannot convert from 'string' to 'int'

SO any way u can help me out now.please let me know and repost any changes. Thanks
 

Admin_V

Wanderer
ok here is what your looking for tested and works good

PublicMoongate.cs

Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
	public class PublicMoongate : Item
	{
		[Constructable]
		public PublicMoongate() : base( 0xF6C )
		{
			Movable = false;
			Light = LightType.Circle300;
		}

		public PublicMoongate( Serial serial ) : base( serial )
		{
		}

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.Player )
				return;

			if ( from.InRange( GetWorldLocation(), 1 ) )
				UseGate( from );
			else
				from.SendLocalizedMessage( 500446 ); // That is too far away.
		}

		public override bool OnMoveOver( Mobile m )
		{
			return !m.Player || UseGate( m );
		}

		public bool UseGate( Mobile m )
		{
			if ( m.Criminal )
			{
				m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
				return false;
			}
			else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
			{
				m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
				return false;
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
				return false;
			}
			else
			{
				m.CloseGump( typeof( MoongateGump ) );
				m.SendGump( new MoongateGump( m, this ) );

				Effects.PlaySound( m.Location, m.Map, 0x20E );
				return true;
			}
		}

		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 static void Initialize()
		{
			Server.Commands.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) );
		}

		[Usage( "MoonGen" )]
		[Description( "Generates public moongates. Removes all old moongates." )]
		public static void MoonGen_OnCommand( CommandEventArgs e )
		{
			DeleteAll();

			int count = 0;

			count += MoonGen( PMList.Trammel );
			count += MoonGen( PMList.Felucca );
			count += MoonGen( PMList.Ilshenar );
			count += MoonGen( PMList.Malas );
                        count += MoonGen( PMList.Tokuno );

                        

			World.Broadcast( 0x35, true, "{0} moongates generated.", count );
		}

		private static void DeleteAll()
		{
			ArrayList list = new ArrayList();

			foreach ( Item item in World.Items.Values )
			{
				if ( item is PublicMoongate )
					list.Add( item );
			}

			foreach ( Item item in list )
				item.Delete();

			if ( list.Count > 0 )
				World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count );
		}

		private static int MoonGen( PMList list )
		{
			foreach ( PMEntry entry in list.Entries )
			{
				Item item = new PublicMoongate();

				item.MoveToWorld( entry.Location, list.Map );

			}

			return list.Entries.Length;
		}
	}

	public class PMEntry
	{
		private Point3D m_Location;
		private string m_Text;

		public Point3D Location
		{
			get
			{
				return m_Location;
			}
		}

		public string Text
		{
			get
			{
				return m_Text;
			}
		}

      public PMEntry( Point3D loc, string text ) 
      { 
         m_Location = loc; 
         m_Text = text; 
      } 
	}

	public class PMList
	{
		private string m_Text, m_SelText;
		private Map m_Map;
		private PMEntry[] m_Entries;

		public string Text
		{
			get
			{
				return m_Text;
			}
		}

		public string SelText
				{
			get
			{
				return m_SelText;
			}
		}

		public Map Map
		{
			get
			{
				return m_Map;
			}
		}

		public PMEntry[] Entries
		{
			get
			{
				return m_Entries;
			}
		}

		public PMList( string text, string selText, Map map, PMEntry[] entries )
		{
			m_Text = text;
			m_SelText = selText;
			m_Map = map;
			m_Entries = entries;
		}


		public static readonly PMList Trammel =
			new PMList( "Trammel", "Trammel", Map.Trammel, new PMEntry[]
				{
					new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow
					new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain
					new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom
					new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew
					new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc
					new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic
					new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae
					new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia
					new PMEntry( new Point3D( 3763, 2771, 50), "Haven" )  // Haven
				} );

		public static readonly PMList Felucca =
			new PMList( "Felucca", "Felucca", Map.Felucca, new PMEntry[]
				{
					new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow
					new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain
					new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom
					new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew
					new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc
					new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic
					new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae
					new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia
					new PMEntry( new Point3D( 2711, 2234, 0 ), "Buccaneer's Den" )  // Buccaneer's Den
				} );

		public static readonly PMList Ilshenar =
			new PMList( "Ilshenar", "Ilshenar", Map.Ilshenar, new PMEntry[]
				{
					new PMEntry( new Point3D( 1215,  467, -13 ), "Compassion" ), // Compassion
					new PMEntry( new Point3D(  722, 1366, -60 ), "Honesty" ), // Honesty
					new PMEntry( new Point3D(  744,  724, -28 ), "Honor" ), // Honor
					new PMEntry( new Point3D(  281, 1016,   0 ), "Humility" ), // Humility
					new PMEntry( new Point3D(  987, 1011, -32 ), "Justice" ), // Justice
					new PMEntry( new Point3D( 1174, 1286, -30 ), "Sacrifice" ), // Sacrifice
					new PMEntry( new Point3D( 1532, 1340, - 3 ), "Spirituality" ), // Spirituality
					new PMEntry( new Point3D(  528,  216, -45 ), "Valor" ), // Valor
					new PMEntry( new Point3D( 1721,  218,  96 ), "Chaos" )  // Chaos
				} );

		public static readonly PMList Malas =
			new PMList( "Malas", "Malas", Map.Malas, new PMEntry[]
				{
					new PMEntry( new Point3D( 1015,  527, -65 ), "Luna" ), // Luna
					new PMEntry( new Point3D( 1997, 1386, -85 ), "Umbra" )  // Umbra
				} );

                public static readonly PMList Tokuno =
			new PMList( "Tokuno", "Tokuno", Map.Maps[4], new PMEntry[]
				{
					new PMEntry( new Point3D( 1169,  998, 41 ), "Isamu-Jima" ), 
		                        new PMEntry( new Point3D(  802, 1204, 25 ), "Makoto-Jima" ),
		                        new PMEntry( new Point3D(  270,  628, 15 ), "Homare-Jima" )
				} );

		public static readonly PMList[] UORLists = new PMList[]{ Trammel, Felucca };
		public static readonly PMList[] LBRLists = new PMList[]{ Trammel, Felucca, Ilshenar };
		public static readonly PMList[] AOSLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, Tokuno };
		public static readonly PMList[] RedLists = new PMList[]{ Felucca };
	}

	public class MoongateGump : Gump
	{
		private Mobile m_Mobile;
		private Item m_Moongate;
		private PMList[] m_Lists;

		public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 )
		{
			m_Mobile = mobile;
			m_Moongate = moongate;

			PMList[] checkLists;

			if ( mobile.Player )
			{
				if ( mobile.Kills >= 5 )
				{
					checkLists = PMList.RedLists;
				}
				else
				{
					int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags;

					if ( Core.AOS && (flags & 0x8) != 0 )
						checkLists = PMList.AOSLists;
					else if ( (flags & 0x4) != 0 )
						checkLists = PMList.LBRLists;
					else
						checkLists = PMList.UORLists;
				}
			}
			else
			{
				checkLists = PMList.AOSLists;
			}

			m_Lists = new PMList[checkLists.Length];

			for ( int i = 0; i < m_Lists.Length; ++i )
				m_Lists[i] = checkLists[i];

			for ( int i = 0; i < m_Lists.Length; ++i )
			{
				if ( m_Lists[i].Map == mobile.Map )
				{
					PMList temp = m_Lists[i];

					m_Lists[i] = m_Lists[0];
					m_Lists[0] = temp;

					break;
				}
			}

			AddPage( 0 );

			AddBackground( 0, 0, 380, 280, 5054 );

			AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 210, 140, 25, 1011036,  false, false ); // OKAY

			AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 45, 235, 140, 25, 1011012,  false, false ); // CANCEL

			AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination:

			 for ( int i = 0; i < checkLists.Length; ++i )
			 {
				  AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 );
				  AddLabel( 30, 35 + (i * 25), 0, checkLists[i].Text );
			 }

			for ( int i = 0; i < m_Lists.Length; ++i )
				 RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) );
		}

		private void RenderPage( int index, int offset )
		{
			PMList list = m_Lists[index];

			AddPage( index + 1 );

			AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 );
			AddLabel( 30, 35 + (offset * 25), 0, list.SelText );

			PMEntry[] entries = list.Entries;

			for ( int i = 0; i < entries.Length; ++i )
			{
			AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i );
	            AddHtml( 225, 35 + (i * 25), 250, 20, entries[i].Text, false, false ); 
			}
		}

		public override void OnResponse( NetState state, RelayInfo info )
		{
			if ( info.ButtonID == 0 ) // Cancel
				return;
			else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null )
				return;

			int[] switches = info.Switches;

			if ( switches.Length == 0 )
				return;

			int switchID = switches[0];
			int listIndex = switchID / 100;
			int listEntry = switchID % 100;

			if ( listIndex < 0 || listIndex >= m_Lists.Length )
				return;

			PMList list = m_Lists[listIndex];

			if ( listEntry < 0 || listEntry >= list.Entries.Length )
				return;

			PMEntry entry = list.Entries[listEntry];

			if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map )
			{
				m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate.
			}
			else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca )
			{
				m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m_Mobile.Criminal )
			{
				m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
			}
			else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) )
			{
				m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
			}
			else if ( m_Mobile.Spell != null )
			{
				m_Mobile.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
			else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) )
			{
				m_Mobile.SendLocalizedMessage( 1019003 ); // You are already there.
			}
			else
			{
				BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );

				m_Mobile.Combatant = null;
				m_Mobile.Warmode = false;
				m_Mobile.Hidden = true;
				m_Mobile.Map = list.Map;
				m_Mobile.Location = entry.Location;

				Effects.PlaySound( entry.Location, list.Map, 0x1FE );
			}
		}
	}
}

and you might want this

MapDefinitions.cs
Code:
using System;
using Server;

namespace Server.Misc
{
	public class MapDefinitions
	{
		public static void Configure()
		{
			/* Here we configure all maps. Some notes:
			 * 
			 * 1) The first 32 maps are reserved for core use.
			 * 2) Map 0x7F is reserved for core use.
			 * 3) Map 0xFF is reserved for core use.
			 * 4) Changing or removing any predefined maps may cause server instability.
			 */

			RegisterMap( 0, 0, 0, 6144, 4096, 4, "Felucca", MapRules.FeluccaRules );
                        RegisterMap( 1, 1, 0, 6144, 4096, 0, "Trammel", MapRules.TrammelRules );
                        RegisterMap( 2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.FeluccaRules );
                        RegisterMap( 3, 3, 3, 2560, 2048, 1, "Malas", MapRules.FeluccaRules );
                        RegisterMap( 4, 4, 4, 1448, 1448, 1, "Tokuno", MapRules.TrammelRules );


			RegisterMap( 0x7F, 0x7F, 0x7F, Map.SectorSize, Map.SectorSize, 1, "Internal", MapRules.Internal );

			/* Example of registering a custom map:
			 * RegisterMap( 32, 0, 0, 6144, 4096, 3, "Iceland", MapRules.FeluccaRules );
			 * 
			 * Defined:
			 * RegisterMap( <index>, <mapID>, <fileIndex>, <width>, <height>, <season>, <name>, <rules> );
			 *  - <index> : An unreserved unique index for this map
			 *  - <mapID> : An identification number used in client communications. For any visible maps, this value must be from 0-3
			 *  - <fileIndex> : A file identification number. For any visible maps, this value must be 0, 2, or 3
			 *  - <width>, <height> : Size of the map (in tiles)
			 *  - <name> : Reference name for the map, used in props gump, get/set commands, region loading, etc
			 *  - <rules> : Rules and restrictions associated with the map. See documentation for details
			*/
		}

		public static void RegisterMap( int mapIndex, int mapID, int fileIndex, int width, int height, int season, string name, MapRules rules )
		{
			Map newMap = new Map( mapID, mapIndex, fileIndex, width, height, season, name, rules );

			Map.Maps[mapIndex] = newMap;
			Map.AllMaps.Add( newMap );
		}
	}
}
 

Gandy897

Wanderer
Worked like a charm ! :)
This is prolly a stupid question , but like all silly question askers im gonna ask anyway lol .. when players mark a rune in malas it turns grey etc.. i was wondering if anyone knows what script handles that so i can have the tokuno runes also change shade when marked there .. at the moment they default to just plaing black text/font ?
 
new PMList( "Tokuno", "Tokuno", Map.Maps[4], new PMEntry[]

change this to:
new PMList( 1063258, 1063415, Map.Maps[4], new PMEntry[]
and that should get rid of 2 of your errors
 
Top