[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4712: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3842)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4714: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3842)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4715: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3842)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4716: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3842)
The Weapon Templates Object | JoinUO Forums

The Weapon Templates Object

The UO "Demo" is a slightly modified OSI UO Server and Client which was bundled on the Ultima Online Second Age retail CD. This forum seeks to reveal it's mysteries.

Site Admin
Posts: 372
Joined: Wed Apr 08, 2009 6:35 am
PostPosted: Wed Oct 28, 2009 9:18 pm
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything

Site Admin
Posts: 372
Joined: Wed Apr 08, 2009 6:35 am
PostPosted: Wed Oct 28, 2009 9:20 pm
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything

Site Admin
Posts: 372
Joined: Wed Apr 08, 2009 6:35 am
PostPosted: Wed Oct 28, 2009 9:28 pm
Attachments
weapon templates constructor.jpg
weapon templates constructor.jpg (104.25 KiB) Viewed 8393 times
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything

Posts: 2
Joined: Thu Nov 12, 2009 1:11 am
PostPosted: Thu Nov 12, 2009 2:22 pm
Hi Batlin,

In the demo dat folder, there's a folder for weapons. It has files called stats.q, and weapon.x.q, where x goes from 0 to 300+. stats.q has data for every weapon, just once I believe. Each individual weapon file has stats for that one weapon.

However, in the individual files, some weapons have two different files with two different sets of stats (for example, kryss and halberd are represented by #22 and #18, and #17 and #15).

Are you able to tell from the demo code where it is pulling from when it creates a weapon? (whether it pulls from stats.q or from one of the individual files)

If it pulls from the individual files, can you tell me if the game actually spawns both templates of kryss, or if it just spawns #22 or just spawns #18?

This has some interesting implications for the stats we use on UOSA. Thanks!

Site Admin
Posts: 372
Joined: Wed Apr 08, 2009 6:35 am
PostPosted: Thu Nov 12, 2009 7:15 pm
This is what I know:

The "stats.q" and "weapon_templates.q" files are not used in the demo. The weapons you see in the game come from the "weapon.X.q" files.

I'll take the two krysses as an example, in "defines.q":
defines.jpg
defines.jpg (31.31 KiB) Viewed 8370 times
Two krysses seem to exist, KRYSS with ID 5121 and the other KRYSS_2 with ID 5120.

You have look in "templatestable.dat.q" also, you will find that both krysses can be bought by vendors but only the KRYSS with ID 5121 can be bought by players. Maybe KRYSS_2 is an older kryss which has been removed from the game?

Sellable (by the vendor):
weaponeer sellable.jpg
weaponeer sellable.jpg (34.18 KiB) Viewed 8370 times

Buyable (by the vendor):
weaponeer buyable.jpg
weaponeer buyable.jpg (14.16 KiB) Viewed 8370 times


The question is, how do we arrive from the ID 5120/5121 to the weapon template number 18/22.
To answer this question you have to use a tiledata.mul viewer.
You can find a tool named "TilData Editor" here:

Open the server side file "tiledata.mul.q" and go to object 0x1400. ID 5120 is decimal which equals 0x1400 in hexadecimal.
TileData Editor.jpg
TileData Editor.jpg (106.5 KiB) Viewed 8368 times


The Unknown0 field is the answer. This field is (partially) the internal weapon template number. I say partially because those programs were created by reversing the client. The reversers always believed it was a byte (8-bit) but this field is actually a word (16-bit) and therefor they don't display the data like the OSI servers would see the data.

Based on this, I conclude (for now), the kryss with weapon template 18 is not used. Unless you can find a related weapon in the "tiledata.mul.q" file.

Also, an interesting note. In "stats.q", weapon 18 is a kryss. weapon 22 is a viking sword. This conflicts with the "weapon.X.q" files and also conflicts with the "tiledata.mul.q" file.
<Derrick> RunUO AI is kind of a functional prototype, which i have hacked into something resembling OSI behavior, but only by complitcating everything

Posts: 2
Joined: Thu Nov 12, 2009 1:11 am
PostPosted: Thu Nov 12, 2009 9:43 pm
Awesome, thanks so much for your time on this.

This helps me understand what's going on.

In the numbered templates, there exists an entry for all weapons as of the demo (early-mid 1998) as well as all weapon templates that were "pre-patch" (before the Jan-1998 patch that greatly altered most weapon stats).

So my guess is, the demo code allows both kryss' to be sold to NPC's because you may have a pre-patch kryss in April 1998 that you want to sell to an NPC. However, you can only buy the post-patch kryss from the vendor, because that's the new standard kryss. If there ever needed to be more proof that the demo was ripped straight from production code, this is it. It is not possible to have a #18 kryss on the demo, so why would vendors need to be able to buy one from you if you could never have one in the first place!

When I match up both kryss possibilities with archive.org pages from Stratics, I concur that the stats of kryss #18 are indeed in line with the pre-patch kryss from before Jan-1998, and kryss #22 should be the new standard kryss as of the demo's time period.

It's so much fun when it all fits together :-)

Site Admin
Posts: 455
Joined: Tue Jun 17, 2008 2:33 pm
PostPosted: Fri Nov 13, 2009 3:50 am

Return to UO Demo

Who is online

Users browsing this forum: No registered users and 6 guests

cron