diff options
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 80 | ||||
-rw-r--r-- | src/server/game/Handlers/QuestHandler.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.h | 125 | ||||
-rw-r--r-- | src/server/game/World/World.cpp | 26 |
4 files changed, 164 insertions, 73 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 13e09c9051a..61734358212 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7100,6 +7100,8 @@ void Player::ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSour return false; }(); + bool ignoreCaps = isGainOnRefund || gainSource == CurrencyGainSource::QuestRewardIgnoreCaps || gainSource == CurrencyGainSource::WorldQuestRewardIgnoreCaps; + if (amount > 0 && !isGainOnRefund && gainSource != CurrencyGainSource::Vendor) { amount *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_CURRENCY_GAIN, id); @@ -7138,16 +7140,18 @@ void Player::ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSour itr->second.Flags = CurrencyDbFlags(0); } - // Weekly cap uint32 weeklyCap = GetCurrencyWeeklyCap(currency); - if (weeklyCap && amount > 0 && (itr->second.WeeklyQuantity + amount) > weeklyCap) - if (!isGainOnRefund) // Ignore weekly cap for refund + if (!ignoreCaps) // Ignore weekly cap for refund + { + // Weekly cap + if (weeklyCap && amount > 0 && (itr->second.WeeklyQuantity + amount) > weeklyCap) amount = weeklyCap - itr->second.WeeklyQuantity; - // Max cap - uint32 maxCap = GetCurrencyMaxQuantity(currency, false, gainSource == CurrencyGainSource::UpdatingVersion); - if (maxCap && amount > 0 && (itr->second.Quantity + amount) > maxCap) - amount = maxCap - itr->second.Quantity; + // Max cap + uint32 maxCap = GetCurrencyMaxQuantity(currency, false, gainSource == CurrencyGainSource::UpdatingVersion); + if (maxCap && amount > 0 && (itr->second.Quantity + amount) > maxCap) + amount = maxCap - itr->second.Quantity; + } // Underflow protection if (amount < 0 && uint32(std::abs(amount)) > itr->second.Quantity) @@ -7161,7 +7165,7 @@ void Player::ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSour itr->second.Quantity += amount; - if (amount > 0 && !isGainOnRefund) // Ignore total values update for refund + if (amount > 0 && !ignoreCaps) // Ignore total values update for refund { if (weeklyCap) itr->second.WeeklyQuantity += amount; @@ -7172,7 +7176,8 @@ void Player::ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSour if (currency->HasTotalEarned()) itr->second.EarnedQuantity += amount; - UpdateCriteria(CriteriaType::CurrencyGained, id, amount); + if (!isGainOnRefund) + UpdateCriteria(CriteriaType::CurrencyGained, id, amount); } CurrencyChanged(id, amount); @@ -15086,7 +15091,7 @@ void Player::RewardQuest(Quest const* quest, LootItemType rewardType, uint32 rew } } - if (!quest->HasFlagEx(QUEST_FLAGS_EX_KEEP_ADDITIONAL_ITEMS)) + if (!quest->HasFlagEx(QUEST_FLAGS_EX_NO_ITEM_REMOVAL)) { for (uint8 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i) { @@ -15122,6 +15127,14 @@ void Player::RewardQuest(Quest const* quest, LootItemType rewardType, uint32 rew CurrencyGainSource currencyGainSource = [&]() -> CurrencyGainSource { + if (quest->HasFlagEx(QUEST_FLAGS_EX_REWARDS_IGNORE_CAPS)) + { + if (quest->IsWorldQuest()) + return CurrencyGainSource::WorldQuestRewardIgnoreCaps; + + return CurrencyGainSource::QuestRewardIgnoreCaps; + } + CurrencyGainSource gainSource = CurrencyGainSource::QuestReward; if (quest->IsDaily()) @@ -16160,7 +16173,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object const* questgiver) const case QUEST_STATUS_COMPLETE: if (quest->GetQuestTag() == QuestTagType::CovenantCalling) result |= quest->HasFlag(QUEST_FLAGS_HIDE_REWARD_POI) ? QuestGiverStatus::CovenantCallingRewardCompleteNoPOI : QuestGiverStatus::CovenantCallingRewardCompletePOI; - else if (quest->HasFlagEx(QUEST_FLAGS_EX_LEGENDARY_QUEST)) + else if (quest->HasFlagEx(QUEST_FLAGS_EX_LEGENDARY)) result |= quest->HasFlag(QUEST_FLAGS_HIDE_REWARD_POI) ? QuestGiverStatus::LegendaryRewardCompleteNoPOI : QuestGiverStatus::LegendaryRewardCompletePOI; else result |= quest->HasFlag(QUEST_FLAGS_HIDE_REWARD_POI) ? QuestGiverStatus::RewardCompleteNoPOI : QuestGiverStatus::RewardCompletePOI; @@ -16203,7 +16216,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object const* questgiver) const { if (quest->GetQuestTag() == QuestTagType::CovenantCalling) result |= QuestGiverStatus::CovenantCallingQuest; - else if (quest->HasFlagEx(QUEST_FLAGS_EX_LEGENDARY_QUEST)) + else if (quest->HasFlagEx(QUEST_FLAGS_EX_LEGENDARY)) result |= QuestGiverStatus::LegendaryQuest; else if (quest->IsDaily()) result |= QuestGiverStatus::DailyQuest; @@ -16565,6 +16578,10 @@ void Player::UpdateQuestObjectiveProgress(QuestObjectiveType objectiveType, int3 if (!IsQuestObjectiveCompletable(logSlot, quest, objective)) continue; + if (quest->HasFlagEx(QUEST_FLAGS_EX_NO_CREDIT_FOR_PROXY)) + if (objective.Type == QUEST_OBJECTIVE_MONSTER && victimGuid.IsEmpty()) + continue; + bool objectiveWasComplete = IsQuestObjectiveComplete(logSlot, quest, objective); if (!objectiveWasComplete || addCount < 0) { @@ -19061,6 +19078,9 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) else if (questStatusData.Status == QUEST_STATUS_FAILED) SetQuestSlotState(slot, QUEST_STATE_FAIL); + if (quest->HasFlagEx(QUEST_FLAGS_EX_RECAST_ACCEPT_SPELL_ON_LOGIN) && quest->HasFlag(QUEST_FLAGS_PLAYER_CAST_ACCEPT) && quest->GetSrcSpell() > 0) + CastSpell(this, quest->GetSrcSpell(), TRIGGERED_FULL_MASK); + ++slot; } @@ -24422,6 +24442,24 @@ void Player::DailyReset() m_DFQuests.clear(); // Dungeon Finder Quests. + for (uint16 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot) + { + uint32 questId = GetQuestSlotQuestId(slot); + if (!questId) + continue; + + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest || !quest->IsDaily() || !quest->HasFlagEx(QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET)) + continue; + + SetQuestSlot(slot, 0); + AbandonQuest(questId); + RemoveActiveQuest(questId); + + if (quest->GetLimitTime()) + RemoveTimedQuest(questId); + } + // DB data deleted in caller m_DailyQuestChanged = false; m_lastDailyQuestTime = 0; @@ -24439,6 +24477,24 @@ void Player::ResetWeeklyQuestStatus() if (uint32 questBit = sDB2Manager.GetQuestUniqueBitFlag(questId)) SetQuestCompletedBit(questBit, false); + for (uint16 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot) + { + uint32 questId = GetQuestSlotQuestId(slot); + if (!questId) + continue; + + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest || !quest->IsWeekly() || !quest->HasFlagEx(QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET)) + continue; + + SetQuestSlot(slot, 0); + AbandonQuest(questId); + RemoveActiveQuest(questId); + + if (quest->GetLimitTime()) + RemoveTimedQuest(questId); + } + m_weeklyquests.clear(); // DB data deleted in caller m_WeeklyQuestChanged = false; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 9010a3d629e..1e376a55d90 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -445,6 +445,11 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemove if (quest) { + if (quest->HasFlagEx(QUEST_FLAGS_EX_NO_ABANDON_ONCE_BEGUN)) + for (QuestObjective const& objective : quest->Objectives) + if (_player->IsQuestObjectiveComplete(packet.Entry, quest, objective)) + return; + if (quest->GetLimitTime()) _player->RemoveTimedQuest(questId); @@ -453,7 +458,6 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPackets::Quest::QuestLogRemove _player->pvpInfo.IsHostile = _player->pvpInfo.IsInHostileArea || _player->HasPvPForcingQuest(); _player->UpdatePvPState(); } - } _player->SetQuestSlot(packet.Entry, 0); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index d16e8b1ad09..036655de6a6 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -199,76 +199,81 @@ enum QuestFlags : uint32 QUEST_FLAGS_DISPLAY_ITEM_IN_TRACKER = 0x00020000, // Displays usable item in quest tracker QUEST_FLAGS_DISABLE_COMPLETION_TEXT = 0x00040000, // use Objective text as Complete text QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. - QUEST_FLAGS_PLAYER_CAST_ACCEPT = 0x00100000, - QUEST_FLAGS_PLAYER_CAST_COMPLETE = 0x00200000, - QUEST_FLAGS_UPDATE_PHASESHIFT = 0x00400000, - QUEST_FLAGS_SOR_WHITELIST = 0x00800000, - QUEST_FLAGS_LAUNCH_GOSSIP_COMPLETE = 0x01000000, + QUEST_FLAGS_PLAYER_CAST_ACCEPT = 0x00100000, // Accept Spell Player Cast + QUEST_FLAGS_PLAYER_CAST_COMPLETE = 0x00200000, // Complete Spell Player Cast + QUEST_FLAGS_UPDATE_PHASESHIFT = 0x00400000, // Update Phase Shift + QUEST_FLAGS_SOR_WHITELIST = 0x00800000, // Scroll of Resurrection Whitelist + QUEST_FLAGS_LAUNCH_GOSSIP_COMPLETE = 0x01000000, // Gossip on Quest Completion - Force Gossip QUEST_FLAGS_REMOVE_SURPLUS_ITEMS = 0x02000000, // Remove all items from inventory that have the same id as the objective, not just the amount required by quest - QUEST_FLAGS_WELL_KNOWN = 0x04000000, - QUEST_FLAGS_PORTRAIT_IN_QUEST_LOG = 0x08000000, - QUEST_FLAGS_SHOW_ITEM_WHEN_COMPLETED = 0x10000000, - QUEST_FLAGS_LAUNCH_GOSSIP_ACCEPT = 0x20000000, - QUEST_FLAGS_ITEMS_GLOW_WHEN_COMPLETE = 0x40000000, - QUEST_FLAGS_FAIL_ON_LOGOUT = 0x80000000 + QUEST_FLAGS_WELL_KNOWN = 0x04000000, // Well-Known + QUEST_FLAGS_PORTRAIT_IN_QUEST_LOG = 0x08000000, // Portrait from Log + QUEST_FLAGS_SHOW_ITEM_WHEN_COMPLETED = 0x10000000, // Show Item When Completed + QUEST_FLAGS_LAUNCH_GOSSIP_ACCEPT = 0x20000000, // Gossip on Quest Accept - Force Gossip + QUEST_FLAGS_ITEMS_GLOW_WHEN_COMPLETE = 0x40000000, // Items Glow When Done + QUEST_FLAGS_FAIL_ON_LOGOUT = 0x80000000 // Fail on Logout }; // last checked in 19802 enum QuestFlagsEx : uint32 { - QUEST_FLAGS_EX_NONE = 0x00000000, - QUEST_FLAGS_EX_KEEP_ADDITIONAL_ITEMS = 0x00000001, - QUEST_FLAGS_EX_SUPPRESS_GOSSIP_COMPLETE = 0x00000002, - QUEST_FLAGS_EX_SUPPRESS_GOSSIP_ACCEPT = 0x00000004, - QUEST_FLAGS_EX_DISALLOW_PLAYER_AS_QUESTGIVER = 0x00000008, - QUEST_FLAGS_EX_DISPLAY_CLASS_CHOICE_REWARDS = 0x00000010, - QUEST_FLAGS_EX_DISPLAY_SPEC_CHOICE_REWARDS = 0x00000020, - QUEST_FLAGS_EX_REMOVE_FROM_LOG_ON_PERIDOIC_RESET = 0x00000040, - QUEST_FLAGS_EX_ACCOUNT_LEVEL_QUEST = 0x00000080, - QUEST_FLAGS_EX_LEGENDARY_QUEST = 0x00000100, - QUEST_FLAGS_EX_NO_GUILD_XP = 0x00000200, - QUEST_FLAGS_EX_RESET_CACHE_ON_ACCEPT = 0x00000400, - QUEST_FLAGS_EX_NO_ABANDON_ONCE_ANY_OBJECTIVE_COMPLETE = 0x00000800, - QUEST_FLAGS_EX_RECAST_ACCEPT_SPELL_ON_LOGIN = 0x00001000, - QUEST_FLAGS_EX_UPDATE_ZONE_AURAS = 0x00002000, - QUEST_FLAGS_EX_NO_CREDIT_FOR_PROXY = 0x00004000, - QUEST_FLAGS_EX_DISPLAY_AS_DAILY_QUEST = 0x00008000, - QUEST_FLAGS_EX_PART_OF_QUEST_LINE = 0x00010000, - QUEST_FLAGS_EX_QUEST_FOR_INTERNAL_BUILDS_ONLY = 0x00020000, - QUEST_FLAGS_EX_SUPPRESS_SPELL_LEARN_TEXT_LINE = 0x00040000, - QUEST_FLAGS_EX_DISPLAY_HEADER_AS_OBJECTIVE_FOR_TASKS = 0x00080000, - QUEST_FLAGS_EX_GARRISON_NON_OWNERS_ALLOWED = 0x00100000, - QUEST_FLAGS_EX_REMOVE_QUEST_ON_WEEKLY_RESET = 0x00200000, - QUEST_FLAGS_EX_SUPPRESS_FAREWELL_AUDIO_AFTER_QUEST_ACCEPT = 0x00400000, - QUEST_FLAGS_EX_REWARDS_BYPASS_WEEKLY_CAPS_AND_SEASON_TOTAL = 0x00800000, - QUEST_FLAGS_EX_IS_WORLD_QUEST = 0x01000000, - QUEST_FLAGS_EX_NOT_IGNORABLE = 0x02000000, - QUEST_FLAGS_EX_AUTO_PUSH = 0x04000000, - QUEST_FLAGS_EX_NO_SPELL_COMPLETE_EFFECTS = 0x08000000, - QUEST_FLAGS_EX_DO_NOT_TOAST_HONOR_REWARD = 0x10000000, - QUEST_FLAGS_EX_KEEP_REPEATABLE_QUEST_ON_FACTION_CHANGE = 0x20000000, - QUEST_FLAGS_EX_KEEP_PROGRESS_ON_FACTION_CHANGE = 0x40000000, - QUEST_FLAGS_EX_PUSH_TEAM_QUEST_USING_MAP_CONTROLLER = 0x80000000 + QUEST_FLAGS_EX_NONE = 0x00000000, + QUEST_FLAGS_EX_NO_ITEM_REMOVAL = 0x00000001, // Keep Additional Items + QUEST_FLAGS_EX_SUPPRESS_GOSSIP_COMPLETE = 0x00000002, // Gossip on Quest Completion - Suppress Gossip + QUEST_FLAGS_EX_SUPPRESS_GOSSIP_ACCEPT = 0x00000004, // Gossip on Quest Accept - Suppress Gossip + QUEST_FLAGS_EX_DENY_PLAYER_QUESTGIVER = 0x00000008, // Disallow Player as Questgiver (advanced) + QUEST_FLAGS_EX_DISPLAY_CLASS_CHOICE_REWARDS = 0x00000010, // Choice Reward Filter - Matches Class + QUEST_FLAGS_EX_DISPLAY_SPEC_CHOICE_REWARDS = 0x00000020, // Choice Reward Filter - Matches Spec + QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET = 0x00000040, // Remove from Log on Periodic Reset + QUEST_FLAGS_EX_ACCOUNT = 0x00000080, // Account-Level Quest + QUEST_FLAGS_EX_LEGENDARY = 0x00000100, // Legendary Quest + QUEST_FLAGS_EX_NO_GUILD_XP = 0x00000200, // No Guild XP + QUEST_FLAGS_EX_RESET_CACHE_ON_ACCEPT = 0x00000400, // Reset Cache on Accept (internal) + QUEST_FLAGS_EX_NO_ABANDON_ONCE_BEGUN = 0x00000800, // No Abandon Once Any Objective Complete + QUEST_FLAGS_EX_RECAST_ACCEPT_SPELL_ON_LOGIN = 0x00001000, // Recast accept spell on login + QUEST_FLAGS_EX_UPDATE_ZONE_AURAS = 0x00002000, // Update Zone Auras + QUEST_FLAGS_EX_NO_CREDIT_FOR_PROXY = 0x00004000, // No Credit for Proxy Creatures + QUEST_FLAGS_EX_DISPLAY_AS_DAILY = 0x00008000, // Display As Daily Quest + QUEST_FLAGS_EX_DISPLAY_QUEST_LINE = 0x00010000, + QUEST_FLAGS_EX_INTERNAL_BUILDS_ONLY = 0x00020000, // Quest for Internal Builds ONLY + QUEST_FLAGS_EX_SUPPRESS_SPELL_LEARN_TEXT = 0x00040000, // Suppress spell learn text line (for followers) + QUEST_FLAGS_EX_DISPLAY_AS_OBJECTIVE = 0x00080000, // Display Header as Objective for Tasks + QUEST_FLAGS_EX_ALLOW_ALL_IN_GARRISON = 0x00100000, // Garrison non-owners allowed + QUEST_FLAGS_EX_REMOVE_ON_WEEKLY_RESET = 0x00200000, // Remove quest on weekly reset + QUEST_FLAGS_EX_SUPPRESS_GREETINGS_ON_ACCEPT = 0x00400000, // Suppress farewell audio after quest accept + QUEST_FLAGS_EX_REWARDS_IGNORE_CAPS = 0x00800000, // Rewards bypass weekly caps and Season Total + QUEST_FLAGS_EX_IS_WORLD_QUEST = 0x01000000, // Is a World Quest + QUEST_FLAGS_EX_NOT_IGNORABLE = 0x02000000, // Not Ignorable + QUEST_FLAGS_EX_AUTO_PUSH = 0x04000000, // Auto Push + QUEST_FLAGS_EX_NO_SPELL_COMPLETE_EFFECTS = 0x08000000, // No Complete Quest Spell Effect + QUEST_FLAGS_EX_DO_NOT_TOAST_HONOR_REWARD = 0x10000000, // Do Not Toast Honor Reward + QUEST_FLAGS_EX_KEEP_REPEATABLE_QUEST_ON_FACTION_CHANGE = 0x20000000, // Keep repeatable quest on faction change + QUEST_FLAGS_EX_KEEP_PROGRESS_ON_FACTION_CHANGE = 0x40000000, // Keep quest progress on faction change + QUEST_FLAGS_EX_PUSH_TEAM_QUEST_USING_MAP_CONTROLLER = 0x80000000 }; enum QuestFlagsEx2 : uint32 { - QUEST_FLAGS_EX2_RESET_ON_GAME_MILESTONE = 0x00000001, - QUEST_FLAGS_EX2_NO_WAR_MODE_BONUS = 0x00000002, - QUEST_FLAGS_EX2_AWARD_HIGHEST_PROFESSION = 0x00000004, - QUEST_FLAGS_EX2_NOT_REPLAYABLE = 0x00000008, - QUEST_FLAGS_EX2_NO_REPLAY_REWARDS = 0x00000010, - QUEST_FLAGS_EX2_DISABLE_WAYPOINT_PATHING = 0x00000020, - QUEST_FLAGS_EX2_RESET_ON_MYTHIC_PLUS_SEASON = 0x00000040, - QUEST_FLAGS_EX2_RESET_ON_PVP_SEASON = 0x00000080, - QUEST_FLAGS_EX2_ENABLE_OVERRIDE_SORT_ORDER = 0x00000100, - QUEST_FLAGS_EX2_FORCE_STARTING_LOC_ON_ZONE_MAP = 0x00000200, - QUEST_FLAGS_EX2_BONUS_LOOT_NEVER = 0x00000400, - QUEST_FLAGS_EX2_BONUS_LOOT_ALWAYS = 0x00000800, - QUEST_FLAGS_EX2_HIDE_TASK_ON_MAIN_MAP = 0x00001000, - QUEST_FLAGS_EX2_HIDE_TASK_IN_TRACKER = 0x00002000, - QUEST_FLAGS_EX2_SKIP_DISABLED_CHECK = 0x00004000, - QUEST_FLAGS_EX2_ENFORCE_MAXIMUM_QUEST_LEVEL = 0x00008000 + QUEST_FLAGS_EX2_RESET_ON_GAME_MILESTONE = 0x00000001, + QUEST_FLAGS_EX2_WAR_MODE_REWARDS_OPT_OUT = 0x00000002, + QUEST_FLAGS_EX2_AWARD_HIGHEST_PROFESSION = 0x00000004, + QUEST_FLAGS_EX2_NOT_REPLAYABLE = 0x00000008, + QUEST_FLAGS_EX2_NO_REPLAY_REWARDS = 0x00000010, + QUEST_FLAGS_EX2_DISABLE_WAYPOINT_PATHING = 0x00000020, + QUEST_FLAGS_EX2_RESET_ON_MYTHIC_PLUS_SEASON = 0x00000040, + QUEST_FLAGS_EX2_RESET_ON_PVP_SEASON = 0x00000080, + QUEST_FLAGS_EX2_ENABLE_OVERRIDE_SORT_ORDER = 0x00000100, + QUEST_FLAGS_EX2_FORCE_STARTING_LOC_ON_ZONE_MAP = 0x00000200, + QUEST_FLAGS_EX2_BONUS_LOOT_NEVER = 0x00000400, + QUEST_FLAGS_EX2_BONUS_LOOT_ALWAYS = 0x00000800, + QUEST_FLAGS_EX2_HIDE_TASK_ON_MAIN_MAP = 0x00001000, + QUEST_FLAGS_EX2_HIDE_TASK_IN_TRACKER = 0x00002000, + QUEST_FLAGS_EX2_SKIP_DISABLED_CHECK = 0x00004000, + QUEST_FLAGS_EX2_ENFORCE_MAXIMUM_QUEST_LEVEL = 0x00008000, + QUEST_FLAGS_EX2_CONTENT_ALERT = 0x00010000, + QUEST_FLAGS_EX2_DISPLAY_TIME_REMAINING = 0x00020000, + QUEST_FLAGS_EX2_CLEAR_TASK_PROGRESS_WHEN_ABANDONED = 0x00040000, + QUEST_FLAGS_EX2_SUPPRESS_GREETINGS_ON_COMPLETE = 0x00080000, + QUEST_FLAGS_EX2_HIDE_REQUIRED_ITEMS_ON_TURN_IN = 0x00100000 }; enum QuestSpecialFlags diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 67d8cc0d280..e4b0c88190e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -3514,6 +3514,19 @@ void World::DailyReset() if (Player* player = itr->second->GetPlayer()) player->DailyReset(); + { + std::ostringstream questIds; + questIds << "DELETE cq, cqo FROM character_queststatus cq LEFT JOIN character_queststatus_objectives cqo ON cq.quest = cqo.quest WHERE cq.quest IN ("; + for (auto const& [questId, quest] : sObjectMgr->GetQuestTemplates()) + { + if (quest.IsDaily() && quest.HasFlagEx(QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET)) + questIds << questId << ','; + } + questIds << "0)"; + + CharacterDatabase.Execute(questIds.str().c_str()); + } + // reselect pools sQuestPoolMgr->ChangeDailyQuests(); @@ -3550,6 +3563,19 @@ void World::ResetWeeklyQuests() if (Player* player = itr->second->GetPlayer()) player->ResetWeeklyQuestStatus(); + { + std::ostringstream questIds; + questIds << "DELETE cq, cqo FROM character_queststatus cq LEFT JOIN character_queststatus_objectives cqo ON cq.quest = cqo.quest WHERE cq.quest IN ("; + for (auto const& [questId, quest] : sObjectMgr->GetQuestTemplates()) + { + if (quest.IsWeekly() && quest.HasFlagEx(QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET)) + questIds << questId << ','; + } + questIds << "0)"; + + CharacterDatabase.Execute(questIds.str().c_str()); + } + // reselect pools sQuestPoolMgr->ChangeWeeklyQuests(); |