mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Scripts/Commands: Add .debug questreset to force daily/weekly/monthly quest reset.
This commit is contained in:
@@ -775,6 +775,7 @@ enum RBACPermissions
|
||||
RBAC_PERM_COMMAND_LOOKUP_MAP_ID = 875,
|
||||
RBAC_PERM_COMMAND_LOOKUP_ITEM_ID = 876,
|
||||
RBAC_PERM_COMMAND_LOOKUP_QUEST_ID = 877,
|
||||
RBAC_PERM_COMMAND_DEBUG_QUESTRESET = 878,
|
||||
//
|
||||
// IF YOU ADD NEW PERMISSIONS, ADD THEM IN MASTER BRANCH AS WELL!
|
||||
//
|
||||
|
||||
@@ -880,6 +880,8 @@ class TC_GAME_API World
|
||||
bool _guidAlert;
|
||||
uint32 _warnDiff;
|
||||
time_t _warnShutdownTime;
|
||||
|
||||
friend class debug_commandscript;
|
||||
};
|
||||
|
||||
TC_GAME_API extern Realm realm;
|
||||
|
||||
@@ -28,6 +28,7 @@ EndScriptData */
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "GameTime.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
@@ -46,6 +47,7 @@ EndScriptData */
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
using namespace Trinity::ChatCommands;
|
||||
class debug_commandscript : public CommandScript
|
||||
{
|
||||
public:
|
||||
@@ -116,6 +118,7 @@ public:
|
||||
{ "dummy", rbac::RBAC_PERM_COMMAND_DEBUG_DUMMY, false, &HandleDebugDummyCommand, "" },
|
||||
{ "asan", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, nullptr, "", debugAsanCommandTable },
|
||||
{ "guidlimits", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugGuidLimitsCommand, "" },
|
||||
{ "questreset", rbac::RBAC_PERM_COMMAND_DEBUG_QUESTRESET, true, &HandleDebugQuestResetCommand, "" }
|
||||
};
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
@@ -1698,6 +1701,43 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugQuestResetCommand(ChatHandler* handler, std::string arg)
|
||||
{
|
||||
if (!Utf8ToUpperOnlyLatin(arg))
|
||||
return false;
|
||||
|
||||
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;
|
||||
|
||||
time_t const now = GameTime::GetGameTime();
|
||||
if (daily)
|
||||
{
|
||||
sWorld->m_NextDailyQuestReset = now;
|
||||
handler->SendSysMessage("Daily quest reset scheduled for next tick.");
|
||||
}
|
||||
if (weekly)
|
||||
{
|
||||
sWorld->m_NextWeeklyQuestReset = now;
|
||||
handler->SendSysMessage("Weekly quest reset scheduled for next tick.");
|
||||
}
|
||||
if (monthly)
|
||||
{
|
||||
sWorld->m_NextMonthlyQuestReset = now;
|
||||
handler->SendSysMessage("Monthly quest reset scheduled for next tick.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugNearGraveyard(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
Reference in New Issue
Block a user