HiddenTradition_PRC8/_module/nss/x0_ch_hen_death.nss
Jaysyn904 f50efc97c0 Added Faction Zoo
- igor doesn't give boxes if you choose to explore a bit, but he takes the contract anyway [quest-breaking]
	*Fixed.  Moved some dialog around so you couldn't skip out on taking the quest after you gave up the letter.

- key 'Pilgrims Cave Key' it_pilgrimscavek to plot-locked door isn't provided anywhere [quest-breaking]
	*Not a bug.  Key drops from the Elder Goblin Shaman in Pilgrim's Cave

Full compile.  Updated release archive.

- can't get farmer bouillon's quest if already offered to buy an ox [quest-breaking]
	*Couldn't replicate.  Nothing in the dialog is locked regarding this.

- jerusalem watch captain doesn't recognise letter to ogre mage [quest-breaking]
	*Fixed.  Quest item tag was mispelled.

- plot key 'amulet of thievery' [amuletofthievery] to plot-locked door never given anywhere
	*Not fixed.  This may be for an incomplete area or quest.  No NPC named "Fremmy South" exists in the module, nor is the name mentioned in dialogs.

- key 'Lomendel's Front Door Key' [it_LomFrontKey] to plot-locked door never given anywhere.
	*Not fixed.  This appears to be a DM or system area.  No NPC named Lomendel exists & the only mention of them in the dialogs is by the Efreeti merchant in the area.

- key it_RachelsRoomKey [rachelskey] to plot-locked door never given anywhere
	*Not fixed.  This may be for an incomplete area or quest.  No NPC named "Rachel" exists in the module, nor is the name mentioned in dialogs.  There is nothing of note in the room.

- east tower key given but no doors on any east towers anywhere
	*Not fixed.  There is no "East Tower Key" in the item palette at all.  Balkan East Tower doesn't require a key.

- transitions within areas don't jump henchmen with pc
	*Fixed.  Changed the triggers to use scripted transitions that bring all associates with the PC.

- rd to bethlehem - broken trans [gate to nowhere]
	*Not fixed.  Not an actual transition, There is no "Convent" in the area list.  Gate description now tells you it's barred.

- faction bugs with guards at pilgrims' rest
	*Maybe fixed.  I added a "faction zoo" and set the merchant faction to neutral to all of the other factions.

- faction bugs with watchmen in jerusalem
	*See above

- dwarf captives in svirfneblin lair - invalid exit waypoint
	*Fixed.  Added missing waypoint.

- elvish grove quest journal doesn't close
	*Couldn't replicate.  Journal entry cleared normally upon completion of the quest.

- dwarven mine quest journal doesn't close
	*Fixed.  Final journal entry wasn't set to close the quest.

- idun's apple quest journal doesn't close
	*Fixed.  Final journal entry wasn't set to close the quest.

- implementation of climbing rope, while well-intentioned, doesn't work correctly
	*Couldn't replicate.  Worked fine for me. https://i.imgur.com/45UC3xS.jpeg

- doors close automatically without anyone to close them
	*Not a bug, desired behaivior.

- henchmen don't level up
	*Fixed

- when henchmen are dismissed, they don't just go back to where they were; they're destroyed and respawned
	*Fixed
2024-09-14 22:29:14 -04:00

146 lines
5.4 KiB
Plaintext

