Core/Quests: New FlagsEx implementations

* QUEST_FLAGS_EX_REWARDS_IGNORE_CAPS
* QUEST_FLAGS_EX_NO_CREDIT_FOR_PROXY
* QUEST_FLAGS_EX_RECAST_ACCEPT_SPELL_ON_LOGIN
* QUEST_FLAGS_EX_REMOVE_ON_PERIODIC_RESET
* QUEST_FLAGS_EX_NO_ABANDON_ONCE_BEGUN
Port From (https://github.com/TrinityCore/TrinityCore/commit/0cb8965de22c5da3887b8f8b5c08b9f5034b3cc6)
This commit is contained in:
hondacrx
2023-06-13 09:11:55 -04:00
parent 5b7b6c5494
commit 264647c611
6 changed files with 147 additions and 57 deletions
+22
View File
@@ -20,6 +20,7 @@ using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Game
{
@@ -2012,6 +2013,17 @@ namespace Game
player.DailyReset();
}
StringBuilder questIds = new StringBuilder("DELETE cq, cqo FROM character_queststatus cq LEFT JOIN character_queststatus_objectives cqo ON cq.quest = cqo.quest WHERE cq.quest IN (");
foreach (var (questId, quest) in Global.ObjectMgr.GetQuestTemplates())
{
if (quest.IsDaily() && quest.HasFlagEx(QuestFlagsEx.RemoveOnPeriodicReset))
questIds.Append($"{questId},");
}
questIds.Append("0)");
DB.Characters.Execute(questIds.ToString());
// reselect pools
Global.QuestPoolMgr.ChangeDailyQuests();
@@ -2054,6 +2066,16 @@ namespace Game
player.ResetWeeklyQuestStatus();
}
StringBuilder questIds = new StringBuilder("DELETE cq, cqo FROM character_queststatus cq LEFT JOIN character_queststatus_objectives cqo ON cq.quest = cqo.quest WHERE cq.quest IN (");
foreach (var (questId, quest) in Global.ObjectMgr.GetQuestTemplates())
{
if (quest.IsWeekly() && quest.HasFlagEx(QuestFlagsEx.RemoveOnWeeklyReset))
questIds.Append($"{questId},");
}
questIds.Append("0)");
DB.Characters.Execute(questIds.ToString());
// reselect pools
Global.QuestPoolMgr.ChangeWeeklyQuests();