From 6dcf7a470929431f170f05cb91744cd7f3ba7a4a Mon Sep 17 00:00:00 2001 From: Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com> Date: Fri, 12 Jan 2024 07:36:10 -0500 Subject: [PATCH] Genasi notes Genasi notes --- _notes_/Genasi/ds_enf_genasi.ncs | Bin 0 -> 34181 bytes _notes_/Genasi/ds_enf_genasi.nss | 1005 +++++++++++++++++++++++++++++ _notes_/Genasi/genasi color.nss | 1007 +++++++++++++++++++++++++++++- 3 files changed, 1996 insertions(+), 16 deletions(-) create mode 100644 _notes_/Genasi/ds_enf_genasi.ncs create mode 100644 _notes_/Genasi/ds_enf_genasi.nss diff --git a/_notes_/Genasi/ds_enf_genasi.ncs b/_notes_/Genasi/ds_enf_genasi.ncs new file mode 100644 index 0000000000000000000000000000000000000000..82e63bdebe97b45a0ad32c1d8f21a20b54b084cc GIT binary patch literal 34181 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 literal 0 HcmV?d00001 diff --git a/_notes_/Genasi/ds_enf_genasi.nss b/_notes_/Genasi/ds_enf_genasi.nss new file mode 100644 index 000000000..9a7048e10 --- /dev/null +++ b/_notes_/Genasi/ds_enf_genasi.nss @@ -0,0 +1,1005 @@ +//:: ds_enf_genasi.nss +/* +* Checks that PC Genasis are using an appropriate +* skin & hair color for their racialtype & set +* them to an appropriate color if not. +* +*/ + +#include "prc_inc_racial" + +int CheckAirGenasiSkin(object oPC); +int CheckAirGenasiHair(object oPC); +void RndAirGenasiSkin(object oPC); +void RndAirGenasiHair(object oPC); +int CheckEarthGenasiSkin(object oPC); +int CheckEarthGenasiHair(object oPC); +void RndEarthGenasiSkin(object oPC); +void RndEarthGenasiHair(object oPC); +int CheckFireGenasiSkin(object oPC); +int CheckFireGenasiHair(object oPC); +void RndFireGenasiSkin(object oPC); +void RndFireGenasiHair(object oPC); +int CheckWaterGenasiSkin(object oPC); +int CheckWaterGenasiHair(object oPC); +void RndWaterGenasiSkin(object oPC); +void RndWaterGenasiHair(object oPC); +int CheckMagmaGenasiSkin(object oPC); +int CheckMagmaGenasiHair(object oPC); +void RndMagmaGenasiSkin(object oPC); +void RndMagmaGenasiHair(object oPC); +int CheckRainGenasiSkin(object oPC); +int CheckRainGenasiHair(object oPC); +void RndRainGenasiSkin(object oPC); +void RndRainGenasiHair(object oPC); +int CheckSiltGenasiSkin(object oPC); +int CheckSiltGenasiHair(object oPC); +void RndSiltGenasiSkin(object oPC); +void RndSiltGenasiHair(object oPC); +int CheckSunGenasiSkin(object oPC); +int CheckSunGenasiHair(object oPC); +void RndSunGenasiSkin(object oPC); +void RndSunGenasiHair(object oPC); + +void main () +{ + object oPC = OBJECT_SELF; + +//:: Check & fix Air Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN && CheckAirGenasiSkin(oPC) != TRUE) + { + RndAirGenasiSkin(oPC); + } + +//:: Check & fix Air Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN && CheckAirGenasiHair(oPC) != TRUE) + { + RndAirGenasiHair(oPC); + } + +//:: Check & fix Earth Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN && CheckEarthGenasiSkin(oPC) != TRUE) + { + RndEarthGenasiSkin(oPC); + } + +//:: Check & fix Earth Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN && CheckEarthGenasiHair(oPC) != TRUE) + { + RndEarthGenasiHair(oPC); + } + +//:: Check & fix Fire Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN && CheckFireGenasiSkin(oPC) != TRUE) + { + RndFireGenasiSkin(oPC); + } + +//:: Check & fix Fire Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN && CheckFireGenasiHair(oPC) != TRUE) + { + RndFireGenasiHair(oPC); + } + +//:: Check & fix Water Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN && CheckWaterGenasiSkin(oPC) != TRUE) + { + RndWaterGenasiSkin(oPC); + } + +//:: Check & fix Water Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN && CheckWaterGenasiHair(oPC) != TRUE) + { + RndWaterGenasiHair(oPC); + } + +//:: Check & fix Magma Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN && CheckMagmaGenasiSkin(oPC) != TRUE) + { + RndMagmaGenasiSkin(oPC); + } + +//:: Check & fix Magma Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN && CheckMagmaGenasiHair(oPC) != TRUE) + { + RndMagmaGenasiHair(oPC); + } + +//:: Check & fix Rain Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN && CheckRainGenasiSkin(oPC) != TRUE) + { + RndRainGenasiSkin(oPC); + } + +//:: Check & fix Rain Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN && CheckRainGenasiHair(oPC) != TRUE) + { + RndRainGenasiHair(oPC); + } + +//:: Check & fix Silt Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN && CheckSiltGenasiSkin(oPC) != TRUE) + { + RndSiltGenasiSkin(oPC); + } + +//:: Check & fix Silt Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN && CheckSiltGenasiHair(oPC) != TRUE) + { + RndSiltGenasiHair(oPC); + } + +//:: Check & fix Sun Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN && CheckSunGenasiSkin(oPC) != TRUE) + { + RndSunGenasiSkin(oPC); + } + +//:: Check & fix Sun Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN && CheckSunGenasiHair(oPC) != TRUE) + { + RndSunGenasiHair(oPC); + } + +} + +//:: Checks for valid Air Genasi skin color channel +int CheckAirGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 20 && nSkinColor <= 23) || + (nSkinColor == 40) || + (nSkinColor >= 50 && nSkinColor <= 51) || + (nSkinColor >= 132 && nSkinColor <= 133) || + (nSkinColor >= 136 && nSkinColor <= 137) || + (nSkinColor >= 140 && nSkinColor <= 141) || + (nSkinColor >= 148 && nSkinColor <= 149) || + (nSkinColor == 164) || + (nSkinColor == 166); +} + +//:: Checks for valid Air Genasi hair color channel +int CheckAirGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 35) || + (nHairColor == 44) || + (nHairColor == 46) || + (nHairColor == 54) || + (nHairColor == 56) || + (nHairColor == 57) || + (nHairColor == 70) || + (nHairColor >= 77 && nHairColor <= 79) || + (nHairColor >= 82 && nHairColor <= 84) || + (nHairColor >= 128 && nHairColor <= 150) || + (nHairColor >= 163 && nHairColor <= 171); +} + +// Function to randomly set oPC's skin color channel for Air Genasi +void RndAirGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(9); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = 20 + Random(4); // Range 20-23 + else if (randomNum == 1) randomSkinColor = 40; + else if (randomNum == 2) randomSkinColor = 50 + Random(2); // Range 50-51 + else if (randomNum == 3) randomSkinColor = 132 + Random(2); // Range 132-133 + else if (randomNum == 4) randomSkinColor = 136 + Random(2); // Range 136-137 + else if (randomNum == 5) randomSkinColor = 140 + Random(2); // Range 140-141 + else if (randomNum == 6) randomSkinColor = 148 + Random(2); // Range 148-149 + else if (randomNum == 7) randomSkinColor = 164; + else if (randomNum == 8) randomSkinColor = 166; + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Air Genasi +void RndAirGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(11); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum == 0) randomHairColor = Random(20) + 16; // Range 16-35 + else if (randomNum == 1) randomHairColor = 44; // Single value + else if (randomNum == 2) randomHairColor = 46; // Single value + else if (randomNum == 3) randomHairColor = 54; // Single value + else if (randomNum == 4) randomHairColor = 56; // Single value + else if (randomNum == 5) randomHairColor = 57; // Single value + else if (randomNum == 6) randomHairColor = 70; // Single value + else if (randomNum == 7) randomHairColor = Random(3) + 77; // Range 77-79 + else if (randomNum == 8) randomHairColor = Random(3) + 82; // Range 82-84 + else if (randomNum == 9) randomHairColor = Random(23) + 128; // Range 128-150 + else if (randomNum == 10) randomHairColor = Random(9) + 163; // Range 163-171 + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Earth Genasi skin color channel +int CheckEarthGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 3 && nSkinColor <= 7) || + (nSkinColor == 11) || + (nSkinColor >= 14 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 21 && nSkinColor <= 23) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor == 35) || + (nSkinColor >= 37 && nSkinColor <= 39) || + (nSkinColor >= 42 && nSkinColor <= 43) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor == 63) || + (nSkinColor >= 74 && nSkinColor <= 79) || + (nSkinColor >= 80 && nSkinColor <= 87) || + (nSkinColor >= 103 && nSkinColor <= 127) || + (nSkinColor >= 130 && nSkinColor <= 135) || + (nSkinColor >= 155 && nSkinColor <= 157) || + (nSkinColor >= 167 && nSkinColor <= 174); +} + +//:: Checks for valid Earth Genasi hair color channel +int CheckEarthGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 0 && nHairColor <= 3) || + (nHairColor == 7) || + (nHairColor >= 13 && nHairColor <= 15) || + (nHairColor == 19) || + (nHairColor == 23) || + (nHairColor >= 27 && nHairColor <= 31) || + (nHairColor == 35) || + (nHairColor >= 37 && nHairColor <= 39) || + (nHairColor == 41) || + (nHairColor == 43) || + (nHairColor == 47) || + (nHairColor == 49) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor == 63) || + (nHairColor >= 69 && nHairColor <= 71) || + (nHairColor >= 74 && nHairColor <= 79) || + (nHairColor >= 80 && nHairColor <= 86) || + (nHairColor >= 96 && nHairColor <= 135) || + (nHairColor >= 148 && nHairColor <= 159) || + (nHairColor >= 165 && nHairColor <= 174); +} + +// Function to randomly set oPC's skin color channel for Earth Genasi +void RndEarthGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(18); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = Random(5) + 3; // Range 3-7 + else if (randomNum == 1) randomSkinColor = 11; // Range 11 + else if (randomNum == 2) randomSkinColor = Random(2) + 14; // Range 14-15 + else if (randomNum == 3) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum == 4) randomSkinColor = Random(3) + 21; // Range 21-23 + else if (randomNum == 5) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum == 6) randomSkinColor = 35; // Range 35 + else if (randomNum == 7) randomSkinColor = Random(3) + 37; // Range 37-39 + else if (randomNum == 8) randomSkinColor = Random(2) + 42; // Range 42-43 + else if (randomNum == 9) randomSkinColor = 57; // Range 57 + else if (randomNum == 10) randomSkinColor = 60; // Range 60 + else if (randomNum == 11) randomSkinColor = 63; // Range 63 + else if (randomNum == 12) randomSkinColor = Random(6) + 74; // Range 74-79 + else if (randomNum == 13) randomSkinColor = Random(8) + 80; // Range 80-87 + else if (randomNum == 14) randomSkinColor = Random(25) + 103; // Range 103-127 + else if (randomNum == 15) randomSkinColor = Random(6) + 130; // Range 130-135 + else if (randomNum == 16) randomSkinColor = Random(3) + 155; // Range 155-157 + else if (randomNum == 17) randomSkinColor = Random(8) + 167; // Range 167-174 + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Earth Genasi +void RndEarthGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(99); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 3) randomHairColor = Random(4); // Range 0-3 + else if (randomNum == 4) randomHairColor = 7; + else if (randomNum >= 5 && randomNum <= 7) randomHairColor = Random(3) + 13; // Range 13-15 + else if (randomNum == 8) randomHairColor = 19; + else if (randomNum == 9) randomHairColor = 23; + else if (randomNum >= 10 && randomNum <= 14) randomHairColor = Random(5) + 27; // Range 27-31 + else if (randomNum == 15) randomHairColor = 35; + else if (randomNum >= 16 && randomNum <= 18) randomHairColor = Random(3) + 37; // Range 37-39 + else if (randomNum == 19) randomHairColor = 41; + else if (randomNum == 20) randomHairColor = 43; + else if (randomNum == 21) randomHairColor = 47; + else if (randomNum == 22) randomHairColor = 49; + else if (randomNum == 23) randomHairColor = 57; + else if (randomNum == 24) randomHairColor = 60; + else if (randomNum == 25) randomHairColor = 63; + else if (randomNum >= 26 && randomNum <= 28) randomHairColor = Random(3) + 69; // Range 69-71 + else if (randomNum >= 29 && randomNum <= 33) randomHairColor = Random(5) + 74; // Range 74-79 + else if (randomNum >= 34 && randomNum <= 40) randomHairColor = Random(7) + 80; // Range 80-86 + else if (randomNum >= 41 && randomNum <= 79) randomHairColor = Random(39) + 96; // Range 96-134 + else if (randomNum >= 80 && randomNum <= 99) randomHairColor = Random(20) + 148; // Range 148-167 + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Fire Genasi skin color channel +int CheckFireGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 4 && nSkinColor <= 7) || + (nSkinColor >= 12 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 22 && nSkinColor <= 23) || + (nSkinColor >= 27 && nSkinColor <= 31) || + (nSkinColor >= 42 && nSkinColor <= 47) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor == 63) || + (nSkinColor >= 64 && nSkinColor <= 67) || + (nSkinColor >= 73 && nSkinColor <= 75) || + (nSkinColor == 79) || + (nSkinColor == 81) || + (nSkinColor >= 83 && nSkinColor <= 103) || + (nSkinColor >= 112 && nSkinColor <= 119) || + (nSkinColor >= 123 && nSkinColor <= 127) || + (nSkinColor >= 131 && nSkinColor <= 135) || + (nSkinColor >= 156 && nSkinColor <= 162) || + (nSkinColor >= 167 && nSkinColor <= 171) || + (nSkinColor == 173); +} + +//:: Checks for valid Fire Genasi hair color channel +int CheckFireGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 1 && nHairColor <= 7) || + (nHairColor == 15) || + (nHairColor == 23) || + (nHairColor == 31) || + (nHairColor == 47) || + (nHairColor >= 48 && nHairColor <= 49) || + (nHairColor >= 51 && nHairColor <= 55) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor == 63) || + (nHairColor >= 64 && nHairColor <= 65) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor == 79) || + (nHairColor >= 84 && nHairColor <= 103) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 118 && nHairColor <= 119) || + (nHairColor >= 123 && nHairColor <= 127) || + (nHairColor >= 131 && nHairColor <= 135) || + (nHairColor >= 155 && nHairColor <= 159) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor == 171) || + (nHairColor >= 173 && nHairColor <= 175); +} + +// Function to randomly set oPC's skin color channel for Fire Genasi +void RndFireGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(87); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 3) randomSkinColor = Random(4) + 4; // Range 4-7 + else if (randomNum >= 4 && randomNum <= 7) randomSkinColor = Random(4) + 12; // Range 12-15 + else if (randomNum >= 8 && randomNum <= 9) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum >= 10 && randomNum <= 11) randomSkinColor = Random(2) + 22; // Range 22-23 + else if (randomNum >= 12 && randomNum <= 16) randomSkinColor = Random(5) + 27; // Range 27-31 + else if (randomNum >= 17 && randomNum <= 22) randomSkinColor = Random(6) + 42; // Range 42-47 + else if (randomNum == 23) randomSkinColor = 57; + else if (randomNum == 24) randomSkinColor = 60; + else if (randomNum == 25) randomSkinColor = 63; + else if (randomNum >= 26 && randomNum <= 29) randomSkinColor = Random(4) + 64; // Range 64-67 + else if (randomNum >= 30 && randomNum <= 32) randomSkinColor = Random(3) + 73; // Range 73-75 + else if (randomNum == 33) randomSkinColor = 79; + else if (randomNum == 34) randomSkinColor = 81; + else if (randomNum >= 35 && randomNum <= 55) randomSkinColor = Random(21) + 83; // Range 83-103 + else if (randomNum >= 56 && randomNum <= 63) randomSkinColor = Random(8) + 112; // Range 112-119 + else if (randomNum >= 64 && randomNum <= 68) randomSkinColor = Random(5) + 123; // Range 123-127 + else if (randomNum >= 69 && randomNum <= 73) randomSkinColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 74 && randomNum <= 80) randomSkinColor = Random(7) + 156; // Range 156-162 + else if (randomNum >= 81 && randomNum <= 85) randomSkinColor = Random(5) + 167; // Range 167-171 + else if (randomNum == 86) randomSkinColor = 173; + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Fire Genasi +void RndFireGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(73); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 6) randomHairColor = Random(7) + 1; // Range 1-7 + else if (randomNum == 7) randomHairColor = 15; + else if (randomNum == 8) randomHairColor = 23; + else if (randomNum == 9) randomHairColor = 31; + else if (randomNum == 10) randomHairColor = 47; + else if (randomNum >= 11 && randomNum <= 12) randomHairColor = Random(2) + 48; // Range 48-49 + else if (randomNum >= 13 && randomNum <= 17) randomHairColor = Random(5) + 51; // Range 51-55 + else if (randomNum == 18) randomHairColor = 57; + else if (randomNum == 19) randomHairColor = 60; + else if (randomNum == 20) randomHairColor = 63; + else if (randomNum >= 21 && randomNum <= 22) randomHairColor = Random(2) + 64; // Range 64-65 + else if (randomNum >= 23 && randomNum <= 24) randomHairColor = Random(2) + 74; // Range 74-75 + else if (randomNum == 25) randomHairColor = 79; + else if (randomNum >= 26 && randomNum <= 45) randomHairColor = Random(20) + 84; // Range 84-103 + else if (randomNum >= 46 && randomNum <= 49) randomHairColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 50 && randomNum <= 51) randomHairColor = Random(2) + 118; // Range 118-119 + else if (randomNum >= 52 && randomNum <= 56) randomHairColor = Random(5) + 123; // Range 123-127 + else if (randomNum >= 57 && randomNum <= 61) randomHairColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 62 && randomNum <= 66) randomHairColor = Random(5) + 155; // Range 155-159 + else if (randomNum == 67) randomHairColor = 165; + else if (randomNum == 68) randomHairColor = 167; + else if (randomNum == 69) randomHairColor = 171; + else if (randomNum >= 70 && randomNum <= 72) randomHairColor = Random(3) + 173; // Range 173-175 + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Water Genasi hair color channel +int CheckWaterGenasiSkin(object oPC) +{ + //:: Get the hair color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the Skin color channel is within any of the specified ranges + return (nSkinColor >= 16 && nSkinColor <= 23) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor >= 32 && nSkinColor <= 43) || + (nSkinColor >= 48 && nSkinColor <= 53) || + (nSkinColor == 60) || + (nSkinColor >= 69 && nSkinColor <= 86) || + (nSkinColor >= 104 && nSkinColor <= 114) || + (nSkinColor >= 124 && nSkinColor <= 127) || + (nSkinColor >= 132 && nSkinColor <= 143) || + (nSkinColor >= 148 && nSkinColor <= 153) || + (nSkinColor == 165) || + (nSkinColor >= 169 && nSkinColor <= 171); +} + +//:: Checks for valid Water Genasi hair color channel +int CheckWaterGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 47) || + (nHairColor >= 67 && nHairColor <= 86) || + (nHairColor >= 104 && nHairColor <= 115) || + (nHairColor >= 121 && nHairColor <= 127) || + (nHairColor >= 132 && nHairColor <= 143) || + (nHairColor >= 148 && nHairColor <= 153) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor >= 169 && nHairColor <= 171) || + (nHairColor == 173); +} + +//:: Function to randomly set oPC's skin color channel for Water Genasi +void RndWaterGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(86); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(8) + 16; // Range 16-23 + else if (randomNum >= 8 && randomNum <= 11) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum >= 12 && randomNum <= 23) randomSkinColor = Random(12) + 32; // Range 32-43 + else if (randomNum >= 24 && randomNum <= 29) randomSkinColor = Random(6) + 48; // Range 48-53 + else if (randomNum == 30) randomSkinColor = 60; + else if (randomNum >= 31 && randomNum <= 48) randomSkinColor = Random(18) + 69; // Range 69-86 + else if (randomNum >= 49 && randomNum <= 59) randomSkinColor = Random(11) + 104; // Range 104-114 + else if (randomNum >= 60 && randomNum <= 63) randomSkinColor = Random(4) + 124; // Range 124-127 + else if (randomNum >= 64 && randomNum <= 75) randomSkinColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 76 && randomNum <= 81) randomSkinColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 82) randomSkinColor = 165; + else if (randomNum >= 83 && randomNum <= 85) randomSkinColor = Random(3) + 169; // Range 169-171 + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +//:: Function to randomly set oPC's hair color channel for Water Genasi +void RndWaterGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(95); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 31) randomHairColor = Random(32) + 16; // Range 16-47 + else if (randomNum >= 32 && randomNum <= 51) randomHairColor = Random(20) + 67; // Range 67-86 + else if (randomNum >= 52 && randomNum <= 63) randomHairColor = Random(12) + 104; // Range 104-115 + else if (randomNum >= 64 && randomNum <= 70) randomHairColor = Random(7) + 121; // Range 121-127 + else if (randomNum >= 71 && randomNum <= 82) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 83 && randomNum <= 88) randomHairColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 89) randomHairColor = 165; + else if (randomNum == 90) randomHairColor = 167; + else if (randomNum >= 91 && randomNum <= 93) randomHairColor = Random(3) + 169; // Range 169-171 + else if (randomNum == 94) randomHairColor = 173; + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Magma Genasi skin color channel +int CheckMagmaGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor == 7) || + (nSkinColor >= 13 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor >= 41 && nSkinColor <= 45) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor >= 63 && nSkinColor <= 65) || + (nSkinColor >= 87 && nSkinColor <= 91) || + (nSkinColor >= 96 && nSkinColor <= 103) || + (nSkinColor >= 112 && nSkinColor <= 115) || + (nSkinColor >= 118 && nSkinColor <= 119) || + (nSkinColor >= 122 && nSkinColor <= 127) || + (nSkinColor >= 131 && nSkinColor <= 135) || + (nSkinColor >= 158 && nSkinColor <= 159) || + (nSkinColor == 165) || + (nSkinColor == 167) || + (nSkinColor == 171) || + (nSkinColor == 173); +} + +// Function to check for valid hair color channel for Magma Genasi +int CheckMagmaGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 3 && nHairColor <= 7) || + (nHairColor == 15) || + (nHairColor >= 22 && nHairColor <= 23) || + (nHairColor == 27) || + (nHairColor >= 30 && nHairColor <= 31) || + (nHairColor == 47) || + (nHairColor == 51) || + (nHairColor == 53) || + (nHairColor == 55) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor >= 63 && nHairColor <= 65) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 103) || + (nHairColor >= 111 && nHairColor <= 115) || + (nHairColor == 119) || + (nHairColor >= 126 && nHairColor <= 127) || + (nHairColor >= 133 && nHairColor <= 135) || + (nHairColor >= 158 && nHairColor <= 159) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor == 171) || + (nHairColor == 173); +} + +// Function to randomly set oPC's skin color channel for Magma Genasi +void RndMagmaGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(58); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = 7; + else if (randomNum >= 1 && randomNum <= 3) randomSkinColor = Random(3) + 13; // Range 13-15 + else if (randomNum >= 4 && randomNum <= 5) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum >= 6 && randomNum <= 9) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum >= 10 && randomNum <= 14) randomSkinColor = Random(5) + 41; // Range 41-45 + else if (randomNum == 15) randomSkinColor = 57; + else if (randomNum == 16) randomSkinColor = 60; + else if (randomNum >= 17 && randomNum <= 19) randomSkinColor = Random(3) + 63; // Range 63-65 + else if (randomNum >= 20 && randomNum <= 24) randomSkinColor = Random(5) + 87; // Range 87-91 + else if (randomNum >= 25 && randomNum <= 32) randomSkinColor = Random(8) + 96; // Range 96-103 + else if (randomNum >= 33 && randomNum <= 36) randomSkinColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 37 && randomNum <= 38) randomSkinColor = Random(2) + 118; // Range 118-119 + else if (randomNum >= 39 && randomNum <= 44) randomSkinColor = Random(6) + 122; // Range 122-127 + else if (randomNum >= 45 && randomNum <= 49) randomSkinColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 50 && randomNum <= 51) randomSkinColor = Random(2) + 158; // Range 158-159 + else if (randomNum == 52) randomSkinColor = 165; + else if (randomNum == 53) randomSkinColor = 167; + else if (randomNum == 54) randomSkinColor = 171; + else if (randomNum == 55) randomSkinColor = 173; + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Magma Genasi +void RndMagmaGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(64); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 4) randomHairColor = Random(5) + 3; // Range 3-7 + else if (randomNum == 5) randomHairColor = 15; // Single value + else if (randomNum >= 6 && randomNum <= 7) randomHairColor = Random(2) + 22; // Range 22-23 + else if (randomNum == 8) randomHairColor = 27; // Single value + else if (randomNum >= 9 && randomNum <= 10) randomHairColor = Random(2) + 30; // Range 30-31 + else if (randomNum == 11) randomHairColor = 47; // Single value + else if (randomNum == 12) randomHairColor = 51; // Single value + else if (randomNum == 13) randomHairColor = 53; // Single value + else if (randomNum == 14) randomHairColor = 55; // Single value + else if (randomNum == 15) randomHairColor = 57; // Single value + else if (randomNum == 16) randomHairColor = 60; // Single value + else if (randomNum >= 17 && randomNum <= 19) randomHairColor = Random(3) + 63; // Range 63-65 + else if (randomNum >= 20 && randomNum <= 21) randomHairColor = Random(2) + 74; // Range 74-75 + else if (randomNum >= 22 && randomNum <= 46) randomHairColor = Random(20) + 84; // Range 84-103 + else if (randomNum >= 47 && randomNum <= 51) randomHairColor = Random(5) + 111; // Range 111-115 + else if (randomNum == 52) randomHairColor = 119; // Single value + else if (randomNum >= 53 && randomNum <= 54) randomHairColor = Random(2) + 126; // Range 126-127 + else if (randomNum >= 55 && randomNum <= 57) randomHairColor = Random(3) + 133; // Range 133-135 + else if (randomNum >= 58 && randomNum <= 59) randomHairColor = Random(2) + 158; // Range 158-159 + else if (randomNum == 60) randomHairColor = 165; // Single value + else if (randomNum == 61) randomHairColor = 167; // Single value + else if (randomNum == 62) randomHairColor = 171; // Single value + else if (randomNum == 63) randomHairColor = 173; // Single value + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Rain Genasi skin color channel +int CheckRainGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 16 && nSkinColor <= 23) || + (nSkinColor == 28) || + (nSkinColor >= 40 && nSkinColor <= 42) || + (nSkinColor >= 48 && nSkinColor <= 51) || + (nSkinColor >= 76 && nSkinColor <= 79) || + (nSkinColor >= 81 && nSkinColor <= 84) || + (nSkinColor >= 112 && nSkinColor <= 114) || + (nSkinColor >= 121 && nSkinColor <= 126) || + (nSkinColor >= 132 && nSkinColor <= 143) || + (nSkinColor >= 148 && nSkinColor <= 151) || + (nSkinColor == 165) || + (nSkinColor >= 167 && nSkinColor <= 169) || + (nSkinColor == 171); +} + +// Function to check for valid hair color channel for Rain Genasi +int CheckRainGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 35) || + (nHairColor >= 69 && nHairColor <= 86) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 124 && nHairColor <= 127) || + (nHairColor >= 132 && nHairColor <= 143) || + (nHairColor >= 148 && nHairColor <= 153) || + (nHairColor == 165) || + (nHairColor >= 167 && nHairColor <= 169) || + (nHairColor == 171); +} + +// Function to randomly set oPC's skin color channel for Rain Genasi +void RndRainGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(52); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(8) + 16; // Range 16-23 + else if (randomNum == 8) randomSkinColor = 28; // Single value + else if (randomNum >= 9 && randomNum <= 11) randomSkinColor = Random(3) + 40; // Range 40-42 + else if (randomNum >= 12 && randomNum <= 15) randomSkinColor = Random(4) + 48; // Range 48-51 + else if (randomNum >= 16 && randomNum <= 19) randomSkinColor = Random(4) + 76; // Range 76-79 + else if (randomNum >= 20 && randomNum <= 23) randomSkinColor = Random(4) + 81; // Range 81-84 + else if (randomNum >= 24 && randomNum <= 26) randomSkinColor = Random(3) + 112; // Range 112-114 + else if (randomNum >= 27 && randomNum <= 32) randomSkinColor = Random(6) + 121; // Range 121-126 + else if (randomNum >= 33 && randomNum <= 44) randomSkinColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 45 && randomNum <= 48) randomSkinColor = Random(4) + 148; // Range 148-151 + else if (randomNum == 49) randomSkinColor = 165; // Single value + else if (randomNum >= 50 && randomNum <= 51) randomSkinColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 52) randomSkinColor = 171; // Single value + else randomSkinColor = 0; // Default case + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Rain Genasi +void RndRainGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(68); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 19) randomHairColor = Random(20) + 16; // Range 16-35 + else if (randomNum >= 20 && randomNum <= 37) randomHairColor = Random(18) + 69; // Range 69-86 + else if (randomNum >= 38 && randomNum <= 41) randomHairColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 42 && randomNum <= 45) randomHairColor = Random(4) + 124; // Range 124-127 + else if (randomNum >= 46 && randomNum <= 57) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 58 && randomNum <= 63) randomHairColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 64) randomHairColor = 165; // Single value + else if (randomNum >= 65 && randomNum <= 67) randomHairColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 68) randomHairColor = 171; // Single value + else randomHairColor = 0; // Default case + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +//:: Checks for valid Silt Genasi skin color channel +int CheckSiltGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 39 && nSkinColor <= 47) || + (nSkinColor == 60) || + (nSkinColor >= 66 && nSkinColor <= 67) || + (nSkinColor >= 74 && nSkinColor <= 75) || + (nSkinColor >= 84 && nSkinColor <= 86) || + (nSkinColor >= 92 && nSkinColor <= 95) || + (nSkinColor >= 108 && nSkinColor <= 111) || + (nSkinColor >= 112 && nSkinColor <= 115) || + (nSkinColor >= 120 && nSkinColor <= 127) || + (nSkinColor >= 154 && nSkinColor <= 155) || + (nSkinColor == 172) || + (nSkinColor == 174); +} + +// Function to check for valid hair color channel for Silt Genasi +int CheckSiltGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 7 && nHairColor <= 11) || + (nHairColor >= 24 && nHairColor <= 31) || + (nHairColor >= 40 && nHairColor <= 43) || + (nHairColor >= 54 && nHairColor <= 55) || + (nHairColor == 58) || + (nHairColor == 60) || + (nHairColor >= 66 && nHairColor <= 67) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 86) || + (nHairColor >= 92 && nHairColor <= 95) || + (nHairColor >= 104 && nHairColor <= 111) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 120 && nHairColor <= 127) || + (nHairColor >= 130 && nHairColor <= 131) || + (nHairColor >= 154 && nHairColor <= 157) || + (nHairColor == 167) || + (nHairColor == 172); +} + +// Function to randomly set oPC's skin color channel for Silt Genasi +void RndSiltGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(58); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(9) + 39; // Range 39-47 + else if (randomNum == 8) randomSkinColor = 60; // Range 60 + else if (randomNum >= 9 && randomNum <= 10) randomSkinColor = Random(2) + 66; // Range 66-67 + else if (randomNum >= 11 && randomNum <= 12) randomSkinColor = Random(2) + 74; // Range 74-75 + else if (randomNum >= 13 && randomNum <= 15) randomSkinColor = Random(3) + 84; // Range 84-86 + else if (randomNum >= 16 && randomNum <= 19) randomSkinColor = Random(4) + 92; // Range 92-95 + else if (randomNum >= 20 && randomNum <= 23) randomSkinColor = Random(4) + 108; // Range 108-111 + else if (randomNum >= 24 && randomNum <= 29) randomSkinColor = Random(6) + 112; // Range 112-115 + else if (randomNum >= 30 && randomNum <= 41) randomSkinColor = Random(12) + 120; // Range 120-127 + else if (randomNum >= 42 && randomNum <= 55) randomSkinColor = Random(14) + 154; // Range 154-157 + else if (randomNum == 56) randomSkinColor = 172; // Single value + else if (randomNum == 57) randomSkinColor = 174; // Single value + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Silt Genasi +void RndSiltGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(80); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 4) randomHairColor = Random(5) + 7; // Range 7-11 + else if (randomNum >= 5 && randomNum <= 18) randomHairColor = Random(8) + 24; // Range 24-31 + else if (randomNum >= 19 && randomNum <= 20) randomHairColor = Random(2) + 40; // Range 40-43 + else if (randomNum >= 21 && randomNum <= 22) randomHairColor = Random(2) + 54; // Range 54-55 + else if (randomNum == 23) randomHairColor = 58; // Single value + else if (randomNum == 24) randomHairColor = 60; // Single value + else if (randomNum >= 25 && randomNum <= 26) randomHairColor = Random(2) + 66; // Range 66-67 + else if (randomNum >= 27 && randomNum <= 28) randomHairColor = Random(2) + 74; // Range 74-75 + else if (randomNum >= 29 && randomNum <= 31) randomHairColor = Random(3) + 84; // Range 84-86 + else if (randomNum >= 32 && randomNum <= 35) randomHairColor = Random(4) + 92; // Range 92-95 + else if (randomNum >= 36 && randomNum <= 47) randomHairColor = Random(12) + 104; // Range 104-111 + else if (randomNum >= 48 && randomNum <= 59) randomHairColor = Random(12) + 112; // Range 112-115 + else if (randomNum >= 60 && randomNum <= 71) randomHairColor = Random(12) + 120; // Range 120-127 + else if (randomNum >= 72 && randomNum <= 73) randomHairColor = Random(2) + 130; // Range 130-131 + else if (randomNum >= 74 && randomNum <= 77) randomHairColor = Random(4) + 154; // Range 154-157 + else if (randomNum == 78) randomHairColor = 167; // Single value + else if (randomNum == 79) randomHairColor = 172; // Single value + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + +// Function to check for valid skin color channel for Sun Genasi +int CheckSunGenasiSkin(object oPC) +{ + // Get the skin color channel + int nSkinColor = GetColor(oPC, COLOR_CHANNEL_SKIN); + + // Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 0 && nSkinColor <= 14) || + (nSkinColor >= 24 && nSkinColor <= 27) || + (nSkinColor >= 54 && nSkinColor <= 55) || + (nSkinColor >= 57 && nSkinColor <= 59) || + (nSkinColor == 66) || + (nSkinColor >= 87 && nSkinColor <= 95) || + (nSkinColor >= 116 && nSkinColor <= 117) || + (nSkinColor >= 128 && nSkinColor <= 129) || + (nSkinColor >= 154 && nSkinColor <= 159) || + (nSkinColor == 167) || + (nSkinColor == 172) || + (nSkinColor == 175); +} + +// Function to check for valid hair color channel for Sun Genasi +int CheckSunGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColor(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 8 && nHairColor <= 15) || + (nHairColor >= 42 && nHairColor <= 47) || + (nHairColor == 56) || + (nHairColor == 58) || + (nHairColor >= 65 && nHairColor <= 67) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 95) || + (nHairColor >= 100 && nHairColor <= 103) || + (nHairColor >= 154 && nHairColor <= 163) || + (nHairColor == 167) || + (nHairColor == 172) || + (nHairColor >= 173 && nHairColor <= 175); +} + +// Function to randomly set oPC's skin color channel for Sun Genasi +void RndSunGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(43); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 14) randomSkinColor = Random(15); // Range 0-14 + else if (randomNum >= 15 && randomNum <= 18) randomSkinColor = Random(4) + 24; // Range 24-27 + else if (randomNum >= 19 && randomNum <= 20) randomSkinColor = Random(2) + 54; // Range 54-55 + else if (randomNum >= 21 && randomNum <= 23) randomSkinColor = Random(2) + 57; // Range 57-59 + else if (randomNum == 24) randomSkinColor = 66; // Range 66 + else if (randomNum >= 25 && randomNum <= 32) randomSkinColor = Random(9) + 87; // Range 87-95 + else if (randomNum >= 33 && randomNum <= 34) randomSkinColor = Random(2) + 116; // Range 116-117 + else if (randomNum >= 35 && randomNum <= 36) randomSkinColor = Random(2) + 128; // Range 128-129 + else if (randomNum >= 37 && randomNum <= 40) randomSkinColor = Random(5) + 154; // Range 154-159 + else if (randomNum == 41) randomSkinColor = 167; // Single value + else if (randomNum == 42) randomSkinColor = 172; // Single value + else if (randomNum == 43) randomSkinColor = 175; // Single value + + // Set the random skin color value for oPC + SetColor(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Sun Genasi +void RndSunGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(73); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 6) randomHairColor = Random(8) + 16; // Range 16-23 + else if (randomNum == 7) randomHairColor = 28; // Single value + else if (randomNum >= 8 && randomNum <= 10) randomHairColor = Random(3) + 40; // Range 40-42 + else if (randomNum >= 11 && randomNum <= 14) randomHairColor = Random(4) + 48; // Range 48-51 + else if (randomNum >= 15 && randomNum <= 18) randomHairColor = Random(4) + 76; // Range 76-79 + else if (randomNum >= 19 && randomNum <= 21) randomHairColor = Random(4) + 81; // Range 81-84 + else if (randomNum >= 22 && randomNum <= 24) randomHairColor = Random(3) + 112; // Range 112-114 + else if (randomNum >= 25 && randomNum <= 30) randomHairColor = Random(6) + 121; // Range 121-126 + else if (randomNum >= 31 && randomNum <= 42) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 43 && randomNum <= 46) randomHairColor = Random(4) + 148; // Range 148-151 + else if (randomNum == 47) randomHairColor = 165; // Single value + else if (randomNum >= 48 && randomNum <= 50) randomHairColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 51) randomHairColor = 171; // Single value + else if (randomNum == 52) randomHairColor = 173; // Single value + else if (randomNum >= 53 && randomNum <= 61) randomHairColor = Random(9) + 174; // Range 174-182 + else if (randomNum >= 62 && randomNum <= 64) randomHairColor = Random(3) + 187; // Range 187-189 + else if (randomNum == 65) randomHairColor = 194; // Single value + else if (randomNum == 66) randomHairColor = 195; // Single value + else if (randomNum >= 67 && randomNum <= 70) randomHairColor = Random(4) + 199; // Range 199-202 + else if (randomNum == 71) randomHairColor = 208; // Single value + else if (randomNum == 72) randomHairColor = 213; // Single value + else if (randomNum == 73) randomHairColor = 215; // Single value + + // Set the random hair color value for oPC + SetColor(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} diff --git a/_notes_/Genasi/genasi color.nss b/_notes_/Genasi/genasi color.nss index 527f6084d..a6ea4edea 100644 --- a/_notes_/Genasi/genasi color.nss +++ b/_notes_/Genasi/genasi color.nss @@ -5,9 +5,118 @@ * them to an appropriate color if not. * */ -#include "prc_color_const" +/* #include "prc_color_const" */ #include "prc_inc_racial" +/* +33 RACIAL_TYPE_MAGMA_GEN +34 RACIAL_TYPE_RAIN_GEN +35 RACIAL_TYPE_SILT_GEN +36 RACIAL_TYPE_SUN_GEN +199 RACIAL_TYPE_AIR_GEN +200 RACIAL_TYPE_EARTH_GEN +202 RACIAL_TYPE_FIRE_GEN +205 RACIAL_TYPE_WATER_GEN +*/ + +//:: Check & fix Air Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN && CheckAirGenasiSkin(oPC) != TRUE) + { + RndAirGenasiSkin(oPC); + } + +//:: Check & fix Air Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN && CheckAirGenasiHair(oPC) != TRUE) + { + RndAirGenasiHair(oPC); + } + +//:: Check & fix Earth Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN && CheckEarthGenasiSkin(oPC) != TRUE) + { + RndEarthGenasiSkin(oPC); + } + +//:: Check & fix Earth Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN && CheckEarthGenasiHair(oPC) != TRUE) + { + RndEarthGenasiHair(oPC); + } + +//:: Check & fix Fire Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN && CheckFireGenasiSkin(oPC) != TRUE) + { + RndFireGenasiSkin(oPC); + } + +//:: Check & fix Fire Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN && CheckFireGenasiHair(oPC) != TRUE) + { + RndFireGenasiHair(oPC); + } + +//:: Check & fix Water Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN && CheckWaterGenasiSkin(oPC) != TRUE) + { + RndWaterGenasiSkin(oPC); + } + +//:: Check & fix Water Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN && CheckWaterGenasiHair(oPC) != TRUE) + { + RndWaterGenasiHair(oPC); + } + +//:: Check & fix Magma Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN && CheckMagmaGenasiSkin(oPC) != TRUE) + { + RndMagmaGenasiSkin(oPC); + } + +//:: Check & fix Magma Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN && CheckMagmaGenasiHair(oPC) != TRUE) + { + RndMagmaGenasiHair(oPC); + } + +//:: Check & fix Rain Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN && CheckRainGenasiSkin(oPC) != TRUE) + { + RndRainGenasiSkin(oPC); + } + +//:: Check & fix Rain Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN && CheckRainGenasiHair(oPC) != TRUE) + { + RndRainGenasiHair(oPC); + } + +//:: Check & fix Silt Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN && CheckSiltGenasiSkin(oPC) != TRUE) + { + RndSiltGenasiSkin(oPC); + } + +//:: Check & fix Silt Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN && CheckSiltGenasiHair(oPC) != TRUE) + { + RndSiltGenasiHair(oPC); + } + +//:: Check & fix Sun Genasi Skin Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN && CheckSunGenasiSkin(oPC) != TRUE) + { + RndSunGenasiSkin(oPC); + } + +//:: Check & fix Sun Genasi Hair Color Channel + if ( GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN && CheckSunGenasiHair(oPC) != TRUE) + { + RndSunGenasiHair(oPC); + } + + + //:: Skin color reference /* 001 = DARK_VANILLA @@ -198,7 +307,6 @@ 176 = GOLD */ - //:: Hair Color Reference /* 001 = AMBER_BROWN @@ -390,6 +498,7 @@ */ + /* Air Genasi Colors @@ -550,6 +659,93 @@ CHANNEL_HAIR_MADDER_VIOLET */ +//:: Checks for valid Air Genasi skin color channel +int CheckAirGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 20 && nSkinColor <= 23) || + (nSkinColor == 40) || + (nSkinColor >= 50 && nSkinColor <= 51) || + (nSkinColor >= 132 && nSkinColor <= 133) || + (nSkinColor >= 136 && nSkinColor <= 137) || + (nSkinColor >= 140 && nSkinColor <= 141) || + (nSkinColor >= 148 && nSkinColor <= 149) || + (nSkinColor == 164) || + (nSkinColor == 166); +} + +//:: Checks for valid Air Genasi hair color channel +int CheckAirGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 35) || + (nHairColor == 44) || + (nHairColor == 46) || + (nHairColor == 54) || + (nHairColor == 56) || + (nHairColor == 57) || + (nHairColor == 70) || + (nHairColor >= 77 && nHairColor <= 79) || + (nHairColor >= 82 && nHairColor <= 84) || + (nHairColor >= 128 && nHairColor <= 150) || + (nHairColor >= 163 && nHairColor <= 171); +} + +// Function to randomly set oPC's skin color channel for Air Genasi +void RndAirGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(9); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = 20 + Random(4); // Range 20-23 + else if (randomNum == 1) randomSkinColor = 40; + else if (randomNum == 2) randomSkinColor = 50 + Random(2); // Range 50-51 + else if (randomNum == 3) randomSkinColor = 132 + Random(2); // Range 132-133 + else if (randomNum == 4) randomSkinColor = 136 + Random(2); // Range 136-137 + else if (randomNum == 5) randomSkinColor = 140 + Random(2); // Range 140-141 + else if (randomNum == 6) randomSkinColor = 148 + Random(2); // Range 148-149 + else if (randomNum == 7) randomSkinColor = 164; + else if (randomNum == 8) randomSkinColor = 166; + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Air Genasi +void RndAirGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(11); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum == 0) randomHairColor = Random(20) + 16; // Range 16-35 + else if (randomNum == 1) randomHairColor = 44; // Single value + else if (randomNum == 2) randomHairColor = 46; // Single value + else if (randomNum == 3) randomHairColor = 54; // Single value + else if (randomNum == 4) randomHairColor = 56; // Single value + else if (randomNum == 5) randomHairColor = 57; // Single value + else if (randomNum == 6) randomHairColor = 70; // Single value + else if (randomNum == 7) randomHairColor = Random(3) + 77; // Range 77-79 + else if (randomNum == 8) randomHairColor = Random(3) + 82; // Range 82-84 + else if (randomNum == 9) randomHairColor = Random(23) + 128; // Range 128-150 + else if (randomNum == 10) randomHairColor = Random(9) + 163; // Range 163-171 + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Earth Genasi Colors Skin Color Channels @@ -769,6 +965,132 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +//:: Checks for valid Earth Genasi skin color channel +int CheckEarthGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 3 && nSkinColor <= 7) || + (nSkinColor == 11) || + (nSkinColor >= 14 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 21 && nSkinColor <= 23) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor == 35) || + (nSkinColor >= 37 && nSkinColor <= 39) || + (nSkinColor >= 42 && nSkinColor <= 43) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor == 63) || + (nSkinColor >= 74 && nSkinColor <= 79) || + (nSkinColor >= 80 && nSkinColor <= 87) || + (nSkinColor >= 103 && nSkinColor <= 127) || + (nSkinColor >= 130 && nSkinColor <= 135) || + (nSkinColor >= 155 && nSkinColor <= 157) || + (nSkinColor >= 167 && nSkinColor <= 174); +} + +//:: Checks for valid Earth Genasi hair color channel +int CheckEarthGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 0 && nHairColor <= 3) || + (nHairColor == 7) || + (nHairColor >= 13 && nHairColor <= 15) || + (nHairColor == 19) || + (nHairColor == 23) || + (nHairColor >= 27 && nHairColor <= 31) || + (nHairColor == 35) || + (nHairColor >= 37 && nHairColor <= 39) || + (nHairColor == 41) || + (nHairColor == 43) || + (nHairColor == 47) || + (nHairColor == 49) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor == 63) || + (nHairColor >= 69 && nHairColor <= 71) || + (nHairColor >= 74 && nHairColor <= 79) || + (nHairColor >= 80 && nHairColor <= 86) || + (nHairColor >= 96 && nHairColor <= 135) || + (nHairColor >= 148 && nHairColor <= 159) || + (nHairColor >= 165 && nHairColor <= 174); +} + +// Function to randomly set oPC's skin color channel for Earth Genasi +void RndEarthGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(18); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = Random(5) + 3; // Range 3-7 + else if (randomNum == 1) randomSkinColor = 11; // Range 11 + else if (randomNum == 2) randomSkinColor = Random(2) + 14; // Range 14-15 + else if (randomNum == 3) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum == 4) randomSkinColor = Random(3) + 21; // Range 21-23 + else if (randomNum == 5) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum == 6) randomSkinColor = 35; // Range 35 + else if (randomNum == 7) randomSkinColor = Random(3) + 37; // Range 37-39 + else if (randomNum == 8) randomSkinColor = Random(2) + 42; // Range 42-43 + else if (randomNum == 9) randomSkinColor = 57; // Range 57 + else if (randomNum == 10) randomSkinColor = 60; // Range 60 + else if (randomNum == 11) randomSkinColor = 63; // Range 63 + else if (randomNum == 12) randomSkinColor = Random(6) + 74; // Range 74-79 + else if (randomNum == 13) randomSkinColor = Random(8) + 80; // Range 80-87 + else if (randomNum == 14) randomSkinColor = Random(25) + 103; // Range 103-127 + else if (randomNum == 15) randomSkinColor = Random(6) + 130; // Range 130-135 + else if (randomNum == 16) randomSkinColor = Random(3) + 155; // Range 155-157 + else if (randomNum == 17) randomSkinColor = Random(8) + 167; // Range 167-174 + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Earth Genasi +void RndEarthGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(99); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 3) randomHairColor = Random(4); // Range 0-3 + else if (randomNum == 4) randomHairColor = 7; + else if (randomNum >= 5 && randomNum <= 7) randomHairColor = Random(3) + 13; // Range 13-15 + else if (randomNum == 8) randomHairColor = 19; + else if (randomNum == 9) randomHairColor = 23; + else if (randomNum >= 10 && randomNum <= 14) randomHairColor = Random(5) + 27; // Range 27-31 + else if (randomNum == 15) randomHairColor = 35; + else if (randomNum >= 16 && randomNum <= 18) randomHairColor = Random(3) + 37; // Range 37-39 + else if (randomNum == 19) randomHairColor = 41; + else if (randomNum == 20) randomHairColor = 43; + else if (randomNum == 21) randomHairColor = 47; + else if (randomNum == 22) randomHairColor = 49; + else if (randomNum == 23) randomHairColor = 57; + else if (randomNum == 24) randomHairColor = 60; + else if (randomNum == 25) randomHairColor = 63; + else if (randomNum >= 26 && randomNum <= 28) randomHairColor = Random(3) + 69; // Range 69-71 + else if (randomNum >= 29 && randomNum <= 33) randomHairColor = Random(5) + 74; // Range 74-79 + else if (randomNum >= 34 && randomNum <= 40) randomHairColor = Random(7) + 80; // Range 80-86 + else if (randomNum >= 41 && randomNum <= 79) randomHairColor = Random(39) + 96; // Range 96-134 + else if (randomNum >= 80 && randomNum <= 99) randomHairColor = Random(20) + 148; // Range 148-167 + + return randomHairColor; + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Fire Genasi Colors Skin color channels @@ -977,22 +1299,141 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE CHANNEL_HAIR_MOCHA CHANNEL_HAIR_GOLD - - - - -/* -33 RACIAL_TYPE_MAGMA_GEN -34 RACIAL_TYPE_RAIN_GEN -35 RACIAL_TYPE_SILT_GEN -36 RACIAL_TYPE_SUN_GEN -199 RACIAL_TYPE_AIR_GEN -200 RACIAL_TYPE_EARTH_GEN -202 RACIAL_TYPE_FIRE_GEN -205 RACIAL_TYPE_WATER_GEN - */ +//:: Checks for valid Fire Genasi skin color channel +int CheckFireGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 4 && nSkinColor <= 7) || + (nSkinColor >= 12 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 22 && nSkinColor <= 23) || + (nSkinColor >= 27 && nSkinColor <= 31) || + (nSkinColor >= 42 && nSkinColor <= 47) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor == 63) || + (nSkinColor >= 64 && nSkinColor <= 67) || + (nSkinColor >= 73 && nSkinColor <= 75) || + (nSkinColor == 79) || + (nSkinColor == 81) || + (nSkinColor >= 83 && nSkinColor <= 103) || + (nSkinColor >= 112 && nSkinColor <= 119) || + (nSkinColor >= 123 && nSkinColor <= 127) || + (nSkinColor >= 131 && nSkinColor <= 135) || + (nSkinColor >= 156 && nSkinColor <= 162) || + (nSkinColor >= 167 && nSkinColor <= 171) || + (nSkinColor == 173); +} + +//:: Checks for valid Fire Genasi hair color channel +int CheckFireGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 1 && nHairColor <= 7) || + (nHairColor == 15) || + (nHairColor == 23) || + (nHairColor == 31) || + (nHairColor == 47) || + (nHairColor >= 48 && nHairColor <= 49) || + (nHairColor >= 51 && nHairColor <= 55) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor == 63) || + (nHairColor >= 64 && nHairColor <= 65) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor == 79) || + (nHairColor >= 84 && nHairColor <= 103) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 118 && nHairColor <= 119) || + (nHairColor >= 123 && nHairColor <= 127) || + (nHairColor >= 131 && nHairColor <= 135) || + (nHairColor >= 155 && nHairColor <= 159) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor == 171) || + (nHairColor >= 173 && nHairColor <= 175); +} + +// Function to randomly set oPC's skin color channel for Fire Genasi +void RndFireGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(87); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 3) randomSkinColor = Random(4) + 4; // Range 4-7 + else if (randomNum >= 4 && randomNum <= 7) randomSkinColor = Random(4) + 12; // Range 12-15 + else if (randomNum >= 8 && randomNum <= 9) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum >= 10 && randomNum <= 11) randomSkinColor = Random(2) + 22; // Range 22-23 + else if (randomNum >= 12 && randomNum <= 16) randomSkinColor = Random(5) + 27; // Range 27-31 + else if (randomNum >= 17 && randomNum <= 22) randomSkinColor = Random(6) + 42; // Range 42-47 + else if (randomNum == 23) randomSkinColor = 57; + else if (randomNum == 24) randomSkinColor = 60; + else if (randomNum == 25) randomSkinColor = 63; + else if (randomNum >= 26 && randomNum <= 29) randomSkinColor = Random(4) + 64; // Range 64-67 + else if (randomNum >= 30 && randomNum <= 32) randomSkinColor = Random(3) + 73; // Range 73-75 + else if (randomNum == 33) randomSkinColor = 79; + else if (randomNum == 34) randomSkinColor = 81; + else if (randomNum >= 35 && randomNum <= 55) randomSkinColor = Random(21) + 83; // Range 83-103 + else if (randomNum >= 56 && randomNum <= 63) randomSkinColor = Random(8) + 112; // Range 112-119 + else if (randomNum >= 64 && randomNum <= 68) randomSkinColor = Random(5) + 123; // Range 123-127 + else if (randomNum >= 69 && randomNum <= 73) randomSkinColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 74 && randomNum <= 80) randomSkinColor = Random(7) + 156; // Range 156-162 + else if (randomNum >= 81 && randomNum <= 85) randomSkinColor = Random(5) + 167; // Range 167-171 + else if (randomNum == 86) randomSkinColor = 173; + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Fire Genasi +void RndFireGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(73); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 6) randomHairColor = Random(7) + 1; // Range 1-7 + else if (randomNum == 7) randomHairColor = 15; + else if (randomNum == 8) randomHairColor = 23; + else if (randomNum == 9) randomHairColor = 31; + else if (randomNum == 10) randomHairColor = 47; + else if (randomNum >= 11 && randomNum <= 12) randomHairColor = Random(2) + 48; // Range 48-49 + else if (randomNum >= 13 && randomNum <= 17) randomHairColor = Random(5) + 51; // Range 51-55 + else if (randomNum == 18) randomHairColor = 57; + else if (randomNum == 19) randomHairColor = 60; + else if (randomNum == 20) randomHairColor = 63; + else if (randomNum >= 21 && randomNum <= 22) randomHairColor = Random(2) + 64; // Range 64-65 + else if (randomNum >= 23 && randomNum <= 24) randomHairColor = Random(2) + 74; // Range 74-75 + else if (randomNum == 25) randomHairColor = 79; + else if (randomNum >= 26 && randomNum <= 45) randomHairColor = Random(20) + 84; // Range 84-103 + else if (randomNum >= 46 && randomNum <= 49) randomHairColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 50 && randomNum <= 51) randomHairColor = Random(2) + 118; // Range 118-119 + else if (randomNum >= 52 && randomNum <= 56) randomHairColor = Random(5) + 123; // Range 123-127 + else if (randomNum >= 57 && randomNum <= 61) randomHairColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 62 && randomNum <= 66) randomHairColor = Random(5) + 155; // Range 155-159 + else if (randomNum == 67) randomHairColor = 165; + else if (randomNum == 68) randomHairColor = 167; + else if (randomNum == 69) randomHairColor = 171; + else if (randomNum >= 70 && randomNum <= 72) randomHairColor = Random(3) + 173; // Range 173-175 + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Water Genasi Colors Skin color channels @@ -1301,6 +1742,97 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +//:: Checks for valid Water Genasi hair color channel +int CheckWaterGenasiSkin(object oPC) +{ + //:: Get the hair color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the Skin color channel is within any of the specified ranges + return (nSkinColor >= 16 && nSkinColor <= 23) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor >= 32 && nSkinColor <= 43) || + (nSkinColor >= 48 && nSkinColor <= 53) || + (nSkinColor == 60) || + (nSkinColor >= 69 && nSkinColor <= 86) || + (nSkinColor >= 104 && nSkinColor <= 114) || + (nSkinColor >= 124 && nSkinColor <= 127) || + (nSkinColor >= 132 && nSkinColor <= 143) || + (nSkinColor >= 148 && nSkinColor <= 153) || + (nSkinColor == 165) || + (nSkinColor >= 169 && nSkinColor <= 171); +} + +//:: Checks for valid Water Genasi hair color channel +int CheckWaterGenasiHair(object oPC) +{ + //:: Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + //:: Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 47) || + (nHairColor >= 67 && nHairColor <= 86) || + (nHairColor >= 104 && nHairColor <= 115) || + (nHairColor >= 121 && nHairColor <= 127) || + (nHairColor >= 132 && nHairColor <= 143) || + (nHairColor >= 148 && nHairColor <= 153) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor >= 169 && nHairColor <= 171) || + (nHairColor == 173); +} + +// Function to randomly set oPC's skin color channel for Water Genasi +void RndWaterGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(86); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(8) + 16; // Range 16-23 + else if (randomNum >= 8 && randomNum <= 11) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum >= 12 && randomNum <= 23) randomSkinColor = Random(12) + 32; // Range 32-43 + else if (randomNum >= 24 && randomNum <= 29) randomSkinColor = Random(6) + 48; // Range 48-53 + else if (randomNum == 30) randomSkinColor = 60; + else if (randomNum >= 31 && randomNum <= 48) randomSkinColor = Random(18) + 69; // Range 69-86 + else if (randomNum >= 49 && randomNum <= 59) randomSkinColor = Random(11) + 104; // Range 104-114 + else if (randomNum >= 60 && randomNum <= 63) randomSkinColor = Random(4) + 124; // Range 124-127 + else if (randomNum >= 64 && randomNum <= 75) randomSkinColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 76 && randomNum <= 81) randomSkinColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 82) randomSkinColor = 165; + else if (randomNum >= 83 && randomNum <= 85) randomSkinColor = Random(3) + 169; // Range 169-171 + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Water Genasi +void RndWaterGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(95); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 31) randomHairColor = Random(32) + 16; // Range 16-47 + else if (randomNum >= 32 && randomNum <= 51) randomHairColor = Random(20) + 67; // Range 67-86 + else if (randomNum >= 52 && randomNum <= 63) randomHairColor = Random(12) + 104; // Range 104-115 + else if (randomNum >= 64 && randomNum <= 70) randomHairColor = Random(7) + 121; // Range 121-127 + else if (randomNum >= 71 && randomNum <= 82) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 83 && randomNum <= 88) randomHairColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 89) randomHairColor = 165; + else if (randomNum == 90) randomHairColor = 167; + else if (randomNum >= 91 && randomNum <= 93) randomHairColor = Random(3) + 169; // Range 169-171 + else if (randomNum == 94) randomHairColor = 173; + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Magma Genasi Colors Skin color channels @@ -1691,6 +2223,138 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +//:: Checks for valid Magma Genasi skin color channel +int CheckMagmaGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor == 7) || + (nSkinColor >= 13 && nSkinColor <= 15) || + (nSkinColor >= 18 && nSkinColor <= 19) || + (nSkinColor >= 28 && nSkinColor <= 31) || + (nSkinColor >= 41 && nSkinColor <= 45) || + (nSkinColor == 57) || + (nSkinColor == 60) || + (nSkinColor >= 63 && nSkinColor <= 65) || + (nSkinColor >= 87 && nSkinColor <= 91) || + (nSkinColor >= 96 && nSkinColor <= 103) || + (nSkinColor >= 112 && nSkinColor <= 115) || + (nSkinColor >= 118 && nSkinColor <= 119) || + (nSkinColor >= 122 && nSkinColor <= 127) || + (nSkinColor >= 131 && nSkinColor <= 135) || + (nSkinColor >= 158 && nSkinColor <= 159) || + (nSkinColor == 165) || + (nSkinColor == 167) || + (nSkinColor == 171) || + (nSkinColor == 173); +} + +// Function to check for valid hair color channel for Magma Genasi +int CheckMagmaGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 3 && nHairColor <= 7) || + (nHairColor == 15) || + (nHairColor >= 22 && nHairColor <= 23) || + (nHairColor == 27) || + (nHairColor >= 30 && nHairColor <= 31) || + (nHairColor == 47) || + (nHairColor == 51) || + (nHairColor == 53) || + (nHairColor == 55) || + (nHairColor == 57) || + (nHairColor == 60) || + (nHairColor >= 63 && nHairColor <= 65) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 103) || + (nHairColor >= 111 && nHairColor <= 115) || + (nHairColor == 119) || + (nHairColor >= 126 && nHairColor <= 127) || + (nHairColor >= 133 && nHairColor <= 135) || + (nHairColor >= 158 && nHairColor <= 159) || + (nHairColor == 165) || + (nHairColor == 167) || + (nHairColor == 171) || + (nHairColor == 173); +} + +// Function to randomly set oPC's skin color channel for Magma Genasi +void RndMagmaGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(58); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum == 0) randomSkinColor = 7; + else if (randomNum >= 1 && randomNum <= 3) randomSkinColor = Random(3) + 13; // Range 13-15 + else if (randomNum >= 4 && randomNum <= 5) randomSkinColor = Random(2) + 18; // Range 18-19 + else if (randomNum >= 6 && randomNum <= 9) randomSkinColor = Random(4) + 28; // Range 28-31 + else if (randomNum >= 10 && randomNum <= 14) randomSkinColor = Random(5) + 41; // Range 41-45 + else if (randomNum == 15) randomSkinColor = 57; + else if (randomNum == 16) randomSkinColor = 60; + else if (randomNum >= 17 && randomNum <= 19) randomSkinColor = Random(3) + 63; // Range 63-65 + else if (randomNum >= 20 && randomNum <= 24) randomSkinColor = Random(5) + 87; // Range 87-91 + else if (randomNum >= 25 && randomNum <= 32) randomSkinColor = Random(8) + 96; // Range 96-103 + else if (randomNum >= 33 && randomNum <= 36) randomSkinColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 37 && randomNum <= 38) randomSkinColor = Random(2) + 118; // Range 118-119 + else if (randomNum >= 39 && randomNum <= 44) randomSkinColor = Random(6) + 122; // Range 122-127 + else if (randomNum >= 45 && randomNum <= 49) randomSkinColor = Random(5) + 131; // Range 131-135 + else if (randomNum >= 50 && randomNum <= 51) randomSkinColor = Random(2) + 158; // Range 158-159 + else if (randomNum == 52) randomSkinColor = 165; + else if (randomNum == 53) randomSkinColor = 167; + else if (randomNum == 54) randomSkinColor = 171; + else if (randomNum == 55) randomSkinColor = 173; + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Magma Genasi +void RndMagmaGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(64); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 4) return Random(5) + 3; // Range 3-7 + else if (randomNum == 5) return 15; // Single value + else if (randomNum >= 6 && randomNum <= 7) return Random(2) + 22; // Range 22-23 + else if (randomNum == 8) return 27; // Single value + else if (randomNum >= 9 && randomNum <= 10) return Random(2) + 30; // Range 30-31 + else if (randomNum == 11) return 47; // Single value + else if (randomNum == 12) return 51; // Single value + else if (randomNum == 13) return 53; // Single value + else if (randomNum == 14) return 55; // Single value + else if (randomNum == 15) return 57; // Single value + else if (randomNum == 16) return 60; // Single value + else if (randomNum >= 17 && randomNum <= 19) return Random(3) + 63; // Range 63-65 + else if (randomNum >= 20 && randomNum <= 21) return Random(2) + 74; // Range 74-75 + else if (randomNum >= 22 && randomNum <= 46) return Random(20) + 84; // Range 84-103 + else if (randomNum >= 47 && randomNum <= 51) return Random(5) + 111; // Range 111-115 + else if (randomNum == 52) return 119; // Single value + else if (randomNum >= 53 && randomNum <= 54) return Random(2) + 126; // Range 126-127 + else if (randomNum >= 55 && randomNum <= 57) return Random(3) + 133; // Range 133-135 + else if (randomNum >= 58 && randomNum <= 59) return Random(2) + 158; // Range 158-159 + else if (randomNum == 60) return 165; // Single value + else if (randomNum == 61) return 167; // Single value + else if (randomNum == 62) return 171; // Single value + else if (randomNum == 63) return 173; // Single value + + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Rain Genasi Colors Skin Color Channels @@ -1724,6 +2388,99 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +//:: Checks for valid Rain Genasi skin color channel +int CheckRainGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 16 && nSkinColor <= 23) || + (nSkinColor == 28) || + (nSkinColor >= 40 && nSkinColor <= 42) || + (nSkinColor >= 48 && nSkinColor <= 51) || + (nSkinColor >= 76 && nSkinColor <= 79) || + (nSkinColor >= 81 && nSkinColor <= 84) || + (nSkinColor >= 112 && nSkinColor <= 114) || + (nSkinColor >= 121 && nSkinColor <= 126) || + (nSkinColor >= 132 && nSkinColor <= 143) || + (nSkinColor >= 148 && nSkinColor <= 151) || + (nSkinColor == 165) || + (nSkinColor >= 167 && nSkinColor <= 169) || + (nSkinColor == 171); +} + +// Function to check for valid hair color channel for Rain Genasi +int CheckRainGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 16 && nHairColor <= 35) || + (nHairColor >= 69 && nHairColor <= 86) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 124 && nHairColor <= 127) || + (nHairColor >= 132 && nHairColor <= 143) || + (nHairColor >= 148 && nHairColor <= 153) || + (nHairColor == 165) || + (nHairColor >= 167 && nHairColor <= 169) || + (nHairColor == 171); +} + +// Function to randomly set oPC's skin color channel for Rain Genasi +void RndRainGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(52); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(8) + 16; // Range 16-23 + else if (randomNum == 8) randomSkinColor = 28; // Single value + else if (randomNum >= 9 && randomNum <= 11) randomSkinColor = Random(3) + 40; // Range 40-42 + else if (randomNum >= 12 && randomNum <= 15) randomSkinColor = Random(4) + 48; // Range 48-51 + else if (randomNum >= 16 && randomNum <= 19) randomSkinColor = Random(4) + 76; // Range 76-79 + else if (randomNum >= 20 && randomNum <= 23) randomSkinColor = Random(4) + 81; // Range 81-84 + else if (randomNum >= 24 && randomNum <= 26) randomSkinColor = Random(3) + 112; // Range 112-114 + else if (randomNum >= 27 && randomNum <= 32) randomSkinColor = Random(6) + 121; // Range 121-126 + else if (randomNum >= 33 && randomNum <= 44) randomSkinColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 45 && randomNum <= 48) randomSkinColor = Random(4) + 148; // Range 148-151 + else if (randomNum == 49) randomSkinColor = 165; // Single value + else if (randomNum >= 50 && randomNum <= 51) randomSkinColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 52) randomSkinColor = 171; // Single value + else randomSkinColor = 0; // Default case + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Rain Genasi +void RndRainGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(68); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 19) randomHairColor = Random(20) + 16; // Range 16-35 + else if (randomNum >= 20 && randomNum <= 37) randomHairColor = Random(18) + 69; // Range 69-86 + else if (randomNum >= 38 && randomNum <= 41) randomHairColor = Random(4) + 112; // Range 112-115 + else if (randomNum >= 42 && randomNum <= 45) randomHairColor = Random(4) + 124; // Range 124-127 + else if (randomNum >= 46 && randomNum <= 57) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 58 && randomNum <= 63) randomHairColor = Random(6) + 148; // Range 148-153 + else if (randomNum == 64) randomHairColor = 165; // Single value + else if (randomNum >= 65 && randomNum <= 67) randomHairColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 68) randomHairColor = 171; // Single value + else randomHairColor = 0; // Default case + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Silt Genasi Colors Skin Color Channels @@ -1762,6 +2519,111 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +//:: Checks for valid Silt Genasi skin color channel +int CheckSiltGenasiSkin(object oPC) +{ + //:: Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + //:: Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 39 && nSkinColor <= 47) || + (nSkinColor == 60) || + (nSkinColor >= 66 && nSkinColor <= 67) || + (nSkinColor >= 74 && nSkinColor <= 75) || + (nSkinColor >= 84 && nSkinColor <= 86) || + (nSkinColor >= 92 && nSkinColor <= 95) || + (nSkinColor >= 108 && nSkinColor <= 111) || + (nSkinColor >= 112 && nSkinColor <= 115) || + (nSkinColor >= 120 && nSkinColor <= 127) || + (nSkinColor >= 154 && nSkinColor <= 155) || + (nSkinColor == 172) || + (nSkinColor == 174); +} + +// Function to check for valid hair color channel for Silt Genasi +int CheckSiltGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 7 && nHairColor <= 11) || + (nHairColor >= 24 && nHairColor <= 31) || + (nHairColor >= 40 && nHairColor <= 43) || + (nHairColor >= 54 && nHairColor <= 55) || + (nHairColor == 58) || + (nHairColor == 60) || + (nHairColor >= 66 && nHairColor <= 67) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 86) || + (nHairColor >= 92 && nHairColor <= 95) || + (nHairColor >= 104 && nHairColor <= 111) || + (nHairColor >= 112 && nHairColor <= 115) || + (nHairColor >= 120 && nHairColor <= 127) || + (nHairColor >= 130 && nHairColor <= 131) || + (nHairColor >= 154 && nHairColor <= 157) || + (nHairColor == 167) || + (nHairColor == 172); +} + +// Function to randomly set oPC's skin color channel for Silt Genasi +void RndSiltGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(58); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 7) randomSkinColor = Random(9) + 39; // Range 39-47 + else if (randomNum == 8) randomSkinColor = 60; // Range 60 + else if (randomNum >= 9 && randomNum <= 10) randomSkinColor = Random(2) + 66; // Range 66-67 + else if (randomNum >= 11 && randomNum <= 12) randomSkinColor = Random(2) + 74; // Range 74-75 + else if (randomNum >= 13 && randomNum <= 15) randomSkinColor = Random(3) + 84; // Range 84-86 + else if (randomNum >= 16 && randomNum <= 19) randomSkinColor = Random(4) + 92; // Range 92-95 + else if (randomNum >= 20 && randomNum <= 23) randomSkinColor = Random(4) + 108; // Range 108-111 + else if (randomNum >= 24 && randomNum <= 29) randomSkinColor = Random(6) + 112; // Range 112-115 + else if (randomNum >= 30 && randomNum <= 41) randomSkinColor = Random(12) + 120; // Range 120-127 + else if (randomNum >= 42 && randomNum <= 55) randomSkinColor = Random(14) + 154; // Range 154-157 + else if (randomNum == 56) randomSkinColor = 172; // Single value + else if (randomNum == 57) randomSkinColor = 174; // Single value + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Silt Genasi +void RndSiltGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(80); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 4) randomHairColor = Random(5) + 7; // Range 7-11 + else if (randomNum >= 5 && randomNum <= 18) randomHairColor = Random(8) + 24; // Range 24-31 + else if (randomNum >= 19 && randomNum <= 20) randomHairColor = Random(2) + 40; // Range 40-43 + else if (randomNum >= 21 && randomNum <= 22) randomHairColor = Random(2) + 54; // Range 54-55 + else if (randomNum == 23) randomHairColor = 58; // Single value + else if (randomNum == 24) randomHairColor = 60; // Single value + else if (randomNum >= 25 && randomNum <= 26) randomHairColor = Random(2) + 66; // Range 66-67 + else if (randomNum >= 27 && randomNum <= 28) randomHairColor = Random(2) + 74; // Range 74-75 + else if (randomNum >= 29 && randomNum <= 31) randomHairColor = Random(3) + 84; // Range 84-86 + else if (randomNum >= 32 && randomNum <= 35) randomHairColor = Random(4) + 92; // Range 92-95 + else if (randomNum >= 36 && randomNum <= 47) randomHairColor = Random(12) + 104; // Range 104-111 + else if (randomNum >= 48 && randomNum <= 59) randomHairColor = Random(12) + 112; // Range 112-115 + else if (randomNum >= 60 && randomNum <= 71) randomHairColor = Random(12) + 120; // Range 120-127 + else if (randomNum >= 72 && randomNum <= 73) randomHairColor = Random(2) + 130; // Range 130-131 + else if (randomNum >= 74 && randomNum <= 77) randomHairColor = Random(4) + 154; // Range 154-157 + else if (randomNum == 78) randomHairColor = 167; // Single value + else if (randomNum == 79) randomHairColor = 172; // Single value + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + /* Sun Genasi Colors Skin Color Channels @@ -1797,6 +2659,119 @@ CHANNEL_HAIR_LIGHT_BROWNISH_OLIVE */ +// Function to check for valid skin color channel for Sun Genasi +int CheckSunGenasiSkin(object oPC) +{ + // Get the skin color channel + int nSkinColor = GetColorChannel(oPC, COLOR_CHANNEL_SKIN); + + // Check if the skin color channel is within any of the specified ranges + return (nSkinColor >= 0 && nSkinColor <= 14) || + (nSkinColor >= 24 && nSkinColor <= 27) || + (nSkinColor >= 54 && nSkinColor <= 55) || + (nSkinColor >= 57 && nSkinColor <= 59) || + (nSkinColor == 66) || + (nSkinColor >= 87 && nSkinColor <= 95) || + (nSkinColor >= 116 && nSkinColor <= 117) || + (nSkinColor >= 128 && nSkinColor <= 129) || + (nSkinColor >= 154 && nSkinColor <= 159) || + (nSkinColor == 167) || + (nSkinColor == 172) || + (nSkinColor == 175); +} + +// Function to check for valid hair color channel for Sun Genasi +int CheckSunGenasiHair(object oPC) +{ + // Get the hair color channel + int nHairColor = GetColorChannel(oPC, COLOR_CHANNEL_HAIR); + + // Check if the hair color channel is within any of the specified ranges + return (nHairColor >= 8 && nHairColor <= 15) || + (nHairColor >= 42 && nHairColor <= 47) || + (nHairColor == 56) || + (nHairColor == 58) || + (nHairColor >= 65 && nHairColor <= 67) || + (nHairColor >= 74 && nHairColor <= 75) || + (nHairColor >= 84 && nHairColor <= 95) || + (nHairColor >= 100 && nHairColor <= 103) || + (nHairColor >= 154 && nHairColor <= 163) || + (nHairColor == 167) || + (nHairColor == 172) || + (nHairColor >= 173 && nHairColor <= 175); +} + +// Function to randomly set oPC's skin color channel for Sun Genasi +void RndSunGenasiSkin(object oPC) +{ + // Get a random number + int randomNum = Random(43); + + // Map the random number to a skin color value + int randomSkinColor; + + if (randomNum >= 0 && randomNum <= 14) randomSkinColor = Random(15); // Range 0-14 + else if (randomNum >= 15 && randomNum <= 18) randomSkinColor = Random(4) + 24; // Range 24-27 + else if (randomNum >= 19 && randomNum <= 20) randomSkinColor = Random(2) + 54; // Range 54-55 + else if (randomNum >= 21 && randomNum <= 23) randomSkinColor = Random(2) + 57; // Range 57-59 + else if (randomNum == 24) randomSkinColor = 66; // Range 66 + else if (randomNum >= 25 && randomNum <= 32) randomSkinColor = Random(9) + 87; // Range 87-95 + else if (randomNum >= 33 && randomNum <= 34) randomSkinColor = Random(2) + 116; // Range 116-117 + else if (randomNum >= 35 && randomNum <= 36) randomSkinColor = Random(2) + 128; // Range 128-129 + else if (randomNum >= 37 && randomNum <= 40) randomSkinColor = Random(5) + 154; // Range 154-159 + else if (randomNum == 41) randomSkinColor = 167; // Single value + else if (randomNum == 42) randomSkinColor = 172; // Single value + else if (randomNum == 43) randomSkinColor = 175; // Single value + + // Set the random skin color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_SKIN, randomSkinColor); +} + +// Function to randomly set oPC's hair color channel for Sun Genasi +void RndSunGenasiHair(object oPC) +{ + // Get a random number + int randomNum = Random(73); + + // Map the random number to a hair color value + int randomHairColor; + + if (randomNum >= 0 && randomNum <= 6) randomHairColor = Random(8) + 16; // Range 16-23 + else if (randomNum == 7) randomHairColor = 28; // Single value + else if (randomNum >= 8 && randomNum <= 10) randomHairColor = Random(3) + 40; // Range 40-42 + else if (randomNum >= 11 && randomNum <= 14) randomHairColor = Random(4) + 48; // Range 48-51 + else if (randomNum >= 15 && randomNum <= 18) randomHairColor = Random(4) + 76; // Range 76-79 + else if (randomNum >= 19 && randomNum <= 21) randomHairColor = Random(4) + 81; // Range 81-84 + else if (randomNum >= 22 && randomNum <= 24) randomHairColor = Random(3) + 112; // Range 112-114 + else if (randomNum >= 25 && randomNum <= 30) randomHairColor = Random(6) + 121; // Range 121-126 + else if (randomNum >= 31 && randomNum <= 42) randomHairColor = Random(12) + 132; // Range 132-143 + else if (randomNum >= 43 && randomNum <= 46) randomHairColor = Random(4) + 148; // Range 148-151 + else if (randomNum == 47) randomHairColor = 165; // Single value + else if (randomNum >= 48 && randomNum <= 50) randomHairColor = Random(3) + 167; // Range 167-169 + else if (randomNum == 51) randomHairColor = 171; // Single value + else if (randomNum == 52) randomHairColor = 173; // Single value + else if (randomNum >= 53 && randomNum <= 61) randomHairColor = Random(9) + 174; // Range 174-182 + else if (randomNum >= 62 && randomNum <= 64) randomHairColor = Random(3) + 187; // Range 187-189 + else if (randomNum == 65) randomHairColor = 194; // Single value + else if (randomNum == 66) randomHairColor = 195; // Single value + else if (randomNum >= 67 && randomNum <= 70) randomHairColor = Random(4) + 199; // Range 199-202 + else if (randomNum == 71) randomHairColor = 208; // Single value + else if (randomNum == 72) randomHairColor = 213; // Single value + else if (randomNum == 73) randomHairColor = 215; // Single value + + // Set the random hair color value for oPC + SetColorChannel(oPC, COLOR_CHANNEL_HAIR, randomHairColor); +} + + + + + + + + + + //:: Function to check if oPC has valid Air Genasi skin color channels int HasValidAirGenasiSkinColor(object oPC);