fix(Core/Loot): restore hide quest starter item conditions (#25355)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -441,8 +441,26 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// check quest requirements
|
// check quest requirements
|
||||||
if (needs_quest && !pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && !player->HasQuestForItem(itemid))
|
if (!pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS))
|
||||||
return false;
|
{
|
||||||
|
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))
|
if (!sScriptMgr->OnAllowedForPlayerLootCheck(player, source))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user