[CODE] [NEWBIE] Object spec_procs

From: Sliver (sliver@lightspeed.bc.ca)
Date: 10/01/96


Hey there all you coders out there,
I have a somewhat newbie question..
I want to have a sword that echos things to the room while it is wielded
or in inventory..
This is what I have so far, but it doesn't seem to be working,
it only echos the thing when the game access the object, ie by typeing
"equipment"
while you have it wielded, or if it's in a room, and you type look, and
so on.
Furthermore, the sword isn't supposed to echo anything if it's just in a
room,
and not in possession of anyone, but it does, like I said, when the game
access it.
It's just supposed to randomly do the stuff.
Any help would be appritiated.

Heres the code:


SPECIAL(newbiesword)
{
  struct obj_data *obj = me;
  struct char_data *usr;
  
  if (obj->in_room > NOWHERE)
    return FALSE;

  if (obj->carried_by)
    usr = obj->carried_by;

  if (obj->worn_by)
    usr = obj->worn_by;

  if (!usr)
    return FALSE;

  if (usr == NULL)
    return FALSE;

  if (usr) {
    if (GET_POS(usr) != POS_FIGHTING) {
      switch (number(0, 15)) {
        case 0:
          sprintf(buf2, "%s makes a face at %s.",
obj->short_description, GET_NAME(usr));
          act(buf2, FALSE, usr, obj, 0, TO_ROOM); 
          sprintf(buf2, "%s makes a face at you.",
obj->short_description);
          act(buf2, FALSE, usr, obj, 0, TO_CHAR); 
          break;
       }
     }
  }
  return FALSE;
}



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SLiVER Implementor of
ArmadaMUD                    lightspeed.bc.ca 4000
EMail:                     sliver@lightspeed.bc.ca
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST