37 lines
1.0 KiB
Plaintext
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);
|
|
}
|