コード例 #1
0
        public static string NpcText()
        {
            if (!Storage.NpcTexts.IsEmpty())
            {
                if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.npc_text))
                    return string.Empty;

                foreach (var npcText in Storage.NpcTexts)
                    npcText.Value.Item1.ConvertToDBStruct();

                var entries = Storage.NpcTexts.Keys();
                var templatesDb = SQLDatabase.GetDict<uint, NpcText>(entries, "ID");

                return SQLUtil.CompareDicts(Storage.NpcTexts, templatesDb, StoreNameType.NpcText, "ID");
            }

            if (!Storage.NpcTextsMop.IsEmpty())
            {

                if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.npc_text))
                    return string.Empty;

                foreach (var npcText in Storage.NpcTextsMop)
                    npcText.Value.Item1.ConvertToDBStruct();

                var entries = Storage.NpcTextsMop.Keys();
                var templatesDb = SQLDatabase.GetDict<uint, NpcTextMop>(entries, "ID");

                return SQLUtil.CompareDicts(Storage.NpcTextsMop, templatesDb, StoreNameType.NpcText, "ID");
            }

            return String.Empty;
        }
コード例 #2
0
        public static string QuestPOI()
        {
            if (Storage.QuestPOIs.IsEmpty())
            {
                return(String.Empty);
            }

            var sql = string.Empty;

            if (Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_poi))
            {
                var entries = Storage.QuestPOIs.Keys();
                var poiDb   = SQLDatabase.GetDict <uint, uint, QuestPOI>(entries, "questid", "id");

                sql = SQLUtil.CompareDicts(Storage.QuestPOIs, poiDb, StoreNameType.Quest, "questid", "id");
            }

            // TODO: fix this piece of code so it compares with db
            //var points = new StoreMulti<Tuple<uint, uint>, QuestPOIPoint>();
            //
            //foreach (KeyValuePair<Tuple<uint, uint>, Tuple<QuestPOI, TimeSpan?>> pair in Storage.QuestPOIs)
            //    foreach (var point in pair.Value.Item1.Points)
            //        points.Add(pair.Key, point, pair.Value.Item2);
            //
            //var entries2 = points.Keys();
            //var poiPointsDb = SQLDatabase.GetDictMulti<uint, uint, QuestPOIPoint>(entries2, "questid", "id");

            const string tableName2 = "quest_poi_points";

            if (Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_poi_points))
            {
                var rows = new List <QueryBuilder.SQLInsertRow>();
                foreach (var quest in Storage.QuestPOIs)
                {
                    var questPOI = quest.Value.Item1;

                    if (questPOI.Points != null) // Needed?
                    {
                        foreach (var point in questPOI.Points)
                        {
                            var row = new QueryBuilder.SQLInsertRow();

                            row.AddValue("questId", quest.Key.Item1);
                            row.AddValue("id", quest.Key.Item2);
                            row.AddValue("idx", point.Index); // Not on sniffs
                            row.AddValue("x", point.X);
                            row.AddValue("y", point.Y);
                            row.AddValue("VerifiedBuild", point.VerifiedBuild);
                            row.Comment = StoreGetters.GetName(StoreNameType.Quest, (int)quest.Key.Item1, false);

                            rows.Add(row);
                        }
                    }
                }

                sql += new QueryBuilder.SQLInsert(tableName2, rows, 2).Build();
            }

            return(sql);
        }
コード例 #3
0
        public static string QuestPOIWoD()
        {
            var sql = string.Empty;

            if (Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_poi))
            {
                if (!Storage.QuestPOIWoDs.IsEmpty())
                {
                    var entries = Storage.QuestPOIWoDs.Keys();
                    var poiDb   = SQLDatabase.GetDict <int, int, QuestPOIWoD>(entries, "QuestID", "Idx1");
                    sql += SQLUtil.CompareDicts(Storage.QuestPOIWoDs, poiDb, StoreNameType.Quest, StoreNameType.None, "QuestID", "Idx1");
                }
            }

            if (Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_poi_points))
            {
                if (!Storage.QuestPOIPointWoDs.IsEmpty())
                {
                    var entries = Storage.QuestPOIPointWoDs.Keys();
                    var poiDb   = SQLDatabase.GetDict <int, int, int, QuestPOIPointWoD>(entries, "QuestID", "Idx1", "Idx2");
                    sql += SQLUtil.CompareDicts(Storage.QuestPOIPointWoDs, poiDb, StoreNameType.Quest, StoreNameType.None, StoreNameType.None, "QuestID", "Idx1", "Idx2");
                }
            }

            return(sql);
        }
