void LoadLootTemplates_Pickpocketing() { TC_LOG_INFO("server.loading", "Loading pickpocketing loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet, lootIdSetUsed; uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(lootIdSet); // Remove real entries and check loot existence CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr) { if (uint32 lootid = itr->second.pickpocketLootId) { if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Pickpocketing.ReportNonExistingId(lootid, "Creature", itr->second.Entry); else lootIdSetUsed.insert(lootid); } } for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); }
void LoadLootTemplates_Prospecting() { TC_LOG_INFO("server.loading", "Loading prospecting loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet; uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) { if (!(itr->second.GetFlags() & ITEM_FLAG_IS_PROSPECTABLE)) continue; if (lootIdSet.find(itr->second.GetId()) != lootIdSet.end()) lootIdSet.erase(itr->second.GetId()); } // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Prospecting.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); }
void LoadLootTemplates_Disenchant() { TC_LOG_INFO("server.loading", "Loading disenchanting loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet, lootIdSetUsed; uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet); for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) { ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i); if (!disenchant) continue; uint32 lootid = i; if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Disenchant.ReportNonExistingId(lootid); else lootIdSetUsed.insert(lootid); } for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Disenchant.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); }
void LoadLootTemplates_Reference() { TC_LOG_INFO("server.loading", "Loading reference loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet; LootTemplates_Reference.LoadAndCollectLootIds(lootIdSet); // check references and remove used LootTemplates_Creature.CheckLootRefs(&lootIdSet); LootTemplates_Fishing.CheckLootRefs(&lootIdSet); LootTemplates_Gameobject.CheckLootRefs(&lootIdSet); LootTemplates_Item.CheckLootRefs(&lootIdSet); LootTemplates_Milling.CheckLootRefs(&lootIdSet); LootTemplates_Pickpocketing.CheckLootRefs(&lootIdSet); LootTemplates_Skinning.CheckLootRefs(&lootIdSet); LootTemplates_Disenchant.CheckLootRefs(&lootIdSet); LootTemplates_Prospecting.CheckLootRefs(&lootIdSet); LootTemplates_Mail.CheckLootRefs(&lootIdSet); LootTemplates_Reference.CheckLootRefs(&lootIdSet); // output error for any still listed ids (not referenced from any loot table) LootTemplates_Reference.ReportUnusedIds(lootIdSet); TC_LOG_INFO("server.loading", ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); }
void LoadLootTemplates_Spell() { // TODO: change this to use MiscValue from spell effect as id instead of spell id TC_LOG_INFO("server.loading", "Loading spell loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet; uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); if (!spellInfo) continue; // possible cases if (!spellInfo->IsLootCrafting()) continue; if (lootIdSet.find(spell_id) == lootIdSet.end()) { // not report about not trainable spells (optionally supported by DB) // ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example if (!spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT) || (spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL))) LootTemplates_Spell.ReportNonExistingId(spell_id, "Spell", spellInfo->Id); } else lootIdSet.erase(spell_id); } // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Spell.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); }
void LoadLootTemplates_Fishing() { TC_LOG_INFO("server.loading", "Loading fishing loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet; uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (AreaTableEntry const* areaTable : sAreaTableStore) if (lootIdSet.find(areaTable->ID) != lootIdSet.end()) lootIdSet.erase(areaTable->ID); // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Fishing.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); }
void LoadLootTemplates_Mail() { TC_LOG_INFO("server.loading", "Loading mail loot templates..."); uint32 oldMSTime = getMSTime(); LootIdSet lootIdSet; uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 i = 1; i < sMailTemplateStore.GetNumRows(); ++i) if (sMailTemplateStore.LookupEntry(i)) if (lootIdSet.find(i) != lootIdSet.end()) lootIdSet.erase(i); // output error for any still listed (not referenced from appropriate table) ids LootTemplates_Mail.ReportUnusedIds(lootIdSet); if (count) TC_LOG_INFO("server.loading", ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else TC_LOG_ERROR("server.loading", ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); }