do_skin

Posted by Joeyfogas on Sun 09 May 2010 01:52 PM — 4 posts, 15,271 views.

#0
i couldnt find exactly what i was looking for so i made this post....

i am using smaugfuss 1.9 and i wanted to change skin to decapitate... well i went in the do_skin and changed a couple things (still left he skin code, just changed the messages to decapitate and the name of the do_command)

well it works like i want it to except for one thing.. you can constantly decapitate (skin) the same corpse. Is there any way to prevent a player from doing that once the corpse has already been decapitated (skinned)

below is the copy of the code..



void do_decap( CHAR_DATA* ch, const char* argument)
{
   OBJ_DATA *korps;
   OBJ_DATA *corpse;
   OBJ_DATA *obj;
   OBJ_DATA *skin;
   bool found;
   const char *name;
   char buf[MAX_STRING_LENGTH];
   found = FALSE;

   if( !IS_PKILL( ch ) && !IS_IMMORTAL( ch ) )
   {
      send_to_char( "Leave the hideous defilings to the killers!\n", ch );
      return;
   }
   if( argument[0] == '\0' )
   {
      send_to_char( "Whose corpse do you wish to decapitate?\r\n", ch );
      return;
   }
   if( ( corpse = get_obj_here( ch, argument ) ) == NULL )
   {
      send_to_char( "You cannot find that here.\r\n", ch );
      return;
   }
   if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL )
   {
      send_to_char( "You cannot find that here.\r\n", ch );
      return;
   }
   if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL )
   {
      send_to_char( "You have no weapon with which to perform this deed.\r\n", ch );
      return;
   }

   if( corpse->item_type != ITEM_CORPSE_PC )
   {
      send_to_char( "You can only decapiate the bodies of player characters.\r\n", ch );
      return;
   }

   if( obj->value[3] != 1 && obj->value[3] != 2 && obj->value[3] != 3 && obj->value[3] != 11 )
   {
      send_to_char( "There is nothing you can do with this corpse.\r\n", ch );
      return;
   }
   if( get_obj_index( OBJ_VNUM_SKIN ) == NULL )
   {
      bug( "Vnum %d (OBJ_VNUM_SKIN) not found for do_decap!", OBJ_VNUM_SKIN );
      return;
   }
   korps = create_object( get_obj_index( OBJ_VNUM_CORPSE_PC ), 0 );
   skin = create_object( get_obj_index( OBJ_VNUM_SKIN ), 0 );
   name = IS_NPC( ch ) ? korps->short_descr : corpse->short_descr;
   snprintf( buf, MAX_STRING_LENGTH, skin->short_descr, name );
   STRFREE( skin->short_descr );
   skin->short_descr = STRALLOC( buf );
   act( AT_BLOOD, "$n decapitates the head from $p.", ch, corpse, NULL, TO_ROOM );
   act( AT_BLOOD, "You decapitate the head from $p.", ch, corpse, NULL, TO_CHAR );
/*
  act( AT_MAGIC, "\nThe headless corpse is dragged through the ground by a strange force...", ch, corpse, NULL, TO_CHAR);
    act( AT_MAGIC, "\nThe headless corpse is dragged through the ground by a strange force...", ch, corpse, NULL, TO_ROOM);
    extract_obj( corpse );
*/

   obj_to_char( skin, ch );
   return;
}
Amended on Sun 09 May 2010 09:14 PM by Nick Gammon
#1
also, i do realize i have it so i can decap (skin) mobiles. this is essential to a monster hunt feature i am wanting to impliment
Australia Forum Administrator #2
You created a new object here:


korps = create_object( get_obj_index( OBJ_VNUM_CORPSE_PC ), 0 );


But you don't put it anywhere (like in the room). Also you don't remove the old object from the room, so it is still there.

These lines (which you commented out) remove the corpse after decapitating. Without them, the corpse stays there so you still see it.


/*
  act( AT_MAGIC, "\nThe headless corpse is dragged through the ground by a strange force...", ch, corpse, NULL, TO_CHAR);
    act( AT_MAGIC, "\nThe headless corpse is dragged through the ground by a strange force...", ch, corpse, NULL, TO_ROOM);
    extract_obj( corpse );
*/
#3
appreciate the speedy response.. i didnt want the corpse to disapperar, as that would destrow all EQ on player body lol. i did find a work-around though. i just put an ifcheck on the item value and changed it after the decap. so it only allowed for the one decap.

:) really glad to see that someone is still active on here though, i havent Mudded in a while and wasnt sure if anyone was still into oldschool.

again, i appreciate it :) any more concers i'll be sure to come here.