From 62e4f1a7c5fcef347770aef93a0b107adbae9b1b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 20 Jan 2022 12:39:18 -0500 Subject: [PATCH] Scripts/Commands: Add .debug questreset to force daily/weekly/monthly quest reset. Port From (https://github.com/TrinityCore/TrinityCore/commit/6f6cf975e4e0bef621b9465f364476ec6731ae0d) --- Source/Game/Chat/Commands/DebugCommands.cs | 35 ++++++++++++++++++++++ Source/Game/Server/WorldManager.cs | 5 ++++ 2 files changed, 40 insertions(+) diff --git a/Source/Game/Chat/Commands/DebugCommands.cs b/Source/Game/Chat/Commands/DebugCommands.cs index 909ce15ac..212342bed 100644 --- a/Source/Game/Chat/Commands/DebugCommands.cs +++ b/Source/Game/Chat/Commands/DebugCommands.cs @@ -774,6 +774,41 @@ namespace Game.Chat return true; } + [Command("questreset", RBACPermissions.CommandDebugQuestreset)] + static bool HandleDebugQuestResetCommand(CommandHandler handler, string arg) + { + bool daily = false, weekly = false, monthly = false; + if (arg == "ALL") + daily = weekly = monthly = true; + else if (arg == "DAILY") + daily = true; + else if (arg == "WEEKLY") + weekly = true; + else if (arg == "MONTHLY") + monthly = true; + else + return false; + + long now = GameTime.GetGameTime(); + if (daily) + { + Global.WorldMgr.SetNextDailyQuestsResetTime(now); + handler.SendSysMessage("Daily quest reset scheduled for next tick."); + } + if (weekly) + { + Global.WorldMgr.SetNextWeeklyQuestsResetTime(now); + handler.SendSysMessage("Weekly quest reset scheduled for next tick."); + } + if (monthly) + { + Global.WorldMgr.SetNextMonthlyQuestsResetTime(now); + handler.SendSysMessage("Monthly quest reset scheduled for next tick."); + } + + return true; + } + [Command("raidreset", RBACPermissions.CommandInstanceUnbind)] static bool HandleDebugRaidResetCommand(CommandHandler handler, StringArguments args) { diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index 521e767d2..d6d34ae39 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -2405,7 +2405,12 @@ namespace Game public void SetDataPath(string path) { _dataPath = path; } public long GetNextDailyQuestsResetTime() { return m_NextDailyQuestReset; } + public void SetNextDailyQuestsResetTime(long time) { m_NextDailyQuestReset = time; } public long GetNextWeeklyQuestsResetTime() { return m_NextWeeklyQuestReset; } + public void SetNextWeeklyQuestsResetTime(long time) { m_NextWeeklyQuestReset = time; } + public long GetNextMonthlyQuestsResetTime() { return m_NextMonthlyQuestReset; } + public void SetNextMonthlyQuestsResetTime(long time) { m_NextMonthlyQuestReset = time; } + long GetNextRandomBGResetTime() { return m_NextRandomBGReset; } public uint GetConfigMaxSkillValue()