mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
Core/Quest: implement Quest Tracker (#1233)
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "GitRevision.h"
|
||||
#include "revision.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Language.h"
|
||||
@@ -15662,6 +15664,20 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
|
||||
|
||||
SendQuestUpdate(quest_id);
|
||||
|
||||
// check if Quest Tracker is enabled
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_TRACK);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt32(1, GetGUIDLow());
|
||||
stmt->setString(2, _HASH);
|
||||
stmt->setString(3, _DATE);
|
||||
|
||||
// add to Quest Tracker
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
// Xinef: area auras may change on quest accept!
|
||||
UpdateZoneDependentAuras(GetZoneId());
|
||||
UpdateAreaDependentAuras(GetAreaId());
|
||||
@@ -15690,6 +15706,18 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||
UpdateAreaDependentAuras(GetAreaId());
|
||||
AdditionalSavingAddMask(ADDITIONAL_SAVING_INVENTORY_AND_GOLD | ADDITIONAL_SAVING_QUEST_STATUS);
|
||||
}
|
||||
|
||||
// check if Quest Tracker is enabled
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_COMPLETE_TIME);
|
||||
stmt->setUInt32(0, quest_id);
|
||||
stmt->setUInt32(1, GetGUIDLow());
|
||||
|
||||
// add to Quest Tracker
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::IncompleteQuest(uint32 quest_id)
|
||||
|
||||
@@ -426,6 +426,17 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
|
||||
#endif
|
||||
// check if Quest Tracker is enabled
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_ABANDON_TIME);
|
||||
stmt->setUInt32(0, questId);
|
||||
stmt->setUInt32(1, _player->GetGUIDLow());
|
||||
|
||||
// add to Quest Tracker
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
_player->SetQuestSlot(slot, 0);
|
||||
|
||||
@@ -1037,6 +1037,8 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetIntDefault("WorldBossLevelDiff", 3);
|
||||
|
||||
m_bool_configs[CONFIG_QUEST_ENABLE_QUEST_TRACKER] = sConfigMgr->GetBoolDefault("Quests.EnableQuestTracker", false);
|
||||
|
||||
// note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100)
|
||||
m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetIntDefault("Quests.LowLevelHideDiff", 4);
|
||||
if (m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL)
|
||||
|
||||
@@ -157,6 +157,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS, // pussywizard
|
||||
CONFIG_QUEST_IGNORE_AUTO_ACCEPT,
|
||||
CONFIG_QUEST_IGNORE_AUTO_COMPLETE,
|
||||
CONFIG_QUEST_ENABLE_QUEST_TRACKER,
|
||||
CONFIG_WARDEN_ENABLED,
|
||||
CONFIG_ENABLE_CONTINENT_TRANSPORT,
|
||||
CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING,
|
||||
|
||||
@@ -225,6 +225,18 @@ public:
|
||||
if (ReqOrRewMoney < 0)
|
||||
player->ModifyMoney(-ReqOrRewMoney);
|
||||
|
||||
// check if Quest Tracker is enabled
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER))
|
||||
{
|
||||
// prepare Quest Tracker datas
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
|
||||
stmt->setUInt32(0, quest->GetQuestId());
|
||||
stmt->setUInt32(1, player->GetGUIDLow());
|
||||
|
||||
// add to Quest Tracker
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
player->CompleteQuest(entry);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1230,6 +1230,14 @@ Instance.ResetTimeHour = 4
|
||||
|
||||
Instance.UnloadDelay = 1800000
|
||||
|
||||
#
|
||||
# Quests.EnableQuestTracker
|
||||
# Description: Store datas in the database about quest completion and abandonment to help finding out bugged quests.
|
||||
# Default: 0 - (Disabled)
|
||||
# 1 - (Enabled)
|
||||
|
||||
Quests.EnableQuestTracker = 0
|
||||
|
||||
#
|
||||
# Quests.LowLevelHideDiff
|
||||
# Description: Level difference between player and quest level at which quests are
|
||||
|
||||
Reference in New Issue
Block a user