This is a simple junk command I set up using the current purge command as a template.
All group levels should be able to rid themselves of an item by typing junk <object>.
Junking multiple items can wait until later, but if anyone does add multiple items it would
be aprrecitated if they post the file here :)
Add this under COMMAND(cmd_purge) in olc2/olc.c
+COMMAND(cmd_junk) {
+ void *found = NULL;
+ int found_type = PARSE_NONE;
+ OBJ_DATA *obj = NULL;
+ char *at = "";
+ bitvector_t find_scope = FIND_SCOPE_INV;
+
+ if (!parse_args(ch, TRUE, cmd, arg, "| { obj.inv }", &found, &found_type))
+ return;
+
+ // junk what?!?
+ if(found == NULL)
+ send_to_char(ch, "You wanna junk what?\r\n");
+
+ if(found_type == PARSE_OBJ) {
+
+ if(IS_SET(find_scope, FIND_SCOPE_INV)) {
+ LIST *inv_objs = find_all_objs(ch, charGetInventory(ch), at, NULL, (IS_SET(find_scope, FIND_SCOPE_VISIBLE)));
+ while( (obj = listPop(inv_objs)) != NULL) {
+ obj_from_char(found);
+ obj_to_room(found, charGetRoom(ch));
+ extract_obj(found);
+ }
+ send_to_char(ch, "You junk %s.\r\n", objGetName(found));
+ message(ch, NULL, found, NULL, FALSE, TO_ROOM, "$n junks $o.");
+ }
+ }
+}
Add this under purge in the add_cmd list at the bottom of olc2/olc.c
+add_cmd("junk", NULL, cmd_junk, POS_SITTING, POS_FLYING,
+ "player", FALSE, FALSE);
Copyover and you should be able to junk anything in your inventory. DIVA