コード例 #4
0
ファイル: UnitMisc.cs プロジェクト: wayt/WowPacketParser
        public static string CreatureEquip(Dictionary <Guid, Unit> units)
        {
            if (units.Count == 0)
            {
                return(string.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.creature_equip_template))
            {
                return(string.Empty);
            }

            var equips = new StoreDictionary <ushort, CreatureEquipment>();

            foreach (var unit in units)
            {
                var equip = new CreatureEquipment();
                var npc   = unit.Value;
                var entry = (ushort)unit.Key.GetEntry();

                if (npc.Equipment == null || npc.Equipment.Length != 3)
                {
                    continue;
                }

                if (npc.Equipment[0] == 0 && npc.Equipment[1] == 0 && npc.Equipment[2] == 0)
                {
                    continue;
                }

                if (equips.ContainsKey(entry))
                {
                    var existingEquip = equips[entry].Item1;

                    if (existingEquip.ItemEntry1 != npc.Equipment[0] ||
                        existingEquip.ItemEntry2 != npc.Equipment[1] ||
                        existingEquip.ItemEntry3 != npc.Equipment[2])
                    {
                        equips.Remove(entry); // no conflicts
                    }
                    continue;
                }

                equip.ItemEntry1 = npc.Equipment[0];
                equip.ItemEntry2 = npc.Equipment[1];
                equip.ItemEntry3 = npc.Equipment[2];

                equips.Add(entry, equip);
            }

            var entries  = equips.Keys();
            var equipsDb = SQLDatabase.GetDict <ushort, CreatureEquipment>(entries);

            return(SQLUtil.CompareDicts(equips, equipsDb, StoreNameType.Unit));
        }
コード例 #5
0
        public static string PageText()
        {
            if (Storage.PageTexts.IsEmpty())
            {
                return(String.Empty);
            }

            var entries     = Storage.PageTexts.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, PageText>(entries);

            return(SQLUtil.CompareDicts(Storage.PageTexts, templatesDb, StoreNameType.PageText));
        }
コード例 #6
0
        public static string Quest()
        {
            if (Storage.QuestTemplates.IsEmpty())
            {
                return(String.Empty);
            }

            var entries     = Storage.QuestTemplates.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, QuestTemplate>(entries, "Id");

            return(SQLUtil.CompareDicts(Storage.QuestTemplates, templatesDb, StoreNameType.Quest, "Id"));
        }
コード例 #7
0
        public static string GameObject()
        {
            if (Storage.GameObjectTemplates.IsEmpty())
            {
                return(String.Empty);
            }

            var entries    = Storage.GameObjectTemplates.Keys();
            var tempatesDb = SQLDatabase.GetDict <uint, GameObjectTemplate>(entries);

            return(SQLUtil.CompareDicts(Storage.GameObjectTemplates, tempatesDb, StoreNameType.GameObject));
        }
コード例 #8
0
ファイル: QuestMisc.cs プロジェクト: Kinzcool/WowPacketParser
        public static string QuestOffer()
        {
            if (Storage.QuestOffers.IsEmpty())
            {
                return(String.Empty);
            }

            var entries = Storage.QuestOffers.Keys();
            var offerDb = SQLDatabase.GetDict <uint, QuestOffer>(entries, "Id");

            return(SQLUtil.CompareDicts(Storage.QuestOffers, offerDb, StoreNameType.Quest, "Id"));
        }
コード例 #9
0
        public static string Npc()
        {
            if (Storage.UnitTemplates.IsEmpty)
            {
                return(String.Empty);
            }

            var entries     = Storage.UnitTemplates.Keys.ToList();
            var templatesDb = SQLDatabase.GetDict <uint, UnitTemplate>(entries);

            return(SQLUtil.CompareDicts(Storage.UnitTemplates, templatesDb, StoreNameType.Unit));
        }
コード例 #10
0
        public static string SpellsX()
        {
            if (Storage.SpellsX.IsEmpty())
            {
                return(String.Empty);
            }

            var entries   = Storage.SpellsX.Keys();
            var spellsXDb = SQLDatabase.GetDict <uint, SpellsX>(entries);

            return(SQLUtil.CompareDicts(Storage.SpellsX, spellsXDb, StoreNameType.Unit));
        }
コード例 #11
0
ファイル: QuestMisc.cs プロジェクト: Kinzcool/WowPacketParser
        public static string QuestReward()
        {
            if (Storage.QuestRewards.IsEmpty())
            {
                return(String.Empty);
            }

            var entries  = Storage.QuestRewards.Keys();
            var rewardDb = SQLDatabase.GetDict <uint, QuestReward>(entries, "Id");

            return(SQLUtil.CompareDicts(Storage.QuestRewards, rewardDb, StoreNameType.Quest, "Id"));
        }
コード例 #12
0
        public static string PageText()
        {
            if (Storage.PageTexts.IsEmpty())
                return String.Empty;

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.page_text))
                return string.Empty;

            var entries = Storage.PageTexts.Keys();
            var templatesDb = SQLDatabase.GetDict<uint, PageText>(entries, "ID");

            return SQLUtil.CompareDicts(Storage.PageTexts, templatesDb, StoreNameType.PageText, "ID");
        }
