Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Third Party Program Support

Third Party Program Support Misc support forum and advertisment forum for all RunUO related third party Utilities.

Reply
 
Thread Tools Display Modes
Old 12-22-2003, 03:51 PM   #1 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default [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 - omegared@o2.pl

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 - omegared@o2.pl
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 - omegared@o2.pl

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 omegared@o2.pl 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 - omegared@o2.pl

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:
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-22-2003, 04:17 PM   #2 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

SWEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEET TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT


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.
XxSP1DERxX is offline   Reply With Quote
Old 12-22-2003, 04:21 PM   #3 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Quote:
Originally Posted by omegared
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 ;]
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-22-2003, 04:37 PM   #4 (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

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.
Phantom is offline   Reply With Quote
Old 12-22-2003, 04:41 PM   #5 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

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...".
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-22-2003, 04:56 PM   #6 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

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[i] = SkillInfo.Table[i];

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[i].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
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-27-2003, 04:43 AM   #7 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

incredible tool, :shock:
Ravatar is offline   Reply With Quote
Old 12-27-2003, 03:41 PM   #8 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

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

__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-27-2003, 04:39 PM   #9 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

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.
TheOutkastDev is offline   Reply With Quote
Old 12-27-2003, 05:13 PM   #10 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

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?
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-27-2003, 05:19 PM   #11 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

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?
TheOutkastDev is offline   Reply With Quote
Old 12-27-2003, 05:52 PM   #12 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Yes, its correct. The original one has load of unused garbage inside
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-27-2003, 06:53 PM   #13 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

got it working. Thanks alot :-)
TheOutkastDev is offline   Reply With Quote
Old 12-29-2003, 12:50 AM   #14 (permalink)
Forum Novice
 
Join Date: Mar 2003
Location: Canada, eh?
Age: 23
Posts: 466
Default

The link seems to be broken :?:

Seems like an amazing tool though!
__________________
Tylius Dragon --==(UDIC)==--
Tylius is offline   Reply With Quote
Old 12-29-2003, 06:03 AM   #15 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Link on the first page has had an old version, updated to contain the new.
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 12-29-2003, 02:04 PM   #16 (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

Very nice, especialy the part with the patching part, means shards can add new skills without replacing the client.
Phantom is offline   Reply With Quote
Old 01-02-2004, 04:26 PM   #17 (permalink)
 
Join Date: Apr 2003
Location: Brazil
Age: 25
Posts: 341
Send a message via ICQ to tobagin Send a message via AIM to tobagin Send a message via MSN to tobagin Send a message via Yahoo to tobagin
Default

I can't get the skill gump to open!
__________________
tobagin is offline   Reply With Quote
Old 01-02-2004, 05:49 PM   #18 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Quote:
Originally Posted by omegared
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).
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 01-10-2004, 07:27 AM   #19 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Added mirror download (old server is down):
http://nelderim.website.pl/SkillTools.zip
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 01-10-2004, 07:56 AM   #20 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,529
Default

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]
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 01-10-2004, 08:01 AM   #21 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

You must run it from command line in the form:
[code:1]uo_loader <number of skills>[/code:1]
or create a shortcut and put above in the "target element" property of it.
For example, [code:1]uo_loader 58[/code:1]
Although if you run it with >52 skills and don't provide skills.mul with the names for them, the client will probably crash.
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 01-10-2004, 08:07 AM   #22 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,529
Default

so if i want to add a new skill which right now there are exactly 52 skills???

So if i want to add a skill i need to first of all, go like 53 or something?
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 01-10-2004, 08:19 AM   #23 (permalink)
Forum Expert
 
Ravenal's Avatar
 
Join Date: Oct 2003
Location: Spokane Valley, WA
Age: 24
Posts: 1,529
Default

Okay what does this thing do?

[code:1]
// (c) 2003 Omega Red - omegared@o2.pl

#include <stdlib.h>
#include <windows.h>

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
typedef DWORD (__stdcall *tUOG_Client_Launch)(DWORD client_type);
tUOG_Client_Launch UOG_Client_Launch;
typedef DWORD (__stdcall *tUOG_Client_Resume)(void);
tUOG_Client_Resume UOG_Client_Resume;
typedef DWORD (__stdcall *tUOG_Client_Patch_Inject)(DWORD pid, char *DllPath, char *FunctionName, void *ParamsPtr, DWORD ParamsSize);
tUOG_Client_Patch_Inject UOG_Client_Patch_Inject;
typedef DWORD (__stdcall *tUOG_Client_Patch)(void);
tUOG_Client_Patch UOG_Client_Patch;

struct
{
DWORD pid;
byte max_skills;
} params;

params.max_skills = atoi(lpCmdLine);
if (params.max_skills > 52)
{
MessageBox(0, "Usage: uo_loader <max_skills>\n\nmax_skills must be in range 52-255", "UoLoader error", MB_ICONSTOP);
return -1;
}

HMODULE hUOG = LoadLibrary("uog.dll");
if (!hUOG)
{
MessageBox(0, "Failed to load uog.dll!", "UoLoader error", MB_ICONSTOP);
return -1;
}

UOG_Client_Launch = (tUOG_Client_Launch)GetProcAddress(hUOG, "UOG_Client_Launch");
UOG_Client_Resume = (tUOG_Client_Resume)GetProcAddress(hUOG, "UOG_Client_Resume");
UOG_Client_Patch_Inject = (tUOG_Client_Patch_Inject)GetProcAddress(hUOG, "UOG_Client_Patch_Inject");
UOG_Client_Patch = (tUOG_Client_Patch)GetProcAddress(hUOG, "UOG_Client_Patch");

params.pid = UOG_Client_Launch(0);

UOG_Client_Patch_Inject(params.pid, "UoPatch.dll", "_PatchClient@8", &params, sizeof(params));
UOG_Client_Patch();
UOG_Client_Resume();
}
[/code:1]
__________________
Creator of Genesis :: genesisworlds.com
-- Genesis is the next replacement program for UO Landscaper & Dragon
Ravenal is offline   Reply With Quote
Old 01-10-2004, 08:29 AM   #24 (permalink)
 
Join Date: Apr 2003
Location: Poland
Posts: 141
Default

Yes, if you want to have 53 skills then put 53 in the command line.
The code you've pasted is the source of the loader, for the curious ones how it works ;]
Look here for some explanation what is required to really have working new skills and what are the side effects: http://www.runuo.com/discussion/viewtopic.php?t=29030
__________________
Vulnerant omnes, ultima necat...
omegared is offline   Reply With Quote
Old 02-10-2004, 04:25 AM   #25 (permalink)
Forum Novice
 
Join Date: Mar 2003
Posts: 246
Send a message via ICQ to Nagash
Default

broken link
does someone have a working one or can you fix it?
Nagash 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