diff options
author | Shauren <none@none> | 2010-08-04 10:34:30 +0200 |
---|---|---|
committer | Shauren <none@none> | 2010-08-04 10:34:30 +0200 |
commit | b7d34dcb534a14098f1666bf6de38d9895642191 (patch) | |
tree | 20e02e2ec035463ff8070277d69d665ab76bf104 /src/server/game/Loot/LootMgr.cpp | |
parent | 846aa122605e6862b3c0a58e2d741c379aa1a3ef (diff) |
Cleaned up item flags: separated item proto flags and item field flags
Implemented use of:
ITEM_PROTO_FLAG_PROSPECTABLE and ITEM_PROTO_FLAG_MILLABLE now checked instead of bag family mask
ITEM_PROTO_FLAG_SMART_LOOT for profession recipes, player has to have skillline and not know the recipe
ITEM_PROTO_FLAG_OPENABLE item has to have it set to use item_loot_template
ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA if this is set item can never be used in arena
ITEM_FLAG_UNLOCKED marks unlocked items
Simplified BoA check for mail sending
Stackable items are no longer refundable
Removed useless code that always set ITEM_FIELD_FLAGS equal to proto flags
Unlocking items (lockpicking) is now blizzlike
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
-rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index d331f7e7ca1..38bad409718 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -330,7 +330,7 @@ LootItem::LootItem(LootStoreItem const& li) conditions = li.conditions; ItemPrototype const* proto = objmgr.GetItemPrototype(itemid); - freeforall = proto && (proto->Flags & ITEM_FLAGS_PARTY_LOOT); + freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT); needs_quest = li.needs_quest; @@ -354,6 +354,10 @@ bool LootItem::AllowedForPlayer(Player const * player) const if (!pProto) return false; + // not show loot for players without profession or those who already know the recipe + if ((pProto->Flags & ITEM_PROTO_FLAG_SMART_LOOT) && (!player->HasSkill(pProto->RequiredSkill) || player->HasSpell(pProto->Spells[1].SpellId))) + return false; + // not show loot for not own team if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeam() != HORDE) return false; @@ -399,7 +403,7 @@ void Loot::AddItem(LootStoreItem const & item) if (item.conditions.empty()) { ItemPrototype const* proto = objmgr.GetItemPrototype(item.itemid); - if (!proto || (proto->Flags & ITEM_FLAGS_PARTY_LOOT) == 0) + if (!proto || (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT) == 0) ++unlootedCount; } } @@ -1470,7 +1474,7 @@ void LoadLootTemplates_Item() // remove real entries and check existence loot for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i) if (ItemPrototype const *proto = sItemStorage.LookupEntry<ItemPrototype>(i)) - if (ids_set.find(proto->ItemId) != ids_set.end()) + if (ids_set.find(proto->ItemId) != ids_set.end() && proto->Flags & ITEM_PROTO_FLAG_OPENABLE) ids_set.erase(proto->ItemId); // output error for any still listed (not referenced from appropriate table) ids @@ -1489,7 +1493,7 @@ void LoadLootTemplates_Milling() if (!proto) continue; - if ((proto->BagFamily & BAG_FAMILY_MASK_HERBS) == 0) + if (!(proto->Flags & ITEM_PROTO_FLAG_MILLABLE)) continue; if (ids_set.find(proto->ItemId) != ids_set.end()) @@ -1538,7 +1542,7 @@ void LoadLootTemplates_Prospecting() if (!proto) continue; - if ((proto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP) == 0) + if (!(proto->Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) continue; if (ids_set.find(proto->ItemId) != ids_set.end()) |