ActionUseFeat(int, object)

From NWN Lexicon
Jump to: navigation, search

Causes an NPC to use a feat on oTarget.

void ActionUseFeat(
    int nFeat,
    object oTarget
);

Parameters

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

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.

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

Version

1.61

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());
}

See Also

functions:  GetHasFeat
constants:  FEAT_* Constants


 author: Iskander Merriman, editor: Jasperre