/
roa/
roa/lib/boards/
roa/lib/config/
roa/lib/edits/
roa/lib/help/
roa/lib/misc/
roa/lib/plrobjs/
roa/lib/quests/
roa/lib/socials/
roa/lib/www/
roa/lib/www/LEDSign/
roa/lib/www/LEDSign/fonts/
roa/lib/www/LEDSign/scripts/
roa/src/s_inc/
roa/src/sclient/
roa/src/sclient/binary/
roa/src/sclient/text/
roa/src/util/
/************************************************************************
	Realms of Aurealis 		James Rhone aka Vall of RoA

races.c					Code related to runtime initialization
					of races... usually determined before
					classes...

		******** 100% Completely Original Code ********
		*** BE AWARE OF ALL RIGHTS AND RESERVATIONS ***
		******** 100% Completely Original Code ********
		        All rights reserved henceforth. 

    Please note that no guarantees are associated with any code from
Realms of Aurealis.  All code which has been released to the general
public has been done so with an 'as is' pretense.  RoA is based on both
Diku and CircleMUD and ALL licenses from both *MUST* be adhered to as well
as the RoA license.   *** Read, Learn, Understand, Improve ***
*************************************************************************/
#include "conf.h"
#include "sysdep.h"

#include "structures.h"
#include "utils.h"
#include "comm.h"
#include "db.h"
#include "interpreter.h" 
#include "acmd.h"
#include "magic.h"
#include "handler.h"
#include "nature.h"
#include "affect.h"
#include "lists.h"
#include "darkenelf.h"
#include "global.h"

// return -1 if race not found in rcarray
int get_race_by_name(char *arg)
{
  int i;

  for (i = 1; i <= NUM_RACES; i++)
    if (is_abbrev(arg, rcarray[i].race_name))
      return i;

  return -1;
}

// fill this slot of rcarray with this info  
void fill_race(int cnum, char *cname, char *racial, char *mleg, char *fleg, char *title, 
               int str, int stradd, int intel, int wis, int dex, int con, int def_lang)
{
  strcpy(rcarray[cnum].race_name, cname);
  strcpy(rcarray[cnum].racial_string, racial);
  strcpy(rcarray[cnum].male_legend, mleg);
  strcpy(rcarray[cnum].female_legend, fleg);
  strcpy(rcarray[cnum].default_title, title);
  rcarray[cnum].str = str;
  rcarray[cnum].stradd = stradd;
  rcarray[cnum].intel = intel;
  rcarray[cnum].wis = wis;
  rcarray[cnum].dex = dex;
  rcarray[cnum].con = con;
  rcarray[cnum].lang = def_lang;
}

// allow a class to be a particular race (or vice versa)
void class_to_race(int rnum, int class)
{
  rcarray[rnum].race_allow[class] = 1;
}

// add a skill to a particular race... 
void skill_to_race(int cnum, int skl, BOOL innate, BOOL learnable, int minlevel)
{
  rcarray[cnum].skills[skl].innate    = innate;
  rcarray[cnum].skills[skl].learnable = learnable;
  rcarray[cnum].skills[skl].minlevel  = minlevel;
}

// fill races with meaningful default data  7/9/98 -jtrhone
void init_races(void)
{
  int c, i;

  fill_race(0, "UNDEFINED", "---", "------", "------", "the newbie somethin or other.", 
            0, 0, 0, 0, 0, 0, LANG_COMMON);

  for (c = 1; c <= NUM_RACES; c++)
  {
    fill_race(c, "", "---", "------", "------", "the newbie somethin or other.", 
              0, 0, 0, 0, 0, 0, LANG_COMMON);

    for (i = 0; i < MAX_SKILLS; i++)
      skill_to_race(c, i, FALSE, FALSE, LEV_IMM);

    for (i = 0; i < NUM_CLASSES+1; i++)
      rcarray[c].race_allow[i] = 0;
  }
}

