MMD_PRC8/_module/nss/mp_hen_spawn.nss
Jaysyn904 d77404f157 2025/07/15 Update
Added PEPS AI.
Updated module name.
Set all henchmen to have a random race &/or class based name using a custom version of Markshire's Nomeclature scripts, as well as appearance.
Set Constructs, Undead, Outsiders & Elementals to not require food or drink.
Full compile.
2025-07-15 22:19:46 -04:00

91 lines
2.8 KiB
Plaintext

//:://////////////////////////////////////////////////
//:: X0_CH_HEN_SPAWN
//:: Copyright (c) 2002 Floodgate Entertainment
//:://////////////////////////////////////////////////
/*
Henchman-specific OnSpawn handler for XP1. Based on NW_CH_AC9 by Bioware.
*/
//:://////////////////////////////////////////////////
//:: Created By: Naomi Novik
//:: Created On: 10/09/2002
//:://////////////////////////////////////////////////
#include "x0_i0_anims"
#include "x0_inc_henai"
#include "x2_inc_switches"
#include "ms_name_inc"
#include "mmd_inc_random"
void main()
{
object oNPC = OBJECT_SELF;
string sTag = GetTag(oNPC);
object oReset = GetWaypointByTag(sTag);
object oRespawn = GetObjectByTag("NW_DEATH_TEMPLE");
location lRespawn = GetLocation(oRespawn);
location lReset = GetLocation(oReset);
//SetLocalInt(oNPC,"X2_L_SPAWN_USE_AMBIENT",1);
//:: Don't want all the Henchmen to have a title.
if (d2(1) == 2)
{
DeleteLocalInt(oNPC, "RND_BARD");
DeleteLocalInt(oNPC, "RND_BARBARIAN");
DeleteLocalInt(oNPC, "RND_CLERIC");
DeleteLocalInt(oNPC, "RND_DRUID");
DeleteLocalInt(oNPC, "RND_FIGHTER");
DeleteLocalInt(oNPC, "RND_MAGE");
DeleteLocalInt(oNPC, "RND_MONK");
DeleteLocalInt(oNPC, "RND_PALADIN");
DeleteLocalInt(oNPC, "RND_RANGER");
DeleteLocalInt(oNPC, "RND_ROGUE");
}
ms_Nomenclature(oNPC);
DelayCommand(0.0f, rnd_skin(oNPC));
DelayCommand(0.0f, rnd_head(oNPC));
DelayCommand(0.0f, rnd_pheno(oNPC));
DelayCommand(0.0f, rnd_tattoo(oNPC));
DelayCommand(0.0f, rnd_height(oNPC));
//Sets up the special henchmen listening patterns
SetAssociateListenPatterns();
// Set additional henchman listening patterns
bkSetListeningPatterns();
// Default behavior for henchmen at start
SetAssociateState(NW_ASC_POWER_CASTING);
SetAssociateState(NW_ASC_HEAL_AT_50);
SetAssociateState(NW_ASC_RETRY_OPEN_LOCKS, FALSE);
SetAssociateState(NW_ASC_DISARM_TRAPS);
SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE);
SetAssociateState(NW_ASC_DISTANCE_2_METERS);
//Use melee weapons by default
SetAssociateState(NW_ASC_USE_RANGED_WEAPON, FALSE);
// For some general behavior while we don't have a master,
// let's do some immobile animations
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//JumpToLocation(lReset);
int iRoll = Random(60)+1;
string sTag2 = "henchwp";
object oWP = GetObjectByTag(sTag2+IntToString(iRoll));
//ExecuteScript("nw_c2_default9",OBJECT_SELF);
//ActionForceMoveToObject(oWP,FALSE,3.0f);
JumpToObject(oWP);
// Set starting location
//SetAssociateStartLocation();
// Set respawn location
//SetRespawnLocationSpecific(oNPC, lRespawn);
//DelayCommand(6.0f,ActionRandomWalk());
if (GetIsHired(oNPC)!=TRUE) SetAnimationCondition(NW_ANIM_FLAG_IS_ACTIVE);
}