From: WarRat Additions From: Chris Jacobson Subject: vwear command 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 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. In act.wizard.c: ACMD(do_vwear) { one_argument(argument, buf); if (!*buf) { send_to_char("Usage: vwear \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); return; } 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); else 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; for (nr = 0; nr <= top_of_objt; nr++) { if (CAN_WEAR(&obj_proto[nr], 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 util.h: In the CAN_WEAR macro replace 'obj' with '&obj_proto[nr]' In interpreter.c ACMD(do_vwear); and { "vwear" , POS_DEAD , do_vwear , LVL_AVATAR, 0 },