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!

[Updated 27/12/2003] Tools for adding new skills

omegared

Wanderer
[Updated 27/12/2003] Tools for adding new skills

People who are creating their own new skills often wonder how to integrate them with the client. Client reads only 52 skill names from skills.mul - we can edit them, but adding new ones is not easy. As I run into these problems, I've sat and written two utilities to deal with this. They are both command-line tools. Of course, new skills must be scripted server-side, and standard client skill window may sometimes crash the client - I've adapted [skills gump to function like normal skills menu.

[Version 1.0 removed, description of 2.0 is in the later post]
http://nelderim.org/files/SkillTools.zip

First one is simple skills.mul viewer/editor. Here's the readme:
[code:1]
UO skills.mul (de)compiler
Copyright (c) 2003 Omega Red - [email protected]

Usage: SkillsMul [skills script]
Files skills.idx and skills.mul must be in the program's directory.

Without arguments, program displays contents of skills.mul file.
To build custom skills.mul, provide script filename as command-line argument.
Example: SkillsMul myskills.txt

Script consists of lines in format:
<allow use> <skill name>
allow use - should be 0 or 1, determines if skill has "use" button.
skill name - self explaining ;)
ID of skill is determined by order in script file - first is #0, next #1 and so on.

Standard AOS skill set is provided in script file uoskills.txt
[/code:1]

Sample output from listing mode:
[code:1]
id start size use unkn name
-------------------------------------------------
0000: 0000 [0009]: [ ] [ 0] Alchemy
0001: 0009 [0009]: [*] [ 0] Anatomy
0002: 0012 [000d]: [*] [ 0] Animal lore
0003: 001f [000f]: [*] [ 0] Item Identify
0004: 002e [000b]: [*] [ 0] Arms lore
0005: 0039 [000a]: [ ] [ 0] Parrying
0006: 0043 [0009]: [ ] [ 0] Begging
0007: 004c [000f]: [ ] [ 0] Blacksmithing
0008: 005b [000a]: [ ] [ 0] Bowcraft
0009: 0065 [000d]: [*] [ 0] Peacemaking
0010: 0072 [0009]: [ ] [ 0] Camping
0011: 007b [000b]: [ ] [ 0] Carpentry
0012: 0086 [000d]: [ ] [ 0] Cartography
0013: 0093 [0009]: [ ] [ 0] Cooking
0014: 009c [0012]: [*] [ 0] Detecting Hidden
0015: 00ae [000d]: [*] [ 0] Discordance
0016: 00bb [0017]: [*] [ 0] Evaluate intelligence
0017: 00d2 [0009]: [ ] [ 0] Healing
0018: 00db [0009]: [ ] [ 0] Fishing
0019: 00e4 [0015]: [ ] [ 0] Forensic Evaluation
0020: 00f9 [0009]: [ ] [ 0] Herding
0021: 0102 [0008]: [*] [ 0] Hiding
0022: 010a [000d]: [*] [ 0] Provocation
0023: 0117 [000d]: [*] [ 0] Inscription
0024: 0124 [000d]: [ ] [ 0] Lockpicking
0025: 0131 [0008]: [ ] [ 0] Magery
0026: 0139 [0012]: [ ] [ 0] Magic Resistance
0027: 014b [0009]: [ ] [ 0] Tactics
0028: 0154 [000a]: [ ] [ 0] Snooping
0029: 015e [000e]: [ ] [ 0] Musicianship
0030: 016c [000b]: [*] [ 0] Poisoning
0031: 0177 [0009]: [ ] [ 0] Archery
0032: 0180 [0011]: [*] [ 0] Spirit Speaking
0033: 0191 [000a]: [*] [ 0] Stealing
0034: 019b [000b]: [ ] [ 0] Tailoring
0035: 01a6 [000f]: [*] [ 0] Animal Taming
0036: 01b5 [0016]: [ ] [ 0] Taste Identification
0037: 01cb [000b]: [ ] [ 0] Tinkering
0038: 01d6 [000a]: [*] [ 0] Tracking
0039: 01e0 [000c]: [ ] [ 0] Veterinary
0040: 01ec [000f]: [ ] [ 0] Swordsmanship
0041: 01fb [000e]: [ ] [ 0] Macefighting
0042: 0209 [0009]: [ ] [ 0] Fencing
0043: 0212 [000b]: [ ] [ 0] Wrestling
0044: 021d [000f]: [ ] [ 0] Lumberjacking
0045: 022c [0008]: [ ] [ 0] Mining
0046: 0234 [000c]: [*] [ 0] Meditation
0047: 0240 [0009]: [*] [ 0] Stealth
0048: 0249 [000e]: [ ] [ 0] Remove Traps
0049: 0257 [000c]: [ ] [ 0] Necromancy
0050: 0263 [0007]: [ ] [ 0] Focus
0051: 026a [000a]: [ ] [ 0] Chivalry
0052: 0274 [000b]: [ ] [ 0] TestSkill
[/code:1]

The second one was more tricky, as it patches the client to allow use of more than 52 skills. The readme again:
[code:1]

UO client 52-skill limit remover
Copyright (c) 2003 Omega Red - [email protected]
This utility changes hardcoded UO client skill limit to whatever you wish
(oh well, in range of 52-255 ;)

Usage: UoSkillPatcher <client-exe-filename> <number of max skills>
Example: UoSkillPatcher no_crypt_client.exe 53

If all goes well, output is written to new_client.exe

