Invisible Object Special [by Mike Carpenter]
Snippet Posted Wednesday, August 12th @ 11:29:28 PM, by George Greer in the Specials dept.
Added Dec 8, 1997. Click the link below to read it or download it.

From: Mike Carpenter <abram@DELTANET.COM>
Subject: Spec_proc invis_item

/* Below I adjusted the spec_proc to remove the check for specific vnum */
/* This version has been tested and works */
/* You can now assign any object this spec_proc and it will work */

SPECIAL(invis_item)
{
 int i;
 char arg1[MAX_INPUT_LENGTH];
 struct obj_data *invis_obj = (struct obj_data *)me;
        /* cast the "me" pointer and assign it to invis_obj */
 if (invis_obj->worn_by == ch) {
        /* check to see if the person carrying the invis_obj is the character *
/
      if(CMD_IS("disappear")) {
      send_to_char("You slowly fade out of view.\r\n", ch);
      act("$n slowly fades out of view.\r\n", FALSE, ch, 0, 0,TO_ROOM);
      SET_BIT(AFF_FLAGS(ch), AFF_INVISIBLE);
      return (TRUE);
      }

      if (CMD_IS("appear")) {
      REMOVE_BIT(AFF_FLAGS(ch), AFF_INVISIBLE);
      send_to_char("You slowly fade into view.\r\n", ch);

      act("$n slowly fades into view.\r\n", FALSE, ch, 0, 0,TO_ROOM);
      return(TRUE);
      }

    one_argument(argument, arg1);

    if (is_abbrev(arg1, "magical")) {
     for (i=0; i< NUM_WEARS; i++)
     if(GET_EQ(ch,i)){
        if (IS_SET(AFF_FLAGS(ch), AFF_INVISIBLE)) {

          REMOVE_BIT(AFF_FLAGS(ch), AFF_INVISIBLE);
          perform_remove(ch,i);
          send_to_char("You slowly fade into view.\r\n", ch);
          act("$n slowly fades into view.\r\n", FALSE, ch, 0, 0, TO_ROOM);
          return (TRUE);
          } else {
          perform_remove(ch, i);
          return (TRUE);
          }
     return (FALSE);
     }
  return (FALSE);
  }
 return (FALSE);
 }
return (FALSE);
}


<< Interpreter Tree Search (commands) [by Angus] | Reply | View as text | Threaded | Ispell Code (Spell Checker) [by Chris Baggett] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.