/*----------------------------------------------------------------------------------*\ * * * This snippet was written by Kaine De'Arque of Vampire Wars: Embrace the Darkness * * (VWETD). If you use this snippet all I ask is that you email me saying that you * * used, benefited, didnt like, etc. from it ( shane@computers-mn.com ). * * * * This snippet should work with any Merc dirivitive, if it doesnt let me know. * * Basicly (in short) I was sick of everyone saying "Hey my eq broke all of a sudden* * and I dont know why!!". So what this snippet does is puts a gauge next to the * * piece of equipment that looks simmilar to this: [++++++++++]. If its condition * * lowers, the pluses in turn lower, it is also setup so that when it goes down the * * colors change on the pluses (If your mud doesnt support COL_SCALE remove: * * COL_SCALE(gauge, ch, plus_cnt, 10, MAX_INPUT_LENGTH); from the snippet. * * * * To install: Simply delete your old 'void do_equipment' from, act_info.c and * * replace it with this one. Very simple not alot of fuss and muss, lemme know if * * ya like it! - Kaine De'Arque, VWETD, shane@computers-mn.com * * * \*----------------------------------------------------------------------------------*/ void do_equipment( CHAR_DATA *ch, char *argument ) { OBJ_DATA *obj; int iWear; bool found; int plus_cnt; char buf[MAX_INPUT_LENGTH]; char gauge[MAX_INPUT_LENGTH]; int i; send_to_char_formatted( "You are using:\n\r", ch ); found = FALSE; for ( iWear = 0; iWear < MAX_WEAR; iWear++ ) { if ( ( obj = get_eq_char( ch, iWear ) ) == NULL ) continue; send_to_char_formatted( where_name[iWear], ch ); if( can_see_obj(ch,obj)) { plus_cnt = obj->condition / 10; gauge[0] = '\0'; for(i = 0; i < 10; i++) { if(i < plus_cnt) { strncat(gauge, "+", MAX_INPUT_LENGTH - strlen(gauge)); } else { strncat(gauge, " ", MAX_INPUT_LENGTH - strlen(gauge)); } } COL_SCALE(gauge, ch, plus_cnt, 10, MAX_INPUT_LENGTH); snprintf(buf, MAX_INPUT_LENGTH, "%-38s [%s]\r\n", format_obj_to_char(obj, ch, TRUE)); send_to_char(buf, ch); } else { send_to_char_formatted( "something.\n\r", ch ); } found = TRUE; } if ( !found ) send_to_char_formatted( "Nothing.\n\r", ch ); return; }