Author Topic: How do I make it that if the henchman dies, the PC dies too  (Read 359 times)

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0


                Greetings, had no trouble setting up my henchman (who is mandatory for a small while) and I want to make it, that if he dies, the PC dies as well. The reason is I do not allowing respawning in my module, and the henchman must surive as part of the story. 
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
How do I make it that if the henchman dies, the PC dies too
« Reply #1 on: June 20, 2011, 07:52:25 am »


               Basically you should just be able to add a couple lines to your default henchmen OnDeath script. For example:


"x2_hen_death" (modified. the 2 red lines are all I added to the default script):


//::///////////////////////////////////////////////
//:: Henchman Death Script
//::
//:: X2_HEN_DEATH.nss
//::
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
//:: <description>
//:://////////////////////////////////////////////
//::
//:: Created By:
//:: Modified by:   Brent, April 3 2002
//::                Removed delay in respawning
//::                the henchman - caused bugs
//:: Modified November 14 2002
//::  - Henchem will now stay dead. Need to be raised
//:://////////////////////////////////////////////

//::///////////////////////////////////////////////
//:: Greater Restoration
//:: NW_S0_GrRestore.nss
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Removes all negative effects of a temporary nature
    and all permanent effects of a supernatural nature
    from the character. Does not remove the effects
    relating to Mind-Affecting spells or movement alteration.
    Heals target for 5d8 + 1 point per caster level.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 7, 2002
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Modifications To Support Horses By: Deva Winblood, On: April 17th, 2008

#include "nw_i0_generic"
#include "nw_i0_plot"
#include "x0_i0_henchman"
#include "x3_inc_horse"

void main()
{
    effect eDeath = EffectDeath();
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetMaster(OBJECT_SELF));
    
    SetLocalString(OBJECT_SELF,"sX3_DEATH_SCRIPT","x2_hen_death");
    if (HorseHandleDeath()) return;
    DeleteLocalString(OBJECT_SELF,"sX3_DEATH_SCRIPT");
    etc...........


Hope that works for ya. Good luck.
               
               

               
            

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
How do I make it that if the henchman dies, the PC dies too
« Reply #2 on: June 20, 2011, 07:57:13 am »


               Thanks for the quick response to both my threads. Let you know if they work out '<img'>
               
               

               
            

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
How do I make it that if the henchman dies, the PC dies too
« Reply #3 on: June 21, 2011, 08:28:50 am »


               It worked! Thanks loads. I also added a message that lets you know your henchman dies and as a result it's game over. Just so people don't get confused and wonder why the hell they just died '<img'>