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!

New player starting point...

eragon

Wanderer
New player starting point...

Well i been looking through the server scripts and i was wondering... what script and where can i change the starting point of a newly created account? like i know the co-ordinates and i would like to apply them... :confused: x
 

Marak

Sorceror
charactercreation.cs i believe (its been a while since i changed them) - there's acouple of fields because certain types of character spawn in different locations.
 

Kiki

Wanderer
Code:
[COLOR=Red]//[/color]CityInfo city = GetStartLocation( args, young );
//This is the section you edit for a custom starting location. By default they have Brit. Inn here.

			CityInfo city = new CityInfo( [color=blue][b]"CityName", "LocationName", x, y, z, Map.FacetName[/b][/color] );

			newChar.MoveToWorld( city.Location, city.Map );

			Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username );
			Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial );
			Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() );

			new WelcomeTimer( newChar ).Start();
		}

		public static bool VerifyProfession( int profession )
		{
			if ( profession < 0 )
				return false;
			else if ( profession < 4 )
				return true;
			else if ( Core.AOS && profession < 6 )
				return true;
			else if ( Core.SE && profession < 8 )
				return true;
			else
				return false;
		}

		[COLOR=Red]/*[/color]	private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
		{
			switch ( args.Profession )
			{
				case 4: //Necro
				{
					return new CityInfo( "Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas );
				}
				case 5:	//Paladin
				{
					return new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel );
				}
				case 6:	//Samurai
				{
					return new CityInfo( "Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas );
				}
				case 7:	//Ninja
				{
					return new CityInfo( "Ninja DE", "Enimo's Residence", 414, 823, -1, Map.Malas );
				}
				default:
				{
					if( isYoung )
						return new CityInfo( "Haven", "Uzeraan's Mansion", 3582, 2587, 0, Map.Trammel );
					else
						return args.City;
				}
			}
		}	[COLOR=Red]*/[/color]

If you look at the above script snippet from my modified CharacterCreation.cs You'll see what has to be changed.

Mine starts in a custom location in Ilshenar (we aren't using the tram/fel maps at this time) I commented out (the // at the beginning) the part that told the script to use young player starting locations.. and the Young player starting locations themselves (thats the /* all the way till you see the */)

The bold blue text is where you put in your custom info.

those symbols // and /* - */ tell the RunUO compiler not to read those parts of code. // is best for single lines and /* - */ is for multiple lines. You MUST close a /* with the */ but you don't have to close the //.
 

Tintamar

Sorceror
You dont have to keep it so different professions start at different spots if you want ALL new players to start in same locaion just comment out one line and put your coords in the other line.


CharacterCreation.cs
Code:
			//CityInfo city = GetStartLocation( args, young );
			CityInfo city = new CityInfo( "Britain", "Bank", [b]3013, 1061, 0,[/b] Map.Trammel );

Just change the coords that are in bold. change city name and location too. My coords in bold aren't default
 

Uhhhh

Wanderer
Tw1st3d_Dr4g0n said:
ya but what happens if it gives them the option to choose on map to get started ?

Nothing, since the 'args' are being ignored, and that's what stores the CityInfo from the client start point selection screen.
 
Top