Manual:DIL Manual/cast spell()
Jump to navigation
Jump to search
cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr )
WILL EVENTUALLY BE OBSOLETE AND REPLACED BY THE CAST_SPELL BELOW.
i : Spell index to cast. See SPL_* in values.h and/or vme.h. caster : The caster of the spell. medium : The medium, with which the spell is cast, might be caster. target : The target of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities.
integer cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr, effect : string )
i : Spell index to cast. See SPL_* in values.h and/or vme.h.
caster : The caster of the spell.
medium : The medium, with which the spell is cast, might be caster.
target : The target of the spell.
effect : A symbolic DIL program which takes no arguments. This will
cause all effects to be suppressed and leave this to the program
specified. A string of "" will cause the ordinary messages to
appear.
returns: The result of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities. Please note that in the two programs below the variable 'hm' represents the number of hitpoints that will be deducted from the target.
Example:
%dil
dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer);
code
dilend
.....
%...
dilbegin test();
var
n : integer;
code
dilend
---~---~---~---~---~---~---~---~---
cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr )
WILL EVENTUALLY BE OBSOLETE AND REPLACED BY THE CAST_SPELL BELOW.
i : Spell index to cast. See SPL_* in values.h and/or vme.h. caster : The caster of the spell. medium : The medium, with which the spell is cast, might be caster. target : The target of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities.
integer cast_spell( i : integer, caster : unitptr, medium : unitptr, target : unitptr, effect : string )
i : Spell index to cast. See SPL_* in values.h and/or vme.h.
caster : The caster of the spell.
medium : The medium, with which the spell is cast, might be caster.
target : The target of the spell.
effect : A symbolic DIL program which takes no arguments. This will
cause all effects to be suppressed and leave this to the program
specified. A string of "" will cause the ordinary messages to
appear.
returns: The result of the spell.
Use this to cast spells without performing all the usual mana stuff, etc. Very useful with for example rings / items possessing magical abilities. Please note that in the two programs below the variable 'hm' represents the number of hitpoints that will be deducted from the target.
Example:
%dil
dilbegin myeffect(medi : unitptr, targ : unitptr, hm : integer);
code
dilend
.....
%...
dilbegin test();
var
n : integer;
code
dilend
---~---~---~---~---~---~---~---~---