<Ewald's note>This file is taken from the NWN Custom Content Guide wiki (ccg.dladventures.com). I removed some stuff that the java JTextPane class couldn't handle and added anchor tags to the different column names ( e.g. <a name="MetaMagic"> ) to make it work as help file in my 2da editor.</Ewald's note>

# spells.2 da

Note: This page would be a hell to edit without formating it first, or the use of a wiki new-style table editor if that can be found.

NB: in what follows when we mention a "spell" it isn't necessarily a true spell, if it is the case it will be made explicit. It can be anything this 2da can implement: cast-spell item property, useable feat, racial capacity...

For specifics about spells, and monster abilities see Spells.
Useable feats, class-specific Abilities (Special Ability menu of the palyer) or racial Abilities see Feats.
For item properties see ?ItemProperties, if what you want are spell-like properties (useable from the item) iprp_spells.2da should contain all the info you need besides this page.

We will use the mention True Spell Only for a column whose value only applies to Wizard, cleric etc spells or innate Monster spell-like abilities (those found in the toolset in the "cast spell" list). This generally means that for other features (feats and cast-spell properties in particular) this value is overruled in an other 2da, but not that you can leave the entry blank.

The spell resource file - spells.2da defines each of the spells, how it is cast, who can cast it, and a variety of other details. There are eight main parts to a spells.2da record.

1. General information (spell name, school, range, etc.)
2. What classes can use the spell and what level it is
3. The Conjuration group which stores the sounds and animations that are played when the spell is being cast.
4. The Cast group which stores the sounds and animations that are executed when the caster is done chanting and the spell takes effect. This is not the effect on the recipient -- that is handled in the ?ImpactScript -- but is, for example, the animation for the cone of frost between the caster and target in a cone of cold spell. Cast effects take place after Conjuration effects. Refer to the spell effects reference near the end of this tutorial for details on effects you can use.
5. The Projectile group. This one designates any type of model that moves between the caster and the target. An example would be the ball of the fireball spell that travels from the caster’s hand to the target and then explodes.
6. A list of immunities.
7. Linked spells. This is where you can designate a spell to have more than one type of end effect, similar to a Polymorph spell where you can pick from several options. Linked effects are used for radial menus.
8. Miscellaneous information.

Column | Description |

> Values

SpellID | The first, unnamed column. It serves as the Spell ID. It will be used to cross-reference this spell ressource in other 2das. It is returned by the GetSpellID() function in the associated spell script. |

> As in all other 2das, the value you indicate is of no importance.
> Its actual value is the line number, starting with 0 for the first line.

Label | No other function than giving it a name for human use |

> Whatever

Name True Spell Only | StrRef for the name of the spell: reference to dialog.tlk or the custom tlk file for the module This will give a name to a true spell or monster ability only ; for an item-cast-spell-property or a feat for exemple, it will be overwriten by a column in the appropriate 2da |

> See ?the talk table description to learn how to reference the custom tlk instead of dialog.tlk (HotU feature, 1.33? )

IconResRef True Spell Only | Name of the .tga file that will represent the spell icon. |

> You can create your own icons and put them in the hakpak. This is the recommended method because people want to be able to tell spells apart visually.
> Alternately, you can use generic icons for the different spell school classes:
> Abjuration = is_abjure
> Conjuration = is_conjure
> Divination = is_divine
> Enchantment = is_enchant
> Evocation = is_evoke
> Illusion = is_illusion
> Necromancy = is_necromancy
> Transmutation = is_transmut

School | School of magic |

> A = Abjuration
> C = Conjuration
> D = Divination
> E = Enchantment
> I = Illusion
> N = Necromancy
> T = Transmutation
> V = Evocation

Range | Range of the spell |

> P = Personal (affects only the caster)
> T = Touch (affects the person
> touched)
> S = Short (25 ft + 5 ft/2 levels,
> according to standard 3e rules)
> M = Medium (100 ft + 10 ft/level)
> L = Long (400 ft + 40 ft/level)

VS | Verbal and somatic components of the spell. |

> V = Verbal only (cannot cast this spell if silenced)
> S = Somatic (Spell suffers arcane spell failure from armor)
> VS = both
> - = neither

