Here's the script I'm currently using. The tag of the encounter trigger is almost the same as the tag of the ipoint, although with an 'e' in front of it ("day_encounter" verses "eday_encounter" for instance). You set a string variable on the ipoint called 'Time' to either 'day' or 'night'. That could easily be modified to include specific hours of the day if necessary.
include "ginc_group"
void SpawnEncounter(object oEncounter, string sTime)
{
SetLocalInt(OBJECT_SELF,"Active",1);
SetEncounterActive(TRUE,oEncounter);
TriggerEncounter(oEncounter,GetFirstPC(),ENCOUNTER_CALC_FROM_FACTION, -1.0);
ResetGroup("e"+sTime);
EncounterToGroup("e"+sTime,1);
DelayCommand(0.1, SetEncounterActive(FALSE,oEncounter));
}
void KillEncounter(string sTime)
{
SetLocalInt(OBJECT_SELF,"Active",0);
DestroyObjectsInGroup("e"+sTime,0.0);
ResetGroup("e"+sTime);
}
void main()
{
int iActive = GetLocalInt(OBJECT_SELF,"Active");
string sTime = GetLocalString(OBJECT_SELF,"Time");
if (GetArea(GetFirstPC()) != GetArea(OBJECT_SELF))
{
if (iActive == 0) return;
KillEncounter(sTime);
return;
}
string sTag = GetTag(OBJECT_SELF);
object oEncounter = GetObjectByTag("e"+sTag);
if (iActive == 0 && sTime == "day" && GetIsDay())
{
SpawnEncounter(oEncounter, sTime);
}
if (iActive == 0 && sTime == "night" && GetIsNight())
{
SpawnEncounter(oEncounter, sTime);
}
if (iActive == 1 && sTime == "day" && !GetIsDay())
{
KillEncounter(sTime);
}
if (iActive == 1 && sTime == "night" && !GetIsNight())
{
KillEncounter(sTime);
}
}