コード例 #13
0
        public static string Npc()
        {
            if (Storage.UnitTemplates.IsEmpty())
                return String.Empty;

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.creature_template))
                return string.Empty;

            var entries = Storage.UnitTemplates.Keys();
            var templatesDb = SQLDatabase.GetDict<uint, UnitTemplate>(entries);

            return SQLUtil.CompareDicts(Storage.UnitTemplates, templatesDb, StoreNameType.Unit);
        }
コード例 #14
0
        public static string QuestWod()
        {
            if (Storage.QuestTemplatesWod.IsEmpty())
                return String.Empty;

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.quest_template))
                return string.Empty;

            var entries = Storage.QuestTemplatesWod.Keys();
            var templatesDb = SQLDatabase.GetDict<uint, QuestTemplateWod>(entries, "Id");

            return SQLUtil.CompareDicts(Storage.QuestTemplatesWod, templatesDb, StoreNameType.Quest, "Id");
        }
コード例 #15
0
        public static string ModelData(Dictionary <Guid, Unit> units)
        {
            if (units.Count == 0)
            {
                return(string.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.creature_model_info))
            {
                return(string.Empty);
            }

            // Build a dictionary with model data; model is the key
            var models = new StoreDictionary <uint, ModelData>();

            foreach (var npc in units.Select(unit => unit.Value))
            {
                uint modelId;
                if (npc.Model.HasValue)
                {
                    modelId = npc.Model.Value;
                }
                else
                {
                    continue;
                }

                // Do not add duplicate models
                if (models.ContainsKey(modelId))
                {
                    continue;
                }

                float scale = npc.Size.GetValueOrDefault(1.0f);
                var   model = new ModelData
                {
                    BoundingRadius = npc.BoundingRadius.GetValueOrDefault(0.306f) / scale,
                    CombatReach    = npc.CombatReach.GetValueOrDefault(1.5f) / scale,
                    Gender         = npc.Gender.GetValueOrDefault(Gender.Male)
                };

                models.Add(modelId, model, null);
            }

            var entries  = models.Keys();
            var modelsDb = SQLDatabase.GetDict <uint, ModelData>(entries, "modelid");

            return(SQLUtil.CompareDicts(models, modelsDb, StoreNameType.None, "modelid"));
        }
コード例 #16
0
ファイル: Miscellaneous.cs プロジェクト: xerkoss/Project-WoW
        // Non-WDB data but nevertheless data that should be saved to gameobject_template
        public static string GameobjectTemplateNonWDB(Dictionary <Guid, GameObject> gameobjects)
        {
            if (gameobjects.Count == 0)
            {
                return(string.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.gameobject_template))
            {
                return(string.Empty);
            }

            var templates = new StoreDictionary <uint, GameObjectTemplateNonWDB>();

            foreach (var goT in gameobjects)
            {
                if (templates.ContainsKey(goT.Key.GetEntry()))
                {
                    continue;
                }

                var go       = goT.Value;
                var template = new GameObjectTemplateNonWDB
                {
                    Size    = go.Size.GetValueOrDefault(1.0f),
                    Faction = go.Faction.GetValueOrDefault(0),
                    Flags   = go.Flags.GetValueOrDefault(GameObjectFlag.None)
                };

                if (template.Faction == 1 || template.Faction == 2 || template.Faction == 3 ||
                    template.Faction == 4 || template.Faction == 5 || template.Faction == 6 ||
                    template.Faction == 115 || template.Faction == 116 || template.Faction == 1610 ||
                    template.Faction == 1629 || template.Faction == 2203 || template.Faction == 2204) // player factions
                {
                    template.Faction = 0;
                }

                template.Flags &= ~GameObjectFlag.Triggered;
                template.Flags &= ~GameObjectFlag.Damaged;
                template.Flags &= ~GameObjectFlag.Destroyed;

                templates.Add(goT.Key.GetEntry(), template, null);
            }

            var templatesDb = SQLDatabase.GetDict <uint, GameObjectTemplateNonWDB>(templates.Keys());

            return(SQLUtil.CompareDicts(templates, templatesDb, StoreNameType.GameObject));
        }
コード例 #17
0
ファイル: DB2.cs プロジェクト: danlapps/WowPacketParser
        public static string SpellMisc()
        {
            if (Storage.SpellMiscs.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.spell_misc))
            {
                return(string.Empty);
            }

            var entries     = Storage.SpellMiscs.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, SpellMisc>(entries, "Id", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.SpellMiscs, templatesDb, StoreNameType.None));
        }
