diff options
| author | Brian <runningnak3d@gmail.com> | 2010-07-18 04:37:08 -0600 |
|---|---|---|
| committer | Brian <runningnak3d@gmail.com> | 2010-07-18 04:37:08 -0600 |
| commit | 8ceda47e3916bdd8e0aa26adb67506845b76d0d1 (patch) | |
| tree | 4e4cffe457e565f2609dd0cbeee972bbd4cbd68a /src/server/game/Loot/LootMgr.cpp | |
| parent | 4d09046d5462c47dcf7799efdcaf0810291cc10f (diff) | |
* 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
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
| -rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 77b7f08fd5a..d331f7e7ca1 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -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; |
