GetXP
From NWN Lexicon
Contents |
[edit] GetXP(object)
Get a given creature's experience.
[edit] Parameters
oCreature
Target creature.
[edit] Description
Returns oCreature's experience points (XP).
Only player characters (PC's) can have experience. Anything else returns 0, and of course a newly created PC will also return 0. Dungeon masters may return different values if leveled up outside the DM client by moving them into the local vault, then back into the dm valut.
[edit] Remarks
One use for this function is if you want to take XP away from a PC. GiveXPToCreature doesn't work with negative amounts of XP, so you'll first have to calculate the XP the PC should have, then set it with SetXP. See code sample below for a wrapper function that can be used to both give and take XP from a PC.
[edit] Version
1.61
[edit] Example
[edit] See Also
functions: |
author: Kristian Markon, editor: Jasperre