LevelUpHenchman(object, int, int, int)

From NWN Lexicon
Jump to: navigation, search

Levels up a creature using the default settings.

int LevelUpHenchman(
    object oCreature,
    int nClass = CLASS_TYPE_INVALID,
    int bReadyAllSpells = FALSE,
    int nPackage = PACKAGE_INVALID


Creature to level up.
A CLASS_TYPE_* constant matching the class to level the creature in. (Default: CLASS_TYPE_INVALID)
Determines if all memorizable spell slots will be filled without requiring rest. (Default: FALSE)
A PACKAGE_* constant matching the package used to select skills and feats for the henchman. (Default: PACKAGE_INVALID)


Levels up a creature using the default settings. Returns the new level if successful, or 0 if the function fails. You can assign a new class to level up in by specifying anything CLASS_TYPE_* constant other than CLASS_TYPE_INVALID (when CLASS_TYPE_INVALID is specified, the creature advances on an unknown default path). If an invalid class combination is chosen, like Barbarian and Paladin, the default class is leveled up.

The nPackage determines which package to level up with. If omitted, it will use the starting package assigned to that class or just the class package. The NWN Toolset Level Up Wizard and Creature Wizard use the default package for each class to do level ups.


It is unknown which class is leveled up when a creature is already multiclassed if CLASS_TYPE_INVALID is passed through (need to test).

In order to level up a henchman (or any NPC, it isn't restricted to henchmen), that NPC must have followed its packages stringently. When you create a creature in the toolset, giving it, say, 5 levels of wizard, it automatically follows its packages. If you then start adding feats manually to it, for instance, you'll no longer be able to use the LevelUpHenchman() command successfully on that NPC.

As of HotU and patch 1.61, there a level up wizard available in the Toolset. This along with the Creature Wizard always applies the default package. For custom NPCs and henchmen leave them at level 1 and level them when they are spawned.



See Also

constants:  PACKAGE_* Constants

 author: Charles Feduke, editor: Lilac Soul