Spell Creation Quick Start Guide

Get started creating your first spell in OpenRoads in just 5 minutes!

๐Ÿš€ Quick Start

Step 1: Create Your Spell File

Create a new file in the spells/custom/ directory:

# Example: Create a simple damage spell
touch spells/custom/magic_missile.yaml

Step 2: Define Your Spell

Add this basic spell definition:

name: "Magic Missile"
description: "Launches a magical projectile at target enemy"
element_required: ""
min_spell_level: 5
sp_cost: 8
cooldown: 2
target_type: "enemy"
effects:
  - type: "damage"
    damage_min: 12
    damage_max: 18
    damage_type: "magic"
messages:
  success: "Your magic missile strikes %s!"
  failure_level: "You need spell level %d or higher. (Current: %d)"
  failure_sp: "Not enough spell points. (Need: %d, Have: %d)"
  failure_target: "You must specify a target enemy."

Step 3: Test Your Spell

  1. Start the OpenRoads server

  2. Connect to the game

  3. Use spells command to see your new spell

  4. Cast it with: cast magic_missile <enemy_name>

๐ŸŽฏ Common Spell Types

Damage Spell

Healing Spell

Teleport Spell

Summoning Spell

๐Ÿ“‹ Essential Properties

Required Properties

  • name: Display name

  • description: What the spell does

  • sp_cost: Spell point cost

  • target_type: Who/what the spell targets

  • effects: What the spell does

Common Optional Properties

  • element_required: Element restriction

  • min_spell_level: Level requirement

  • cast_time: Casting delay in seconds

  • cooldown: Cooldown in seconds

  • required_items: Items needed to cast

  • messages: Custom messages

  • restrictions: When/where it can be cast

๐ŸŽฎ Target Types

  • "self" - Targets the caster

  • "enemy" - Requires an enemy target

  • "player" - Requires a player target

  • "room" - Requires a room ID

  • "none" - No target required

โšก Effect Types

  • "damage" - Deal damage to target

  • "heal" - Restore health

  • "teleport" - Move player to location

  • "summon_creature" - Summon a creature

  • "stat_mod" - Modify player stats

๐Ÿ’ฌ Message Placeholders

Use these in your messages:

  • %s - String values (target names, items)

  • %d - Numbers (levels, spell points)

Example:

๐Ÿ”ง Testing Tips

  1. Start Simple: Begin with basic damage or heal spells

  2. Test Thoroughly: Try different character levels and elements

  3. Check Balance: Make sure damage/cost ratios are fair

  4. Use Examples: Look at existing spells in spells/custom/

  5. Read Errors: The server logs will show YAML parsing errors

๐Ÿ“š Next Steps

Once you've created your first spell:

  1. Read the YAML Spell Tutorial for detailed explanations

  2. Check the Spell Effects Reference for all available effects

  3. Review Custom Spells Directoryarrow-up-right for more examples

  4. Study existing spells in the spells/custom/ directory

๐Ÿšจ Common Mistakes

  • Missing quotes: Always quote string values

  • Wrong indentation: YAML is sensitive to spaces

  • Invalid target_type: Must be one of the valid types

  • Missing required fields: name, sp_cost, target_type, effects are required

  • Typos in effect types: Check spelling of "damage", "heal", etc.

๐ŸŽ‰ Congratulations!

You've created your first spell! The spell system is very flexible - you can create simple spells like the examples above, or complex multi-effect spells with cast times, cooldowns, and restrictions.

Happy spell crafting! โœจ

Last updated

Was this helpful?