I have a number of NWN1-style henchman in the mod I'm working on. Using the following script on the PC Level Up event, they automatically level up when the PC does:
void main()
{
object oPC=GetPCLevellingUp();
int iXP=GetXP(oPC);
object oHench=GetHenchman(oPC,1);
ResetCreatureLevelForXP(oHench, iXP, FALSE);
ForceRest( oHench);
}
The goal of course is to have the henchman level scale to match the PC level. It works very well and the PC doesn't have to worry about a thing.
Of course the problem happens when the PC and/or henchman are different subraces. Say, for example, the henchman is a human and PC is a Drow. Since it takes 6000xp for the Drow to reach level 2, he/she will end up with a level 4 henchman and really mess with balance. The other way 'round of course and the PC will end up with a henchman who dies as soon as an ogre sneezes near them.
I *could* start slogging away at conditionals and math that will make my head hurt, but I was curious if anyone has already tackled this situation and could save me several hours of trial-and-error. In an ideal world there would be a scripting function to simply set an NPC to the same *hit dice* rather than XP as a PC, but that doesn't seem to exist.
Thoughts?
Modifié par Mazadan, 04 septembre 2010 - 07:33 .





Retour en haut






