GetLevelByPosition
From NWN Lexicon
Contents |
[edit] GetLevelByPosition(int, object)
Get the class level of an object from the class table.
int GetLevelByPosition( int nClassPosition, object oCreature = OBJECT_SELF );
[edit] Parameters
nClassPosition
The row in the class table to get a value from. Range is 1 to 3.
oCreature
The object to get a value from. (Default: OBJECT_SELF)
[edit] Description
Returns an integer that describes the class level of oCreature in position nClassPosition of the class table (i.e., returns the level of oCreature's [nClassPosition]th class). If oCreature doesn't have a class table (e.g., a placeable object or trigger), or if the object doesn't have a class in the targeted position (e.g. the second position for a single-classed character) then the function will return 0 as there is no class value to return.
[edit] Version
1.22
[edit] Example
// Return the level of the player's first class void main() { int i; i = GetLevelByPosition(1,GetFirstPC()); SendMessageToPC(GetFirstPC(),"Your first class is level == " + IntToString(i)); }
[edit] See Also
functions: |
author: GoLeM, editor: Kristian Markon