diff --git a/common/ruletypes.h b/common/ruletypes.h index 2e8529d70..da2078434 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -269,6 +269,7 @@ RULE_BOOL(Zone, EnableZoneControllerGlobals, false, "Enables the ability to use RULE_INT(Zone, GlobalLootMultiplier, 1, "Sets Global Loot drop multiplier for database based drops, useful for double, triple loot etc") RULE_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS") RULE_INT(Zone, SecondsBeforeIdle, 60, "Seconds before IDLE_WHEN_EMPTY define kicks in") +RULE_INT(Zone, SpawnEventMin, 3, "When strict is set in spawn_events, specifies the max EQ minutes into the trigger hour a spawn_event will fire. Going below 3 may cause the spawn_event to not fire.") RULE_CATEGORY_END() RULE_CATEGORY(Map) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index b6689d715..f15ff12c3 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -832,8 +832,11 @@ void SpawnConditionManager::Process() { if(EQTime::IsTimeBefore(&tod, &cevent.next)) { //this event has been triggered. //execute the event - if(!cevent.strict || (cevent.strict && cevent.next.hour == tod.hour && cevent.next.day == tod.day && cevent.next.month == tod.month && cevent.next.year == tod.year)) + uint8 min = cevent.next.minute + RuleI(Zone, SpawnEventMin); + if(!cevent.strict || (cevent.strict && tod.minute < min && cevent.next.hour == tod.hour && cevent.next.day == tod.day && cevent.next.month == tod.month && cevent.next.year == tod.year)) ExecEvent(cevent, true); + else + LogSpawns("Event {}: Is strict, ExecEvent is skipped.", cevent.id); //add the period of the event to the trigger time EQTime::AddMinutes(cevent.period, &cevent.next); @@ -858,6 +861,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { + //If we're here, strict has already been checked. Check again in case hour has changed. LogSpawns("Event [{}]: Unable to find condition [{}] to execute on", event.id, event.condition_id); return; //unable to find the spawn condition to operate on }