コード例 #18
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string BroadcastText()
        {
            if (Storage.BroadcastTexts.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.broadcast_text))
            {
                return(String.Empty);
            }

            var entries     = Storage.BroadcastTexts.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, BroadcastText>(entries, "Id", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.BroadcastTexts, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #19
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string Toy()
        {
            if (Storage.Toys.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.toy))
            {
                return(String.Empty);
            }

            var entries     = Storage.Toys.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, Toy>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.Toys, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #20
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string BattlePetSpecies()
        {
            if (Storage.BattlePetSpecies.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.battle_pet_species))
            {
                return(String.Empty);
            }

            var entries     = Storage.BattlePetSpecies.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, BattlePetSpecies>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.BattlePetSpecies, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #21
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string SpellEffectGroupSize()
        {
            if (Storage.SpellEffectGroupSizes.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.spell_effect_group_size))
            {
                return(String.Empty);
            }

            var entries     = Storage.SpellEffectGroupSizes.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, SpellEffectGroupSize>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.SpellEffectGroupSizes, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #22
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string OverrideSpellData()
        {
            if (Storage.OverrideSpellDatas.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.override_spell_data))
            {
                return(String.Empty);
            }

            var entries     = Storage.OverrideSpellDatas.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, OverrideSpellData>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.OverrideSpellDatas, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #23
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string SpellClassOptions()
        {
            if (Storage.SpellClassOptions.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.spell_class_options))
            {
                return(String.Empty);
            }

            var entries     = Storage.SpellClassOptions.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, SpellClassOptions>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.SpellClassOptions, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #24
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string ItemSparse()
        {
            if (Storage.ItemSparses.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.item_sparse))
            {
                return(String.Empty);
            }

            var entries     = Storage.ItemSparses.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, ItemSparse>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.ItemSparses, templatesDb, StoreNameType.Item, "ID"));
        }
コード例 #25
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string ItemModifiedAppearance()
        {
            if (Storage.ItemModifiedAppearances.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.item_extended_cost))
            {
                return(String.Empty);
            }

            var entries     = Storage.ItemModifiedAppearances.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, ItemModifiedAppearance>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.ItemModifiedAppearances, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #26
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string ChrUpgradeBucketSpell()
        {
            if (Storage.ChrUpgradeBucketSpells.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.chr_upgrade))
            {
                return(String.Empty);
            }

            var entries     = Storage.ChrUpgradeBucketSpells.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, ChrUpgradeBucketSpell>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.ChrUpgradeBucketSpells, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #27
0
ファイル: DB2.cs プロジェクト: rushgun/WowPacketParser
        public static string HotfixData()
        {
            if (Storage.HotfixDatas.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.HotfixSQLOutputFlag.HasAnyFlagBit(HotfixSQLOutput.hotfix_data))
            {
                return(String.Empty);
            }

            var entries     = Storage.HotfixDatas.Keys();
            var templatesDb = SQLDatabase.GetDict <DB2Hash, int, uint, HotfixData>(entries, "TableHash", "RecordID", "Timestamp", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.HotfixDatas, templatesDb, StoreNameType.None, StoreNameType.None, StoreNameType.None, "TableHash", "RecordID", "Timestamp"));
        }
コード例 #28
0
ファイル: DB2.cs プロジェクト: danlapps/WowPacketParser
        public static string GameObjectDB2()
        {
            if (Storage.GameObjectTemplateDB2s.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.gameobject_template))
            {
                return(string.Empty);
            }

            var entries     = Storage.GameObjectTemplateDB2s.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, GameObjectTemplateDB2>(entries, "Id", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.GameObjectTemplateDB2s, templatesDb, StoreNameType.GameObject));
        }
コード例 #29
0
ファイル: DB2.cs プロジェクト: danlapps/WowPacketParser
        public static string CurvePoint()
        {
            if (Storage.CurvePoints.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.curve_point))
            {
                return(string.Empty);
            }

            var entries     = Storage.CurvePoints.Keys();
            var templatesDb = SQLDatabase.GetDict <uint, CurvePoint>(entries, "ID", Settings.HotfixesDatabase);

            return(SQLUtil.CompareDicts(Storage.CurvePoints, templatesDb, StoreNameType.None, "ID"));
        }
コード例 #30
0
ファイル: UnitMisc.cs プロジェクト: wayt/WowPacketParser
        public static string SpellsX()
        {
            if (Storage.SpellsX.IsEmpty())
            {
                return(String.Empty);
            }

            if (!Settings.SQLOutputFlag.HasAnyFlagBit(SQLOutput.creature_template))
            {
                return(string.Empty);
            }

            var entries   = Storage.SpellsX.Keys();
            var spellsXDb = SQLDatabase.GetDict <uint, SpellsX>(entries);

            return(SQLUtil.CompareDicts(Storage.SpellsX, spellsXDb, StoreNameType.Unit));
        }