-----------------------------------------------------------------
SMAUG Book of Blood 1.0 By Chaos (Released August 17, 1999)
      Written By: Jeff Polser
      Date:  August 15, 1999
      Email: jeffpolser@home.com
-----------------------------------------------------------------

Book of Blood allows a player to to change their Pkill status once
they have already started by going into a room and paying a hefty
free.  A useful command if you want to allow players to change
their status and don't want them bugging immortals to get it.  Only
note on this version, it uses a room flag instead of an object
flag, so if you are running out of room flags, you might want to
change this to an object flag and write a bit more code for it
(Please do not contact Jeff or I about it, if it is changed, a
 new version will be posted).  That is all, so here it is.

-----------------------------------------------------------------

Files Needed:  mud.h build.c tables.c act_obj.c

-----------------------------------------------------------------

/*******************************************************************************
 *      BBBB                            BBB     BBBB  B                        *
 *      B   B  BBB   BBB  B B     BBB  B        B   B B  BBB   BBB  BBBB       *
 *      BBBB  B   B B   B BB     B   B BBBB     BBBB  B B   B B   B B   B      *
 *      B   B B   B B   B B B    B   B B        B   B B B   B B   B B   B      *
 *      BBBB   BBB   BBB  B  B    BBB  B        BBBB  B  BBB   BBB  BBBB       *
 *******************************************************************************/

 /*
      Written By: Jeff Polser
      Date:  August 15, 1999
      Email: jeffpolser@home.com
 */


//You can use this snippet as long as you give credit to me somewhere
//on your mud.  If you dont, then just be a nad. =)


 
//Instructions:

/*

1.  Mud.h:

    With the other room bitvectors(Around Line 1450) add:

    #define ROOM_BLOODROOM BVXX
    ***Put a number in place of XX

    Goto all of the other DECLARE_DO_FUN and add:

    DECLARE_DO_FUN (do_book);

2.  Build.c:

    In
        char *	const	r_flags	[] =

    Add "bloodroom" in the corresponding spot to the BV in mud.h

    **Meaning if bloodroom after prototype in mud.h, it needs
    to be after prototype in build.c**

3.  Tables.c:

    Under:  if ( !str_cmp( name, "do_bodybag" ))     return do_bodybag;
    Add: if ( !str_cmp( name, "do_book" ))     return do_book;

    Under: if ( skill == do_bodybag )     return "do_bodybag";
    Add: if ( skill == do_book )     return "do_book";

4.  Place the Following code in act_obj.c (well anywhere will work)
    After you have done so, make clean and recompile.
    Then add the command to the game (using the cedit commands below)

    cedit book create do_book
    cedit book level 1
    cedit save cmdtable



*******START OF CODE**********


   */

void do_book( CHAR_DATA *ch, char *argument )
{
   int cost; /* Cost to change */

 if ( argument[0] == '\0' )
    {
        send_to_char("&RSyntax: book sign\n\r", ch);
        send_to_char("&RSyntax: book erase\n\r", ch);
        send_to_char("&RSee &YHELP BOOK &Rfor more info.\n\r", ch);
        return;
    }


 if ( IS_SET(ch->in_room->room_flags, ROOM_BLOODROOM) )
   {


 if ( !str_cmp( argument, "sign" ) )
    {
        if ( get_age( ch ) < 18 )
        {
           send_to_char("&rYou are too young to be a Player Killer.\n\r", ch);
        }

           else
           {

              if ( CAN_PKILL ( ch ) )
              {
              send_to_char("&rYou are already a Player Killer!\n\r", ch);
              }
                 else
                 {
        		     send_to_char("&rYou sign your name in the Book of Blood.\n\r", ch);
        		     send_to_char("&rYou are now a Player Killer!\n\r", ch);
                 SET_BIT(ch->pcdata->flags, PCFLAG_DEADLY);
	              xREMOVE_BIT(ch->act, PLR_NICE);
        		     save_char_obj( ch );
        		     saving_char = NULL;
        		     send_to_char( "&rSaving %s.\n\r", ch, ch );
        		     send_to_char( "&rDone.\n\r", ch );
                 }
           }
    return;
    }


  if ( !str_cmp( argument, "erase" ) )
     {

     		if ( !CAN_PKILL ( ch ))
         {
         send_to_char( "&rYou are already peaceful!\n\r", ch );
         return;
         }

         else
         {

            if( ch->gold < cost)
              {
                send_to_char( "&rYou do not have enough money to erase your name!\n\r", ch);
                return;
              }

             else
             {

        		  ch->gold -= cost;
         	  REMOVE_BIT(ch->pcdata->flags, PCFLAG_DEADLY );
	      	  xSET_BIT(ch->act, PLR_NICE);
         	  send_to_char( "&rYou are now a peaceful player.\n\r", ch);
         	  save_char_obj( ch );
        	 	  saving_char = NULL;
       	     send_to_char( "&rSaving %s.\n\r", ch, ch );
        		  send_to_char( "&rDone.\n\r", ch );
         	 }

         }

     return;
     }

  return;
  }
    else
    {
    send_to_char( "&rYou can't sign that!\n\r", ch );
    }
}



******END OF CODE********
