ALWAYS BACK UP YOUR CODE BEFORE ADDING SOMEONE ELSES, OR EVEN YOUR
OWN!

This snippet will allow all your skills and spells to have messages
that are displayed to everyone in the room when they wear off. Normally
only the character whose skill/spell just wore off sees the message,
but if you're running a MUD where PK is an integral part of gameplay
it is useful to have some message display to others. A good example
would be dirt kick. Normally when this wears off only the character
who got dirt kicked sees the message, so how is the guy who's fighting
him supposed to know without keeping a careful eye on the ticks? How
does a groupmate know when your protective spells wear off so they
can re-cast them? This snippet will provide the answer.

Like my other released snippet (keep flags) I require no credit for
this since it is a very simple piece of code. This snippet should
work for any ROM 2.4b6 MUD, but was originally coded on a QuickMUD
base (ROM with colour and OLC). As always, add any line that is
preceeded by a +, or add the bits specified.

BACK UP YOUR CODE!

/* merc.h */
/* Find struct skill_type, the table which defines the structure
   of a skill, and add the following. (A simple search for
   "skill_type" should take you straight there) */

    char *    msg_off;        /* Wear off message        */
    char *    msg_obj;        /* Wear off message for obects    */
+   char *    msg_off2;       /* Wear off message for other characters */

--------------------------------------------------------------------------
/* update.c */
/* Find void char_update. Here is where we tell the MUD to display
   the extra wear off message to everyone. Do a search for "char_update"
   and it should be the SECOND one you come to. */

/* Look for this bit of code in char_update: */

          if (paf_next == NULL
              || paf_next->type != paf->type || paf_next->duration > 0)
          {
              if (paf->type > 0 && skill_table[paf->type].msg_off)
              {
                  send_to_char (skill_table[paf->type].msg_off, ch);
                  send_to_char ("\n\r", ch);
              }
          }   

/* And change it to: */

          if (paf_next == NULL
              || paf_next->type != paf->type || paf_next->duration > 0)
          {
              if (paf->type > 0 && skill_table[paf->type].msg_off)
              {
                  send_to_char (skill_table[paf->type].msg_off, ch);
                  act (skill_table[paf->type].msg_off2, ch, NULL, ch, TO_NOTVICT);
                  send_to_char ("\n\r", ch);
              }
          }

--------------------------------------------------------------------------
/* const.c */
/* The boring bit. You have to go through ALL the skills and spells listed
   in const.c and make the changes shown. */

/* For an example, lets take our dirt kick skill. It will look something
   like this: */
    {
     "dirt kicking", {52,52,52,52}, {52,52,52,52},
     spell_null, TAR_IGNORE, POS_FIGHTING,
     &gsn_dirt, SLOT (0), 0, 24,
     "kicked dirt", "You rub the dirt out of your eyes.", ""},

/* You need to add the new field (msg_off2) that you created. So for example: */
    {
     "dirt kicking", {52,52,52,52}, {52,52,52,52},
     spell_null, TAR_IGNORE, POS_FIGHTING,
     &gsn_dirt, SLOT (0), 0, 24,
     "kicked dirt", "You rub the dirt out of your eyes.", "",<--dont forget this comma 
     "$n rubs the dirt out of $s eyes."},

--------------------------------------------------------------------------

Do that to all of your skills/spells you wish to have messages displayed to
people in the room when they wear off. For the ones you dont want to display,
you MUST remember to add the blank field (""},) instead of a message.

If there is an easier way of doing this, then I'm sorry. I'm still just a
newbie coder mugging his way through the world! As always, if you get
problems I will try and help you if you email me, but before you do be sure
you've got your syntax correct in the code! 98% of my problems adding this
to my own code came from me missing out a comma or }.

Happy coding!
Chris Jenkins (Xerihae of the Winds of Lor'an)
windsofloran.co.uk 7000
xerihae@windsofloran.co.uk