LevelUpHenchman() NWScript command causes the specified object (which must be a creature) to perform an automatic level-up process. The command is named for its initial purpose, leveling the player's henchman in the Shadows of Undrentide campaign. However, it can be used for any creature — including player characters, as is done in one case at the start of the Hordes of the Underdark campaign. (Player characters do need to have the experience points for the level first; non-player characters ignore this requirement. In either case, SetXP() can be used to remove levels.)
This command allows specifying the class to be gained, as well as the package to be used for choosing skills, feats, etc. This allows variability in how creatures level, as a different class or package could be specified for each level (still within the limit of three classes per creature, and prestige class prerequisites must still be met). However, when dealing with creatures created in the Toolset,
LevelUpHenchman() tends to only work if the creature was created with a single hit die. There may be a way to create a higher-level creature that will work with this command, but it is generally not worth the trouble as the same result could be achieved by calling
LevelUpHenchman() when the creature spawns.
Unlike the normal level-up process for player characters, prerequisites need to be met before leveling. (Normally, player characters just need to have met prerequisites at the point in the leveling process when a choice is made.) For example, epic feats will not be taken until level 22 as they require character level 21, which is not met before the level-up process for level 21. Also, any feat assigned through the Toolset is not considered when the creature is leveling up, allowing the creature to select a feat it already has.
int LevelUpHenchman (object oCreature, int nClass=CLASS_TYPE_INVALID
int bReadyAllSpells=FALSE, int nPackage=PACKAGE_INVALID
- The creature that will be leveled.
- The class in which the creature will gain a level. The default value indicates leveling in the creature's first class.
- If set to TRUE, all spell slots will be readied (with no need to rest).
- The package to use for this automatic level-up. This parameter is ignored if it specifies a package that is not for the class indicated by the second parameter. The default value indicates using the package selected when the character was created (in the Toolset or by the player). If no such package was selected for the given class, the default package for that class will be used.
This command will return the level the creature now is, unless the level-up failed for some reason. In the latter case, 0 is returned.