While I've never tried to do this, I don't see why it'd need NWNX. Here's our ForceEquip function, with some server specific stuff cut out:
void ForceUnequip (object oTarget, object oItem) {
if (!GetIsObjectValid(oTarget) || GetObjectType(oTarget) != OBJECT_TYPE_CREATURE)
return;
if (!GetIsObjectValid(GetArea(oTarget))) {
DelayCommand(5.0, ForceUnequip(oTarget, oItem));
return;
}
if (GetIsDead(oTarget)) {
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oTarget)), oTarget);
//if (GetIsPC(oTarget))
// AssignCommand(oTarget, ExecuteScript("fky_deathprocess", oTarget));
//swap in your custom 'on resurrection' script above, if you have one
DelayCommand(0.1, ForceUnequip(oTarget, oItem));
} else {
AssignCommand(oTarget, ClearAllActions(TRUE));
AssignCommand(oTarget, ActionUnequipItem(oItem));
AssignCommand(oTarget, ActionDoCommand(SetCommandable(TRUE)));
AssignCommand(oTarget, SetCommandable(FALSE));
}
}
In principle, it should work the same with ActionEquipItem, though I'm not sure what poly status will do to that. My experience with polymorphed critters mostly extends to shifter scripts (though those get fairly complicated what with the occasionally chaotic order of event firing).
Funky