aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Loot
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-07-04 22:20:21 +0200
committerShauren <shauren.trinity@gmail.com>2012-07-04 22:20:21 +0200
commited6f3e2deff55f913f9646db5f540b7704088478 (patch)
tree2212558564e685b43214a2ca80aea7014af8e200 /src/server/game/Loot
parent138375c0455fc0c7f1c2fc0e6b94930dea28ae9c (diff)
parentc3cb82b9263331ceaf68ebf69638ce3162b4a934 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.x
Diffstat (limited to 'src/server/game/Loot')
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 2100eb26346..24338d5f0ad 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -356,18 +356,14 @@ bool LootItem::AllowedForPlayer(Player const* player) const
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE)
return false;
- if (needs_quest)
- {
- // Checking quests for quest-only drop (check only quests requirements in this case)
- if (!player->HasQuestForItem(itemid))
- return false;
- }
- else
- {
- // Not quest only drop (check quest starting items for already accepted non-repeatable quests)
- if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
- return false;
- }
+ // 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)))
+ if (Group const* group = player->GetGroup())
+ {
+ if (pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT || ((pProto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0 && (group->GetLootMethod() != MASTER_LOOT || group->GetLooterGuid() != player->GetGUID())))
+ return false;
+ }
+ else return false;
return true;
}
@@ -483,7 +479,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player))
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid))
- if (proto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ if (proto->IsCurrencyToken())
player->StoreLootItem(i, this);
}
}
@@ -899,6 +895,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())
@@ -911,7 +908,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;
}
}
@@ -929,7 +929,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;
}
}
@@ -947,7 +950,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;
}
}