HoS_PRC8/_mod/_module/nss/spawn_cleaners.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

37 lines
1.0 KiB
Plaintext

void main()
{
object oOb=GetObjectByTag("dwarfscav");
object oWP;
object oMod=GetModule();
int nCAI=GetLocalInt(oMod,"nAISetting");
int nSC=GetLocalInt(oMod,"nCleanerSpawnCount");
int nFreq=240;
if (nCAI==1) nFreq=30;
nSC++;
if (nSC>nFreq)
{ // do spawn
nSC=0;
if (oOb==OBJECT_INVALID)
{
oWP=GetWaypointByTag("POST_dwarfscav");
oOb=CreateObject(OBJECT_TYPE_CREATURE,"dwarfscav",GetLocation(oWP));
SetAILevel(oOb,AI_LEVEL_NORMAL);
}
oOb=GetObjectByTag("sewerclean");
if (oOb==OBJECT_INVALID)
{
oWP=GetWaypointByTag("POST_sewerclean");
oOb=CreateObject(OBJECT_TYPE_CREATURE,"sewerclean",GetLocation(oWP));
SetAILevel(oOb,AI_LEVEL_NORMAL);
}
oOb=GetObjectByTag("toweragent");
if (oOb==OBJECT_INVALID)
{
oWP=GetWaypointByTag("POST_toweragent");
oOb=CreateObject(OBJECT_TYPE_CREATURE,"toweragent",GetLocation(oWP));
SetAILevel(oOb,AI_LEVEL_NORMAL);
}
} // do spawn
SetLocalInt(oMod,"nCleanerSpawnCount",nSC);
}