Changed folder name.
Changed folder name.
This commit is contained in:
78
_module/nss/spawnmultiplenpc.nss
Normal file
78
_module/nss/spawnmultiplenpc.nss
Normal file
@@ -0,0 +1,78 @@
|
||||
//Created by Guile 3/12/07
|
||||
//Multiple NPC spawn trigger script, this one checks each creature.
|
||||
|
||||
location lTarget;
|
||||
object oSpawn;
|
||||
object oTarget;
|
||||
object oObject;
|
||||
|
||||
|
||||
//Put this script OnEnter
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
oObject = GetWaypointByTag("WP_tagname_01");
|
||||
|
||||
if (!GetIsObjectValid(GetNearestObjectByTag("tagname1", oObject)))
|
||||
{
|
||||
oTarget = GetWaypointByTag("WP_tagname_01");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "resrefname", lTarget);
|
||||
|
||||
}
|
||||
oObject = GetWaypointByTag("WP_tagname2_01");
|
||||
if (!GetIsObjectValid(GetNearestObjectByTag("tagname2", oObject)))
|
||||
{
|
||||
oTarget = GetWaypointByTag("WP_tagname_01");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "resrefname", lTarget);
|
||||
|
||||
}
|
||||
oObject = GetWaypointByTag("WP_tagname3_01");
|
||||
if (!GetIsObjectValid(GetNearestObjectByTag("tagname3", oObject)))
|
||||
{
|
||||
oTarget = GetWaypointByTag("WP_tagname_01");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "resrefname", lTarget);
|
||||
|
||||
}
|
||||
oObject = GetWaypointByTag("WP_tagname4_01");
|
||||
if (!GetIsObjectValid(GetNearestObjectByTag("tagname4", oObject)))
|
||||
{
|
||||
oTarget = GetWaypointByTag("WP_tagname_01");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "rerefname", lTarget);
|
||||
|
||||
}
|
||||
|
||||
|
||||
oTarget = GetObjectByTag("tagnameofnpc");
|
||||
|
||||
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
|
||||
|
||||
oTarget = GetObjectByTag("tagnameofnpc2");
|
||||
|
||||
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
|
||||
|
||||
oTarget = GetObjectByTag("tagnameofnpc3");
|
||||
|
||||
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
|
||||
|
||||
oTarget = GetObjectByTag("tagnameofnpc4");
|
||||
|
||||
DelayCommand(500.0, DestroyObject(oTarget, 0.0));
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user