@@ -20,27 +20,66 @@ public class ItemOptionParser {
2020 "mergematerial" ,
2121 "skin" ,
2222 ] ;
23- private readonly string [ ] randomSuffix = {
24- "12" , "13" , "14" , "15" , "16" , "17" , "18" , "19" ,
25- "20" , "21" , "22" ,
26- "30" , "31" , "32" , "33" , "34" ,
27- "40" , "41" ,
28- "50" , "51" , "52" , "53" , "54" , "54_pvp" , "55" , "56" ,
23+ private readonly string [ ] randomSuffix = [
24+ "12" ,
25+ "13" ,
26+ "14" ,
27+ "15" ,
28+ "16" ,
29+ "17" ,
30+ "18" ,
31+ "19" ,
32+ "20" ,
33+ "21" ,
34+ "22" ,
35+ "30" ,
36+ "31" ,
37+ "32" ,
38+ "33" ,
39+ "34" ,
40+ "40" ,
41+ "41" ,
42+ "50" ,
43+ "51" ,
44+ "52" ,
45+ "53" ,
46+ "54" ,
47+ "54_pvp" ,
48+ "55" ,
49+ "56" ,
2950 "accmanual" ,
3051 "armormanual" ,
3152 "pet_60" ,
3253 "weaponmanual" ,
33- } ;
34- private readonly string [ ] staticSuffix = {
35- "12" , "13" , "14" , "15" , "16" , "17" , "18" , "19" ,
36- "20" , "21" , "22" ,
37- "30" , "31" , "32" , "33" , "34" ,
38- "40" , "41" ,
39- "50" , "51" , "52" , "53" , "54" ,
54+ ] ;
55+ private readonly string [ ] staticSuffix = [
56+ "12" ,
57+ "13" ,
58+ "14" ,
59+ "15" ,
60+ "16" ,
61+ "17" ,
62+ "18" ,
63+ "19" ,
64+ "20" ,
65+ "21" ,
66+ "22" ,
67+ "30" ,
68+ "31" ,
69+ "32" ,
70+ "33" ,
71+ "34" ,
72+ "40" ,
73+ "41" ,
74+ "50" ,
75+ "51" ,
76+ "52" ,
77+ "53" ,
78+ "54" ,
4079 "armormanual" ,
4180 "mergematerial" ,
4281 "petequipment" ,
43- } ;
82+ ] ;
4483 private readonly string [ ] variationSuffix = [
4584 "acc" ,
4685 "armor" ,
@@ -50,7 +89,10 @@ public class ItemOptionParser {
5089
5190 private readonly M2dReader xmlReader ;
5291 private readonly XmlSerializer itemOptionConstantSerializer ;
92+ private readonly XmlSerializer itemOptionConstantKrSerializer ;
5393 private readonly XmlSerializer itemOptionSerializer ;
94+ private readonly XmlSerializer itemOptionKrSerializer ;
95+ private readonly XmlSerializer itemMergeOptionKrSerializer ;
5496 private readonly XmlSerializer itemMergeOptionSerializer ;
5597 private readonly XmlSerializer itemOptionPickSerializer ;
5698 private readonly XmlSerializer itemVariationSerializer ;
@@ -59,7 +101,10 @@ public class ItemOptionParser {
59101 public ItemOptionParser ( M2dReader xmlReader ) {
60102 this . xmlReader = xmlReader ;
61103 itemOptionConstantSerializer = new XmlSerializer ( typeof ( ItemOptionConstantRoot ) ) ;
104+ itemOptionConstantKrSerializer = new XmlSerializer ( typeof ( ItemOptionConstantRootKR ) ) ;
62105 itemOptionSerializer = new XmlSerializer ( typeof ( ItemOptionRoot ) ) ;
106+ itemOptionKrSerializer = new XmlSerializer ( typeof ( ItemOptionRandomRootKR ) ) ;
107+ itemMergeOptionKrSerializer = new XmlSerializer ( typeof ( ItemMergeOptionRootKR ) ) ;
63108 itemMergeOptionSerializer = new XmlSerializer ( typeof ( ItemMergeOptionRoot ) ) ;
64109 itemOptionPickSerializer = new XmlSerializer ( typeof ( ItemOptionPickRoot ) ) ;
65110 itemVariationSerializer = new XmlSerializer ( typeof ( ItemOptionVariation ) ) ;
@@ -82,6 +127,20 @@ public IEnumerable<ItemOptionConstantData> ParseConstant() {
82127 }
83128 }
84129
130+ public IEnumerable < ItemOptionConstant > ParseConstantKr ( ) {
131+ string xml = Sanitizer . RemoveEmpty ( xmlReader . GetString ( xmlReader . GetEntry ( "table/itemoptionconstant.xml" ) ) ) ;
132+ xml = Sanitizer . RemoveUtf8Bom ( xml ) ;
133+ var reader = XmlReader . Create ( new StringReader ( xml ) ) ;
134+ var root = itemOptionConstantKrSerializer . Deserialize ( reader ) as ItemOptionConstantRootKR ;
135+ Debug . Assert ( root != null ) ;
136+
137+ foreach ( ItemOptionConstant option in root . options ) {
138+ if ( option . code > 0 ) {
139+ yield return option ;
140+ }
141+ }
142+ }
143+
85144 public IEnumerable < ItemOptionData > ParseRandom ( ) {
86145 foreach ( string suffix in randomSuffix ) {
87146 string filename = $ "itemoption/option/random/itemoptionrandom_{ suffix } .xml";
@@ -98,6 +157,21 @@ public IEnumerable<ItemOptionData> ParseRandom() {
98157 }
99158 }
100159
160+ public IEnumerable < ItemOptionRandomKR > ParseRandomKr ( ) {
161+ string xml = Sanitizer . RemoveEmpty ( xmlReader . GetString ( xmlReader . GetEntry ( "table/itemoptionrandom.xml" ) ) ) ;
162+ xml = Sanitizer . RemoveUtf8Bom ( xml ) ;
163+ var reader = XmlReader . Create ( new StringReader ( xml ) ) ;
164+ var root = itemOptionKrSerializer . Deserialize ( reader ) as ItemOptionRandomRootKR ;
165+ Debug . Assert ( root != null ) ;
166+
167+ foreach ( ItemOptionRandomKR option in root . options ) {
168+ if ( option . code > 0 ) {
169+ yield return option ;
170+ }
171+ }
172+
173+ }
174+
101175 public IEnumerable < ItemOptionData > ParseStatic ( ) {
102176 foreach ( string suffix in staticSuffix ) {
103177 string filename = $ "itemoption/option/static/itemoptionstatic_{ suffix } .xml";
@@ -114,6 +188,18 @@ public IEnumerable<ItemOptionData> ParseStatic() {
114188 }
115189 }
116190
191+ public IEnumerable < MergeOptionKR > ParseMergeOptionBaseKr ( ) {
192+ string xml = Sanitizer . RemoveEmpty ( xmlReader . GetString ( xmlReader . GetEntry ( "table/itemmergeoptionbase.xml" ) ) ) ;
193+ xml = Sanitizer . RemoveUtf8Bom ( xml ) ;
194+ var reader = XmlReader . Create ( new StringReader ( xml ) ) ;
195+ var root = itemMergeOptionKrSerializer . Deserialize ( reader ) as ItemMergeOptionRootKR ;
196+ Debug . Assert ( root != null ) ;
197+
198+ foreach ( MergeOptionKR option in root . mergeOption ) {
199+ yield return option ;
200+ }
201+ }
202+
117203 public IEnumerable < MergeOption > ParseMergeOptionBase ( ) {
118204 string xml = Sanitizer . RemoveEmpty ( xmlReader . GetString ( xmlReader . GetEntry ( "table/itemmergeoptionbase.xml" ) ) ) ;
119205 var reader = XmlReader . Create ( new StringReader ( xml ) ) ;
0 commit comments