hey all-
i'm trying to get the skin code to work. I'm having a fair amount of luck, but the one thing i can't figure out (do to my limited coding knowledge) is how to change how the object is described in my inventory. For example, with the following code chunk as it is, if i skin something, it appears in my inventory as
the skin of the corpse of a goblin
what i would like it to say is:
the skin of a goblin
any ideas on how to change it? the code is below.
void do_skin( CHAR_DATA *ch, char *argument)
{
OBJ_DATA *corpse;
OBJ_DATA *obj;
OBJ_DATA *skin;
bool found;
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 skin?\n\r", ch );
return;
}
if ( (corpse=get_obj_here(ch, argument)) == NULL )
{
send_to_char( "You cannot find that here.\n\r", ch );
return;
}
/* if ( (obj=get_eq_char(ch, WEAR_WIELD)) == NULL )
{
send_to_char( "You have no weapon with which to perform this deed.\n\r", ch );
return;
}
if ( corpse->item_type != ITEM_CORPSE_PC )
{
send_to_char( "You can only skin the bodies of player characters.\n\r", 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.\n\r", ch );
return;
} */
if ( get_obj_index( OBJ_VNUM_SKIN ) == NULL )
{
bug( "Vnum 23 (OBJ_VNUM_SKIN) not found for do_skin!", 0);
return;
}
skin = create_object(get_obj_index(OBJ_VNUM_SKIN), 0);
skin->level = number_range( 1, ch->level);
SET_BIT(skin->wear_flags,ITEM_WEAR_ABOUT);
SET_BIT(skin->wear_flags,ITEM_TAKE);
name = corpse->short_descr;
sprintf( buf, skin->short_descr, name );
STRFREE( skin->short_descr );
skin->short_descr = STRALLOC( buf );
sprintf( buf, skin->short_descr, name );
STRFREE( skin->description );
skin->description = STRALLOC( buf );
act( AT_BLOOD, "$n strips the skin from $p.", ch, corpse, NULL, TO_ROOM);
act( AT_BLOOD, "You strip the skin from $p.", ch, corpse, NULL, TO_CHAR);
act( AT_MAGIC, "\nThe skinless corpse is devoured by a horde of shadowy gerbils...", ch, corpse, NULL, TO_CHAR);
act( AT_MAGIC, "\nThe skinless corpse is devoured by a horde of shadowy gerbils...", ch, corpse, NULL, TO_ROOM);
extract_obj( corpse );
obj_to_char( skin, ch );
return;
} |