void main()
{
    if (!(GetLocalInt(OBJECT_SELF, "nTriggered")))
    {
        if ((GetEncounterActive()) && (GetIsPC(GetEnteringObject())))
        {
            int nEncSpawned = GetLocalInt(GetModule(), "nBeetleEncountersSpawned");
            SetLocalInt(GetModule(), "nBeetleEncountersSpawned", nEncSpawned + 1);
            //DEBUG SendMessageToPC(GetFirstPC(), "Beetle Encounters spawned: " + IntToString(nEncSpawned + 1));
            SetLocalInt(OBJECT_SELF, "nTriggered", 1);
        }
    }
}
