Changed folder name.
Changed folder name.
This commit is contained in:
84
_module/nss/spawn1stguard.nss
Normal file
84
_module/nss/spawn1stguard.nss
Normal file
@@ -0,0 +1,84 @@
|
||||
//Script Name:
|
||||
//////////////////////////////////////////
|
||||
//Created By: Genisys (Guile)
|
||||
//Created On: 8/13/08
|
||||
/////////////////////////////////////////
|
||||
/*
|
||||
This script goes in the OnEnter Event
|
||||
for an Area or a Tracks Trigger.
|
||||
(Preferrably an Area's OnEnter Event)
|
||||
(The PC will not notice the NPC's being spawned in)
|
||||
|
||||
This script will spawn in an NPC
|
||||
at the proper way point and destroy it
|
||||
after an amount of time set by you.
|
||||
|
||||
You MUST create the first walk waypoint for the NPC
|
||||
(put the npc in the module right click on it)
|
||||
(select create way point, then delete the NPC)
|
||||
If you wish for the NPC to walk around create more
|
||||
walk waypoint by moving the NPC and creating more way points
|
||||
as instructed above.
|
||||
*/
|
||||
////////////////////////////////////////
|
||||
|
||||
//PROTOTYPE DECLARED
|
||||
void SpawnNPC(string sTag, string sResref, float fSeconds);
|
||||
|
||||
|
||||
//Main Script
|
||||
void main()
|
||||
{
|
||||
//Define the PC
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
//Stop here if it's not a PC entering!
|
||||
if(!GetIsPC(oPC)) {return;}
|
||||
|
||||
//Enter the tagname and resref name of the NPC below
|
||||
//600.0 = How many seconds before the NPC is destroyed
|
||||
//Default = 10 Minutes (600.0 seconds)
|
||||
SpawnNPC("TownWatch1", "townwatch004", 900.0);
|
||||
|
||||
//If you wish to spawn multiple NPCs simply delete the // before SpawnNPC
|
||||
//For each additional NPC you wish to spawn in.(follow instructions above)
|
||||
|
||||
SpawnNPC("travel", "travelingmerchan", 901.0);
|
||||
SpawnNPC("Madman", "madman", 902.0);
|
||||
SpawnNPC("TownWatch4", "townwatch005", 903.0);
|
||||
//SpawnNPC("tagname", "resrefname", 600.0);
|
||||
//SpawnNPC("tagname", "resrefname", 600.0);
|
||||
|
||||
//NOTE: This options is NOT for spawning in multiple NPCs with the same tagname!
|
||||
//I recommend that you create copies of the NPCs and spawn them in seperately.
|
||||
//(each copied NPC needs thier own tagname / resref name & walk waypoints!)
|
||||
|
||||
|
||||
//Enter any additional code here if your merging this script..
|
||||
|
||||
|
||||
//Main Script End
|
||||
}
|
||||
|
||||
/////////////////////DO NOT TOUCH ANYTHING BELOW!/////////////////////
|
||||
|
||||
//PROTOTYPE DEFINED
|
||||
|
||||
void SpawnNPC(string sTag, string sResref, float fSeconds)
|
||||
{
|
||||
object oTarget;
|
||||
|
||||
object oObject = GetWaypointByTag("WP_"+sTag+"_01");
|
||||
|
||||
if (!GetIsObjectValid(GetNearestObjectByTag(sTag, oObject)))
|
||||
{
|
||||
CreateObject(OBJECT_TYPE_CREATURE, sResref, GetLocation(oObject));
|
||||
}
|
||||
|
||||
oTarget = GetObjectByTag(sTag);
|
||||
|
||||
DelayCommand(fSeconds, DestroyObject(oTarget, 0.0));
|
||||
|
||||
//PROTOTYPE END
|
||||
}
|
||||
|
Reference in New Issue
Block a user