private static void ExportNpcs()
        {
            var dc = DCT.DataCenter;
            var strings = dc.Root.ChildrenByName("StrSheet_Creature")
                            .SelectMany(x => x.Children)
                            .SelectMany(
                                hz =>
                                hz.ChildrenByName("String").Select(
                                    str =>
                                    new
                                    {
                                        huntingZoneId = hz.Attribute<int>("id"),
                                        templateId = str.Attribute<int>("templateId"),
                                        String = str
                                    }))
                            .ToDictionary(x => x.huntingZoneId + "-" + x.templateId, x => x.String);
            var npcs = dc.Root.ChildrenByName("NpcData")
                        .SelectMany(x => x.Children)
                        .SelectMany(hz => hz.ChildrenByName("Template").Select(template => new
                        {
                            huntingZoneId = hz.Attribute("id"),
                            templateId = template.Attribute("id"),
                            Template = template
                        }));

            foreach (var npcData in npcs)
            {
                var stringData = strings[npcData.huntingZoneId + "-" + npcData.templateId];
                var templateData = npcData.Template;
                var npc = new DamageMeterNpc();
                npc.name = stringData.Attribute<string>("name");
                //npc.
            }
        }
Beispiel #2
0
        private static void ExportNpcs()
        {
            var dc      = DCT.DataCenter;
            var strings = dc.Root.ChildrenByName("StrSheet_Creature")
                          .SelectMany(x => x.Children)
                          .SelectMany(
                hz =>
                hz.ChildrenByName("String").Select(
                    str =>
                    new
            {
                huntingZoneId = hz.Attribute <int>("id"),
                templateId    = str.Attribute <int>("templateId"),
                String        = str
            }))
                          .ToDictionary(x => x.huntingZoneId + "-" + x.templateId, x => x.String);
            var npcs = dc.Root.ChildrenByName("NpcData")
                       .SelectMany(x => x.Children)
                       .SelectMany(hz => hz.ChildrenByName("Template").Select(template => new
            {
                huntingZoneId = hz.Attribute("id"),
                templateId    = template.Attribute("id"),
                Template      = template
            }));

            foreach (var npcData in npcs)
            {
                var stringData   = strings[npcData.huntingZoneId + "-" + npcData.templateId];
                var templateData = npcData.Template;
                var npc          = new DamageMeterNpc();
                npc.name = stringData.Attribute <string>("name");
                //npc.
            }
        }