/* Installation: Installing this snippet is exactly the same as installing the iscarrying snippet. I'll duplicate the instructions here, just incase. Just append this snippet after the "lck" ifcheck, which is located between the if (chkchar) {} body of code in the mprog_do_ifcheck() function in the mud_prog.c source file. Search for "lck" (include the quotes in the search) in the mud_prog.c file and the first instance should be the location you are looking for. E-Mail me if you have any problems: -Ron Kinney(minex@dod.hpi.net) */ /* This if check has the syntax within mprogs: if iswearing() == It will return true if the person is wearing the item of that vnum. False will be returned otherwise. Only the == check is supported, for I didn't see the need for other comparisons. For example, iswearing($n) > 100 didn't seem to have much of a use in my opinion. However, feel free to add those conditions if you feel so inclined. ie, if iswearing($n) == 100 say You are wearing vnum 100 else say You are not wearing vnum 100 endif */ if ( !str_cmp(chck, "iswearing") ) { OBJ_DATA *pObj; int vnum = atoi(rval); int iWear; if ( vnum < 1 || vnum > 2097152000 ) { progbug("iswearing: bad vnum", mob); return BERR; } if (str_cmp(opr, "==")) { progbug("iswearing: bad check", mob); return BERR ; } for ( iWear = 0; iWear < MAX_WEAR; iWear++ ) { for ( pObj = chkchar->first_carrying; pObj; pObj = pObj->next_content ) { if ( pObj->wear_loc == iWear ) { if (pObj->pIndexData->vnum == vnum) { return TRUE ; } } } } return FALSE ; }