• Tutorials

  • Home
  • Intermediate Tutorial: Adding a Spell

    This tutorial assumes that you already know the basics of adding a spell. If you do not, please see Basic Tutorial: Adding a Spell.

    In this tutorial, we will create a spell that uses Special Abilities to accomplish our goal of modifying one of the characters. For the example item, we'll create a "Flash Freeze" spell which inflicts damage on a target as well as stopping the target combatant from being able to move, cast spells or attack an opponent.

      Adding Flash Freeze

    1. Here's how I've set up the Flash Freeze spell. Important for this tutorial is the Special Abilities button.
    2. Adding a Special Ability

    3. Click "Add" to bring up the "Edit Attribute Value" dialog.
    4. Enter the name of the Special Ability, in this case "spell_FlashFreeze". The name can be anything that you like, but it is much easier to keep things straight if you use a naming scheme that is both informational and functional. Note, you need not create the Special Ability first - we will do that in upcoming steps. Do write down or remember the name you have written so that you can create the Special Ability - the spelling must be exact and is case and space sensitive.
    5. The parameter can be anything, and may actually be something which the Special Ability uses. For example, you may create a Special Ability that is used by several different objects, and you might list the object name as the parameter so that other Special Abilities will know which object called the Special Ability.
    6. Click "OK" until you are back to the main Spell Editor window and "OK" again. The rest of our work will be done in the Special Abilities Editor.
    7. This tutorial assumes that you know the basics of using the Special Ability Editor. If you do not, please see Basic Tutorial: Adding a Special Ability.

      Adding a Hook

    8. After adding the "spell_FlashFreeze" Special Ability, we need to some scripts to it. The damage part of this spell is covered in the Spell Editor, but we still have several things to do. Firts, we need a script that tells the players the status of the affected target. The Hook to use to accomplish this goal is CharCombatStatus. (See CharCombatStatus for a complete list of names.)
    9. The "Value" field requires something be entered before we can continue, and often the script is much longer than in the basic tutorial, However this is one script that can be entered right in the line.
      $RETURN "Frozen";
      	
    10. Hit "OK" and with the Hook highlighted, choose "Script" so that Dungeon Craft knows how to handle this.
    11. Adding a Hook

    12. We need to add a script that stops the target combatant from moving, casting spells, or attacking. There are individual Hooks that can handle each one of these, but there is also a Hook that covers all of these and decides whether a combatant can participate in combat - IsCombatReady. (See IsCombatReady for a complete list of names.)
    13. As with the CharCombatStatus script, this script can be completely entered into the "Value" field and there is no need to open the Script Editor up. The script should read:
      $RETURN "N";
      	
    14. Hit "OK" and with the Hook highlighted, choose "Script" so that Dungeon Craft knows how to handle this.
    15. Click "OK" to close the Special Ability Editor and save your work.

    With new database items, it is always a good idea to try them out while you are getting used to the ins and outs of Dungeon Craft and GPDL scripting.