Number of skills MUST match of that in skills.mul or client will crash!
Use my SkillsMul for viewing/editing that ;)

Patching is based on bytestream search so it should work with any client version (starting from AOS).
Hovewer, if it fails (and you're sure it's AOS client, not some older one),
drop me an e-mail with some details (preferably with that client attached ;)
[/code:1]

Sample output from older client:
[code:1]
E:\uo2d\clients>uoskillpatcher client300c.exe 53
UO client 52-skill limit remover
Copyright (c) 2003 Omega Red - [email protected]

Filesize: 1490944 bytes.
One of the code signatures was not found - patch failed.
Either supplied client is too old (must be an AOS one)
or it's too new and OSI has significantly changed their code ;]
Contact me at [email protected] and provide some details about your client.
[/code:1]

..and succesfull patching:
[code:1]
E:\uo2d\clients>uoskillpatcher client400c.exe 53
UO client 52-skill limit remover
Copyright (c) 2003 Omega Red - [email protected]

Filesize: 1945600 bytes.
Skill limit found at offset 0x00043535.
Max number of skills successfully set to 53.
Modified client saved to new_client.exe - all OK! :)
[/code:1]

And one screenshot:
 

Kamron

Knight
SWEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT


Only thing i ask.. DONT LEAVE... we will need you as the client gets updated. Or you can always release source code if you get too lazy or leave UO ;)

I say this even though the patcher searches for what to change because OSI has a knack for fucking with the client.
 

omegared

Wanderer
omegared said:
Patching is based on bytestream search so it should work with any client version (starting from AOS).
Hovewer, if it fails (and you're sure it's AOS client, not some older one),
drop me an e-mail with some details (preferably with that client attached ;)
It's written in the same way as UOrice (I think ;) so should work with any AOS client. Source code won't help much as most of the work was under the debugger/disassembler and this proggy does only search/replace on the crucial code ;]
 

Phantom

Knight
interesting

Interesting, How did you get RunUO to list the Skill in the skill menu if it loops through Skillname which is a protect enum?

Wondering also how you got runuo to give you that message...

Interesting...

Good work, those 2 things is whats been keeping people from really adding news skills.
 

omegared

Wanderer
I've redefined SkillName - it gives some like 1020 warnings but uses my definition. Anyone know how to disable warnings (or better - one specific warning)? :)
Of course it would help much if some core things like SkillName and SkillInfo were modifyable (how to spell it correctly? :p)
And for the message, I've implemented new skills as normal Skill objects - it seems that core handles the rest. Without modifying skills.mul and the client though, the message goes with no skillname - some like "Your skill in has increased...".
 

omegared

Wanderer
At the moment it works like this:
In AOS.Configure() (first of all Configure()'s) I've added:
[code:1]
for (int i=0; i<SkillInfo.Table.Length; i++)
NewSkillInfo.Table = SkillInfo.Table;

NewSkillInfo.Table[52] = new SkillInfo (52, "TestSkill", 1, 1, 1, "Tester", null, 0, 0, 1, 1.0);

for (int i=0; i<NewSkillInfo.Table.Length; i++)
Console.WriteLine("Skill registry: added {0}", NewSkillInfo.Table.Name);
[/code:1]

NewSkillInfo is derived from SkillInfo with larger skills table.

And in PlayerMobile constructors:
[code:1]
Skills skills = new Skills(this);
NewSkills[0] = new Skill(skills, NewSkillInfo.Table[52], 0, 1000, SkillLock.Up);
[/code:1]

Now I'm thinking how to merge my NewSkills and Skills, but hint for this is in repliy to my post in Script Support :)
 

omegared

Wanderer
OK, I've been working quite intensively in the last few days. Sadly, attempts to extend standard client's skill window failed - it's too complicated to reverse the code. Hovewer, I've rewritten my patching procedure and changed it to not alter the .exe, but to patch the client process in memory - thanks to Mr Fixit for UOG sdk and great cooperation :) This also fixed possible client crashes when too long/too many new skills were added.
To use the loader, you must have working server-side replacement for player skill management window, because the standard one is disabled.
And of course the skills.mul file must contain names for all your new skills.

http://212.33.90.15/~omega/SkillTools_v2.zip

 
Everytime I try to run the SkillsMul.exe

without any arguments - it displays no skill lists

with argument uoskills.txt - it starts to launch then windows error report box pops up to send report.
 

omegared

Wanderer
Files skills.mul and skills.idx must be in the current directory to list their content. And the second option.. what is exactly the error message?
 
1.) The files are in the same directory. I dropped the files into my Ultima Online 2D folder. Backed up the skill.idx and skill.mul files

2.) Its the microsoft error reporting window.

"Skillsmul.exe has encountered a problem and needs to close. We are sorry for the inconvience."

Ran these from the Command Line prompt. Then when I go to run>".exe path" uoskills.txt

the muls are changed but now they are only 628 bytes? is that correct?
 

Phantom

Knight
Very nice, especialy the part with the patching part, means shards can add new skills without replacing the client.
 

omegared

Wanderer
omegared said:
To use the loader, you must have working server-side replacement for player skill management window, because the standard one is disabled.
Default client skills window won't work with the new skills and thus is disabled.
This tool is for rather experienced shard developers, if you are serious to adding new skills, you should have no problem in writing your own skills gump (as a base you can take the [skills gump).
 

Ravenal

Knight
Why am i getting this error?

[code:1]Usage: uo_loader <max_skills>\n\nmax_skills must be in range 52-255", "UoLoader error[/code:1]
 
Top