[Circle] (code) vwear command

From: WarRat (warrat@erinet.com)
Date: 08/03/96

At the request of my builder, I made a command called vwear (see below).
What this does is goes through the objects and prints a list of all the
objects in a wear position.

Usage is:  vwear <position>

It's just a quick hack of vnum but could be useful for those people trying
to decide what type of equipment needs to be created.

Feel free to use it...the code is not all that tight, if you make it better,
please send me (and the list) a copy.

I would also like to thank the people who helped me with my crash bug, it is
fixed :)

In act.wizard.c:

  one_argument(argument, buf);

  if (!*buf) {
    send_to_char("Usage: vwear <wear position>\r\n"
          "Possible positions are:\r\n"
          "finger    neck    body    head    legs    feet    hands\r\n"
          "shield    arms    about   waist   wrist   wield   hold\r\n", ch);
  if (is_abbrev(buf, "finger"))
    vwear_object(ITEM_WEAR_FINGER, ch);
  else if (is_abbrev(buf, "neck"))
    vwear_object(ITEM_WEAR_NECK, ch);
  else if (is_abbrev(buf, "body"))
    vwear_object(ITEM_WEAR_BODY, ch);
  else if (is_abbrev(buf, "head"))
    vwear_object(ITEM_WEAR_HEAD, ch);
  else if (is_abbrev(buf, "legs"))
    vwear_object(ITEM_WEAR_LEGS, ch);
  else if (is_abbrev(buf, "feet"))
    vwear_object(ITEM_WEAR_FEET, ch);
  else if (is_abbrev(buf, "hands"))
    vwear_object(ITEM_WEAR_HANDS, ch);
  else if (is_abbrev(buf, "arms"))
    vwear_object(ITEM_WEAR_ARMS, ch);
  else if (is_abbrev(buf, "shield"))
    vwear_object(ITEM_WEAR_SHIELD, ch);
  else if (is_abbrev(buf, "about body"))
    vwear_object(ITEM_WEAR_ABOUT, ch);
  else if (is_abbrev(buf, "waist"))
    vwear_object(ITEM_WEAR_WAIST, ch);
  else if (is_abbrev(buf, "wrist"))
    vwear_object(ITEM_WEAR_WRIST, ch);
  else if (is_abbrev(buf, "wield"))
    vwear_object(ITEM_WEAR_WIELD, ch);
  else if (is_abbrev(buf, "hold"))
    vwear_object(ITEM_WEAR_HOLD, ch);
          send_to_char("Possible positions are:\r\n"
          "finger    neck    body    head    legs    feet    hands\r\n"
          "shield    arms    about   waist   wrist   wield   hold\r\n", ch);

In db.c:
void vwear_object(int wearpos, struct char_data * ch)
  int nr, found = 0;
  struct obj_data *obj;
  for (nr = 0; nr <= top_of_objt; nr++) {
        obj = read_object(obj_index[nr].virtual, VIRTUAL);
    if (CAN_WEAR(obj, wearpos)) {
     sprintf(buf, "%3d. [%5d] %s\r\n", ++found,
     obj_index[nr].virtual, obj_proto[nr].short_description);
     send_to_char(buf, ch);

In db.h:
void vwear_object(int wearpos, struct char_data * ch);

In interpreter.c


  { "vwear"    , POS_DEAD    , do_vwear    , LVL_AVATAR, 0 },

                            #  \O/
10,000 lemmings#    |
can't all be wrong#   / \    
                            #  .. .     warrat@erinet.com
                            #  . . .
                            # #..# .

       Happy shall he be, that taketh and dasheth thy little ones 
       against the stones.
                                  Psalms 137:9 

| 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/07/00 PST