* 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:
Brian
2010-07-18 04:37:08 -06:00
parent 4d09046d54
commit 8ceda47e39
7 changed files with 67 additions and 51 deletions
+14 -4
View File
@@ -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;