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.yamlStep 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
Start the OpenRoads server
Connect to the game
Use
spellscommand to see your new spellCast it with:
cast magic_missile <enemy_name>
๐ฏ Common Spell Types
Damage Spell
name: "Fireball"
description: "Hurls a ball of fire"
element_required: "fire"
min_spell_level: 10
sp_cost: 15
target_type: "enemy"
effects:
- type: "damage"
damage_min: 20
damage_max: 35
damage_type: "fire"Healing Spell
name: "Heal"
description: "Restores health"
min_spell_level: 5
sp_cost: 10
cast_time: 2
target_type: "self"
effects:
- type: "heal"
heal_min: 15
heal_max: 25
restrictions:
non_combat_only: trueTeleport Spell
name: "Recall"
description: "Return to your element room"
min_spell_level: 3
sp_cost: 20
cast_time: 5
target_type: "self"
effects:
- type: "teleport"
teleport:
element_room: true
restrictions:
non_combat_only: trueSummoning Spell
name: "Summon Wolf"
description: "Summons a wolf companion"
element_required: "earth"
min_spell_level: 18
sp_cost: 30
cast_time: 4
target_type: "room"
effects:
- type: "summon_creature"
creature: "wolf"
max_instances: 1๐ Essential Properties
Required Properties
name: Display namedescription: What the spell doessp_cost: Spell point costtarget_type: Who/what the spell targetseffects: What the spell does
Common Optional Properties
element_required: Element restrictionmin_spell_level: Level requirementcast_time: Casting delay in secondscooldown: Cooldown in secondsrequired_items: Items needed to castmessages: Custom messagesrestrictions: 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:
messages:
success: "Your %s spell hits %s for %d damage!"
failure_level: "Need level %d (you're %d)"๐ง Testing Tips
Start Simple: Begin with basic damage or heal spells
Test Thoroughly: Try different character levels and elements
Check Balance: Make sure damage/cost ratios are fair
Use Examples: Look at existing spells in
spells/custom/Read Errors: The server logs will show YAML parsing errors
๐ Next Steps
Once you've created your first spell:
Read the YAML Spell Tutorial for detailed explanations
Check the Spell Effects Reference for all available effects
Review Custom Spells Directory for more examples
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?