MMD_PRC8/_module/nss/spawn_towners.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

74 lines
1.9 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name x2_def_spawn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default On Spawn script
2003-07-28: Georg Zoeller:
If you set a ninteger on the creature named
"X2_USERDEFINED_ONSPAWN_EVENTS"
The creature will fire a pre and a post-spawn
event on itself, depending on the value of that
variable
1 - Fire Userdefined Event 1510 (pre spawn)
2 - Fire Userdefined Event 1511 (post spawn)
3 - Fire both events
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner, Georg Zoeller
//:: Created On: June 11/03
//:://////////////////////////////////////////////
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
#include "x0_i0_anims"
#include "x2_inc_switches"
#include "ms_name_inc"
#include "mmd_inc_random"
void main()
{
object oNPC = OBJECT_SELF;
// User defined OnSpawn event requested?
int nSpecEvent = GetLocalInt(oNPC,"X2_USERDEFINED_ONSPAWN_EVENTS");
// Pre Spawn Event requested
if (nSpecEvent == 1 || nSpecEvent == 3 )
{
SignalEvent(oNPC,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
}
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));
/* Fix for the new golems to reduce their number of attacks */
int nNumber = GetLocalInt(oNPC,CREATURE_VAR_NUMBER_OF_ATTACKS);
if (nNumber >0 )
{
SetBaseAttackBonus(nNumber);
}
// Execute default OnSpawn script.
ExecuteScript("nw_c2_default9", oNPC);
//Post Spawn event requeste
if (nSpecEvent == 2 || nSpecEvent == 3)
{
SignalEvent(oNPC,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
}
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
}