NWNWiki
Advertisement
NWNWiki
3,718
pages

The spells.2da file controls the available spells that are included in the game. It specifies any restrictions the spell has, any scripts that are fired on use, and any other information governing the use of the spell. Refer to spells.2da (table) for a layout of the actual file.

Column descriptions

Column name Description
ID (no actual header} Sequentially numbered. This field identifies the item property to the game engine. The game engine actually ignores the value in this field and sequentially numbers the records as it reads them, so it is good practice to keep the entries in this field sequentially numbered to avoid confusion.
Label The name of the spell. Any spaces should be written as underscores ( _ ). This value is usually just for reference purposes, but can be displayed in game if the value in the Name column is ****.
Name A StringRef indicating a string that will be displayed in the game as the name of the spell.
IconResRef A text value (ResRef) specifying the filename of the icon displayed in game for this spell. By convention, all icon names start is_, for icon spell, followed by the spell name, abbreviated if necessary. The maximum length for the text/filename is 16 characters.
School A letter value specifying the spell school for the spell. A = Abjuration, C = Conjuration, D = Divination, E = Enchantment, N = Necromancy, T = Transmutation, V = Evocation
Range A letter value specifying the range at which targets may be selected. P = Personal, T = Touch, S = Short, M = Medium, L = Long
VS A combination value of letters specifying whether the spell has verbal or somatic components, or both. v = verbal only, s = somatic only, vs = both verbal and somatic
MetaMagic A hex number value which determines which metamagic feats may be used with this spell. See the column notes below for how to determine the value for this field.
TargetType A hex number value which determines the targets which may be selected for this spell. See the column notes below for how to determine the value for this field.
ImpactScript The name of the script file that is run when the spell is cast. The name has a maximum of 16 characters. See the script naming conventions section below for more information on script names.
Bard The spell level at which this spell is available to this class. A value of **** means it is normally unavailable to this class.
Cleric Same as Bard. Spells unavailable in this file may be made available via a domain. This is specified in domains.2da.
Druid Same as Bard.
Paladin Same as Bard.
Ranger Same as Bard.
Wiz_Sorc Same as Bard. This column applies to both sorcerers and wizards.
Innate The innate level of the spell.
ConjTime The amount of time in milliseconds the Conj visuals and sounds specified in the following columns will play. 1000 milliseconds is about equal to 1 second. The usual value for spells (not abilities) in this column is 1500.
ConjAnim Specifies the location on the casting object where the visuals will be played. Value is either head or hand.
ConjHeadVisual ResRef of the visual model to be used on the caster's head.
ConjHandVisual ResRef of the visual model to be used on the caster's hands.
ConjGrndVisual ResRef of the visual model to be used. This field is used for the higher level spells to make them look more "grand", especially if they have lower level counterparts.
ConjSoundVFX ResRef of the sound the spell causes while it is being cast.
ConjSoundMale ResRef of the sound played for verbal components of male casters.
ConjSoundFemale Same as ConjSoundMale, but for female casters.
CastAnim A text value specifying the animation the character makes when finishing the spell. Values are: self, touch, out, area, and up.
CastTime Amount of time in milliseconds that the Cast columns play. These fire when the Conj section completes. The spell script triggers when this starts. Effects from the spell script should be applied as close as possible to when this time finishes.
CastHeadVisual ResRef of visual model played on the caster's head when casting the spell.
CastHandVisual ResRef of visual model played on the caster's hands when casting the spell.
CastGrndVisual ResRef of grand visual model.
CastSound ResRef of sound played.
Proj Value 0 (false) or 1 (true). States whether this spell uses a projectile model used during the CastTime
ProjModel ResRef of the model
ProjType behavior of the projectile. Values are: accelerating, homing, linked, ballistic, spiral, bounce
ProjSpwnPoint spawn point on the caster that the projectile leaves from. Values are: hand (used for 99% of spells), and monster0, monster1, monster2, monster3, monster4 (used for Beholder rays from eyestalks).
ProjSound ResRef of the sound file for the projectile
ProjOrientation for any spell that has a projectile, the value for this field is path.
ImmunityType Specifies an immunity type for this spell. Values are: Acid, Cold, Death, Divine, Disease, Electricity, Fear, Fire, Mind_Affecting, Negative, Poison, Positive, Sonic
ItemImmunity Value 0 (false) or 1 (true).
SubRadSpell1 If a spell has different possible variations, this field contains the ID value for the subspell. This subspell appears in the subradial menu that appears when attempting to select the main spell.
SubRadSpell2 Same as SubRadSpell1.
SubRadSpell3 Same as SubRadSpell1.
SubRadSpell4 Same as SubRadSpell1.
SubRadSpell5 Same as SubRadSpell1.
Category Used for the AI, this column contains the ID value of the category specified in categories.2da.
Master If this spell is a subspell, this field contains the ID value for the spell it is a subspell for.
UserType Specifies what type the "spell" is. Values are: 1 = spell, 2 = creature ability, 3 = feat, 4 = item power
SpellDesc A StringRef indicating a string that will be displayed in the game as the spell description.
UseConcentration Value 0 (false) or 1 (true). If true, the spell can be interrupted by getting hit in combat, etc.
SpontaneouslyCast Value 0 (false) or 1 (true). If true, the spell may be cast without having been previously memorized.
AltMessage A StringRef.
HostileSetting Value 0 (false) or 1 (true). Determines whether a spell is considered hostile when being cast on other creatures.
FeatID ID value of the associated feat, if there is one.
Counter1 Spell ID of the specific counter-spell, if the spell has one.
Counter2 Same as Counter1.
HasProjectile Value 0 (false) or 1 (true). States whether or not the spell has a projectile.

Column notes

Both the MetaMagic field and TargetType fields are bit fields. The below tables show the hexadecimal values that are added together to get the values for use in the .2da file.

MetaMagic values
Value Metamagic
0x01 empower spell
0x02 extend spell
0x04 maximize spell
0x08 quicken spell
0x10 silent spell
0x20 still spell
 
TargetType values
Value Target
0x01 self
0x02 creature
0x04 area/ground
0x08 items
0x10 doors
0x20 placeables

A value of 0x40 can be used as a target type for triggers, encompassing both trap triggers that have been discovered and area transition triggers, but this does not work very well.

Hordes of the Underdark specific changes:

  • All player castable spells need to have bit 0x08 set in the target type to allow them to work with the crafting system.
  • Feats connected to a spell using FeatID now will correctly work with the target type field.

There is online Metamagic/TargetType values calculator plus unique pictured list of many other field values - [1]

General notes

  • It appears there is a limit of 255 to the number of spells which can be put into class spell book. Attempting to log in with a character with more spells than this will crash the server (or crash the game in single player). This limit applies only to the actual spells known by a character, not the spells available on level up. Since radial spells — such as protection from good and protection from evil — count as one spell in the spell book — protection from alignment, for this example — adding spells as radial options is one way around this limitation.
  • BioWare followed a naming convention for their spell scripts, as detailed in the following table.
Character positions Value(s) Description
1 & 2 nw, x0, x1, x2 The first two letters designate which game/expansion the script came from: nw for NWN, x0 or x1 for Shadows of Undrentide, and x2 for Hordes of the Underdark. For custom scripts, many authors will use their initials here.
3 _ Underscore
4 & 5 s0, s1, s2, s3 s0 is used for player castable spells, s1 for monster spell-like abilities, s2 for special ablities/feats, and s3 for items/item properties.
6 _ Underscore
7-16 <spell name> The remainder of the script name is the spell name, abbreviated if necessary to fit within the 16 character limit.
Advertisement