Change appearance script

okay I am running into some issues here.

Explenation:
So I am using an appearance change script for a widget. So the change happends during conversation with the item.

So here is the script:

void main()
{
object oPC = GetPCSpeaker();

// Store PC-appearance -> used when changing back
int nAppear = GetAppearanceType(oPC);
SetLocalInt(oPC, "PCAppearance", nAppear);

SendMessageToPC(oPC, "Changing Appearance");

if (GetGender(oPC) == GENDER_MALE)
    {
    SetCreatureAppearanceType(oPC, 1624); // appearance.2da-line
    }
else
    {
    SetCreatureAppearanceType(oPC, 1624); // appearance.2da-line
    }
{
    effect eEffect;

    // Get the PC who is in this conversation.
    object oPC = GetPCSpeaker();

    // Apply some effects.
    eEffect = SupernaturalEffect(EffectACIncrease(5, AC_NATURAL_BONUS));
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
    eEffect = SupernaturalEffect(EffectTrueSeeing());
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
    eEffect = SupernaturalEffect(EffectAbilityIncrease(ABILITY_STRENGTH, 6));
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
    eEffect = SupernaturalEffect(EffectAbilityIncrease(ABILITY_CONSTITUTION, 6));
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);
}
}

Okay so this works, now what I am wondering is how to make it so that the PC will now be unable to use weapons/armor while it has this specific appearance on? Anyone know how to do that?

The easiest (script-only) approach is to unequip all items, then in OnPlayerEquipItem check if PC has given appearance and force-unequip any item that matches your criteria. It won’t look great, though.

But your script is pretty much emulating an EffectPolymorph, so why not add your own line to polymorph.2da instead? This will change appearance, prevent weapon/armor use, change AC, stats, etc, and - as a bonus - keep everything in sync.

well, I kinda wanted to have a semi-polymorph effect. Though for as far as I am aware the polymorph always cancels during rests and with this I wanted to prevent that from happening unless that can be prevented as well in polymorph?

SupernaturalEffect + DURATION_TYPE_PERMANENT :slight_smile:

thank you!! <3