SMAUG Hometown and Nations Module (v2.2)
=======================================
http://www.crimsonblade.org/snippets/

Disclaimer
==========

This code has been tested on a heavily modified version
of SMAUG 1.4a, there is no guarentee that it will work
on your copy, and I retain no responcibilty if this code
does anything to your code, your game, or the system it's
running on.

Terms of Use
============

(1) All comments and headers must be left in place.
(2) If you find a bug in the code, please report it to the
    SMAUG MAILING LIST (smaug@realms.game.org) and/or directly
    to myself: noplex@crimsonblade.org
(3) You MUST abide by the license; found in the included license.txt
    or on the website (http://www.crimsonblade.org/snippets/)

Overview
========

This is the second release of my hometown snippet; the first release was
a ported version of an old MERC snippet. The first release was roughly a
year and a half from this release. I figured it was about time to update
the tables a bit ;).

This release includes a full editable online Hometown table; it also includes
some MOBprogs to allow mobs to 'citizen' and 'de-citizen' characters if they
wish to become part of a hometown.

Also included is an updated module of my Nations code from CbC; which (right
now) does almost nothing except make a note of a Nation; Nation leader; and
applys that to a hometown.

Future Releases
===============

The next release (which isn't far away) will include a full 'rank-list' system
for the nations.

A 'rank-list' system allows a nation leader to appoint persons to positions they
create in their nation. Each nation is saved in a seperate file; and all of the
rank-list positions will be saved in each file. This will help diversifiy the
roleplay aspect of Nations on my own game; and hopefully others if they wish to
include it.

Instructions
============

(1) mud.h

 Find: #define LEVEL_AVATAR               (MAX_LEVEL - 15)
 Add (under): #include "hometowns.h" /* nations and hometowns module 7/2/02 -Nopey */

 Find: sh_int              lt_index;
 Under that add:
    HOMETOWN_DATA *     hometown;
    NATION_DATA   *     nation;
    int                 htown_vnum;
    int                 nation_vnum;

 Find: SUB_TIMER_DO_ABORT = 128
 Before that, add: SUB_HTOWN_DESC, SUB_NATION_DESC,

 Find /* tables */
 Below that, if don't you see:
  int                     MAX_PC_CLASS;
  int                     MAX_PC_RACE;
 Add it.

(2) comm.c

 Find: mail_count(ch);
 Add (under):
  /* update hometowns and nations -Nopey */
  update_char_hometown(ch);

(3) db.c

 Find:
    log_string("Building wizinfo");
    build_wizinfo();
 Add (under):
    /* Load Hometowns  (5/17/01)        -Nopey */
    log_string("Loading Hometowns...");
    load_hometowns();

    /* Load Nations 4/2/02             -Nopey */
    log_string("Loading Nations...");
    load_nations();

 Find: STRFREE( ch->pcdata->filename   );
 Add (under):
       if(ch->pcdata->hometown)
        ch->pcdata->hometown = NULL;
       if(ch->pcdata->nation)
        ch->pcdata->nation   = NULL;
(4) save.c

 Find: fprintf( fp, "Council2     %s~\n",    ch->pcdata->council_name );
 Add (under):
  if(ch->pcdata->hometown && (ch->pcdata->htown_vnum > -1))
   fprintf(fp, "Hometown        %d\n", ch->pcdata->htown_vnum);
  if(ch->pcdata->nation && (ch->pcdata->nation_vnum > -1))
   fprintf(fp, "Nation          %d\n", ch->pcdata->nation_vnum);

 Find: ch->morph                           = NULL;
 Add (under):
    ch->pcdata->hometown                = NULL;
    ch->pcdata->nation                  = NULL;
    ch->pcdata->htown_vnum              = -1;
    ch->pcdata->nation_vnum             = -1;

 Find: ch->pcdata->wizinvis            = 0;
 Add (under):
    ch->pcdata->hometown            = NULL;
    ch->pcdata->nation              = NULL;
    ch->pcdata->nation_vnum         = -1;
    ch->pcdata->htown_vnum          = -1;

 Find: KEY( "Hitroll",     ch->hitroll,            fread_number( fp ) );
 Add (under):
  KEY( "Hometown", ch->pcdata->htown_vnum, fread_number(fp));

 Find: KEY ("Name", ch->name, fread_string( fp ) );
 Add (under):
  KEY ("Nation", ch->pcdata->nation_vnum, fread_number(fp));

(5) If your not using BSD [http://www.alsherok.net] then you will have to
    add the commands to the correct places in tables.c

    You must add commands for:
     do_nations
     do_hometowns
     do_editnation
     do_edithometown
     do_makenation
     do_makehometown
     do_destroynation
     do_destroyhometown
     do_mpmakecitizen
     do_mprevokecitizen

     This includes for cedit also.

(6) Add the nations.lst file into the /nations/ directory ABOVE the /areas/ directory
    Add hometowns.dat into the /system/ directory

(7) Make clean, recompile.

Bugs
====

If you find any bugs, please report them to either my email (below) or the
Smaug Mailing List (smaug@realms.game.org)

Noplex, Implementor of Crimson Blade
http://www.crimsonblade.org
jbellone@comcast.net


