Difference between revisions of "GetCreatureTalentBest"

From NWN Lexicon
Jump to: navigation, search
(works only with unequippable items)
(additional info)
 
Line 28: Line 28:
  
 
If nCategory = 0, returns anything without category, known feats (but not with 0 uses) and skills.
 
If nCategory = 0, returns anything without category, known feats (but not with 0 uses) and skills.
 +
 +
The talent engine checks most talent prerequisities: class level and base ability score for spells, use limitation itemproperty for items, and will not return talents that creature is not able to use. This validity control doesn't work well with polymorphed creatures though. Only item (excluding potion) talents are disallowed to use in polymorph, everything else is allowed.
  
 
====Known bugs====
 
====Known bugs====

Latest revision as of 22:15, 10 February 2016

Determines the best talent of a creature from a group of talents.

talent GetCreatureTalentBest(
    int nCategory,
    int nCRMax,
    object oCreature = OBJECT_SELF
);

Parameters

nCategory
TALENT_CATEGORY_*
nCRMax
The maximum Challenge Rating of the talent.
oCreature
The creature that has the talent. (Default: OBJECT_SELF)

Description

Returns the best talent (i.e. closest to nCRMax without going over) of oCreature, within nCategory.

Remarks

It is possible for nCreature not to have any talent within the specified nCategory. In this case this function will return an invalid talent, akin to OBJECT_INVALID, but you must use the GetIsTalentValid() to test this.

If CR = -1 function works like GetCreatureTalentRandom, CR = 0 returns potions, scrolls and other unequippable items, spell has CR equal to (InnateLevel*2)-1, feats probably 0 as well.

If nCategory = 0, returns anything without category, known feats (but not with 0 uses) and skills.

The talent engine checks most talent prerequisities: class level and base ability score for spells, use limitation itemproperty for items, and will not return talents that creature is not able to use. This validity control doesn't work well with polymorphed creatures though. Only item (excluding potion) talents are disallowed to use in polymorph, everything else is allowed.

Known bugs

Specifying nCategory 1 actually returns talents of category 11 and vice versa. Confirmation needed.

Returns invalid talent if the creature is immobilized (toolset speed setting, entangle effect or cutscene immobility).

Version

1.22

See Also

functions:  GetCreatureTalentRandom, GetIsTalentValid
constants:  TALENT_CATEGORY_* Constants


 author: Tom Cassiotis