From NWN Lexicon
Revision as of 06:49, 19 December 2017 by (talk) (Undo revision 33691 by (talk))
Jump to: navigation, search

GetHasSpell(int, object)

Determines whether a creature has a spell available.

int GetHasSpell(
    int nSpell,
    object oCreature = OBJECT_SELF





The creature to test for a spell. (Default: OBJECT_SELF)


Returns an integer indicating how many instances of a particular nSpell are left on oCreature, or FALSE (0) if no more instances of that spell remain.


Prior to patch 1.25 this function would not work properly for sorcerers or bards.

With patch 1.61, metamagic feats applied to spells and domain feats are now considered for this function (previously this was not the case). The following factors determine the value of the return of GetHasSpell:

No metamagic feat applied: 1
Cleric domain spell, no metamagic feat applied: 2
Silent metamagic feat applied: 3
Still metamagic feat applied: 3
Extended metamagic feat applied: 3
Quickened metamagic feat applied: 1
Maximized metamagic feat applied: 1
Empowered metamagic feat applied: 1

Returns 1 for each spontaneous use when looking for cure/inflict spells cast by clerics.

Known Bugs

Patch 1.28 claims to have fixed problems regarding spontaneous casts, but reports indicate that this is not the case. If you can verify that it has been fixed, please use the link at the bottom of this topic to contact the maintainers of the Lexicon.

The number returned by this function is after each spell use, but it is not always decremented by one. Sometimes it is decremented by 5, 3, or 2.



See Also




SPELL_* Constants

 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Keith Voss, Musashi, Bard Jackson, Justin Koch