This article covers the layout of the file; for the default contents, see spells.2da (contents).

The spells.2da file is the .2da that nominally defines the spells available in the game. While it does define the spells available to spellcasters, it also covers many other actions, such as most feats that require activation, monster abilities, and item abilities. For simplicity, these are often collectively called "spells" when in the context of custom content. Each row of this file corresponds to one of these generic "spells".

The columns of this file define how each spell can be used. This covers such things as valid targets, animations, the script to fire, and whether or not casting the spell is inherently considered a hostile act. Also covered is the definition of which classes have access to each spell by default (not counting special cases like domains).

Traditional spells are defined by adding them to this file and assigning them to classes. Other entries in this file are used only when specifically referenced by something, such as the "SPELLID" column of feat.2da. In this respect, this file is the central location for connecting in-game actions to scripts.

Columns of spells.2da
Name Description
ID (no actual name) Row numbers for the benefit of human readers. The game engine ignores the value in this field, instead generating sequential row numbers as the file is read. It is good practice to keep the entries in this field sequentially numbered to avoid confusion.
Label A text value identifying the spell associated with this row. It is not used by the game engine, but makes it easier to locate specific spells within the file. All spaces should be replaced with underscores ( _ ).
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, I=Illusion, 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 these classes. A value of **** means the spell is not normally made available to this class (but could be available via a domain).
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 ResRef of the sound played for verbal components of female casters.
CastAnim A text value specifying the animation the character makes when finishing the spell. Values are: area, attack, out, self, touch, 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 this spell's projectile. This can be one of
accelerating, ballistic, bounce, burst, highballistic, homing, linked, spiral, or test.[1]
(Values in italics are the ones used by standard spells.)
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 Orientation of this spell's projectile while it is in flight. All standard spells use path (projectile faces the direction it is traveling), but target is another supported value (projectile faces the target).
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, these fields contain the ID values for the subspells. These subspells then appear as a submenu off the main spell in the radial menus.
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 of "spell" this is. Values are: 1 = spell, 2 = creature ability, 3 = feat, 4 = item power.
Values of 1 or 2 will cause this row to be listed as a possible special ability for creatures in the Toolset.
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 for the message to be displayed in the combat log when this spell is cast, if the default ("X casts Y") is undesirable. Many special abilities set this column, but no "true" spells do.
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(s) of the specific counter-spell(s), if the spell has any.
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. For an online calculator for these columns, see the external links at the end of this article.

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
0x40 triggers

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 change:
All player-castable spells need to have bit 0x08 (target items) set in the target type to allow them to work with the crafting system (for brew potion, craft wand, and scribe scroll). The responsibility for blocking spells from targeting items other than a blank potion, wand, or scroll has been shifted to the crafting routines. To indicate whether or not a spell is allowed to target items outside the crafting system, the "CastOnItems" column in des_crft_spells.2da needs to be used.

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.


  1. ProjType demo module by OldTimeRadio, posted in BioWare's forum