Gaming
 

Deep Slumber

From NWN2Wiki

Deep Slumber
Spell Information
Spell level : Innate level: 3, Bard: 3, Sorcerer/Wizard: 3
School : Enchantment
Descriptor(s) : Compulsion, Mind-affecting
Components : Verbal and Somatic
Range : Medium
Target/Area : Huge
Duration : 18 seconds + 6 seconds / level
Save : Will negates
Spell resistance : Yes




[edit] Description

This spell functions like Sleep, except that it affects 10 HD of creatures.

[edit] Bug Notes

Differences between script and description: The script works on 10 + d10 HD of creatures (not mentioned in the description), maximum HD of creature affected is 5 (which matches Sleep, but also not mentioned). It also doesn't affect construct or undead races (which is not mentioned explicitly).

Line 52: Error in the way Empower works (only affecting the dice roll), it should do d10() here, and have on line 64, a maximum of 10 instead of 20. Then add 10 to nHD after line 64.

Line 55: A note that nMax should really be set to 6, which is 1 over the maximum HD to affect, but due to line 97 level 5 is the highest to affect anyway (where it says < 6).

Line 57 - 67: Duration works oddly. We seem to have (ignoring GetScaledDuration(), see below) nCaster Level + 3 + 2 rounds. This is Level + 18 + 12 seconds!

The basic thing should be to remove the added 2 rounds on line 67, and remove the use of GetScaledDuration() on line 58 (so it is simply "nDuration = 3 + nDuration;").

Line 58: GetScaledDuration() is meant to reduce the duration of sleep when less then core rules. In fact, in this and Sleep it doesn't work either.

To remedy this a few changes are needed. The duration should be calculated properly (noted above) to be nCasterLevel + 3 rounds. This will be fDuration, the "base" duration.

Firstly, GetScaledDuration() needs to have nDur changed to a float, or a new GetScaledDurationFloat() be added in nw_i0_spells.nss.

A new variable in the script, fNewDuration, can then be altered every time. It should be reset to fDuration's scaled duration just before 119, ie:

fNewDuration = GetScaledDuration(fDuration, oLowest);

This will return fDuration if the target isn't a PC, or the duration is <= 3 rounds, but the correct scaled ones for the PC.

Then, use fNewDuration 122 and 128 instead of fDuration.

Line 109: The check "if(oLowest != OBJECT_INVALID)" should use GetIsObjectValid() since this test sometimes does not work, so should be "if(GetIsObjectValid(oLowest))"

Line 112: The signal event should be fired at oLowest not oTarget (which will simply be invalid all the time due to how GetNextObjectInShape works).

Line 134-141: oLowest may be invalid (see line 109!) these things should be moved into the 109-133 if statement section, else the script can perform functions on invalid objects.

Line 137: This setting the variable to FALSE is redundant, the delete line on 138 is all that is needed (in fact, doing it this way would mean it gets deleted, then set to false, due to the nature of the delay command stack).

[edit] NWN comparison

  • This spell did not exist in NWN.

[edit] External resources