MetaMagic True Spell Only | Defines which metamagic feats can be used on the spell. The number is a bit flag setting and must be in hexadecimal format. The numbers need to be added together to get the final set of flags for the spell. Example: I want a spell that can be Quickened, Silent, Still, and Maximized. I would have 8(Quicken) + 16(Silent) + 32(Still) + 4(Maximize) = 60 total.
Once you get the number you need to convert it into hex format. The easiest way if you use Windows is to use the calculator.
Open up the Calculator program in Windows and under the View menu, switch to scientific mode. Make sure the round radio button is checked for Dec. Enter in your number and then change it from Dec to Hex; this is your hexadecimal number. Enter this number along with a 0x (just programmer’s notation that a number is in hexadecimal format) to the column. That is a 'zero' and not the letter Oh. So our example would be 0x3c.

> 0x01 = 1 = Empower
> 0x02 = 2 = Extend
> 0x04 = 4 = Maximize
> 0x08 = 8 = Quicken
> 0x10 = 16 = Silent
> 0x20 = 32 = Still

TargetType | This is the type of target the spell requires. Like the MetaMagic value,this is actually a binary flag system. You must enter the hex code after adding up the values for all the targets you want to be able to affect. This doesn't work too well for feat implementation prior to 1.33: this value tells when the script will actually fire, and the one in feat.2da (limited to target self and other), when the cursor is active. HotU promises to fix it |