void assign_races(void)
{
  init_races();

  fill_race(RACE_HUMAN, "human",  "human", "human ", "human ", "the newbie human", 
            0, 0, 0, 0, 0, 0, LANG_COMMON);
  class_to_race(RACE_HUMAN, CLASS_MAGE);
  class_to_race(RACE_HUMAN, CLASS_CLERIC);
  class_to_race(RACE_HUMAN, CLASS_THIEF);
  class_to_race(RACE_HUMAN, CLASS_WARRIOR);
  class_to_race(RACE_HUMAN, CLASS_SHAMAN);
  class_to_race(RACE_HUMAN, CLASS_RANGER);
  class_to_race(RACE_HUMAN, CLASS_BARD);
  class_to_race(RACE_HUMAN, CLASS_MONK);
  class_to_race(RACE_HUMAN, CLASS_MADEPT);
  class_to_race(RACE_HUMAN, CLASS_DRUID);

  fill_race(RACE_ELF, "elf", "elven", "elf ", "elf ", "the newbie elf", 
            -1,  0,  1,  1,  1, -1, LANG_ELVEN);
  class_to_race(RACE_ELF, CLASS_MAGE);
  class_to_race(RACE_ELF, CLASS_CLERIC);
  class_to_race(RACE_ELF, CLASS_THIEF);
  class_to_race(RACE_ELF, CLASS_WARRIOR);
  class_to_race(RACE_ELF, CLASS_RANGER);
  class_to_race(RACE_ELF, CLASS_BARD);
  class_to_race(RACE_ELF, CLASS_WARLOCK);
  class_to_race(RACE_ELF, CLASS_MADEPT);
  class_to_race(RACE_ELF, CLASS_DRUID);

  fill_race(RACE_HALF_ELF, "half-elf", "half-elven", "h-elf ", "h-elf ", "the newbie half-elf", 
             0,  0,  1,  0,  1, -1, LANG_ELVEN);
  class_to_race(RACE_HALF_ELF, CLASS_MAGE);
  class_to_race(RACE_HALF_ELF, CLASS_CLERIC);
  class_to_race(RACE_HALF_ELF, CLASS_THIEF);
  class_to_race(RACE_HALF_ELF, CLASS_WARRIOR);
  class_to_race(RACE_HALF_ELF, CLASS_RANGER);
  class_to_race(RACE_HALF_ELF, CLASS_BARD);
  class_to_race(RACE_HALF_ELF, CLASS_WARLOCK);
  class_to_race(RACE_HALF_ELF, CLASS_MADEPT);
  class_to_race(RACE_HALF_ELF, CLASS_DRUID);

  fill_race(RACE_ORC, "orc",    "orcish", "orc   ", "orc   ", "the newbie orc", 
            1,  0, -1, -2,  0,  2, LANG_ORCISH);
  class_to_race(RACE_ORC, CLASS_THIEF);
  class_to_race(RACE_ORC, CLASS_WARRIOR);
  class_to_race(RACE_ORC, CLASS_SHAMAN);
  class_to_race(RACE_ORC, CLASS_WARLOCK);

  fill_race(RACE_OGRE, "ogre",   "ogre", "ogre  ", "ogre  ", "the newbie ogre", 
             2, 20, -2, -2, -1,  3, LANG_OGRE);
  class_to_race(RACE_OGRE, CLASS_WARRIOR);
  class_to_race(RACE_OGRE, CLASS_SHAMAN);
  class_to_race(RACE_OGRE, CLASS_RANGER);

  fill_race(RACE_DROW, "drow",   "drow", "drow  ", "drow  ", "the newbie drow", 
            -2,  0,  2,  1,  0, -1, LANG_DROW);
  class_to_race(RACE_DROW, CLASS_MAGE);
  class_to_race(RACE_DROW, CLASS_CLERIC);
  class_to_race(RACE_DROW, CLASS_THIEF);
  class_to_race(RACE_DROW, CLASS_WARRIOR);
  class_to_race(RACE_DROW, CLASS_BARD);
  class_to_race(RACE_DROW, CLASS_WARLOCK);
  class_to_race(RACE_DROW, CLASS_MADEPT);
  class_to_race(RACE_DROW, CLASS_DRUID);

  fill_race(RACE_DWARF, "dwarf",  "dwarven", "dwarf ", "dwarf ", "the newbie dwarf", 
             1,  0, -1,  0, -1,  1, LANG_DWARVEN);
  class_to_race(RACE_DWARF, CLASS_CLERIC);
  class_to_race(RACE_DWARF, CLASS_THIEF);
  class_to_race(RACE_DWARF, CLASS_WARRIOR);
  class_to_race(RACE_DWARF, CLASS_MONK);

  fill_race(RACE_PIXIE, "pixie",  "pixish", "pixie ", "pixie ", "the newbie pixie", 
            -3,  0,  1,  0,  3, -2, LANG_IXISH);
  class_to_race(RACE_PIXIE, CLASS_MAGE);
  class_to_race(RACE_PIXIE, CLASS_CLERIC);
  class_to_race(RACE_PIXIE, CLASS_THIEF);
  class_to_race(RACE_PIXIE, CLASS_WARRIOR);
  class_to_race(RACE_PIXIE, CLASS_RANGER);
  class_to_race(RACE_PIXIE, CLASS_BARD);
  class_to_race(RACE_PIXIE, CLASS_WARLOCK);

  fill_race(RACE_NIXIE, "nixie",  "nixish", "nixie ", "nixie ", "the newbie nixie", 
            -3,  0,  1,  0,  3, -2, LANG_IXISH);
  class_to_race(RACE_NIXIE, CLASS_MAGE);
  class_to_race(RACE_NIXIE, CLASS_CLERIC);
  class_to_race(RACE_NIXIE, CLASS_THIEF);
  class_to_race(RACE_NIXIE, CLASS_WARRIOR);
  class_to_race(RACE_NIXIE, CLASS_RANGER);
  class_to_race(RACE_NIXIE, CLASS_WARLOCK);

  fill_race(RACE_DRAGON, "drakyn", "drakyn", "drakyn", "drakyn", "the newbie drakyn", 
             2, 10,  1,  1, -2,  2, LANG_DRAGON);
  class_to_race(RACE_DRAGON, CLASS_CLERIC);
  class_to_race(RACE_DRAGON, CLASS_WARRIOR);

}