//:://////////////////////////////////////////////////
//:: X0_CH_HEN_DEATH
//:: Copyright (c) 2002 Floodgate Entertainment
//:://////////////////////////////////////////////////
/*
OnDeath handler for henchmen ONLY. Causes them to respawn at
(in order of preference) the respawn point of their master
or their own starting location.
*/
//:://////////////////////////////////////////////////
//:: Created By: Naomi Novik
//:: Created On: 10/09/2002
//:://////////////////////////////////////////////////
//:://////////////////////////////////////////////////
//:: Modified By: Bob Minors
//:: Modified On: Jan 12th, 2008
//:: Added Support for Dying While Mounted
//:: Modified By: Deva Winblood
//:: Modified On: April 17th, 2008
//:: Fixes for henchmen mounts being lost
//:://///////////////////////////////////////////////
#include "x0_i0_henchman"
#include "x3_inc_horse"
void BringBack(object oWP)
{
SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", GetMaster());
// : REMINDER: The delay is here for a reason
DelayCommand(0.1, RemoveEffects(OBJECT_SELF));
DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectResurrection(), OBJECT_SELF));
DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF));
DelayCommand(5.1, SetIsDestroyable(TRUE, TRUE, TRUE));
if (GetIsObjectValid(oWP) == TRUE)
{
// * if in Source stone area, respawn at opening to area
// if (GetTag(GetArea(OBJECT_SELF)) == "SOME_RANDOM_AREA")
// {
DelayCommand(0.2, JumpToObject(oWP, FALSE));
// }
// else
// DelayCommand(0.2, JumpToObject(oWP, FALSE));
}
else
DelayCommand(0.3, ActionSpeakString("Error: No place to go"));
}
void main()
{
object oNPC = OBJECT_SELF;
object oWP;
string sResref = GetResRef(oNPC);
if(sResref == "angus001") {oWP = GetObjectByTag("WP_HRESPAWN_ANGUS");}
if(sResref == "bjorn") {oWP = GetObjectByTag("WP_HRESPAWN_BJORN");}
if(sResref == "briah001") {oWP = GetObjectByTag("WP_HRESPAWN_BRIAH");}
if(sResref == "hench_jeanmarie") {oWP = GetObjectByTag("WP_HRESPAWN_CHURCH");}
if(sResref == "fabrizio001") {oWP = GetObjectByTag("WP_HRESPAWN_FAB");}
if(sResref == "farouk") {oWP = GetObjectByTag("WP_HRESPAWN_FAROUK");}
if(sResref == "francesco001") {oWP = GetObjectByTag("WP_HRESPAWN_FRANCESCO");}
if(sResref == "frederic") {oWP = GetObjectByTag("WP_HRESPAWN_FREDERIC");}
if(sResref == "gabrielle") {oWP = GetObjectByTag("WP_HRESPAWN_GABRIELLE");}
if(sResref == "guillaume") {oWP = GetObjectByTag("WP_HRESPAWN_GUILL");}
if(sResref == "isang") {oWP = GetObjectByTag("WP_HRESPAWN_ISANG");}
if(sResref == "jacob001") {oWP = GetObjectByTag("WP_HRESPAWN_JACOB");}
if(sResref == "kamen001") {oWP = GetObjectByTag("WP_HRESPAWN_KAMEN");}
if(sResref == "kamiosa") {oWP = GetObjectByTag("WP_HRESPAWN_KAMIOSA");}
if(sResref == "kerville") {oWP = GetObjectByTag("WP_HRESPAWN_KERVILLE");}
if(sResref == "hench_marco") {oWP = GetObjectByTag("WP_HRESPAWN_MARCO");}
if(sResref == "nephiliam") {oWP = GetObjectByTag("WP_HRESPAWN_NEPHILIAM");}
if(sResref == "ug001") {oWP = GetObjectByTag("WP_HRESPAWN_UG");}
SetLocalString(OBJECT_SELF,"sX3_DEATH_SCRIPT","x0_ch_hen_death");
if (HorseHandleDeath()) return;
DeleteLocalString(OBJECT_SELF,"sX3_DEATH_SCRIPT");
// Handle a bunch of stuff to keep us from running around,
// dying again, etc.
PreRespawnSetup();
// Call for healing
DelayCommand(0.5, VoiceHealMe(TRUE));
// Get our last master
object oPC = GetLastMaster();
object oSelf = OBJECT_SELF;
// Clear dialogue events
ClearAllDialogue(oPC, OBJECT_SELF);
ClearAllActions();
string sAreaTag = GetTag(GetArea(OBJECT_SELF));
// * in final battle area henchmen death is now permanent
if (sAreaTag == "Winds_04")
{
SetPlotFlag(OBJECT_SELF,FALSE);
SetImmortal(OBJECT_SELF, FALSE);
SetIsDestroyable(TRUE, FALSE, FALSE);
DestroyObject(OBJECT_SELF, 0.2);
return;
}
if ((GetTag(GetModule()) == "MODULE" || GetTag(GetModule()) == "x0_module2" || GetTag(GetModule()) == "x0_module3") && GetIsObjectValid(oPC) == FALSE)
{
// SpawnScriptDebugger();
// * if you kill a henchmen who has never had a master
// * then permanently kill them to prevent
// * faction issues.
SetPlotFlag(OBJECT_SELF,FALSE);
SetImmortal(OBJECT_SELF, FALSE);
SetIsDestroyable(TRUE, FALSE, FALSE);
DestroyObject(OBJECT_SELF, 0.2);
return;
}
// If we don't have a master OR he has died, respawn immediately
// April 2003, in some areas the henchmen has to respawn immediately
// back for pathfinding reasons (i.e., if they die in front of the dragon
// the dragon will act stupid
if (!GetIsObjectValid(oPC) || GetIsDead(oPC) == TRUE && GetTag(GetModule()) == "x0_module1"
|| sAreaTag =="Q5_DragonCaves" || sAreaTag == "Q3C_AncientTemple")
{
DelayCommand(1.0, RespawnHenchman());
DelayCommand(1.5, PostRespawnCleanup());
}
else
{
// BK Feb 2003: Make the henchman rejoin you so that you can use potions on them
DelayCommand(0.1, AddHenchman(oPC, oSelf));
// Start the respawn checking
RaiseForRespawn(oPC);
BringBack(oWP);
SetCommandable(FALSE);
// * henchmen will always stay where they die unless you leave them
// RespawnCheck(oPC);
}
}