mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-31 06:07:37 +01:00
Core/Loot: fix loot rules for looting quest items that have the party loot flag
This commit is contained in:
@@ -358,7 +358,12 @@ bool LootItem::AllowedForPlayer(Player const* player) const
|
||||
|
||||
// check quest requirements
|
||||
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid)))
|
||||
return false;
|
||||
if (Group const* group = player->GetGroup())
|
||||
{
|
||||
if ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 || (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID())))
|
||||
return false;
|
||||
}
|
||||
else return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -889,6 +894,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
}
|
||||
|
||||
LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
LootSlotType partySlotType = lv.permission == MASTER_PERMISSION ? LOOT_SLOT_TYPE_MASTER : (lv.permission == GROUP_PERMISSION ? LOOT_SLOT_TYPE_ROLL_ONGOING : slotType);
|
||||
QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
|
||||
QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow());
|
||||
if (q_itr != lootPlayerQuestItems.end())
|
||||
@@ -901,7 +907,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
{
|
||||
b << uint8(l.items.size() + (qi - q_list->begin()));
|
||||
b << item;
|
||||
b << uint8(slotType);
|
||||
if (!item.freeforall)
|
||||
b << uint8(partySlotType);
|
||||
else
|
||||
b << uint8(slotType);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
@@ -919,7 +928,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
{
|
||||
b << uint8(fi->index);
|
||||
b << item;
|
||||
b << uint8(slotType);
|
||||
if (!item.freeforall)
|
||||
b << uint8(partySlotType);
|
||||
else
|
||||
b << uint8(slotType);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
@@ -937,7 +949,10 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
{
|
||||
b << uint8(ci->index);
|
||||
b << item;
|
||||
b << uint8(slotType);
|
||||
if (!item.freeforall)
|
||||
b << uint8(partySlotType);
|
||||
else
|
||||
b << uint8(slotType);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user