Script:spellcast: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page describes the <code>spellcast</code> script command.
{{ScriptCommandPage
|description=cast [[Spellcasting|spells]] or cancel active spells
|context=any
|special=
-k spell
|flags=
k Abort the first instance of the given spell for this caster
d Specify a spell duration - otherwise the duration is <code>1 + <spelllevel> * 2</code> seconds
x No sound
m Not drawn, no checks
s No animation, no checks
f No mana cost, no checks
z Restore (used for [[Create_field|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 {{Changelog|1.2}})
|parameters=
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]]
target entity Spell target
|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.


Usage:
To add a spell to the player's list of prepared spells use the {{Command|precast}} command.
 
}}
spellcast -k <spell>
spellcast -d[xmsfz] <duration> <level> <spell> <target>
spellcast [-xmsfz] <level> <spell> <target>
 
The spell caster is always the current IO.


Flags:
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.
* <code>-k</code>: Abort the first instance of the given spell for this caster
* <code>-d</code>: Specify a spell duration - otherwise the duration is <code>1000 + <level> * 2000</code> ms
* <code>-x</code>: No sound
* <code>-m</code>: Not drawn, no checks
* <code>-s</code>: No animation, no checks
* <code>-f</code>: No mana cost, no checks
* <code>-z</code>: Restore


Parameters:
{{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.}}
{| class="wikitable sortable"
! Parameter
! Type
! Description
|-
| <code><duration></code>
| {{real}}
| Spell duration in milliseconds
|-
| <code><level></code>
| {{int}}<code> in [1,10]</code>
| Spellcaster level to cast the spell at
|-
| <code><spell></code>
| {{text}}
| Spell script name - see [[#Spell Names|table below]]
|-
| <code><target></code>
| <code>entity</code>
| Spell target
|}


== Spell Names ==
== Spell names ==


{{#ask:[[Category:Spells]]
{{#ask:[[Category:Spells]]
|?Spell level=Level
|?Spell level=Page
|?Script name=Script name
|?Script name=Script name
|format=table
|format=table
Line 55: Line 41:
}}
}}


[[Category:Script:Commands]]
[[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:

ParameterTypeDescription
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.

⚠️
Active spells are not stored in save files. Any spells that are meant to be persistent (e.g. Create field (Aam Rune (create)Kaom Rune (protection)Spacium Rune (field)) spells that should block the player) need to be re-cast on load in the game_ready event using the -z flag.

Spell names

SpellPageScript name
Teleport0
Mega cheat0
Activate portal1activate_portal
Magic missile1magic_missile
Night vision1magic_sight
Douse1douse
Ignite1ignit
Armor2armor
Harm2harm
Lower armor2lower_armor
Heal2heal
Detect trap2detect_trap
Fireball3fireball
Reveal3dispell_illusion
Ice projection3ice_projectile
Speed3speed
Feed3create_food
Telekinesis4telekinesis
Protection from cold4cold_protection
Bless4bless
Dispel field4dispell_field
Protection from fire4fire_protection
Curse4curse
Trap5rune_of_guarding
Cure effects of poison5cure_poison
Repel undead5repel_undead
Levitate5levitate
Poison projection5poison_projectile
Slow down6slowdown
Disable trap6disarm_trap
Create field6create_field
Raise dead6raise_dead
Paralyze6paralyse
Fire field7fire_field
Ice field7ice_field
Confuse7confuse
Lightning projection7lightning_strike
Flying eye7flying_eye
Mana drain8mana_drain
Enchant object8enchant_weapon
Chaos8explosion
Invisibility8invisibility
Life drain8life_drain
Summon9summon_creature
Mass paralyze9mass_paralyse
Incinerate9incinerate
Negate magic9negate_magic
Fake summon9fake_summon
Mass lightning projection10mass_lightning_strike
Mass incinerate10mass_incinerate
Slow time10freeze_time
Control demon10control