GetLastSpellHarmful()

From NWN Lexicon
Jump to navigationJump to search

Determines whether the last spell cast was harmful.

int GetLastSpellHarmful();

Description

Use this in a OnSpellCastAt event script to determine whether the spell was considered harmful.

Returns TRUE if the last spell cast was harmful.

Only can be used accurately in the OnSpellCastAt script of a creature, placeable or door.


Remarks

Returns exact value passed into EventSpellCastAt function, i.e. any value, not just FALSE/TRUE can be put into EventSpellCastAt().

If it is FALSE, it doesn't mean it was a good spell, it could be any non-hostile (IE: don't initiate combat) spell.

If it is TRUE then the caster of the spell should have all invisibility effects removed.


Example

if(GetLastSpellHarmful())
{
    SpeakString("Ouch!");
}
else
{
    SpeakString("Thank you!");
}

See Also

functions: 

GetLastSpellCaster GetLastSpell

events: 

OnSpellCastAt Event


 author: Jochem van 't Hull, editor: Jasperre