GetMetaMagicFeat()
Get the type of metamagic used on the last spell.
int GetMetaMagicFeat();
Description
Returns an integer corresponding to the METAMAGIC_* constant describing which metamagic was used on the last spell cast. This value should remain the same until another spell has been cast. The function will return a value of -1 if the caster is not a valid object.
Can be used in a Spell Script or an Area of Effects OnEnter, OnExit or OnHeartbeat
Remarks
This is called from an object who cast a spell. Epic-level Automatic feats do not show up with this (As this can only return 1 value even though it's a bitmask variable).
It works fine after another spell is cast if used in an Area of Effects scripts, saving the correct value (eg; Empower).
Version
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.
Example
// OnHeartbeat this will tell you if you have used metamagic in a spell script
void main()
{
if(GetMetaMagicFeat() == -1)
SendMessageToPC(OBJECT_SELF,"GetMetaMagicFeat ERROR!");
if(GetMetaMagicFeat() != METAMAGIC_NONE)
SendMessageToPC(OBJECT_SELF,"YOU USED METAMAGIC ON LAST SPELL");
}
See Also
| constants: |
author: GoLeM, editor: Jasperre