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
This commit is contained in:
Shauren
2010-08-04 10:34:30 +02:00
parent 846aa12260
commit b7d34dcb53
15 changed files with 185 additions and 140 deletions
+9 -5
View File
@@ -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())