-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
FileIO.bas
3574 lines (2594 loc) · 138 KB
/
FileIO.bas
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
Attribute VB_Name = "ES"
' Argentum 20 Game Server
'
' Copyright (C) 2023 Noland Studios LTD
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program. If not, see <https://www.gnu.org/licenses/>.
'
' This program was based on Argentum Online 0.11.6
' Copyright (C) 2002 Márquez Pablo Ignacio
'
' Argentum Online is based on Baronsoft's VB6 Online RPG
' You can contact the original creator of ORE at [email protected]
' for more information about ORE please visit http://www.baronsoft.com/
'
'
'
Option Explicit
Const MAX_RANDOM_TELEPORT_IN_MAP = 20
Const FISHING_REQUIRED_PERCENT = 90
Const FISHING_TILES_ON_MAP = 10
Public Const FISHING_POOL_ID = 3740
Private Type t_Position
x As Integer
y As Integer
End Type
'Item type
Private Type t_Item
objIndex As Integer
amount As Integer
End Type
Private Type t_WorldPos
map As Integer
x As Byte
y As Byte
End Type
Private Type t_Grh
GrhIndex As Long
FrameCounter As Single
Speed As Single
Started As Byte
alpha_blend As Boolean
angle As Single
End Type
Private Type t_GrhData
sX As Integer
sY As Integer
filenum As Integer
pixelWidth As Integer
pixelHeight As Integer
TileWidth As Single
TileHeight As Single
NumFrames As Integer
Frames() As Integer
Speed As Integer
mini_map_color As Long
End Type
Private Type t_MapHeader
NumeroBloqueados As Long
NumeroLayers(1 To 4) As Long
NumeroTriggers As Long
NumeroLuces As Long
NumeroParticulas As Long
NumeroNPCs As Long
NumeroOBJs As Long
NumeroTE As Long
End Type
Private Type t_DatosBloqueados
x As Integer
y As Integer
Lados As Byte
End Type
Private Type t_DatosGrh
x As Integer
y As Integer
GrhIndex As Long
End Type
Private Type t_DatosTrigger
x As Integer
y As Integer
trigger As Integer
End Type
Private Type t_DatosLuces
x As Integer
y As Integer
Color As Long
Rango As Byte
End Type
Private Type t_DatosParticulas
x As Integer
y As Integer
Particula As Long
End Type
Private Type t_DatosNPC
x As Integer
y As Integer
npcIndex As Integer
End Type
Private Type t_DatosObjs
x As Integer
y As Integer
objIndex As Integer
ObjAmmount As Integer
End Type
Private Type t_DatosTE
x As Integer
y As Integer
DestM As Integer
DestX As Integer
DestY As Integer
End Type
Private Type t_MapSize
XMax As Integer
XMin As Integer
YMax As Integer
YMin As Integer
End Type
Private Type t_MapDat
map_name As String
backup_mode As Byte
restrict_mode As String
music_numberHi As Long
music_numberLow As Long
Seguro As Byte
zone As String
terrain As String
ambient As String
base_light As Long
letter_grh As Long
level As Long
extra2 As Long
Salida As String
lluvia As Byte
Nieve As Byte
niebla As Byte
End Type
Private MapSize As t_MapSize
Private MapDat As t_MapDat
Private FeatureToggles As Dictionary
Public Sub load_stats()
On Error GoTo error_load_stats
Dim n As Integer
Dim strFile As String
strFile = App.Path & "\logs\recordusers.log"
Dim str As String
If Not FileExist(strFile) Then
n = FreeFile()
Open strFile For Append As #n
Print #n, "1"
Close #n
End If
Debug.Assert FileExist(strFile)
n = FreeFile()
Open strFile For Input Shared As n
Line Input #n, str
RecordUsuarios = val(str)
Close #n
Exit Sub
error_load_stats:
Call TraceError(Err.Number, Err.Description, "ES.load_stats", Erl)
End Sub
Public Sub dump_stats()
On Error GoTo error_dump_stats
Dim n As Integer
n = FreeFile()
Open App.Path & "\logs\numusers.log" For Output Shared As n
Print #n, NumUsers
Close #n
n = FreeFile()
Open App.Path & "\logs\recordusers.log" For Output Shared As n
Print #n, str(RecordUsuarios)
Close #n
Exit Sub
error_dump_stats:
Call TraceError(Err.Number, Err.Description, "ES.error_dump_stats", Erl)
End Sub
Public Sub CargarSpawnList()
On Error GoTo CargarSpawnList_Err
Dim n As Integer, LoopC As Integer
100 n = val(GetVar(DatPath & "npcs.dat", "INIT", "NumNPCs"))
102 ReDim SpawnList(n) As t_CriaturasEntrenador
104 For LoopC = 1 To n
106 SpawnList(LoopC).npcIndex = LoopC
108 SpawnList(LoopC).NpcName = GetVar(DatPath & "npcs.dat", "NPC" & LoopC, "Name")
SpawnList(LoopC).PuedeInvocar = val(GetVar(DatPath & "npcs.dat", "NPC" & LoopC, "PuedeInvocar")) = 1
110 If Len(SpawnList(LoopC).NpcName) = 0 Then
112 SpawnList(LoopC).NpcName = "Nada"
End If
114 Next LoopC
Exit Sub
CargarSpawnList_Err:
116 Call TraceError(Err.Number, Err.Description, "ES.CargarSpawnList", Erl)
End Sub
Function EsAdmin(ByRef Name As String) As Boolean
'***************************************************
'Author: Unknown
'Last Modification: 27/03/2011
'27/03/2011 - ZaMa: Utilizo la clase para saber los datos.
'***************************************************
On Error GoTo EsAdmin_Err
100 EsAdmin = (val(Administradores.GetValue("Admin", Name)) = 1)
Exit Function
EsAdmin_Err:
102 Call TraceError(Err.Number, Err.Description, "ES.EsAdmin", Erl)
End Function
Function EsDios(ByRef Name As String) As Boolean
'***************************************************
'Author: Unknown
'Last Modification: 27/03/2011
'27/03/2011 - ZaMa: Utilizo la clase para saber los datos.
'***************************************************
On Error GoTo EsDios_Err
100 EsDios = (val(Administradores.GetValue("Dios", Name)) = 1)
Exit Function
EsDios_Err:
102 Call TraceError(Err.Number, Err.Description, "ES.EsDios", Erl)
End Function
Function EsSemiDios(ByRef Name As String) As Boolean
'***************************************************
'Author: Unknown
'Last Modification: 27/03/2011
'27/03/2011 - ZaMa: Utilizo la clase para saber los datos.
'***************************************************
On Error GoTo EsSemiDios_Err
100 EsSemiDios = (val(Administradores.GetValue("SemiDios", Name)) = 1)
Exit Function
EsSemiDios_Err:
102 Call TraceError(Err.Number, Err.Description, "ES.EsSemiDios", Erl)
End Function
Function EsConsejero(ByRef Name As String) As Boolean
'***************************************************
'Author: Unknown
'Last Modification: 27/03/2011
'27/03/2011 - ZaMa: Utilizo la clase para saber los datos.
'***************************************************
On Error GoTo EsConsejero_Err
100 EsConsejero = (val(Administradores.GetValue("Consejero", Name)) = 1)
Exit Function
EsConsejero_Err:
102 Call TraceError(Err.Number, Err.Description, "ES.EsConsejero", Erl)
End Function
Function EsRolesMaster(ByRef Name As String) As Boolean
'***************************************************
'Author: Unknown
'Last Modification: 27/03/2011
'27/03/2011 - ZaMa: Utilizo la clase para saber los datos.
'***************************************************
On Error GoTo EsRolesMaster_Err
100 EsRolesMaster = (val(Administradores.GetValue("RM", Name)) = 1)
Exit Function
EsRolesMaster_Err:
102 Call TraceError(Err.Number, Err.Description, "ES.EsRolesMaster", Erl)
End Function
Public Function EsGmChar(ByRef Name As String) As Boolean
'***************************************************
'Author: ZaMa
'Last Modification: 27/03/2011
'Returns true if char is administrative user.
'***************************************************
On Error GoTo EsGmChar_Err
Dim EsGM As Boolean
' Admin?
100 EsGM = EsAdmin(Name)
' Dios?
102 If Not EsGM Then EsGM = EsDios(Name)
' Semidios?
104 If Not EsGM Then EsGM = EsSemiDios(Name)
' Consejero?
106 If Not EsGM Then EsGM = EsConsejero(Name)
108 EsGmChar = EsGM
Exit Function
EsGmChar_Err:
110 Call TraceError(Err.Number, Err.Description, "ES.EsGmChar", Erl)
End Function
Public Sub loadAdministrativeUsers()
'Admines => Admin
'Dioses => Dios
'SemiDioses => SemiDios
'Especiales => Especial
'Consejeros => Consejero
'RoleMasters => RM
' If frmMain.Visible Then frmMain.txtStatus.Text = "Cargando Administradores/Dioses/Gms."
On Error GoTo loadAdministrativeUsers_Err
'Si esta mierda tuviese array asociativos el codigo seria tan lindo.
Dim buf As Integer
Dim i As Long
Dim Name As String
' Anti-choreo de GM's
100 Set AdministratorAccounts = New Dictionary
Dim TempName() As String
' Public container
102 Set Administradores = New clsIniManager
' Server ini info file
Dim ServerIni As clsIniManager
104 Set ServerIni = New clsIniManager
Debug.Assert FileExist(IniPath & "Server.ini")
106 Call ServerIni.Initialize(IniPath & "Server.ini")
' Admines
108 buf = val(ServerIni.GetValue("INIT", "Admines"))
110 For i = 1 To buf
112 Name = UCase$(ServerIni.GetValue("Admines", "Admin" & i))
114 TempName = Split(Name, "|", , vbTextCompare)
' Si NO declara el mail de la cuenta en el Server.ini, NO le doy privilegios.
116 If UBound(TempName()) > 0 Then
' AdministratorAccounts("Nick") = "Email"
118 AdministratorAccounts(TempName(0)) = TempName(1)
' Add key
120 Call Administradores.ChangeValue("Admin", TempName(0), "1")
End If
122 Next i
' Dioses
124 buf = val(ServerIni.GetValue("INIT", "Dioses"))
126 For i = 1 To buf
128 Name = UCase$(ServerIni.GetValue("Dioses", "Dios" & i))
130 TempName = Split(Name, "|", , vbTextCompare)
' Si NO declara el mail de la cuenta en el Server.ini, NO le doy privilegios.
132 If UBound(TempName()) > 0 Then
' AdministratorAccounts("Nick") = "Email"
134 AdministratorAccounts(TempName(0)) = TempName(1)
' Add key
136 Call Administradores.ChangeValue("Dios", TempName(0), "1")
End If
138 Next i
' SemiDioses
140 buf = val(ServerIni.GetValue("INIT", "SemiDioses"))
142 For i = 1 To buf
144 Name = UCase$(ServerIni.GetValue("SemiDioses", "SemiDios" & i))
146 TempName = Split(Name, "|", , vbTextCompare)
' Si NO declara el mail de la cuenta en el Server.ini, NO le doy privilegios.
148 If UBound(TempName()) > 0 Then
' AdministratorAccounts("Nick") = "Email"
150 AdministratorAccounts(TempName(0)) = TempName(1)
' Add key
152 Call Administradores.ChangeValue("SemiDios", TempName(0), "1")
End If
154 Next i
' Consejeros
156 buf = val(ServerIni.GetValue("INIT", "Consejeros"))
158 For i = 1 To buf
160 Name = UCase$(ServerIni.GetValue("Consejeros", "Consejero" & i))
162 TempName = Split(Name, "|", , vbTextCompare)
' Si NO declara el mail de la cuenta en el Server.ini, NO le doy privilegios.
164 If UBound(TempName()) > 0 Then
' AdministratorAccounts("Nick") = "Email"
166 AdministratorAccounts(TempName(0)) = TempName(1)
' Add key
168 Call Administradores.ChangeValue("Consejero", TempName(0), "1")
End If
170 Next i
' RolesMasters
172 buf = val(ServerIni.GetValue("INIT", "RolesMasters"))
174 For i = 1 To buf
176 Name = UCase$(ServerIni.GetValue("RolesMasters", "RM" & i))
178 TempName = Split(Name, "|", , vbTextCompare)
' Si NO declara el mail de la cuenta en el Server.ini, NO le doy privilegios.
180 If UBound(TempName()) > 0 Then
' AdministratorAccounts("Nick") = "Email"
182 AdministratorAccounts(TempName(0)) = TempName(1)
' Add key
184 Call Administradores.ChangeValue("RM", TempName(0), "1")
End If
186 Next i
188 Set ServerIni = Nothing
'If frmMain.Visible Then frmMain.txtStatus.Text = Date & " " & Time & " - Los Administradores/Dioses/Gms se han cargado correctamente."
Exit Sub
loadAdministrativeUsers_Err:
190 Call TraceError(Err.Number, Err.Description, "ES.loadAdministrativeUsers", Erl)
End Sub
Public Function TxtDimension(ByVal Name As String) As Long
On Error GoTo TxtDimension_Err
Dim n As Integer, cad As String, Tam As Long
100 n = FreeFile(1)
102 Open Name For Input As #n
104 Tam = 0
106 Do While Not EOF(n)
108 Tam = Tam + 1
110 Line Input #n, cad
Loop
112 Close n
114 TxtDimension = Tam
Exit Function
TxtDimension_Err:
116 Call TraceError(Err.Number, Err.Description, "ES.TxtDimension", Erl)
End Function
Public Sub CargarForbidenWords()
On Error GoTo CargarForbidenWords_Err
Dim size As Integer
100 size = TxtDimension(DatPath & "NombresInvalidos.txt")
102 If size = 0 Then
104 ReDim ForbidenNames(0)
Exit Sub
End If
106 ReDim ForbidenNames(1 To size)
Dim n As Integer, i As Integer
108 n = FreeFile(1)
110 Open DatPath & "NombresInvalidos.txt" For Input As #n
112 For i = 1 To UBound(ForbidenNames)
114 Line Input #n, ForbidenNames(i)
ForbidenNames(i) = LCase$(ForbidenNames(i))
116 Next i
118 Close n
Exit Sub
CargarForbidenWords_Err:
120 Call TraceError(Err.Number, Err.Description, "ES.CargarForbidenWords", Erl)
End Sub
Public Sub CargarHechizos()
'###################################################
'# ATENCION PELIGRO #
'###################################################
'
' ¡¡¡¡ NO USAR GetVar PARA LEER Hechizos.dat !!!!
'
'El que ose desafiar esta LEY, se las tendrá que ver
'con migo. Para leer Hechizos.dat se deberá usar
'la nueva clase clsLeerInis.
'
'Alejo
'
'###################################################
On Error GoTo ErrHandler
100 If frmMain.Visible Then frmMain.txStatus.Caption = "Cargando Hechizos."
Dim Hechizo As Integer
Dim Leer As New clsIniManager
102 Call Leer.Initialize(DatPath & "Hechizos.dat")
'obtiene el numero de hechizos
104 NumeroHechizos = val(Leer.GetValue("INIT", "NumeroHechizos"))
106 ReDim Hechizos(1 To NumeroHechizos) As t_Hechizo
108 frmCargando.cargar.Min = 0
110 frmCargando.cargar.max = NumeroHechizos
112 frmCargando.cargar.value = 0
'Llena la lista
114 For Hechizo = 1 To NumeroHechizos
116 Hechizos(Hechizo).velocidad = val(Leer.GetValue("Hechizo" & Hechizo, "Velocidad"))
'Materializacion
118 Hechizos(Hechizo).MaterializaObj = val(Leer.GetValue("Hechizo" & Hechizo, "MaterializaObj"))
120 Hechizos(Hechizo).MaterializaCant = val(Leer.GetValue("Hechizo" & Hechizo, "MaterializaCant"))
'Materializacion
'Screen Efecto
122 Hechizos(Hechizo).ScreenColor = val(Leer.GetValue("Hechizo" & Hechizo, "ScreenColor"))
124 Hechizos(Hechizo).TimeEfect = val(Leer.GetValue("Hechizo" & Hechizo, "TimeEfect"))
'Screen Efecto
126 Hechizos(Hechizo).TeleportX = val(Leer.GetValue("Hechizo" & Hechizo, "Teleport"))
128 Hechizos(Hechizo).TeleportXMap = val(Leer.GetValue("Hechizo" & Hechizo, "TeleportMap"))
130 Hechizos(Hechizo).TeleportXX = val(Leer.GetValue("Hechizo" & Hechizo, "TeleportX"))
132 Hechizos(Hechizo).TeleportXY = val(Leer.GetValue("Hechizo" & Hechizo, "TeleportY"))
134 Hechizos(Hechizo).nombre = Leer.GetValue("Hechizo" & Hechizo, "Nombre")
136 Hechizos(Hechizo).Desc = Leer.GetValue("Hechizo" & Hechizo, "Desc")
138 Hechizos(Hechizo).PalabrasMagicas = Leer.GetValue("Hechizo" & Hechizo, "PalabrasMagicas")
140 Hechizos(Hechizo).HechizeroMsg = Leer.GetValue("Hechizo" & Hechizo, "HechizeroMsg")
142 Hechizos(Hechizo).TargetMsg = Leer.GetValue("Hechizo" & Hechizo, "TargetMsg")
144 Hechizos(Hechizo).PropioMsg = Leer.GetValue("Hechizo" & Hechizo, "PropioMsg")
146 Hechizos(Hechizo).NecesitaObj = val(Leer.GetValue("Hechizo" & Hechizo, "NecesitaObj"))
148 Hechizos(Hechizo).NecesitaObj2 = val(Leer.GetValue("Hechizo" & Hechizo, "NecesitaObj2"))
150 Hechizos(Hechizo).Tipo = val(Leer.GetValue("Hechizo" & Hechizo, "Tipo"))
151 Hechizos(Hechizo).SkillType = val(Leer.GetValue("Hechizo" & Hechizo, "SkillType"))
152 Hechizos(Hechizo).wav = val(Leer.GetValue("Hechizo" & Hechizo, "WAV"))
154 Hechizos(Hechizo).FXgrh = val(Leer.GetValue("Hechizo" & Hechizo, "Fxgrh"))
156 Hechizos(Hechizo).Particle = val(Leer.GetValue("Hechizo" & Hechizo, "Particle"))
158 Hechizos(Hechizo).ParticleViaje = val(Leer.GetValue("Hechizo" & Hechizo, "ParticleViaje"))
160 Hechizos(Hechizo).TimeParticula = val(Leer.GetValue("Hechizo" & Hechizo, "TimeParticula"))
162 Hechizos(Hechizo).desencantar = val(Leer.GetValue("Hechizo" & Hechizo, "desencantar"))
164 Hechizos(Hechizo).Sanacion = val(Leer.GetValue("Hechizo" & Hechizo, "Sanacion"))
166 Hechizos(Hechizo).AntiRm = val(Leer.GetValue("Hechizo" & Hechizo, "AntiRm"))
'Hechizos de area
168 Hechizos(Hechizo).AreaRadio = val(Leer.GetValue("Hechizo" & Hechizo, "AreaRadio"))
170 Hechizos(Hechizo).AreaAfecta = val(Leer.GetValue("Hechizo" & Hechizo, "AreaAfecta"))
'Hechizos de area
172 If val(Leer.GetValue("Hechizo" & Hechizo, "Incinera")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Incinerate)
If val(Leer.GetValue("Hechizo" & Hechizo, "RemoveDebuff")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.RemoveDebuff)
If val(Leer.GetValue("Hechizo" & Hechizo, "StealBuff")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.StealBuff)
174 Hechizos(Hechizo).AutoLanzar = val(Leer.GetValue("Hechizo" & Hechizo, "AutoLanzar"))
175 Hechizos(Hechizo).TargetEffectType = val(Leer.GetValue("Hechizo" & Hechizo, "TargetEffectType"))
176 Hechizos(Hechizo).Cooldown = val(Leer.GetValue("Hechizo" & Hechizo, "CoolDown"))
177 Hechizos(Hechizo).CdEffectId = val(Leer.GetValue("Hechizo" & Hechizo, "CdEffectId"))
178 Hechizos(Hechizo).loops = val(Leer.GetValue("Hechizo" & Hechizo, "Loops"))
182 Hechizos(Hechizo).MinHp = val(Leer.GetValue("Hechizo" & Hechizo, "MinHP"))
184 Hechizos(Hechizo).MaxHp = val(Leer.GetValue("Hechizo" & Hechizo, "MaxHP"))
186 Hechizos(Hechizo).SubeMana = val(Leer.GetValue("Hechizo" & Hechizo, "SubeMana"))
188 Hechizos(Hechizo).MinMana = val(Leer.GetValue("Hechizo" & Hechizo, "MinMana"))
190 Hechizos(Hechizo).MaxMana = val(Leer.GetValue("Hechizo" & Hechizo, "MaxMana"))
192 Hechizos(Hechizo).SubeSta = val(Leer.GetValue("Hechizo" & Hechizo, "SubeSta"))
194 Hechizos(Hechizo).MinSta = val(Leer.GetValue("Hechizo" & Hechizo, "MinSta"))
196 Hechizos(Hechizo).MaxSta = val(Leer.GetValue("Hechizo" & Hechizo, "MaxSta"))
198 Hechizos(Hechizo).SubeHam = val(Leer.GetValue("Hechizo" & Hechizo, "SubeHam"))
200 Hechizos(Hechizo).MinHam = val(Leer.GetValue("Hechizo" & Hechizo, "MinHam"))
202 Hechizos(Hechizo).MaxHam = val(Leer.GetValue("Hechizo" & Hechizo, "MaxHam"))
204 Hechizos(Hechizo).SubeSed = val(Leer.GetValue("Hechizo" & Hechizo, "SubeSed"))
206 Hechizos(Hechizo).MinSed = val(Leer.GetValue("Hechizo" & Hechizo, "MinSed"))
208 Hechizos(Hechizo).MaxSed = val(Leer.GetValue("Hechizo" & Hechizo, "MaxSed"))
210 Hechizos(Hechizo).SubeAgilidad = val(Leer.GetValue("Hechizo" & Hechizo, "SubeAG"))
212 Hechizos(Hechizo).MinAgilidad = val(Leer.GetValue("Hechizo" & Hechizo, "MinAG"))
214 Hechizos(Hechizo).MaxAgilidad = val(Leer.GetValue("Hechizo" & Hechizo, "MaxAG"))
216 Hechizos(Hechizo).SubeFuerza = val(Leer.GetValue("Hechizo" & Hechizo, "SubeFU"))
218 Hechizos(Hechizo).MinFuerza = val(Leer.GetValue("Hechizo" & Hechizo, "MinFU"))
220 Hechizos(Hechizo).MaxFuerza = val(Leer.GetValue("Hechizo" & Hechizo, "MaxFU"))
222 Hechizos(Hechizo).SubeCarisma = val(Leer.GetValue("Hechizo" & Hechizo, "SubeCA"))
224 Hechizos(Hechizo).MinCarisma = val(Leer.GetValue("Hechizo" & Hechizo, "MinCA"))
226 Hechizos(Hechizo).MaxCarisma = val(Leer.GetValue("Hechizo" & Hechizo, "MaxCA"))
228 If val(Leer.GetValue("Hechizo" & Hechizo, "Invisibilidad")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Invisibility)
230 If val(Leer.GetValue("Hechizo" & Hechizo, "Paraliza")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Paralize)
232 If val(Leer.GetValue("Hechizo" & Hechizo, "Inmoviliza")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Immobilize)
234 If val(Leer.GetValue("Hechizo" & Hechizo, "RemoverParalisis")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.RemoveParalysis)
236 If val(Leer.GetValue("Hechizo" & Hechizo, "RemoverEstupidez")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.RemoveDumb)
238 If val(Leer.GetValue("Hechizo" & Hechizo, "RemueveInvisibilidadParcial")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.RemoveInvisibility)
240 If val(Leer.GetValue("Hechizo" & Hechizo, "CuraVeneno")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.CurePoison)
242 Hechizos(Hechizo).Envenena = val(Leer.GetValue("Hechizo" & Hechizo, "Envenena"))
244 If val(Leer.GetValue("Hechizo" & Hechizo, "Maldicion")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Curse)
246 If val(Leer.GetValue("Hechizo" & Hechizo, "RemoverMaldicion")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.RemoveCurse)
250 If val(Leer.GetValue("Hechizo" & Hechizo, "Revivir")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Resurrect)
252 If val(Leer.GetValue("Hechizo" & Hechizo, "Ceguera")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Blindness)
254 If val(Leer.GetValue("Hechizo" & Hechizo, "Estupidez")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.Dumb)
255 If val(Leer.GetValue("Hechizo" & Hechizo, "ToggleCleave")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.ToggleCleave)
If val(Leer.GetValue("Hechizo" & Hechizo, "AdjustStatsWithCaster")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.AdjustStatsWithCaster)
If val(Leer.GetValue("Hechizo" & Hechizo, "CancelActiveEffect")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.CancelActiveEffect)
256 Hechizos(Hechizo).Invoca = val(Leer.GetValue("Hechizo" & Hechizo, "Invoca"))
258 Hechizos(Hechizo).NumNpc = val(Leer.GetValue("Hechizo" & Hechizo, "NumNpc"))
260 Hechizos(Hechizo).cant = val(Leer.GetValue("Hechizo" & Hechizo, "Cant"))
262 Hechizos(Hechizo).Mimetiza = val(Leer.GetValue("Hechizo" & Hechizo, "Mimetiza"))
264 If val(Leer.GetValue("Hechizo" & Hechizo, "GolpeCertero")) > 0 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.PreciseHit)
266 Hechizos(Hechizo).MinSkill = val(Leer.GetValue("Hechizo" & Hechizo, "MinSkill"))
268 Hechizos(Hechizo).ManaRequerido = val(Leer.GetValue("Hechizo" & Hechizo, "ManaRequerido"))
270 Hechizos(Hechizo).RequiredHP = val(Leer.GetValue("Hechizo" & Hechizo, "RequiredHP"))
272 Hechizos(Hechizo).duration = val(Leer.GetValue("Hechizo" & Hechizo, "Duration"))
'Barrin 30/9/03
274 Hechizos(Hechizo).StaRequerido = val(Leer.GetValue("Hechizo" & Hechizo, "StaRequerido"))
276 Hechizos(Hechizo).Target = val(Leer.GetValue("Hechizo" & Hechizo, "Target"))
277 Hechizos(Hechizo).RequireTransform = val(Leer.GetValue("Hechizo" & Hechizo, "RequireTransform"))
278 frmCargando.cargar.value = frmCargando.cargar.value + 1
280 Hechizos(Hechizo).NeedStaff = val(Leer.GetValue("Hechizo" & Hechizo, "NeedStaff"))
281 Hechizos(Hechizo).StaffAffected = CBool(val(Leer.GetValue("Hechizo" & Hechizo, "StaffAffected")))
282 Hechizos(Hechizo).EotId = val(Leer.GetValue("Hechizo" & Hechizo, "EOTID"))
290 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireArmor")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eArmor)
292 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireShip")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eShip)
294 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireHelm")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eHelm)
296 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireKnucle")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eKnucle)
298 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireMagicItem")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eMagicItem)
300 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireProjectile")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eProjectile)
302 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireShield")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eShield)
304 If val(Leer.GetValue("Hechizo" & Hechizo, "RequireWeapon")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eWeapon)
If val(Leer.GetValue("Hechizo" & Hechizo, "RequireTargetOnLand")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eRequireTargetOnLand)
If val(Leer.GetValue("Hechizo" & Hechizo, "RequireTargetOnWater")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eRequireTargetOnWater)
If val(Leer.GetValue("Hechizo" & Hechizo, "WorkOnDead")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eWorkOnDead)
If val(Leer.GetValue("Hechizo" & Hechizo, "IsSkill")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eIsSkill)
If val(Leer.GetValue("Hechizo" & Hechizo, "IsBindable")) > 0 Then Call SetMask(Hechizos(Hechizo).SpellRequirementMask, e_SpellRequirementMask.eIsBindable)
305 Hechizos(Hechizo).RequireWeaponType = val(Leer.GetValue("Hechizo" & Hechizo, "RequireWeaponType"))
Dim SubeHP As Byte
SubeHP = val(Leer.GetValue("Hechizo" & Hechizo, "SubeHP"))
If SubeHP = 1 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.eDoHeal)
If SubeHP = 2 Then Call SetMask(Hechizos(Hechizo).Effects, e_SpellEffects.eDoDamage)
306 Next Hechizo
400 Set Leer = Nothing
Exit Sub
ErrHandler:
402 MsgBox "Error cargando hechizos.dat " & Err.Number & ": " & Err.Description
End Sub
Public Sub LoadEffectOverTime()
On Error GoTo ErrHandler
100 If frmMain.Visible Then frmMain.txStatus.Caption = "Cargando Hechizos."
Dim i As Integer
Dim Leer As New clsIniManager
Dim EffectCount As Integer
102 Call Leer.Initialize(DatPath & "EffectsOverTime.dat")
'obtiene el numero de hechizos
104 EffectCount = val(Leer.GetValue("INIT", "EffectCount"))
106 ReDim EffectOverTime(1 To EffectCount) As t_EffectOverTime
108 frmCargando.cargar.Min = 0
110 frmCargando.cargar.max = EffectCount
112 frmCargando.cargar.value = 0
114 For i = 1 To EffectCount
EffectOverTime(i).Type = val(Leer.GetValue("EOT" & i, "Type"))
EffectOverTime(i).SubType = val(Leer.GetValue("EOT" & i, "SubType"))
EffectOverTime(i).SharedTypeId = val(Leer.GetValue("EOT" & i, "SharedTypeId"))
EffectOverTime(i).TickPowerMin = val(Leer.GetValue("EOT" & i, "TickPowerMin"))
EffectOverTime(i).TickPowerMax = val(Leer.GetValue("EOT" & i, "TickPowerMax"))
EffectOverTime(i).Ticks = val(Leer.GetValue("EOT" & i, "Ticks"))
EffectOverTime(i).TickTime = val(Leer.GetValue("EOT" & i, "TickTime"))
EffectOverTime(i).TickFX = val(Leer.GetValue("EOT" & i, "TickFX"))
EffectOverTime(i).TickManaConsumption = val(Leer.GetValue("EOT" & i, "TickManaConsumption"))
EffectOverTime(i).TickStaminaConsumption = val(Leer.GetValue("EOT" & i, "TickStaminaConsumption"))
EffectOverTime(i).OnHitFx = val(Leer.GetValue("EOT" & i, "OnHitFx"))
EffectOverTime(i).OnHitWav = val(Leer.GetValue("EOT" & i, "OnHitWav"))
EffectOverTime(i).Override = val(Leer.GetValue("EOT" & i, "Override"))
EffectOverTime(i).Limit = val(Leer.GetValue("EOT" & i, "Limit"))
EffectOverTime(i).PhysicalDamageReduction = val(Leer.GetValue("EOT" & i, "PhysicalDamageReduction"))
EffectOverTime(i).MagicDamageReduction = val(Leer.GetValue("EOT" & i, "MagicDamageReduction"))
EffectOverTime(i).PhysicalDamageDone = val(Leer.GetValue("EOT" & i, "PhysicalDamageDone"))
EffectOverTime(i).SpeedModifier = val(Leer.GetValue("EOT" & i, "SpeedModifier"))
EffectOverTime(i).HitModifier = val(Leer.GetValue("EOT" & i, "HitModifier"))
EffectOverTime(i).EvasionModifier = val(Leer.GetValue("EOT" & i, "EvasionModifier"))
EffectOverTime(i).MagicDamageDone = val(Leer.GetValue("EOT" & i, "MagicDamageDone"))
EffectOverTime(i).SelfHealingBonus = val(Leer.GetValue("EOT" & i, "SelfHealingBonus"))
EffectOverTime(i).MagicHealingBonus = val(Leer.GetValue("EOT" & i, "MagicHealingBonus"))
EffectOverTime(i).ClientEffectTypeId = val(Leer.GetValue("EOT" & i, "ClientEffectTypeId"))
EffectOverTime(i).PhysicalLinearBonus = val(Leer.GetValue("EOT" & i, "PhysicalLinearBonus"))
EffectOverTime(i).DefenseBonus = val(Leer.GetValue("EOT" & i, "DefenseBonus"))
EffectOverTime(i).BuffType = val(Leer.GetValue("EOT" & i, "BuffType"))
EffectOverTime(i).Area = val(Leer.GetValue("EOT" & i, "Area"))
EffectOverTime(i).Aura = Leer.GetValue("EOT" & i, "Aura")
EffectOverTime(i).ApplyeffectID = val(Leer.GetValue("EOT" & i, "ApplyeffectID"))
EffectOverTime(i).SecondaryEffectId = val(Leer.GetValue("EOT" & i, "SecondaryEffectId"))
EffectOverTime(i).RequireTransform = val(Leer.GetValue("EOT" & i, "RequireTransform"))
If val(Leer.GetValue("EOT" & i, "AffectedByMagicBonus")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.MagicBonus)
End If
If val(Leer.GetValue("EOT" & i, "AffectedByMagicReduction")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.MagicReduction)
End If
If val(Leer.GetValue("EOT" & i, "AffectedByPhysicalBonus")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.PhysiccalBonus)
End If
If val(Leer.GetValue("EOT" & i, "AffectedByPhysicalReduction")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.PhysicalReduction)
End If
If val(Leer.GetValue("EOT" & i, "AffectedBySpeedModifier")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.MovementSpeed)
End If
If val(Leer.GetValue("EOT" & i, "AffectedByMagicHealing")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.MagicHealingBonus)
End If
If val(Leer.GetValue("EOT" & i, "AffectedBySelfHealing")) > 0 Then
Call SetMask(EffectOverTime(i).EffectModifiers, e_ModifierTypes.SelfHealingBonus)
End If
290 If val(Leer.GetValue("EOT" & i, "RequireArmor")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eArmor)
292 If val(Leer.GetValue("EOT" & i, "RequireShip")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eShip)
294 If val(Leer.GetValue("EOT" & i, "RequireHelm")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eHelm)
296 If val(Leer.GetValue("EOT" & i, "RequireKnucle")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eKnucle)
298 If val(Leer.GetValue("EOT" & i, "RequireMagicItem")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eMagicItem)
300 If val(Leer.GetValue("EOT" & i, "RequireProjectile")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eProjectile)
302 If val(Leer.GetValue("EOT" & i, "RequireShield")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eShield)
304 If val(Leer.GetValue("EOT" & i, "RequireWeapon")) > 0 Then Call SetMask(EffectOverTime(i).SpellRequirementMask, e_SpellRequirementMask.eWeapon)
316 EffectOverTime(i).npcId = val(Leer.GetValue("EOT" & i, "NpcId"))
If val(Leer.GetValue("EOT" & i, "LimitCastOnlyOnSelf")) > 0 Then
Call SetMask(EffectOverTime(i).ApplyStatusMask, e_StatusMask.eCastOnlyOnSelf)
End If
If val(Leer.GetValue("EOT" & i, "Transform")) > 0 Then
Call SetMask(EffectOverTime(i).ApplyStatusMask, e_StatusMask.eTransformed)
End If
If val(Leer.GetValue("EOT" & i, "CCInmunity")) > 0 Then
Call SetMask(EffectOverTime(i).ApplyStatusMask, e_StatusMask.eCCInmunity)
End If
If val(Leer.GetValue("EOT" & i, "RequireSword")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eSword))
If val(Leer.GetValue("EOT" & i, "RequireDagger")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eDagger))
If val(Leer.GetValue("EOT" & i, "RequireBow")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eBow))
If val(Leer.GetValue("EOT" & i, "RequireStaff")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eStaff))
If val(Leer.GetValue("EOT" & i, "RequireMace")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eMace))
If val(Leer.GetValue("EOT" & i, "RequireThrowableAxe")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eThrowableAxe))
If val(Leer.GetValue("EOT" & i, "RequireAxe")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eAxe))
If val(Leer.GetValue("EOT" & i, "RequireKnucle")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eKnuckle))
If val(Leer.GetValue("EOT" & i, "RequireFist")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eFist))
If val(Leer.GetValue("EOT" & i, "RequireSpear")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eSpear))
If val(Leer.GetValue("EOT" & i, "RequireGunpowder")) > 0 Then Call SetIntMask(EffectOverTime(i).RequireWeaponType, ShiftLeft(1, eGunPowder))
EffectOverTime(i).SecondaryTargetModifier = val(Leer.GetValue("EOT" & i, "SecondaryTargetModifier"))
Next i
Call InitializePools
Exit Sub
ErrHandler:
288 MsgBox "Error cargando EffectsOverTime.dat " & Err.Number & ": " & Err.Description
End Sub
Sub LoadMotd()
On Error GoTo LoadMotd_Err
Dim i As Integer
100 MaxLines = val(GetVar(DatPath & "Motd.ini", "INIT", "NumLines"))
102 ReDim MOTD(1 To MaxLines)
104 For i = 1 To MaxLines
106 MOTD(i).texto = GetVar(DatPath & "Motd.ini", "Motd", "Line" & i)
108 MOTD(i).Formato = vbNullString
110 Next i
Exit Sub
LoadMotd_Err:
112 Call TraceError(Err.Number, Err.Description, "ES.LoadMotd", Erl)
End Sub
Public Sub DoBackUp()
On Error GoTo DoBackUp_Err
100 haciendoBK = True
Dim i As Integer
102 Call SendData(SendTarget.ToAll, 0, PrepareMessagePauseToggle())
108 Call SendData(SendTarget.ToAll, 0, PrepareMessagePauseToggle())
110 haciendoBK = False
Call LogThis(0, "[BackUps.log] DoBackUp", vbLogEventTypeInformation)
Exit Sub
DoBackUp_Err:
120 Call TraceError(Err.Number, Err.Description, "ES.DoBackUp", Erl)
End Sub
Sub LoadArmasHerreria()
On Error GoTo LoadArmasHerreria_Err
Dim n As Integer, lc As Integer
100 n = val(GetVar(DatPath & "ArmasHerrero.dat", "INIT", "NumArmas"))
102 If n = 0 Then
104 ReDim ArmasHerrero(0) As Integer
Exit Sub
End If
106 ReDim Preserve ArmasHerrero(1 To n) As Integer
108 For lc = 1 To n
110 ArmasHerrero(lc) = val(GetVar(DatPath & "ArmasHerrero.dat", "Arma" & lc, "Index"))
112 Next lc
Exit Sub
LoadArmasHerreria_Err:
114 Call TraceError(Err.Number, Err.Description, "ES.LoadArmasHerreria", Erl)
End Sub
Sub LoadArmadurasHerreria()
On Error GoTo LoadArmadurasHerreria_Err
Dim n As Integer, lc As Integer
100 n = val(GetVar(DatPath & "ArmadurasHerrero.dat", "INIT", "NumArmaduras"))
102 If n = 0 Then
104 ReDim ArmadurasHerrero(0) As Integer
Exit Sub
End If
106 ReDim Preserve ArmadurasHerrero(1 To n) As Integer
108 For lc = 1 To n
110 ArmadurasHerrero(lc) = val(GetVar(DatPath & "ArmadurasHerrero.dat", "Armadura" & lc, "Index"))