This is the script you're looking for, from Adam Miller's Shadowlords 1. All credit goes to Adam. Modify as you need.
The henchman will die in combat, and resurrect a few seconds later. Like above posters said, you can add a conditional so they only do so at the end of combat.
#include "nw_i0_generic"
#include "nw_i0_plot"
void BringBack()
{
string sReturn = "";
if(GetTag(OBJECT_SELF) == "Nooble")
sReturn = "I'm not dead yet!";
if(GetTag(OBJECT_SELF) == "Teira")
sReturn = "Well, there goes one of my nine lives.";
if(GetTag(OBJECT_SELF) == "Anera")
sReturn = "By Kelemvor's faith, I return.";
SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", GetMaster());
// : REMINDER: The delay is here for a reason
DelayCommand(0.1, RemoveEffects(OBJECT_SELF));
DelayCommand(30.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectResurrection(), OBJECT_SELF));
DelayCommand(30.3, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF));
DelayCommand(31.0, AssignCommand(OBJECT_SELF, ActionSpeakString(sReturn)));
// AssignCommand(OBJECT_SELF, ActionWait(30.0));
// DelayCommand(31.0, FloatingTextStringOnCreature(sReturn, OBJECT_SELF));
DelayCommand(35.1, SetIsDestroyable(TRUE, TRUE, TRUE));
}
void main()
{
object oMe = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, GetMaster());
if (oMe == OBJECT_SELF
// * this is to prevent 'double hits' from stopping
// * the henchmen from moving to the temple of tyr
// * I.e., henchmen dies 'twice', once after leaving your party
|| GetLocalInt(OBJECT_SELF, "NW_L_HEN_I_DIED") == TRUE)
{
SetPlotFlag(oMe, TRUE);
SetAssociateState(NW_ASC_IS_BUSY, TRUE);
AddJournalQuestEntry("Henchmen", 99, GetMaster(), FALSE, FALSE, FALSE);
SetIsDestroyable(FALSE, TRUE, TRUE);
SetLocalInt(OBJECT_SELF, "NW_L_HEN_I_DIED", TRUE);
ClearAllActions();
DelayCommand(0.5, ActionDoCommand(SetCommandable(TRUE)));
DelayCommand(5.0, ActionDoCommand(SetAssociateState(NW_ASC_IS_BUSY, FALSE)));
DelayCommand(5.0, SetPlotFlag(oMe, FALSE));
BringBack();
SetCommandable(FALSE);
}
else
{
BringBack();
}
}
Modifié par Snarkblat, 24 juin 2011 - 09:24 .