## Code: by Ranka
## MUD : telnet carlnet.ee 4242
## Mail: rainer_roomet@hotmail.com (also MSN)
## Idea: From MUME (telnet mume.pvv.org 23)
## Credits: No need ANY credit
## Code Tested: About 2 years
## Snippet Installation Tested: Nope
## Example:
## Conditions: Player named as 'Baldors' died and Corpse is same room
## as I am.

> scalp corpse
You attempt to scalp the corpse of Baldors.
You get the scalp of Baldors from corpse.

> inventory
     the scalp of Baldors

## It's good for PK MUDs. Some players start collectict scalps and it was great
## to get all.scalp sack, if you see about 100 scalps received from PK!
## Also you can do different quests - you have to bring atleast 10 player scalps
## to Orkish Shaman then he will give you some great Quest Items.

# Open: fight.c
# Find: void make_corpse( CHAR_DATA *ch )
# Find the following code: 
#     else  /* player corpses */
#     {
#	corpse		= create_object(get_obj_index(OBJ_VNUM_CORPSE_PC));
# Add after that:

       corpse->raceowner = str_dup(pc_race_table[ch->race].name);

# Close: fight.c
# Open: recycle.c
# Find: void free_obj(OBJ_DATA *obj)
# Find: free_string( obj->name        );
# Add after that:

free_string( obj->raceowner        );

# Close: recycle.c
# Open : act_obj.c
# Add the following to somewherE:

void do_scalp( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    char *name;
    char *name2;
    OBJ_DATA *corpse;
    OBJ_DATA *scalp;
    OBJ_DATA *corpse2;


    one_argument( argument, arg );

    if (arg[0] == '\0')
    {
       send_to_char( "Scalp what corpse?\n\r", ch );
       return;
    }

    corpse = get_obj_list(ch, arg, ch->in_room->contents);

    if ( corpse == NULL )
    {
	send_to_char( "You can't find it.\n\r", ch );
	return;
    }


    if ( corpse->item_type == ITEM_CORPSE_NPC)
    {
	send_to_char("Scalping mobiles?! Huh! What's that?\n\r", ch);
	return;
    }
    if ( corpse->item_type == ITEM_CORPSE_SCALPED)
    {
       send_to_char("Cannot scalp that.\n\r",ch);
       return;
    }

    if ( corpse->item_type == ITEM_CORPSE_PC )
    {
	if (corpse->contains)
        {
	   send_to_char("You can't scalp unlooted corpses!\n\r",ch);
	   return;
        }
    }
    
    scalp	= create_object(get_obj_index(OBJ_VNUM_SCALP));
    corpse2	= create_object(get_obj_index(OBJ_VNUM_SCALPED_CORPSE));
	
    act("You attempt to scalp $p.", ch, corpse, NULL, TO_CHAR);
    act("$n attempts to scalp $p.", ch, corpse, NULL, TO_ROOM);

    name = corpse->owner;
    name2 = corpse->raceowner;

	   /* name for scalped corpses */
    	   sprintf( buf, corpse2->short_descr, name2 );
    	   free_string( corpse->short_descr );
   	   corpse->short_descr = str_dup( buf );

  	   sprintf( buf, corpse2->description, name2 );
   	   free_string( corpse2->description );
   	   corpse2->description = str_dup( buf );

       	   /* name for scalps */
           sprintf( buf, scalp->name, name );
    	   free_string( scalp->name );
   	   scalp->name = str_dup( buf );

       	   sprintf( buf, scalp->short_descr, name );
	   free_string( scalp->short_descr );
   	   scalp->short_descr = str_dup( buf );
	
           act("You get $p from corpse.", ch, scalp, NULL, TO_CHAR);
	   act("$n takes $p from corpse.",ch, scalp, NULL, TO_ROOM);
                
           extract_obj(corpse);
   	   obj_to_room(corpse2, ch->in_room);
           corpse2->timer = 20;
           obj_to_char(scalp, ch);
	   return;
    
}

# Close: act_obj.c
# Open: interp.c and interp.h
# Make: command named as do_scalp
# close interp.c and interp.h
# Make two new objects, for example:

Area:         [0] Limbo
Last Editor:  [Ranka]
Vnum:         [   26]
Name:         [scalp %s]
Short desc:   [the scalp of %s]
Long desc:    [The bloody scalp of is lying here.]
Material:     [undefined]
Type:         [food]
Food hours    [v0]: [0]
Full hours    [v1]: [0]
Poisoned      [v2]: [Yes]
Wear flags:   [take onbelt]
Extra flags:  [none]
Condition:    [0%]
Weight:       [0]
Cost:         [0 copper (0 copper pennies)]
Allowed:      [Unlimited]


Area:         [0] Limbo
Last Editor:  [None]
Vnum:         [   27]
Name:         [corpse]
Short desc:   [the scalped corpse of %s]
Long desc:    [The scalped corpse of %s is lying here.]
Material:     [undefined]
Type:         [scalped_corpse]
Wear flags:   [take]
Extra flags:  [nopurge]
Condition:    [25%]
Weight:       [124]
Cost:         [0 copper (0 copper pennies)]
Allowed:      [Unlimited]

#Now open the merc.h
#And define these two objects:

#define OBJ_VNUM_SCALP			26 // OBJ SCALP VNUM!
#define OBJ_VNUM_SCALPED_CORPSE		27 // OBJ SCALPED CORPSE VNUM!

# Close the files
# Make Clean, ReCompile, ReRun. Slay some tesplayer, type 'SCALP CORPSE'
# And check!
# You have to received object named as: "the scalp of <YourTestCharacterName>