GetSpellFeatId()

From NWN Lexicon
Jump to navigationJump to search
Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

In the spell script returns the feat used, or -1 if no feat was used.

int GetSpellFeatId();

Description

In the spell script returns the feat used, or -1 if no feat was used.


Remarks

If it is not -1 you can safely determine the feat.2da line that was used to cast the spell. Feats with successors should return the parent feat ID (eg Bard Song).

This can be useful for scripts used by both spells and feats which one was used to capture special behaviour.

Note that Area of Effect objects do store this value for further use along with the spell ID via. GetSpellId.


Version

This function was added in 1.87.8193.35 of NWN:EE.

This function was updated in 1.89.8193.37 of NWN:EE. VM: GetMetaMagicFeat, GetLastSpellCastClass, GetSpellCastSpontaneously and GetSpellFeatId are no longer set erroneously with bad data if the AOE was generated in a spell script when using an item.

This function was updated in 1.89.8193.37 of NWN:EE. VM: GetSpellFeatId() and GetSpellCastSpontaneously() now work in Area of Effect scripts.


Example

This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.


See Also

functions: 

GetSpellId

events: 

Spell Script


 author: Shadguy