Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ do_skin

do_skin

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Joeyfogas   (41 posts)  Bio
Date Sun 09 May 2010 01:52 PM (UTC)

Amended on Sun 09 May 2010 09:14 PM (UTC) by Nick Gammon

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

Posted by Joeyfogas   (41 posts)  Bio
Date Reply #1 on Sun 09 May 2010 01:57 PM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 09 May 2010 09:17 PM (UTC)
Message
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 );
*/

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Joeyfogas   (41 posts)  Bio
Date Reply #3 on Sun 09 May 2010 11:59 PM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,789 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.