> 0x01 = 1 = Self
> 0x02 = 2 = Creature
> 0x04 = 4 = Area/Ground
> 0x08 = 8 = Items
> 0x10 = 16 = Doors
> 0x20 = 32 = Placeables
> 0x40 = 64 = Trap triggers (only when detected) and area transition triggers (this does not work very well - the cursor is active on the area transition, but when clicking the PC is left hanging before casting the spell and the script doesn't fire). This value is not currently used by Bioware, and hasn't been tested by the original writer of the last sentence for a very long time.
> HotU specific changes:

> - All player castable spells need to have bit 0x08 set to allow them to work with the crafting system
> - Feats connected to a spell using FeatID now will work correctly with this field, with the exception of bit 0x01, which is always included (but you can code around that in your spellscript).

?ImpactScript | The script that runs against the target of the spell |

> its name without the .ncs extension...

Bard Cleric Druid Paladin Ranger
Wiz_Sorc
Innate
True Spell Only
The level of the spell for each class, if it can't be used by that class then it is commented out with ****.
Innate is for creatures that have it as a spell like ability. A lot of creature abilities are implemented as "innate spells".

> 1 to 9, unknown for epic spells

ConjTime True Spell Only | Conjuration is the process of invoking the spell. The conjuration time in milliseconds. Note: the Conjuration effects are executed before the Cast effects. |

> For spells it is 1500 with only 1 exception - Phantasmal Killer - which is at 900

ConjAnim True Spell Only | This is for the character or creature invoking the spell and calls the appropriate animation so that the caster goes through the right motions. |

> The three possible values are:
> hand = Casters hands are in front of
> him.
> head = Casters hands reach up to
> above face level.
> **** = No hand movement

ConjHeadVisual | This is to add a visual effect over the head of the caster when invoking the spell. |

> Some sample head visuals and the spells they are used on are:
> Ice_Storm vco_mehancold03
> Resurrection vco_mehanelec01
> Premonition vco_mehanelec03
> Meteor_Swarm vco_mehanevil03
> There are a lot more. ?visual effects reference

ConjHandVisual | This adds an effect to - or between - the caster's hands when invoking the spell. |

> ?visual effects reference

ConjGrndVisual | This adds an effect to the ground around the caster when invoking the spell. |

> ?visual effects reference

ConjSoundVFX | This is the sound effect that plays when invoking the spell. It is not the caster's voice but the energy crackles, moaning, etc. that plays in the background |

> ?visual effects reference

ConjSoundMale ConjSoundFemale | These are the sound effects for the chanting that the caster does while invoking the spell |

> ?visual effects reference

CastAnim | The caster's pose after finishing the spell conjuration. Note: the Cast animations and effects occur after the Conjuration ones. |

> Possibilities are
> Area
> out
> self
> touch
> up
> attack - perform attack animation
> ****

CastTime | This seems to be how long in milliseconds the caster stays in the CastAnim pose |

> There seem to be 2 settings
> 1000 = most spells
> 1700 = spells with ray or cone shaped effects

CastHeadVisual | Not currently used for any spells |

> '****'

CastHandVisual | These effects happen to the caster after the conjuration effects take place. An example would be the force rings that radiate from the casters hand after a magic missile spell or the cone of frost from a cone of cold spell |

> placeholder_2

CastGrndVisual | Not currently used for any spells |

> '****'

CastSound | The sound played after the Conjuration |

> placeholder_3

Proj | Is there a projectile model that moves between the caster and the target in the spell |

> 1 for yes
> 0 for no

ProjModel | The model that moves between the caster and the target |

> The currently used ones are:
> vpr_aroacid
> vpr_ectoacid01
> vpr_ectocold01
> vpr_ectoevil01
> vpr_ectofire01
> vpr_ectomind01
> vpr_ectonatr01
> vpr_ectoodd01
> vpr_ectosonc01
> vpr_fireball
> vpr_ringsmal
> vpr_wraith

ProjType | The physics of the projectile |

> accelerating
> homing
> linked
> spiral - like the arcane archer's seeker arrow
> ballistic
> bounce - like grenade like weapons
> ****

ProjSpwnPoint | Where the projectile starts at from the caster |

> hand - spawn from caster's hand
> head - spawn from caster's head
> **** - no projectile spawned
> HotU:
> monster0 to monster9 - Monster nodes (HotU specific, i.e. the beholder's eye nodes).

ProjSound | The sound of the projectile |

> placeholder_4

ProjOrientation | Which direction to orient the projectile in |

> Set to path if there is a projectile

ImmunityType | Type of immunity needed to ignore the effects of this spell. * This column is not used by the game * |

> Note there are three Mind Affecting immunities and two Positive immunities, I'm not sure if this a typo or not - looks like one
> Acid
> Cold
> Death
> Disease
> Divine
> Electricity
> Fear
> Fire
> Mind_Affecting
> Mind_Effecting (Typo?)
> Mind-Affecting (Typo?)
> Negative
> Poison
> Positive
> Postive (Typo?)
> Sonic

ItemImmunity | Are items immune to being affected by this spell? |

> 1 for yes
> 0 for no

SubRadSpell1-5 | These are for spells that have multiple ways of casting them. The values in these columns are the index value of "sub" spells that will come up in another radial menu. Spells like Polymorph Self or Shapechange where you can pick a type of creature to turn into, or Shadow Conjuration where you can pick the spell to emulate.
The maximum number of choices you have for a spell will be 5. The people who are planning on implementing radical new Polymorph spells where you can turn into all sorts of animals may want to look at this.

> Index of each of the subspells in this very 2da
> It has been reported that radials only work if the new spells use ID numbers directly consecutive to those already in use... But only because one has to remember the true SpellID is the line number NOT the index one has written without repecting line count I believe).
> (1.32):Information in these fields is not computed correctly for custom content prior to HotU. With HotU these fields should work fine, BUT it will require some special tricks to make them useable with feats (i.e. a feat that opens into a subradial spell selection, like the druid's wildshape). Prior to HotU using subradial spells with feats is not possible at all.

Category | Possible values are equal to the various TALENT_CATEGORY_* constants in nwscript.nss, and are also listed in category.2da that this entry appears to reference (however category.2da has only one column besides the index, so its function is unclear).
It is used in various AI scripts to select appropriate abilities for creatures or NPCs to use.

> from category.2da:
> (AoE = Area of Effect)
> 1 Harmful_AOE_Discriminant (only affects ennemies)
> 2 Harmful_Ranged
> 3 Harmful_Touch
> 4 Beneficial_Healing_AOE
> 5 Beneficial_Healing_Touch
> 6 Beneficial_Conditional_AOE
> 7 Beneficial_Conditional_Single
> 8 Beneficial_Enhancement_Area Effect
> 9 Beneficial_Enhancement_Single
> 10 Beneficial_Enhancement_Self
> 11 Harmful_AOE_Indiscriminant
> 12 TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF
> 13 TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE
> 14 TALENT_CATEGORY_BENEFICIAL_PROTECTION_AOE
> 15 TALENT_CATEGORY_BENEFICIAL_SUMMON
> 16 TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT
> 17 TALENT_CATEGORY_BENEFICIAL_HEALING_POTION
> 18 TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_POTION
> 19 TALENT_CATEGORY_DRAGONS_BREATH
> 20 TALENT_CATEGORY_BENEFICIAL_PROTECTION_POTION
> 21 TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_POTION
> 22 TALENT_CATEGORY_HARMFUL_MELEE
> 23 TALENT_DISPEL

Master | Used in conjunction with the SubRadSpell columns. For a subspell this is the parent spell that called it. The actual effect is that the uses-per-day of the master spell is reduced by one when this spell is cast, along with that of all the other subspells. Generally all sub-spells will want this and no others will. Subspells without this seem to work, at least last time I checked, and it might have an interest, but it comes without waranty, since Bioware never uses it this way. |

> Index of the master spell in this very 2da

UserType | Type of capacity this line actually implements I can't remember any engine use for this entry other than a cosmetic one in the toolset, but put the appropriate value anyway. |

> 1 = Spells
> 2 = Creature Power
> 3 = Feat
> 4 = Item Power
> If it is only a Creature Power put 2
> Only an Item Power, 4
> Only a feat put 3.
> If it is simply a spell or a spell and (a Creature Power or an Item Power) put 1.

> Notes:

> > - ?UserType 4 (Item) spells will never show up in the special abilities panel (toolset) on creatures
> > - ?UserType 3 (Feat) will not show up as seperate special abilities/spells (toolset).
> > - The talent system in the AI makes use of these values, i.e. putting a 3 (feat) will prevent creatures from using a spell via ?TalentSpell, ?TalentFeat must be used instead.
> > - In addition certain game mechanisms make use of this data field, it may affect if a spell can be counterspelled, is affected by dispel magic, etc. It also affects if the spell can be interrupted. (i.e. feats can not be interrupted).
> > - It's important that you put the correct use into this field.

SpellDesc True Spell Only | StrRef for the description of the spell: reference to dialog.tlk or the custom tlk file for the module |

> See ?the talk table description to learn how to reference the custom tlk instead of dialog.tlk (HotU feature, 1.33? )

UseConcentration | Determines if a Concentration check is needed to successfully cast the spell if interrupted (e.g., if hit during combat) |

> 0 for no
> 1 for yes
> For spells always 1. The only records which have a 0 are uninterruptible ones like constant creature powers.

SpontaneouslyCast | This is for the Clerics spontaneously casting. Only Cure/Cause wounds should have this. |

> 1 for yes
> 0 for no

AltMessage | This is the strref for the message in dialog.tlk that is displayed to people other than the caster, for example "SoAndSo smites evil". |

> See ?the talk table description to learn how to reference the custom tlk instead of dialog.tlk (HotU feature, 1.33? )
> You can use the token <CUSTOM0> in the string that is referenced by this line to make the name of the creature using the spell appear:
> "<Custom0> smites evil" would translate into "Big Troll smites evil".

HostileSetting | Should a NPC consider this an attack if they are affected by the spell? |

> 1 for yes
> 0 for no
> This actually is used in the SignalEvent call. If it is 1, then it will be a hostile act when the target gets the event signaled to them.

FeatID | The ID of the feat this "spell" implements. There are a few feats that are activated like spells, and you can make your owns. Actually I'm pretty sure this reference is of no use to the engine, its the other way around that matters most (the reference from ?feat.2da to this 2da). However do put the correct one. It will makes things easier for you, and it could be usefull to get this data from the ?ImpactScript (there is no function doing it for now, except for Get2daString, but it might change one day). |

> Index of the feat in ?feat.2da. You know what? It is actually the line number in the 2da that matters not the index written in the first column which might (but should not) be bogus. How extrordinary!

Counter1 | Reference to the first counterspell |

> Index of the counterspell in this 2da... line number... bogus

Counter2 | Reference to the second counterspell |

> Index of the counterspell in this 2da... line number... bogus

HasProjectile | HotU specific field, introduced to optimize performance. Controls if a projectile information needs to be sent to each client that can see the spell being cast. |

> You need to set this field to 1 if any of the following conditions is met:

> > ?CastHandVisual is not empty OR
> > Proj is not empty OR
> > ?ProjModel is not empty

> In all other conditions this fields should be set to 0 to prevent the game from sending unneccessary packets to the clients.

Last edited on November 25, 2003 1:45 pm.