I need a script to find what level an NPC is, would anybody know of something that would work?
getlevelcreature command should be able to find the level of whoever it is used on
Could I see some actual syntax, I can script all day long but only so long as I have a template to work with
Not too sure about the GetLevelCreature command. moda, could you tell me where you saw that? It isn't an in-game function.
harIII, you can use the GetHitDice() function. Something simple like this:
void main() {
object oTarget = GetFirstPC();
int nLevel = GetHitDice( oTarget );
// Do stuff...
}
- Star Admiral
Does the "GetHitDice()" make a randomly generated number?
its what force powers such as Force storm use to set the levelcap to prevent the power from becoming one hit kill on everything when you go beyond level 10.
so i would assume that every level adds 1 to your hit dice which is then used as part of damage calculation or some such operation.
oh there is no getcreaturelevel, i must have misread setcreatureailevel sorry about that
Hit dice is actually a remnant from the D20 system that both Knights of the Old Republic and Dungeons and Dragons based games, like Neverwinter Nights, which of course shares the same basic game engine, use. When a character is created in D&D you're assigned a certain type of die based on your class, for instance a four sided die for wizards, and a ten sided die for barbarians.
These dice will determine your character's base hit points, which of course increase with constitution bonuses and levels, at first level you get the full possible amount, then at each level up you roll the dice to determine how many more hit points you earn.
That's where the term hit dice comes from, and why it's basically another way of saying level, because a level one creature would only have one hit die worth of HP, while a level ten creature would have ten.
Ok, got it chief, I'll see if this does the trick.