


/inherit/monster.c(1)      MAJIK MUDLIB     /inherit/monster.c(1)


DDEESSCCRRIIPPTTIIOONN
       /inherit/monster.c  is the base object of all monsters. It
       provides the basic functionality for monsters what  should
       be  enough for every common monster out there. If you need
       something more special not listed here, you have  to  code
       it yourself.


CCOODDEERRSS
       Monster  object  is  mainly  coded by Dazzt with some help
       from Namhas.  All things  concerning  monsters  should  be
       forwarded to them.


MMOONNSSTTEERR CCRREEAATTIIOONN
       _s_e_t___n_a_m_e_(_s_t_r_i_n_g _| _s_t_r_i_n_g _*_)
              Every  monster  has to have a name, which has to be
              set using this  function.   If  you  have  multiple
              names the monster can be indexed with the first one
              is used in monster actions.


       _s_e_t___s_h_o_r_t_(_s_t_r_i_n_g_)_, _s_e_t___l_o_n_g_(_s_t_r_i_n_g_)
              These functions define the corresponding short  and
              long  descriptions  of the monster. There are sepa              rate help files concerning the descriptions.


       _s_e_t___r_a_c_e_(_s_t_r_i_n_g_)
              Every monster *must*  have  a  race.  Calling  this
              function  will  set many important variables (stats
              and hps for example) for without the  monster  will
              not  function properly. You can manually adjust the
              values later if you know what you are  doing.  List
              of available races and their abilities is listed in
              /data/monster/races.


       _s_e_t___l_e_v_e_l_(_m_a_p_p_i_n_g _l_e_v_e_l_s_)
              Levels describe monsters' education, ie. what  they
              have  learned during their lives. Higher level will
              contribute towards better stats  and  more  compli              cated  skills  and  spells,  depending on the level
              type. Levels are given in type : value  pairs,  for
              example  set_level(([  "fighter" : 10, "caster" : 5
              ])); would give the monster ten fighter levels  and
              five caster levels. Currently available level types
              are 'fighter' and 'caster'.


       _a_d_d___o_b_j_e_c_t_(_o_b_j_e_c_t_)_, _a_d_d___w_e_a_p_o_n_(_o_b_j_e_c_t_)_, _a_d_d___a_r_m_o_u_r_(_o_b_j_e_c_t_)
              Of  course monsters will need equipment. With these
              functions you  can  give  any  object  to  monster.
              Add_weapon()   and   add_armour()   functions  will



Majik                      21 Nov 1997                          1





/inherit/monster.c(1)      MAJIK MUDLIB     /inherit/monster.c(1)


              automatically (try to) wield  /  wear  the  objects
              given.  Same  rules  for wielding and wearing apply
              for monsters as they do for players.


MMOONNSSTTEERR BBEEHHAAVVIIOORR
       Monster that just stands in the room quietly waiting to be
       killed is a quite boring one. There are many functions for
       modifying monsters' behavior, which  when  correctly  used
       will make monsters more interesting and unique.


       _s_e_t___t_a_l_k_(_s_t_r_i_n_g _| _s_t_r_i_n_g _*_)
              Monsters  can  also  talk, sometimes giving helpful
              hints or maybe  just  general  chatter.  With  this
              function  you  can  set the phrases for the monster
              which it will repeat randomly.


       _s_e_t___l_a_n_g_u_a_g_e_(_s_t_r_i_n_g_)
              By default, monsters speak common, but you can  set
              them to speak any language you wish. Language given
              is the monster's native language, and it will speak
              it with skill at 100%.


       _s_e_t___t_a_l_k___d_e_l_a_y_(_i_n_t_)
              Normally  monsters chat every 30-60 seconds, but if
              you need to do it with different intervals you  can
              modify it with this function.


       _s_e_t___e_m_o_t_e_(_s_t_r_i_n_g _| _s_t_r_i_n_g _*_)
              This function is otherwise identical to set_talk(),
              but instead of saying the messages will  be  echoed
              to room every now and then.


       _s_e_t___e_m_o_t_e___d_e_l_a_y_(_i_n_t_)
              Same for emotes as set_talk_delay() is for talks.


       _a_d_d___a_n_s_w_e_r_(_s_t_r_i_n_g _| _s_t_r_i_n_g _*_t_o_p_i_c_, _s_t_r_i_n_g _a_n_s_w_e_r_)
              As  monsters  can  answer questions made by players
              you can define the answers with this function. Syn              tax should be quite straightforward.


       _s_e_t___w_a_n_d_e_r_(_i_n_t_, _i_n_t_, _i_n_t _| _s_t_r_i_n_g _*_)
              Monsters  don't  need  to stand still, but they can
              also move. Monsters can have three different  kinds
              of  wandering  behavior. Calling set_wander(0) will
              disable wandering.




Majik                      21 Nov 1997                          2





/inherit/monster.c(1)      MAJIK MUDLIB     /inherit/monster.c(1)


       _s_e_t___w_a_n_d_e_r_(_1_, _i_n_t _d_e_l_a_y_)
              In the first wandering  type  monster  will  wander
              randomly  in any direction, but it will stay in the
              same area, which is defined in the room  code  with
              set_area() function. 'delay' is in seconds.


       _s_e_t___w_a_n_d_e_r_(_2_, _i_n_t _d_e_l_a_y_, _i_n_t _d_i_s_t_a_n_c_e_)
              Second wandering type limits the wander for maximum
              of 'distance' rooms away from the start location of
              the monster.


       _s_e_t___w_a_n_d_e_r_(_3_, _i_n_t _d_e_l_a_y_, _s_t_r_i_n_g _*_c_o_m_m_a_n_d_s_)
              Third wandering type can be a really powerful tool.
              You must give an array of commands as  third  argu              ment, which can be from just a path for movement to
              a series of  commands  including  walking,  opening
              doors,  emoting  and perhaps other more complicated
              actions. Monsters can use exactly the same commands
              as mortals.


       _s_e_t___m_o_v_e_(_i_n_t_)
              This function modifies the wandering delay which is
              set in the set_wander() function. This function  is
              obsolete  and  exists  only  for compatibility pur              poses!


       _s_e_t___p_i_c_k_(_i_n_t_)_, _s_e_t___d_r_o_p_(_i_n_t_)
              Monsters can also pick up  and  drop  objects.  The
              chance  of  taking  or  dropping an object in every
              heart beat (one second) is given as percents.  Giv              ing  high  values  will  result  in monster quickly
              looting all the stuff so lower  values  are  recom              mended unless you really need high ones.


CCOOMMBBAATT BBEEHHAAVVIIOORR
       _s_e_t___a_g_g_r_e_s_s_i_v_e_(_)
              Calling  this  function makes the monster automati              cally attack every player it encounters.


       _s_e_t___w_i_m_p_y_(_i_n_t _w_h_e_n_, _i_n_t _c_h_a_n_c_e_)
              Intelligent monsters can flee from  combat.  'When'
              is the percent of hp left before having a chance of
              'chance' percents to attempt fleeing.  If  you  set
              the  chance  near  100%, the monster becomes nearly
              impossible to kill because it will most of the time
              run  out  of the room before players have chance of
              hitting it.




Majik                      21 Nov 1997                          3





/inherit/monster.c(1)      MAJIK MUDLIB     /inherit/monster.c(1)


       -- Dazzt
























































Majik                      21 Nov 1997                          4


