Core/WorldStates: Move custom worldstates to separate table and move saving worldstate values to WorldStateMgr

Port From (https://github.com/TrinityCore/TrinityCore/commit/e487d78ba7b37c35ede36c554169d26afeac88b0)
This commit is contained in:
hondacrx
2022-07-14 20:25:57 -04:00
parent 5648dc959d
commit e521433e38
9 changed files with 231 additions and 221 deletions
+6 -6
View File
@@ -799,18 +799,18 @@ namespace Game.Chat
long now = GameTime.GetGameTime();
if (daily)
{
Global.WorldMgr.SetNextDailyQuestsResetTime(now);
handler.SendSysMessage("Daily quest reset scheduled for next tick.");
Global.WorldMgr.DailyReset();
handler.SendSysMessage($"Daily quests have been reset. Next scheduled reset: {Time.UnixTimeToDateTime(Global.WorldMgr.GetPersistentWorldVariable(WorldManager.NextDailyQuestResetTimeVarId)).ToShortTimeString()}");
}
if (weekly)
{
Global.WorldMgr.SetNextWeeklyQuestsResetTime(now);
handler.SendSysMessage("Weekly quest reset scheduled for next tick.");
Global.WorldMgr.ResetWeeklyQuests();
handler.SendSysMessage($"Weekly quests have been reset. Next scheduled reset: {Time.UnixTimeToDateTime(Global.WorldMgr.GetPersistentWorldVariable(WorldManager.NextWeeklyQuestResetTimeVarId)).ToShortTimeString()}");
}
if (monthly)
{
Global.WorldMgr.SetNextMonthlyQuestsResetTime(now);
handler.SendSysMessage("Monthly quest reset scheduled for next tick.");
Global.WorldMgr.ResetMonthlyQuests();
handler.SendSysMessage($"Monthly quests have been reset. Next scheduled reset: {Time.UnixTimeToDateTime(Global.WorldMgr.GetPersistentWorldVariable(WorldManager.NextMonthlyQuestResetTimeVarId)).ToShortTimeString()}");
}
return true;