Spells.2da
From NWN1 Custom Content Guide
Contents |
[edit] Overview
Safe index line: 1500 This means your first line should be number 1500 (starting from 0). Remember the indexes must be consecutive. If line 43 has 2000 written in its first column it will still be considered line 43 by the engine. If necessary use blank lines (****) to pad the 2da up to the first safe line.
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, usable feat, racial capacity...
For specifics about spells, and monster abilities see Spells.
Usable feats, class-specific Abilities (Special Ability menu of the palyer) or racial Abilities see Feats.
For item properties see Item Properties, 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 another 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.
- General information (spell name, school, range, etc.).
- What classes can use the spell and what level it is.
- The Conjuration group which stores the sounds and animations that are played when the spell is being cast.
- 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 Impact Script -- 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.
- 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.
- A list of immunities.
- 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.
- Miscellaneous information.
[edit] Table
| 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 overwritten by a column in the appropriate 2da. | See the talk table description to learn how to reference the custom tlk instead of dialog.tlk. |
| IconResRef True Spell Only | Name of the .tga file that will represent the spell icon. The .tga file must be present in the hakpack or Bioware resources, else it will appear as a white, blank, 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:
|
| School | School of magic. This dictates, in game, if a specilist wizard can take the spell, and adds bonuses due to Spell Focus feats. Note that G is "General" in spellschools.2da, where the rest of these values are from, and should be usable by all casters. New spell schools can probably never be added, however, it might be possible as spellschools.2da does have a "Letter" value. It wouldn't be possible to add new feats to contribute to the school DC values, however. (Similar to how there is no way to add new weapon feats, like Improved Critical, for new weapons). |
|
| Range | Range of the spell. See Ranges.2da for the actual meter value. NwN uses Metres, and doesn't scale due to caster level. 1 tile is 10x10M. Note that Ranges.2da holds the hardcoded ranges for spells - there seems no way to add new ones as these letters seemingly are not in the Ranges.2da file.
Also note that if the caster is trying to touch the target, and is next to them, the ranges here will not matter and the game will let them cast it. Therefore, to have real touch spells, put P for a range of 0. If the target type is self, these ranges have absolutely no effect - this is only for targeting other creatures. |
|
| VS | Verbal and somatic components of the spell. Verbal component spells cannot be cast when under the influence of Silence, while somatic component spells cannot be cast if the caster cannot move. It is unknown when verbal-only spells actually can be cast in stun ETC. Somatic spells also have a spell armour failure induced for arcane spell casters (Bard, Wizard, Sorcerer). There is no way to add more components to this, using other values are not recommended. |
|
| Metamagic True Spell Only | Defines which metamagic feats can be used on the spell. The number is a bit flag setting (See BitMasks) 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. |
|
| TargetType | This is the type of target the spell requires. Like the Metamagic value, this is actually a binary flag system (See BitMasks). You must enter the hex code after adding up the values for all the targets you want to be able to affect.
The target is only what a PC object will be able to validly pick as a target. It will not apply to scripted calls of ActionCastSpell(). If something invalid is somehow chosen as a target, such as by the script call, then the spell casts as normal as if it was a valid target. See the notes for feats to the right. This does apply to feats, but the self bit is always set. |
HotU specific changes:
|
| ImpactScript | The script (compiled in the toolset, and available in any resource file) that runs against the target of the spell. See Impact Script. The ImpactScript column is NOT case-sensitive as with any script reference in 2da's. Note that this script applies effects - therefore, if the spell is interrupted (eg: Via concentration checks) this script merely fails to fire. If the script doesn't exist, basically nothing happens. Also note that the scripting functions ActionCastFakeSpell***() will fire all the conjuration effects, casting effects and sounds, but just fail to fire this script. | Its name without the .ncs extension. For example, making a new spell, I might have "SPL_ALARM" for a spell called alarm. It is only the reference used for the script and that's just a simple naming convention. |
| 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".
The spell level does directly change the "CR" of the spell, got by GetCreatureTalentBest(), and seems to be simply double the appropiate level put in these columns (so a max CR of 18). This means, even for creature spells, the innate level directly influences the default AI and perhaps what abilities are used first or considered the most powerful. | 0 (Cantrip) to 9. Epic spells are essentially "feats" and do not carry a level, but every valid entry to the spells.2da requires an Innate column entry.
- Aenn: Epic Spells are innate level 10 spells. |
| ConjTime True Spell Only | Conjuration is the process of invoking the spell. This makes the conjuration effects stay on until this time is over, and can be any amount (so a spell can take longer than 1 action to cast). The conjuration time is in milliseconds. This is tested, and any value can be put here. A time of 0 is used for creature auras and any feat references.
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:
|
| 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:
There are a lot more, see VFX. |
| ConjHandVisual | This adds an effect to - or between - the caster's hands when invoking the spell. | VFX |
| ConjGrndVisual | This adds an effect to the ground around the caster when invoking the spell. | VFX |
| 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. These are not looping, and fire once, despite any changes to ConjTime, or if the spell is disrupted. | VFX |
| ConjSoundMale ConjSoundFemale | These are the sound effects for the chanting that the caster does while invoking the spell. If the spell is disrupted, this sound plays anyway, and plays for the full duration dispite any changes to CastTime/ConjTime. | VFX |
| CastAnim | The caster's pose after finishing the spell conjuration.
Note: the Cast animations and effects occur after the Conjuration ones. | Possibilities are:
|
| CastTime | This seems to be how long in milliseconds the caster stays in the CastAnim pose. | There seem to be 2 settings:
Other values will probably work, however. This amount of time is passed before a new action can take place (after the spell script has fired). It usually just looks good for some spells like Cones, or for the "CastHandVisual" to work right. |
| 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 caster's hand after a Magic Missile spell or the cone of frost from a Cone of Cold spell. If concentration is disrupted, this is not fired. | placeholder_2 |
| CastGrndVisual | Not currently used for any spells | '****' |
| CastSound | The sound played after the Conjuration, if the conjuration is sucessful with no concentration interrupts. | placeholder_3 |
| Proj | Whether there is a projectile model that moves between the caster and the target in the spell. If there is a projectile model, the spell script only fires once the model reaches the target location. This means that a fireball will have a natural delay before the impact script which does damage actually fires. | 1 for yes, 0 for no |
| ProjModel | The model that moves between the caster and the target. | The currently used ones are:
|
| ProjType | The physics of the projectile |
|
| ProjSpwnPoint | Where the projectile starts at from the caster. |
|
| 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. Note: 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:
|
| ItemImmunity | Can the spell be added to an item, so that the user of the item is immune to the spell? | 1 for yes, 0 for no.
This should just be the availability to have "Immunity Spell:" on an item, not the fact items will be immune to this spell (Else, none of the crafting things would work!). Therefore, it is set to 1 for hostile spells which have Spell Resistance checks, and Epic Spells do not have it set to 1. Note: if a spell doesn't have a Spell Resistance check, immunity will not work. |
| 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 respecting 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. Also note that TALENT_DISPEL is not used, and isn't called in the Bioware AI script files, and the POTION values should not be directly put into here - I have no idea how it is decided if one potion is a healing, beneficial or otherwise potion. iprp_spells.2da doesn't help. Speculation: if it finds a potion with a spell relating to the "AOE" or "Single" versions of conditional, Healing or beneficial, it uses it in the potion category. Items must be similar - it is game engine workings, nothing can be changed. New categories might not work. | From category.2da(AoE = Area of Effect)
|
| 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 set do not work correctly, you need to have it set else when you rest, you may only cast the spells that reference the master spell. Therefore, Acid Fog (Line 0, with no master entry) cannot be directly added to Shades. This is why Bioware needed new Shades: Fireball entries, among other things. | Index of the master spell in this very 2da. It is a good idea to keep all spells which use the same Master spell next to each other. A subspell can only be on one sub-dial (although, I suppose, it could be used independantly of that sub-dial too). |
| 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. |
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:
|
| SpellDescTrue 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/patch feature, 1.59+). |
| 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, abilties, innate powers, feats, and basically any non-player spells. Also note that even if a spell is added as a Creature Ability in the Toolset, and this is 1, it requires concentration to cast. As noted in Spells, the duration of the conjuration time must be complete without the concentration being broken for the impact script to fire. With this set to 0, it only requires the time to complete - it doesn't cause Attacks of Oppotunity nor get stopped by damage. |
| SpontaneouslyCast | This is for the Cleric's spontaneous casting. Only Cure/Cause wounds should have this. Note that there is no way to define what class uses the spells, and it is NOT alignment-restricted to 3E rules - it only works for Clerics, and only should really be used for healing spells. | 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 (Patch 1.59+)
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.
It seems SignalEvent() called in the scripting engine has nothing to do with this 2da entry (although they are usually the same, of course). This is probably to cause the repadjust.2da values to change the internal reputations even if the NPC has no script attached to it (This may be why it happens anyway). Plot creatures would ignore this. It might have something to do with other game engine things - and should always be set to 1 for hostile spells. |
| FeatID | The ID of the feat this "spell" implements. There are a few feats that are activated like spells, and you can make your own. Actually I'm pretty sure this reference is of no use to the engine, it's 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 extraordinary!
If you are trying to create a subradial feat, the instructions for the FeatID to use in this field are here. |
| Counter1 | Reference to the first counterspell | Index of the counterspell in this 2da... line number... bogus
Jasperre: Is this really bogus...? ...Bioware uses it for both NwN, SoU and HotU spells for the counterspells (Haste and Slow for example). It points to another spells.2da line entry. Change this if any information comes up. |
| 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:
In all other conditions this field should be set to 0 to prevent the game from sending unneccessary packets to the clients. This information is by Georg, Here. |
[edit] Links
[edit] End of Page
2DA | Spells.2da
