Difference between revisions of "SPELL"

From SphereWiki
Jump to: navigation, search
m (Added languagemenue)
(Triggers)
 
(4 intermediate revisions by 3 users not shown)
Line 56: Line 56:
  
 
{| border="1" cellspacing="4" cellpadding="4"
 
{| border="1" cellspacing="4" cellpadding="4"
| '''Name''' || '''Description'''
+
| '''Name''' || '''Description''' || '''Sphere X only? '''
 
|-
 
|-
 
| [[@Effect]] || Fires when a character or item is hit by the spell.
 
| [[@Effect]] || Fires when a character or item is hit by the spell.
 +
|-
 +
| [[@EffectAdd]] || Fires when a spell memory item is being added.
 +
|-
 +
| [[@EffectRemove]] || Fires when a spell memory item is removed. || X
 +
|-
 +
| [[@EffectTick]] || Fires when a character is under effect of a periodic spell (like Poison spell). || X
 
|-
 
|-
 
| [[@Fail (Spell Trigger)|@Fail]] || Fires when a character fails to cast the spell.
 
| [[@Fail (Spell Trigger)|@Fail]] || Fires when a character fails to cast the spell.
Line 67: Line 73:
 
|-
 
|-
 
| [[@Success (Spell Trigger)|@Success]] || Fires when a character successfully casts the spell.
 
| [[@Success (Spell Trigger)|@Success]] || Fires when a character successfully casts the spell.
 +
|-
 +
| [[@TargetCancel]] || Fires when a character cancels target selection for a spell they are casting.
 
|}
 
|}
 
  
 
==Examples==
 
==Examples==

Latest revision as of 22:00, 4 January 2023

Help
Available languages


A spell block defines the basic properties and behaviours of a spell.


Properties

The following properties are available when defining a spell:

Name Read/Write Description
CAST_TIME RW Gets or sets the length of time it takes to cast the spell, in tenths of a second. Accepts multiple values to adjust based on skill level.
DEFNAME RW Gets or sets the spell's defname.
DURATION RW Gets or sets the duration of the spell's affect in tenths of a second, if applicable. Accepts multiple values to adjust based on skill level.
EFFECT RW Gets or sets the strength of the spell. Accepts multiple values to adjust based on skill level.
EFFECT_ID RW Gets or sets the ID of the spell's visual effect.
FLAGS RW Gets or sets the spell's attribute flags.
GROUP RW Gets or sets the spell's group flags.
INTERRUPT RW Gets or sets the chance of a character being interrupted when hit in combat while casting the spell. Accepts multiple values to adjust based on skill level.
MANAUSE Rw Gets or sets the number of mana points needed to cast the spell.
NAME RW Gets or sets the name of the spell.
PROMPT_MSG RW Gets or sets the message shown when a character casts the spell, and also forces characters to select a target when non-empty.
RESOURCES RW Gets or sets the resources that are needed to cast the spell.
RESOURCES.n.KEY R Gets the BASEID of the nth resource needed to cast the spell. (zero-based)
RESOURCES.n.VAL R Gets the amount of the nth resource needed to cast the spell. (zero-based)
RUNE_ITEM RW Gets or sets the BASEID of the item that should be equipped when a spell has a duration.
RUNES RW Gets or sets the spell's words of power.
SCROLL_ITEM RW Gets or sets the BASEID of the scroll that casts the spell.
SKILLREQ RW Gets or sets a list of skills that are needed to cast the spell.
SOUND RW Gets or sets the ID of the sound that will be played when the spell is cast.


Triggers

The following table lists all of the triggers that can be placed under a spell definition. All of the triggers here have an equivalent @Spell trigger on the character object.

Name Description Sphere X only?
@Effect Fires when a character or item is hit by the spell.
@EffectAdd Fires when a spell memory item is being added.
@EffectRemove Fires when a spell memory item is removed. X
@EffectTick Fires when a character is under effect of a periodic spell (like Poison spell). X
@Fail Fires when a character fails to cast the spell.
@Select Fires when a character selects to cast the spell, or when Sphere checks if a character is capable of casting it.
@Start Fires when a character starts to cast the spell.
@Success Fires when a character successfully casts the spell.
@TargetCancel Fires when a character cancels target selection for a spell they are casting.

Examples

//
// Clumsy spell from the default script pack.
//
[SPELL 1]
DEFNAME=s_clumsy
NAME=Clumsy
SOUND=snd_SPELL_CLUMSY
RUNES=UJ
CAST_TIME=1.0
RESOURCES=i_reag_blood_moss,i_reag_nightshade
RUNE_ITEM=i_rune_CLUMSY
SCROLL_ITEM=i_scroll_CLUMSY
FLAGS=SPELLFLAG_TARG_CHAR | SPELLFLAG_DIR_ANIM | SPELLFLAG_HARM | SPELLFLAG_FX_TARG | SPELLFLAG_RESIST
EFFECT_ID=i_fx_curse
EFFECT=3,15
DURATION=2*60.0,3*60.0
MANAUSE=4
SKILLREQ=MAGERY 10.0
INTERRUPT=100.0,100.0