PoA_PRC8/_module/nss/spawnemporium.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

77 lines
1.8 KiB
Plaintext

//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_magicitemmerch_01");
if (!GetIsObjectValid(GetNearestObjectByTag("magicitemmerch", oObject)))
{
oTarget = GetWaypointByTag("WP_magicitemmerch_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "magicitemmerch", lTarget);
}
oObject = GetWaypointByTag("WP_weaponmerchant_01");
if (!GetIsObjectValid(GetNearestObjectByTag("weaponmerchant", oObject)))
{
oTarget = GetWaypointByTag("WP_weaponmerchant_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "weaponmerchant", lTarget);
}
oObject = GetWaypointByTag("WP_npcarmorer_01");
if (!GetIsObjectValid(GetNearestObjectByTag("npcarmorer", oObject)))
{
oTarget = GetWaypointByTag("WP_npcarmorer_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "npcarmorer", lTarget);
}
oObject = GetWaypointByTag("WP_bowermerchant_01");
if (!GetIsObjectValid(GetNearestObjectByTag("bowermerchant", oObject)))
{
oTarget = GetWaypointByTag("WP_bowermerchant_01");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bowermerchant", lTarget);
}
oTarget = GetObjectByTag("magicitemmerch");
DelayCommand(901.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("weaponmerchant");
DelayCommand(902.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("npcarmorer");
DelayCommand(903.0, DestroyObject(oTarget, 0.0));
oTarget = GetObjectByTag("bowermerchant");
DelayCommand(904.0, DestroyObject(oTarget, 0.0));
}