• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Ability points

Doober

Buccaneer
Storm Modder
I am fooling around with the amount of skill points and ability points you can get each time you level. I have found a way to only get one skill point with each level, but would like to make it so I only get an ability every other level. I changed the characterutilite.c from:

_refCharacter.rank = sti(_refCharacter.rank) + 1;
_refCharacter.Skill.FreeSkill = sti(_refCharacter.Skill.FreeSkill) + 2;
if(CheckAttribute(_refCharacter,"perks.FreePoints"))
{ _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;

to:

_refCharacter.rank = sti(_refCharacter.rank) + 1;
_refCharacter.Skill.FreeSkill = sti(_refCharacter.Skill.FreeSkill) + 1;
if(CheckAttribute(_refCharacter,"perks.FreePoints"))
{ _refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + 1;


I tried putting the perk at 0.5, but then it never increases at all. Any ideas on how to make that work?
 
Change

sti(_refCharacter.perks.FreePoints) + 1;

to

stf(_refCharacter.perks.FreePoints) + 0.5;

Note that "sti" changed to "stf". This shouldn't cause any problems, but test it to be sure.

Hook
 
Note that without other changes in the code, if you have 1.5 ability points and use a point, you'll lose the extra half point. Probably best to spend the ability points as soon as you see them.

Hook
 
Can some code be added that would check if the character's level can be devided by 2 and only then will add the ability point? Such as:
if(level / 2 = even number)

Or something similar?
 
That would work even better. Plus it's easy to give 2 skill points up to a given level, then start giving one skill point. Similar with ability points. I'll get back to you on that one.

Hook
 
_refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + (sti(_refCharacter.rank) % 2);

The above line will give one ability point on odd number ranks.

_refCharacter.perks.FreePoints = sti(_refCharacter.perks.FreePoints) + intRet(sti(_refCharacter.rank) < 10, 1, sti(_refCharacter.rank) % 2);

The above line will give 1 ability point if you're below level 10, or one ability point on odd number ranks if you're above level 10.

Other combinations should be easy enough to work out from the above.

Hook
 
<img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> Hook,
I tried out that new code and really like it, thanks for helping me out on that! I must be a glutton for punishment, but it is a lot more fun an challenging to have to rely on officers and make sure each person specializes to maximize efficency. One more thing that I didn't have a chance to test, will officers go up by the normal amount or does that code apply to them as well? Thanks once again! <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Newly created characters will have the normal amount of points, but when your officers level up they'll the the code you put in.

Hook
 
Back
Top