From: Frollo Subject: Add an object apply ACMD(do_apply) { int nr, found = FALSE, i, x, y = 0, plus = FALSE, minus = FALSE; char arg2[256]; two_arguments(argument, arg, arg2); if (!strcmp(arg2, "+")) plus = TRUE; if (!strcmp(arg2, "-")) minus = TRUE; for (x = 1; x < 28; x++) { if (is_abbrev(arg, apply_types[x])) { y = x; found = TRUE; x = 27; } } if (!found || !*arg) { sprintf(buf, "Usage: apply (+/-)\r\n "); for (x = 1; x < 28; x++) sprintf(buf, "%s%s%s%s", buf, apply_types[x], x < 27 ? ", " : "", (x == 11 || x == 20 || x == 25 || x == 27) ? "\r\n " : ""); send_to_char(buf, ch); return; } found = FALSE; sprintf(buf, "&n&m&uApply to %s:\r\n&n", apply_types[y]); send_to_char(buf, ch); for (nr = 0; nr <= top_of_objt; nr++) { for (i = 0; i < MAX_OBJ_AFFECT; i++) { if ((minus && obj_proto[nr].affected[i].modifier < 0) || (plus && obj_proto[nr] .affected[i].modifier > 0) || (!minus && !plus && obj_proto[nr].affected[i].mod ifier)) { if (obj_proto[nr].affected[i].location == y) { sprinttype(obj_proto[nr].affected[i].location, apply_types, buf2); sprintf(buf, "&n&g[&c%5d&n] &y%-45s &c%+d to %s&n\r\n", obj_index[nr].virtual, obj_proto[nr].short_description, obj_proto[nr].affected[i].modifier, buf2); send_to_char(buf, ch); found = TRUE; } } } } if (!found) send_to_char("&n&c None.&n\r\n", ch); }