-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameScr.cs
More file actions
9520 lines (8865 loc) · 257 KB
/
Copy pathGameScr.cs
File metadata and controls
9520 lines (8865 loc) · 257 KB
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
using System;
using System.IO;
using Assets.src.g;
using UnityEngine;
// Token: 0x0200009A RID: 154
public class GameScr : mScreen, IChatable
{
// Token: 0x06000622 RID: 1570 RVA: 0x0004C77C File Offset: 0x0004A97C
public GameScr()
{
this.cName1 = string.Empty;
this.cName2 = string.Empty;
this.isShowUIzone = true;
this.isgetPean = true;
this.isgetPeanComplete = true;
this.isgobackComplete = true;
this.mapupsetID = -1;
this.planetupsetID = -1;
this.stepHome = -1;
this.isAuto = true;
this.isRegis = true;
this.step = 0;
this.vmobadded = new MyVector();
this.mobIDadded = -1;
this.zoneCol = 6;
this.indexItemUse = -1;
this.cLastFocusID = -1;
this.cPreFocusID = -1;
this.tradeName = string.Empty;
this.tradeItemName = string.Empty;
this.strTam = string.Empty;
this.bgRID = -1;
this.selectedIndexSkill = -1;
this.keyTouchSkill = -1;
this.idVS = new int[]
{
-1,
-1
};
this.Hitem = 30;
this.maxSizeRow = 5;
this.yourNumber = string.Empty;
if (GameCanvas.w == 128 || GameCanvas.h <= 208)
{
GameScr.indexSize = 20;
}
this.cmdback = new Command(string.Empty, 11021);
this.cmdMenu = new Command("menu", 11000);
this.cmdFocus = new Command(string.Empty, 11001);
this.cmdMenu.img = GameScr.imgMenu;
this.cmdMenu.w = mGraphics.getImageWidth(this.cmdMenu.img) + 20;
this.cmdMenu.isPlaySoundButton = false;
this.cmdFocus.img = GameScr.imgFocus;
if (GameCanvas.isTouch)
{
this.cmdMenu.x = 0;
this.cmdMenu.y = 50;
this.cmdFocus = null;
}
else
{
this.cmdMenu.x = 0;
this.cmdMenu.y = GameScr.gH - 30;
this.cmdFocus.x = GameScr.gW - 32;
this.cmdFocus.y = GameScr.gH - 32;
}
this.right = this.cmdFocus;
GameScr.isPaintRada = 1;
if (GameCanvas.isTouch)
{
GameScr.isHaveSelectSkill = true;
}
}
// Token: 0x06000624 RID: 1572 RVA: 0x0004CC70 File Offset: 0x0004AE70
public static void loadBg()
{
GameScr.imgSP = GameCanvas.loadImage("/mainImage/SP.png");
GameScr.imgHPLost = GameCanvas.loadImage("/mainImage/myTexture2dhpLost.png");
GameScr.imgMPLost = GameCanvas.loadImage("/mainImage/myTexture2dmpLost.png");
GameScr.imgMP = GameCanvas.loadImage("/mainImage/myTexture2dMP.png");
GameScr.imgMenu = GameCanvas.loadImage("/mainImage/myTexture2dmenu.png");
GameScr.flyTextX = new int[5];
GameScr.flyTextY = new int[5];
GameScr.flyTextDx = new int[5];
GameScr.flyTextDy = new int[5];
GameScr.flyTextState = new int[5];
GameScr.flyTextString = new string[5];
GameScr.flyTextYTo = new int[5];
GameScr.flyTime = new int[5];
GameScr.flyTextColor = new int[8];
for (int i = 0; i < 5; i++)
{
GameScr.flyTextState[i] = -1;
}
sbyte[] array = Rms.loadRMS("NRdataVersion");
sbyte[] array2 = Rms.loadRMS("NRmapVersion");
sbyte[] array3 = Rms.loadRMS("NRskillVersion");
sbyte[] array4 = Rms.loadRMS("NRitemVersion");
if (array != null)
{
GameScr.vcData = array[0];
}
if (array2 != null)
{
GameScr.vcMap = array2[0];
}
if (array3 != null)
{
GameScr.vcSkill = array3[0];
}
if (array4 != null)
{
GameScr.vcItem = array4[0];
}
MobCapcha.init();
GameScr.isAnalog = ((Rms.loadRMSInt("analog") != 1) ? 0 : 1);
GameScr.gamePad = new GamePad();
}
// Token: 0x06000625 RID: 1573 RVA: 0x000063B6 File Offset: 0x000045B6
public void initSelectChar()
{
this.readPart();
SmallImage.init();
}
// Token: 0x06000626 RID: 1574 RVA: 0x0004CDC4 File Offset: 0x0004AFC4
public static void paintOngMauPercent(Image img0, Image img1, Image img2, float x, float y, int size, float pixelPercent, mGraphics g)
{
int clipX = g.getClipX();
int clipY = g.getClipY();
int clipWidth = g.getClipWidth();
int clipHeight = g.getClipHeight();
g.setClip((int)x, (int)y, (int)pixelPercent, 13);
int num = size / 15 - 2;
for (int i = 0; i < num; i++)
{
g.drawImage(img1, x + (float)((i + 1) * 15), y, 0);
}
g.drawImage(img0, x, y, 0);
g.drawImage(img1, x + (float)size - 30f, y, 0);
g.drawImage(img2, x + (float)size - 15f, y, 0);
g.setClip(clipX, clipY, clipWidth, clipHeight);
}
// Token: 0x06000627 RID: 1575 RVA: 0x000063C3 File Offset: 0x000045C3
public void initTraining()
{
if (CreateCharScr.isCreateChar)
{
CreateCharScr.isCreateChar = false;
this.right = null;
}
}
// Token: 0x06000628 RID: 1576 RVA: 0x000063D9 File Offset: 0x000045D9
public bool isMapDocNhan()
{
return TileMap.mapID >= 53 && TileMap.mapID <= 62;
}
// Token: 0x06000629 RID: 1577 RVA: 0x000063F2 File Offset: 0x000045F2
public bool isMapFize()
{
return TileMap.mapID >= 63;
}
// Token: 0x0600062A RID: 1578 RVA: 0x0004CE74 File Offset: 0x0004B074
public override void switchToMe()
{
GameScr.vChatVip.removeAllElements();
ServerListScreen.isWait = false;
if (BackgroudEffect.isHaveRain())
{
SoundMn.gI().rain();
}
LoginScr.isContinueToLogin = false;
global::Char.isLoadingMap = false;
Service.gI().finishLoadMap();
if (TileMap.isTrainingMap())
{
this.initTraining();
}
GameScr.info1.isUpdate = true;
GameScr.info2.isUpdate = true;
this.resetButton();
GameScr.isLoadAllData = true;
base.switchToMe();
}
// Token: 0x0600062B RID: 1579 RVA: 0x0004CEF0 File Offset: 0x0004B0F0
public static int getMaxExp(int level)
{
int num = 0;
for (int i = 0; i <= level; i++)
{
num += (int)GameScr.exps[i];
}
return num;
}
// Token: 0x0600062C RID: 1580 RVA: 0x0004CF18 File Offset: 0x0004B118
public static void resetAllvector()
{
GameScr.vCharInMap.removeAllElements();
Teleport.vTeleport.removeAllElements();
GameScr.vItemMap.removeAllElements();
Effect2.vEffect2.removeAllElements();
Effect2.vAnimateEffect.removeAllElements();
Effect2.vEffect2Outside.removeAllElements();
Effect2.vEffectFeet.removeAllElements();
Effect2.vEffect3.removeAllElements();
GameScr.vMobAttack.removeAllElements();
GameScr.vMob.removeAllElements();
GameScr.vNpc.removeAllElements();
global::Char.myCharz().vMovePoints.removeAllElements();
}
// Token: 0x0600062D RID: 1581 RVA: 0x00003584 File Offset: 0x00001784
public void loadSkillShortcut()
{
}
// Token: 0x0600062E RID: 1582 RVA: 0x0004CFA4 File Offset: 0x0004B1A4
public void onOSkill(sbyte[] oSkillID)
{
Cout.println("GET onScreenSkill!");
GameScr.onScreenSkill = new Skill[5];
if (oSkillID == null)
{
this.loadDefaultonScreenSkill();
return;
}
for (int i = 0; i < oSkillID.Length; i++)
{
for (int j = 0; j < global::Char.myCharz().vSkillFight.size(); j++)
{
Skill skill = (Skill)global::Char.myCharz().vSkillFight.elementAt(j);
if (skill.template.id == oSkillID[i])
{
GameScr.onScreenSkill[i] = skill;
break;
}
}
}
}
// Token: 0x0600062F RID: 1583 RVA: 0x0004D028 File Offset: 0x0004B228
public void onKSkill(sbyte[] kSkillID)
{
Cout.println("GET KEYSKILL!");
GameScr.keySkill = new Skill[5];
if (kSkillID == null)
{
this.loadDefaultKeySkill();
return;
}
for (int i = 0; i < kSkillID.Length; i++)
{
for (int j = 0; j < global::Char.myCharz().vSkillFight.size(); j++)
{
Skill skill = (Skill)global::Char.myCharz().vSkillFight.elementAt(j);
if (skill.template.id == kSkillID[i])
{
GameScr.keySkill[i] = skill;
break;
}
}
}
}
// Token: 0x06000630 RID: 1584 RVA: 0x0004D0AC File Offset: 0x0004B2AC
public void onCSkill(sbyte[] cSkillID)
{
Cout.println("GET CURRENTSKILL!");
if (cSkillID == null || cSkillID.Length == 0)
{
if (global::Char.myCharz().vSkillFight.size() > 0)
{
global::Char.myCharz().myskill = (Skill)global::Char.myCharz().vSkillFight.elementAt(0);
}
}
else
{
for (int i = 0; i < global::Char.myCharz().vSkillFight.size(); i++)
{
Skill skill = (Skill)global::Char.myCharz().vSkillFight.elementAt(i);
if (skill.template.id == cSkillID[0])
{
global::Char.myCharz().myskill = skill;
break;
}
}
}
if (global::Char.myCharz().myskill != null)
{
Service.gI().selectSkill((int)global::Char.myCharz().myskill.template.id);
this.saveRMSCurrentSkill(global::Char.myCharz().myskill.template.id);
}
}
// Token: 0x06000631 RID: 1585 RVA: 0x0004D190 File Offset: 0x0004B390
private void loadDefaultonScreenSkill()
{
Cout.println("LOAD DEFAULT ONmScreen SKILL");
int num = 0;
while (num < GameScr.onScreenSkill.Length && num < global::Char.myCharz().vSkillFight.size())
{
Skill skill = (Skill)global::Char.myCharz().vSkillFight.elementAt(num);
GameScr.onScreenSkill[num] = skill;
num++;
}
this.saveonScreenSkillToRMS();
}
// Token: 0x06000632 RID: 1586 RVA: 0x0004D1F0 File Offset: 0x0004B3F0
private void loadDefaultKeySkill()
{
Cout.println("LOAD DEFAULT KEY SKILL");
int num = 0;
while (num < GameScr.keySkill.Length && num < global::Char.myCharz().vSkillFight.size())
{
Skill skill = (Skill)global::Char.myCharz().vSkillFight.elementAt(num);
GameScr.keySkill[num] = skill;
num++;
}
this.saveKeySkillToRMS();
}
// Token: 0x06000633 RID: 1587 RVA: 0x0004D250 File Offset: 0x0004B450
public void doSetOnScreenSkill(SkillTemplate skillTemplate)
{
Skill skill = global::Char.myCharz().getSkill(skillTemplate);
MyVector myVector = new MyVector();
for (int i = 0; i < 5; i++)
{
object[] p = new object[]
{
skill,
i + string.Empty
};
myVector.addElement(new Command(mResources.into_place + (i + 1), 11120, p));
}
GameCanvas.menu.startAt(myVector, 0);
}
// Token: 0x06000634 RID: 1588 RVA: 0x0004D2C8 File Offset: 0x0004B4C8
public void doSetKeySkill(SkillTemplate skillTemplate)
{
Cout.println("DO SET KEY SKILL");
Skill skill = global::Char.myCharz().getSkill(skillTemplate);
string[] array = (!TField.isQwerty) ? mResources.key_skill : mResources.key_skill_qwerty;
MyVector myVector = new MyVector();
for (int i = 0; i < 5; i++)
{
object[] p = new object[]
{
skill,
i + string.Empty
};
myVector.addElement(new Command(array[i], 11121, p));
}
GameCanvas.menu.startAt(myVector, 0);
}
// Token: 0x06000635 RID: 1589 RVA: 0x0004D354 File Offset: 0x0004B554
public void saveonScreenSkillToRMS()
{
sbyte[] array = new sbyte[GameScr.onScreenSkill.Length];
for (int i = 0; i < GameScr.onScreenSkill.Length; i++)
{
if (GameScr.onScreenSkill[i] == null)
{
array[i] = -1;
}
else
{
array[i] = GameScr.onScreenSkill[i].template.id;
}
}
Service.gI().changeOnKeyScr(array);
}
// Token: 0x06000636 RID: 1590 RVA: 0x0004D3B0 File Offset: 0x0004B5B0
public void saveKeySkillToRMS()
{
sbyte[] array = new sbyte[GameScr.keySkill.Length];
for (int i = 0; i < GameScr.keySkill.Length; i++)
{
if (GameScr.keySkill[i] == null)
{
array[i] = -1;
}
else
{
array[i] = GameScr.keySkill[i].template.id;
}
}
Service.gI().changeOnKeyScr(array);
}
// Token: 0x06000637 RID: 1591 RVA: 0x00003584 File Offset: 0x00001784
public void saveRMSCurrentSkill(sbyte id)
{
}
// Token: 0x06000638 RID: 1592 RVA: 0x0004D40C File Offset: 0x0004B60C
public void addSkillShortcut(Skill skill)
{
Cout.println("ADD SKILL SHORTCUT TO SKILL " + skill.template.id);
for (int i = 0; i < GameScr.onScreenSkill.Length; i++)
{
if (GameScr.onScreenSkill[i] == null)
{
GameScr.onScreenSkill[i] = skill;
break;
}
}
for (int j = 0; j < GameScr.keySkill.Length; j++)
{
if (GameScr.keySkill[j] == null)
{
GameScr.keySkill[j] = skill;
break;
}
}
if (global::Char.myCharz().myskill == null)
{
global::Char.myCharz().myskill = skill;
}
this.saveKeySkillToRMS();
this.saveonScreenSkillToRMS();
}
// Token: 0x06000639 RID: 1593 RVA: 0x0004D4A8 File Offset: 0x0004B6A8
public bool isBagFull()
{
for (int i = global::Char.myCharz().arrItemBag.Length - 1; i >= 0; i--)
{
if (global::Char.myCharz().arrItemBag[i] == null)
{
return false;
}
}
return true;
}
// Token: 0x0600063A RID: 1594 RVA: 0x00006400 File Offset: 0x00004600
public void createConfirm(string[] menu, Npc npc)
{
this.resetButton();
this.isLockKey = true;
this.left = new Command(menu[0], 130011, npc);
this.right = new Command(menu[1], 130012, npc);
}
// Token: 0x0600063B RID: 1595 RVA: 0x0004D4E0 File Offset: 0x0004B6E0
public void createMenu(string[] menu, Npc npc)
{
MyVector myVector = new MyVector();
for (int i = 0; i < menu.Length; i++)
{
myVector.addElement(new Command(menu[i], 11057, npc));
}
GameCanvas.menu.startAt(myVector, 2);
}
// Token: 0x0600063C RID: 1596 RVA: 0x0004D524 File Offset: 0x0004B724
public void readPart()
{
DataInputStream dataInputStream = null;
try
{
dataInputStream = new DataInputStream(Rms.loadRMS("NR_part"));
int num = (int)dataInputStream.readShort();
GameScr.parts = new Part[num];
for (int i = 0; i < num; i++)
{
int type = (int)dataInputStream.readByte();
GameScr.parts[i] = new Part(type);
for (int j = 0; j < GameScr.parts[i].pi.Length; j++)
{
GameScr.parts[i].pi[j] = new PartImage();
GameScr.parts[i].pi[j].id = dataInputStream.readShort();
GameScr.parts[i].pi[j].dx = dataInputStream.readByte();
GameScr.parts[i].pi[j].dy = dataInputStream.readByte();
}
}
}
catch (Exception ex)
{
Cout.LogError("LOI TAI readPart " + ex.ToString());
}
finally
{
try
{
dataInputStream.close();
}
catch (Exception ex2)
{
Cout.LogError("LOI TAI readPart 2" + ex2.ToString());
}
}
}
// Token: 0x0600063D RID: 1597 RVA: 0x0004D664 File Offset: 0x0004B864
public void readEfect()
{
DataInputStream dataInputStream = null;
try
{
dataInputStream = new DataInputStream(Rms.loadRMS("NR_effect"));
int num = (int)dataInputStream.readShort();
GameScr.efs = new EffectCharPaint[num];
for (int i = 0; i < num; i++)
{
GameScr.efs[i] = new EffectCharPaint();
GameScr.efs[i].idEf = (int)dataInputStream.readShort();
GameScr.efs[i].arrEfInfo = new EffectInfoPaint[(int)dataInputStream.readByte()];
for (int j = 0; j < GameScr.efs[i].arrEfInfo.Length; j++)
{
GameScr.efs[i].arrEfInfo[j] = new EffectInfoPaint();
GameScr.efs[i].arrEfInfo[j].idImg = (int)dataInputStream.readShort();
GameScr.efs[i].arrEfInfo[j].dx = (int)dataInputStream.readByte();
GameScr.efs[i].arrEfInfo[j].dy = (int)dataInputStream.readByte();
}
}
}
catch (Exception)
{
}
finally
{
try
{
dataInputStream.close();
}
catch (Exception ex)
{
Cout.LogError("Loi ham Eff: " + ex.ToString());
}
}
}
// Token: 0x0600063E RID: 1598 RVA: 0x0004D7A4 File Offset: 0x0004B9A4
public void readArrow()
{
DataInputStream dataInputStream = null;
try
{
dataInputStream = new DataInputStream(Rms.loadRMS("NR_arrow"));
int num = (int)dataInputStream.readShort();
GameScr.arrs = new Arrowpaint[num];
for (int i = 0; i < num; i++)
{
GameScr.arrs[i] = new Arrowpaint();
GameScr.arrs[i].id = (int)dataInputStream.readShort();
GameScr.arrs[i].imgId[0] = (int)dataInputStream.readShort();
GameScr.arrs[i].imgId[1] = (int)dataInputStream.readShort();
GameScr.arrs[i].imgId[2] = (int)dataInputStream.readShort();
}
}
catch (Exception)
{
}
finally
{
try
{
dataInputStream.close();
}
catch (Exception ex)
{
Cout.LogError("Loi ham readArrow: " + ex.ToString());
}
}
}
// Token: 0x0600063F RID: 1599 RVA: 0x0004D88C File Offset: 0x0004BA8C
public void readDart()
{
DataInputStream dataInputStream = null;
try
{
dataInputStream = new DataInputStream(Rms.loadRMS("NR_dart"));
int num = (int)dataInputStream.readShort();
GameScr.darts = new DartInfo[num];
for (int i = 0; i < num; i++)
{
GameScr.darts[i] = new DartInfo();
GameScr.darts[i].id = dataInputStream.readShort();
GameScr.darts[i].nUpdate = dataInputStream.readShort();
GameScr.darts[i].va = (int)(dataInputStream.readShort() * 256);
GameScr.darts[i].xdPercent = dataInputStream.readShort();
int num2 = (int)dataInputStream.readShort();
GameScr.darts[i].tail = new short[num2];
for (int j = 0; j < num2; j++)
{
GameScr.darts[i].tail[j] = dataInputStream.readShort();
}
num2 = (int)dataInputStream.readShort();
GameScr.darts[i].tailBorder = new short[num2];
for (int k = 0; k < num2; k++)
{
GameScr.darts[i].tailBorder[k] = dataInputStream.readShort();
}
num2 = (int)dataInputStream.readShort();
GameScr.darts[i].xd1 = new short[num2];
for (int l = 0; l < num2; l++)
{
GameScr.darts[i].xd1[l] = dataInputStream.readShort();
}
num2 = (int)dataInputStream.readShort();
GameScr.darts[i].xd2 = new short[num2];
for (int m = 0; m < num2; m++)
{
GameScr.darts[i].xd2[m] = dataInputStream.readShort();
}
num2 = (int)dataInputStream.readShort();
GameScr.darts[i].head = new short[num2][];
for (int n = 0; n < num2; n++)
{
short num3 = dataInputStream.readShort();
GameScr.darts[i].head[n] = new short[(int)num3];
for (int num4 = 0; num4 < (int)num3; num4++)
{
GameScr.darts[i].head[n][num4] = dataInputStream.readShort();
}
}
num2 = (int)dataInputStream.readShort();
GameScr.darts[i].headBorder = new short[num2][];
for (int num5 = 0; num5 < num2; num5++)
{
short num6 = dataInputStream.readShort();
GameScr.darts[i].headBorder[num5] = new short[(int)num6];
for (int num7 = 0; num7 < (int)num6; num7++)
{
GameScr.darts[i].headBorder[num5][num7] = dataInputStream.readShort();
}
}
}
}
catch (Exception ex)
{
Cout.LogError("Loi ham ReadDart: " + ex.ToString());
}
finally
{
try
{
dataInputStream.close();
}
catch (Exception ex2)
{
Cout.LogError("Loi ham reaaDart: " + ex2.ToString());
}
}
}
// Token: 0x06000640 RID: 1600 RVA: 0x0004DB90 File Offset: 0x0004BD90
public void readSkill()
{
DataInputStream dataInputStream = null;
try
{
dataInputStream = new DataInputStream(Rms.loadRMS("NR_skill"));
int num = (int)dataInputStream.readShort();
GameScr.sks = new SkillPaint[Skills.skills.size()];
for (int i = 0; i < num; i++)
{
short num2 = dataInputStream.readShort();
Res.outz("skill id= " + num2);
if (num2 == 1111)
{
num2 = (short)(num - 1);
}
GameScr.sks[(int)num2] = new SkillPaint();
GameScr.sks[(int)num2].id = (int)num2;
GameScr.sks[(int)num2].effectHappenOnMob = (int)dataInputStream.readShort();
if (GameScr.sks[(int)num2].effectHappenOnMob <= 0)
{
GameScr.sks[(int)num2].effectHappenOnMob = 80;
}
GameScr.sks[(int)num2].numEff = (int)dataInputStream.readByte();
GameScr.sks[(int)num2].skillStand = new SkillInfoPaint[(int)dataInputStream.readByte()];
for (int j = 0; j < GameScr.sks[(int)num2].skillStand.Length; j++)
{
GameScr.sks[(int)num2].skillStand[j] = new SkillInfoPaint();
GameScr.sks[(int)num2].skillStand[j].status = (int)dataInputStream.readByte();
GameScr.sks[(int)num2].skillStand[j].effS0Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e0dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e0dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].effS1Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e1dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e1dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].effS2Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e2dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].e2dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].arrowId = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].adx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillStand[j].ady = (int)dataInputStream.readShort();
}
GameScr.sks[(int)num2].skillfly = new SkillInfoPaint[(int)dataInputStream.readByte()];
for (int k = 0; k < GameScr.sks[(int)num2].skillfly.Length; k++)
{
GameScr.sks[(int)num2].skillfly[k] = new SkillInfoPaint();
GameScr.sks[(int)num2].skillfly[k].status = (int)dataInputStream.readByte();
GameScr.sks[(int)num2].skillfly[k].effS0Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e0dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e0dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].effS1Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e1dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e1dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].effS2Id = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e2dx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].e2dy = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].arrowId = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].adx = (int)dataInputStream.readShort();
GameScr.sks[(int)num2].skillfly[k].ady = (int)dataInputStream.readShort();
}
}
}
catch (Exception ex)
{
Cout.LogError("Loi ham readSkill: " + ex.ToString());
}
finally
{
try
{
dataInputStream.close();
}
catch (Exception ex2)
{
Cout.LogError("Loi ham readskill: " + ex2.ToString());
}
}
}
// Token: 0x06000641 RID: 1601 RVA: 0x00006437 File Offset: 0x00004637
public static GameScr gI()
{
if (GameScr.instance == null)
{
GameScr.instance = new GameScr();
}
return GameScr.instance;
}
// Token: 0x06000642 RID: 1602 RVA: 0x0000644F File Offset: 0x0000464F
public static void clearGameScr()
{
GameScr.instance = null;
}
// Token: 0x06000643 RID: 1603 RVA: 0x00006457 File Offset: 0x00004657
public void loadGameScr()
{
GameScr.loadSplash();
Res.init();
this.loadInforBar();
}
// Token: 0x06000644 RID: 1604 RVA: 0x0004E02C File Offset: 0x0004C22C
public void doMenuInforMe()
{
GameScr.scrMain.clear();
GameScr.scrInfo.clear();
GameScr.isViewNext = false;
this.cmdBag = new Command(mResources.MENUME[0], 1100011);
this.cmdSkill = new Command(mResources.MENUME[1], 1100012);
this.cmdTiemnang = new Command(mResources.MENUME[2], 1100013);
this.cmdInfo = new Command(mResources.MENUME[3], 1100014);
this.cmdtrangbi = new Command(mResources.MENUME[4], 1100015);
MyVector myVector = new MyVector();
myVector.addElement(this.cmdBag);
myVector.addElement(this.cmdSkill);
myVector.addElement(this.cmdTiemnang);
myVector.addElement(this.cmdInfo);
myVector.addElement(this.cmdtrangbi);
GameCanvas.menu.startAt(myVector, 3);
}
// Token: 0x06000645 RID: 1605 RVA: 0x0004E114 File Offset: 0x0004C314
public void doMenusynthesis()
{
MyVector myVector = new MyVector();
myVector.addElement(new Command(mResources.SYNTHESIS[0], 110002));
myVector.addElement(new Command(mResources.SYNTHESIS[1], 1100032));
myVector.addElement(new Command(mResources.SYNTHESIS[2], 1100033));
GameCanvas.menu.startAt(myVector, 3);
}
// Token: 0x06000646 RID: 1606 RVA: 0x0004E178 File Offset: 0x0004C378
public static void loadCamera(bool fullmScreen, int cx, int cy)
{
GameScr.gW = GameCanvas.w;
GameScr.cmdBarH = 39;
GameScr.gH = GameCanvas.h;
GameScr.cmdBarW = GameScr.gW;
GameScr.cmdBarX = 0;
GameScr.cmdBarY = GameCanvas.h - Paint.hTab - GameScr.cmdBarH;
GameScr.girlHPBarY = 0;
GameScr.csPadMaxH = GameCanvas.h / 6;
if (GameScr.csPadMaxH < 48)
{
GameScr.csPadMaxH = 48;
}
GameScr.gW2 = GameScr.gW >> 1;
GameScr.gH2 = GameScr.gH >> 1;
GameScr.gW3 = GameScr.gW / 3;
GameScr.gH3 = GameScr.gH / 3;
GameScr.gW23 = GameScr.gH - 120;
GameScr.gH23 = GameScr.gH * 2 / 3;
GameScr.gW34 = 3 * GameScr.gW / 4;
GameScr.gH34 = 3 * GameScr.gH / 4;
GameScr.gW6 = GameScr.gW / 6;
GameScr.gH6 = GameScr.gH / 6;
GameScr.gssw = GameScr.gW / (int)TileMap.size + 2;
GameScr.gssh = GameScr.gH / (int)TileMap.size + 2;
if (GameScr.gW % 24 != 0)
{
GameScr.gssw++;
}
GameScr.cmxLim = (TileMap.tmw - 1) * (int)TileMap.size - GameScr.gW;
GameScr.cmyLim = (TileMap.tmh - 1) * (int)TileMap.size - GameScr.gH;
if (cx == -1 && cy == -1)
{
GameScr.cmx = (GameScr.cmtoX = global::Char.myCharz().cx - GameScr.gW2 + GameScr.gW6 * global::Char.myCharz().cdir);
GameScr.cmy = (GameScr.cmtoY = global::Char.myCharz().cy - GameScr.gH23);
}
else
{
GameScr.cmx = (GameScr.cmtoX = cx - GameScr.gW23 + GameScr.gW6 * global::Char.myCharz().cdir);
GameScr.cmy = (GameScr.cmtoY = cy - GameScr.gH23);
}
GameScr.firstY = GameScr.cmy;
if (GameScr.cmx < 24)
{
GameScr.cmx = (GameScr.cmtoX = 24);
}
if (GameScr.cmx > GameScr.cmxLim)
{
GameScr.cmx = (GameScr.cmtoX = GameScr.cmxLim);
}
if (GameScr.cmy < 0)
{
GameScr.cmy = (GameScr.cmtoY = 0);
}
if (GameScr.cmy > GameScr.cmyLim)
{
GameScr.cmy = (GameScr.cmtoY = GameScr.cmyLim);
}
GameScr.gssx = GameScr.cmx / (int)TileMap.size - 1;
if (GameScr.gssx < 0)
{
GameScr.gssx = 0;
}
GameScr.gssy = GameScr.cmy / (int)TileMap.size;
GameScr.gssxe = GameScr.gssx + GameScr.gssw;
GameScr.gssye = GameScr.gssy + GameScr.gssh;
if (GameScr.gssy < 0)
{
GameScr.gssy = 0;
}
if (GameScr.gssye > TileMap.tmh - 1)
{
GameScr.gssye = TileMap.tmh - 1;
}
TileMap.countx = (GameScr.gssxe - GameScr.gssx) * 4;
if (TileMap.countx > TileMap.tmw)
{
TileMap.countx = TileMap.tmw;
}
TileMap.county = (GameScr.gssye - GameScr.gssy) * 4;
if (TileMap.county > TileMap.tmh)
{
TileMap.county = TileMap.tmh;
}
TileMap.gssx = (global::Char.myCharz().cx - 2 * GameScr.gW) / (int)TileMap.size;
if (TileMap.gssx < 0)
{
TileMap.gssx = 0;
}
TileMap.gssxe = TileMap.gssx + TileMap.countx;
if (TileMap.gssxe > TileMap.tmw)
{
TileMap.gssxe = TileMap.tmw;
}
TileMap.gssy = (global::Char.myCharz().cy - 2 * GameScr.gH) / (int)TileMap.size;
if (TileMap.gssy < 0)
{
TileMap.gssy = 0;
}
TileMap.gssye = TileMap.gssy + TileMap.county;
if (TileMap.gssye > TileMap.tmh)
{
TileMap.gssye = TileMap.tmh;
}
ChatTextField.gI().parentScreen = GameScr.instance;
ChatTextField.gI().tfChat.y = GameCanvas.h - 35 - ChatTextField.gI().tfChat.height;
ChatTextField.gI().initChatTextField();
if (GameCanvas.isTouch)
{
GameScr.yTouchBar = GameScr.gH - 88;
GameScr.xC = GameScr.gW - 40;
GameScr.yC = 2;
if (GameCanvas.w <= 240)
{
GameScr.xC = GameScr.gW - 35;
GameScr.yC = 5;
}
GameScr.xF = GameScr.gW - 55;
GameScr.yF = GameScr.yTouchBar + 35;
GameScr.xTG = GameScr.gW - 37;
GameScr.yTG = GameScr.yTouchBar - 1;
if (GameCanvas.w >= 450)
{
GameScr.yTG -= 12;
GameScr.yHP -= 7;
GameScr.xF -= 10;
GameScr.yF -= 5;
GameScr.xTG -= 10;
}
}
GameScr.setSkillBarPosition();
GameScr.disXC = ((GameCanvas.w <= 200) ? 30 : 40);
if (Rms.loadRMSInt("viewchat") == -1)
{
GameCanvas.panel.isViewChatServer = true;
return;
}
GameCanvas.panel.isViewChatServer = (Rms.loadRMSInt("viewchat") == 1);
}
// Token: 0x06000647 RID: 1607 RVA: 0x0004E680 File Offset: 0x0004C880
public static void setSkillBarPosition()
{
Skill[] array = (!GameCanvas.isTouch) ? GameScr.keySkill : GameScr.onScreenSkill;
GameScr.xS = new int[array.Length];
GameScr.yS = new int[array.Length];
if (GameCanvas.isTouchControlSmallScreen && GameScr.isUseTouch)
{
GameScr.xSkill = 23;
GameScr.ySkill = 52;
GameScr.padSkill = 5;
for (int i = 0; i < GameScr.xS.Length; i++)
{
GameScr.xS[i] = i * (25 + GameScr.padSkill);
GameScr.yS[i] = GameScr.ySkill;
}
GameScr.xHP = array.Length * (25 + GameScr.padSkill);
GameScr.yHP = GameScr.ySkill;
}
else
{
GameScr.wSkill = 30;
if (GameCanvas.w <= 320)
{
GameScr.ySkill = GameScr.gH - GameScr.wSkill - 6;
GameScr.xSkill = GameScr.gW2 - array.Length * GameScr.wSkill / 2 - 25;
}
else
{
GameScr.wSkill = 40;
GameScr.xSkill = 10;
GameScr.ySkill = GameCanvas.h - GameScr.wSkill + 7;
}
for (int j = 0; j < GameScr.xS.Length; j++)
{
GameScr.xS[j] = j * GameScr.wSkill;
GameScr.yS[j] = GameScr.ySkill;
}
GameScr.xHP = array.Length * GameScr.wSkill;
GameScr.yHP = GameScr.ySkill;
}
if (GameCanvas.isTouch)
{
GameScr.xSkill = 17;
GameScr.ySkill = GameCanvas.h - 40;
if (GameScr.gamePad.isSmallGamePad && GameScr.isAnalog == 1)
{
GameScr.xHP = array.Length * GameScr.wSkill;
GameScr.yHP = GameScr.ySkill;
}
else
{
GameScr.xHP = GameCanvas.w - 45;
GameScr.yHP = GameCanvas.h - 45;
}
GameScr.setTouchBtn();
for (int k = 0; k < GameScr.xS.Length; k++)
{
GameScr.xS[k] = k * GameScr.wSkill;
GameScr.yS[k] = GameScr.ySkill;
}
}