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;
}
|