LoD_PRC8/_module/nss/pentavus_trigger.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

36 lines
1.3 KiB
Plaintext

void main()
{
object oPC = GetEnteringObject(), oPentaCopy1, oPentaCopy2, oMod;
location lSpawn1=GetLocation(GetObjectByTag("FloorSpawn1"))
, lSpawn2=GetLocation(GetObjectByTag("FloorSpawn2"))
, lSpawn3=GetLocation(GetObjectByTag("FloorSpawn3"));
int iSpawn;
if(GetIsPC(oPC))
{
iSpawn = 1 + Random(3);
switch (iSpawn)
{
case 1: CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn1,TRUE);
oPentaCopy1 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn2,TRUE);
oPentaCopy2 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn3,TRUE);
break;
case 2: CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn2,TRUE);
oPentaCopy1 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn1,TRUE);
oPentaCopy2 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn3,TRUE);
break;
case 3: CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn3,TRUE);
oPentaCopy1 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn2,TRUE);
oPentaCopy2 = CreateObject(OBJECT_TYPE_CREATURE,"pentavus",lSpawn1,TRUE);
break;
default: break;
}
SetImmortal(oPentaCopy1,TRUE);
SetImmortal(oPentaCopy2,TRUE);
oMod = GetModule();
SetLocalObject(oMod,"pentacopy1",oPentaCopy1);
SetLocalObject(oMod,"pentacopy2",oPentaCopy2);
DestroyObject(OBJECT_SELF);
}
}