[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/effects/magic/magic_spell.c</h2>
This is the basic inheritable for spells.  It is written as an effect
so that it is more exciting than before.  This effect
has a classification of "magic.spell.".
<p>
This effect has a shadow associated with it.<p><b>See also:</b><br>help::effects.c<p>Written by Pinkfish<h2>Includes</h2>
This class includes the following files <a href="include.magic.h.shtml">/include/magic.h</a>, <a href="include.playtesters.h.shtml">/include/playtesters.h</a>, <a href="include.tasks.h.shtml">/include/tasks.h</a>, <a href="include.player.h.shtml">/include/player.h</a>, <a href="include.move_failures.h.shtml">/include/move_failures.h</a>, <a href="include.effect.h.shtml">/include/effect.h</a>, /std/effects/magic/path.h, <a href="include.nroff.h.shtml">/include/nroff.h</a> and <a href="include.obj_parser.h.shtml">/include/obj_parser.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#cast_spell">cast_spell</a>(string, int, object)<br/>
This method casts the actual spell.
<li><a href="#cast_spell_new">cast_spell_new</a>(string, int, object *, object *)<li><a href="#check_components">check_components</a>(class spell_argument)<br/>
This method checks to see if the player has all the needed
components to cast the spell.
<li><a href="#check_disabilities">check_disabilities</a>(string, object)<br/>
This method checks disabilities of the player.
<li><a href="#check_octogram">check_octogram</a>(object, int, class spell_argument)<br/>
This method checks to see if an octogram exists.
<li><a href="#consume_components">consume_components</a>(string *, object, object *, class spell_argument)<br/>
This method will use up the components at the end of each spell stage.
<li><a href="#create_lost_spell">create_lost_spell</a>(object)<br/>
This method creates a lost spell that shows up when you try to memorise
something from a page and the spell escapes.
<li><a href="#destroy_consumable_stuff">destroy_consumable_stuff</a>(class spell_argument, object)<br/>
This method destroys the consumables and destroys the container
they are in.
<li><a href="#event_npc_cast_spell">event_npc_cast_spell</a>(object, object, object *, class spell_argument, int)<br/>
This event is called on all the objects in a room when a wizards starts
to cast a spell.
<li><a href="#expand_spell_message">expand_spell_message</a>(string, object, object *, int)<br/>
This method does the expansion of the spell messages as used by the
spell processing code.
<li><a href="#help">help</a>()<br/>
This method returns the help for the spell as a string.
<li><a href="#help_function">help_function</a>()<br/>
This method creates a function to view the help if the nroff
file is set.
<li><a href="#pre_process_command_line">pre_process_command_line</a>(string)<br/>
This method pre-checks a command line to see if it fits into the
currently allowed patterns for the spell.
<li><a href="#pre_process_target_objects">pre_process_target_objects</a>(object *)<br/>
This method pre-checks the target objects to make sure they are
all correct.
<li><a href="#query_casting_time">query_casting_time</a>()<br/>
This method returns the current default casting time of the spell.
<li><a href="#query_consumables">query_consumables</a>()<br/>
This method queries the shorts of all the things that will need to
be consumed to cast the spell.
<li><a href="#query_critical_stages">query_critical_stages</a>()<br/>
This method returns the array of critical stages.
<li><a href="#query_directed">query_directed</a>()<br/>
This method queries the directed flag of the spell.
<li><a href="#query_dynamic_difficulty">query_dynamic_difficulty</a>(object, object *, string)<br/>
This method returns the dynamic difficulty factor of the spell.
<li><a href="#query_fixed_time">query_fixed_time</a>()<br/>
This method returns the fixed time variable of the spell object.
<li><a href="#query_learn_lvl">query_learn_lvl</a>()<br/>
This method queries the level at which the learner needs to be to learn
the spell.
<li><a href="#query_magic_spell">query_magic_spell</a>()<br/>
This method will always return 1 for magic spells.
<li><a href="#query_max_casting_time">query_max_casting_time</a>()<br/>
This method returns the current default maximum casting time of the spell.
<li><a href="#query_name">query_name</a>()<br/>
This method returns the name of the spell.
<li><a href="#query_needed">query_needed</a>()<br/>
This method queries all the items needed to cast the spell (that are
not consumed).
<li><a href="#query_nroff_file">query_nroff_file</a>()<br/>
This method returns the nroff file name.
<li><a href="#query_octogram_needed">query_octogram_needed</a>()<br/>
This method queries if an octogram is needed to cast the spell.
<li><a href="#query_pivot_casting_bonus">query_pivot_casting_bonus</a>()<br/>
This method returns the bonus at which the casting time will be
unmodified.
<li><a href="#query_point_cost">query_point_cost</a>()<br/>
This method queries the point cost of the spell.
<li><a href="#query_power_level">query_power_level</a>()<br/>
This queries the power level of the spell.
<li><a href="#query_prevents_movement">query_prevents_movement</a>()<br/>
Queries the prevent_movement flag, which disallows movement from the caster's
part while the spell is cast.
<li><a href="#query_ritual">query_ritual</a>()<br/>
This method returns the currently set ritual for the spell.
<li><a href="#query_skill_used">query_skill_used</a>()<br/>
This method queries the skill used to cast the spell.
<li><a href="#query_spell_type">query_spell_type</a>()<br/>
This method sets the type of spell.
<li><a href="#query_teach_lvl">query_teach_lvl</a>()<br/>
This method queries the level at which the teacher needs to be to teach
the spell to someone else.
<li><a href="#query_tm_rate">query_tm_rate</a>()<br/>
This method returns the tm rate of the spell, i.
<li><a href="#safe_to_consume">safe_to_consume</a>(object)<br/>
This function checks whether an item is safe to consume, ie whether or
not it is a quest item or otherwise irreplaceable.
<li><a href="#scale_by_race">scale_by_race</a>(int, object)<br/>
This method scales the weight by the race.
<li><a href="#set_casting_time">set_casting_time</a>(int)<br/>
This method sets the casting time of the spell.
<li><a href="#set_consumables">set_consumables</a>(string *)<br/>
This method sets the shorts of all the things that will need to
be consumed to cast the spell.
<li><a href="#set_critical_stages">set_critical_stages</a>(int *)<br/>
This method sets the critical stages for the spell.
<li><a href="#set_directed">set_directed</a>(int)<br/>
This method sets the directed flag of the spell.
<li><a href="#set_fixed_time">set_fixed_time</a>(int)<br/>
This method sets the fixed time variable of the spell object.
<li><a href="#set_fixed_tm">set_fixed_tm</a>(int)<br/>
This method sets the spell to use TM_FIXED rather than TM_SPELL.
<li><a href="#set_learn_lvl">set_learn_lvl</a>(int)<br/>
This method sets the level at which the learner needs to be to learn the
spell.
<li><a href="#set_max_casting_time">set_max_casting_time</a>(int)<br/>
This method sets the maximum casting time of the spell.
<li><a href="#set_name">set_name</a>(string)<br/>
This method sets the name of the spell.
<li><a href="#set_needed">set_needed</a>(string *)<br/>
This method sets all the items needed to cast the spell (that are
not consumed).
<li><a href="#set_nroff_file">set_nroff_file</a>(string)<br/>
This method sets the nroff file name to use for the
help of the spell.
<li><a href="#set_octogram_needed">set_octogram_needed</a>(int)<br/>
This method sets if an octogram is needed to cast the spell.
<li><a href="#set_pivot_casting_bonus">set_pivot_casting_bonus</a>(int)<br/>
This method sets the bonus at which the casting time will be exactly
the set casting time.
<li><a href="#set_point_cost">set_point_cost</a>(int)<br/>
This method sets the point cost of the spell.
<li><a href="#set_power_level">set_power_level</a>(int)<br/>
This sets the power level of the spell.
<li><a href="#set_prevents_movement">set_prevents_movement</a>(int)<br/>
This sets the prevent_movement flag.
<li><a href="#set_ritual">set_ritual</a>(mixed *)<br/>
This method sets the ritual for the spell.
<li><a href="#set_skill_used">set_skill_used</a>(string)<br/>
This method sets the skill used to cast the spell.
<li><a href="#set_spell_type">set_spell_type</a>(string)<br/>
This method sets the type of spell.
<li><a href="#set_teach_lvl">set_teach_lvl</a>(int)<br/>
This method sets the level at which the teacher needs to be to teach
the spell to someone else.
<li><a href="#spell_aborted">spell_aborted</a>(object, object *, int, int)<br/>
This method is called when the spell is aborted.
<li><a href="#spell_failed">spell_failed</a>(object, object *, int)<br/>
This is called if the spell runs to completion and the spell then
fails to go off correctly.
<li><a href="#spell_stage">spell_stage</a>(object, class spell_argument, int)<br/>
This method does all the process for the specified spell stage.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="cast_spell">
cast_spell</a><pre>
int cast_spell(string words,
               int scroll,
               object staff)
</pre></br>
This method casts the actual spell.  It does all the checking for
things like targets and compents, runs the ritual and then
launches the effect.
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the command line arguments to the spell
<br/>scroll - this flag is 1 if it is cast from a scroll
<br/>staff - the staff we are storing a spell in if storing

</dl>

<ul><a name="cast_spell_new">
cast_spell_new</a><pre>
int cast_spell_new(string args,
                   int scroll,
                   object * targets,
                   object * using)
</pre>
<ul><a name="check_components">
check_components</a><pre>
int check_components(class spell_argument fluff)
</pre></br>
This method checks to see if the player has all the needed
components to cast the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>returns a non-zero value if the compents are there

</dl>

<ul><a name="check_disabilities">
check_disabilities</a><pre>
int check_disabilities(string word,
                       object person)
</pre></br>
This method checks disabilities of the player.  It will check the
skills which the caster uses and determine if those disabilities have
been associated with them.  ie: things which use chanting cannot be
cast if you are silenced etc.
<br/><ul>
<li><b>Parameters:</b>
<br/>word - the skill to check
<br/>person - the player casting the spell
<li><b>Returns:</b>
<br/>1 if disabled and 0 if ok

</dl>

<ul><a name="check_octogram">
check_octogram</a><pre>
int check_octogram(object thing,
                   int remove,
                   class spell_argument args)
</pre></br>
This method checks to see if an octogram exists.  This will check
to see if the needed octograms exist.


<ul><a name="consume_components">
consume_components</a><pre>
int consume_components(string * words,
                       object person,
                       object * targets,
                       class spell_argument fluff)
</pre></br>
This method will use up the components at the end of each spell stage.
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the components to consume
<br/>person - the person casting the spell
<br/>targets - the targets of the spell
<br/>args - the spell effect args
<li><b>Returns:</b>
<br/>0 for failure to find components, 1 for success

</dl>

<ul><a name="create_lost_spell">
create_lost_spell</a><pre>
object create_lost_spell(object room)
</pre></br>
This method creates a lost spell that shows up when you try to memorise
something from a page and the spell escapes.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#set_power_level">set_power_level()
</a></dl>

<ul><a name="destroy_consumable_stuff">
destroy_consumable_stuff</a><pre>
void destroy_consumable_stuff(class spell_argument fluff,
                              object give_back_to)
</pre></br>
This method destroys the consumables and destroys the container
they are in.


<ul><a name="event_npc_cast_spell">
event_npc_cast_spell</a><pre>
void event_npc_cast_spell(object spell,
                          object caster,
                          object * targets,
                          class spell_argument args,
                          int stage)
</pre></br>
This event is called on all the objects in a room when a wizards starts
to cast a spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>spell - the spell doing the casting
<br/>caster - the caster of the spell
<br/>targets - the targets of the spell
<br/>args - the spell arguments
<br/>stage - the start number, 0 for start

</dl>

<ul><a name="expand_spell_message">
expand_spell_message</a><pre>
string expand_spell_message(string message,
                            object thing,
                            object * things,
                            int to_whom)
</pre></br>
This method does the expansion of the spell messages as used by the
spell processing code.  This is applied to all the messages in the
ritual.  NB: if the message is of the form "#function_name" then
function_name( thing, things, to_whom ) will be called and its return
value used for the message.

<br/><ul>
<li><b>Parameters:</b>
<br/>message - the message to expand
<br/>thing - the caster
<br/>things - the targets
<br/>to_whom - -2 for caster, -1 for room, 0, 1, ... for targets
<li><b>Returns:</b>
<br/>the expanded string

</dl>

<ul><a name="help">
help</a><pre>
string help()
</pre></br>
This method returns the help for the spell as a string.
This will evaluate the nroff file if nessessary, or return the
(obsolete) info if needed.
<br/><ul>
<li><b>Returns:</b>
<br/>the help as a string
<li><b>See also:</b>
<br/><a href="#help_function">help_function()</a>, <a href="#set_nroff_file">set_nroff_file()</a> and <a href="#query_nroff_file">query_nroff_file()
</a></dl>

<ul><a name="help_function">
help_function</a><pre>
function help_function()
</pre></br>
This method creates a function to view the help if the nroff
file is set.
<br/><ul>
<li><b>Returns:</b>
<br/>the help viewing function
<li><b>See also:</b>
<br/><a href="#help">help()</a>, <a href="#query_nroff_file">query_nroff_file()</a> and <a href="#set_nroff_file">set_nroff_file()
</a></dl>

<ul><a name="pre_process_command_line">
pre_process_command_line</a><pre>
int pre_process_command_line(string str)
</pre></br>
This method pre-checks a command line to see if it fits into the
currently allowed patterns for the spell.  You need to set the
failed messages for why the spell failed if this returns 0.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the command line
<li><b>Returns:</b>
<br/>1 on success, 0 on failure

</dl>

<ul><a name="pre_process_target_objects">
pre_process_target_objects</a><pre>
int pre_process_target_objects(object * obs)
</pre></br>
This method pre-checks the target objects to make sure they are
all correct.
<br/><ul>
<li><b>Parameters:</b>
<br/>obs - the target objects
<li><b>Returns:</b>
<br/>1 on success, 0 on failure

</dl>

<ul><a name="query_casting_time">
query_casting_time</a><pre>
int query_casting_time()
</pre></br>
This method returns the current default casting time of the spell.
This can be modified by the player's skill at casting time.  This
is the casting time of the entire spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the casting time
<li><b>See also:</b>
<br/><a href="#set_casting_time">set_casting_time()
</a></dl>

<ul><a name="query_consumables">
query_consumables</a><pre>
string * query_consumables()
</pre></br>
This method queries the shorts of all the things that will need to
be consumed to cast the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the array of consumables
<li><b>See also:</b>
<br/><a href="#set_consumables">set_consumables()
</a></dl>

<ul><a name="query_critical_stages">
query_critical_stages</a><pre>
int * query_critical_stages()
</pre></br>
This method returns the array of critical stages.
<br/><ul>
<li><b>Returns:</b>
<br/>The stages that must be passed to succeed, or ({ })

</dl>

<ul><a name="query_directed">
query_directed</a><pre>
int query_directed()
</pre></br>
This method queries the directed flag of the spell.  The directed flags
set if the spell is directed at something and what the thing it is
directed as is.  If the spell is not directed then the argument is
passed directly to the spell.
<ul>
<li>SPELL_DIRECT_LIVING
<li>SPELL_DIRECT_ANY_LIVING
<li>SPELL_DIRECT_NON_LIVING
<li>SPELL_DIRECT_NON_LIVING_ANYWHERE
<li>SPELL_DIRECT_SELF
<li>SPELL_DIRECT_MULTIPLE
</ul>
<br/><ul>
<li><b>See also:</b>
<br/><a href="#set_directed">set_directed()</a> and <a href="include.magic.h.shtml">/include/magic.h</a><li><b>Example:</b>
<br/><pre>int flags;

flags = query_directed();
if (flags & SPELL_DIRECT_LIVING) {
   write("Works against living objects.\n");
}
if (flags & SPELL_DIRECT_NON_LIVING) {
   write("Works against non-living objects.\n");
}
if (flags & SPELL_DIRECT_SELF) {
   write("Works against the caster.\n");
}
if (flags & SPELL_DIRECT_MULTIPLE) {
   write("Works against multiple targets.\n");
}
</pre></dl>

<ul><a name="query_dynamic_difficulty">
query_dynamic_difficulty</a><pre>
int query_dynamic_difficulty(object caster,
                             object * targets,
                             string skill)
</pre></br>
This method returns the dynamic difficulty factor of the spell.  This
is applied to all the skill checks to make them harder or easier.  A
value of 100 is the mid point and makes the result the same as the values
in the spell, 200 is double the values in the spell and less than 100
makes the values drop.  The value may never be less than 10.
<br/><ul>
<li><b>Parameters:</b>
<br/>caster - the caster of the spell
<br/>targets - the targets to check
<br/>skill - the skill being checked
<li><b>Returns:</b>
<br/>the dynamic difficulty

</dl>

<ul><a name="query_fixed_time">
query_fixed_time</a><pre>
int query_fixed_time()
</pre></br>
This method returns the fixed time variable of the spell object.  If this
is set to a non-zero value then the casting time of the spell will
always be the same length, no matter how good the spell caster is at
the spell.  Normally casting time will decay with skill increase.
<br/><ul>
<li><b>Returns:</b>
<br/>non-zero for a fixed time spell
<li><b>See also:</b>
<br/><a href="#set_fixed_time">set_fixed_time()
</a></dl>

<ul><a name="query_learn_lvl">
query_learn_lvl</a><pre>
int query_learn_lvl()
</pre></br>
This method queries the level at which the learner needs to be to learn
the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the learn level of the spell
<li><b>See also:</b>
<br/><a href="#set_learn_lvl">set_learn_lvl()
</a></dl>

<ul><a name="query_magic_spell">
query_magic_spell</a><pre>
int query_magic_spell()
</pre></br>
This method will always return 1 for magic spells.
<br/><ul>
<li><b>Returns:</b>
<br/>always return 1

</dl>

<ul><a name="query_max_casting_time">
query_max_casting_time</a><pre>
int query_max_casting_time()
</pre></br>
This method returns the current default maximum casting time of the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the casting time
<li><b>See also:</b>
<br/><a href="#set_casting_time">set_casting_time()
</a></dl>

<ul><a name="query_name">
query_name</a><pre>
string query_name()
</pre></br>
This method returns the name of the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the name of the spell
<li><b>See also:</b>
<br/><a href="#set_name">set_name()
</a></dl>

<ul><a name="query_needed">
query_needed</a><pre>
string * query_needed()
</pre></br>
This method queries all the items needed to cast the spell (that are
not consumed).
<br/><ul>
<li><b>Returns:</b>
<br/>the needed items to cast the spell
<li><b>See also:</b>
<br/><a href="#set_needed">set_needed()
</a></dl>

<ul><a name="query_nroff_file">
query_nroff_file</a><pre>
string query_nroff_file()
</pre></br>
This method returns the nroff file name.  The file name is path to the
file which will be used to display the help.
<br/><ul>
<li><b>Returns:</b>
<br/>the nroff file name
<li><b>See also:</b>
<br/><a href="#set_nroff_file_name">set_nroff_file_name()</a> and <a href="#help_function">help_function()
</a></dl>

<ul><a name="query_octogram_needed">
query_octogram_needed</a><pre>
int query_octogram_needed()
</pre></br>
This method queries if an octogram is needed to cast the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>non-zero if an octogram is needed.
<li><b>See also:</b>
<br/><a href="#set_octogram_needed">set_octogram_needed()
</a></dl>

<ul><a name="query_pivot_casting_bonus">
query_pivot_casting_bonus</a><pre>
int query_pivot_casting_bonus()
</pre></br>
This method returns the bonus at which the casting time will be
unmodified.
<br/><ul>
<li><b>Returns:</b>
<br/>the unmodified bonus pivot point

</dl>

<ul><a name="query_point_cost">
query_point_cost</a><pre>
int query_point_cost()
</pre></br>
This method queries the point cost of the spell.  This is the number of
guild points the spell will cost to cast.  This will be modified
by the level of the caster.
<br/><ul>
<li><b>Returns:</b>
<br/>the guild point cost of the spell
<li><b>See also:</b>
<br/><a href="#set_point_cost">set_point_cost()
</a></dl>

<ul><a name="query_power_level">
query_power_level</a><pre>
int query_power_level()
</pre></br>
This queries the power level of the spell. The power level sets how
powerful the escaped spell creatures will be, if they escape.  It also
determines how much space the spell uses up in the wizard's mind
once they have remembered it.
<br/><ul>
<li><b>Returns:</b>
<br/>the power level of the spell
<li><b>See also:</b>
<br/><a href="#set_power_level">set_power_level()
</a></dl>

<ul><a name="query_prevents_movement">
query_prevents_movement</a><pre>
int query_prevents_movement()
</pre></br>
Queries the prevent_movement flag, which disallows movement from the caster's
part while the spell is cast.
<br/><ul>
<li><b>Returns:</b>
<br/>The movement flag
<li><b>See also:</b>
<br/><a href="#set_prevents_movement">set_prevents_movement()
</a></dl>

<ul><a name="query_ritual">
query_ritual</a><pre>
mixed * query_ritual()
</pre></br>
This method returns the currently set ritual for the spell.  The
ritual describes all the strings and things which go towards the casting
of the spell.  See the set_ritual() code for a more detailed explanation.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#set_ritual">set_ritual()
</a></dl>

<ul><a name="query_skill_used">
query_skill_used</a><pre>
string query_skill_used()
</pre></br>
This method queries the skill used to cast the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the skill used to cast the spell
<li><b>See also:</b>
<br/><a href="#set_skill_used">set_skill_used()
</a></dl>

<ul><a name="query_spell_type">
query_spell_type</a><pre>
string query_spell_type()
</pre></br>
This method sets the type of spell.  This should be something like:
"elemental.defensive", "conjuration.misc", "earth.offensive".
<br/><ul>
<li><b>Returns:</b>
<br/>the current spell type
<li><b>See also:</b>
<br/><a href="#set_spell_type">set_spell_type()
</a></dl>

<ul><a name="query_teach_lvl">
query_teach_lvl</a><pre>
int query_teach_lvl()
</pre></br>
This method queries the level at which the teacher needs to be to teach
the spell to someone else.
<br/><ul>
<li><b>Returns:</b>
<br/>the current teach level
<li><b>See also:</b>
<br/><a href="#set_teach_lvl">set_teach_lvl()
</a></dl>

<ul><a name="query_tm_rate">
query_tm_rate</a><pre>
int query_tm_rate()
</pre></br>
This method returns the tm rate of the spell, i.e. TM_FIXED or TM_SPELL.
The default is TM_SPELL.  See set_fixed_tm for an explanation of when
fixed tms may be used.

<br/><ul>
<li><b>Parameters:</b>
<li><b>Returns:</b>
<br/>The tm rate
<li><b>See also:</b>
<br/><a href="#set_fixed_tm">set_fixed_tm()
</a></dl>

<ul><a name="safe_to_consume">
safe_to_consume</a><pre>
int safe_to_consume(object thing)
</pre></br>
This function checks whether an item is safe to consume, ie whether or
not it is a quest item or otherwise irreplaceable.
<br/><ul>
<li><b>Parameters:</b>
<br/>an - object to check
<li><b>Returns:</b>
<br/>1 if the object is safe to consume, 0 if not.

</dl>

<ul><a name="scale_by_race">
scale_by_race</a><pre>
int scale_by_race(int amount,
                  object thing)
</pre></br>
This method scales the weight by the race.
<br/><ul>
<li><b>Parameters:</b>
<br/>amount - the normal weight
<br/>thing - the thing to scale the weight on
<li><b>Returns:</b>
<br/>the scaled weight

</dl>

<ul><a name="set_casting_time">
set_casting_time</a><pre>
void set_casting_time(int number)
</pre></br>
This method sets the casting time of the spell.  This
is the casting time of the entire spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new casting time of the spell
<li><b>See also:</b>
<br/><a href="#query_casting_time">query_casting_time()
</a></dl>

<ul><a name="set_consumables">
set_consumables</a><pre>
void set_consumables(string * words)
</pre></br>
This method sets the shorts of all the things that will need to
be consumed to cast the spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the new array of consumables
<li><b>See also:</b>
<br/><a href="#query_consumables">query_consumables()
</a></dl>

<ul><a name="set_critical_stages">
set_critical_stages</a><pre>
void set_critical_stages(int * stages)
</pre></br>
This method sets the critical stages for the spell.
 Critical stages are stages that must be succeeded for the spell to be
 cast successfully.  Stages are numbered from 0.
 @param stages An array of stage numbers.


<ul><a name="set_directed">
set_directed</a><pre>
void set_directed(int number)
</pre></br>
This method sets the directed flag of the spell.  The directed flags
determine how the spell can be directed at a target.  The flags are:
<ul>
<li>SPELL_DIRECT_LIVING
<li>SPELL_DIRECT_ANY_LIVING
<li>SPELL_DIRECT_NON_LIVING
<li>SPELL_DIRECT_NON_LIVING_ANYWHERE
<li>SPELL_DIRECT_SELF
<li>SPELL_DIRECT_MULTIPLE
</ul>
It is better to use the or symbol '|' to add together flags than the
plus symbol '+'.  This is because if you add the same flag twice
(acidently) with the + the result will be undefined, but definitely
incorrect.  With an or the result will still be the correct flags set.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new directed flag
<li><b>See also:</b>
<br/><a href="#query_directed">query_directed()</a> and <a href="include.magic.h.shtml">/include/magic.h</a><li><b>Example:</b>
<br/><pre>set_directed(0); // Cannot be directed at a target at all.</pre><br/><pre>
set_directed(SPELL_DIRECT_LIVING | SPELL_DIRECT_NON_LIVING);</pre><br/><pre>
set_directed(SPELL_DIRECT_LIVING | SPELL_DIRECT_MULTIPLE);
</pre></dl>

<ul><a name="set_fixed_time">
set_fixed_time</a><pre>
void set_fixed_time(int number)
</pre></br>
This method sets the fixed time variable of the spell object.  If this
is set to a non-zero value then the casting time of the spell will
always be the same length, no matter how good the spell caster is at
the spell.  Normally casting time will decay with skill increase.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new value for the fixed time attribute
<li><b>See also:</b>
<br/><a href="#set_fixed_time">set_fixed_time()
</a></dl>

<ul><a name="set_fixed_tm">
set_fixed_tm</a><pre>
void set_fixed_tm(int fixed)
</pre></br>
This method sets the spell to use TM_FIXED rather than TM_SPELL.  This
will make the casting the spell tm more easily but only at lower levels.
This is only to be used for training spells, i.e. a low level spells
designed to let low level players learn rudimentary skills.

<br/><ul>
<li><b>Parameters:</b>
<br/>fixed - 1 to use TM_FIXED, 0 to use TM_SPELL
<li><b>Returns:</b>
<br/>void
<li><b>See also:</b>
<br/><a href="#query_tm_rate">query_tm_rate()
</a></dl>

<ul><a name="set_learn_lvl">
set_learn_lvl</a><pre>
void set_learn_lvl(int number)
</pre></br>
This method sets the level at which the learner needs to be to learn the
spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new level at which the learner needs to be
<li><b>See also:</b>
<br/><a href="#query_learn_lvl">query_learn_lvl()
</a></dl>

<ul><a name="set_max_casting_time">
set_max_casting_time</a><pre>
void set_max_casting_time(int number)
</pre></br>
This method sets the maximum casting time of the spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new maximum casting time of the spell
<li><b>See also:</b>
<br/><a href="#query_casting_time">query_casting_time()
</a></dl>

<ul><a name="set_name">
set_name</a><pre>
void set_name(string word)
</pre></br>
This method sets the name of the spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>word - the name of the spell
<li><b>See also:</b>
<br/><a href="#query_name">query_name()
</a></dl>

<ul><a name="set_needed">
set_needed</a><pre>
void set_needed(string * words)
</pre></br>
This method sets all the items needed to cast the spell (that are
not consumed).
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the array of needed objects
<li><b>See also:</b>
<br/><a href="#set_needed">set_needed()
</a></dl>

<ul><a name="set_nroff_file">
set_nroff_file</a><pre>
void set_nroff_file(string str)
</pre></br>
This method sets the nroff file name to use for the
help of the spell.  This shold be used instead of the info
string.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the file name of the nroff help
<li><b>See also:</b>
<br/><a href="#query_nroff_file">query_nroff_file()</a>, <a href="#help_function">help_function()</a> and <a href="#help">help()
</a></dl>

<ul><a name="set_octogram_needed">
set_octogram_needed</a><pre>
void set_octogram_needed(int number)
</pre></br>
This method sets if an octogram is needed to cast the spell.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - non-zero means an octogram is needed
<li><b>See also:</b>
<br/><a href="#query_octogram_needed">query_octogram_needed()
</a></dl>

<ul><a name="set_pivot_casting_bonus">
set_pivot_casting_bonus</a><pre>
void set_pivot_casting_bonus(int bonus)
</pre></br>
This method sets the bonus at which the casting time will be exactly
the set casting time.  If the bonus is higher, it will be less, if it
is lower it will be more.
<br/><ul>
<li><b>Parameters:</b>
<br/>bonus - the pivot bonus point

</dl>

<ul><a name="set_point_cost">
set_point_cost</a><pre>
void set_point_cost(int number)
</pre></br>
This method sets the point cost of the spell.  This is the number of
guild points the spell will cost to cast.  This will be modified
by the level of the caster.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new guild point cost of the spell
<li><b>See also:</b>
<br/><a href="#query_point_cost">query_point_cost()
</a></dl>

<ul><a name="set_power_level">
set_power_level</a><pre>
void set_power_level(int number)
</pre></br>
This sets the power level of the spell. The power level sets how
powerful the escaped spell creatures will be, if they escape.  It also
determines how much space the spell uses up in the wizard's mind
once they have remembered it.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new power level of the spell
<li><b>See also:</b>
<br/><a href="#set_power_level">set_power_level()
</a></dl>

<ul><a name="set_prevents_movement">
set_prevents_movement</a><pre>
void set_prevents_movement(int onoff)
</pre></br>
This sets the prevent_movement flag.  If this is set to 1, it's impossible
for the caster to move while the spell is cast.
<br/><ul>
<li><b>Parameters:</b>
<br/>onoff - 1 to prevent movement, 0 to allow it
<li><b>See also:</b>
<br/><a href="#query_prevents_movement">query_prevents_movement()
</a></dl>

<ul><a name="set_ritual">
set_ritual</a><pre>
void set_ritual(mixed * args)
</pre></br>
This method sets the ritual for the spell.  The
ritual describes all the strings and things which go towards the casting
of the spell. The format is as follows:
<pre>
({
   ({ [first part]
      ({ [first possibility]
         message to caster when caster is a target,
         message to caster when caster is not a target,
         message to room excluding all targets,
         message to targets excluding caster,
      }),
      ({ [other possibilities...]
         etc.
      }),
      relevant skill for this part,
      required skill bonus for this part,
      ({ consumables used in this part }),
   }),
   ({ [other parts]
      etc.
   })
})
</pre>
<br/><ul>
<li><b>Parameters:</b>
<br/>args - the ritual
<li><b>See also:</b>
<br/><a href="#query_ritual">query_ritual(), expand_spell_message()
</a></dl>

<ul><a name="set_skill_used">
set_skill_used</a><pre>
void set_skill_used(string word)
</pre></br>
This method sets the skill used to cast the spell.
<br/><ul>
<li><b>Returns:</b>
<br/>the skill used to cast the spell
<li><b>See also:</b>
<br/><a href="#query_skill_used">query_skill_used()
</a></dl>

<ul><a name="set_spell_type">
set_spell_type</a><pre>
void set_spell_type(string word)
</pre></br>
This method sets the type of spell.  This should be something like:
"elemental.defensive", "conjuration.misc", "earth.offensive".
<br/><ul>
<li><b>Parameters:</b>
<br/>word - the new spell type
<li><b>See also:</b>
<br/><a href="#set_spell_type">set_spell_type()
</a></dl>

<ul><a name="set_teach_lvl">
set_teach_lvl</a><pre>
void set_teach_lvl(int number)
</pre></br>
This method sets the level at which the teacher needs to be to teach
the spell to someone else.
<br/><ul>
<li><b>Parameters:</b>
<br/>number - the new teach level of the spell
<li><b>See also:</b>
<br/><a href="#query_teach_lvl">query_teach_lvl()
</a></dl>

<ul><a name="spell_aborted">
spell_aborted</a><pre>
void spell_aborted(object person,
                   object * targets,
                   int bonus,
                   int stage)
</pre></br>
This method is called when the spell is aborted.  This method shold
be overridden to make spell aborts do more intersting things.
<br/><ul>
<li><b>Parameters:</b>
<br/>person - the person casting the spell
<br/>targets - the targets of the spell
<br/>bonus - the bonus of the spell
<br/>stage - the stage it was aborted at

</dl>

<ul><a name="spell_failed">
spell_failed</a><pre>
void spell_failed(object person,
                  object * targets,
                  int bonus)
</pre></br>
This is called if the spell runs to completion and the spell then
fails to go off correctly.  This should be overridden by spell objects
to make failures more interesting.  See the portal spell and the
pragi's spell for examples.
<br/><ul>
<li><b>Parameters:</b>
<br/>person - the caster of the spell
<br/>targets - the targets of the spell
<br/>bonus - the bonus which the spell was cast at

</dl>

<ul><a name="spell_stage">
spell_stage</a><pre>
void spell_stage(object person,
                 class spell_argument fluff,
                 int id)
</pre></br>
This method does all the process for the specified spell stage.
<br/><ul>
<li><b>Parameters:</b>
<br/>person - the caster
<br/>fluff - the arguments to the stage
<br/>id - the id of the stage

</dl>


[an error occurred while processing this directive]

