ReadySpellLevel(object, int, int)

From NWN Lexicon
Jump to navigationJump to search
Nwnee logo.jpg 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.

Ready a spell level for oCreature.

void ReadySpellLevel(
    object oCreature,
    int nSpellLevel,
    int nClassType = CLASS_TYPE_INVALID
);

Parameters

oCreature
The creature.
nSpellLevel
An integer from 0-9.
nClassType
a CLASS_TYPE_* constant or CLASS_TYPE_INVALID to ready the spell level for all classes.

Description

Ready a spell level for oCreature.

For instance a Sorcerer with 2 of 4 castings of level 1 spells left, will get all 4 castings available after using ReadySpellLevel(oCreature, 1, CLASS_TYPE_SORCERER)


Remarks

Acts like resting essentially, except just for spells of a particular spell level.

Individual slots on a Wizard/Cleric can be done with SetMemorizedSpellReady.

For Sorcerer/Bards you can use this first, then you potentially can use DecrementRemainingSpellUses on a spell of the given level they know to reach a level of spells left you want. However due to the way DecrementRemainingSpellUses you might also need to re-ready a load of other class slots if the Sorcerer or Bard classes are not the first ones in the class list. This could be considered very hacky however.


Version

This function was added in 1.87.8193.35 of NWN:EE.


Example

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


See Also

constants:

CLASS_TYPE_*


 author: Shadguy