Ti fix the head issue make sure that that race has enough heads as not all do. Otherwise it might be issues with them spawning then them perceiving you which might have a clearallaction() or just a lag issue. below is what I do and it seems to work. I have a lot of custom functions but it will get you on the right track. Let me know if you want any other functions and I will post them. setting a variable on the area will run a demographics model so this can work in the Underdark and other areas of your above ground worlds. This was not all my work btw I just pieced it together and asked a lot of questions in here.
from on spawn
AssignCommand(oNPC, ClearAllActions());AssignCommand(oNPC,SetRandomSubrace(oNPC));AssignCommand(oNPC,vec_SetRandomName(oNPC));AssignCommand(oNPC,SetRandomAppearance());AssignCommand(oNPC,SetRandomPhenotype (oNPC));AssignCommand(oNPC,SetRandomSkin(oNPC));AssignCommand(oNPC,SetRandomHair (oNPC));AssignCommand(oNPC,SetCreatureBodyPart(CREATURE_PART_HEAD, iNewApp, oNPC));DelayCommand(1.5,DressTheNPC (oNPC));
Her is the include file
//////////////////////////////////////////////////////////////////////////////////:: FILENAME: "vec_random_inc"//:: Description: Include file for creating randomly designed npcs in an area//:: Features of the randomization (based on area variables://:: 1) Random Subrace 7) Random clothing and cloak//:: 2) Random Head
Random Name (Specific to race and gender)//:: 3) Random Hair Color 9)Random Ability bonuses//:: 4) Random Skin Color 10)Random Faction Allegiance//:: 5) Random Clothing 11) Random Description (see the "00_descriptions")//:: 6) Random PhenoType 12) Faction///////////////////////////////////////////////////////////////////////////:: Created By: DM_Vecna//:: Created On: January/2010////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#include "00_descriptions"
//recognized Regionsconst string sRegion_1 = "Benzor" ;const string sRegion_2 = "Brosna" ;const string sRegion_3 = "Hebdezi" ;const string sRegion_4 = "Jumon" ;const string sRegion_5 = "Mulrok" ;const string sRegion_6 = "Jacala" ;const string sRegion_7 = "Elven" ;const string sRegion_8 = "Dwarven" ;const string sRegion_9 = "Underdark" ;const string sRegion_10 = "Drow" ;const string sRegion_11 = "Duergar" ;const string sRegion_12 = "Svirfneblin" ;const string sRegion_13 = "Rhumania" ;
//recognized subracesconst string sHuman_1 = "Demorocles" ; //Benzorconst string sHuman_2 = "Aspian" ; //Brosnaconst string sHuman_3 = "Hebdezi" ; //Abizconst string sHuman_4 = "Bohemee" ; //Rhumanian aka: Gypsyconst string sHuman_5 = "Ing" ; //Jumonconst string sHuman_6 = "Jacala" ; //Jungle Savanahconst string sElf_1 = "High" ; //High Elfconst string sElf_2 = "Sun" ; //Sun Elfconst string sElf_3 = "Drow" ; //Drow Elfconst string sDwarf_1 = "Shield" ; //Shield Dwarfconst string sDwarf_2 = "Duergar" ; //Duergarconst string sGnome_1 = "rock" ; //Rock Gnomeconst string sGnome_2 = "Svirfneblin" ; //Svirfneblinconst string sHalfling_1 = "Halfling" ; //Halflingconst string sHalfOrc_1 = "Half Orc" ; //Half Orcconst string sHalfElf_1 = "Half Elf" ; //Half Elfconst string sMonster_1 = "Gnoll" ; //Gnollconst string sMonster_2 = "Goblin" ; //Goblinconst string sMonster_3 = "Ilithid" ; //Ilithidconst string sMonster_4 = "Orc" ; //Orc
///// FUNCTION DECLARATIONS ////////////////////////////////////////////////////
//sets a random subrace based upon the region of the area the NPC was spawned in.void SetRandomSubrace(object oNPC = OBJECT_SELF);
//Sets a random appearance based upon the subrace field.void SetRandomAppearance();
void SetRandomSkin(object oNPC = OBJECT_SELF);
void SetRandomHair(object oNPC = OBJECT_SELF);
void DressTheNPC(object oNPC = OBJECT_SELF);
/////////////////////////////////////////////////////////////////////////////////////////////SetRandomSubrace
void SetRandomSubrace(object oNPC = OBJECT_SELF){object oNPC = OBJECT_SELF;object oArea = GetArea(OBJECT_SELF);string sRegion = GetLocalString (oArea, "region");int nSubrace = Random(100);
//if(nRace >= 5 && nRace <= 6)
if (sRegion == sRegion_1) /////////////////////////////////Benzor/Demorocles { if (nSubrace <=60) SetSubRace (oNPC, sHuman_1); //Demorocles if (nSubrace >=61 && nSubrace <=70) SetSubRace (oNPC, sHuman_2); //Aspian if (nSubrace >=71 && nSubrace <=75) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=76 && nSubrace <=78) SetSubRace (oNPC, sHuman_4); //Gypsy if (nSubrace >=79 && nSubrace <=83) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=84 && nSubrace <=91) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=92 && nSubrace <=98) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace >=99 && nSubrace <=99) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace ==100) SetSubRace (oNPC, sHalfOrc_1); //Half Orc return; }else if (sRegion == sRegion_2) /////////////////////////////////////Brosna/Aspian { if (nSubrace <=09) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=10 && nSubrace <=70) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=71 && nSubrace <=75) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=76 && nSubrace <=76) SetSubRace (oNPC, sHuman_4); //Gypsy if (nSubrace >=77 && nSubrace <=80) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=81 && nSubrace <=85) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=86 && nSubrace <=98) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace ==99) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace ==100) SetSubRace (oNPC, sHalfOrc_1); //Half Orc return; }else if (sRegion == sRegion_3) /////////////////////////////////////Abiz/Jacala { if (nSubrace <=10) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=11 && nSubrace <=15) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=16 && nSubrace <=70) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=71 && nSubrace <=80) SetSubRace (oNPC, sHuman_4); //Gypsy if (nSubrace >=81 && nSubrace <=82) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=83 && nSubrace <=88) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=89 && nSubrace <=95) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace >=96 && nSubrace <=99) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace ==100) SetSubRace (oNPC, sHalfOrc_1); //Half Orc return; }else if (sRegion == sRegion_4) /////////////////////////////////////////Jumon/Ing { if (nSubrace <=00) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace ==01) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace ==02) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=3 && nSubrace <=95) SetSubRace (oNPC, sHuman_5); //Jumon if (nSubrace ==96) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace ==97) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace ==98) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace ==99) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace ==100) SetSubRace (oNPC, sHalfOrc_1); //Half Orc return; }else if (sRegion == sRegion_5) ////////////////////////////////////// Mulrok/All { if (nSubrace <=10) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=11 && nSubrace <=15) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=16 && nSubrace <=25) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=26 && nSubrace <=28) SetSubRace (oNPC, sHuman_4); //Gypsy if (nSubrace >=29 && nSubrace <=35) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=36 && nSubrace <=45) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=46 && nSubrace <=55) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace >=56 && nSubrace <=60) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace >=61 && nSubrace <=65) SetSubRace (oNPC, sHalfOrc_1); //Half Orc if (nSubrace >=66 && nSubrace <=85) SetSubRace (oNPC, sElf_3); //Drow if (nSubrace >=86 && nSubrace <=95) SetSubRace (oNPC, sDwarf_2); //Duergar if (nSubrace >=96 && nSubrace <=100) SetSubRace (oNPC, sGnome_2); //Svirfneblin return; }else if (sRegion == sRegion_6) ///////////////////////////////////////////Jacala { SetSubRace (oNPC, sHuman_6); //Jacala return; }else if (sRegion == sRegion_7) /////////////////////////////////////////////Elven { if (nSubrace <=01) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=02 && nSubrace <=03) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=04 && nSubrace <=74) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=75 && nSubrace <=94) SetSubRace (oNPC, sElf_2); //Sun Elf if (nSubrace ==95) SetSubRace (oNPC, sHalfling_1); //Halfling if (nSubrace >=96 && nSubrace <=100) SetSubRace (oNPC, sHalfElf_1); //Half Elf return; }else if (sRegion == sRegion_8) ///////////////////////////////////////////Dwarven { if (nSubrace <=02) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=03 && nSubrace <=05) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=06 && nSubrace <=10) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=11 && nSubrace <=100) SetSubRace (oNPC, sDwarf_1); //Dwarf return; }else if (sRegion == sRegion_9) /////////////////////////////////////////Underdark { if (nSubrace ==00) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace ==01) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace ==02) SetSubRace (oNPC, sHuman_3); //Abiz if (nSubrace >=03 && nSubrace <=17) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace >=18 && nSubrace <=20) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace >=21 && nSubrace <=25) SetSubRace (oNPC, sHalfOrc_1); //Half Orc if (nSubrace >=26 && nSubrace <=40) SetSubRace (oNPC, sElf_3); //Drow if (nSubrace >=41 && nSubrace <=65) SetSubRace (oNPC, sDwarf_2); //Duergar if (nSubrace >=66 && nSubrace <=80) SetSubRace (oNPC, sGnome_2); //Svirfneblin if (nSubrace >=81 && nSubrace <=95) SetSubRace (oNPC, sMonster_2); //Goblin if (nSubrace >=96 && nSubrace <=100) SetSubRace (oNPC, sMonster_4); //Orc return; }else if (sRegion == sRegion_10) //////////////////////////////////////////////Drow { if (nSubrace ==00) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace ==01) SetSubRace (oNPC, sHalfOrc_1); //Half Orc if (nSubrace >=02 && nSubrace <=85) SetSubRace (oNPC, sElf_3); //Drow if (nSubrace >=86 && nSubrace <=90) SetSubRace (oNPC, sDwarf_2); //Duergar if (nSubrace >=91 && nSubrace <=96) SetSubRace (oNPC, sMonster_2); //Goblin if (nSubrace >=97 && nSubrace <=98) SetSubRace (oNPC, sMonster_3); //Ilithid if (nSubrace >=99 && nSubrace <=100) SetSubRace (oNPC, sMonster_4); //Orc return; }else if (sRegion == sRegion_11) /////////////////////////////////////////Duergar { if (nSubrace ==00) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace ==01) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=02 && nSubrace <=03) SetSubRace (oNPC, sHalfOrc_1); //Half Orc if (nSubrace >=04 && nSubrace <=13) SetSubRace (oNPC, sElf_3); //Drow if (nSubrace >=14 && nSubrace <=98) SetSubRace (oNPC, sDwarf_2); //Duergar if (nSubrace ==99) SetSubRace (oNPC, sMonster_2); //Goblin if (nSubrace ==100) SetSubRace (oNPC, sMonster_4); //Orc return; }else if (sRegion == sRegion_12) //////////////////////////////////////Svirfneblin { if (nSubrace <=02) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=03 && nSubrace <=10) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=11 && nSubrace <=15) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace >=16 && nSubrace <=20) SetSubRace (oNPC, sHalfElf_1); //Half Elf if (nSubrace >=21 && nSubrace <=100) SetSubRace (oNPC, sGnome_2); //Svirfneblin return; }else if (sRegion == sRegion_13) /////////////////////////////////Rhumania { if (nSubrace <=7) SetSubRace (oNPC, sHuman_1); //Benzor if (nSubrace >=08 && nSubrace <=14) SetSubRace (oNPC, sHuman_2); //Brosna if (nSubrace >=15 && nSubrace <=70) SetSubRace (oNPC, sHuman_4); //Gypsy if (nSubrace >=71 && nSubrace <=90) SetSubRace (oNPC, sElf_1); //High Elf if (nSubrace >=91 && nSubrace <=95) SetSubRace (oNPC, sHalfling_1);//Halfling if (nSubrace >=96 && nSubrace <=99) SetSubRace (oNPC, sDwarf_1); //Dwarf if (nSubrace ==100) SetSubRace (oNPC, sHalfElf_1); //Half Elf return; }else { SetSubRace (oNPC, sHuman_1); return; }}//////////////////////////////////////////////////////////////////////////////////////SetRandomAppearancevoid SetRandomAppearance(){string sSubRace = GetSubRace (OBJECT_SELF);
if (sSubRace == sHuman_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN); return; }else if (sSubRace == sHuman_2) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN);return; }else if (sSubRace == sHuman_3) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN); return; }else if (sSubRace == sHuman_4) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN);return; }else if (sSubRace == sHuman_5) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN); return; }else if (sSubRace == sElf_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_ELF); return; }else if (sSubRace == sElf_2) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_ELF); return; }else if (sSubRace == sElf_3) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_ELF); return; }else if (sSubRace == sDwarf_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_DWARF); return; }else if (sSubRace == sDwarf_2) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_DWARF); return; }else if (sSubRace == sGnome_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_GNOME); return; }else if (sSubRace == sGnome_2) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_GNOME); return; }else if (sSubRace == sHalfling_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALFLING); return; }else if (sSubRace == sHalfOrc_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALF_ORC); return; }else if (sSubRace == sHalfElf_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALF_ELF); return; }else if (sSubRace == sMonster_1) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_GNOLL_WARRIOR); return; }else if (sSubRace == sMonster_2) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_GOBLIN_A); return; }else if (sSubRace == sMonster_3) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_MINDFLAYER); return; }else if (sSubRace == sMonster_4) { SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_ORC_A); return; }
}
////////////////////////////////////////////////////////////////////////////////////////////////Phenoytpevoid SetRandomPhenotype(object oNPC = OBJECT_SELF){int nPhenotype = Random(9);string sSubRace = GetSubRace (OBJECT_SELF);
if (sSubRace == sHuman_1) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHuman_2) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHuman_3) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHuman_4) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHuman_5) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sElf_1) { if(nPhenotype <=0) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sElf_2) { if(nPhenotype <=0) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sElf_3) { if(nPhenotype <=0) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sDwarf_1) { if(nPhenotype <=5) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sDwarf_2) { if(nPhenotype <=5) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sGnome_1) { if(nPhenotype <=3) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sGnome_2) { if(nPhenotype <=3) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHalfling_1) { if(nPhenotype <=3) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHalfOrc_1) { if(nPhenotype <=5) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (sSubRace == sHalfElf_1) { if(nPhenotype <=1) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_DWARF) { if(nPhenotype <=5) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_ELF) { if(nPhenotype <=0) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_GNOME) { if(nPhenotype <=3) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFELF) { if(nPhenotype <=1) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFLING) { if(nPhenotype <=3) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFORC) { if(nPhenotype <=5) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HUMAN) { if(nPhenotype <=2) { SetPhenoType(PHENOTYPE_BIG, oNPC); return; } else { SetPhenoType(PHENOTYPE_NORMAL, oNPC); return; } return; } return;}
////////////////////////////////////////////////////////////////////////////////////////////////Skinvoid SetRandomSkin(object oNPC = OBJECT_SELF){//hair and skinint nSkinColor = Random(3);int nSkinToUse;
string sSubRace = GetSubRace (OBJECT_SELF);
if (sSubRace == sHuman_1)//Benzor { switch (nSkinColor) { case 0: nSkinToUse = 2; break; case 1: nSkinToUse = 3; break; case 2: nSkinToUse = 2; break; case 3: nSkinToUse = 3; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHuman_2)//Brosna { switch (nSkinColor) { case 0:nSkinToUse = 0; break; case 1:nSkinToUse = 1; break; case 2:nSkinToUse = 117; break; case 3:nSkinToUse = 118; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHuman_3) //hebdezi { switch (nSkinColor) { case 0:nSkinToUse = 4; break; case 1:nSkinToUse = 5; break; case 2:nSkinToUse = 15; break; case 3:nSkinToUse = 4; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHuman_4) //behomee { switch (nSkinColor) { case 0:nSkinToUse = 118; break; case 1:nSkinToUse = 119; break; case 2:nSkinToUse = 118; break; case 3:nSkinToUse = 119; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHuman_5) //Ing { switch (nSkinColor) { case 0:nSkinToUse = 9; break; case 1:nSkinToUse = 9; break; case 2:nSkinToUse = 10; break; case 3:nSkinToUse = 24; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHuman_6) //Jacala { switch (nSkinColor) { case 0:nSkinToUse = 7; break; case 1:nSkinToUse = 6; break; case 2:nSkinToUse = 7; break; case 3:nSkinToUse = 6; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sElf_1) { switch (nSkinColor) { case 0:nSkinToUse = 8; break; case 1:nSkinToUse = 12; break; case 2:nSkinToUse = 74; break; case 3:nSkinToUse = 128; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sElf_2)//Sun { switch (nSkinColor) { case 0:nSkinToUse = 3; break; case 1:nSkinToUse = 4; break; case 2:nSkinToUse = 27; break; case 3:nSkinToUse = 10; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sElf_3) //Drow { switch (nSkinColor) { case 0:nSkinToUse = 30; break; case 1:nSkinToUse = 43; break; case 2:nSkinToUse = 63; break; case 3:nSkinToUse = 135; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sDwarf_1) { switch (nSkinColor) { case 0:nSkinToUse = 9; break; case 1:nSkinToUse = 9; break; case 2:nSkinToUse = 10; break; case 3:nSkinToUse = 24; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sDwarf_2) //Duergar { switch (nSkinColor) { case 0:nSkinToUse = 19; break; case 1:nSkinToUse = 31; break; case 2:nSkinToUse = 127; break; case 3:nSkinToUse = 19; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sGnome_1) { switch (nSkinColor) { case 0:nSkinToUse = 74; break; case 1:nSkinToUse = 117; break; case 2:nSkinToUse = 12; break; case 3:nSkinToUse = 74; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sGnome_2)//Svirf { switch (nSkinColor) { case 0:nSkinToUse = 42; break; case 1:nSkinToUse = 17; break; case 2:nSkinToUse = 127; break; case 3:nSkinToUse = 128; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHalfling_1) { switch (nSkinColor) { case 0:nSkinToUse = 0; break; case 1:nSkinToUse = 0; break; case 2:nSkinToUse = 1; break; case 3:nSkinToUse = 1; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHalfOrc_1) { switch (nSkinColor) { case 0:nSkinToUse = 39; break; case 1:nSkinToUse = 107; break; case 2:nSkinToUse = 113; break; case 3:nSkinToUse = 123; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (sSubRace == sHalfElf_1) { switch (nSkinColor) { case 0:nSkinToUse = 1; break; case 1:nSkinToUse = 9; break; case 2:nSkinToUse = 8; break; case 3:nSkinToUse = 3; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_DWARF) { switch (nSkinColor) { case 0:nSkinToUse = 19; break; case 1:nSkinToUse = 31; break; case 2:nSkinToUse = 127; break; case 3:nSkinToUse = 19; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_ELF) { switch (nSkinColor) { case 0:nSkinToUse = 8; break; case 1:nSkinToUse = 12; break; case 2:nSkinToUse = 74; break; case 3:nSkinToUse = 128; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_GNOME) { switch (nSkinColor) { case 0:nSkinToUse = 74; break; case 1:nSkinToUse = 117; break; case 2:nSkinToUse = 12; break; case 3:nSkinToUse = 74; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFELF) { switch (nSkinColor) { case 0:nSkinToUse = 1; break; case 1:nSkinToUse = 9; break; case 2:nSkinToUse = 8; break; case 3:nSkinToUse = 3; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFLING) { switch (nSkinColor) { case 0:nSkinToUse = 0; break; case 1:nSkinToUse = 0; break; case 2:nSkinToUse = 1; break; case 3:nSkinToUse = 1; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HALFORC) { switch (nSkinColor) { case 0:nSkinToUse = 39; break; case 1:nSkinToUse = 107; break; case 2:nSkinToUse = 113; break; case 3:nSkinToUse = 123; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }else if (GetRacialType(oNPC)==RACIAL_TYPE_HUMAN) { switch (nSkinColor) { case 0:nSkinToUse = 0; break; case 1:nSkinToUse = 3; break; case 2:nSkinToUse = 9; break; case 3:nSkinToUse = 7; break; } SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinToUse); return; }
}////////////////////////////////////////////////////////////////////////////////////////////////hairvoid SetRandomHair(object oNPC = OBJECT_SELF){//hair and skinint nHairColor = Random(3);int nHairToUse;
string sSubRace = GetSubRace (OBJECT_SELF);
if (sSubRace == sHuman_1)//Benzor { switch (nHairColor) { case 0: nHairToUse = 15; break; case 1: nHairToUse = 17; break; case 2: nHairToUse = 35; break; case 3: nHairToUse = 15; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sHuman_2)//Brosna { switch (nHairColor) { case 0: nHairToUse = 117; break; case 1: nHairToUse = 120; break; case 2: nHairToUse = 126; break; case 3: nHairToUse = 128; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sHuman_3) //hebdezi { switch (nHairColor) { case 0: nHairToUse = 79; break; case 1: nHairToUse = 127; break; case 2: nHairToUse = 164; break; case 3: nHairToUse = 22; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sHuman_4) //behomee { switch (nHairColor) { case 0: nHairToUse = 20; break; case 1: nHairToUse = 21; break; case 2: nHairToUse = 31; break; case 3: nHairToUse = 9; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sHuman_5) //Ing { switch (nHairColor) { case 0: nHairToUse = 166; break; case 1: nHairToUse = 171; break; case 2: nHairToUse = 23; break; case 3: nHairToUse = 23; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sHuman_6) //Jacala { switch (nHairColor) { case 0: nHairToUse = 23; break; case 1: nHairToUse = 56; break; case 2: nHairToUse = 120; break; case 3: nHairToUse = 15; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sElf_1) { switch (nHairColor) { case 0: nHairToUse = 50; break; case 1: nHairToUse = 9; break; case 2: nHairToUse = 100; break; case 3: nHairToUse = 92; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sElf_2)//Sun { switch (nHairColor) { case 0: nHairToUse = 7; break; case 1: nHairToUse = 49; break; case 2: nHairToUse = 53; break; case 3: nHairToUse = 92; break; } SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairToUse); return; }else if (sSubRace == sElf_3) //Drow { switch (nHairColor) { case 0: nHairToUse = 16; break; case 1: nHairToUse = 166; break; case 2: nHairToUse = 164; break; case 3: nHairToUse = 16; break; &