void main() { object oPC = GetPCSpeaker(); object oArea = GetArea(oPC); object oWay = GetWaypointByTag("bh_tagdream1"); object oPartyArea; int nHeal; object oPartyM = GetFirstFactionMember(oPC); while(GetIsObjectValid(oPartyM)) { oPartyArea = GetArea(oPartyM); if(!GetIsDM(oPartyM) && oArea == oPartyArea) { if(!GetIsDead(oPartyM)) { AssignCommand(oPartyM, PlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 3.0)); DelayCommand(0.5f, FadeToBlack(oPartyM)); DelayCommand(1.5f, AssignCommand(oPartyM, ActionJumpToLocation(GetLocation(oWay)))); } else { nHeal = GetMaxHitPoints(oPartyM); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPartyM); DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHeal), oPartyM)); // Remove player's Death status from the database SetCampaignInt("p_death", "is_dead", FALSE, oPartyM); DelayCommand(0.4f, AssignCommand(oPartyM, PlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 3.0))); DelayCommand(0.8f, FadeToBlack(oPartyM)); DelayCommand(1.5f, AssignCommand(oPartyM, ActionJumpToLocation(GetLocation(oWay)))); } } oPartyM = GetNextFactionMember(oPC); } SetLocalInt(oArea, "HSended", TRUE); }