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 requires the whatever is provided in the package parameter to match the parameter for the class (as found in packages.2da). If this is not the case, the game will continue to use the package associated with the class (either by character creation, or the default package). The resulting package will be used for choosing skills, feats, etc. Beyond this, a creature is free to level up using different packages and classes 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. 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.