Page 1 of 1

Skill changes not working

Posted: Sun Nov 25, 2007 6:01 pm
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!

Posted: Wed Nov 28, 2007 6:57 pm
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.

Posted: Thu Nov 29, 2007 1:53 pm
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!

Posted: Fri Nov 30, 2007 11:45 am
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.

Posted: Fri Nov 30, 2007 2:06 pm
by stranf
ok!

That would be my bug. I did indeed change the names in skills.dfn. That would be the issue.

Posted: Fri Nov 30, 2007 4:16 pm
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 :)