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!

RunUO Basic Scripts

DustBuster

Wanderer
RunUO Basic Scripts

In order to change anything, you have to know where to look. The following list shows which file allows you to change what. In RunUO, any *.cs file in the scripts directory is read as a script. I won’t be discussing how the actual scripts work in this article, just the basic things that you may want to change. However, just reading the lines that you are editing will help you learn, as most of the stuff in here is pretty straightforward.

We will start with the Scripts\Misc\ folder. Inside this folder we see another folder, and a bunch of .cs files. If you look in the Test Center folder you notice two .cs files. The HelpGump file contains the source code for; you guessed it, the Help Gump! Incase you don’t know what a gump is, it is a collection of artwork that is sent to a client. Things such as the guild stone menu. If you are in game and say “help” then the Help Gump is displayed for you to see an example of a gump. The SetSkills file contains the source code for the ability to set skills by saying, “set skill int” (“set magery 100”). If you don’t want a test center style shard, you can just delete the Test Center folder, and players will no longer be able to change their own skills as they wish.

Back in the Misc folder we see the file AccountHandler.cs. This file is the one that allows you to change between auto-account (players can login without you verifying them, and this script will create an account if the username they entered is not being used already), or not auto account (in which case you will have to add a method of adding accounts another way). If you want to check what your current setting is, you can open the .cs file now. If you don’t have Microsoft Visual Studio.NET or SharpDevelop, I suggest you get one of the two. SharpDevelop is free. If you don’t want to get either one, you can simply use Notepad or WordPad. For right now we will ignore most of stuff in this file, simply because we aren’t ready for it yet. J. So, find this line:

Code:
private static bool AutoAccountCreation = true;


This is the toggle for Auto Account Creation! If you change the true to false then accounts will no longer be created automatically. So if you don’t want Auto-Account on. Change that line to look like this:

Code:
private static bool AutoAccountCreation = false;

The next important one is AutoSave.cs. This file contains the source code for the Auto Saving of your world (man, those RunUO Devs sure made it easy to tell what each script does). If you find your world saves too often, or not enough, this is where you change it. If you would like to change it, let’s open up that script! Find the line that looks like this:

Code:
private static TimeSpan m_Delay = TimeSpan.FromMinutes( 5.0 );

You can simply change the 5.0 in this line to something else, and make the auto saves happen at a different interval. I’ve change mine to look like the following:

Code:
private static TimeSpan m_Delay = TimeSpan.FromMinutes( 30.0 );

Now instead of having my world save every 5 minutes, it saves every 30 minutes!

Easy stuff so far isn’t it? This file is quite a bit larder then the ones we have looked at so far, and a lot more can be edited in it. CharacterCreation.cs contains all the information and events for when a character is created. If you are to open this file up, you will notice that it is quite long. The first line we are going to look at is this one:

Code:
pack.DropItem( MakeNewbie( new Gold( 1000 ) ) ); // Starting gold can be customized here

If you can’t find it, do a search for part of it. This line drops 1000 gold coins in the new characters backpack. It is once again pretty straightforward. If you want to change how much money new characters get when they are created simply change to 1000 to a different number. You can make it look something like this:

Code:
pack.DropItem( MakeNewbie( new Gold( 6000000 ) ) ); // Starting gold can be customized here

And make all your players rich! Of course, I don’t suggest that. The starting amount should be based on how you want you economy to be. Remember that players can keep making new players and getting more and more gold. Maybe in a later section we will find out how to have a set amount of gold that each account gets to start with?

On to the next line in CharacterCreation.cs that we will edit, and the last one for now. You will most likely want to come back to this file to change more things. Find this line:

Code:
FillBankbox( newChar );

