Impale Code by Kracus v1.1 Please leave my credits above the do_impale if you choose to use or modify my code for your mud. I included two versions of do_impale with one needing a pike item and one not needing a pike. This version is the simple version, while the mud I code has a more advanced one...the code does not affect corpse timers or objects inside corpses. You can even get objects from an impaled corpse, and you can impale non-empty corpses. The Pike is defined in merc.h but you can always change that part to just not be hard coded to source and check for weapon_types. I do change the v1 v2 so the corpse cannot be impaled twice so str_dup does not add onto a previous str_dupped impaled corpse. Do not forget to add your do_impale into interp.c and interp.h and if you use the OBJ_VNUM_PIKE add that into merc.h and put the pike object into limbo.are..... #define OBJ_VNUM_PIKE 66 #66 pike~ a bloodied pike~ A bloodied pike lies here on the ground.~ steel~ weapon TY AN polearm 2 4 pierce 0 6 1 1000 P Have fun, Kracus the Impaler // Impale Command by Kracus // Impale corpses with the need for the ch to be // carrying a pike in their inventory to impale // either a corpse_npc or a corpse_pc in the room // Syntax: impale corpse pike void do_impale( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; OBJ_DATA *corpse; OBJ_DATA *pike; argument = one_argument(argument, arg); argument = one_argument(argument, arg2); if (arg[0] == '\0') { send_to_char( "Impale what corpse?\n\r", ch ); return; } if (arg2[0] == '\0') { send_to_char( "Impale the corpse with what?\n\r", ch ); return; } corpse = get_obj_list(ch, arg, ch->in_room->contents); pike = get_obj_list(ch, arg2, ch->carrying); if (corpse == NULL) { send_to_char( "You can't find it.\n\r", ch ); return; } // if (corpse->item_type == ITEM_CORPSE_PC || corpse->item_type == ITEM_CORPSE_NPC) // { // if (corpse->contains) // { // send_to_char( "You cannot impale the corpse, because it is not empty.\n\r",ch); // return; // } // } if ((pike = get_obj_carry(ch, arg2, ch)) == NULL || (pike->pIndexData->vnum != OBJ_VNUM_PIKE)) { send_to_char( "You are not carrying a pike to impale the corpse with...\n\r", ch ); return; } // Kracus- its important to keep this next part in the right order // or the act msgs and str_dup will not be correct. // Setting v1 v2 so we can determine if the corpse has // already been impaled so we dont str_dup again... if (corpse->in_room != NULL) { if (corpse->item_type == ITEM_CORPSE_PC || corpse->item_type == ITEM_CORPSE_NPC) { if (corpse->value[1] != 9 && corpse->value[2] != 1) { act( "{rYou impale $p onto a bloodied pike for all to see.{x", ch, corpse, 0, TO_CHAR ); act( "{r$n impales $p onto a bloodied pike for all to see.{x", ch, corpse, NULL, TO_ROOM ); wiznet( "{r$N impales $p onto a bloodied pike for all to see.{x", ch, corpse, WIZ_SACCING, 0, 0 ); // Kracus- str_dup needs to come after the acts, // so it sends the right obj descr to act. sprintf( buf, "Dripping {rblood{x, %s lies here {rimpaled{x by %s.", corpse->short_descr, ch->name ); free_string(corpse->description); corpse->description = str_dup(buf); sprintf( buf, "%s impaled upon a bloodied pike by %s", corpse->short_descr, ch->name ); free_string(corpse->short_descr); corpse->short_descr = str_dup(buf); corpse->value[1] = 9; corpse->value[2] = 1; if (pike != NULL && pike->pIndexData->vnum == OBJ_VNUM_PIKE) extract_obj(pike); return; } else { send_to_char( "That corpse has already been impaled upon a bloodied pike.\n\r", ch ); return; } } else { send_to_char( "You can only impale corpses.\n\r", ch ); return; } } } /* // Impale Command by Kracus // Impale corpses with no need for a Pike object // Syntax: impale corpse void do_impale( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; OBJ_DATA *obj; one_argument(argument, arg); if (arg[0] == '\0') { send_to_char( "You cannot impale yourself!\n\r", ch ); return; } obj = get_obj_list(ch, arg, ch->in_room->contents); if (obj == NULL) { send_to_char( "You can't find it.\n\r", ch ); return; } // if (obj->item_type == ITEM_CORPSE_PC || obj->item_type == ITEM_CORPSE_NPC) // { // if (obj->contains) // { // send_to_char( "You cannot impale the corpse, because it is not empty.\n\r",ch); // return; // } // } // Kracus- its important to keep this next part in the right order // or the act msgs and str_dup will not be correct. // Setting v1 v2 so we can determine if the corpse has // already been impaled so we dont str_dup again... if (obj->in_room != NULL) { if (obj->item_type == ITEM_CORPSE_PC || obj->item_type == ITEM_CORPSE_NPC) { if (corpse->value[1] != 9 && corpse->value[2] != 1) { act( "{rYou impale $p onto a bloodied pike for all to see.{x", ch, obj, 0, TO_CHAR ); act( "{r$n impales $p onto a bloodied pike for all to see.{x", ch, obj, NULL, TO_ROOM ); wiznet("{r$N impales $p onto a bloodied pike for all to see.{x", ch,obj,WIZ_SACCING,0,0); // Kracus- str_dup needs to come after the acts, // so it sends the right obj descr to act. sprintf( buf, "Dripping {rblood{x, %s lies here {rimpaled{x by %s.", obj->short_descr, ch->name ); free_string(obj->description); obj->description = str_dup(buf); sprintf( buf, "%s impaled upon a bloodied pike by %s", obj->short_descr, ch->name ); free_string(obj->short_descr); obj->short_descr = str_dup(buf); corpse->value[1] = 9; corpse->value[2] = 1; return; } else { send_to_char( "That corpse has already been impaled upon a bloodied pike.\n\r", ch ); return; } } else { send_to_char( "You can only impale corpses.\n\r", ch ); return; } } } */