예제 #1
0
        public static void LoadLootTemplates_Skinning()
        {
            Log.outInfo(LogFilter.ServerLoading, "Loading skinning loot templates...");

            uint oldMSTime = Time.GetMSTime();

            List<uint> lootIdSet;
            List<uint> lootIdSetUsed = new List<uint>();
            uint count = Skinning.LoadAndCollectLootIds(out lootIdSet);

            // remove real entries and check existence loot
            var ctc = Global.ObjectMgr.GetCreatureTemplates();
            foreach (var pair in ctc)
            {
                uint lootid = pair.Value.SkinLootId;
                if (lootid != 0)
                {
                    if (!lootIdSet.Contains(lootid))
                        Skinning.ReportNonExistingId(lootid, pair.Value.Entry);
                    else
                        lootIdSetUsed.Add(lootid);
                }
            }

            foreach (var id in lootIdSetUsed)
                lootIdSet.Remove(id);

            // output error for any still listed (not referenced from appropriate table) ids
            Skinning.ReportUnusedIds(lootIdSet);

            if (count != 0)
                Log.outInfo(LogFilter.ServerLoading, "Loaded {0} skinning loot templates in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime));
            else
                Log.outError(LogFilter.ServerLoading, "Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
        }