I've seen several spells come my way while on the forums, and they're all pretty cool! But I myself didn't know how to create spells with different effects until just recently. So I decided to create a Tut for easy to create and use spells! I'll have some of my own, one of Venima's (with full credit given to him), and components for new spells!
The first spell is a simple light that comes from your right hand (Yes, I know there are already two of these type of spells, however, this spell is specifically like a flashlight

Code: Select all
spawn_flashlight = [
r_type $ENT_ITEM
r_icon flashlight
r_description "A flashlight for searching with."
r_item_slots $SLOT_RHAND
r_addowneffect $STATUS_LIGHT 35 1000000000
r_interact [
r_select $rpginteract
r_pickup $rpgself
]
]
Code: Select all
spawn_flashlight = [
Code: Select all
r_type $ENT_ITEM
Code: Select all
r_icon flashlight
Code: Select all
r_description "A flashlight for searching with."
Code: Select all
r_item_slots $SLOT_RHAND

Code: Select all
r_addowneffect $STATUS_LIGHT 35 1000000000

Code: Select all
r_interact [
r_select $rpginteract
r_pickup $rpgself
]
]
One last bit of info. Every time you add a new item/spell, make sure you add:
Code: Select all
r_additem yourspellnamehere
Code: Select all
spawn_player = [
r_additem item
r_additem item2
r_additem spell
r_additem spell2
r_additem frost
r_additem magicarrow
r_additem light
r_additem eth_vis1
r_additem minehelm
Code: Select all
spawn_player = [
r_additem item
r_additem item2
r_additem spell
r_additem spell2
r_additem frost
r_additem magicarrow
r_additem light
r_additem eth_vis1
r_additem minehelm
r_additem flashlight
Code: Select all
spawn_flashlight = [

This is Venima's so all the right's go to him!
Code: Select all
spawn_dust = [
r_type $ENT_SPELL
r_icon losehealth
r_description "sprays flames"
r_name "Flame Spray"
r_spell_type $STYPE_CONE
r_spell_gravity 60
r_spell_cost 5
r_spell_range 8
r_spell_effect 5
r_addeffect $STATUS_HEALTH -10 1
r_interact [
r_select $rpginteract
r_pickup $rpgself
]
]
Code: Select all
r_type $ENT_SPELL
The icon, is:
Code: Select all
r_icon losehealth
Code: Select all
r_description "sprays flames"
r_name "Flame Spray"
The next part is important, so I'll explain as best as possible:
Code: Select all
r_spell_type $STYPE_CONE
r_spell_gravity 60
r_spell_cost 5
r_spell_range 8
r_spell_effect 5
r_addeffect $STATUS_HEALTH -10 1
The r_spell_gravity is easily explained. This will be how much gravity will affect the attack.
The r_spell_cost is 5. 5 mana. Mana is regenerated so don't worry about running out!
The next part is important: the r_spell_range. You can have a long range, or a short range. It's up to you. However, the range is also affected by the gravity, so make sure these work together. The r_spell_effect I have yet to understand but as far as I know it is alright to leave out. Check out the fireball spell under data/game_rpg.cfg to learn more.
The addeffect:
Code: Select all
r_addeffect $STATUS_HEALTH -10 1
And just like with the flashlight, you must place the r_additem at the end of your "spawn_player":
Code: Select all
spawn_player = [
r_additem item
r_additem item2
r_additem spell
r_additem spell2
r_additem frost
r_additem magicarrow
r_additem light
r_additem eth_vis1
r_additem minehelm
r_additem flashlight
r_additem dust
Arc
