Examine item list 1.0 by Xerves (Released September 23 2000) Xerves is the admin/owner of Rafermand (mud.rafermand.net port 3002) Website: http://www.rafermand.net Contact: xerves@rafermand.net Pretty simple addition, but a nice one. It will allow a person to examine a container and see just a list of weapons, armor, or any kind of item type that is available in your game. Syntax: exam Pretty much it. Files that need to be changed ----------------------------- 1. act_info.c 1. ACT_INFO.c ---------------- Find void show_list_to_char( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing ) Change it to void show_list_to_char_type( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing, int itemtype ) Just slightly below find this OBJ_DATA *obj; int nShow; int iShow; And add int type = 0; Just a bit more below that find this if ( !ch->desc ) return; And after that add if (itemtype > 0) type = 1; Still in show_list_to_char_type find this.. if ( tmp > 0 && number_bits(1) == 0 ) { prgpstrShow [nShow] = str_dup( hallucinated_object(ms, fShort) ); BEFORE it add this if ( type == 1) // For Examine, will only show a certain itemtype if prompted { if (obj->item_type != itemtype) continue; } After the show_list_to_char_type function you are in, you need to add this. // So we do not have to declare show_list_to_char_type in mud.h void show_list_to_char( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing ) { show_list_to_char_type( list, ch, fShort, fShowNothing, 0); return; } In the function do_look find this bit of code act( AT_PLAIN, "$p holds:", ch, obj, NULL, TO_CHAR ); obj->count = count; show_list_to_char( obj->first_content, ch, TRUE, TRUE ); Change the last line to look like this. show_list_to_char_type( obj->first_content, ch, TRUE, TRUE, atoi(argument)); Now, in do_examine find this at the top of the function OBJ_DATA *obj; BOARD_DATA *board; sh_int dam; Add this after it. sh_int value; Slightly below you will find this one_argument( argument, arg ); Change that statement to this argument = one_argument( argument, arg ); Toward the end of the function you will find this. case ITEM_CONTAINER: if ( IS_OBJ_STAT( obj, ITEM_COVERING ) ) break; case ITEM_DRINK_CON: case ITEM_QUIVER: send_to_char( "When you look inside, you see:\n\r", ch ); case ITEM_KEYRING: sprintf( buf, "in %s noprog", arg ); do_look( ch, buf ); break; } Need to change it to this case ITEM_CONTAINER: if ( IS_OBJ_STAT( obj, ITEM_COVERING ) ) break; case ITEM_DRINK_CON: case ITEM_QUIVER: send_to_char( "When you look inside, you see:\n\r", ch ); case ITEM_KEYRING: value = get_otype( argument ); if ( value > 0 ) sprintf( buf, "in %s noprog %d", arg, value); else sprintf( buf, "in %s noprog", arg ); do_look( ch, buf ); break; } -------------------------------------- Pretty much it, now make clean and compile your code. You might want to update your examine helpfile and tell your players this change has been added. Also a note, you have to use weapon, armor, etc to view the different king of itemtypes. It will not work with weapons or any other plural because it works with o_type which only takes one word for each type. If you want to change this, you could put in a new list to hunt through, but this is up to you. This code is ran on a heavily modified 1.4 Smaug mud and has been modified to run on hopefully a Stock 1.4 and 1.4a mud. There might be slightest changes you might run into, if you have any problems, please contact the auth, the email is listed at the top of this file.