PoA_PRC8/_module/nss/spawnemporium.nss

77 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2022-10-07 14:20:31 -04:00
//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));
}