Script:spellcast: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ScriptCommandPage | {{ScriptCommandPage | ||
|description=[[Spellcasting| | |description=cast [[Spellcasting|spells]] or cancel active spells | ||
|context=any | |context=any | ||
|special= | |special= | ||
Line 6: | Line 6: | ||
|flags= | |flags= | ||
k Abort the first instance of the given spell for this caster | k Abort the first instance of the given spell for this caster | ||
d Specify a spell duration - otherwise the duration is <code>1 + < | d Specify a spell duration - otherwise the duration is <code>1 + <spelllevel> * 2</code> seconds | ||
x No sound | x No sound | ||
m Not drawn, no checks | m Not drawn, no checks | ||
Line 15: | Line 15: | ||
|parameters= | |parameters= | ||
d?duration int* Spell duration in milliseconds | d?duration int* Spell duration in milliseconds | ||
spelllevel int*[1,10] Spellcaster level to cast the spell at | |||
spell string [[Script:spellcast#Spell names|Spell script name]] | spell string [[Script:spellcast#Spell names|Spell script name]] | ||
target entity Spell target | target entity Spell target | ||
|intro=The spell caster is always the entity executing the command. To | |intro=The spell caster is always the entity executing the command. To draw individual runes without actually casting a spell use the {{Command|drawsymbol}} command. | ||
To add a spell to the player's list of prepared spells use the {{Command|precast}} command. | |||
}} | }} | ||
The ID of the cast spell can be retrieved using the <code>^spell</code> [[Script:Variables#Systemvariables|system variable]] which allows the spell to be ended using the {{Command|destroy}} command. | The ID of the cast spell can be retrieved using the <code>^spell</code> [[Script:Variables#Systemvariables|system variable]] which allows the spell to be ended using the {{Command|destroy}} command. | ||
{{Warning|Active spells are '''not''' stored in save files. Any spells that are meant to be persistent (e.g. {{Spell|Create field}} spells that should block the player) need to be re-cast on load in the {{Event|game_ready}} event using the <code>-z</code> flag.}} | |||
== Spell names == | == Spell names == | ||
{{#ask:[[Category:Spells]] | {{#ask:[[Category:Spells]] | ||
|?Spell level= | |?Spell level=Page | ||
|?Script name=Script name | |?Script name=Script name | ||
|format=table | |format=table | ||
Line 36: | Line 40: | ||
|class=sortable wikitable smwtable center_1 code_2 | |class=sortable wikitable smwtable center_1 code_2 | ||
}} | }} | ||
[[Category:Script commands creating entities]] |
Latest revision as of 09:23, 24 July 2022
The spellcast
script command is used to cast spells or cancel active spells for an entity. The spell caster is always the entity executing the command. To draw individual runes without actually casting a spell use the drawsymbol
command.
To add a spell to the player's list of prepared spells use the precast
command.
Usage
spellcast [-dxmsfzo] [d?duration*] <spelllevel*> <spell> <target>
spellcast -k <spell>
Context: Any Entity
Flags:
-k
: Abort the first instance of the given spell for this caster
-d
: Specify a spell duration - otherwise the duration is 1 + <spelllevel> * 2
seconds
-x
: No sound
-m
: Not drawn, no checks
-s
: No animation, no checks
-f
: No mana cost, no checks
-z
: Restore (used for fields in the game world, making sure they appear already casted upon game load)
-o
: Orphan the spell after casting so that will not be affected by changes to the caster (Added in Arx Libertatis 1.2)
Parameters:
Parameter | Type | Description |
---|---|---|
duration (requires -d ) |
int or variable |
Spell duration in milliseconds |
spelllevel |
int or variable [1,10] |
Spellcaster level to cast the spell at |
spell |
string |
Spell script name |
target |
entity |
Spell target |
The ID of the cast spell can be retrieved using the ^spell
system variable which allows the spell to be ended using the destroy
command.
game_ready
event using the -z
flag.Spell names
Spell | Page | Script name |
---|---|---|
Teleport | 0 | |
Mega cheat | 0 | |
Activate portal | 1 | activate_portal |
Magic missile | 1 | magic_missile |
Night vision | 1 | magic_sight |
Douse | 1 | douse |
Ignite | 1 | ignit |
Armor | 2 | armor |
Harm | 2 | harm |
Lower armor | 2 | lower_armor |
Heal | 2 | heal |
Detect trap | 2 | detect_trap |
Fireball | 3 | fireball |
Reveal | 3 | dispell_illusion |
Ice projection | 3 | ice_projectile |
Speed | 3 | speed |
Feed | 3 | create_food |
Telekinesis | 4 | telekinesis |
Protection from cold | 4 | cold_protection |
Bless | 4 | bless |
Dispel field | 4 | dispell_field |
Protection from fire | 4 | fire_protection |
Curse | 4 | curse |
Trap | 5 | rune_of_guarding |
Cure effects of poison | 5 | cure_poison |
Repel undead | 5 | repel_undead |
Levitate | 5 | levitate |
Poison projection | 5 | poison_projectile |
Slow down | 6 | slowdown |
Disable trap | 6 | disarm_trap |
Create field | 6 | create_field |
Raise dead | 6 | raise_dead |
Paralyze | 6 | paralyse |
Fire field | 7 | fire_field |
Ice field | 7 | ice_field |
Confuse | 7 | confuse |
Lightning projection | 7 | lightning_strike |
Flying eye | 7 | flying_eye |
Mana drain | 8 | mana_drain |
Enchant object | 8 | enchant_weapon |
Chaos | 8 | explosion |
Invisibility | 8 | invisibility |
Life drain | 8 | life_drain |
Summon | 9 | summon_creature |
Mass paralyze | 9 | mass_paralyse |
Incinerate | 9 | incinerate |
Negate magic | 9 | negate_magic |
Fake summon | 9 | fake_summon |
Mass lightning projection | 10 | mass_lightning_strike |
Mass incinerate | 10 | mass_incinerate |
Slow time | 10 | freeze_time |
Control demon | 10 | control |