I have been adding a few new classes. I added the Ninja Spy class and so far all the feats I got working except one. The thousand faces (where the PC can change his/her appearance to any race or sex). For some weird reason I can only change to a headless dwarf pheno type and can’t change back. Is this scripting too old for NWN:EE? See Below:
//::///////////////////////////////////////////////
//:: Thousand Faces
//:: no_sw_thouface
//:://////////////////////////////////////////////
/*
Allows the Ninjamastah to appear as various
NPCs of PC playable races.
*/
//:://////////////////////////////////////////////
//:: Created By: Tim Czvetics (NamelessOne)
//:: Created On: Dec 17, 2003
//:://////////////////////////////////////////////
#include "x2_inc_itemprop"
#include "codi_nwscript"
const string sOriginalAppearance = "#TFORIGAPP"; //label for tracking ninjamastah's original appearance
int GetIsShapeChanged( object oE=OBJECT_SELF );
void SetOriginalAppearanceType( object oE=OBJECT_SELF );
int GetOriginalAppearanceType( object oE=OBJECT_SELF );
void main()
{
int iSpell = GetSpellId();
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect( VFX_DUR_PROT_SHADOW_ARMOR );
int iFace;
int iGender = GetGender( OBJECT_SELF );
//don't let ninjamastah use thousand faces if they are polymorphed
if ( GetIsShapeChanged( OBJECT_SELF ) == TRUE )
{
SendMessageToPC( OBJECT_SELF, "You cannot use this ability if your form is altered." );
return;
}
//call function that logs appearance type if it is the first use of this ability
SetOriginalAppearanceType( OBJECT_SELF );
//Determine subradial selection
if(iSpell == SPELLABILITY_NS_DWARF) //DWARF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_DWARF_NPC_FEMALE : APPEARANCE_TYPE_DWARF_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_ELF) //ELF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_ELF_NPC_FEMALE : APPEARANCE_TYPE_ELF_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HALF_ELF) //HALF_ELF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01 : APPEARANCE_TYPE_HUMAN_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HALF_ORC) //HALF_ORC
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE : APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HUMAN) //HUMAN
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02 : APPEARANCE_TYPE_HUMAN_NPC_MALE_02;
}
else if (iSpell == SPELLABILITY_NS_GNOME) //GNOME
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_GNOME_NPC_FEMALE : APPEARANCE_TYPE_GNOME_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_HALFLING) //HALFLING
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HALFLING_NPC_FEMALE : APPEARANCE_TYPE_HALFLING_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_OFF) //RETURN TO ORIGINAL APPEARANCE
{
iFace = GetOriginalAppearanceType( OBJECT_SELF );
}
//Apply the change
ApplyEffectToObject( DURATION_TYPE_TEMPORARY, eVis, OBJECT_SELF, 1.0 );
DelayCommand( 0.5, SetCreatureAppearanceType( OBJECT_SELF, iFace ) );
}
/*
====================
GetIsShapeChanged
Checks to see if oE has the effects of any shapechanging spells or feats.
Returns TRUE is they do and FALSE if not.
====================
*/
int GetIsShapeChanged( object oE=OBJECT_SELF )
{
int iS = FALSE;
if ( GetHasSpellEffect( SPELL_POLYMORPH_SELF, oE ) || GetHasSpellEffect( SPELL_SHAPECHANGE, oE ) ||
GetHasFeatEffect( FEAT_WILD_SHAPE, oE ) || GetHasFeatEffect( FEAT_ELEMENTAL_SHAPE, oE ) ||
GetHasFeatEffect( FEAT_EPIC_WILD_SHAPE_DRAGON, oE ) || GetHasFeatEffect( FEAT_EPIC_WILD_SHAPE_UNDEAD, oE ) ||
GetHasFeatEffect( FEAT_HUMANOID_SHAPE, oE ) || GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_1, oE ) ||
GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_2, oE ) || GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_3, oE ) ||
GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_4, oE ) )
{
iS = TRUE;
}
return iS;
}
/*
====================
SetOriginalAppearanceType
If oE does not have a recorded original appearance type then it is probably the first
time they are using Thousand Faces. Record their current appearance type so that we can
revert to it later.
Note: Increments the appearance type by 1 before recording it. This is because
GetOriginalAppearanceType uses GetLocalInt() and it is possible that it would return
0 which would also be a match for APPEARANCE_TYPE_DWARF, making it difficult to distinguish
between a failed GetLocalInt() and a stored APPEARANCE_TYPE_DWARF.
====================
*/
void SetOriginalAppearanceType( object oE=OBJECT_SELF )
{
int iA = GetLocalInt( oE, sOriginalAppearance );
if ( iA == 0 )
{
//add one to appearance type so we can avoid confusion for APPEARANCE_TYPE_DWARF
SetLocalInt( oE, sOriginalAppearance, GetAppearanceType( oE ) + 1 );
}
}
/*
====================
GetOriginalAppearanceType
Return the APPEARANCE_TYPE_* value that was stored on the creature during the first use of
Thousand Faces. If no value is stored the value returned will be -1.
Note: See the notes for SetOriginalAppearanceType for an explanation of why the retrieved
local integer is decremented.
====================
*/
int GetOriginalAppearanceType( object oE=OBJECT_SELF )
{
//subtract one to match up with adjustment in SetOriginalAppearance
int iA = GetLocalInt( oE, sOriginalAppearance ) - 1;
return iA;
}
//::///////////////////////////////////////////////
//:: codi_nwscript
//:: Central nwscript include file
//:://////////////////////////////////////////////
/*
This file should be the EXACT SAME for ALL CODI
releases.
Version 1.1 - 12-31-2003
-Added all of the prcs, to get everything in line
-Added all racial constants
*/
//:://////////////////////////////////////////////
//:: Created By: James Stoneburner
//:: Created On: 2003-11-30
//:://////////////////////////////////////////////
const int SPELLABILITY_NS_MEDIUM = 1500;
const int SPELLABILITY_NS_SMALL = 1501;
const int SPELLABILITY_NS_DWARF = 1502;
const int SPELLABILITY_NS_ELF = 1503;
const int SPELLABILITY_NS_HALF_ELF = 1504;
const int SPELLABILITY_NS_HALF_ORC = 1505;
const int SPELLABILITY_NS_HUMAN = 1506;
const int SPELLABILITY_NS_GNOME = 1507;
const int SPELLABILITY_NS_HALFLING = 1508;
const int SPELLABILITY_NS_OFF = 1509;
const int SPELLABILITY_OA_CHPERRAY = 1510;
const int SPELLABILITY_OA_SLEEPRAY = 1511;
const int SPELLABILITY_OA_INFRAY = 1512;
const int SPELLABILITY_OA_SLOWRAY = 1513;
const int SPELLABILITY_OA_FEARRAY = 1514;
const int SPELLABILITY_OA_CHMONRAY = 1515;
const int SPELLABILITY_OA_TELERAY = 1516;
const int SPELLABILITY_OA_PETRAY = 1517;
const int SPELLABILITY_OA_DISRAY = 1518;
const int SPELLABILITY_OA_DEATHRAY = 1519;
const int SPELLABILITY_SM_ANCESTDAISHO = 1520;
const int SPELLABILITY_WP_RALLY = 1521;
const int SPELLABILITY_WP_INFLAME = 1522;
const int SPELLABILITY_WP_IMPLACABLE_FOE = 1523;
const int SPELL_BLUR = 1600;
const int SPELL_FAERIE_FIRE = 1601;
const int FEAT_1000FACES_MEDIUM = 2995;
const int FEAT_1000FACES_SMALL = 2996;
const int FEAT_1000FACES_OFF = 2997;
const int FEAT_CHPERRAY = 2980;
const int FEAT_SLEEPRAY = 2981;
const int FEAT_INFRAY = 2982;
const int FEAT_SLOWRAY = 2983;
const int FEAT_FEARRAY = 2984;
const int FEAT_CHMONRAY = 2985;
const int FEAT_TELERAY = 2986;
const int FEAT_PETRAY = 2987;
const int FEAT_DISRAY = 2988;
const int FEAT_DEATHRAY = 2989;
const int FEAT_BATTLE_RAGE1 = 2998;
const int FEAT_BATTLE_RAGE2 = 3014;
const int FEAT_BATTLE_RAGE3 = 3015;
const int FEAT_ANCESTRAL_DAISHO = 3017;
const int FEAT_RALLY = 3018;
const int FEAT_INFLAME = 3019;
const int FEAT_IMPLACABLE_FOE = 3020;
const int FEAT_HEALING_CIRCLE = 3021;
const int FEAT_FEAR_AURA = 3022;
const int FEAT_MASS_HASTE = 3023;
const int FEAT_MASS_HEAL = 3024;
const int FEAT_EPIC_SAMURAI = 3016;
const int FEAT_EPIC_OCULAR = 2979;
const int FEAT_EPIC_NINJA = 3026;
const int FEAT_EPIC_THEURGE = 3027;
const int FEAT_EPIC_WARPRIEST = 3028;
const int CLASS_TYPE_OCULAR = 64;
const int CLASS_TYPE_BATTLERAGER = 61;
const int CLASS_TYPE_MYSTIC_THEURGE = 50;
const int CLASS_TYPE_NINJA_SPY = 47;
const int CLASS_TYPE_SAMURAI = 43;
const int CLASS_TYPE_WARPRIEST = 66;
const int RACIAL_TYPE_TIEFLING = 188;
const int RACIAL_TYPE_DROW = 165;
const int RACIAL_TYPE_GNOLL = 207;
const int RACIAL_TYPE_KOBOLD = 211;
const int RACIAL_TYPE_SUNELF = 167;
const int RACIAL_TYPE_GOLDDWARF = 145;
const int RACIAL_TYPE_WOODELF = 169;
const int RACIAL_TYPE_DEEPGNOME = 174;
const int RACIAL_TYPE_HALFDROW = 161;
const int RACIAL_TYPE_GHOSTWISEHALFLING = 178;
const int RACIAL_TYPE_STRONGHEARTHALFLING = 180;
const int RACIAL_TYPE_AASIMAR = 143;
const int RACIAL_TYPE_DUERGAR = 146;
const int RACIAL_TYPE_WILDELF = 168;
Yup…have gone through everything…still defaults to dwarf when I pick other races. But at least now I get the full dwarf pheno (incl head). It does at least also change me back to my original character too.
Now just need to figure out why it won’t change to other races
//::///////////////////////////////////////////////
//:: codi_nwscript
//:: Central nwscript include file
//:://////////////////////////////////////////////
/*
This file should be the EXACT SAME for ALL CODI
releases.
Version 1.1 - 12-31-2003
-Added all of the prcs, to get everything in line
-Added all racial constants
*/
//:://////////////////////////////////////////////
//:: Created By: James Stoneburner
//:: Created On: 2003-11-30
//:://////////////////////////////////////////////
const int SPELLABILITY_NS_MEDIUM = 2277;
const int SPELLABILITY_NS_SMALL = 2278;
const int SPELLABILITY_NS_DWARF = 2279;
const int SPELLABILITY_NS_ELF = 2280;
const int SPELLABILITY_NS_HALF_ELF = 2281;
const int SPELLABILITY_NS_HALF_ORC = 2282;
const int SPELLABILITY_NS_HUMAN = 2283;
const int SPELLABILITY_NS_GNOME = 2284;
const int SPELLABILITY_NS_HALFLING = 2285;
const int SPELLABILITY_NS_OFF = 2286;
const int SPELLABILITY_OA_CHPERRAY = 2240;
const int SPELLABILITY_OA_SLEEPRAY = 2241;
const int SPELLABILITY_OA_INFRAY = 2242;
const int SPELLABILITY_OA_SLOWRAY = 2243;
const int SPELLABILITY_OA_FEARRAY = 2244;
const int SPELLABILITY_OA_CHMONRAY = 2245;
const int SPELLABILITY_OA_TELERAY = 2246;
const int SPELLABILITY_OA_PETRAY = 2247;
const int SPELLABILITY_OA_DISRAY = 2248;
const int SPELLABILITY_OA_DEATHRAY = 2249;
const int SPELLABILITY_SM_ANCESTDAISHO = 2287;
const int SPELLABILITY_WP_RALLY = 2288;
const int SPELLABILITY_WP_INFLAME = 2289;
const int SPELLABILITY_WP_IMPLACABLE_FOE = 2290;
const int SPELL_BLUR = 1600;
const int SPELL_FAERIE_FIRE = 1601;
const int FEAT_1000FACES_MEDIUM = 2995;
const int FEAT_1000FACES_SMALL = 2996;
const int FEAT_1000FACES_OFF = 2997;
const int FEAT_CHPERRAY = 2980;
const int FEAT_SLEEPRAY = 2981;
const int FEAT_INFRAY = 2982;
const int FEAT_SLOWRAY = 2983;
const int FEAT_FEARRAY = 2984;
const int FEAT_CHMONRAY = 2985;
const int FEAT_TELERAY = 2986;
const int FEAT_PETRAY = 2987;
const int FEAT_DISRAY = 2988;
const int FEAT_DEATHRAY = 2989;
const int FEAT_BATTLE_RAGE1 = 2998;
const int FEAT_BATTLE_RAGE2 = 3014;
const int FEAT_BATTLE_RAGE3 = 3015;
const int FEAT_ANCESTRAL_DAISHO = 3017;
const int FEAT_RALLY = 3018;
const int FEAT_INFLAME = 3019;
const int FEAT_IMPLACABLE_FOE = 3020;
const int FEAT_HEALING_CIRCLE = 3021;
const int FEAT_FEAR_AURA = 3022;
const int FEAT_MASS_HASTE = 3023;
const int FEAT_MASS_HEAL = 3024;
const int FEAT_EPIC_SAMURAI = 3016;
const int FEAT_EPIC_OCULAR = 2979;
const int FEAT_EPIC_NINJA = 3026;
const int FEAT_EPIC_THEURGE = 3027;
const int FEAT_EPIC_WARPRIEST = 3028;
const int CLASS_TYPE_OCULAR = 64;
const int CLASS_TYPE_BATTLERAGER = 61;
const int CLASS_TYPE_MYSTIC_THEURGE = 50;
const int CLASS_TYPE_NINJA_SPY = 47;
const int CLASS_TYPE_SAMURAI = 43;
const int CLASS_TYPE_WARPRIEST = 66;
const int RACIAL_TYPE_TIEFLING = 188;
const int RACIAL_TYPE_DROW = 165;
const int RACIAL_TYPE_GNOLL = 207;
const int RACIAL_TYPE_KOBOLD = 211;
const int RACIAL_TYPE_SUNELF = 167;
const int RACIAL_TYPE_GOLDDWARF = 145;
const int RACIAL_TYPE_WOODELF = 169;
const int RACIAL_TYPE_DEEPGNOME = 174;
const int RACIAL_TYPE_HALFDROW = 161;
const int RACIAL_TYPE_GHOSTWISEHALFLING = 178;
const int RACIAL_TYPE_STRONGHEARTHALFLING = 180;
const int RACIAL_TYPE_AASIMAR = 143;
const int RACIAL_TYPE_DUERGAR = 146;
const int RACIAL_TYPE_WILDELF = 168;
I think in the script above (very first script in thread here). That the reason it keeps defaulting to the dwarf pheno is this part found in the script which I do not understand:
====================
SetOriginalAppearanceType
If oE does not have a recorded original appearance type then it is probably the first
time they are using Thousand Faces. Record their current appearance type so that we can
revert to it later.
Note: Increments the appearance type by 1 before recording it. This is because
GetOriginalAppearanceType uses GetLocalInt() and it is possible that it would return
0 which would also be a match for APPEARANCE_TYPE_DWARF, making it difficult to distinguish
between a failed GetLocalInt() and a stored APPEARANCE_TYPE_DWARF.
====================
*/
void SetOriginalAppearanceType( object oE=OBJECT_SELF )
{
int iA = GetLocalInt( oE, sOriginalAppearance );
if ( iA == 0 )
{
//add one to appearance type so we can avoid confusion for APPEARANCE_TYPE_DWARF
SetLocalInt( oE, sOriginalAppearance, GetAppearanceType( oE ) + 1 );
}
}
/*
Suggestion: If you suspect something is wrong with the SetOriginalAppearanceType function, maybe you could add a debug message to see what the game says is the original appearance of the character (the number of the appearance that is (I have no idea what numbers corresponds to the different appearances)):
====================
SetOriginalAppearanceType
If oE does not have a recorded original appearance type then it is probably the first
time they are using Thousand Faces. Record their current appearance type so that we can
revert to it later.
Note: Increments the appearance type by 1 before recording it. This is because
GetOriginalAppearanceType uses GetLocalInt() and it is possible that it would return
0 which would also be a match for APPEARANCE_TYPE_DWARF, making it difficult to distinguish
between a failed GetLocalInt() and a stored APPEARANCE_TYPE_DWARF.
====================
*/
void SetOriginalAppearanceType( object oE=OBJECT_SELF )
{
int iA = GetLocalInt( oE, sOriginalAppearance );
if ( iA == 0 )
{
//add one to appearance type so we can avoid confusion for APPEARANCE_TYPE_DWARF
SetLocalInt( oE, sOriginalAppearance, GetAppearanceType( oE ) + 1 );
SendMessageToPC(OBJECT_SELF,"Creature's original appearance is number" + IntToString(sOriginalAppearance));
}
}
Hi andgalf
Nice to hear from you again. Hope life is treating you well.
Yeah, I saw that. That is why I uploaded my 2das…I think they are in numerical order. If you see beow:
const int SPELLABILITY_NS_MEDIUM = 2277;
const int SPELLABILITY_NS_SMALL = 2278;
const int SPELLABILITY_NS_DWARF = 2279;
const int SPELLABILITY_NS_ELF = 2280;
const int SPELLABILITY_NS_HALF_ELF = 2281;
const int SPELLABILITY_NS_HALF_ORC = 2282;
const int SPELLABILITY_NS_HUMAN = 2283;
const int SPELLABILITY_NS_GNOME = 2284;
const int SPELLABILITY_NS_HALFLING = 2285;
const int SPELLABILITY_NS_OFF = 2286;
So, have you tried with the debug message above? What does the game tells you about the creature’s original appearance?
EDIT: I don’t think the 2das have anything to do with original appearance. Seems to me that checks for APPEARANCE_TYPE constants. I have those in NWN2, but I have no idea if the numbers are identical in both games.
//::///////////////////////////////////////////////
//:: Thousand Faces
//:: no_sw_thouface
//:://////////////////////////////////////////////
/*
Allows the Ninjamastah to appear as various
NPCs of PC playable races.
*/
//:://////////////////////////////////////////////
//:: Created By: Tim Czvetics (NamelessOne)
//:: Created On: Dec 17, 2003
//:://////////////////////////////////////////////
#include "x2_inc_itemprop"
#include "codi_nwscript"
const string sOriginalAppearance = "#TFORIGAPP"; //label for tracking ninjamastah's original appearance
int GetIsShapeChanged( object oE=OBJECT_SELF );
void SetOriginalAppearanceType( object oE=OBJECT_SELF );
int GetOriginalAppearanceType( object oE=OBJECT_SELF );
void main()
{
int iSpell = GetSpellId();
object oTarget = GetSpellTargetObject();
effect eVis = EffectVisualEffect( VFX_DUR_PROT_SHADOW_ARMOR );
int iFace;
int iGender = GetGender( OBJECT_SELF );
//don't let ninjamastah use thousand faces if they are polymorphed
if ( GetIsShapeChanged( OBJECT_SELF ) == TRUE )
{
SendMessageToPC( OBJECT_SELF, "You cannot use this ability if your form is altered." );
return;
}
//call function that logs appearance type if it is the first use of this ability
SetOriginalAppearanceType( OBJECT_SELF );
//Determine subradial selection
if(iSpell == SPELLABILITY_NS_DWARF) //DWARF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_DWARF_NPC_FEMALE : APPEARANCE_TYPE_DWARF_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_ELF) //ELF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_ELF_NPC_FEMALE : APPEARANCE_TYPE_ELF_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HALF_ELF) //HALF_ELF
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01 : APPEARANCE_TYPE_HUMAN_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HALF_ORC) //HALF_ORC
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE : APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01;
}
else if (iSpell == SPELLABILITY_NS_HUMAN) //HUMAN
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02 : APPEARANCE_TYPE_HUMAN_NPC_MALE_02;
}
else if (iSpell == SPELLABILITY_NS_GNOME) //GNOME
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_GNOME_NPC_FEMALE : APPEARANCE_TYPE_GNOME_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_HALFLING) //HALFLING
{
iFace = iGender == GENDER_FEMALE ? APPEARANCE_TYPE_HALFLING_NPC_FEMALE : APPEARANCE_TYPE_HALFLING_NPC_MALE;
}
else if (iSpell == SPELLABILITY_NS_OFF) //RETURN TO ORIGINAL APPEARANCE
{
iFace = GetOriginalAppearanceType( OBJECT_SELF );
}
//Apply the change
ApplyEffectToObject( DURATION_TYPE_TEMPORARY, eVis, OBJECT_SELF, 1.0 );
DelayCommand( 0.5, SetCreatureAppearanceType( OBJECT_SELF, iFace ) );
}
/*
====================
GetIsShapeChanged
Checks to see if oE has the effects of any shapechanging spells or feats.
Returns TRUE is they do and FALSE if not.
====================
*/
int GetIsShapeChanged( object oE=OBJECT_SELF )
{
int iS = FALSE;
if ( GetHasSpellEffect( SPELL_POLYMORPH_SELF, oE ) || GetHasSpellEffect( SPELL_SHAPECHANGE, oE ) ||
GetHasFeatEffect( FEAT_WILD_SHAPE, oE ) || GetHasFeatEffect( FEAT_ELEMENTAL_SHAPE, oE ) ||
GetHasFeatEffect( FEAT_EPIC_WILD_SHAPE_DRAGON, oE ) || GetHasFeatEffect( FEAT_EPIC_WILD_SHAPE_UNDEAD, oE ) ||
GetHasFeatEffect( FEAT_HUMANOID_SHAPE, oE ) || GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_1, oE ) ||
GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_2, oE ) || GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_3, oE ) ||
GetHasFeatEffect( FEAT_GREATER_WILDSHAPE_4, oE ) )
{
iS = TRUE;
}
return iS;
}
/*
====================
SetOriginalAppearanceType
If oE does not have a recorded original appearance type then it is probably the first
time they are using Thousand Faces. Record their current appearance type so that we can
revert to it later.
Note: Increments the appearance type by 1 before recording it. This is because
GetOriginalAppearanceType uses GetLocalInt() and it is possible that it would return
0 which would also be a match for APPEARANCE_TYPE_DWARF, making it difficult to distinguish
between a failed GetLocalInt() and a stored APPEARANCE_TYPE_DWARF.
====================
*/
void SetOriginalAppearanceType( object oE=OBJECT_SELF )
{
int iA = GetLocalInt( oE, sOriginalAppearance );
if ( iA == 0 )
{
//add one to appearance type so we can avoid confusion for APPEARANCE_TYPE_DWARF
SetLocalInt( oE, sOriginalAppearance, GetAppearanceType( oE ) + 1 );
SendMessageToPC(OBJECT_SELF,"Creature's original appearance is number" + IntToString(sOriginalAppearance));
}
}
/*
====================
GetOriginalAppearanceType
Return the APPEARANCE_TYPE_* value that was stored on the creature during the first use of
Thousand Faces. If no value is stored the value returned will be -1.
Note: See the notes for SetOriginalAppearanceType for an explanation of why the retrieved
local integer is decremented.
====================
*/
int GetOriginalAppearanceType( object oE=OBJECT_SELF )
{
//subtract one to match up with adjustment in SetOriginalAppearance
int iA = GetLocalInt( oE, sOriginalAppearance ) - 1;
return iA;
}
Here is your script again with my added SendMessageToPC line.