Spell Modding Tutorial

Written by: Hazmat
Edited by: El Heffe

1.0 Tag Explanations

1.1: Understanding the Spell Block.

1.1.1: The opening and closing tags:

The Spell block:

[spell][/spell]

The Effect stanzas:

[effect][/effect]

[payloadeffect][/payloadeffect]

1.1.2: The Tag structure:

1.2: Practical Example: breakdown of a spell.

Example: Lightning Strike

1.2.1: The [spell] tag.

[SPELL]

Opens the spell block.

1.2.1: The <sphere> tag.

<SPHERE>:ATTACK

This is the selector that defines which magic skill governs the use of the spell, and where it will appear in the player’s spellbook.

Possible values are:

1.2.3: The <name> tag.

<NAME>:Lightning Strike

This selector is simple. All there is to it is a little imagination.

Possible values are:

1.2.4: The <target_alignment> tag.

<TARGET_ALIGNMENT>:EVIL

This selector determines who is affected by the spell.

Possible values are:

1.2.5 The <target> tag.

<TARGET>:CHARACTER

This selector determines what or who is a valid target.

Possible values are:

1.2.6 The <cast_time> tag.

<CAST_TIME>:1

This selector defines the length of time it takes, in seconds, to cast this spell.

Possible Values are:

1.2.7: The <mana> tag.

<MANA>:20

This selector determines the amount of mana depletion when the spell is cast.

Possible values are:

1.2.8: The <icon> tag.

<ICON>:ICONS/spelllightning.png:ICONS/spelllightninga.png

This selector defines the path to the artwork files for the spell’s icon.

Possible values are:

More detail on icons and icon making can be found on these Tutorial Archive pages:

1.2.9: The <description> tag.

<DESCRIPTION>:Lightning strikes target for\n8-10 damage.\n+4 points
of max damage per Attack Skill level

This selector is where you enter what shows up when looking at the spell in the inventory or spellbook. Use \n as a hard carriage return when typing your description.

Possible values are:

The [effect] stanza

The "Effect" stanza will often be inserted here, but we will cover those tags separately.

The "Comment Line."

#sfx:type:duration:looping:speed:turnate:pathtoeffect:exclusive:respect bonuses

The pound sign "#" is used to add informational data to a spell block. It is ignored by the game, and therefore is only useful when working with the spells.dat file directly.

In this case, it explains the values and paths used to define the <SFX> (Special Effects) tags.

1.2.10: The <sfx> tag.

<SFX>:STATIONARYTARGET:.5:1:0:0:SPELLS/EFFECTS/FIREPUFF/bluepuff.mdl:0:0
<SFX>:STATIONARYTARGET:-1:0:0:0:SPELLS/EFFECTS/LIGHTNING/lightning.ams:0:0

This tag defines the "special effects" that happen when the spell is cast. As you can see, more than one effect can be used on a single spell. It can be very tricky to tinker with, so I recommend that you either use the default, or copy and paste a working <SFX> off of another item or spell, or just leave this line of code off altogether. if you leave it off, though, the spell will have no graphics.

*This line is sometimes optional.* On projectile spells this line is required.

Possible values are:

1.2.11: The <sound>: tag.

<SOUND>:SUCCESS:SOUNDS/SPELLS/lightning.wav
<SOUND>:FAIL:SOUNDS/SPELLS/fail.wav
<SOUND>:CHANT:SOUNDS/SPELLS/cast2.wav

This tag defines the path to the spell’s sound effects. You can mix and match sound code from other spells to get the sounds you like. As you can see above, most spells have 3 sound tags, one each for Success, Fail, and Chant.

Possible values are:

1.1.12: The <cast_particle> tag

<CAST_PARTICLE>:ELECTRIC0:0:0
<CAST_PARTICLE>:PURPLEFIRESPARK:0:0:0

This selector defines what kinds of particles trail from the casters hands while the spell is being cast. you can have more than one if you want. Its best to cut and paste this line from existing spells.

Possible values are:

1.1.13: The <requires>: tag.

<REQUIRES>:MAGIC:19

This tag tells the spell how high a Magic attribute score is required to use it. You can require other things besides magic if you want... Strength, Skills, whatever.

*This line is optional.*

Possible values are:

1.1.14: The [/spell] tag.

[/SPELL]

And finally, the tag that closes out the spell block. This completes our discussion of the general selector tags, and their respective values. Next page covers the the Effect stanzas in-depth.