From 42fe005764ef77647ac8fbfded5c0250e5baf443 Mon Sep 17 00:00:00 2001 From: sogladev Date: Sun, 5 Apr 2026 16:17:21 +0200 Subject: [PATCH] fix(Core/Loot): restore hide quest starter item conditions (#25355) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/server/game/Loot/LootMgr.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 9a9804a7d..d65883255 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -441,8 +441,26 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const return false; // check quest requirements - if (needs_quest && !pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && !player->HasQuestForItem(itemid)) - return false; + if (!pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS)) + { + if (needs_quest && !player->HasQuestForItem(itemid)) + return false; + + // Hide quest starter items when quest is already started/rewarded, + // when unique count is already reached, or when prerequisite is missing. + if (pProto->StartQuest) + { + uint32 prevQuestId = 0; + if (Quest const* startQuest = sObjectMgr->GetQuestTemplate(pProto->StartQuest)) + prevQuestId = startQuest->GetPrevQuestId(); + + if (player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE || + player->GetQuestRewardStatus(pProto->StartQuest) || + (pProto->MaxCount && player->HasItemCount(itemid, pProto->MaxCount, true)) || + (prevQuestId && !player->GetQuestRewardStatus(prevQuestId))) + return false; + } + } if (!sScriptMgr->OnAllowedForPlayerLootCheck(player, source)) return false;