HoS_PRC8/_mod/_module/nss/pc_custom_random.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

179 lines
7.1 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// pc_custom_random - Adjust the PC to a random appearance
// By Deva B. Winblood. December 13th, 2008
////////////////////////////////////////////////////////////////////////////////
#include "prc_inc_racial"
int StartingConditional()
{
int bRet=FALSE;
object oPC=GetPCSpeaker();
int nParm=GetLocalInt(oPC,"nParm");
int nRace=MyPRCGetRacialType(oPC);
int nGender=GetGender(oPC);
if (nParm==0&&nRace==RACIAL_TYPE_HALFLING) bRet=TRUE;
else if (nParm==2&&nRace==RACIAL_TYPE_HALFLING) bRet=TRUE;
else if (nParm==3&&nRace==RACIAL_TYPE_GNOME&&nGender==GENDER_MALE) bRet=TRUE;
else if (nParm==4&&nRace==RACIAL_TYPE_HALFORC) bRet=TRUE;
else if (nParm==5&&nRace==RACIAL_TYPE_ELF) bRet=TRUE;
else if (nParm==6&&nRace==RACIAL_TYPE_HALFORC) bRet=TRUE;
else if (nParm==8&&nRace==RACIAL_TYPE_HUMAN) bRet=TRUE;
else if (nParm==1||nParm==7) bRet=TRUE;
if (bRet)
{ // valid parameters
FadeToBlack(oPC);
int nTail=14;
int nHead=-1;
int nSkin=-1;
int nHair=-1;
int nApp=-1;
string sSubRace="";
int nR;
if (nParm==0)
{ // brownie
nApp=1002;
nHead=Random(10);
nTail=0;
sSubRace="Brownie";
} // brownie
else if (nParm==1)
{ // non-brownie
nApp=3;
} // non-brownie
else if (nParm==2)
{ // kobold
nApp=3;
nTail=2797;
nR=d4();
if (nR==1&&nGender==GENDER_FEMALE) nHead=176;
else if (nR==1) nHead=169;
else if (nR==2&&nGender==GENDER_FEMALE) nHead=175;
else if (nR==2) nHead=168;
else if (nR==3&&nGender==GENDER_FEMALE) nHead=174;
else if (nR==3) nHead=167;
else if (nR==4&&nGender==GENDER_FEMALE) nHead=173;
else if (nR==4) nHead=166;
nR=d6();
if (nR==1) nSkin=16;
else if (nR==2) nSkin=19;
else if (nR==3) nSkin=39;
else if (nR==4) nSkin=49;
else if (nR==5) nSkin=53;
else if (nR==6) nSkin=54;
nR=Random(5)+1;
if (nR==1) nHair=7;
else if (nR==2) nHair=15;
else if (nR==3) nHair=22;
else if (nR==4) nHair=52;
else if (nR==5) nHair=60;
sSubRace="Kobold";
} // kobold
else if (nParm==3)
{ // Goblin
nApp=2;
nR=Random(9)+1;
if (nR==1) nHead=33;
else if (nR==2) nHead=32;
else if (nR==3) nHead=31;
else if (nR==4) nHead=30;
else if (nR==5) nHead=29;
else if (nR==6) nHead=28;
else if (nR==7) nHead=27;
else if (nR==8) nHead=26;
else if (nR==9) nHead=25;
nR=Random(16)+1;
if (nR==1) nSkin=5;
else if (nR==2) nSkin=23;
else if (nR==3) nSkin=34;
else if (nR==4) nSkin=35;
else if (nR==5) nSkin=38;
else if (nR==6) nSkin=39;
else if (nR==7) nSkin=49;
else if (nR==8) nSkin=50;
else if (nR==9) nSkin=52;
else if (nR==10) nSkin=53;
else if (nR==11) nSkin=67;
else if (nR==12) nSkin=78;
else if (nR==13) nSkin=80;
else if (nR==14) nSkin=95;
else if (nR==15) nSkin=107;
else if (nR==16) nSkin=111;
sSubRace="Goblin";
} // Goblin
else if (nParm==4)
{ // Half-Ogre
nTail=0;
sSubRace="Half-Ogre";
} // Half-Ogre
else if (nParm==5)
{ // Drow
nApp=1;
sSubRace="Drow";
} // Drow
else if (nParm==6)
{ // Wemic
nTail=0;
nApp=1000;
if (nGender==GENDER_FEMALE) nHead=Random(2)+1;
else { nHead=d4(); }
sSubRace="Wemic";
} // Wemic
else if (nParm==7)
{ // Non-Wemic
nApp=5;
nHead=Random(10);
} // Non-Wemic
else if (nParm==8)
{ // Skeleton
nTail=0;
sSubRace="Skeleton";
nApp=1769;
nR=Random(5)+1;
if (nR==1) nHead=1;
else if (nR==2) nHead=2;
else if (nR==3) nHead=4;
else if (nR==4) nHead=5;
else if (nR==5) nHead=7;
DelayCommand(1.0,SetCreatureBodyPart(CREATURE_PART_RIGHT_FOOT,1,oPC));
DelayCommand(1.2,SetCreatureBodyPart(CREATURE_PART_LEFT_FOOT,1,oPC));
DelayCommand(1.4,SetCreatureBodyPart(CREATURE_PART_RIGHT_SHIN,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(1.6,SetCreatureBodyPart(CREATURE_PART_LEFT_SHIN,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(1.8,SetCreatureBodyPart(CREATURE_PART_RIGHT_THIGH,1,oPC));
DelayCommand(2.0,SetCreatureBodyPart(CREATURE_PART_LEFT_THIGH,1,oPC));
DelayCommand(2.2,SetCreatureBodyPart(CREATURE_PART_PELVIS,1,oPC));
DelayCommand(2.4,SetCreatureBodyPart(CREATURE_PART_TORSO,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(2.6,SetCreatureBodyPart(CREATURE_PART_BELT,1,oPC));
DelayCommand(2.8,SetCreatureBodyPart(CREATURE_PART_NECK,1,oPC));
DelayCommand(3.0,SetCreatureBodyPart(CREATURE_PART_RIGHT_FOREARM,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(3.2,SetCreatureBodyPart(CREATURE_PART_LEFT_FOREARM,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(3.4,SetCreatureBodyPart(CREATURE_PART_RIGHT_BICEP,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(3.6,SetCreatureBodyPart(CREATURE_PART_LEFT_BICEP,CREATURE_MODEL_TYPE_SKIN,oPC));
DelayCommand(3.8,SetCreatureBodyPart(CREATURE_PART_RIGHT_SHOULDER,1,oPC));
DelayCommand(4.0,SetCreatureBodyPart(CREATURE_PART_LEFT_SHOULDER,1,oPC));
DelayCommand(4.2,SetCreatureBodyPart(CREATURE_PART_RIGHT_HAND,1,oPC));
DelayCommand(4.4,SetCreatureBodyPart(CREATURE_PART_LEFT_HAND,1,oPC));
nR=d8();
if (nR==1) nSkin=16;
else if (nR==2) nSkin=18;
else if (nR==3) nSkin=20;
else if (nR==4) nSkin=23;
else if (nR==5) nSkin=30;
else if (nR==6) nSkin=36;
else if (nR==7) nSkin=40;
else if (nR==8) nSkin=60;
SetColor(oPC,COLOR_CHANNEL_TATTOO_1,52);
SetColor(oPC,COLOR_CHANNEL_TATTOO_2,55);
} // Skeleton
sSubRace=GetStringUpperCase(sSubRace);
SetSubRace(oPC,sSubRace);
if (nApp>-1&&GetAppearanceType(oPC)!=nApp) SetCreatureAppearanceType(oPC,nApp);
if (nTail>-1&&GetCreatureTailType(oPC)!=nTail) SetCreatureTailType(nTail,oPC);
if (nHead>-1&&GetCreatureBodyPart(CREATURE_PART_HEAD,oPC)!=nHead) SetCreatureBodyPart(CREATURE_PART_HEAD,nHead,oPC);
if (nSkin>-1) SetColor(oPC,COLOR_CHANNEL_SKIN,nSkin);
if (nHair>-1) SetColor(oPC,COLOR_CHANNEL_HAIR,nHair);
DelayCommand(2.0,FadeFromBlack(oPC));
} // valid parameters
return bRet;
}