Posted by
| Robert Powell
Australia (367 posts) Bio
|
Message
| The skill do_skin is in skills.c, if you dont have it, here is the code for it, it doesnt need many changed to make it skin mobs.
void do_skin( CHAR_DATA *ch, char *argument)
{
OBJ_DATA *korps;
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_NPC )
{
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;
}
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;
sprintf( buf, skin->short_descr, name );
STRFREE( skin->short_descr );
skin->short_descr = STRALLOC( buf );
sprintf( buf, skin->description, 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 dragged through the ground by a strange force...", ch, corpse, NULL, TO_CHAR);
act( AT_MAGIC, "\nThe skinless corpse is dragged through the ground by a strange force...", ch, corpse, NULL, TO_ROOM);
extract_obj( corpse );
obj_to_char( skin, ch );
return;
}
Dont forget to make the required entries in tables.c and mud.h, and then, when cleaned and made, cedit the command.
As for what file to put your baking command in, it is realy a matter of choice, tho, as it is a skill(if your making it a skill that a class receives) and not a command, you could put it in skills.c with all the other skills.
On the other hand, if your going to be making a lot of new skills that are all related, (baking, fishing, mining, chop_trees_down, ect) you might want to start a new C file, crafting.c where all the crafting related skills are kept. Ultimately its up to you to place the functions in a place that is easy to find them later. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|