[10641] Fixed use item dynamic/item proto flags.

* List its independelty. Each from this 2 fields have own flags. Cleanup lists.
* Not copy proto flags to item flags update field. This fix heroic item versions
  show in client in result mixed use ITEM_DYNFLAG_WRAPPED (0x8) with ITEM_FLAG_HEROIC (0x8)
* Update uses to proto case use for some cases where before wrongly has been used item dyn.flags
* For ITEM_DYNFLAG_UNLOCKED (0x4) set for item at unlock and check for prevent re-unlocking.
  This mostly for future case when will be implemented partly loting items support.
* For ITEM_FLAG_LOOTABLE (0x4) check loot absent or conflicting setting with containers/casted at use items.
  Report wrong cases art loading.
* Better check related loot tables content using ITEM_FLAG_PROSPECTABLE and ITEM_FLAG_MILLABLE
This commit is contained in:
VladimirMangos 2010-10-24 20:31:50 +04:00
parent d53fe93e9d
commit 46d740bbf4
17 changed files with 208 additions and 103 deletions

View file

@ -38,8 +38,8 @@ static eConfigFloatValues const qualityToRate[MAX_ITEM_QUALITY] = {
LootStore LootTemplates_Creature( "creature_loot_template", "creature entry", true);
LootStore LootTemplates_Disenchant( "disenchant_loot_template", "item disenchant id", true);
LootStore LootTemplates_Fishing( "fishing_loot_template", "area id", true);
LootStore LootTemplates_Gameobject( "gameobject_loot_template", "gameobject entry", true);
LootStore LootTemplates_Item( "item_loot_template", "item entry", true);
LootStore LootTemplates_Gameobject( "gameobject_loot_template", "gameobject lootid", true);
LootStore LootTemplates_Item( "item_loot_template", "item entry with ITEM_FLAG_LOOTABLE", true);
LootStore LootTemplates_Mail( "mail_loot_template", "mail template id", false);
LootStore LootTemplates_Milling( "milling_loot_template", "item entry (herb)", true);
LootStore LootTemplates_Pickpocketing("pickpocketing_loot_template","creature pickpocket lootid", true);
@ -320,7 +320,7 @@ LootItem::LootItem(LootStoreItem const& li)
conditionId = li.conditionId;
ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemid);
freeforall = proto && (proto->Flags & ITEM_FLAGS_PARTY_LOOT);
freeforall = proto && (proto->Flags & ITEM_FLAG_PARTY_LOOT);
needs_quest = li.needs_quest;
@ -345,10 +345,10 @@ bool LootItem::AllowedForPlayer(Player const * player) const
return false;
// not show loot for not own team
if ((pProto->Flags2 & ITEM_FLAGS2_HORDE_ONLY) && player->GetTeam() != HORDE)
if ((pProto->Flags2 & ITEM_FLAG2_HORDE_ONLY) && player->GetTeam() != HORDE)
return false;
if ((pProto->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE)
if ((pProto->Flags2 & ITEM_FLAG2_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE)
return false;
if ( needs_quest )
@ -386,10 +386,10 @@ void Loot::AddItem(LootStoreItem const & item)
// non-conditional one-player only items are counted here,
// free for all items are counted in FillFFALoot(),
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
if( !item.conditionId )
if (!item.conditionId)
{
ItemPrototype const* proto = ObjectMgr::GetItemPrototype(item.itemid);
if( !proto || (proto->Flags & ITEM_FLAGS_PARTY_LOOT)==0 )
if (!proto || !(proto->Flags & ITEM_FLAG_PARTY_LOOT))
++unlootedCount;
}
}
@ -1189,9 +1189,19 @@ 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 (!(proto->Flags & ITEM_FLAG_LOOTABLE))
continue;
if (ids_set.find(proto->ItemId) != ids_set.end() || proto->MaxMoneyLoot > 0)
ids_set.erase(proto->ItemId);
// wdb have wrong data cases, so skip by default
else if ((sLog.getLogFilter() & LOG_FILTER_DB_STRICTED_CHECK) == 0)
LootTemplates_Item.ReportNotExistedId(proto->ItemId);
}
}
// output error for any still listed (not referenced from appropriate table) ids
LootTemplates_Item.ReportUnusedIds(ids_set);
@ -1209,11 +1219,13 @@ void LoadLootTemplates_Milling()
if(!proto)
continue;
if((proto->BagFamily & BAG_FAMILY_MASK_HERBS)==0)
if (!(proto->Flags & ITEM_FLAG_MILLABLE))
continue;
if (ids_set.find(proto->ItemId) != ids_set.end())
ids_set.erase(proto->ItemId);
else
LootTemplates_Milling.ReportNotExistedId(proto->ItemId);
}
// output error for any still listed (not referenced from appropriate table) ids
@ -1255,14 +1267,16 @@ void LoadLootTemplates_Prospecting()
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
if(!proto)
if (!proto)
continue;
if((proto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)==0)
if (!(proto->Flags & ITEM_FLAG_PROSPECTABLE))
continue;
if (ids_set.find(proto->ItemId) != ids_set.end())
ids_set.erase(proto->ItemId);
//else -- exist some cases that possible can be prospected but not expected have any result loot
// LootTemplates_Prospecting.ReportNotExistedId(proto->ItemId);
}
// output error for any still listed (not referenced from appropriate table) ids