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 Item Database

Initial D

Wanderer
UO Item Database

Hi there,

I've been searching the net for way to long now to try and find a way to get various data from UO.

About a year ago I was developing a new auction/shop web site for UO (that would hopefully support non-OSI servers) but I had to abandon the project due to time constraints, most of my time was consumed with manual data entry, meaning entering every type of craftable etc into a database, as you can imagine, this was a tad mind numbing.

So what I want really is to be able to export this information directly from the game. I need things like all types of armor,weapon,shield,jewlery (including data like str req,medable etc), and more or less anything that you can sell. Also things like all possible item properties(spell effects,stats,etc. etc.) and their value ranges,type of buildings and sizes (althought I already have most of this data for OSI servers), and...well you get the idea. Obviously this information is stored somewhere, but where I don't know, and as for accessing it well, maybe if I had the lives of a cat. Also when I say export items, I dont mean like every item on the server (i.e. player made) just the different types (chainmail tunic,platemail tunic etc.)

So I thought I'd come to the one place where I thought I might get an answer to try and put an end to the misery.

If this is possible and can be made to be straight forward it would be possible to have support for non-OSI servers with a simple "export" of their item database.

The reason for such complexity (compared to something like uo-auction2) is because the main basis of the site is to be able to find EXACTLY what you want.

And if I manage to get that far, I was also thinking about being able to export item data directly from the game, i.e. items in your backpack and their properties (pref without using euo)

Anyway I've babbled enough, I just want closure :p

Thanks in advance to all advice

Sorry if it doesn't seem appropriate to the forum, couldn't think what else to try.

This is going to be developed with ASP.NET(VB.NET).

Cheers

D
 

fittesaft

Wanderer
VB.NET scripts... no files found??

Can anyone please help me with this ? I don't know where I can find VB.NET scripts ?? and where 2 place them ? please help me. thanks a lot !!! ^^
 

Vorspire

Knight
Code:
static Hashtable m_Classes = new Hashtable( new CaseInsensitiveHashCodeProvider( ), new CaseInsensitiveComparer( ) );

public static void Configure( )
{
	//Get ALL Constructors for Type "Item"
	Type[] types = Assembly.GetAssembly( typeof( Item ) ).GetTypes( );

	foreach( Type type in types )
	{
		//Double-Check the Constructors and add Valid Items to Hashtable
		if( type.IsSubclassOf( typeof( Item ) ) && !type.IsAbstract )
		{
			m_Classes.Add( type.FullName, type.GetConstructor( new Type[0] ).Invoke( new object[0] ) );
		}
	}

	foreach( Item item in m_Classes.Values )
	{
		if( item != null && !item.Deleted )
		{
			Console.WriteLine("Found Item Class: "+item.GetType().FullName.ToString());
		}
	}
}

The above code will gether all Classes derived from Type "Item" and print the list to the Console. You can easily modify it to print out to a file, or even a database!

WARNING!
This code WILL create one instance of every item on your server, if you have 10,000 scripts that derive Item, you're gonna get 10,000 new items created outta no-where.

You can just use this to gather and store Type Names instead of creating an instance of the item...

Creating the instances of Item has advantages because you can access it like you would normally, being able to gather a wealth of information on each Item.

You can do tests for special items too!
 

HellRazor

Knight
Vorspire;757161 said:
WTF.. just realised this thread is dead.. LAME.

DONT NECRO THREADS DAMMIT...

*walks away shaking head*

Only now there is some useful example code in the thread. So sometimes necro'ing isn't such a bad thing. :)

Thanks for the code example.
 

Vorspire

Knight
No problem.

There are many great uses for this, i have used it to register donation items, armor "sets" and a special Ability system, it's very neat code and can be VERY helpful.

With this code, i am able to get instances of classes, like all Items, invoke them and get all of their ItemID's... which i can store for a special system or gump or export to a file or database... you can even use this to save and load in serializes, you can simply save the Type Name as a string... since there are never two Type Names that are the same, it can be good to use them for indexing other things, or even encrypting them to get a new serial #, which will always be unique.
 
Top