Home

[Package Index | Mudlib Index | Effect Index]

File /std/effects/magic/magic_spell.c

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

This effect has a shadow associated with it.

See also:
help::effects.c

Written by Pinkfish

Includes

This class includes the following files /include/magic.h, /include/playtesters.h, /include/tasks.h, /include/player.h, /include/move_failures.h, /include/effect.h, /std/effects/magic/path.h, /include/nroff.h and /include/obj_parser.h

Method index

  • cast_spell(string, int, object)
    This method casts the actual spell.
  • cast_spell_new(string, int, object *, object *)
  • check_components(class spell_argument)
    This method checks to see if the player has all the needed components to cast the spell.
  • check_disabilities(string, object)
    This method checks disabilities of the player.
  • check_octogram(object, int, class spell_argument)
    This method checks to see if an octogram exists.
  • consume_components(string *, object, object *, class spell_argument)
    This method will use up the components at the end of each spell stage.
  • create_lost_spell(object)
    This method creates a lost spell that shows up when you try to memorise something from a page and the spell escapes.
  • destroy_consumable_stuff(class spell_argument, object)
    This method destroys the consumables and destroys the container they are in.
  • event_npc_cast_spell(object, object, object *, class spell_argument, int)
    This event is called on all the objects in a room when a wizards starts to cast a spell.
  • expand_spell_message(string, object, object *, int)
    This method does the expansion of the spell messages as used by the spell processing code.
  • help()
    This method returns the help for the spell as a string.
  • help_function()
    This method creates a function to view the help if the nroff file is set.
  • pre_process_command_line(string)
    This method pre-checks a command line to see if it fits into the currently allowed patterns for the spell.
  • pre_process_target_objects(object *)
    This method pre-checks the target objects to make sure they are all correct.
  • query_casting_time()
    This method returns the current default casting time of the spell.
  • query_consumables()
    This method queries the shorts of all the things that will need to be consumed to cast the spell.
  • query_critical_stages()
    This method returns the array of critical stages.
  • query_directed()
    This method queries the directed flag of the spell.
  • query_dynamic_difficulty(object, object *, string)
    This method returns the dynamic difficulty factor of the spell.
  • query_fixed_time()
    This method returns the fixed time variable of the spell object.
  • query_learn_lvl()
    This method queries the level at which the learner needs to be to learn the spell.
  • query_magic_spell()
    This method will always return 1 for magic spells.
  • query_max_casting_time()
    This method returns the current default maximum casting time of the spell.
  • query_name()
    This method returns the name of the spell.
  • query_needed()
    This method queries all the items needed to cast the spell (that are not consumed).
  • query_nroff_file()
    This method returns the nroff file name.
  • query_octogram_needed()
    This method queries if an octogram is needed to cast the spell.
  • query_pivot_casting_bonus()
    This method returns the bonus at which the casting time will be unmodified.
  • query_point_cost()
    This method queries the point cost of the spell.
  • query_power_level()
    This queries the power level of the spell.
  • query_prevents_movement()
    Queries the prevent_movement flag, which disallows movement from the caster's part while the spell is cast.
  • query_ritual()
    This method returns the currently set ritual for the spell.
  • query_skill_used()
    This method queries the skill used to cast the spell.
  • query_spell_type()
    This method sets the type of spell.
  • query_teach_lvl()
    This method queries the level at which the teacher needs to be to teach the spell to someone else.
  • query_tm_rate()
    This method returns the tm rate of the spell, i.
  • safe_to_consume(object)
    This function checks whether an item is safe to consume, ie whether or not it is a quest item or otherwise irreplaceable.
  • scale_by_race(int, object)
    This method scales the weight by the race.
  • set_casting_time(int)
    This method sets the casting time of the spell.
  • set_consumables(string *)
    This method sets the shorts of all the things that will need to be consumed to cast the spell.
  • set_critical_stages(int *)
    This method sets the critical stages for the spell.
  • set_directed(int)
    This method sets the directed flag of the spell.
  • set_fixed_time(int)
    This method sets the fixed time variable of the spell object.
  • set_fixed_tm(int)
    This method sets the spell to use TM_FIXED rather than TM_SPELL.
  • set_learn_lvl(int)
    This method sets the level at which the learner needs to be to learn the spell.
  • set_max_casting_time(int)
    This method sets the maximum casting time of the spell.
  • set_name(string)
    This method sets the name of the spell.
  • set_needed(string *)
    This method sets all the items needed to cast the spell (that are not consumed).
  • set_nroff_file(string)
    This method sets the nroff file name to use for the help of the spell.
  • set_octogram_needed(int)
    This method sets if an octogram is needed to cast the spell.
  • set_pivot_casting_bonus(int)
    This method sets the bonus at which the casting time will be exactly the set casting time.
  • set_point_cost(int)
    This method sets the point cost of the spell.
  • set_power_level(int)
    This sets the power level of the spell.
  • set_prevents_movement(int)
    This sets the prevent_movement flag.
  • set_ritual(mixed *)
    This method sets the ritual for the spell.
  • set_skill_used(string)
    This method sets the skill used to cast the spell.
  • set_spell_type(string)
    This method sets the type of spell.
  • set_teach_lvl(int)
    This method sets the level at which the teacher needs to be to teach the spell to someone else.
  • spell_aborted(object, object *, int, int)
    This method is called when the spell is aborted.
  • spell_failed(object, object *, int)
    This is called if the spell runs to completion and the spell then fails to go off correctly.
  • spell_stage(object, class spell_argument, int)
    This method does all the process for the specified spell stage.