This calls the function that you may have seen earlier in the script. If you didn’t see it, don’t worry about it for now. What this does is places all that junk into your bank box. If you haven’t seen it yet, you may want to go into the game, do [add banker then say bank. Now, you may want to get rid of that, because you don’t want to run a test center style shard. What we will do to this is what I call commenting it out. You put // at the beginning of the line. It should look like this:

Code:
//FillBankbox( newChar );

When the scripts are compiled for the server to run, any part of a line after the // is not read. If you look at the code that puts the gold in to a new characters bag, you will see that the Devs put a comment in there to make it easier for people to understand what the line does. The used // to make sure that that comment wouldn’t mess the script up and give them errors when they compiled it. So if you add a // at the beginning of the FillBankBox line, then it won’t be read by the compiler, and the bank box won’t be filled with junk!

Now, because older versions of client.exe can’t do everything that the newer ones can, RunUO supplies us with a simple way to make sure that our players are on the newest client. This is located in ClientVerification.cs.

Code:
ClientVersion.Required = null;
//ClientVersion.Required = new ClientVersion( "3.0.8q" );

This line is where you specify which client can be used. The Devs kindly added a line below it that is commented out that shows us how to specify a client version. We can use the information in that line to make sure our players use the newest client by changing the line that isn’t commented out, or we can simply switch them. Then they will look like this:

Code:
//ClientVersion.Required = null;
ClientVersion.Required = new ClientVersion( "3.0.8q" );

If you look at the other lines in the file, you will see that are some bool values to change whether or not the different client types are allowed. If you don’t want to allow them change the true to false. Make sure you allow at least one of them, or nobody will be able to login!

The next file is DataPath.cs. This file tells RunUO where your Ultima Online files are. By default it will search for your installed UO path. If you have a different directory that you wish to use, you can change this bit of code:

Code:
Utility.DataPath = Console.ReadLine();// For a fixed path with no install, use the following line instead
// Utility.DataPath = @"C:\Path\To\Ultima Online\";

Now we can just change the lines that are commented out, and the path.

Code:
//Utility.DataPath = Console.ReadLine();
// For a fixed path with no install, use the following line instead
Utility.DataPath = @"C:\Program Files\UO Server Files\";

That will allow you to point RunUO to a directory other then the default one from when you installed Ultima Online.

ServerList.cs is an important file. If you are behind a router then you will have to edit this file to allow users to log in to your shard. This is also the file where you can change the name of your server. This file has already been discussed on the RunUO boards in great detail.

The WelcomeTimer.cs and LoginStats.cs files are also two that should be edited to suit your shard, but we have not learned about strings yet.
 

Arthanys

Wanderer
More important scripts:

In misc\charactercreation.cs

Search for this line:
Code:
BankBox bank = m.BankBox;

And below this put this line:
Code:
m.BankBox.MaxItems = 350;

Now the bank have a limit for 350 itens =)

----------------------------------

In misc\charactercreation.cs
search for these lines:

Code:
CityInfo city = GetStartLocation( args, young );
//CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );
To the players "born" in only a local comment the first line and descomment the second, for e.g. :

*When you comment the line ( put the // in front of the line) is like the line does exist, why no is compiled by the emulator.

Code:
//CityInfo city = GetStartLocation( args, young );
CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

Now all the char go "born" in britain, look this: 1496, 1628, 10
Is the coordenates, use the command [where in the local to take the coordenates and put int script.
-----------------------------------------

In misc\charactercreation.cs
search for this line:

Code:
m.StatCap = 250;

Below this put this line:

Code:
m.StatCap = 250;
newChar.SkillsCap = 7200;

All the char created instant now go have 720 of skillcap.
If you want to change the stat cap....
*7200 why is 720.0 =)

------------------------------------

In misc\ServerList.cs
search for this line:

Code:
public const string ServerName =
I not remember what comes with the default name... but search for this part of line =)

For e.g. , the name of you shard goes be: Testing Name, so:

Code:
public const string ServerName = "Testing Name";

---------------------------------

in \Misc\Test Center\TestCenter.cs
search for this line:

Code:
private const bool m_Enabled = false;

Example: if you write: set str 100 or set archery 110
And this variable = false, this don't work.

Code:
private const bool m_Enabled = true;

----------------------------------

in misc\AutoSave.cs

Code:
private static TimeSpan m_Delay = TimeSpan.FromMinutes( 5.0 );

Code:
private static TimeSpan m_Delay = TimeSpan.FromMinutes( 30.0 );

Now the world goes save 30 in 30 minutes.

-----------------------------------

Remember: if you modify any scripts, is need to recompile all scripts.

Sorry for my english.. hehehe

Bye!
 

homergz

Sorceror
LordBalthazar;758083 said:
I tried modifying my Stat Cap.
I found the line it told me to edit and changed it, however, in my Status window, it still says my max stats is 225.

Setting the cap in CharacterCreation.cs will only affect new characters. To change for existing characters use the command:

[global set statcap 250 where playermobile

Change the 250 to whatever cap you set in CharacterCreation.
 

Amy-

Sorceror
Bad news for people who have used statscrolls though right? I'd rather use:
[global inc statcap 25 where playermobile
 
Top