/* enc_nightonly Ensure, an encounter only appears during night hours (as defined in the module properties) Make sure, the encounter is INACTIVE by DEFAULT! */ void main() { object oEnc = OBJECT_SELF; if(GetIsDay()) { if (GetLocalInt(OBJECT_SELF, "TIMER") == FALSE) { SetLocalInt(OBJECT_SELF, "TIMER", TRUE); DelayCommand(1500.0, DeleteLocalInt(OBJECT_SELF, "TIMER")); SetEncounterActive(TRUE, oEnc); /* make sure, the encounter is inactive by default! */ DelayCommand(2.0f, SetEncounterActive(FALSE, oEnc)); } } }