Tutorial Home

Fate Facts

Artwork

Coding

Using Utilities

Casey’s Home Page

Mod Archive

Helpful Freeware

Links

Spell Modding Tutorial

Page Index

This tutorial is part of the “A Blank Mod” project which can be downloaded in it’s entirety here:

A Blank Mod zipfile

This tutorial contains a great deal of information, and is, therefore, spread over several pages. Please use the index below to navigate the tutorial. The current page will be in large red letters in the index.


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). attack
  • 2). defense
  • 3). charm

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). Any unique alpha-numeric string, includes spaces.

1.2.4: The <target_alignment> tag.

<TARGET_ALIGNMENT>:EVIL

This selector determines who is affected by the spell.

Possible values are:

  • 1). evil--all enemies; foreign and domestic.
  • 2). all -- Pretty much everyone; used for spells that don't damage or de-buff enemies.

1.2.5 The <target> tag.

<TARGET>:CHARACTER

This selector determines what or who is a valid target.

Possible values are:

  • 1). area -- Affects the area surrounding the targeted point; aka: an Area of Effect (aoe) spell.
  • 2). userarea -- Affects the around immediately surrounding the caster; aka: a Point Blank Area of Effect (pb-aoe) spell.
  • 3). character -- Affects the monster or object clicked on.
  • 4). projectile -- Has no actual target, just continues in a straight line untils it hits something, and that something then becomes the target. Used with the [payloadeffect] tag.
  • 5). user -- Targets the caster.
  • 6). userandpets -- Targets the caster and allies (pet and summons).
  • 7). item -- Targets an item (used for Identify).

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). Any positive number from 0 to infinity, inclusive (0 is a valid value for this selector), typically, in half second intervals: 0, 0.5, 1, 1.5 and so on. "Casting Speed" bonuses can reduce this value.

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). Any positive whole number.

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:

  • 1). The relative path to any pair of 48 pixel by 48 pixel Portable Networks Graphic (PNG) files you would like the game to display in the spellbook. A valid pair consists of the icon PNG itself and an "Alpha Transparency" PNG. They are listed in the order, separated by a colon; path/icon.png:path/icon-alpha.png, as shown above.

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:

  • 1). Any alpha-numeric string.

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). See comment line above

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). Any relative path to a supported sound file. So it is possible to make your own, but how is beyond the scope of this tutorial.

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). Any relative path to a valid particle file, typically PNG files. Again, possible to edit or make your own effects, but how is beyond the scope of this document.

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). Any positive whole number.

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.

To go on, click here: 1.0.a: The Effect Tags.