#include "Avatar.h"
Avatar::Avatar()
{
	Reset();
}
Avatar::~Avatar()
{
}
void Avatar::Reset()
{
	int i = 0;

	sprintf(LastName, "Last");
	sprintf(FirsName, "First");
	sprintf(MiddName, "Middle");

	Sex = 0; Race = MAX_pcRACES; Height = Weight = 0; alignGood = 50; alignLawful = 50;
	sStr = sExStr = sDex = sCon = sInt = sWis = sCha = sCom = 0;
	aStr = aDex = aCon = aInt = aWis = aCha = aCom = 0.0;

	for(i = 0; i < 4; i++)
	{
		avClass[i]		= cMAX_CLASSES;
		avKit[i]		= kitsMaxKits;
		classLvl[i]		= 0;
		//Worse-case scenario for xp...
		avClassXP[i]	= -1250;
	}
	numClasses = numKits = 0;
	ResetWPs();
	ResetNWPs();
	ResetCustom();

	ID_Num = -1;
	worldX = worldY = worldZ = dungeonX = dungeonY = dungeonZ = facing = 0;

	for(i = 0; i < maxBitArray; i++)
		Statuses[i] = 0;
}
const Avatar& Avatar::operator= (const Avatar &other)
{
	int i;
	if(this != &other)
	{
		sprintf(LastName, "%s", other.LastName);
		sprintf(FirsName, "%s", other.FirsName);
		sprintf(MiddName, "%s", other.MiddName);

		sStr	= other.sStr;
		sDex	= other.sDex;
		sCon	= other.sCon;
		sInt	= other.sInt;
		sWis	= other.sWis;
		sCha	= other.sCha;
		sCom	= other.sCom;

		aStr	= other.aStr;
		sExStr	= other.sExStr;
		aDex	= other.aDex;
		aCon	= other.aCon;
		aInt	= other.aInt;
		aWis	= other.aWis;
		aCha	= other.aCha;
		aCom	= other.aCom;
		
		Sex			= other.Sex;
		Race		= other.Race;
		Height		= other.Height;
		Weight		= other.Weight;
		numClasses	= other.numClasses;
		numKits		= other.numKits;

		alignGood	= other.alignGood;
		alignLawful	= other.alignLawful;

		for(i = 0; i < 4; i++)
		{
			avClass[i]		= other.avClass[i];
			classLvl[i]		= other.classLvl[i];
			avKit[i]		= other.avKit[i];
			avClassXP[i]	= other.avClassXP[i];
		}

		for(i = 0; i < cmbtTOTAL_CmbtValues; i++)
			CombatValues[i]	= other.CombatValues[i];
		
		TotalMult	= other.TotalMult;
		SaveAsClass	= other.SaveAsClass;
		
		for(i = 0; i < TOTAL_OptVals; i++)
			OptionalAbilities[i] = other.OptionalAbilities[i];
		
		for(i = 0; i < TOTAL_Restricts; i++)
			Restrictions[i] = other.Restrictions[i];
		
		MaxWeaponSlots	= other.MaxWeaponSlots;
		numWPs			= other.numWPs;

		for(i = 0; i < MAX_WEAPONPRO; i++)
			weaponPros[i] = other.weaponPros[i];
		
		MaxNWPSlots		= other.MaxNWPSlots;
		AllocatedNWPs	= other.AllocatedNWPs;
		
		for(i = 0; i < MAX_NWPs; i++)
			nwp[i] = other.nwp[i];
		
		ID_Num			= other.ID_Num;
		
		worldX			= other.worldX;
		worldY			= other.worldY;
		dungeonX		= other.dungeonX;
		dungeonY		= other.dungeonY;
		dungeonZ		= other.dungeonZ;

		for(i = 0; i < maxBitArray; i++)
			Statuses[i] = other.Statuses[i];
	}//end: if(this != &other)
	return *this;
}
const Avatar* Avatar::operator= (const Avatar *other)
{
	int i;

	if(this != other)
	{
		sprintf(LastName, "%s", other->LastName);
		sprintf(FirsName, "%s", other->FirsName);
		sprintf(MiddName, "%s", other->MiddName);

		sStr	= other->sStr;
		sExStr	= other->sExStr;
		sDex	= other->sDex;
		sCon	= other->sCon;
		sInt	= other->sInt;
		sWis	= other->sWis;
		sCha	= other->sCha;
		sCom	= other->sCom;

		aStr	= other->aStr;
		aDex	= other->aDex;
		aCon	= other->aCon;		
		aInt	= other->aInt;		
		aWis	= other->aWis;		
		aCha	= other->aCha;		
		aCom	= other->aCom;		
		
		Sex			= other->Sex;
		Race		= other->Race;
		Height		= other->Height;
		Weight		= other->Weight;
		numClasses	= other->numClasses;
		numKits		= other->numKits;

		alignGood	= other->alignGood;
		alignLawful	= other->alignLawful;

		for(i = 0; i < 4; i++)
		{
			avClass[i]		= other->avClass[i];
			classLvl[i]		= other->classLvl[i];
			avKit[i]		= other->avKit[i];
			avClassXP[i]	= other->avClassXP[i];
		}

		for(i = 0; i < cmbtTOTAL_CmbtValues; i++)
			CombatValues[i]	= other->CombatValues[i];
		
		TotalMult	= other->TotalMult;
		SaveAsClass	= other->SaveAsClass;
		
		for(i = 0; i < TOTAL_OptVals; i++)
			OptionalAbilities[i] = other->OptionalAbilities[i];
		
		for(i = 0; i < TOTAL_Restricts; i++)
			Restrictions[i] = other->Restrictions[i];
		
		MaxWeaponSlots	= other->MaxWeaponSlots;
		numWPs			= other->numWPs;
		
		for(i = 0; i < MAX_WEAPONPRO; i++)
			weaponPros[i] = other->weaponPros[i];
		
		MaxNWPSlots		= other->MaxNWPSlots;
		AllocatedNWPs	= other->AllocatedNWPs;
		
		for(i = 0; i < MAX_NWPs; i++)
			nwp[i] = other->nwp[i];
		
		ID_Num			= other->ID_Num;
		worldX			= other->worldX;
		worldY			= other->worldY;
		dungeonX		= other->dungeonX;
		dungeonY		= other->dungeonY;
		dungeonZ		= other->dungeonZ;

		for(i = 0; i < maxBitArray; i++)
			Statuses[i] = other->Statuses[i];
	}
	return this;
}
void Avatar::Copy(Avatar other)
{
	int i;
	sprintf(LastName, "%s", other.LastName);
	sprintf(FirsName, "%s", other.FirsName);
	sprintf(MiddName, "%s", other.MiddName);

	sStr		= other.sStr;
	sDex		= other.sDex;
	sCon		= other.sCon;
	sInt		= other.sInt;
	sWis		= other.sWis;
	sCha		= other.sCha;
	sCom		= other.sCom;

	aStr		= other.aStr;
	sExStr		= other.sExStr;
	aDex		= other.aDex;
	aCon		= other.aCon;
	aInt		= other.aInt;
	aWis		= other.aWis;
	aCha		= other.aCha;
	aCom		= other.aCom;
		
	Sex			= other.Sex;
	Race		= other.Race;
	Height		= other.Height;
	Weight		= other.Weight;
	numClasses	= other.numClasses;
	numKits		= other.numKits;

	alignGood	= other.alignGood;
	alignLawful	= other.alignLawful;

	for(i = 0; i < 4; i++)
	{
		avClass[i]		= other.avClass[i];
		classLvl[i]		= other.classLvl[i];
		avKit[i]		= other.avKit[i];
		avClassXP[i]	= other.avClassXP[i];
	}

	for(i = 0; i < cmbtTOTAL_CmbtValues; i++)
		CombatValues[i]	= other.CombatValues[i];
		
	TotalMult	= other.TotalMult;
	SaveAsClass	= other.SaveAsClass;
		
	for(i = 0; i < TOTAL_OptVals; i++)
		OptionalAbilities[i] = other.OptionalAbilities[i];
		
	for(i = 0; i < TOTAL_Restricts; i++)
		Restrictions[i] = other.Restrictions[i];
		
	MaxWeaponSlots	= other.MaxWeaponSlots;
	numWPs			= other.numWPs;
    
	for(i = 0; i < MAX_WEAPONPRO; i++)
		weaponPros[i] = other.weaponPros[i];
		
	MaxNWPSlots		= other.MaxNWPSlots;
	AllocatedNWPs	= other.AllocatedNWPs;
	
	for(i = 0; i < MAX_NWPs; i++)
		nwp[i] = other.nwp[i];
		
	ID_Num			= other.ID_Num;
		
	worldX			= other.worldX;
	worldY			= other.worldY;
	dungeonX		= other.dungeonX;
	dungeonY		= other.dungeonY;
	dungeonZ		= other.dungeonZ;

	for(i = 0; i < maxBitArray; i++)
		Statuses[i] = other.Statuses[i];
}
void Avatar::SetFName(string data)
{
	if(data.length() > 0 && data.length() < maxNameLength)
	{
		sprintf(FirsName, "               ");
		sprintf(FirsName, "%s", data.c_str());
	}
	else sprintf(FirsName, "Error");
}
void Avatar::SetMName(string data)
{
	if(data.length() > 0 && data.length() < maxNameLength)
	{
		sprintf(MiddName, "               ");
		sprintf(MiddName, "%s", data.c_str());
	}
	else sprintf(MiddName, "Error");
}
void Avatar::SetLName(string data)
{
	if(data.length() > 0 && data.length() < maxNameLength)
	{
		sprintf(LastName, "               ");
		sprintf(LastName, "%s", data.c_str());
	}
	else sprintf(LastName, "Error");
}
string Avatar::GetFName() const
{
	string tmp;
	tmp = FirsName;
	return tmp;
}
string Avatar::GetMName() const
{
	string tmp;
	tmp = MiddName;
	return tmp;
}
string Avatar::GetLName() const
{
	string tmp;
	tmp = LastName;
	return tmp;
}
void Avatar::SetAlign(int Law, int Good)
{
	if(Law >= 0 && Law <= 100)
		alignLawful = Law;
	if(Good >= 0 && Good <= 100)
		alignGood = Good;
}
string Avatar::GetAlign() const
{
	string tmp;

	if		(alignLawful > 66)		tmp = "L";
	else if (alignLawful > 33)		tmp = "N";
	else							tmp = "C";

	if		(alignGood > 66)		tmp += "G";
	else if	(alignGood > 33)		tmp += "N";
	else							tmp += "E";

	return tmp;
}
void Avatar::SetSex(int data)
{
	if(data == 0)	Sex = data;
	else			Sex = 1;
}
int Avatar::GetSex() const
{
	return Sex;
}
void Avatar::SetRace(int data)
{
	Race = data;
}
int Avatar::GetRace() const
{
	return Race;
}
string Avatar::GetRaceStr(int data) const
{
	string tmpStr;
	switch(data)
	{
	case rDwarf:		tmpStr = "Dwarf";		break;
	case rElf:			tmpStr = "Elf";			break;
	case rGnome:		tmpStr = "Gnome";		break;
	case rHalfling:		tmpStr = "Halfling";	break;
	case rHalfElf:		tmpStr = "Half Elf";	break;
	case rHuman:		tmpStr = "Human";		break;
	case MAX_pcRACES:	tmpStr = "Pick";		break;
	}

	return tmpStr;
}
void Avatar::SetHeight(int data)
{
	if(data > 0)	Height = data;
	else			Height = 1;
}
int Avatar::GetHeight() const
{
	return Height;
}
void Avatar::SetRandomHeight()
{
	int tmpHeight	= 0;
	int rndNum		= 0;
	int dieSize		= 0;
	int numRolls	= 0;

	tmpHeight	= 0;

	switch(Race)
	{
	case rDwarf:	if(Sex == 0) tmpHeight = 43; else tmpHeight = 41; dieSize = 10; numRolls = 1; break;
	case rElf:		if(Sex == 0) tmpHeight = 55; else tmpHeight = 50; dieSize = 10; numRolls = 1; break;
	case rGnome:	if(Sex == 0) tmpHeight = 38; else tmpHeight = 36; dieSize =  6; numRolls = 1; break;
	case rHalfElf:	if(Sex == 0) tmpHeight = 60; else tmpHeight = 58; dieSize =  6; numRolls = 2; break;
	case rHalfling:	if(Sex == 0) tmpHeight = 32; else tmpHeight = 30; dieSize =  8; numRolls = 2; break;
	case rHuman:	if(Sex == 0) tmpHeight = 60; else tmpHeight = 56; dieSize = 10; numRolls = 2; break;
	default:
		cout << "\n You must pick a race before randomly assigning height.\n\n";
		system("pause");
		break;
	}

	for(int i = 0; i < numRolls; i++)
	{
		rndNum = rand() % dieSize;
		if(rndNum < 1) rndNum = dieSize;
		tmpHeight += rndNum;
	}

	Height = tmpHeight;
}
void Avatar::SetWeight(int data)
{
	if(data > 0)	Weight = data;
	else			Weight = 1;
}
int Avatar::GetWeight() const
{
	return Weight;
}
void Avatar::SetRandomWeight()
{
	int tmpWeight	= 0;
	int rndNum		= 0;
	int dieSize		= 0;
	int numRolls	= 0;

	tmpWeight = 0;

	switch(Race)
	{
	case rDwarf:	if(Sex == 0) tmpWeight = 130; else tmpWeight = 105; dieSize = 10; numRolls = 4; break;
	case rElf:		if(Sex == 0) tmpWeight =  90; else tmpWeight =  70; dieSize = 10; numRolls = 3; break;
	case rGnome:	if(Sex == 0) tmpWeight =  72; else tmpWeight =  68; dieSize =  4; numRolls = 5; break;
	case rHalfElf:	if(Sex == 0) tmpWeight = 110; else tmpWeight =  85; dieSize = 12; numRolls = 3; break;
	case rHalfling: if(Sex == 0) tmpWeight =  52; else tmpWeight =  48; dieSize	=  4; numRolls = 5; break;
	case rHuman:	if(Sex == 0) tmpWeight = 125; else tmpWeight =  84; dieSize = 10; numRolls = 6; break;
	default:
		cout << "\n You must pick a race before randomly assigning weight.\n\n";
		system("pause");
		break;
	}

	for(int i = 0; i < numRolls; i++)
	{
		rndNum = rand() % dieSize;
		if(rndNum < 1) rndNum = dieSize;
		tmpWeight += rndNum;
	}

	Weight = tmpWeight;
}
void Avatar::SetStatus(int index, bool data)
{
	if(index >= 0 && index < asMAX)
	{
		if(data == true)	Statuses[index] = 1;
		else				Statuses[index] = 0;
	}
}
bool Avatar::GetStatus(int index) const
{
	if(index >= 0 && index < asMAX)
		return Statuses[index];
	return false;
}
void Avatar::SetClass(int d)
{
	int tmp;
	int k;
	bool allow;

	//Allowing cMAX_ to be used as a reset control value
	if(d >= 0 && d <= cMAX_CLASSES)
	{
		//By passing this value, it's a command to 
		//reset all Class values back to default.
		if(d == cMAX_CLASSES)
		{
			for(int k = 0; k < cMAX_CLASSES; k++)
				avClass[k] = cMAX_CLASSES;
			numClasses = 0;
		}
		else
		{
			if(d == cWizard)
			{
				if(Race == rDwarf || Race == rHalfling)
				{
					cout << " Dwarfs and Halflings are not allowed to be wizards of any type.\n ";
					system("pause");
					return;
				}
			}

			if(Statuses[asMultiClass] == true)
			{
				//Count number of classes picked according to Race
				numClasses = 0;
				for(k = 0; k < 4; k++)
					if(avClass[k] < cMAX_CLASSES) numClasses++;

				//This switch statement forces reset of skills if the user
				//attempts to select more than they are allowed by race.
				switch(Race)
				{
				case rDwarf: case rGnome: case rHalfling:
					if(numClasses == 2)
					{
						//Resetting all 4 positions - because
						for(k = 0; k < 4; k++)	avClass[k] = cMAX_CLASSES;
						numClasses = 0;
						allow = false;
					}
					else allow = true;
					break;
				case rElf: case rHalfElf: case rHuman:
					if(numClasses == 3)
					{
						//Resetting all 4 positions - because
						for(k = 0; k < 4; k++)	avClass[k] = cMAX_CLASSES;
						numClasses = 0;
						allow = false;
					}
					else allow = true;
					break;
				}

				if((Race == rHalfling || Race == rElf) && d == cPriest)
					allow = false;

				if(allow == true)
				{
					//By default assign the class to the last position
					avClass[cMAX_CLASSES - 1] = d;
					
					//Bubble sort the value 'up' to 0-index
					for(int j = 0; j < cMAX_CLASSES - 1; j++)
						for(int i = j; i < cMAX_CLASSES; i++)
							if(avClass[i] < avClass[j])
							{
								tmp			= avClass[j];
								avClass[j]	= avClass[i];
								avClass[i]	= tmp;
							}

					numClasses = 0;
					for(k = 0; k < 4; k++)
						if(avClass[k] < cMAX_CLASSES) numClasses++;
				}
			}//end: if(MultiClass == true)
			//Dual-class players simply assign the first position during character creation
			else
			{
				//Assign/Reassign position 0
				avClass[0] = d;
				numClasses = 1;
			}
		}
	}
}
int	Avatar::GetClass(int i) const
{
	if(i >= c0LvlHuman && i < cMAX_CLASSES)	return avClass[i];
	else return -1;
}
string Avatar::GetClassStr(int i) const
{
	string tmp;

	tmp = "";

	if(i >= c0LvlHuman && i <= cMAX_CLASSES)
		tmp = GetClassNam(avClass[i]);

	return tmp;
}
string Avatar::GetClassNam(int i) const
{
	string tmp;

	switch(i)
	{
		case c0LvlHuman:	tmp = "0-lvl Fighter";	break;
		case cWarrior:		tmp = "Warrior";		break;
		case cPriest:		tmp = "Priest";			break;
		case cRogue:		tmp = "Rogue";			break;
		case cWizard:		tmp = "Wizard";			break;
		case cCustom:		tmp = "Custom";			break;
		case cMAX_CLASSES:	tmp = "Pick";			break;
	}

	return tmp;
}
void Avatar::SetKit(int i, int data)
{
	if(i >= 0 && i < 4)
	{
		if(data >= noKit && data < kitsMaxKits)
			avKit[i] = data;
		else
		{
			cout << "\n Kit number out of range.\n ";
			system("pause");
		}
	}
	else
	{
		cout << "\n Kit set index out of range.\n ";
		system("pause");
	}
}
int Avatar::GetKit(int i) const
{
	if(i >= 0 && i < 4)
		return avKit[i];
	else
	{
		cout << "\n Kit index out of range\n ";
		system("pause");
		return -1;
	}
}
string Avatar::GetKitStr(int i) const
{
	string tmp;
	tmp = "";
	if(i >= 0 && i < 4)	tmp = GetKitNam(avKit[i]);
	return tmp;
}
string Avatar::GetKitNam(int i) const
{
	string tmp;
	tmp = "";

	if(i >= noKit && i <= kitsMaxKits)
	{
		switch(i)
		{
		case noKit:					tmp = "";/* Empty */			break;
		case warAmazon:				tmp = "Amazon";					break;
		case warBarbarian:			tmp = "Barbarian";				break;
		case warBeastRider:			tmp = "Beast Rider";			break;
		case warBerserker:			tmp = "Berserker";				break;
		case warCavalier:			tmp = "Cavalier";				break;
		case warGladiator:			tmp = "Gladiator";				break;
		case warMyrmidon:			tmp = "Myrmidon";				break;
		case warNobleWarrior:		tmp = "Noble";					break;
		case warPeasantHero:		tmp = "Peasant Hero";			break;
		case warPirate:				tmp = "Pirate";					break;
		case warOutlaw:				tmp = "Outlaw";					break;
		case warSamurai:			tmp = "Samarai";				break;
		case warSavage:				tmp = "Savage";					break;
		case warSwashbuckler:		tmp = "Swahbuckler";			break;
		case warWildernessWarrior:	tmp = "Wilderness Warrior";		break;
		case palPaladin:			tmp = "Paladin";				break;
		case palChevalier:			tmp = "Chevalier";				break;
		case palDivinate:			tmp = "Divinate";				break;
		case palEnvoy:				tmp = "Envoy";					break;
		case palEquerry:			tmp = "Equerry";				break;
		case palErrant:				tmp = "Errant";					break;
		case palExpatriate:			tmp = "Expatriate";				break;
		case palGhosthunter:		tmp = "Ghost Hunter";			break;
		case palInquisitor:			tmp = "Inquisitor";				break;
		case palMedician:			tmp = "Medician";				break;
		case palMilitarist:			tmp = "Militarist";				break;
		case palSkyrider:			tmp = "Skyrider";				break;
		case palSquire:				tmp = "Squire";					break;
		case palVotary:				tmp = "Votary";					break;
		case palWyrmslayer:			tmp = "Wyrmslayer";				break;
		case ranBeastmaster:		tmp = "Beast Master";			break;
		case ranExplorer:			tmp = "Explorer";				break;
		case ranFalconer:			tmp = "Falconer";				break;
		case ranFeralan:			tmp = "Feralan";				break;
		case ranForestRunner:		tmp = "Forest Runner";			break;
		case ranGiantKiller:		tmp = "Giant Killer";			break;
		case ranGreenwoodRanger:	tmp = "Greenwood Ranger";		break;
		case ranGuardian:			tmp = "Guardian";				break;
		case ranJustifier:			tmp = "Justifier";				break;
		case ranMountainMan:		tmp = "Mountain";				break;
		case ranPathfinder:			tmp = "Pathfinder";				break;
		case ranSeaRanger:			tmp = "Sea Ranger";				break;
		case ranSeeker:				tmp = "Seeker";					break;
		case ranStalker:			tmp = "Stalker";				break;
		case ranWarden:				tmp = "Warden";					break;
		case priAmazonPriestess:	tmp = "Amazon Priestess";		break;
		case priBarbarian:			tmp = "Barbarian";				break;
		case priBerserker:			tmp = "Berserker";				break;
		case priFightingMonk:		tmp = "Fighting Monk";			break;
		case priNobleman:			tmp = "Nobleman";				break;
		case priOutlaw:				tmp = "Outlaw";					break;
		case priPacifist:			tmp = "Pacifist";				break;
		case priPeasant:			tmp = "Peasant";				break;
		case priProphet:			tmp = "Prophit";				break;
		case priSavage:				tmp = "Savage";					break;
		case priScholar:			tmp = "Scholar";				break;
		case druAdviser:			tmp = "Advisor";				break;
		case druAvenger:			tmp = "Avenger";				break;
		case druBeastfriend:		tmp = "Beast Friend";			break;
		case druGuardian:			tmp = "Guardian";				break;
		case druHivemaster:			tmp = "Hivemaster";				break;
		case druLost:				tmp = "Lost";					break;
		case druNaturalPhilosopher:	tmp = "Natural Philosopher";	break;
		case druOutlaw:				tmp = "Outlaw";					break;
		case druPacifist:			tmp = "Pacifist";				break;
		case druSavage:				tmp = "Savage";					break;
		case druShapeshifter:		tmp = "Shapeshifter";			break;
		case druTotemic:			tmp = "Totemic";				break;
		case druVillage:			tmp = "Village";				break;
		case druWanderer:			tmp = "Wanderer";				break;
		case rogAcrobat:			tmp = "Acrobat";				break;
		case rogAdventurer:			tmp = "Adventurer";				break;
		case rogAssassin:			tmp = "Assassin";				break;
		case rogBandit:				tmp = "Bandit";					break;
		case rogBeggar:				tmp = "Beggar";					break;
		case rogBountyHunter:		tmp = "Bounty Hunter";			break;
		case rogBuccaneer:			tmp = "Buccaneer";				break;
		case rogBurglar:			tmp = "Burglar";				break;
		case rogCutpurse:			tmp = "Cutpurse";				break;
		case rogFence:				tmp = "Fence";					break;
		case rogInvestigator:		tmp = "Investigator";			break;
		case rogScout:				tmp = "Scout";					break;
		case rogSmuggler:			tmp = "Smuggler";				break;
		case rogSpy:				tmp = "Spy";					break;
		case rogSwashbuckler:		tmp = "Swashbuckler";			break;
		case rogSwindler:			tmp = "Swindler";				break;
		case rogThug:				tmp = "Thug";					break;
		case rogTroubleshooter:		tmp = "Troubleshooter";			break;
		case barTrueBard:			tmp = "Bard";					break;
		case barBlade:				tmp = "Blade";					break;
		case barCharlatan:			tmp = "Charlatan";				break;
		case barGallant:			tmp = "Gallant";				break;
		case barGypsy:				tmp = "Gypsy";					break;
		case barHerald:				tmp = "Herald";					break;
		case barJester:				tmp = "Jester";					break;
		case barJongleur:			tmp = "Jongleur";				break;
		case barLoremaster:			tmp = "Loremaster";				break;
		case barMeistersinger:		tmp = "Meistersinger";			break;
		case barRiddlemaster:		tmp = "Riddlemaster";			break;
		case barSkald:				tmp = "Skald";					break;
		case barThespian:			tmp = "Thespian";				break;
		case ninStealerIn:			tmp = "Stealer In";				break;
		case ninShadowWarrior:		tmp = "Shadow Warrior";			break;
		case ninIntruder:			tmp = "Intruder";				break;
		case ninConsort:			tmp = "Consort";				break;
		case ninPathfinder:			tmp = "Pathfinder";				break;
		case ninLoneWolf:			tmp = "Lone Wolf";				break;
		case ninSpiritWarrior:		tmp = "Spirit Warrior";			break;
		case ninSpy:				tmp = "Spy";					break;
		case wizAcademician:		tmp = "Academician";			break;
		case wizAmazonSorceress:	tmp = "Amazon Sorceress";		break;
		case wizAnagakok:			tmp = "Anagakok";				break;
		case wizMilitantWizard:		tmp = "Militant Wizard";		break;
		case wizMystic:				tmp = "Mystic";					break;
		case wizPatrician:			tmp = "Patrician";				break;
		case wizPeasant:			tmp = "Peasant";				break;
		case wizSavage:				tmp = "Savage";					break;
		case wizWitch:				tmp = "Witch";					break;
		case wizWuJen:				tmp = "Wu Jen";					break;
		case kitsMaxKits:			tmp = "Pick";					break;
		}
	}
	return tmp;
}
void Avatar::SetNumClass(int i)
{
	if(i >= 0 && i < cMAX_CLASSES)
		numClasses = i;
	else
	{
		for(int k = 0; k < cMAX_CLASSES; k++)
			avClass[k] = cMAX_CLASSES;
		numClasses = 0;
	}
}
int Avatar::GetNumClass() const
{
	return numClasses;
}
void Avatar::SetNumKit(int i)
{
	numKits = i;
}
int Avatar::GetNumKit() const
{
	return numKits;
}
void Avatar::SetSStr(int data)
{
	if(data > 0 && data <= 25)
	{
		sStr = data;
	}
	else sStr = 0;
}
int Avatar::GetSStr() const
{
	return sStr;
}
void Avatar::SetStrE(int data)
{
	if(data >= 0 && data <= 100)
	{
		sExStr = data;
	}
	else sExStr = 0;
}
int Avatar::GetStrE() const
{
	return sExStr;
}
void Avatar::SetSDex(int data)
{
	if(data > 0 && data <= 25)
	{
		sDex = data;
	}
	else sDex = 0;
}
int Avatar::GetSDex() const
{
	return sDex;
}
void Avatar::SetSCon(int data)
{
	if(data > 0 && data <= 25)
	{
		sCon = data;
	}
	else sCon = 0;
}
int Avatar::GetSCon() const
{
	return sCon;
}
void Avatar::SetSInt(int data)
{
	if(data > 0 && data <= 25)
	{
		sInt = data;
	}
	else sInt = 0;
}
int Avatar::GetSInt() const
{
	return sInt;
}
void Avatar::SetSWis(int data)
{
	if(data > 0 && data <= 25)
	{
		sWis = data;
	}
	else sWis = 0;
}
int Avatar::GetSWis() const
{
	return sWis;
}
void Avatar::SetSCha(int data)
{
	if(data > 0 && data <= 25)
	{
		sCha = data;
	}
	else sCha = 0;
}
int Avatar::GetSCha() const
{
	return sCha;
}
void Avatar::SetSCom(int data)
{
	if(data > 0 && data <= 25)
	{
		sCom = data;
	}
	else sCom = 0;
}
int Avatar::GetSCom() const
{
	return sCom;
}
void Avatar::ResetStartingStats()
{
	SetSStr(0);
	SetStrE(0);
	SetSDex(0);
	SetSCon(0);
	SetSInt(0);
	SetSWis(0);
	SetSCha(0);
	SetSCom(0);
}
void Avatar::SetAStr(float data)
{
	if(data > 0 && data <= 25)
	{
		aStr = data;
	}
	else aStr = 0.0;
}
float Avatar::GetAStr() const
{
	return aStr;
}
void Avatar::SetADex(float data)
{
	if(data > 0 && data <= 25)
	{
		aDex = data;
	}
	else aDex = 0;
}
float Avatar::GetADex() const
{
	return aDex;
}
void Avatar::SetACon(float data)
{
	if(data > 0 && data <= 25)
	{
		aCon = data;
	}
	else aCon = 0;
}
float Avatar::GetACon() const
{
	return aCon;
}
void Avatar::SetAInt(float data)
{
	if(data > 0 && data <= 25)
	{
		aInt = data;
	}
	else aInt = 0;
}
float Avatar::GetAInt() const
{
	return aInt;
}
void Avatar::SetAWis(float data)
{
	if(data > 0 && data <= 25)
	{
		aWis = data;
	}
	else aWis = 0;
}
float Avatar::GetAWis() const
{
	return aWis;
}
void Avatar::SetACha(float data)
{
	if(data > 0 && data <= 25)
	{
		aCha = data;
	}
	else aCha = 0;
}
float Avatar::GetACha() const
{
	return aCha;
}
void Avatar::SetACom(float data)
{
	if(data > 0 && data <= 25)
	{
		aCom = data;
	}
	else aCom = 0;
}
float Avatar::GetACom() const
{
	return aCom;
}
void Avatar::CheckStatsByRace()
{
	switch(Race)
	{
	case rDwarf:
		sCon += 1;
		sCha -= 1;
		if(sStr < 8)  sStr = 8;  if(sStr > 18) sStr = 18;
		if(sDex < 3)  sDex = 3;  if(sDex > 17) sDex = 17;
		if(sCon < 11) sCon = 11; if(sCon > 19) sCon = 19;
		if(sInt < 3)  sInt = 3;  if(sInt > 18) sInt = 18;
		if(sWis < 3)  sWis = 3;  if(sWis > 18) sWis = 18;
		if(sCha < 3)  sCha = 3;  if(sCha > 17) sCha = 17;
		break;
	case rElf:
		sDex += 1;
		sCon -= 1;
		if(sStr < 3)  sStr = 3;  if(sStr > 18) sStr = 18;
		if(sDex < 6)  sDex = 6;  if(sDex > 18) sDex = 18;
		if(sCon < 7)  sCon = 7;  if(sCon > 17) sCon = 17;
		if(sInt < 8)  sInt = 8;  if(sInt > 18) sInt = 18;
		if(sWis < 3)  sWis = 3;  if(sWis > 18) sWis = 18;
		if(sCha < 8)  sCha = 8;  if(sCha > 18) sCha = 18;
		break;
	case rGnome:
		sInt += 1;
		sWis -= 1;
		if(sStr < 6)  sStr = 6;  if(sStr > 18) sStr = 18;
		if(sDex < 3)  sDex = 3;  if(sDex > 18) sDex = 18;
		if(sCon < 8)  sCon = 8;  if(sCon > 18) sCon = 18;
		if(sInt < 6)  sInt = 6;  if(sInt > 18) sInt = 18;
		if(sWis < 3)  sWis = 3;  if(sWis > 18) sWis = 18;
		if(sCha < 3)  sCha = 3;  if(sCha > 18) sCha = 18;
		break;
	case rHalfElf:
		if(sStr < 3)  sStr = 3;  if(sStr > 18) sStr = 18;
		if(sDex < 6)  sDex = 6;  if(sDex > 18) sDex = 18;
		if(sCon < 6)  sCon = 6;  if(sCon > 18) sCon = 18;
		if(sInt < 4)  sInt = 4;  if(sInt > 18) sInt = 18;
		if(sWis < 3)  sWis = 3;  if(sWis > 18) sWis = 18;
		if(sCha < 3)  sCha = 3;  if(sCha > 18) sCha = 18;
		break;
	case rHalfling:
		sDex += 1;
		sStr -= 1;
		if(sStr < 7)  sStr =  7;  if(sStr > 18) sStr = 18;
		if(sDex < 7)  sDex =  7;  if(sDex > 18) sDex = 18;
		if(sCon < 10) sCon = 10;  if(sCon > 18) sCon = 18;
		if(sInt < 6)  sInt =  6;  if(sInt > 18) sInt = 18;
		if(sWis < 3)  sWis =  3;  if(sWis > 17) sWis = 17;
		if(sCha < 3)  sCha =  3;  if(sCha > 18) sCha = 18;
		break;
	default:
		break;
	}
}
//Custom Class
void Avatar::SetCmbtValue(int Index, double Data)
{
	if(Index >= 0 && Index < cmbtTOTAL_CmbtValues)
		CombatValues[Index] = Data;

	calTotalMult();
}
double Avatar::GetCmbtValue(int Index) const
{
	if(Index >= 0 && Index < cmbtTOTAL_CmbtValues)
		return CombatValues[Index];
	else return 0;
}
int Avatar::GetCustomCmbtValue() const
{
	int tmp;

	if		(GetCmbtValue(cmbtCombatValue) == -2)	tmp = c0LvlHuman;
	else if	(GetCmbtValue(cmbtCombatValue) == -1)	tmp = cWizard;
	else if	(GetCmbtValue(cmbtCombatValue) ==  0)	tmp = cRogue;
	else if	(GetCmbtValue(cmbtCombatValue) ==  1)	tmp = cPriest;
	else if	(GetCmbtValue(cmbtCombatValue) ==  2)	tmp = cWarrior;
	else											tmp = c0LvlHuman;

	return tmp;
}
void Avatar::SetOptionalAbil(int Index, bool Data)
{
	if(Index >= 0 && Index < TOTAL_OptVals)
		OptionalAbilities[Index] = Data;
	calTotalMult();
}
void Avatar::ReverseOptional(int Index)
{
	if(Index >= 0 && Index < TOTAL_OptVals)
	{
		if(OptionalAbilities[Index] == true)	OptionalAbilities[Index] = false;
		else									OptionalAbilities[Index] = true;
	}
	calTotalMult();
}
bool Avatar::GetOptionalAbil(int Index) const
{
	if(Index >= 0 && Index < TOTAL_OptVals)
		return OptionalAbilities[Index];
	else
		return 0;
}
string Avatar::GetOptTF(int Index) const
{
	if(Index >= 0 && Index < TOTAL_OptVals)
	{
		if(OptionalAbilities[Index] == true)	return "yes";
		else									return "no";
	}
	else return "GotOptTF Fail";
}
void Avatar::SetRestriction(int Index, bool Data)
{
	if(Index >= 0 && Index < TOTAL_Restricts)
		Restrictions[Index] = Data;
	calTotalMult();
}
bool Avatar::GetRestriction(int Index) const
{
	if(Index >= 0 && Index < TOTAL_Restricts)
		return Restrictions[Index];
	else return false;
}
void Avatar::ReverseRestrict(int Index)
{
	if(Index >= 0 && Index < TOTAL_Restricts)
	{
		if(Restrictions[Index] == true)			Restrictions[Index] = false;
		else									Restrictions[Index] = true;
	}
	calTotalMult();
}
string Avatar::GetResTF(int Index) const
{
	if(Index >= 0 && Index < TOTAL_Restricts)
	{
		if(Restrictions[Index] == true)			return "yes";
		else									return "no";
	}
	else return "Error GetResTF";
}
double Avatar::GetTotalMult() const
{
	return TotalMult;
}
void Avatar::calTotalMult()
{
	//Rest to clear...
	TotalMult = 0.0;

	//Begin adding/subtracting of values...
	TotalMult = CombatValues[cmbtRace]		+ CombatValues[cmbtCombatValue]		+ CombatValues[cmbtSaveValue]		+
				CombatValues[cmbtHDLevel]	+ CombatValues[cmbtArmorAllowed]	+ CombatValues[cmbtWeaponsAllowed]	+
				CombatValues[cmbtHPAfter9th];

	if(OptionalAbilities[FighterCon]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[FighterExStr]		== true) TotalMult +=  1.0; 
	if(OptionalAbilities[AnimalEmp]			== true) TotalMult +=  1.0;
	if(OptionalAbilities[BonusHitCreature]	== true) TotalMult +=  1.0;
	if(OptionalAbilities[ReadLang]			== true) TotalMult +=  0.5;
	if(OptionalAbilities[AuraOfPro]			== true) TotalMult +=  1.0;
	if(OptionalAbilities[Backstab]			== true) TotalMult +=  1.0;
	if(OptionalAbilities[CastAnyPriest]		== true) TotalMult +=  8.0;
	if(OptionalAbilities[ClimbWalls]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[FindRemove]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[HealAsPal]			== true) TotalMult +=  1.0;
	if(OptionalAbilities[HearNoise]			== true) TotalMult +=  0.5;
	if(OptionalAbilities[HideShadows]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[AnyMageSpell]		== true) TotalMult += 16.0;
	if(OptionalAbilities[MoveSilent]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[OpenLocks]			== true) TotalMult +=  1.0;
	if(OptionalAbilities[PickPockets]		== true) TotalMult +=  1.0;
	if(OptionalAbilities[FollowAsWarrior]	== true) TotalMult +=  2.0;
	if(OptionalAbilities[FollowAsCleric]	== true) TotalMult +=  1.5;
	if(OptionalAbilities[FollowAsMage]		== true) TotalMult +=  0.5;
	if(OptionalAbilities[FollowAsThief]		== true) TotalMult +=  1.0;

	if(Restrictions[CantKeepMuch]			== true) TotalMult += -0.5;
	if(Restrictions[MustDonate]				== true) TotalMult += -0.5;
	if(Restrictions[NonHuman9]				== true) TotalMult += -1.0;
	if(Restrictions[NonHuman12]				== true) TotalMult += -0.5;
	if(Restrictions[HasEthos]				== true) TotalMult += -1.0;
	if(Restrictions[Cant10Magic]			== true) TotalMult += -0.5;
	if(Restrictions[Cant6Magic]				== true) TotalMult += -1.0;
	if(Restrictions[CantClass]				== true) TotalMult += -1.0;
	if(Restrictions[CantAlign]				== true) TotalMult += -1.0;
}
void Avatar::ResetCustom()
{
	//Custom Class
	int i = 0;

	for(i = 0; i < cmbtTOTAL_CmbtValues;	i++) CombatValues[i]		= 0.0;
	CombatValues[cmbtSaveValue] = -2.0;
	for(i = 0; i < TOTAL_OptVals;			i++) OptionalAbilities[i]	= false;
	for(i = 0; i < TOTAL_Restricts;			i++) Restrictions[i]		= false;

	SaveAsClass = c0LvlHuman;
	calTotalMult();
}
void Avatar::SetSaveAsClass(int data)
{
	//c0LvlHuman = 0, cWarrior, cPriest , cRogue, cWizard, cCustom
	if(data >= c0LvlHuman && data < cMAX_CLASSES)
		SaveAsClass = data;
	else SaveAsClass = c0LvlHuman;
}
int Avatar::GetSaveAsClass() const
{
	return SaveAsClass;
}
//Weapon Proficiencies
void Avatar::ResetWPs()
{
	MaxWeaponSlots = numWPs = 0;
	for(int i = 0; i < MAX_WEAPONPRO; i++)
		weaponPros[i] = 0;
}
void Avatar::AssignNumWeaPros()
{
	int i;

	switch(GetClass(0))
	{
	case c0LvlHuman:	MaxWeaponSlots = 1;		break;
	case cWarrior:		MaxWeaponSlots = 4;		break;
	case cPriest:		MaxWeaponSlots = 2;		break;
	case cRogue:		MaxWeaponSlots = 2;		break;
	case cWizard:		MaxWeaponSlots = 1;		break;
	case cCustom:
		//Monster is assigned the same as Rogue for playability...
		if		(GetCmbtValue(cmbtCombatValue) == 3.0)	i = cRogue;		//Monster
		else if	(GetCmbtValue(cmbtCombatValue) == 2.0)	i = cWarrior;	//Warrior
		else if	(GetCmbtValue(cmbtCombatValue) == 1.0)	i = cPriest;	//Priest
		else if	(GetCmbtValue(cmbtCombatValue) == 0.0)	i = cRogue;		//Rogue
		else											i = cWizard;	//Wizard
		switch(i)
		{
		case cWarrior:		MaxWeaponSlots = 4;		break;
		case cPriest:		MaxWeaponSlots = 2;		break;
		case cRogue:		MaxWeaponSlots = 2;		break;
		case cWizard:		MaxWeaponSlots = 1;		break;
		}
		break;
	default:			MaxWeaponSlots = 0;		break;
	}
}
int Avatar::GetNumMaxWPslots() const
{
	return MaxWeaponSlots;
}
void Avatar::AssignWeaponSlot(int index, int data)
{
	if(numWPs < MaxWeaponSlots)
	{
		//Majority of the time data is going to come from a data file with a total number...
		if(data >= 0 && data < MAX_WEAPONPRO)
		{
			weaponPros[index] = data;
			CalcWPsSlots();	//recalculate the total slots allowed...
		}
	}
	else
	{
		cout << "\n You've reached your maximum WP allocation.\n "
			 << "Reset your skills to start over.\n\n ";
		system("pause");
		//Tested and valid
	}
}
int Avatar::GetNumWPsUsed() const
{
	return numWPs;
}
string Avatar::GetWProName(int i) const
{
	string tmp;

	switch(i)
	{
	case wpArquebus:			tmp = "Arquebus";				break;
	case wpAwlPike:				tmp = "Awl Pike";				break;
	case wpBardiche:			tmp = "Bardiche";				break;
	case wpAxeBattle:			tmp = "Axe, Battle";			break;
	case wpBecDeCorbin:			tmp = "Bed de Corbin";			break;
	case wpBillGuisarme:		tmp = "Bill-guisarme";			break;
	case wpBlowgun:				tmp = "Blowgun";				break;
	case wpBowCompLong:			tmp = "Bow, Long Composite";	break;
	case wpBowCompShort:		tmp = "Bow, Short Composite";	break;
	case wpBowLong:				tmp = "Bow, Long";				break;
	case wpBowShort:			tmp = "Bow, Short";				break;
	case wpClub:				tmp = "Club";					break;
	case wpCrossbowHand:		tmp = "Crossbow, Hand";			break;
	case wpCrossbowHeavy:		tmp = "Crossbow, Heavy";		break;
	case wpCrossbowLight:		tmp = "Crossbow, Light";		break;
	case wpDagger:				tmp = "Dagger";					break;
	case wpDirk:				tmp = "Dirk";					break;
	case wpDart:				tmp = "Dart";					break;
	case wpFauchard:			tmp = "Fauchard";				break;
	case wpFauchardFork:		tmp = "Fauchard-fork";			break;
	case wpFlailFoot:			tmp = "Flail, Footman's";		break;
	case wpFlailHorse:			tmp = "Flail, Horseman's";		break;
	case wpFlintLocks:			tmp = "Flint Locks";			break;
	case wpGlaiveGuisarme:		tmp = "Glaive-guisarme";		break;
	case wpGuisarme:			tmp = "Guisarme";				break;
	case wpGuisarmeVoulge:		tmp = "Guisarme-voulge";		break;
	case wpHalberd:				tmp = "Halberd";				break;
	case wpHookFauchard:		tmp = "Hoook-fauchard";			break;
	case wpJavelin:				tmp = "Javelin";				break;
	case wpKhopesh:				tmp = "Khopesh";				break;
	case wpKnife:				tmp = "Knife";					break;
	case wpLanceHvy:			tmp = "Lance, Heavy";			break;
	case wpLanceLgt:			tmp = "Lance, Light";			break;
	case wpLanceMed:			tmp = "Lance, Medium";			break;
	case wpLucernHammer:		tmp = "Lucern Hammer";			break;
	case wpMaceFoot:			tmp = "Mace, Footman's";		break;
	case wpMaceHorse:			tmp = "Mace, Horseman's";		break;
	case wpMancatcher:			tmp = "Man catcher";			break;
	case wpMilitaryFork:		tmp = "Military Fork";			break;
	case wpMorningStar:			tmp = "Morning star";			break;
	case wpPartisan:			tmp = "Partisan";				break;
	case wpPickFoot:			tmp = "Pick, Footman's";		break;
	case wpPickHorse:			tmp = "Pick, Horseman's";		break;
	case wpQuarterstaff:		tmp = "Quarterstaff";			break;
	case wpRansuer:				tmp = "Ransuer";				break;
	case wpScourge:				tmp = "Scourge";				break;
	case wpSickle:				tmp = "Sickle";					break;
	case wpSpectum:				tmp = "Spetum";					break;
	case wpSling:				tmp = "Sling";					break;
	case wpSpear:				tmp = "Spear";					break;
	case wpStaffSling:			tmp = "Staff Sling";			break;
	case wpSwordBastard:		tmp = "Sword, Bastard";			break;
	case wpSwordBroad:			tmp = "Sword, Broad";			break;
	case wpSwordLong:			tmp = "Sword, Long";			break;
	case wpSwordScimitar:		tmp = "Sword, Scimitar";		break;
	case wpSwordShort:			tmp = "Sword, Short";			break;
	case wpSwordTwoHanded:		tmp = "Sword, Two-handed";		break;
	case wpTrident:				tmp = "Trident";				break;
	case wpVoulge:				tmp = "Voulge";					break;
	case wpWarhammer:			tmp = "Warhammer";				break;
	case wpWhip:				tmp = "Whip";					break;
	default:					tmp = "Weapon WP Error";		break;
	}
	return tmp;
}
int Avatar::GetWPSlotCost(int index) const
{
	if(index >= 0 && index < MAX_WEAPONPRO)
		return weaponPros[index];
	else return 0;
}
void Avatar::CalcWPsSlots()
{
	numWPs = 0;
	for(int i = 0; i < MAX_WEAPONPRO; i++)
		numWPs += weaponPros[i];
}
//NWPs
void Avatar::ResetNWPs()
{
	MaxNWPSlots = AllocatedNWPs = 0;
	for(int i = 0; i < MAX_NWPs; i++)
		nwp[i] = 0;
}
void Avatar::AssignNumNWPs()
{
	int tmpNum1;
	int tmpNum2;
    
	tmpNum2 = 0;

	//If Avatar is multi-class...
	if(Statuses[asMultiClass] == true)
	{
		//With multi-class, we're temporarily using tmpNum1 as a storage
		//location to be able to make a comparison against what tmpNum2 
		//has. After we get a high vallue, we'll recycle tmpNum1 with an 
		//assignment in the next section where tmpNum1 and tmpNum2 are summed.

		//Search the classes to see if any is Wizard or Cleric
		for(int i = 0; i < cMAX_CLASSES; i++)
		{
			if(avClass[i] != cMAX_CLASSES)
			{
				switch(avClass[i])
				{
				case cPriest:	case cWizard:	tmpNum1 = 4;	break;
				case cRogue:	case cWarrior:	tmpNum1 = 3;	break;
				case c0LvlHuman:				tmpNum1 = 2;	break;

				case cCustom:
					switch(GetCustomCmbtValue())
					{
					case cPriest:	case cWizard:	tmpNum1 = 4;	break;
					case cRogue:	case cWarrior:	tmpNum1 = 3;	break;
					case c0LvlHuman:				tmpNum1 = 2;	break;
					}
					break;
				}

				//If we find a greater value, assign it instead...
				if(tmpNum1 > tmpNum2) tmpNum2 = tmpNum1;
			}
		}
	}
	else
	{
		//We don't have to search for high value,
		//as there is only one class to check.
		switch(avClass[0])
		{
		case cPriest:	case cWizard:	tmpNum2 = 4;	break;
		case cRogue:	case cWarrior:	tmpNum2 = 3;	break;
		case c0LvlHuman:				tmpNum2 = 2;	break;
		
		case cCustom:
			switch(GetCustomCmbtValue())
			{
			case cPriest:	case cWizard:	tmpNum2 = 4;	break;
			case cRogue:	case cWarrior:	tmpNum2 = 3;	break;
			case c0LvlHuman:				tmpNum2 = 2;	break;
			}
			break;
		}
	}
	
	//Add number of slots according to Intelligence...
	switch(sInt)
	{
	case 25:	tmpNum1 = 20;	break;
	case 24:	tmpNum1 = 15;	break;
	case 23:	tmpNum1 = 12;	break;
	case 22:	tmpNum1 = 11;	break;
	case 21:	tmpNum1 = 10;	break;
	case 20:	tmpNum1 = 9;	break;
	case 19:	tmpNum1 = 8;	break;
	case 18:	tmpNum1 = 7;	break;
	case 17:	tmpNum1 = 6;	break;
	case 16:	tmpNum1 = 5;	break;
	case 15:	tmpNum1 = 4;	break;
	case 14:	tmpNum1 = 4;	break;
	case 13:	tmpNum1 = 3;	break;
	case 12:	tmpNum1 = 3;	break;
	case 11:	tmpNum1 = 2;	break;
	case 10:	tmpNum1 = 2;	break;
	case 9:		tmpNum1 = 2;	break;
	case 8:		tmpNum1 = 1;	break;
	case 7:		tmpNum1 = 1;	break;
	case 6:		tmpNum1 = 1;	break;
	case 5:		tmpNum1 = 1;	break;
	case 4:		tmpNum1 = 1;	break;
	case 3:		tmpNum1 = 1;	break;
	case 2:		tmpNum1 = 1;	break;
	case 1:		tmpNum1 = 0;	break;
	}

	MaxNWPSlots = tmpNum1 + tmpNum2;
}
void Avatar::AssignNWPSlot(int index, int data)
{
	if(index >= 0 && index < MAX_NWPs)
	{
		nwp[index] = data;
		CalNWPslots();
	}
	else nwp[index] = 0;
}
void Avatar::CalNWPslots()
{
	AllocatedNWPs = 0;
	for(int i = 0; i < MAX_NWPs; i++)
		AllocatedNWPs += nwp[i];
}
int Avatar::GetNWPnumSlotsAll(int index) const
{
	if(index >= 0 && index < MAX_NWPs)
		return nwp[index];
	else return 0;
}
int Avatar::GetNumNWPSAllocated() const
{
	return AllocatedNWPs;
}
int Avatar::GetNumMaxNWPslots() const
{
	return MaxNWPSlots;
}
string Avatar::GetNWPStr(int index)
{
	string tmp;
	switch(index)
	{
	case nwpAlchemy:				tmp = "Alchemy";				break;
	case nwpAlertness:				tmp = "Alertness";				break;
	case nwpAnimalTraining:			tmp = "Animal Training";		break;
	case nwpAppraising:				tmp = "Appraising";				break;
	case nwpBalance:				tmp = "Balance";				break;
	case nwpBargain:				tmp = "Bargain";				break;
	case nwpBeeKeeping:				tmp = "Bee Keeping";			break;
	case nwpBegging:				tmp = "Begging";				break;
	case nwpBlacksmithing:			tmp = "Blacksmithing";			break;
	case nwpBlindFighting:			tmp = "Blind Fighting";			break;
	case nwpBoasting:				tmp = "Boasting";				break;
	case nwpBoating:				tmp = "Boating";				break;
	case nwpBoatwright:				tmp = "Boatwright";				break;
	case nwpBodyLang:				tmp = "Body Language";			break;
	case nwpBowyer:					tmp = "Bowyer";					break;
	case nwpBrewing:				tmp = "Brewing";				break;
	case nwpBribery:				tmp = "Bribery";				break;
	case nwpBureaucracy:			tmp = "Bureaucracy";			break;
	case nwpButcher:				tmp = "Butcher";				break;
	case nwpCamouflage:				tmp = "Camouflage";				break;
	case nwpCarpentry:				tmp = "Carpentry";				break;
	case nwpCandleMaker:			tmp = "Candle Making";			break;
	case nwpCartography:			tmp = "Cartography";			break;
	case nwpCartwright:				tmp = "Cartwright";				break;
	case nwpChanting:				tmp = "Chanting";				break;
	case nwpCharioteering:			tmp = "Charioteering";			break;
	case nwpCheeseMaking:			tmp = "CheeseMaking";			break;
	case nwpClayWorking:			tmp = "Clay Working";			break;
	case nwpClimbing:				tmp = "Climbing";				break;
	case nwpCloseQuarterFighting:	tmp = "Close Qtr Fight'";		break;
	case nwpCobbling:				tmp = "Cobbling";				break;
	case nwpCommerce:				tmp = "Commerce";				break;
	case nwpConcealment:			tmp = "Concealment";			break;
	case nwpCooking:				tmp = "Cooking";				break;
	case nwpDairyman:				tmp = "Dairyman";				break;
	case nwpDancing:				tmp = "Dancing";				break;
	case nwpDangerSense:			tmp = "Danger Sense";			break;
	case nwpDiagnostics:			tmp = "Diagnostics";			break;
	case nwpDiplomacy:				tmp = "Diplomacy";				break;
	case nwpDirectionSense:			tmp = "Direction Sense";		break;
	case nwpDisguise:				tmp = "Disguise";				break;
	case nwpDistanceSense:			tmp = "Distance Sense";			break;
	case nwpEavesdropping:			tmp = "Eaves Dropping";			break;
	case nwpEndurance:				tmp = "Endurance";				break;
	case nwpEngineering:			tmp = "Engineering";			break;
	case nwpEtiquette:				tmp = "Etiquette";				break;
	case nwpEvasion:				tmp = "Evasion";				break;
	case nwpFarming:				tmp = "Farming";				break;
	case nwpFieldOfStudy:			tmp = "Field Of Study";			break;
	case nwpFireBuilding:			tmp = "Fire Building";			break;
	case nwpFishing:				tmp = "Fishing";				break;
	case nwpFletcher:				tmp = "Fletcher";				break;
	case nwpForaging:				tmp = "Foraging";				break;
	case nwpForgery:				tmp = "Forgery";				break;
	case nwpGaming:					tmp = "Gaming";					break;
	case nwpGemCutting:				tmp = "Gem Cutting";			break;
	case nwpHerbalism:				tmp = "Herbalism";				break;
	case nwpHiding:					tmp = "Hiding";					break;
	case nwpHunting:				tmp = "Hunting";				break;
	case nwpIntimidation:			tmp = "Intimidation";			break;
	case nwpJumping:				tmp = "Jumping";				break;
	case nwpLangAncient:			tmp = "Language - Ancient";		break;
	case nwpLangModern:				tmp = "Language - Modern";		break;
	case nwpLeadership:				tmp = "Leadership";				break;
	case nwpLeatherworking:			tmp = "Leatherworking";			break;
	case nwpLockPicking:			tmp = "Lock Picking";			break;
	case nwpLocksmithing:			tmp = "Locksmithing";			break;
	case nwpManipulation:			tmp = "Manipulation";			break;
	case nwpMiller:					tmp = "Miller";					break;
	case nwpMining:					tmp = "Mining";					break;
	case nwpMusicalInstrument:		tmp = "Musical Instrument";		break;
	case nwpNavigation:				tmp = "Navigation";				break;
	case nwpNightsight:				tmp = "Nightsight";				break;
	case nwpObservation:			tmp = "Observation";			break;
	case nwpOrienteering:			tmp = "Orienteering";			break;
	case nwpPickPockets:			tmp = "Pick Pockets";			break;
	case nwpReadWrite:				tmp = "Reading/Writing";		break;
	case nwpRiding:					tmp = "Riding";					break;
	case nwpRopeNetMaking:			tmp = "Rope & Net Making";		break;
	case nwpRunning:				tmp = "Running";				break;
	case nwpSeamanship:				tmp = "Seamanship";				break;
	case nwpSeamstressTailor:		tmp = "Seamstress/Tailor";		break;
	case nwpSetSnaresAndTraps:		tmp = "Set Snares & Traps";		break;
	case nwpShadowing:				tmp = "Shadowing";				break;
	case nwpShepherd:				tmp = "Shepherd";				break;
	case nwpShipwright:				tmp = "Shipwright";				break;
	case nwpSignaling:				tmp = "Signaling";				break;
	case nwpSinging:				tmp = "Singing";				break;
	case nwpSoundAnalysis:			tmp = "Sound Analysis";			break;
	case nwpSpeedCasting:			tmp = "Speed Casting";			break;
	case nwpSpellcraft:				tmp = "Spellcraft";				break;
	case nwpStealth:				tmp = "Stealth";				break;
	case nwpStonemasonry:			tmp = "Stonemasonry";			break;
	case nwpStreetSense:			tmp = "Street Sense";			break;
	case nwpSurvival:				tmp = "Survival";				break;
	case nwpSwimming:				tmp = "Swimming";				break;
	case nwpTeaching:				tmp = "Teaching";				break;
	case nwpTightropeWalking:		tmp = "Tightrope Walking";		break;
	case nwpTrapDetect:				tmp = "Trap Detection";			break;
	case nwpTumbling:				tmp = "Tumbling";				break;
	case nwpVetHealing:				tmp = "Veteranarian Healing";	break;
	case nwpVentriloquism:			tmp = "Ventriloquism";			break;
	case nwpWaterDivine:			tmp = "Water Divining";			break;
	case nwpWeaving:				tmp = "Weaving";				break;
	case nwpWineMaking:				tmp = "Wine Making";			break;
	default:						tmp = "NWP Name Error";			break;
	}
	return tmp;
}
//Other data...
void Avatar::SetID(int index)
{
	if(index >= 0 && index< maxNumAvatars)
		ID_Num = index;
	else ID_Num = -1;
}
int Avatar::GetID() const
{
	return ID_Num;
}
void Avatar::SetWorldX(int x)
{
	if(x >= 0)	worldX = x;
	else		worldX = 0;
}
int Avatar::GetWorldX() const
{
	return worldX;
}
void Avatar::SetWorldY(int y)
{
	if(y >= 0)	worldY = y;
	else		worldY = 0;
}
int Avatar::GetWorldY() const
{
	return worldY;
}
void Avatar::SetWorldZ(int z)
{
	if(z >= 0)	worldZ = z;
	else		worldZ = 0;
}
int Avatar::GetWorldZ() const
{
	return worldZ;
}
void Avatar::Action(string Action, int mWX, int mWY, int mWZ)
{
	int userIn; userIn = -1;
	
	if		(Action == "A" || Action == "a") userIn = 0;
	else if	(Action == "D" || Action == "d") userIn = 1;
	else if	(Action == "W" || Action == "w") userIn = 2;
	
	if(userIn > -1)
	{
		switch(userIn)
		{
		case 0:	if(facing > 0) facing--; else facing = 7; break;
		case 1: if(facing < 7) facing++; else facing = 0; break;
		case 2://Move forward
			switch(facing)
			{
			case 0:										if(worldY > 0)			worldY--;	break;
			case 1:	if(worldX < mWX - 1)	worldX++;	if(worldY > 0)			worldY--;	break;
			case 2:	if(worldX < mWX - 1)	worldX++;										break;
			case 3:	if(worldX < mWX - 1)	worldX++;	if(worldY < mWY - 1)	worldY++;	break;
			case 4:										if(worldY < mWY - 1)	worldY++;	break;
			case 5: if(worldX > 0)			worldX--;	if(worldY < mWY - 1)	worldY++;	break;
			case 6: if(worldX > 0)			worldX--;										break;
			case 7: if(worldX > 0)			worldX--;	if(worldY > 0)			worldY--;	break;
			}
			break;
		}
	}
}
void Avatar::SetFacing(int dir)
{
	if(dir >=0 && dir <= 7)
		facing = dir;
	else facing = 0;
}
int Avatar::GetFacing() const
{
	return facing;
}
void Avatar::SetDungeonX(int x)
{
	if(x >= 0)	dungeonX = x;
	else		dungeonX = 0;
}
int Avatar::GetDungeonX() const
{
	return dungeonX;
}
void Avatar::SetDungeonY(int y)
{
	if(y >= 0)	dungeonY = y;
	else		dungeonY = 0;
}
int Avatar::GetDungeonY() const
{
	return dungeonY;
}
void Avatar::SetDungeonZ(int z)
{
	if(z >= 0)	dungeonZ = z;
	else		dungeonZ = 0;
}
int Avatar::GetDungeonZ() const
{
	return dungeonZ;
}
/*





*/