Public Functions

These are functions that everyone can access.

.

    cast_spell
    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.
    • Parameters:
      words - the command line arguments to the spell
      scroll - this flag is 1 if it is cast from a scroll
      staff - the staff we are storing a spell in if storing
    cast_spell_new
    int cast_spell_new(string args,
                       int scroll,
                       object * targets,
                       object * using)
    
      check_components
      int check_components(class spell_argument fluff)
      

      This method checks to see if the player has all the needed components to cast the spell.
      • Returns:
        returns a non-zero value if the compents are there
          check_disabilities
          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.
          • Parameters:
            word - the skill to check
            person - the player casting the spell
          • Returns:
            1 if disabled and 0 if ok
              check_octogram
              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.
                consume_components
                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.
                • Parameters:
                  words - the components to consume
                  person - the person casting the spell
                  targets - the targets of the spell
                  args - the spell effect args
                • Returns:
                  0 for failure to find components, 1 for success
                    create_lost_spell
                    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.
                    • See also:
                      set_power_level()
                        destroy_consumable_stuff
                        void destroy_consumable_stuff(class spell_argument fluff,
                                                      object give_back_to)
                        

                        This method destroys the consumables and destroys the container they are in.
                          event_npc_cast_spell
                          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.
                          • Parameters:
                            spell - the spell doing the casting
                            caster - the caster of the spell
                            targets - the targets of the spell
                            args - the spell arguments
                            stage - the start number, 0 for start
                              expand_spell_message
                              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.
                              • Parameters:
                                message - the message to expand
                                thing - the caster
                                things - the targets
                                to_whom - -2 for caster, -1 for room, 0, 1, ... for targets
                              • Returns:
                                the expanded string
                                  help
                                  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.
                                  • Returns:
                                    the help as a string
                                  • See also:
                                    help_function(), set_nroff_file() and query_nroff_file()
                                      help_function
                                      function help_function()
                                      

                                      This method creates a function to view the help if the nroff file is set.
                                      • Returns:
                                        the help viewing function
                                      • See also:
                                        help(), query_nroff_file() and set_nroff_file()
                                          pre_process_command_line
                                          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.
                                          • Parameters:
                                            str - the command line
                                          • Returns:
                                            1 on success, 0 on failure
                                              pre_process_target_objects
                                              int pre_process_target_objects(object * obs)
                                              

                                              This method pre-checks the target objects to make sure they are all correct.
                                              • Parameters:
                                                obs - the target objects
                                              • Returns:
                                                1 on success, 0 on failure
                                                  query_casting_time
                                                  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.
                                                  • Returns:
                                                    the casting time
                                                  • See also:
                                                    set_casting_time()
                                                      query_consumables
                                                      string * query_consumables()
                                                      

                                                      This method queries the shorts of all the things that will need to be consumed to cast the spell.
                                                      • Returns:
                                                        the array of consumables
                                                      • See also:
                                                        set_consumables()
                                                          query_critical_stages
                                                          int * query_critical_stages()
                                                          

                                                          This method returns the array of critical stages.
                                                          • Returns:
                                                            The stages that must be passed to succeed, or ({ })
                                                              query_directed
                                                              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.
                                                              • SPELL_DIRECT_LIVING
                                                              • SPELL_DIRECT_ANY_LIVING
                                                              • SPELL_DIRECT_NON_LIVING
                                                              • SPELL_DIRECT_NON_LIVING_ANYWHERE
                                                              • SPELL_DIRECT_SELF
                                                              • SPELL_DIRECT_MULTIPLE

                                                              • See also:
                                                                set_directed() and /include/magic.h
                                                              • Example:
                                                                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");
                                                                }
                                                                
                                                                  query_dynamic_difficulty
                                                                  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.
                                                                  • Parameters:
                                                                    caster - the caster of the spell
                                                                    targets - the targets to check
                                                                    skill - the skill being checked
                                                                  • Returns:
                                                                    the dynamic difficulty
                                                                      query_fixed_time
                                                                      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.
                                                                      • Returns:
                                                                        non-zero for a fixed time spell
                                                                      • See also:
                                                                        set_fixed_time()
                                                                          query_learn_lvl
                                                                          int query_learn_lvl()
                                                                          

                                                                          This method queries the level at which the learner needs to be to learn the spell.
                                                                          • Returns:
                                                                            the learn level of the spell
                                                                          • See also:
                                                                            set_learn_lvl()
                                                                              query_magic_spell
                                                                              int query_magic_spell()
                                                                              

                                                                              This method will always return 1 for magic spells.
                                                                              • Returns:
                                                                                always return 1
                                                                                  query_max_casting_time
                                                                                  int query_max_casting_time()
                                                                                  

                                                                                  This method returns the current default maximum casting time of the spell.
                                                                                  • Returns:
                                                                                    the casting time
                                                                                  • See also:
                                                                                    set_casting_time()
                                                                                      query_name
                                                                                      string query_name()
                                                                                      

                                                                                      This method returns the name of the spell.
                                                                                      • Returns:
                                                                                        the name of the spell
                                                                                      • See also:
                                                                                        set_name()
                                                                                          query_needed
                                                                                          string * query_needed()
                                                                                          

                                                                                          This method queries all the items needed to cast the spell (that are not consumed).
                                                                                          • Returns:
                                                                                            the needed items to cast the spell
                                                                                          • See also:
                                                                                            set_needed()
                                                                                              query_nroff_file
                                                                                              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.
                                                                                              • Returns:
                                                                                                the nroff file name
                                                                                              • See also:
                                                                                                set_nroff_file_name() and help_function()
                                                                                                  query_octogram_needed
                                                                                                  int query_octogram_needed()
                                                                                                  

                                                                                                  This method queries if an octogram is needed to cast the spell.
                                                                                                  • Returns:
                                                                                                    non-zero if an octogram is needed.
                                                                                                  • See also:
                                                                                                    set_octogram_needed()
                                                                                                      query_pivot_casting_bonus
                                                                                                      int query_pivot_casting_bonus()
                                                                                                      

                                                                                                      This method returns the bonus at which the casting time will be unmodified.
                                                                                                      • Returns:
                                                                                                        the unmodified bonus pivot point
                                                                                                          query_point_cost
                                                                                                          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.
                                                                                                          • Returns:
                                                                                                            the guild point cost of the spell
                                                                                                          • See also:
                                                                                                            set_point_cost()
                                                                                                              query_power_level
                                                                                                              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.
                                                                                                              • Returns:
                                                                                                                the power level of the spell
                                                                                                              • See also:
                                                                                                                set_power_level()
                                                                                                                  query_prevents_movement
                                                                                                                  int query_prevents_movement()
                                                                                                                  

                                                                                                                  Queries the prevent_movement flag, which disallows movement from the caster's part while the spell is cast.
                                                                                                                  • Returns:
                                                                                                                    The movement flag
                                                                                                                  • See also:
                                                                                                                    set_prevents_movement()
                                                                                                                      query_ritual
                                                                                                                      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.
                                                                                                                      • See also:
                                                                                                                        set_ritual()
                                                                                                                          query_skill_used
                                                                                                                          string query_skill_used()
                                                                                                                          

                                                                                                                          This method queries the skill used to cast the spell.
                                                                                                                          • Returns:
                                                                                                                            the skill used to cast the spell
                                                                                                                          • See also:
                                                                                                                            set_skill_used()
                                                                                                                              query_spell_type
                                                                                                                              string query_spell_type()
                                                                                                                              

                                                                                                                              This method sets the type of spell. This should be something like: "elemental.defensive", "conjuration.misc", "earth.offensive".
                                                                                                                              • Returns:
                                                                                                                                the current spell type
                                                                                                                              • See also:
                                                                                                                                set_spell_type()
                                                                                                                                  query_teach_lvl
                                                                                                                                  int query_teach_lvl()
                                                                                                                                  

                                                                                                                                  This method queries the level at which the teacher needs to be to teach the spell to someone else.
                                                                                                                                  • Returns:
                                                                                                                                    the current teach level
                                                                                                                                  • See also:
                                                                                                                                    set_teach_lvl()
                                                                                                                                      query_tm_rate
                                                                                                                                      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.
                                                                                                                                      • Parameters:
                                                                                                                                      • Returns:
                                                                                                                                        The tm rate
                                                                                                                                      • See also:
                                                                                                                                        set_fixed_tm()
                                                                                                                                          safe_to_consume
                                                                                                                                          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.
                                                                                                                                          • Parameters:
                                                                                                                                            an - object to check
                                                                                                                                          • Returns:
                                                                                                                                            1 if the object is safe to consume, 0 if not.
                                                                                                                                              scale_by_race
                                                                                                                                              int scale_by_race(int amount,
                                                                                                                                                                object thing)
                                                                                                                                              

                                                                                                                                              This method scales the weight by the race.
                                                                                                                                              • Parameters:
                                                                                                                                                amount - the normal weight
                                                                                                                                                thing - the thing to scale the weight on
                                                                                                                                              • Returns:
                                                                                                                                                the scaled weight
                                                                                                                                                  set_casting_time
                                                                                                                                                  void set_casting_time(int number)
                                                                                                                                                  

                                                                                                                                                  This method sets the casting time of the spell. This is the casting time of the entire spell.
                                                                                                                                                  • Parameters:
                                                                                                                                                    number - the new casting time of the spell
                                                                                                                                                  • See also:
                                                                                                                                                    query_casting_time()
                                                                                                                                                      set_consumables
                                                                                                                                                      void set_consumables(string * words)
                                                                                                                                                      

                                                                                                                                                      This method sets the shorts of all the things that will need to be consumed to cast the spell.
                                                                                                                                                      • Parameters:
                                                                                                                                                        words - the new array of consumables
                                                                                                                                                      • See also:
                                                                                                                                                        query_consumables()
                                                                                                                                                          set_critical_stages
                                                                                                                                                          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.
                                                                                                                                                            set_directed
                                                                                                                                                            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:
                                                                                                                                                            • SPELL_DIRECT_LIVING
                                                                                                                                                            • SPELL_DIRECT_ANY_LIVING
                                                                                                                                                            • SPELL_DIRECT_NON_LIVING
                                                                                                                                                            • SPELL_DIRECT_NON_LIVING_ANYWHERE
                                                                                                                                                            • SPELL_DIRECT_SELF
                                                                                                                                                            • SPELL_DIRECT_MULTIPLE
                                                                                                                                                            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.
                                                                                                                                                            • Parameters:
                                                                                                                                                              number - the new directed flag
                                                                                                                                                            • See also:
                                                                                                                                                              query_directed() and /include/magic.h
                                                                                                                                                            • Example:
                                                                                                                                                              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);
                                                                                                                                                              
                                                                                                                                                                set_fixed_time
                                                                                                                                                                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.
                                                                                                                                                                • Parameters:
                                                                                                                                                                  number - the new value for the fixed time attribute
                                                                                                                                                                • See also:
                                                                                                                                                                  set_fixed_time()
                                                                                                                                                                    set_fixed_tm
                                                                                                                                                                    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.
                                                                                                                                                                    • Parameters:
                                                                                                                                                                      fixed - 1 to use TM_FIXED, 0 to use TM_SPELL
                                                                                                                                                                    • Returns:
                                                                                                                                                                      void
                                                                                                                                                                    • See also:
                                                                                                                                                                      query_tm_rate()
                                                                                                                                                                        set_learn_lvl
                                                                                                                                                                        void set_learn_lvl(int number)
                                                                                                                                                                        

                                                                                                                                                                        This method sets the level at which the learner needs to be to learn the spell.
                                                                                                                                                                        • Parameters:
                                                                                                                                                                          number - the new level at which the learner needs to be
                                                                                                                                                                        • See also:
                                                                                                                                                                          query_learn_lvl()
                                                                                                                                                                            set_max_casting_time
                                                                                                                                                                            void set_max_casting_time(int number)
                                                                                                                                                                            

                                                                                                                                                                            This method sets the maximum casting time of the spell.
                                                                                                                                                                            • Parameters:
                                                                                                                                                                              number - the new maximum casting time of the spell
                                                                                                                                                                            • See also:
                                                                                                                                                                              query_casting_time()
                                                                                                                                                                                set_name
                                                                                                                                                                                void set_name(string word)
                                                                                                                                                                                

                                                                                                                                                                                This method sets the name of the spell.
                                                                                                                                                                                • Parameters:
                                                                                                                                                                                  word - the name of the spell
                                                                                                                                                                                • See also:
                                                                                                                                                                                  query_name()
                                                                                                                                                                                    set_needed
                                                                                                                                                                                    void set_needed(string * words)
                                                                                                                                                                                    

                                                                                                                                                                                    This method sets all the items needed to cast the spell (that are not consumed).
                                                                                                                                                                                    • Parameters:
                                                                                                                                                                                      words - the array of needed objects
                                                                                                                                                                                    • See also:
                                                                                                                                                                                      set_needed()
                                                                                                                                                                                        set_nroff_file
                                                                                                                                                                                        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.
                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                          str - the file name of the nroff help
                                                                                                                                                                                        • See also:
                                                                                                                                                                                          query_nroff_file(), help_function() and help()
                                                                                                                                                                                            set_octogram_needed
                                                                                                                                                                                            void set_octogram_needed(int number)
                                                                                                                                                                                            

                                                                                                                                                                                            This method sets if an octogram is needed to cast the spell.
                                                                                                                                                                                            • Parameters:
                                                                                                                                                                                              number - non-zero means an octogram is needed
                                                                                                                                                                                            • See also:
                                                                                                                                                                                              query_octogram_needed()
                                                                                                                                                                                                set_pivot_casting_bonus
                                                                                                                                                                                                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.
                                                                                                                                                                                                • Parameters:
                                                                                                                                                                                                  bonus - the pivot bonus point
                                                                                                                                                                                                    set_point_cost
                                                                                                                                                                                                    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.
                                                                                                                                                                                                    • Parameters:
                                                                                                                                                                                                      number - the new guild point cost of the spell
                                                                                                                                                                                                    • See also:
                                                                                                                                                                                                      query_point_cost()
                                                                                                                                                                                                        set_power_level
                                                                                                                                                                                                        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.
                                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                                          number - the new power level of the spell
                                                                                                                                                                                                        • See also:
                                                                                                                                                                                                          set_power_level()
                                                                                                                                                                                                            set_prevents_movement
                                                                                                                                                                                                            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.
                                                                                                                                                                                                            • Parameters:
                                                                                                                                                                                                              onoff - 1 to prevent movement, 0 to allow it
                                                                                                                                                                                                            • See also:
                                                                                                                                                                                                              query_prevents_movement()
                                                                                                                                                                                                                set_ritual
                                                                                                                                                                                                                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.
                                                                                                                                                                                                                   })
                                                                                                                                                                                                                })
                                                                                                                                                                                                                

                                                                                                                                                                                                                • Parameters:
                                                                                                                                                                                                                  args - the ritual
                                                                                                                                                                                                                • See also:
                                                                                                                                                                                                                  query_ritual(), expand_spell_message()
                                                                                                                                                                                                                    set_skill_used
                                                                                                                                                                                                                    void set_skill_used(string word)
                                                                                                                                                                                                                    

                                                                                                                                                                                                                    This method sets the skill used to cast the spell.
                                                                                                                                                                                                                    • Returns:
                                                                                                                                                                                                                      the skill used to cast the spell
                                                                                                                                                                                                                    • See also:
                                                                                                                                                                                                                      query_skill_used()
                                                                                                                                                                                                                        set_spell_type
                                                                                                                                                                                                                        void set_spell_type(string word)
                                                                                                                                                                                                                        

                                                                                                                                                                                                                        This method sets the type of spell. This should be something like: "elemental.defensive", "conjuration.misc", "earth.offensive".
                                                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                                                          word - the new spell type
                                                                                                                                                                                                                        • See also:
                                                                                                                                                                                                                          set_spell_type()
                                                                                                                                                                                                                            set_teach_lvl
                                                                                                                                                                                                                            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.
                                                                                                                                                                                                                            • Parameters:
                                                                                                                                                                                                                              number - the new teach level of the spell
                                                                                                                                                                                                                            • See also:
                                                                                                                                                                                                                              query_teach_lvl()
                                                                                                                                                                                                                                spell_aborted
                                                                                                                                                                                                                                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.
                                                                                                                                                                                                                                • Parameters:
                                                                                                                                                                                                                                  person - the person casting the spell
                                                                                                                                                                                                                                  targets - the targets of the spell
                                                                                                                                                                                                                                  bonus - the bonus of the spell
                                                                                                                                                                                                                                  stage - the stage it was aborted at
                                                                                                                                                                                                                                    spell_failed
                                                                                                                                                                                                                                    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.
                                                                                                                                                                                                                                    • Parameters:
                                                                                                                                                                                                                                      person - the caster of the spell
                                                                                                                                                                                                                                      targets - the targets of the spell
                                                                                                                                                                                                                                      bonus - the bonus which the spell was cast at
                                                                                                                                                                                                                                        spell_stage
                                                                                                                                                                                                                                        void spell_stage(object person,
                                                                                                                                                                                                                                                         class spell_argument fluff,
                                                                                                                                                                                                                                                         int id)
                                                                                                                                                                                                                                        

                                                                                                                                                                                                                                        This method does all the process for the specified spell stage.
                                                                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                                                                          person - the caster
                                                                                                                                                                                                                                          fluff - the arguments to the stage
                                                                                                                                                                                                                                          id - the id of the stage
Valid HTML 4.01 Transitional
Valid CSS!
Read More