[Package Index | Mudlib Index | Effect Index]
This effect has a shadow associated with it.
See also:
help::effects.c
Written by Pinkfish
.
int cast_spell(string words, int scroll, object staff)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.
int cast_spell_new(string args, int scroll, object * targets, object * using)
int check_components(class spell_argument fluff)This method checks to see if the player has all the needed components to cast the spell.
int check_disabilities(string word, object person)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.
int check_octogram(object thing, int remove, class spell_argument args)This method checks to see if an octogram exists. This will check to see if the needed octograms exist.
int consume_components(string * words, object person, object * targets, class spell_argument fluff)This method will use up the components at the end of each spell stage.
object create_lost_spell(object room)This method creates a lost spell that shows up when you try to memorise something from a page and the spell escapes.
void destroy_consumable_stuff(class spell_argument fluff, object give_back_to)This method destroys the consumables and destroys the container they are in.
void event_npc_cast_spell(object spell, object caster, object * targets, class spell_argument args, int stage)This event is called on all the objects in a room when a wizards starts to cast a spell.
string expand_spell_message(string message, object thing, object * things, int to_whom)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.
string help()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.
function help_function()This method creates a function to view the help if the nroff file is set.
int pre_process_command_line(string str)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.
int pre_process_target_objects(object * obs)This method pre-checks the target objects to make sure they are all correct.
int query_casting_time()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.
string * query_consumables()This method queries the shorts of all the things that will need to be consumed to cast the spell.
int * query_critical_stages()This method returns the array of critical stages.
int query_directed()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.
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"); }
int query_dynamic_difficulty(object caster, object * targets, string skill)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.
int query_fixed_time()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.
int query_learn_lvl()This method queries the level at which the learner needs to be to learn the spell.
int query_magic_spell()This method will always return 1 for magic spells.
int query_max_casting_time()This method returns the current default maximum casting time of the spell.
string query_name()This method returns the name of the spell.
string * query_needed()This method queries all the items needed to cast the spell (that are not consumed).
string query_nroff_file()This method returns the nroff file name. The file name is path to the file which will be used to display the help.
int query_octogram_needed()This method queries if an octogram is needed to cast the spell.
int query_pivot_casting_bonus()This method returns the bonus at which the casting time will be unmodified.
int query_point_cost()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.
int query_power_level()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.
int query_prevents_movement()Queries the prevent_movement flag, which disallows movement from the caster's part while the spell is cast.
mixed * query_ritual()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.
string query_skill_used()This method queries the skill used to cast the spell.
string query_spell_type()This method sets the type of spell. This should be something like: "elemental.defensive", "conjuration.misc", "earth.offensive".
int query_teach_lvl()This method queries the level at which the teacher needs to be to teach the spell to someone else.
int query_tm_rate()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.
int safe_to_consume(object thing)This function checks whether an item is safe to consume, ie whether or not it is a quest item or otherwise irreplaceable.
int scale_by_race(int amount, object thing)This method scales the weight by the race.
void set_casting_time(int number)This method sets the casting time of the spell. This is the casting time of the entire spell.
void set_consumables(string * words)This method sets the shorts of all the things that will need to be consumed to cast the spell.
void set_critical_stages(int * stages)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.
void set_directed(int number)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:
set_directed(0); // Cannot be directed at a target at all.
set_directed(SPELL_DIRECT_LIVING | SPELL_DIRECT_NON_LIVING);
set_directed(SPELL_DIRECT_LIVING | SPELL_DIRECT_MULTIPLE);
void set_fixed_time(int number)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.
void set_fixed_tm(int fixed)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.
void set_learn_lvl(int number)This method sets the level at which the learner needs to be to learn the spell.
void set_max_casting_time(int number)This method sets the maximum casting time of the spell.
void set_name(string word)This method sets the name of the spell.
void set_needed(string * words)This method sets all the items needed to cast the spell (that are not consumed).
void set_nroff_file(string str)This method sets the nroff file name to use for the help of the spell. This shold be used instead of the info string.
void set_octogram_needed(int number)This method sets if an octogram is needed to cast the spell.
void set_pivot_casting_bonus(int bonus)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.
void set_point_cost(int number)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.
void set_power_level(int number)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.
void set_prevents_movement(int onoff)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.
void set_ritual(mixed * args)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:
({ ({ [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. }) })
void set_skill_used(string word)This method sets the skill used to cast the spell.
void set_spell_type(string word)This method sets the type of spell. This should be something like: "elemental.defensive", "conjuration.misc", "earth.offensive".
void set_teach_lvl(int number)This method sets the level at which the teacher needs to be to teach the spell to someone else.
void spell_aborted(object person, object * targets, int bonus, int stage)This method is called when the spell is aborted. This method shold be overridden to make spell aborts do more intersting things.
void spell_failed(object person, object * targets, int bonus)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.
void spell_stage(object person, class spell_argument fluff, int id)This method does all the process for the specified spell stage.