229 lines
14 KiB
Plaintext
229 lines
14 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Default: On Spawn In
|
||
|
//:: NW_C2_DEFAULT9
|
||
|
//:: Copyright (c) 2001 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Determines the course of action to be taken
|
||
|
after having just been spawned in
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Preston Watamaniuk
|
||
|
//:: Created On: Oct 25, 2001
|
||
|
//:://////////////////////////////////////////////
|
||
|
#include "NW_O2_CONINCLUDE"
|
||
|
#include "NW_I0_GENERIC"
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
//OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
|
||
|
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
|
||
|
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
|
||
|
// This causes the creature to say a special greeting in their conversation file
|
||
|
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
|
||
|
// greeting in order to designate it. As the creature is actually saying this to
|
||
|
// himself, don't attach any player responses to the greeting.
|
||
|
|
||
|
//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
|
||
|
// This will set the listening pattern on the NPC to attack when allies call
|
||
|
//SetSpawnInCondition(NW_FLAG_STEALTH);
|
||
|
// If the NPC has stealth and they are a rogue go into stealth mode
|
||
|
//SetSpawnInCondition(NW_FLAG_SEARCH);
|
||
|
// If the NPC has Search go into Search Mode
|
||
|
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
|
||
|
// This will set the NPC to give a warning to non-enemies before attacking
|
||
|
|
||
|
//SetSpawnInCondition(NW_FLAG_SLEEP);
|
||
|
//Creatures that spawn in during the night will be asleep.
|
||
|
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
|
||
|
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
|
||
|
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
|
||
|
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
|
||
|
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
|
||
|
//NOTE that these animations will play automatically for Encounter Creatures.
|
||
|
|
||
|
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
|
||
|
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
|
||
|
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
|
||
|
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
|
||
|
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)
|
||
|
|
||
|
// CUSTOM USER DEFINED EVENTS
|
||
|
/*
|
||
|
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
|
||
|
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
|
||
|
events user 1000 - 1010
|
||
|
*/
|
||
|
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
|
||
|
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
|
||
|
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
|
||
|
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
|
||
|
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
|
||
|
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
|
||
|
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
|
||
|
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
|
||
|
|
||
|
// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) *****************************************************************************************
|
||
|
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
|
||
|
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
|
||
|
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
|
||
|
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
|
||
|
// combat.
|
||
|
GenerateNPCTreasure(1000); //* Use this to create a small amount of treasure on the creature
|
||
|
|
||
|
int nTownCrier = d100(1);
|
||
|
if(nTownCrier <= 5)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 1);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_GnollAttack_Spawn"));
|
||
|
ActionSpeakString("Leistra is under attack.. to arms.. Gnolls from the sewers!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnoll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagnollleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 10)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 2);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_GiantAttack_Spawn"));
|
||
|
ActionSpeakString("Heija is under attack.. to arms.. Giants are marching on the city!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiant", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiant", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiant", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiant", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiant", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zagiantleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 15)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 3);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_TrollAttack_Spawn"));
|
||
|
ActionSpeakString("Amanbrakul is under attack.. to arms.. The trolls are rallying from the mines!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatroll", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zatrollleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 20)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 4);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_DrowAttack_Spawn"));
|
||
|
ActionSpeakString("Sallen is under attack.. to arms.. Dark Elves are attacking from the North!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrow", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zadrowleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 25)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 5);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_MinoAttack_Spawn"));
|
||
|
ActionSpeakString("A minotaur raiding party has landed near Leistra!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zamino", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zaminoleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 30)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 6);
|
||
|
location lspawn = GetLocation(GetWaypointByTag("ZA_RhutAttack_Spawn"));
|
||
|
ActionSpeakString("Rhutishan Orcs are attacking the Hur from Fehn!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhut", lspawn);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zarhutleader", lspawn);
|
||
|
}
|
||
|
else if(nTownCrier <= 35)
|
||
|
{
|
||
|
object oModule = GetModule();
|
||
|
SetLocalInt(oModule, "TownCrier", 7);
|
||
|
location lspawn1 = GetLocation(GetWaypointByTag("za_halflingleader_spawn"));
|
||
|
location lspawn2 = GetLocation(GetWaypointByTag("za_halfling_spawn1"));
|
||
|
location lspawn3 = GetLocation(GetWaypointByTag("za_halfling_spawn2"));
|
||
|
location lspawn4 = GetLocation(GetWaypointByTag("za_halfling_spawn3"));
|
||
|
location lspawn5 = GetLocation(GetWaypointByTag("za_halfling_spawn4"));
|
||
|
ActionSpeakString("Podor is leading a rebellion of halflings in Gehln. He has declared independence, and the King demands this will not stand!", TALKVOLUME_SHOUT);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingleader", lspawn1);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn5);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn5);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn2);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn2);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn3);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn3);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn4);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalflingarcher", lspawn4);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn5);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn5);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn2);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn2);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn3);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn3);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn4);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn4);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn5);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn2);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn3);
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "zahalfling", lspawn4);
|
||
|
}
|
||
|
|
||
|
else
|
||
|
{
|
||
|
ActionSpeakString("Hear Ye.. Hear Ye.. All is well.", TALKVOLUME_SHOUT);
|
||
|
DestroyObject(OBJECT_SELF);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|