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

44 lines
1.6 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// special cleaners
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oMod=GetModule();
object oOb;
object oWP;
string sTower="toweragent";
string sMurin="dwarfscav";
string sSewer="sewerclean";
int nC=GetLocalInt(oMod,"nSpecClean");
nC++;
if (nC>47)
{ // fire every 48 hours
nC=0;
oOb=GetLocalObject(oMod,"oTowerCleaner");
if (oOb==OBJECT_INVALID||GetIsDead(oOb)==TRUE)
{ // spawn an agent of the tower
oWP=GetWaypointByTag("SPAWN_"+sTower);
oOb=CreateObject(OBJECT_TYPE_CREATURE,sTower,GetLocation(oWP));
SetLocalObject(oMod,"oTowerCleaner",oOb);
SetAILevel(oOb,AI_LEVEL_NORMAL);
} // spawn an agent of the tower
oOb=GetLocalObject(oMod,"oMurinsCleaner");
if (oOb==OBJECT_INVALID||GetIsDead(oOb)==TRUE)
{ // spawn murin's cleaner
oWP=GetWaypointByTag("SPAWN_"+sMurin);
oOb=CreateObject(OBJECT_TYPE_CREATURE,sMurin,GetLocation(oWP));
SetLocalObject(oMod,"oMurinsCleaner",oOb);
SetAILevel(oOb,AI_LEVEL_NORMAL);
} // spawn murin's cleaner
oOb=GetLocalObject(oMod,"oSewerCleaner");
if (oOb==OBJECT_INVALID||GetIsDead(oOb)==TRUE)
{ // spawn sewer cleaner
oWP=GetWaypointByTag("SPAWN_"+sSewer);
oOb=CreateObject(OBJECT_TYPE_CREATURE,sSewer,GetLocation(oWP));
SetLocalObject(oMod,"oSewerCleaner",oOb);
SetAILevel(oOb,AI_LEVEL_NORMAL);
} // spawn sewer cleaner
} // fire every 48 hours
SetLocalInt(oMod,"nSpecClean",nC);
}