Spell Filtering

Using DSAs it is possible to intercept and modify all spells that are cast.

Step 1:  Specify a location in the dungeon that will receive a message whenever a spell is cast.  This is done using CSBuild's Edit/Global menu selection.  On the Edit Global Information dialog there is an "Important Locations" drop-down box and associated edit boxes that specify a level, x, and y locations in the dungeon.  In the drop-down box select "Spell Filter Location" and in the edit boxes provide the location to receive the message.

Step 2:  Put a DSA at the location specified in Step 1.  Whenever a spell is cast, a 'Set 0' message will be sent to that location.  You could put a door or pit there if you so choose but it seems likely you will want to do something more complicated than opening a pit.  A DSA is probably the best thing to put there.

Step 3:  Design a DSA that will do what you want done.  Some examples:
The DSA has access to all of the parameters that the runtime engine uses to create the spell effects.  The parameters can be obtained by using the &PARAM@ command to put the parameters into the Temporary Variable array.  The parameters can be modified and then sent back to the spell-casting code using the &PARAM! command.  This is the mechanism for modifying (Filtering) the spell's effect.  Here are the parameters:
Action:  This is the action to be taken when the DSA exits.  It is initially set to zero.  The possible actions are
Incantation:  The incantation is specified by a 4-digit decimal number.  The four digits are the four runes that are selected in the casting.  If fewer than four are used then the unused ones are zero.  A ZO-Spell might be 1600 or 2600 or  3600 or 4600 or 5600 or 6600 depending on the 'power'.  A fireball could be 1440 or 2440 or 3440 or 4440 or 5440 or 6440 depending on the 'power'.  That should be enough examples to get the idea across.  A spell of 1700 would be nonsense because there is no seventh rune.

Character Index:  The index ( 0, 1, 2, or 3) of the character casting the spell.  From left to right in the portrait area.

back to index