Try something like the following script in the OnDamaged event of both of the NPCs. If you can give both of the NPCs the same tag, then you can use this same script for both of them. Otherwise each will have to have their own script with the correct tag plugged into it. Also make sure both NPCs are checked "immortal"
~You can change the
4 to whatever you want. That line is just saying that if the current HPs of the NPC are less than 4 then do stuff.
~Put the tag of the NPC's partner where it says "
NPC Tag Here". Not the tag of self(unless the tags are the same which would be ideal).
void main()
{
int iCurrHP = GetCurrentHitPoints(OBJECT_SELF);
if (iCurrHP <
4)
{
object oDamager = GetLastDamager(OBJECT_SELF);
object oPal = GetNearestObjectByTag("
NPC Tag Here", OBJECT_SELF);
object oArea = GetArea(OBJECT_SELF);
ClearAllActions(TRUE);
AssignCommand(oPal, ClearAllActions(TRUE));
object oFactionMem = GetFirstFactionMember(oDamager, FALSE);
while (GetIsObjectValid(oFactionMem))
{
if (GetArea(oFactionMem) == oArea)
{
AssignCommand(oFactionMem, ClearAllActions(TRUE));
SetIsTemporaryFriend(oFactionMem, OBJECT_SELF, FALSE);
AssignCommand(oPal, SetIsTemporaryFriend(oFactionMem, oPal, FALSE));
}
oFactionMem = GetNextFactionMember(oDamager, FALSE);
}
}
ExecuteScript("nw_sc_default6", OBJECT_SELF);
}
Hope it helps. Good luck.
Modifié par GhostOfGod, 16 juin 2011 - 07:08 .