This part works, the player is correctly polymorphed to the form I want, and they correctly can't cancel the form. Setting only the appearance will also work for my purposes.
const int POLYMORPH_TYPE_PC = 160;
#include "ginc_param_const"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = oPC;
int nApp = GetAppearanceType(oPC);
SetLocalInt (oPC, "nAppearance", nApp);
int nPolymorphSelection = POLYMORPH_TYPE_PC;
int nLocked = 1; //prevent player from cancelling.
int nDurationType = DURATION_TYPE_PERMANENT;
effect ePoly = EffectPolymorph(nPolymorphSelection, nLocked);
ApplyEffectToObject(nDurationType, ePoly, oTarget);
//store player name for later restoration.
SetLocalString (oPC, "sFirstName", (GetFirstName(oPC)));
SetLocalString (oPC, "sLastName", (GetLastName(oPC)));
SetFirstName(oPC, "name_goes_here");
SetLastName(oPC, "");
}
I need to reverse this when the player exits the trigger, restoring the original form (and name, but that's simple). That part's not working.





Retour en haut






