* Implement additional usage of item_template.FlagsExtra Horde / Ally only
* Check loot (no longer need loot condition) * Check equip/use * Original patch by Vladimir * Ported to Trinity by Az@zel --HG-- branch : trunk
This commit is contained in:
@@ -346,10 +346,21 @@ LootItem::LootItem(LootStoreItem const& li)
|
||||
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
|
||||
bool LootItem::AllowedForPlayer(Player const * player) const
|
||||
{
|
||||
// DB conditions check
|
||||
// DB conditions check
|
||||
if (!sConditionMgr.IsPlayerMeetToConditions(const_cast<Player*>(player), conditions))
|
||||
return false;
|
||||
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
|
||||
if (!pProto)
|
||||
return false;
|
||||
|
||||
// not show loot for not own team
|
||||
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeam() != HORDE)
|
||||
return false;
|
||||
|
||||
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)
|
||||
@@ -359,9 +370,8 @@ bool LootItem::AllowedForPlayer(Player const * player) const
|
||||
else
|
||||
{
|
||||
// Not quest only drop (check quest starting items for already accepted non-repeatable quests)
|
||||
if (ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid))
|
||||
if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
|
||||
return false;
|
||||
if (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE && !player->HasQuestForItem(itemid))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user