In celebration of being back on the list (I somehow got unsubscribed or something) here is my version of the popular "drag corpse" command. I noticed the ftp site snippet directory has been rearranged (*I* didn't know; I've been off the list!), kudos and thanks to whomever did that -- it's much easier to use now. Meer/Melissa Jadwinski jadwin@tiac.net "Cheerfully re-inventing the wheel for drag queens everywhere." Usage: (1) toss in act.movement.c, (2) compile, (3) pray. Oh yeah, if you find a bug, toss it my way -- this is the same drag my mud uses. ;) #define DRAG_MOVE_COST 30 /* move cost to drag a corpse one room */ ACMD(do_drag) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; struct obj_data *corpse; struct char_data *tmp_char; int corpse_dotmode, door, need_movement; two_arguments(argument, arg1, arg2); corpse_dotmode = find_all_dots(arg1); if (!*arg1) send_to_char("Drag what where?\r\n", ch); else if (corpse_dotmode != FIND_INDIV) send_to_char("You can only drag one corpse at a time.\r\n", ch); else if (!*arg2) send_to_char("You must specify a direction.\r\n", ch); else { generic_find(arg1, FIND_OBJ_ROOM, ch, &tmp_char, &corpse); if (!corpse) { sprintf(buf, "You don't see %s %s here.\r\n", AN(arg1), arg1); send_to_char(buf, ch); /* if you remove this check, players will be able to drag */ /* fountains, etc. :) if you want to allow that sort of */ /* thing, you might want to check for !take flags or weight. */ } else if (!IS_CORPSE(corpse)) send_to_char("You can only drag corpses.\r\n", ch); else if ((door = search_block(arg2, dirs, FALSE)) < 0) send_to_char("That's not a direction.\r\n", ch); else { need_movement = (movement_loss[SECT(ch->in_room)] + movement_loss[SECT(EXIT(ch, door)->to_room)]) / 2; need_movement += DRAG_MOVE_COST; if (!IS_NPC(ch) && (GET_LEVEL(ch) < LVL_IMMORT) && (GET_MOVE(ch) < need_movement)) { act("You are too exhausted to drag $p with you!", FALSE, ch, corpse, NULL, TO_CHAR); } else if (perform_move(ch, door, 0)) { if (!IS_NPC(ch) && (GET_LEVEL(ch) < LVL_IMMORT)) GET_MOVE(ch) -= DRAG_MOVE_COST; obj_from_room(corpse); obj_to_room(corpse, ch->in_room); act("You drag $p with you.", FALSE, ch, corpse, NULL, TO_CHAR); act("$n drags $p with $m.", FALSE, ch, corpse, NULL, TO_ROOM); } } } } +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/10/01 PDT