-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathStructures.vb
1104 lines (965 loc) · 39.2 KB
/
Structures.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.IO
Imports System.Windows.Forms
Imports System.Xml
Imports System.Runtime.InteropServices
Imports System.Reflection
Public Class Structures
Public Class c_Groups
Public _GroupID As Integer
Public _GroupName As String
Public Property Group() As Integer
Get
Return Me._GroupID
End Get
Set(value As Integer)
Me._GroupID = value
End Set
End Property
Public Property GroupName() As String
Get
Return Me._GroupName
End Get
Set(value As String)
Me._GroupName = value
End Set
End Property
Public Sub New(GroupID__1 As String, GroupName As String)
Dim groupID__2 As Integer = -1
Integer.TryParse(GroupID__1, groupID__2)
Me._GroupID = groupID__2
Me._GroupName = GroupName
End Sub
End Class
Public Class c_ItemSlot
Public _Index As Integer
Public _Name As String
Public Property Index() As Integer
Get
Return Me._Index
End Get
Set(value As Integer)
Me._Index = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(ID As Integer, Name As String)
Me._Index = ID
Me._Name = Name
End Sub
End Class
Public Class c_ItemType
Public _Index As Integer
Public _Name As String
Public Property Index() As Integer
Get
Return Me._Index
End Get
Set(value As Integer)
Me._Index = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(ID As Integer, Name As String)
Me._Index = ID
Me._Name = Name
End Sub
End Class
Public Class c_CharClass
Public _Index As String
Public _Name As String
Public Property Index() As String
Get
Return Me._Index
End Get
Set(value As String)
Me._Index = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(Index As String, Name As String)
Me._Index = Index
Me._Name = Name
End Sub
Public Overloads Function Equals(tmpTP As c_CharClass) As Boolean
If tmpTP Is Nothing Then
Return False
End If
Return (Me._Index.Equals(tmpTP._Index))
End Function
Public Overrides Function Equals(objTemp As Object) As Boolean
If objTemp Is Nothing Then Return False
Dim objTP As c_CharClass = TryCast(objTemp, c_CharClass)
If objTP Is Nothing Then
Return False
Else
Return Equals(objTP)
End If
End Function
End Class
Public Class c_SocketData
Public _ID As Integer
Public _Name As String
Public Property ID() As Integer
Get
Return Me._ID
End Get
Set(value As Integer)
Me._ID = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(ID As Integer, Name As String)
Me._ID = ID
Me._Name = Name
End Sub
End Class
Public Class c_ElementData
Public _ID As Integer
Public _Name As String
Public Property ID() As Integer
Get
Return Me._ID
End Get
Set(value As Integer)
Me._ID = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(ID As Integer, Name As String)
Me._ID = ID
Me._Name = Name
End Sub
End Class
Public Class c_LevelData
Public _LevelID As Integer
Public _LevelName As String
Public Property ID() As Integer
Get
Return Me._LevelID
End Get
Set(value As Integer)
Me._LevelID = value
End Set
End Property
Public Property Name() As String
Get
Return Me._LevelName
End Get
Set(value As String)
Me._LevelName = value
End Set
End Property
Public Sub New(ID As Integer, Name As String)
Me._LevelID = ID
Me._LevelName = Name
End Sub
End Class
Public Structure c_OptionData
Public Property ID() As Integer
Get
Return m_ID
End Get
Set(value As Integer)
m_ID = value
End Set
End Property
Private m_ID As Integer
Public Property Name() As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Name As String
End Structure
Public Class c_AncientNames
Public _Index As Integer
Public _Name As String
Public Property Index() As Integer
Get
Return Me._Index
End Get
Set(value As Integer)
Me._Index = value
End Set
End Property
Public Property Name() As String
Get
Return Me._Name
End Get
Set(value As String)
Me._Name = value
End Set
End Property
Public Sub New(Index As Integer, Name As String)
Me._Index = Index
Me._Name = Name
End Sub
Public Function ShallowCopy() As c_AncientNames
Return DirectCast(Me.MemberwiseClone(), c_AncientNames)
End Function
End Class
Public Class c_AncientItems
Public _Cat As Integer
Public _Item_index As Integer
Public _IndexT1 As Integer
Public _IndexT2 As Integer
Public Property Cat() As Integer
Get
Return Me._Cat
End Get
Set(value As Integer)
Me._Cat = value
End Set
End Property
Public Property Item_index() As Integer
Get
Return Me._Item_index
End Get
Set(value As Integer)
Me._Item_index = value
End Set
End Property
Public Property IndexT1() As Integer
Get
Return Me._IndexT1
End Get
Set(value As Integer)
Me._IndexT1 = value
End Set
End Property
Public Property IndexT2() As Integer
Get
Return Me._IndexT2
End Get
Set(value As Integer)
Me._IndexT2 = value
End Set
End Property
Public Sub New(Cat As Integer, Item_index As Integer, IndexT1 As Integer, IndexT2 As Integer)
Me._Cat = Cat
Me._Item_index = Item_index
Me._IndexT1 = IndexT1
Me._IndexT2 = IndexT2
End Sub
Public Function ShallowCopy() As c_AncientItems
Return DirectCast(Me.MemberwiseClone(), c_AncientItems)
End Function
End Class
Public Class CustomPictureBox
Inherits PictureBox
Private _MSBType As Integer
Private colorBorder As Color = Color.Transparent
Public Property BorderColor() As Color
Get
Return Me.colorBorder
End Get
Set(value As Color)
Me.colorBorder = value
End Set
End Property
Public Property MSBType() As Integer
Get
Return Me._MSBType
End Get
Set(value As Integer)
Me._MSBType = value
End Set
End Property
Public Sub New()
MyBase.SetStyle(ControlStyles.UserPaint, True)
End Sub
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
e.Graphics.DrawRectangle(New Pen(New SolidBrush(Me.colorBorder), 4.0F), e.ClipRectangle)
End Sub
End Class
Public Class CustomToolTip
Inherits ToolTip
Private _sizeX As Integer = 230
Private _sizeY As Integer = 140
#Region " To disable dropshadow"
Dim exstyle2 As Integer = GetClassLongPtr32(Handle, GCL_STYLE)
<System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint:="GetClassLong")>
Public Shared Function GetClassLongPtr32(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer
End Function
<System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint:="SetClassLong")>
Public Shared Function SetClassLongPtr32(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
End Function
Private Const GCL_STYLE As Integer = -26
Private Const CS_DROPSHADOW As Integer = &H20000
Public ReadOnly Property Handle() As IntPtr
Get
Dim obj As Object
Dim hwnd As IntPtr
Try
hwnd = IntPtr.Zero
obj = GetType(ToolTip).InvokeMember("Handle", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.GetProperty, Nothing, Me, Nothing)
hwnd = CType(obj, IntPtr)
Catch ex As Exception
End Try
Return hwnd
End Get
End Property
#End Region
#Region " To correctly show transparent background"
<DllImport("user32.dll")>
Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As Rectangle) As Boolean
End Function
Private Function GetWindowRect() As Rectangle
Dim rect As Rectangle = New Rectangle
Dim window As NativeWindow = TryCast(GetType(ToolTip).GetField("window", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me), NativeWindow)
GetWindowRect(window.Handle, rect)
Return rect
End Function
#End Region
Public Property sizeX() As Integer
Get
Return Me._sizeX
End Get
Set(value As Integer)
Me._sizeX = value
End Set
End Property
Public Property sizeY() As Integer
Get
Return Me._sizeY
End Get
Set(value As Integer)
Me._sizeY = value
End Set
End Property
Public Sub New()
MyBase.OwnerDraw = True
' Disable dropshadow
If (exstyle2 And CS_DROPSHADOW) = CS_DROPSHADOW Then
exstyle2 -= CS_DROPSHADOW
End If
SetClassLongPtr32(Handle, GCL_STYLE, exstyle2)
AddHandler MyBase.Popup, New PopupEventHandler(AddressOf Me.OnPopup)
AddHandler MyBase.Draw, New DrawToolTipEventHandler(AddressOf Me.OnDraw)
End Sub
Private Sub OnDraw(sender As Object, e As DrawToolTipEventArgs)
Dim graphics As Graphics = e.Graphics
' Correctly show transparent background
graphics.SmoothingMode = SmoothingMode.AntiAlias
Dim windowRect As Rectangle = GetWindowRect()
graphics.CopyFromScreen(windowRect.Left, windowRect.Top, 0, 0, New Size(e.Bounds.Width, e.Bounds.Height))
Dim semiTransBrush As New SolidBrush(Color.FromArgb(92, 0, 0, 0))
graphics.FillRectangle(semiTransBrush, e.Bounds)
Dim stringFormat As New StringFormat()
stringFormat.Alignment = StringAlignment.Center
Dim rect As New Rectangle(0, 0, e.Bounds.Width, e.Bounds.Height)
graphics.DrawString(e.ToolTipText, e.Font, Brushes.White, rect, stringFormat)
semiTransBrush.Dispose()
End Sub
Private Sub OnPopup(sender As Object, e As PopupEventArgs)
e.ToolTipSize = New Size(Me._sizeX, Me._sizeY)
End Sub
End Class
Public Structure ItemSearchStuct
Private m_ItemName As String
Private m_ItemCategory As Integer
Private m_ItemIndex As Integer
Public Property ItemName() As String
Get
Return m_ItemName
End Get
Set(value As String)
m_ItemName = value
End Set
End Property
Public Property ItemCategory() As Integer
Get
Return m_ItemCategory
End Get
Set(value As Integer)
m_ItemCategory = value
End Set
End Property
Public Property ItemIndex() As Integer
Get
Return m_ItemIndex
End Get
Set(value As Integer)
m_ItemIndex = value
End Set
End Property
End Structure
Public Structure ShopItem
Public ShopLocX As Integer
Public ShopLocY As Integer
Public UniqName As String
Public Group As Integer
Public Index As Integer
Public Property Level() As Byte
Get
Return m_Level
End Get
Set(value As Byte)
m_Level = value
End Set
End Property
Private m_Level As Byte
Public Property Durablity() As Byte
Get
Return m_Durablity
End Get
Set(value As Byte)
m_Durablity = value
End Set
End Property
Private m_Durablity As Byte
Public Property Skill() As Boolean
Get
Return m_Skill
End Get
Set(value As Boolean)
m_Skill = value
End Set
End Property
Private m_Skill As Boolean
Public Property Luck() As Boolean
Get
Return m_Luck
End Get
Set(value As Boolean)
m_Luck = value
End Set
End Property
Private m_Luck As Boolean
Public Property [Option]() As Byte
Get
Return m_Option
End Get
Set(value As Byte)
m_Option = value
End Set
End Property
Private m_Option As Byte
Public Property Excellent() As Byte
Get
Return m_Excellent
End Get
Set(value As Byte)
m_Excellent = value
End Set
End Property
Private m_Excellent As Byte
Public Property Ancient() As Byte
Get
Return m_Ancient
End Get
Set(value As Byte)
m_Ancient = value
End Set
End Property
Private m_Ancient As Byte
Public Property Socket() As Byte
Get
Return m_socket
End Get
Set(value As Byte)
m_socket = value
End Set
End Property
Private m_socket As Byte
Public Property Element() As Byte
Get
Return m_element
End Get
Set(value As Byte)
m_element = value
End Set
End Property
Private m_element As Byte
Public Property Serial() As Boolean
Get
Return m_serial
End Get
Set(value As Boolean)
m_serial = value
End Set
End Property
Private m_serial As Boolean
End Structure
Public Structure UniItem
Public Property Group() As Integer
Get
Return m_Group
End Get
Set(value As Integer)
m_Group = value
End Set
End Property
Private m_Group As Integer
Public Property Index() As Integer
Get
Return m_Index
End Get
Set(value As Integer)
m_Index = value
End Set
End Property
Private m_Index As Integer
Public Property Slot() As Integer
Get
Return m_Slot
End Get
Set(value As Integer)
m_Slot = value
End Set
End Property
Private m_Slot As Integer
Public Property Skill() As Integer
Get
Return m_Skill
End Get
Set(value As Integer)
m_Skill = value
End Set
End Property
Private m_Skill As Integer
Public Property X() As Integer
Get
Return m_X
End Get
Set(value As Integer)
m_X = value
End Set
End Property
Private m_X As Integer
Public Property Y() As Integer
Get
Return m_Y
End Get
Set(value As Integer)
m_Y = value
End Set
End Property
Private m_Y As Integer
Public Property [Option]() As Integer
Get
Return m_Option
End Get
Set(value As Integer)
m_Option = value
End Set
End Property
Private m_Option As Integer
Public Property Name() As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Name As String
Public Property Durability() As Integer
Get
Return m_Durability
End Get
Set(value As Integer)
m_Durability = value
End Set
End Property
Private m_Durability As Integer
Public Property Ancient() As c_AncientItems
Get
Return m_Ancient
End Get
Set(value As c_AncientItems)
m_Ancient = value
End Set
End Property
Private m_Ancient As c_AncientItems
Public Property Type() As Integer
Get
Return m_Type
End Get
Set(value As Integer)
m_Type = value
End Set
End Property
Private m_Type As Integer
Public Property CharClass() As List(Of Structures.c_CharClass)
Get
Return m_CharClass
End Get
Set(value As List(Of Structures.c_CharClass))
m_CharClass = value
End Set
End Property
Private m_CharClass As List(Of Structures.c_CharClass)
End Structure
Private Function CheckNodeAttribute(ByVal node As XmlNode, attribute As String) As String
If node.Attributes(attribute) IsNot Nothing Then
Return node.Attributes(attribute).InnerText
End If
Return "0"
End Function
Public Sub ReadItemSetOption(fLocation As String, ByRef L_AncientNames As List(Of Structures.c_AncientNames))
Dim index As String
Dim name As String
Dim settings As New XmlReaderSettings
settings.IgnoreComments = True
Dim reader As XmlReader = XmlReader.Create(fLocation, settings)
Dim xmlDoc As New XmlDocument
Dim SetItem As XmlNodeList
xmlDoc.Load(reader)
SetItem = xmlDoc.GetElementsByTagName("SetItem")
For xml_setitem As Integer = 0 To SetItem.Count - 1
index = SetItem(xml_setitem).Attributes("Index").InnerText
name = SetItem(xml_setitem).Attributes("Name").InnerText
L_AncientNames.Add(New Structures.c_AncientNames(Convert.ToInt32(index), name))
Next
reader.Close()
End Sub
Public Sub ReadItemSetType(fLocation As String, ByRef L_Ancient As List(Of Structures.c_AncientItems))
Dim cat As String
Dim item_index As String
Dim indext1 As String
Dim indext2 As String
Dim settings As New XmlReaderSettings
settings.IgnoreComments = True
Dim reader As XmlReader = XmlReader.Create(fLocation, settings)
Dim xmlDoc As New XmlDocument
Dim Sections As XmlNodeList
Dim Items As XmlNodeList
xmlDoc.Load(reader)
Sections = xmlDoc.GetElementsByTagName("Section")
For xml_section As Integer = 0 To Sections.Count - 1
If Sections(xml_section).Attributes("DropRate") IsNot Nothing Then
Continue For
End If
cat = Sections(xml_section).Attributes("Index").InnerText
Items = Sections(xml_section).ChildNodes
For xml_item As Integer = 0 To Items.Count - 1
item_index = CheckNodeAttribute(Items(xml_item), "Index")
indext1 = CheckNodeAttribute(Items(xml_item), "TierI")
indext2 = CheckNodeAttribute(Items(xml_item), "TierII")
L_Ancient.Add(New Structures.c_AncientItems(Convert.ToInt32(cat),
Convert.ToInt32(item_index),
Convert.ToInt32(indext1),
Convert.ToInt32(indext2)))
Next
Next
reader.Close()
End Sub
Public Sub ReadItemList(fLocation As String, ByRef L_Groups As List(Of Structures.c_Groups),
ByRef L_Swords As List(Of Structures.UniItem),
ByRef L_Axes As List(Of Structures.UniItem),
ByRef L_MacesScepters As List(Of Structures.UniItem),
ByRef L_Spears As List(Of Structures.UniItem),
ByRef L_BowsCrossBows As List(Of Structures.UniItem),
ByRef L_Staffs As List(Of Structures.UniItem),
ByRef L_Shields As List(Of Structures.UniItem),
ByRef L_Helms As List(Of Structures.UniItem),
ByRef L_Armors As List(Of Structures.UniItem),
ByRef L_Pants As List(Of Structures.UniItem),
ByRef L_Gloves As List(Of Structures.UniItem),
ByRef L_Boots As List(Of Structures.UniItem),
ByRef L_WingsSkillsSeedsOther As List(Of Structures.UniItem),
ByRef L_Others1 As List(Of Structures.UniItem),
ByRef L_Others2 As List(Of Structures.UniItem),
ByRef L_Scrolls As List(Of Structures.UniItem),
ByRef ItemName As String(,),
ByRef ItemSize As String(,),
ByRef L_Ancient As List(Of Structures.c_AncientItems),
ByRef L_AncientNames As List(Of Structures.c_AncientNames),
ByRef L_SearchItems As List(Of Structures.ItemSearchStuct),
ByVal L_CharClassDatas As List(Of Structures.c_CharClass))
Dim group_index As String = ""
Dim group_name As String = ""
Dim item_index As String = ""
Dim item_slot As String = ""
Dim item_skill As String = ""
Dim item_x As String = ""
Dim item_y As String = ""
Dim item_option As String = ""
Dim item_durability As String = ""
Dim item_ancient As c_AncientItems
Dim item_name As String = ""
Dim item_type As String = ""
Try
Dim settings As New XmlReaderSettings
settings.IgnoreComments = True
Dim reader As XmlReader = XmlReader.Create(fLocation, settings)
Dim xmlDoc As New XmlDocument
Dim Sections As XmlNodeList
Dim Items As XmlNodeList
xmlDoc.Load(reader)
Sections = xmlDoc.GetElementsByTagName("Section")
For xml_section As Integer = 0 To Sections.Count - 1
group_index = Sections(xml_section).Attributes("Index").InnerText
group_name = Sections(xml_section).Attributes("Name").InnerText
L_Groups.Add(New Structures.c_Groups(group_index, group_name))
Items = Sections(xml_section).ChildNodes
For xml_item As Integer = 0 To Items.Count - 1
item_index = CheckNodeAttribute(Items(xml_item), "Index")
item_slot = CheckNodeAttribute(Items(xml_item), "Slot")
item_skill = CheckNodeAttribute(Items(xml_item), "SkillIndex")
item_x = CheckNodeAttribute(Items(xml_item), "Width")
item_y = CheckNodeAttribute(Items(xml_item), "Height")
item_option = CheckNodeAttribute(Items(xml_item), "Option")
item_durability = CheckNodeAttribute(Items(xml_item), "Durability")
item_type = CheckNodeAttribute(Items(xml_item), "Type")
Dim gi As Integer = Convert.ToInt32(group_index)
Dim ii As Integer = Convert.ToInt32(item_index)
item_ancient = L_Ancient.Find(Function(ancient) ancient.Cat = gi And ancient.Item_index = ii)
Dim cc As New List(Of String)
Dim item_charclass As New List(Of c_CharClass)
cc.Add(CheckNodeAttribute(Items(xml_item), "DarkKnight"))
cc.Add(CheckNodeAttribute(Items(xml_item), "FairyElf"))
cc.Add(CheckNodeAttribute(Items(xml_item), "DarkWizard"))
cc.Add(CheckNodeAttribute(Items(xml_item), "MagicGladiator"))
cc.Add(CheckNodeAttribute(Items(xml_item), "DarkLord"))
cc.Add(CheckNodeAttribute(Items(xml_item), "Summoner"))
cc.Add(CheckNodeAttribute(Items(xml_item), "RageFighter"))
For i As Integer = 0 To cc.Count - 1
If cc.Item(i) <> "0" Then
Dim c As String = i.ToString
Dim e As String = cc.Item(i)
Dim found As c_CharClass = L_CharClassDatas.Find(Function(charclass) charclass.Index = c & e)
If found IsNot Nothing Then
item_charclass.Add(found)
End If
End If
Next
item_name = CheckNodeAttribute(Items(xml_item), "Name")
Dim item As New Structures.UniItem() With {
.Group = Convert.ToInt32(group_index),
.Index = Convert.ToInt32(item_index),
.Slot = Convert.ToInt32(item_slot),
.Skill = Convert.ToInt32(item_skill),
.X = Convert.ToInt32(item_x),
.Y = Convert.ToInt32(item_y),
.[Option] = Convert.ToInt32(item_option),
.Durability = Convert.ToInt16(item_durability),
.Ancient = If(item_ancient IsNot Nothing, item_ancient.ShallowCopy, Nothing),
.Name = item_name,
.Type = Convert.ToInt16(item_type),
.CharClass = item_charclass
}
Dim searchItem As New Structures.ItemSearchStuct() With {
.ItemName = item_name,
.ItemCategory = Convert.ToInt32(group_index),
.ItemIndex = Convert.ToInt32(item_index)
}
L_SearchItems.Add(searchItem)
Select Case item.Group
Case 0
L_Swords.Add(item)
Exit Select
Case 1
L_Axes.Add(item)
Exit Select
Case 2
L_MacesScepters.Add(item)
Exit Select
Case 3
L_Spears.Add(item)
Exit Select
Case 4
L_BowsCrossBows.Add(item)
Exit Select
Case 5
L_Staffs.Add(item)
Exit Select
Case 6
L_Shields.Add(item)
Exit Select
Case 7
L_Helms.Add(item)
Exit Select
Case 8
L_Armors.Add(item)
Exit Select
Case 9
L_Pants.Add(item)
Exit Select
Case 10
L_Gloves.Add(item)
Exit Select
Case 11
L_Boots.Add(item)
Exit Select
Case 12
L_WingsSkillsSeedsOther.Add(item)
Exit Select
Case 13
L_Others1.Add(item)
Exit Select
Case 14
L_Others2.Add(item)
Exit Select
Case 15
L_Scrolls.Add(item)
Exit Select
End Select
If ItemName IsNot Nothing Then
ItemName(item.Group, item.Index) = item.Name
End If
If ItemSize IsNot Nothing Then
ItemSize(item.Group, item.Index) = item.X & "x" & item.Y
End If
Next xml_item
Next xml_section
Catch ex As Exception
MessageBox.Show(ex.Message, "[ReadItemList] ERROR")
Application.[Exit]()
End Try
End Sub
Public Sub Setc_LevelData(ByRef c_LevelDatas As List(Of Structures.c_LevelData), Optional ByVal MaxLevel As Integer = 15)
c_LevelDatas.Clear()
For i As Integer = 0 To MaxLevel
c_LevelDatas.Add(New Structures.c_LevelData(i, "+" & i.ToString))
Next
End Sub
Public Sub Setc_OptionData(ByRef c_OptionDatas As List(Of Structures.c_OptionData), Optional ByVal MaxOption As Integer = 7)
c_OptionDatas.Clear()
Dim item As New Structures.c_OptionData()
For i As Integer = 0 To MaxOption
item.ID = i
item.Name = "+" & i * 4
c_OptionDatas.Add(item)
Next
End Sub
Public Sub Setc_AncientNames(ByVal L_AncientNames As List(Of Structures.c_AncientNames),
ByVal Ancient_Indexes As Structures.c_AncientItems,