Difference between revisions of "GetCreatureTalentRandom"

From NWN Lexicon
Jump to: navigation, search
(Remarks)
m (Prettified article formatting)
Line 1: Line 1:
=GetCreatureTalentRandom(int, object)=
+
{{DISPLAYTITLE:GetCreatureTalentRandom(int, object)}}
 
 
 
Retrieves a random talent from a group of talents that a creature possesses.
 
Retrieves a random talent from a group of talents that a creature possesses.
 
 
<nwscript>
 
<nwscript>
 
talent GetCreatureTalentRandom(
 
talent GetCreatureTalentRandom(
Line 11: Line 9:
  
 
====Parameters====
 
====Parameters====
 +
;nCategory
 +
:[[talent_category|TALENT_CATEGORY_*]]
  
''nCategory''
+
;oCreature
 
+
:The creature who potentially possesses a talent within the specified talent category. (Default: OBJECT_SELF)
[[ talent_category | TALENT_CATEGORY_* ]]
 
 
 
''oCreature''
 
 
 
The creature who potentially possesses a talent within the specified talent category. (Default: OBJECT_SELF)
 
 
 
  
 
====Description====
 
====Description====
 
 
Returns a random talent of oCreature, within nCategory.
 
Returns a random talent of oCreature, within nCategory.
  
 
====Remarks====
 
====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.
 
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.
  
Specifying nCategory 1 actually returns talents of category 11 and vice versa.
+
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).
 
Returns invalid talent if the creature is immobilized (toolset speed setting, entangle effect or cutscene immobility).
  
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.
  
 
====Version====
 
====Version====
 
 
1.22
 
1.22
  
Line 42: Line 33:
  
 
{| class="seealso"
 
{| class="seealso"
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
+
|width="1px" align="right" valign="top" | <font color="gray">functions: </font>
|
+
|[[GetCreatureTalentBest]], [[GetIsTalentValid]]
[[ GetIsTalentValid  | GetIsTalentValid ]]
 
 
|-
 
|-
|-
+
|width="1px" align="right" valign="top" | <font color="gray">constants: </font>
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
+
|[[talent_category|TALENT_CATEGORY_* Constants]]
|
+
|}<br />
[[ talent_category | TALENT_CATEGORY_* Constants ]]
 
|}
 
 
 
<br />
 
 
----
 
----
 
<font color="gray">  author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jim Allen</font><br />  <br />
 
<font color="gray">  author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jim Allen</font><br />  <br />
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Core_AI_Functions]]
 
[[Category:Core_AI_Talent_Functions]]
 
[[Category:Core_AI_Talent_Functions]]
 
[[Category:Get_Data_from_Creature_Functions]]
 
[[Category:Get_Data_from_Creature_Functions]]
 
[[Category:Talents_Skills_Feats_Functions]]
 
[[Category:Talents_Skills_Feats_Functions]]

Revision as of 21:48, 16 January 2016

Retrieves a random talent from a group of talents that a creature possesses.

talent GetCreatureTalentRandom(
    int nCategory,
    object oCreature = OBJECT_SELF
);

Parameters

nCategory
TALENT_CATEGORY_*
oCreature
The creature who potentially possesses a talent within the specified talent category. (Default: OBJECT_SELF)

Description

Returns a random talent 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.

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).

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

Version

1.22

See Also

functions:  GetCreatureTalentBest, GetIsTalentValid
constants:  TALENT_CATEGORY_* Constants


 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jim Allen