mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 15:16:38 +08:00
fix(Core/Quest): Implement QUEST_FLAGS_STAY_ALIVE support (#26989)
Co-authored-by: killerwife <[email protected]> Co-authored-by: sogladev <[email protected]>
This commit is contained in:
co-authored by
killerwife
sogladev
parent
88209128a5
commit
7d9027d73d
@@ -1114,6 +1114,8 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1);
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1);
|
||||
|
||||
FailQuestsOnDeath();
|
||||
|
||||
// Xinef: reset all death criterias
|
||||
ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH, 0);
|
||||
}
|
||||
|
||||
@@ -1466,6 +1466,7 @@ public:
|
||||
void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true, bool isLFGReward = false);
|
||||
void SetRewardedQuest(uint32 quest_id);
|
||||
void FailQuest(uint32 quest_id);
|
||||
void FailQuestsOnDeath();
|
||||
bool SatisfyQuestSkill(Quest const* qInfo, bool msg) const;
|
||||
bool SatisfyQuestLevel(Quest const* qInfo, bool msg) const;
|
||||
bool SatisfyQuestLog(bool msg);
|
||||
|
||||
@@ -953,6 +953,21 @@ void Player::FailQuest(uint32 questId)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::FailQuestsOnDeath()
|
||||
{
|
||||
for (auto& [id, statusData] : m_QuestStatus)
|
||||
{
|
||||
if (statusData.Status != QUEST_STATUS_INCOMPLETE)
|
||||
continue;
|
||||
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(id);
|
||||
if (!quest || !quest->HasFlag(QUEST_FLAGS_STAY_ALIVE))
|
||||
continue;
|
||||
|
||||
FailQuest(id);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::AbandonQuest(uint32 questId)
|
||||
{
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
|
||||
|
||||
@@ -129,7 +129,7 @@ enum QuestFlags
|
||||
{
|
||||
// Flags used at server and sent to client
|
||||
QUEST_FLAGS_NONE = 0x00000000,
|
||||
QUEST_FLAGS_STAY_ALIVE = 0x00000001, // Not used currently
|
||||
QUEST_FLAGS_STAY_ALIVE = 0x00000001, // Quest is failed when the player dies
|
||||
QUEST_FLAGS_PARTY_ACCEPT = 0x00000002, // Not used currently. If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
|
||||
QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently
|
||||
QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest()
|
||||
|
||||
Reference in New Issue
Block a user