Rune_PRC8/_module/nss/alt_shape_inc.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

122 lines
4.6 KiB
Plaintext

//Created by Esreyr Fears
//on February 2nd, 2006
//Change to allow specifics of morphing (values can be either TRUE or FALSE)
int IS_USING_CEP = TRUE;
int ALLOW_CHANGE_RACE = TRUE;
int ALLOW_CHANGE_FACE = TRUE;
int ALLOW_CHANGE_PHENOTYPE = TRUE;
int ALLOW_CHANGE_TAIL = TRUE;
int ALLOW_CHANGE_WING = TRUE;
//------------DO NOT MODIFY BELOW THIS LINE----------------------
//VARIABLES for use with CEP's Wings and Tails
int CREATURE_WING_TYPE_DRAGON_BLACK = 34;
int CREATURE_WING_TYPE_DRAGON_BLUE = 35;
int CREATURE_WING_TYPE_DRAGON_BRASS = 36;
int CREATURE_WING_TYPE_DRAGON_BRONZE = 37;
int CREATURE_WING_TYPE_DRAGON_COPPER = 38;
int CREATURE_WING_TYPE_DRAGON_GOLD = 39;
int CREATURE_WING_TYPE_DRAGON_GREEN = 40;
int CREATURE_WING_TYPE_DRAGON_RED = CREATURE_WING_TYPE_DRAGON;
int CREATURE_WING_TYPE_DRAGON_SILVER = 41;
int CREATURE_WING_TYPE_DRAGON_WHITE = 42;
int CREATURE_WING_TYPE_BIRD_BROWN = CREATURE_WING_TYPE_BIRD;
int CREATURE_WING_TYPE_BIRD_RED = 31;
int CREATURE_WING_TYPE_BIRD_DARK = 32;
int CREATURE_WING_TYPE_BIRD_BLUE = 33;
int CREATURE_WING_TYPE_DEMON_ERINYES = 30;
int CREATURE_TAIL_TYPE_CAT = 30;
//Getters
int getMaxHeads(object oPC) {
//Set the VARIABLES for Faces
int MAX_FACES_DWARF_FEMALE = 12;
int MAX_FACES_DWARF_MALE = 13;
int MAX_FACES_ELF_FEMALE = 16;
int MAX_FACES_ELF_MALE = 18;
int MAX_FACES_GNOME_FEMALE = 9;
int MAX_FACES_GNOME_MALE = 13;
int MAX_FACES_HALFLING_FEMALE = 11;
int MAX_FACES_HALFLING_MALE = 10;
int MAX_FACES_HALFORC_FEMALE = 12;
int MAX_FACES_HALFORC_MALE = 13;
int MAX_FACES_HUMAN_FEMALE = 27;
int MAX_FACES_HUMAN_MALE = 34;
if (IS_USING_CEP) {
MAX_FACES_DWARF_FEMALE = 23;
MAX_FACES_DWARF_MALE = 24;
MAX_FACES_ELF_FEMALE = 43;
MAX_FACES_ELF_MALE = 34;
MAX_FACES_GNOME_FEMALE = 10;
MAX_FACES_GNOME_MALE = 35;
MAX_FACES_HALFLING_FEMALE = 15;
MAX_FACES_HALFLING_MALE = 28;
MAX_FACES_HALFORC_FEMALE = 15;
MAX_FACES_HALFORC_MALE = 31;
MAX_FACES_HUMAN_FEMALE = 49;
MAX_FACES_HUMAN_MALE = 49;
}
//Return the Result
switch ( GetAppearanceType(oPC) ) {
case APPEARANCE_TYPE_DWARF:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_DWARF_MALE;
else return MAX_FACES_DWARF_FEMALE;
break;
case APPEARANCE_TYPE_ELF:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_ELF_MALE;
else return MAX_FACES_ELF_FEMALE;
break;
case APPEARANCE_TYPE_GNOME:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_GNOME_MALE;
else return MAX_FACES_GNOME_FEMALE;
break;
case APPEARANCE_TYPE_HALFLING:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HALFLING_MALE;
else return MAX_FACES_HALFLING_FEMALE;
break;
case APPEARANCE_TYPE_HALF_ORC:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HALFORC_MALE;
else return MAX_FACES_HALFORC_FEMALE;
break;
case APPEARANCE_TYPE_HUMAN:
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HUMAN_MALE;
else return MAX_FACES_HUMAN_FEMALE;
break;
default:
return 0;
break;
}
return 0;
}
int getMinHead(object oPC, int desired_head) {
int max_head = getMaxHeads(oPC);
if (desired_head < max_head) return desired_head;
return max_head-1;
}
int isPlayableRace(object oPC) {
int n = GetAppearanceType(oPC);
if (n == APPEARANCE_TYPE_DWARF || n == APPEARANCE_TYPE_ELF || n == APPEARANCE_TYPE_GNOME || n == APPEARANCE_TYPE_HALFLING || n == APPEARANCE_TYPE_HALF_ORC || n == APPEARANCE_TYPE_HUMAN) return TRUE;
return FALSE;
}
//Setter
void makeChanges(object oPC, object oItem) {
/* Shape */ SetCreatureAppearanceType(oPC, GetLocalInt(oItem, "change_shape"));
/* Pheno */ SetPhenoType(GetLocalInt(oItem, "change_pheno"), oPC);
/* Tail */ SetCreatureTailType(GetLocalInt(oItem, "change_tail"), oPC);
/* Wing */ SetCreatureWingType(GetLocalInt(oItem, "change_wing"), oPC);
/* Face */ int desired_head = getMinHead(oPC, GetLocalInt(oItem, "change_face") );
SetCreatureBodyPart(CREATURE_PART_HEAD, desired_head, oPC);
}