Example #1
0
        public static string ConversationTemplateData()
        {
            var conversations = Storage.Objects.IsEmpty()
                ? new Dictionary <WowGuid, ConversationTemplate>()                                       // empty dict if there are no objects
                : Storage.Objects.Where(
                obj =>
                obj.Value.Item1.Type == ObjectType.Conversation)
                                .OrderBy(pair => pair.Value.Item2)                                      // order by spawn time
                                .ToDictionary(obj => obj.Key, obj => obj.Value.Item1 as ConversationTemplate);

            if (conversations.Count == 0)
            {
                return(string.Empty);
            }

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

            var conversationsData = new DataBag <ConversationTemplate>();

            foreach (var conversation in conversations)
            {
                conversationsData.Add(conversation.Value);
            }

            var templateDb = SQLDatabase.Get(conversationsData);

            return(SQLUtil.Compare(Settings.SQLOrderByKey ? conversationsData.OrderBy(x => x.Item1.Id).ToArray() : conversationsData.ToArray(), templateDb, x => string.Empty));
        }
Example #2
0
        public static string AreaTriggerCreatePropertiesData()
        {
            var spellareatriggers = Storage.Objects.IsEmpty()
                ? new Dictionary <WowGuid, AreaTriggerCreateProperties>()                                        // empty dict if there are no objects
                : Storage.Objects.Where(
                obj =>
                obj.Value.Item1.Type == ObjectType.AreaTrigger &&
                !obj.Value.Item1.IsTemporarySpawn())                                                            // remove temporary spawns
                                    .OrderBy(pair => pair.Value.Item2)                                          // order by spawn time
                                    .ToDictionary(obj => obj.Key, obj => obj.Value.Item1 as AreaTriggerCreateProperties);

            if (spellareatriggers.Count == 0)
            {
                return(string.Empty);
            }

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

            var spellareatriggersData = new DataBag <AreaTriggerCreateProperties>();

            foreach (var spellareatrigger in spellareatriggers)
            {
                spellareatriggersData.Add(spellareatrigger.Value);
            }

            var templateDb = SQLDatabase.Get(spellareatriggersData);

            return(SQLUtil.Compare(Settings.SQLOrderByKey ? spellareatriggersData.OrderBy(x => x.Item1.AreaTriggerId).ToArray() : spellareatriggersData.ToArray(),
                                   templateDb,
                                   x =>
            {
                var comment = "SpellId : " + x.spellId.ToString();
                if ((x.AreaTriggerCreatePropertiesId & 0x80000000) != 0)
                {
                    comment += " CANNOT FIND PROPERTIES ID, USED SPELL ID AS KEY (NEEDS MANUAL CORRECTION)";
                }

                return comment;
            }));
        }
Example #3
0
        public static string SpellAreaTriggersData()
        {
            var spellareatriggers = Storage.Objects.IsEmpty()
                ? new Dictionary <WowGuid, SpellAreaTrigger>()                                                   // empty dict if there are no objects
                : Storage.Objects.Where(
                obj =>
                obj.Value.Item1.Type == ObjectType.AreaTrigger &&
                !obj.Value.Item1.IsTemporarySpawn())                                                            // remove temporary spawns
                                    .OrderBy(pair => pair.Value.Item2)                                          // order by spawn time
                                    .ToDictionary(obj => obj.Key, obj => obj.Value.Item1 as SpellAreaTrigger);

            if (spellareatriggers.Count == 0)
            {
                return(string.Empty);
            }

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

            var spellareatriggersData = new DataBag <SpellAreaTrigger>();

            foreach (var spellareatrigger in spellareatriggers)
            {
                spellareatriggersData.Add(spellareatrigger.Value);
            }

            var templateDb = SQLDatabase.Get(spellareatriggersData);

            return(SQLUtil.Compare(Settings.SQLOrderByKey ? spellareatriggersData.OrderBy(x => x.Item1.AreaTriggerId).ToArray() : spellareatriggersData.ToArray(), templateDb, x => "SpellId : " + x.spellId.ToString()));
        }