97 lines
3.0 KiB
Plaintext
97 lines
3.0 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: wererat_onspawn.nss
|
|
//:: Copyright (c) 2022 Project RATDOG
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
OnSpawn event script for wererats.
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Jaysyn
|
|
//:: Created On: 20220703
|
|
//:://////////////////////////////////////////////
|
|
|
|
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
|
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
|
|
|
#include "j_inc_spawnin"
|
|
#include "ms_name_inc"
|
|
#include "rnd_commoner_inc"
|
|
|
|
void main()
|
|
{
|
|
string sTag;
|
|
object oNPC;
|
|
// User defined OnSpawn event requested?
|
|
int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
|
|
|
|
|
|
// Pre Spawn Event requested
|
|
if (nSpecEvent == 1 || nSpecEvent == 3 )
|
|
{
|
|
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
|
|
}
|
|
|
|
SetAIInteger(AI_INTELLIGENCE, 10);
|
|
// This is the intelligence of the creature 1-10. Default to 10
|
|
// Read the file in "Explainations" about this intelligence for more info.
|
|
|
|
SetSpawnInCondition(AI_FLAG_FLEEING_FEARLESS, AI_TARGETING_FLEE_MASTER);
|
|
// Fearless
|
|
|
|
SetSpawnInCondition(AI_FLAG_OTHER_DONT_RESPOND_TO_EMOTES, AI_OTHER_MASTER);
|
|
// This will ignore ALL chat by ENEMIES who speak in Stars - IE
|
|
// "*Nods*" will be ignored, while "Nods" will not, nor "*Nods"
|
|
|
|
SetSpawnInCondition(AI_FLAG_UDE_ATTACK_EVENT, AI_UDE_MASTER);
|
|
|
|
// AI Behaviour. DO NOT CHANGE! DO NOT CHANGE!!!
|
|
AI_SetUpEndOfSpawn();
|
|
// This MUST be called. It fires these events:
|
|
// SetUpSpells, SetUpSkillToUse, SetListeningPatterns, SetWeapons, AdvancedAuras.
|
|
// These MUST be called! the AI might fail to work correctly if they don't fire!
|
|
|
|
// Example (and default) of user addition:
|
|
// - If we are from an encounter, set mobile (move around) animations.
|
|
if(GetIsEncounterCreature())
|
|
{
|
|
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS, NW_GENERIC_MASTER);
|
|
}
|
|
|
|
// Check for randomizations.
|
|
|
|
ms_Nomenclature(OBJECT_SELF);
|
|
|
|
int nKeepskin = GetLocalInt(OBJECT_SELF,"RA_KEEPSKIN");
|
|
if (nKeepskin != 1)
|
|
{
|
|
rnd_skin(OBJECT_SELF);
|
|
}
|
|
|
|
rnd_skin(OBJECT_SELF);
|
|
|
|
int nKeephead = GetLocalInt(OBJECT_SELF,"RA_KEEPHEAD");
|
|
if (nKeephead != 1)
|
|
{
|
|
rnd_head(OBJECT_SELF);
|
|
}
|
|
|
|
int nKeeptats = GetLocalInt(OBJECT_SELF,"RA_KEEPTATS");
|
|
if (nKeeptats != 1)
|
|
{
|
|
rnd_tattoo(OBJECT_SELF);
|
|
}
|
|
|
|
|
|
// Execute default OnSpawn script.
|
|
ExecuteScript("nw_c2_default9", OBJECT_SELF);
|
|
|
|
// Execute PRC OnSpawn script.
|
|
ExecuteScript("prc_npc_spawn", OBJECT_SELF);
|
|
|
|
// Note: You shouldn't really remove this. Also performs hiding ETC.
|
|
DelayCommand(2.0f, SpawnWalkWayPoints());
|
|
// Delayed walk waypoints, as to not upset instant combat spawning.
|
|
// This will also check if to change to day/night posts during the walking, no heartbeats.
|
|
}
|