GetHasFeat(int, object)
Test whether a creature is able to perform a feat.
int GetHasFeat( int nFeat, object oCreature = OBJECT_SELF );
Parameters
nFeat
oCreature
Creature to check for feat. (Default: OBJECT_SELF)
Description
Determine whether oCreature has nFeat, and nFeat is useable. Checks the highest level of a feat. Returns TRUE (1) if oCreature has nFeat and its usable, FALSE (0) otherwise.
Remarks
It may well return the amount of times it is useable, although it hasn't been checked.
The feat doesn't have to be useable to return TRUE, as feats such as Alertness, Simple Weapon Proficiency and so forth can be returned TRUE by this.
Any feat which stacks - such as bard songs, are got through the base (first) feat aquired for it - such as the first entry of FEAT_BARD_SONGS in feats.2da, or the first entry of FEAT_SNEAK_ATTACK in the same 2da.
Version
1.61
Example
// If the PC speaker has the feat "Alertness" then the NPC whispers // "I see you know whats going on around you..." // Goes in a conversation somewhere. void main() { if(GetHasFeat(FEAT_ALERTNESS, GetPCSpeaker())) { // Speak the whisper SpeakString("I see you know whats going on around you...", TALKVOLUME_WHISPER); } }
See Also
categories: | Get Data from Creature Functions | Talents/Skills/Feats Functions |
constants: | FEAT_* Constants |
author: Iskander Merriman, editor: Jasperre, additional contributor(s): Samvel Oganesyan