Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Visual Basic

Visual Basic Visual Basic Discussion

Reply
 
Thread Tools Display Modes
Old 07-26-2006, 07:25 AM   #1 (permalink)
 
Join Date: Jul 2006
Age: 26
Posts: 1
Lightbulb 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

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
Initial D is offline   Reply With Quote
Old 07-26-2006, 10:42 AM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Read the art.mul file.
Phantom is offline   Reply With Quote
Old 05-16-2008, 06:37 PM   #3 (permalink)
Lurker
 
Join Date: May 2008
Age: 19
Posts: 4
Default 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 !!! ^^
fittesaft is offline   Reply With Quote
Old 05-19-2008, 01:34 AM   #4 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

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!
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard

Last edited by Vorspire; 05-19-2008 at 01:38 AM.
Vorspire is offline   Reply With Quote
Old 05-19-2008, 01:40 AM   #5 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

WTF.. just realised this thread is dead.. LAME.

DONT NECRO THREADS DAMMIT...

*walks away shaking head*
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Old 05-19-2008, 08:17 AM   #6 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,372
Default

Quote:
Originally Posted by Vorspire View Post
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.
__________________
HellRazor is offline   Reply With Quote
Old 05-19-2008, 12:18 PM   #7 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,298
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

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.
__________________

WWW.RPK-UO.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5