/***************************************************************************  
 *                          SMAUG Banking Support Code                     *
 ***************************************************************************
 *                                                                         *
 * This code may be used freely, as long as credit is given in the help    *
 * file. Thanks.                                                           *
 *                                                                         *
 *                                        -= Minas Ravenblood =-           *
 *                                 Implementor of The Apocalypse Theatre   *
 *                                      (email: krisco7@hotmail.com)       *
 *                                                                         *
 ***************************************************************************/

Modifications to original source by Samson of Alsherok

Terms of Use
------------

1. You may use this snippet in your code provided that any included
comment headers in the code are left intact. You may add your own, but
do not take mine out.

2. This snippet may not be posted for redistribution on any site
without obtaining prior written consent from the Alsherok team.

3. ( optional ) Register with the forums at http://forums.alsherok.net
Registration is not required to make use of the snippet, but since I no
longer provide email support for any of the code I release, forum posts
are your only avenue for direct support. This may seem overly stupid,
but you can blame the continuing abuse I suffer from spammers for this.
Don't post stuff to TMC or TMS asking about my code. I'm highly unlikely
to ever notice it there on the rare ocassions I skim posts in either place.

If forum registration doesn't appeal to you, then you can try to get ahold
of me via IMC on the code channel.

If you can't agree to these terms, don't use this code, and don't expect
me to help if something breaks while installing it. Harsh? Hardly. I'm
tired of people who come crawling to whine and complain when they haven't
bothered to comply with the terms first.

What this code does
-------------------

Simply adds the traditional deposit, withdraw, and balance bank commands.
Uses mobs as bankers by setting the ACT_BANKER flag on them.

Installation Instructions
-------------------------

1. To install this code:
 
   Copy bank.c and bank.h to your src directory. Add bank.c, bank.h
   and bank.o to the appropriate sections in your Makefile.

2. In mud.h, find the pc_data structure, and add the following to it:

   int balance;

   Find the following:
   
   #define LEVEL_HIGOD		    LEVEL_GOD

   and after it add: #include "bank.h"

   find the ACT flags for mobiles, and define
   ACT_BANKER using an available slot.

3. In save.c, function fwrite_char, find the following line:

   fprintf( fp, "Favor	       %d\n",	ch->pcdata->favor	);

  Add the following line below it:

   fprintf( fp, "Balance      %d\n", ch->pcdata->balance );

  Locate function load_char_obj, find the following line:

   ch->pcdata->wizinvis		= 0;

  Add the following line below it:
 
   ch->pcdata->balance = 0;

  Locate function fread_char, find the following line:
   KEY( "Bamfin",	ch->pcdata->bamfin,	fread_string_nohash( fp ) );

   Add the following line above it:

            KEY( "Balance", ch->pcdata->balance, fread_number( fp ) );

4. In build.c, find the act_flags for mobs, and add "banker" in the
   spot corresponding to the new ACT_BANKER flag you defined in mud.h.

5. Make the appropriate additions to tables.c for
   do_balance, do_withdraw, and do_deposit.

6. Add the text from bank.help to your help.are file.

7. Make clean, then recompile.

8. Create commands for balance, deposit, and withdraw.

9. Set the banker flag on a mob of your choice.

If there are any problems with this installation, feel free to post your
question to the forums at http://forums.alsherok.net

This code has been installed and tested on Smaug 1.6 FUSS, which is a bugfixed
and cleaned up version of the base Smaug 1.4a code. The Smaug FUSS Project is
maintained on servers which run the Redhat and Fedora family of Linux. Limited
testing has also been done on the Cygwin package under WindowsXP SP1 and SP2.
Users of BSD, MSVC, MSVC++, or Macintosh platforms are on their own as The
Smaug FUSS Project does not have access to these development environments for testing.
The Smaug FUSS Project can be found at: http://www.smaugfuss.org

No guarantees are made that this code will be compatible with your codebase and any
modifications you may have made to it. No warranty of any kind is expressed or implied
by the use of this code, and we are not responsible for any damages which may result
from the application of this snippet to your codebase.

Adventure beckons in the lands of mystique....
Samson, Implementor of Alsherok
http://www.alsherok.net
telnet://alsherok.net:5500

IMC2 contact: Samson@Alsherok