Use this in the henchman heartbeat - you may have to edit it in, but that shouldn't be too hard. I haven't compiled this, but it should work, barring a typo somewhere:
void main() {
object oMaster;
if (GetIsDead(OBJECT_SELF)) {
oMaster = GetLocalObject(OBJECT_SELF, "Master");
if (GetIsObjectValid(oMaster) && !GetIsInCombat(oMaster) && !GetIsDead(oMaster)) {
effect eRes = EffectResurrection();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRes, OBJECT_SELF);
}
} else {
oMaster = GetLocalObject(OBJECT_SELF, "Master");
if (!GetIsObjectValid(oMaster)) {
oMaster = GetMaster(OBJECT_SELF);
if (GetIsObjectValid(oMaster))
SetLocalObject(OBJECT_SELF, "Master", oMaster);
}
//add any other stuff you want to happen to henchman while alive here
}
}
Basically, it checks while the npc is alive for their master, and stores them as a local for later reference. Please note that this is not a robust script - it doesn't provide, for example, with a way for the npc to switch masters. It just does the bare minimum of what you asked. Myself, I would normally only set the "Master" local once, in another event, but it's still fairly low overhead, and I'm trying to keep it simple so that you can see how local objects are used.
Funky