85 lines
2.4 KiB
Plaintext
85 lines
2.4 KiB
Plaintext
//Script Name: spawn_tailors
|
|
//////////////////////////////////////////
|
|
//Created By: Genisys (Guile)
|
|
//Created On: 8/29/10
|
|
/////////////////////////////////////////
|
|
/*
|
|
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("TailoringModel", "tailoringmode001", 600.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("TailoringModel2", "tailoringmodel01", 600.0);
|
|
SpawnNPC("bodymodel", "btlr_female", 600.0);
|
|
SpawnNPC("bodymodel2", "btlr_male", 600.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
|
|
}
|
|
|