Core/Instances: Add new config options to control the time when both daily and weekly resets occur (will not be restricted to instances only)
Port From (https://github.com/TrinityCore/TrinityCore/commit/cedf09f93c44be2abf1c2b40e0e4c51f95f2975c)
This commit is contained in:
@@ -1730,6 +1730,8 @@ namespace Framework.Constants
|
||||
RegenHpCannotReachTargetInRaid,
|
||||
ResetDuelCooldowns,
|
||||
ResetDuelHealthMana,
|
||||
ResetScheduleWeekDay,
|
||||
ResetScheduleHour,
|
||||
RespawnDynamicEscortNpc,
|
||||
RespawnDynamicMinimumCreature,
|
||||
RespawnDynamicMinimumGameObject,
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace Game.Maps
|
||||
public DateTime GetNextResetTime(MapDb2Entries entries)
|
||||
{
|
||||
DateTime dateTime = GameTime.GetDateAndTime();
|
||||
int resetHour = ConfigMgr.GetDefaultValue("ResetSchedule.DailyHour", 9);
|
||||
int resetHour = WorldConfig.GetIntValue(WorldCfg.ResetScheduleHour);
|
||||
|
||||
int hour = 0;
|
||||
int day = 0;
|
||||
@@ -363,7 +363,7 @@ namespace Game.Maps
|
||||
}
|
||||
case MapDifficultyResetInterval.Weekly:
|
||||
{
|
||||
int resetDay = ConfigMgr.GetDefaultValue("ResetSchedule.WeeklyDay", 2);
|
||||
int resetDay = WorldConfig.GetIntValue(WorldCfg.ResetScheduleWeekDay);
|
||||
int daysAdjust = resetDay - dateTime.Day;
|
||||
if (dateTime.Day > resetDay || (dateTime.Day == resetDay && dateTime.Hour >= resetHour))
|
||||
daysAdjust += 7; // passed it for current week, grab time from next week
|
||||
|
||||
@@ -541,7 +541,8 @@ namespace Game
|
||||
Values[WorldCfg.InstanceIgnoreRaid] = GetDefaultValue("Instance.IgnoreRaid", false);
|
||||
|
||||
Values[WorldCfg.CastUnstuck] = GetDefaultValue("CastUnstuck", true);
|
||||
Values[WorldCfg.InstanceResetTimeHour] = GetDefaultValue("Instance.ResetTimeHour", 4);
|
||||
Values[WorldCfg.ResetScheduleWeekDay] = GetDefaultValue("ResetSchedule.WeekDay", 2);
|
||||
Values[WorldCfg.ResetScheduleHour] = GetDefaultValue("ResetSchedule.Hour", 8);
|
||||
Values[WorldCfg.InstanceUnloadDelay] = GetDefaultValue("Instance.UnloadDelay", 30 * Time.Minute * Time.InMilliseconds);
|
||||
Values[WorldCfg.DailyQuestResetTimeHour] = GetDefaultValue("Quests.DailyResetTime", 3);
|
||||
if ((int)Values[WorldCfg.DailyQuestResetTimeHour] > 23)
|
||||
|
||||
@@ -970,14 +970,6 @@ Instance.IgnoreLevel = 0
|
||||
|
||||
Instance.IgnoreRaid = 0
|
||||
|
||||
#
|
||||
# Instance.ResetTimeHour
|
||||
# Description: Hour of the day when the global instance reset occurs.
|
||||
# Range: 0-23
|
||||
# Default: 4 - (04:00 AM)
|
||||
|
||||
Instance.ResetTimeHour = 4
|
||||
|
||||
#
|
||||
# Instance.UnloadDelay
|
||||
# Description: Time (in milliseconds) before instance maps are unloaded from memory if no
|
||||
@@ -996,6 +988,22 @@ Instance.UnloadDelay = 1800000
|
||||
|
||||
InstancesResetAnnounce = false
|
||||
|
||||
#
|
||||
# ResetSchedule.WeekDay
|
||||
# Description: Day of the week when the global weekly reset occurs.
|
||||
# Range: 0-6
|
||||
# Default: 2 - (Tuesday)
|
||||
|
||||
ResetSchedule.WeekDay = 2
|
||||
|
||||
#
|
||||
# ResetSchedule.Hour
|
||||
# Description: Hour of the day when the global daily reset occurs.
|
||||
# Range: 0-23
|
||||
# Default: 8 - (08:00 AM)
|
||||
|
||||
ResetSchedule.Hour = 8
|
||||
|
||||
#
|
||||
# Quests.EnableQuestTracker
|
||||
# Description: Store data in the database about quest completion and abandonment to help finding bugged quests.
|
||||
|
||||
Reference in New Issue
Block a user