GetLastSpellHarmful

From NWN Lexicon
Revision as of 11:15, 21 August 2012 by Dood (talk | contribs) (Created page with " =GetLastSpellHarmful()= Determines whether the last spell cast was harmful. int  GetLastSpellHarmful(); ====Description==== Use this in a Spell...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



GetLastSpellHarmful()

Determines whether the last spell cast was harmful.

 int  GetLastSpellHarmful();

Description

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

Returns TRUE if the last spell cast was harmful.

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



Remarks

Speculation: Returns TRUE if HostileSetting is set to 1 for this particular spell in spells.2da.

That speculation is wrong, it mearly returns the TRUE/FALSE boolean value passed into the EventSpellCastAt(), using SignalEvent().

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.


Version

1.22

Example

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

See Also

functions: 

GetLastSpellCaster

events: 

OnSpellCastAt Event



 author: Jochem van 't Hull, editor: Jasperre