fix(Core/PlayerQuest): Introduce flag QUEST_SPECIAL_FLAGS_NO_LOREMAST… (#19962)

* fix(Core/PlayerQuest): Introduce flag QUEST_SPECIAL_FLAGS_NO_LOREMASTER_COUNT

- this allows flagging quests so that they will not count towards Loremaster achievement
- update Corrupted Flower Quests in Felwood accordingly as a first use case

* load Specialflags as uint32 from DB
This commit is contained in:
sudlud
2024-09-15 23:15:21 +02:00
committed by GitHub
parent 1df989f780
commit e2353a1c9f
4 changed files with 16 additions and 8 deletions

View File

@@ -1087,7 +1087,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
{
Quest const* quest = sObjectMgr->GetQuestTemplate(*itr);
if (quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
if (quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID && !(quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_NO_LOREMASTER_COUNT)))
++counter;
}
SetCriteriaProgress(achievementCriteria, counter);

View File

@@ -187,7 +187,7 @@ void Quest::LoadQuestTemplateAddon(Field* fields)
RequiredMaxRepValue = fields[14].Get<int32>();
StartItemCount = fields[15].Get<uint8>();
RewardMailSenderEntry = fields[16].Get<uint32>();
SpecialFlags = fields[17].Get<uint8>();
SpecialFlags = fields[17].Get<uint32>();
if ((SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) && !sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT))
{

View File

@@ -165,17 +165,18 @@ enum QuestSpecialFlags
QUEST_SPECIAL_FLAGS_CAST = 0x0020, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast)
QUEST_SPECIAL_FLAGS_NO_REP_SPILLOVER = 0x0040, // Set by 64 in SpecialFlags in DB if the quest does not share rewarded reputation with other allied factions
QUEST_SPECIAL_FLAGS_CAN_FAIL_IN_ANY_STATE = 0x0080, // Set by 128 in SpecialFlags in DB if the quest is allowed to fail in Player::FailQuest() independant of its current state
QUEST_SPECIAL_FLAGS_NO_LOREMASTER_COUNT = 0x0100, // Set by 256 in SpecialFlags in DB if the quest should not count towards Loremaster Achievement
// room for more custom flags
QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT |
QUEST_SPECIAL_FLAGS_DF_QUEST | QUEST_SPECIAL_FLAGS_MONTHLY | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_NO_REP_SPILLOVER |
QUEST_SPECIAL_FLAGS_CAN_FAIL_IN_ANY_STATE,
QUEST_SPECIAL_FLAGS_CAN_FAIL_IN_ANY_STATE | QUEST_SPECIAL_FLAGS_NO_LOREMASTER_COUNT,
QUEST_SPECIAL_FLAGS_DELIVER = 0x0100, // Internal flag computed only
QUEST_SPECIAL_FLAGS_SPEAKTO = 0x0200, // Internal flag computed only
QUEST_SPECIAL_FLAGS_KILL = 0x0400, // Internal flag computed only
QUEST_SPECIAL_FLAGS_TIMED = 0x0800, // Internal flag computed only
QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x1000 // Internal flag computed only
QUEST_SPECIAL_FLAGS_DELIVER = 0x0200, // Internal flag computed only
QUEST_SPECIAL_FLAGS_SPEAKTO = 0x0400, // Internal flag computed only
QUEST_SPECIAL_FLAGS_KILL = 0x0800, // Internal flag computed only
QUEST_SPECIAL_FLAGS_TIMED = 0x1000, // Internal flag computed only
QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x2000 // Internal flag computed only
};
struct QuestLocale