ActionUseFeat(int, object)

From NWN Lexicon

Causes an NPC to use a feat on oTarget.

void ActionUseFeat(
    int nFeat,
    object oTarget
);

Contents

[edit] Parameters

nFeat
The FEAT_* constant representing the feat to use.
oTarget
The object to be the target of the feat.

[edit] Description

ActionUseFeat causes the action subject to use the specified feat on oTarget (if oTarget is an appropriate object type for the feat). If the actor doesn't have the feat, this action does nothing. Only useable feats with a target can be used with this action. Passive feats such as Alertness, Martial Weapon Proficiency, and so on cannot be used, of course.

[edit] Remarks

This action cannot be assigned to PCs.

There is no way to make an NPC use a feat it doesn't know. Unlike in ActionCastSpellAtObject(), there is no "Cheat" option. If the NPC knows a feat but has run out of uses, you can use IncrementRemainingFeatUses() to give him more. Contrariwise, you can decrease the number of uses of a feat with DecrementRemainingFeatUses().

[edit] Version

1.61

[edit] Example

// In "Actions Taken" script of conversation node from
// an NPC with the "Lay on Hands" feat:
void main()
{
    ActionUseFeat(FEAT_LAY_ON_HANDS, GetPCSpeaker());
}

[edit] See Also

functions:  GetHasFeat
constants:  FEAT_* Constants


 author: Iskander Merriman, editor: Jasperre

Personal tools
Categories