Skill changes not working

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Skill changes not working

Post by stranf »

I'm attempting to rename the skill "chivalry" and code it to something custom.

Renaming it within Uox3 is easy, but in order to rename it on the gump, I'm going to need to edit the .mul correct?

Also, the hardcoded "set" command does not work for chivalry. IE, you can not type in " 'set chivalry 100".

Now, I can set the skill via .js according to this script:

Code: Select all

case "APER":
    	ourObj.skills.chivalry = ourObj.skills.chivalry + nVal;
	persuade = ourObj.skills.chivalry;
	okMsg( socket );
	socket.SysMessage( "Persuade changed by " + nVal );
	ourObj.TextMessage( "Persuade changed by " + nVal );
	socket.SysMessage( "Target Persuade: " + persuade);
		break;
Now, if I type in " 'dm aper 125" it correctly changes the chivalry skill to 12.5. The catch is, if you click on "show real" it shows chivalry as 0.0. Now I have set up the skills.dfn to allow for an intelligence bonus to the skill.

Here is the code:

Code: Select all

// Chivalry to persuade
[SKILL 51]
{
NAME=PERSUATION
STR=0
DEX=0
INT=150
SKILLPOINT=0,100,100
SKILLPOINT=990,10,5
SKILLPOINT=1000,5,3
MADEWORD=envoked
}
Now my shard has a very strict skill cap, and allowing all "chivalry" increases to be added as a bonus and NOT a "real" stat really unbalances things.

Basically I want to code skill increases like the hardcoded "set" command. If I type in "set tactics 125" and a character has a strength of 200 or something, it changes the skill to a total of approximatley 22.5, where 12.5 is the "real" skill I set, and 10 of the points are an added bonus because of attributes.

The way I code, adds the skill as an attribute bonus only. :(.

How do I get around this? Thanks!
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

Pardon the slowish response, don't get much chance to look here too often.

You want to modify baseskills, not skills. So ourObj.baseskills.chivalry is what you're looking for, I believe.

Really slow connection here, and no local code, so I can't be sure. But chivalry should be okay if you're using "set", as it should work by name. UNless, of course, it's not actually in the array by name. Trying to find the routine that populates the skill[] array, but it's very slow going through web cvs interface.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Thanks Maarc!

I'll try the "baseskills" in .js, if that works that would be awesome.

As far as using "set", as long as I'm not typing it in wrong it dosen't work. I can get around it via .js, so it isn't a huge priority, although it would be nice.

Thanks again!
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

It should work if you use 'set chivalry #

However, the name CHIVALRY comes from skills.dfn. If you change that name, that'll be why. Also same for BUSHIDO and NINJITSU.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

ok!

That would be my bug. I did indeed change the names in skills.dfn. That would be the issue.
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

Good stuff :) I forgot that we'd even shunted that out to DFNs, so there you go! Took a bit of hunt and peck but eventually found it got loaded. Gotta love customisations, and then forgetting about it :)
Post Reply