forked from gaithern/KH-1FM-AP-LUA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1fmAPConnector.lua
2184 lines (2045 loc) · 93.3 KB
/
1fmAPConnector.lua
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
-----------------------------------
------ Kingdom Hearts 1 FM AP -----
------ by Gicu -----
-----------------------------------
LUAGUI_NAME = "1fmAPConnector"
LUAGUI_AUTH = "Gicu and Krujo"
LUAGUI_DESC = "Kingdom Hearts 1FM AP Integration"
if os.getenv('LOCALAPPDATA') ~= nil then
client_communication_path = os.getenv('LOCALAPPDATA') .. "\\KH1FM\\"
else
client_communication_path = os.getenv('HOME') .. "/KH1FM/"
ok, err, code = os.rename(client_communication_path, client_communication_path)
if not ok and code ~= 13 then
os.execute("mkdir " .. path)
end
end
function toBits(num)
-- returns a table of bits, least significant first.
local t={} -- will contain the bits
while num>0 do
rest=math.fmod(num,2)
t[#t+1]=rest
num=(num-rest)/2
end
return t
end
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
--- Global Variables ---
game_version = 1 --1 for EGS 1.0.0.10, 2 for Steam 1.0.0.10
frame_count = 0
canExecute = false
worlds_unlocked_array = {3, 0, 0, 0, 0, 0, 0, 0, 0, 0}
monstro_unlocked = 0
magic_unlocked_bits = {0, 0, 0, 0, 0, 0, 0}
trinity_bits = {0, 0, 0, 0, 0}
initializing = true
required_reports = 14 --EotW won't appear until you've connected to confirm amount
item_categories = {
equipment = 0,
consumable = 1,
unlock = 2,
ability = 3,
magic = 4,
trinity = 5,
summon = 6,
statsUp = 7,
synthesis = 8,
}
message_cache = {
items = {},
sent = {},
debug = { {} },
locationID = -1,
}
prompt_colours = {
blue_donald = -8,
green_goofy = -4,
red_sora = 0,
purple_evil = 4,
green_goofy_dark = 8,
purple_pink = 12,
blue_light = 16,
green_mint = 20,
orange = 24,
violet = 28,
green_goofy_intensiv = 32,
purple_pink_intensiv = 36,
blue_light_intensiv = 40,
red_rose = 64,
red_trap = 140
}
item_usefulness = {
trap = 0,
useless = 1,
normal = 2,
progression = 3,
special = 4,
}
colourOffsetIterator = -8
--- Definitions ---
function define_items()
items = {
--Consumables
{ ID = 2640000, Name = "Victory", Usefulness = item_usefulness.special },
{ ID = 2641001, Name = "Potion", },
{ ID = 2641002, Name = "Hi-Potion", },
{ ID = 2641003, Name = "Ether", },
{ ID = 2641004, Name = "Elixir", },
{ ID = 2641005, Name = "BO5" },
{ ID = 2641006, Name = "Mega-Potion", },
{ ID = 2641007, Name = "Mega-Ether", },
{ ID = 2641008, Name = "Megalixir", },
--Synthesis
{ ID = 2641009, Name = "Fury Stone" },
{ ID = 2641010, Name = "Power Stone" },
{ ID = 2641011, Name = "Energy Stone" },
{ ID = 2641012, Name = "Blazing Stone" },
{ ID = 2641013, Name = "Frost Stone" },
{ ID = 2641014, Name = "Lightning Stone" },
{ ID = 2641015, Name = "Dazzling Stone" },
{ ID = 2641016, Name = "Stormy Stone" },
--Equipment
{ ID = 2641017, Name = "Protect Chain" },
{ ID = 2641018, Name = "Protera Chain" },
{ ID = 2641019, Name = "Protega Chain" },
{ ID = 2641020, Name = "Fire Ring" },
{ ID = 2641021, Name = "Fira Ring" },
{ ID = 2641022, Name = "Firaga Ring" },
{ ID = 2641023, Name = "Blizzard Ring" },
{ ID = 2641024, Name = "Blizzara Ring" },
{ ID = 2641025, Name = "Blizzaga Ring" },
{ ID = 2641026, Name = "Thunder Ring" },
{ ID = 2641027, Name = "Thundara Ring" },
{ ID = 2641028, Name = "Thundaga Ring" },
{ ID = 2641029, Name = "Ability Stud" },
{ ID = 2641030, Name = "Guard Earring" },
{ ID = 2641031, Name = "Master Earring" },
{ ID = 2641032, Name = "Chaos Ring" },
{ ID = 2641033, Name = "Dark Ring" },
{ ID = 2641034, Name = "Element Ring" },
{ ID = 2641035, Name = "Three Stars" },
{ ID = 2641036, Name = "Power Chain" },
{ ID = 2641037, Name = "Golem Chain" },
{ ID = 2641038, Name = "Titan Chain" },
{ ID = 2641039, Name = "Energy Bangle" },
{ ID = 2641040, Name = "Angel Bangle" },
{ ID = 2641041, Name = "Gaia Bangle" },
{ ID = 2641042, Name = "Magic Armlet" },
{ ID = 2641043, Name = "Rune Armlet" },
{ ID = 2641044, Name = "Atlas Armlet" },
{ ID = 2641045, Name = "Heartguard" },
{ ID = 2641046, Name = "Ribbon" },
{ ID = 2641047, Name = "Crystal Crown" },
{ ID = 2641048, Name = "Brave Warrior" },
{ ID = 2641049, Name = "Ifrit's Horn" },
{ ID = 2641050, Name = "Inferno Band" },
{ ID = 2641051, Name = "White Fang" },
{ ID = 2641052, Name = "Ray of Light" },
{ ID = 2641053, Name = "Holy Circlet" },
{ ID = 2641054, Name = "Raven's Claw" },
{ ID = 2641055, Name = "Omega Arts" },
{ ID = 2641056, Name = "EXP Earring" },
{ ID = 2641057, Name = "A41" },
{ ID = 2641058, Name = "EXP Ring" },
{ ID = 2641059, Name = "EXP Bracelet" },
{ ID = 2641060, Name = "EXP Necklace" },
{ ID = 2641061, Name = "Firagun Band" },
{ ID = 2641062, Name = "Blizzagun Band" },
{ ID = 2641063, Name = "Thundagun Band" },
{ ID = 2641064, Name = "Ifrit Belt" },
{ ID = 2641065, Name = "Shiva Belt" },
{ ID = 2641066, Name = "Ramuh Belt" },
{ ID = 2641067, Name = "Moogle Badge" },
{ ID = 2641068, Name = "Cosmic Arts" },
{ ID = 2641069, Name = "Royal Crown" },
{ ID = 2641070, Name = "Prime Cap" },
{ ID = 2641071, Name = "Obsidian Ring" },
{ ID = 2641072, Name = "A56" },
{ ID = 2641073, Name = "A57" },
{ ID = 2641074, Name = "A58" },
{ ID = 2641075, Name = "A59" },
{ ID = 2641076, Name = "A60" },
{ ID = 2641077, Name = "A61" },
{ ID = 2641078, Name = "A62" },
{ ID = 2641079, Name = "A63" },
{ ID = 2641080, Name = "A64" },
{ ID = 2641081, Name = "Kingdom Key" },
{ ID = 2641082, Name = "Dream Sword" },
{ ID = 2641083, Name = "Dream Shield" },
{ ID = 2641084, Name = "Dream Rod" },
{ ID = 2641085, Name = "Wooden Sword" },
{ ID = 2641086, Name = "Jungle King" , Usefulness = item_usefulness.progression },
{ ID = 2641087, Name = "Three Wishes", Usefulness = item_usefulness.progression },
{ ID = 2641088, Name = "Fairy Harp", Usefulness = item_usefulness.progression },
{ ID = 2641089, Name = "Pumpkinhead", Usefulness = item_usefulness.progression },
{ ID = 2641090, Name = "Crabclaw"},
{ ID = 2641091, Name = "Divine Rose", Usefulness = item_usefulness.progression },
{ ID = 2641092, Name = "Spellbinder" },
{ ID = 2641093, Name = "Olympia", Usefulness = item_usefulness.progression },
{ ID = 2641094, Name = "Lionheart", Usefulness = item_usefulness.progression },
{ ID = 2641095, Name = "Metal Chocobo" },
{ ID = 2641096, Name = "Oathkeeper", Usefulness = item_usefulness.progression },
{ ID = 2641097, Name = "Oblivion", Usefulness = item_usefulness.progression },
{ ID = 2641098, Name = "Lady Luck", Usefulness = item_usefulness.progression },
{ ID = 2641099, Name = "Wishing Star", Usefulness = item_usefulness.progression },
{ ID = 2641100, Name = "Ultima Weapon" },
{ ID = 2641101, Name = "Diamond Dust" },
{ ID = 2641102, Name = "One-Winged Angel" },
{ ID = 2641103, Name = "Mage's Staff" },
{ ID = 2641104, Name = "Morning Star" },
{ ID = 2641105, Name = "Shooting Star" },
{ ID = 2641106, Name = "Magus Staff" },
{ ID = 2641107, Name = "Wisdom Staff" },
{ ID = 2641108, Name = "Warhammer" },
{ ID = 2641109, Name = "Silver Mallet" },
{ ID = 2641110, Name = "Grand Mallet" },
{ ID = 2641111, Name = "Lord Fortune" },
{ ID = 2641112, Name = "Violetta" },
{ ID = 2641113, Name = "Dream Rod (Donald)" },
{ ID = 2641114, Name = "Save the Queen" },
{ ID = 2641115, Name = "Wizard's Relic" },
{ ID = 2641116, Name = "Meteor Strike" },
{ ID = 2641117, Name = "Fantasista" },
{ ID = 2641118, Name = "Unused (Donald)" },
{ ID = 2641119, Name = "Knight's Shield" },
{ ID = 2641120, Name = "Mythril Shield" },
{ ID = 2641121, Name = "Onyx Shield" },
{ ID = 2641122, Name = "Stout Shield" },
{ ID = 2641123, Name = "Golem Shield" },
{ ID = 2641124, Name = "Adamant Shield" },
{ ID = 2641125, Name = "Smasher" },
{ ID = 2641126, Name = "Gigas Fist" },
{ ID = 2641127, Name = "Genji Shield" },
{ ID = 2641128, Name = "Herc's Shield" },
{ ID = 2641129, Name = "Dream Shield (Goofy)" },
{ ID = 2641130, Name = "Save the King" },
{ ID = 2641131, Name = "Defender" },
{ ID = 2641132, Name = "Mighty Shield" },
{ ID = 2641133, Name = "Seven Elements" },
{ ID = 2641134, Name = "Unused (Goofy)" },
{ ID = 2641135, Name = "Spear" },
{ ID = 2641136, Name = "No Weapon" },
{ ID = 2641137, Name = "Genie" },
{ ID = 2641138, Name = "No Weapon" },
{ ID = 2641139, Name = "No Weapon" },
{ ID = 2641140, Name = "Tinker Bell" },
{ ID = 2641141, Name = "Claws" },
{ ID = 2641142, Name = "Tent" },
{ ID = 2641143, Name = "Camping Set" },
{ ID = 2641144, Name = "Cottage" },
{ ID = 2641145, Name = "C04" },
{ ID = 2641146, Name = "C05" },
{ ID = 2641147, Name = "C06" },
{ ID = 2641148, Name = "C07" },
{ ID = 2641149, Name = "Ansem's Report 11", Usefulness = item_usefulness.progression },
{ ID = 2641150, Name = "Ansem's Report 12", Usefulness = item_usefulness.progression },
{ ID = 2641151, Name = "Ansem's Report 13", Usefulness = item_usefulness.progression },
{ ID = 2641152, Name = "Power Up" },
{ ID = 2641153, Name = "Defense Up" },
{ ID = 2641154, Name = "AP Up" },
{ ID = 2641155, Name = "Serenity Power" },
{ ID = 2641156, Name = "Dark Matter" },
{ ID = 2641157, Name = "Mythril Stone" },
{ ID = 2641158, Name = "Fire Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641159, Name = "Blizzard Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641160, Name = "Thunder Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641161, Name = "Cure Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641162, Name = "Gravity Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641163, Name = "Stop Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641164, Name = "Aero Arts" , Usefulness = item_usefulness.progression },
{ ID = 2641165, Name = "Shiitank Rank" },
{ ID = 2641166, Name = "Matsutake Rank" },
{ ID = 2641167, Name = "Mystery Mold" },
{ ID = 2641168, Name = "Ansem's Report 1", Usefulness = item_usefulness.progression },
{ ID = 2641169, Name = "Ansem's Report 2", Usefulness = item_usefulness.progression },
{ ID = 2641170, Name = "Ansem's Report 3", Usefulness = item_usefulness.progression },
{ ID = 2641171, Name = "Ansem's Report 4", Usefulness = item_usefulness.progression },
{ ID = 2641172, Name = "Ansem's Report 5", Usefulness = item_usefulness.progression },
{ ID = 2641173, Name = "Ansem's Report 6", Usefulness = item_usefulness.progression },
{ ID = 2641174, Name = "Ansem's Report 7", Usefulness = item_usefulness.progression },
{ ID = 2641175, Name = "Ansem's Report 8", Usefulness = item_usefulness.progression },
{ ID = 2641176, Name = "Ansem's Report 9", Usefulness = item_usefulness.progression },
{ ID = 2641177, Name = "Ansem's Report 10", Usefulness = item_usefulness.progression },
{ ID = 2641178, Name = "Khama Vol. 8" , Usefulness = item_usefulness.progression },
{ ID = 2641179, Name = "Salegg Vol. 6" , Usefulness = item_usefulness.progression },
{ ID = 2641180, Name = "Azal Vol. 3" , Usefulness = item_usefulness.progression },
{ ID = 2641181, Name = "Mava Vol. 3" , Usefulness = item_usefulness.progression },
{ ID = 2641182, Name = "Mava Vol. 6" , Usefulness = item_usefulness.progression },
{ ID = 2641183, Name = "Theon Vol. 6" , Usefulness = item_usefulness.progression },
{ ID = 2641184, Name = "Nahara Vol. 5", Usefulness = item_usefulness.progression },
{ ID = 2641185, Name = "Hafet Vol. 4", Usefulness = item_usefulness.progression },
{ ID = 2641186, Name = "Empty Bottle" , Usefulness = item_usefulness.progression },
{ ID = 2641187, Name = "Old Book" , Usefulness = item_usefulness.progression },
{ ID = 2641188, Name = "Emblem Piece (Flame)", Usefulness = item_usefulness.progression },
{ ID = 2641189, Name = "Emblem Piece (Chest)", Usefulness = item_usefulness.progression },
{ ID = 2641190, Name = "Emblem Piece (Statue)", Usefulness = item_usefulness.progression },
{ ID = 2641191, Name = "Emblem Piece (Fountain)", Usefulness = item_usefulness.progression },
{ ID = 2641192, Name = "Log" },
{ ID = 2641193, Name = "Cloth" },
{ ID = 2641194, Name = "Rope" },
{ ID = 2641195, Name = "Seagull Egg" },
{ ID = 2641196, Name = "Fish" },
{ ID = 2641197, Name = "Mushroom" },
{ ID = 2641198, Name = "Coconut" },
{ ID = 2641199, Name = "Drinking Water" },
{ ID = 2641200, Name = "Navi-G Piece 1" },
{ ID = 2641201, Name = "Navi-G Piece 2" },
{ ID = 2641202, Name = "Navi-Gummi Unused" },
{ ID = 2641203, Name = "Navi-G Piece 3" },
{ ID = 2641204, Name = "Navi-G Piece 4" },
{ ID = 2641205, Name = "Navi-Gummi" },
{ ID = 2641206, Name = "Watergleam" , Usefulness = item_usefulness.progression },
{ ID = 2641207, Name = "Naturespark" , Usefulness = item_usefulness.progression },
{ ID = 2641208, Name = "Fireglow", Usefulness = item_usefulness.progression },
{ ID = 2641209, Name = "Earthshine" },
{ ID = 2641210, Name = "Crystal Trident", Usefulness = item_usefulness.progression },
{ ID = 2641211, Name = "Postcard", Usefulness = item_usefulness.progression },
{ ID = 2641212, Name = "Torn Page" , Usefulness = item_usefulness.progression },
{ ID = 2641213, Name = "Torn Page" , Usefulness = item_usefulness.progression },
{ ID = 2641214, Name = "Torn Page" , Usefulness = item_usefulness.progression },
{ ID = 2641215, Name = "Torn Page" , Usefulness = item_usefulness.progression },
{ ID = 2641216, Name = "Torn Page" , Usefulness = item_usefulness.progression },
{ ID = 2641217, Name = "Slides", Usefulness = item_usefulness.progression },
{ ID = 2641218, Name = "Slide 2" },
{ ID = 2641219, Name = "Slide 3" },
{ ID = 2641220, Name = "Slide 4" },
{ ID = 2641221, Name = "Slide 5" },
{ ID = 2641222, Name = "Slide 6" },
{ ID = 2641223, Name = "Footprints", Usefulness = item_usefulness.progression },
{ ID = 2641224, Name = "Claw Marks" },
{ ID = 2641225, Name = "Stench" },
{ ID = 2641226, Name = "Antenna" },
{ ID = 2641227, Name = "Forget-Me-Not", Usefulness = item_usefulness.progression },
{ ID = 2641228, Name = "Jack-In-The-Box", Usefulness = item_usefulness.progression },
{ ID = 2641229, Name = "Entry Pass", Usefulness = item_usefulness.progression },
{ ID = 2641230, Name = "Hero License" },
{ ID = 2641231, Name = "Pretty Stone" },
{ ID = 2641232, Name = "N41" },
{ ID = 2641233, Name = "Lucid Shard" },
{ ID = 2641234, Name = "Lucid Gem" },
{ ID = 2641235, Name = "Lucid Crystal" },
{ ID = 2641236, Name = "Spirit Shard" },
{ ID = 2641237, Name = "Spirit Gem" },
{ ID = 2641238, Name = "Power Shard" },
{ ID = 2641239, Name = "Power Gem" },
{ ID = 2641240, Name = "Power Crystal" },
{ ID = 2641241, Name = "Blaze Shard" },
{ ID = 2641242, Name = "Blaze Gem" },
{ ID = 2641243, Name = "Frost Shard" },
{ ID = 2641244, Name = "Frost Gem" },
{ ID = 2641245, Name = "Thunder Shard" },
{ ID = 2641246, Name = "Thunder Gem" },
{ ID = 2641247, Name = "Shiny Crystal" },
{ ID = 2641248, Name = "Bright Shard" },
{ ID = 2641249, Name = "Bright Gem" },
{ ID = 2641250, Name = "Bright Crystal" },
{ ID = 2641251, Name = "Mystery Goo" },
{ ID = 2641252, Name = "Gale" },
{ ID = 2641253, Name = "Mythril Shard" },
{ ID = 2641254, Name = "Mythril" },
{ ID = 2641255, Name = "Orichalcum" },
-- Abilities
{ ID = 2642001, Name = "High Jump", Usefulness = item_usefulness.progression },
{ ID = 2642002, Name = "Mermaid Kick", Usefulness = item_usefulness.progression },
{ ID = 2642003, Name = "Progressive Glide", Usefulness = item_usefulness.progression },
{ ID = 2642004, Name = "Superglide", Usefulness = item_usefulness.progression },
{ ID = 2642101, Name = "Puppy 01", Usefulness = item_usefulness.progression },
{ ID = 2642102, Name = "Puppy 02", Usefulness = item_usefulness.progression },
{ ID = 2642103, Name = "Puppy 03", Usefulness = item_usefulness.progression },
{ ID = 2642104, Name = "Puppy 04", Usefulness = item_usefulness.progression },
{ ID = 2642105, Name = "Puppy 05", Usefulness = item_usefulness.progression },
{ ID = 2642106, Name = "Puppy 06", Usefulness = item_usefulness.progression },
{ ID = 2642107, Name = "Puppy 07", Usefulness = item_usefulness.progression },
{ ID = 2642108, Name = "Puppy 08", Usefulness = item_usefulness.progression },
{ ID = 2642109, Name = "Puppy 09", Usefulness = item_usefulness.progression },
{ ID = 2642110, Name = "Puppy 10", Usefulness = item_usefulness.progression },
{ ID = 2642111, Name = "Puppy 11", Usefulness = item_usefulness.progression },
{ ID = 2642112, Name = "Puppy 12", Usefulness = item_usefulness.progression },
{ ID = 2642113, Name = "Puppy 13", Usefulness = item_usefulness.progression },
{ ID = 2642114, Name = "Puppy 14", Usefulness = item_usefulness.progression },
{ ID = 2642115, Name = "Puppy 15", Usefulness = item_usefulness.progression },
{ ID = 2642116, Name = "Puppy 16", Usefulness = item_usefulness.progression },
{ ID = 2642117, Name = "Puppy 17", Usefulness = item_usefulness.progression },
{ ID = 2642118, Name = "Puppy 18", Usefulness = item_usefulness.progression },
{ ID = 2642119, Name = "Puppy 19", Usefulness = item_usefulness.progression },
{ ID = 2642120, Name = "Puppy 20", Usefulness = item_usefulness.progression },
{ ID = 2642121, Name = "Puppy 21", Usefulness = item_usefulness.progression },
{ ID = 2642122, Name = "Puppy 22", Usefulness = item_usefulness.progression },
{ ID = 2642123, Name = "Puppy 23", Usefulness = item_usefulness.progression },
{ ID = 2642124, Name = "Puppy 24", Usefulness = item_usefulness.progression },
{ ID = 2642125, Name = "Puppy 25", Usefulness = item_usefulness.progression },
{ ID = 2642126, Name = "Puppy 26", Usefulness = item_usefulness.progression },
{ ID = 2642127, Name = "Puppy 27", Usefulness = item_usefulness.progression },
{ ID = 2642128, Name = "Puppy 28", Usefulness = item_usefulness.progression },
{ ID = 2642129, Name = "Puppy 29", Usefulness = item_usefulness.progression },
{ ID = 2642130, Name = "Puppy 30", Usefulness = item_usefulness.progression },
{ ID = 2642131, Name = "Puppy 31", Usefulness = item_usefulness.progression },
{ ID = 2642132, Name = "Puppy 32", Usefulness = item_usefulness.progression },
{ ID = 2642133, Name = "Puppy 33", Usefulness = item_usefulness.progression },
{ ID = 2642134, Name = "Puppy 34", Usefulness = item_usefulness.progression },
{ ID = 2642135, Name = "Puppy 35", Usefulness = item_usefulness.progression },
{ ID = 2642136, Name = "Puppy 36", Usefulness = item_usefulness.progression },
{ ID = 2642137, Name = "Puppy 37", Usefulness = item_usefulness.progression },
{ ID = 2642138, Name = "Puppy 38", Usefulness = item_usefulness.progression },
{ ID = 2642139, Name = "Puppy 39", Usefulness = item_usefulness.progression },
{ ID = 2642140, Name = "Puppy 40", Usefulness = item_usefulness.progression },
{ ID = 2642141, Name = "Puppy 41", Usefulness = item_usefulness.progression },
{ ID = 2642142, Name = "Puppy 42", Usefulness = item_usefulness.progression },
{ ID = 2642143, Name = "Puppy 43", Usefulness = item_usefulness.progression },
{ ID = 2642144, Name = "Puppy 44", Usefulness = item_usefulness.progression },
{ ID = 2642145, Name = "Puppy 45", Usefulness = item_usefulness.progression },
{ ID = 2642146, Name = "Puppy 46", Usefulness = item_usefulness.progression },
{ ID = 2642147, Name = "Puppy 47", Usefulness = item_usefulness.progression },
{ ID = 2642148, Name = "Puppy 48", Usefulness = item_usefulness.progression },
{ ID = 2642149, Name = "Puppy 49", Usefulness = item_usefulness.progression },
{ ID = 2642150, Name = "Puppy 50", Usefulness = item_usefulness.progression },
{ ID = 2642151, Name = "Puppy 51", Usefulness = item_usefulness.progression },
{ ID = 2642152, Name = "Puppy 52", Usefulness = item_usefulness.progression },
{ ID = 2642153, Name = "Puppy 53", Usefulness = item_usefulness.progression },
{ ID = 2642154, Name = "Puppy 54", Usefulness = item_usefulness.progression },
{ ID = 2642155, Name = "Puppy 55", Usefulness = item_usefulness.progression },
{ ID = 2642156, Name = "Puppy 56", Usefulness = item_usefulness.progression },
{ ID = 2642157, Name = "Puppy 57", Usefulness = item_usefulness.progression },
{ ID = 2642158, Name = "Puppy 58", Usefulness = item_usefulness.progression },
{ ID = 2642159, Name = "Puppy 59", Usefulness = item_usefulness.progression },
{ ID = 2642160, Name = "Puppy 60", Usefulness = item_usefulness.progression },
{ ID = 2642161, Name = "Puppy 61", Usefulness = item_usefulness.progression },
{ ID = 2642162, Name = "Puppy 62", Usefulness = item_usefulness.progression },
{ ID = 2642163, Name = "Puppy 63", Usefulness = item_usefulness.progression },
{ ID = 2642164, Name = "Puppy 64", Usefulness = item_usefulness.progression },
{ ID = 2642165, Name = "Puppy 65", Usefulness = item_usefulness.progression },
{ ID = 2642166, Name = "Puppy 66", Usefulness = item_usefulness.progression },
{ ID = 2642167, Name = "Puppy 67", Usefulness = item_usefulness.progression },
{ ID = 2642168, Name = "Puppy 68", Usefulness = item_usefulness.progression },
{ ID = 2642169, Name = "Puppy 69", Usefulness = item_usefulness.progression },
{ ID = 2642170, Name = "Puppy 70", Usefulness = item_usefulness.progression },
{ ID = 2642171, Name = "Puppy 71", Usefulness = item_usefulness.progression },
{ ID = 2642172, Name = "Puppy 72", Usefulness = item_usefulness.progression },
{ ID = 2642173, Name = "Puppy 73", Usefulness = item_usefulness.progression },
{ ID = 2642174, Name = "Puppy 74", Usefulness = item_usefulness.progression },
{ ID = 2642175, Name = "Puppy 75", Usefulness = item_usefulness.progression },
{ ID = 2642176, Name = "Puppy 76", Usefulness = item_usefulness.progression },
{ ID = 2642177, Name = "Puppy 77", Usefulness = item_usefulness.progression },
{ ID = 2642178, Name = "Puppy 78", Usefulness = item_usefulness.progression },
{ ID = 2642179, Name = "Puppy 79", Usefulness = item_usefulness.progression },
{ ID = 2642180, Name = "Puppy 80", Usefulness = item_usefulness.progression },
{ ID = 2642181, Name = "Puppy 81", Usefulness = item_usefulness.progression },
{ ID = 2642182, Name = "Puppy 82", Usefulness = item_usefulness.progression },
{ ID = 2642183, Name = "Puppy 83", Usefulness = item_usefulness.progression },
{ ID = 2642184, Name = "Puppy 84", Usefulness = item_usefulness.progression },
{ ID = 2642185, Name = "Puppy 85", Usefulness = item_usefulness.progression },
{ ID = 2642186, Name = "Puppy 86", Usefulness = item_usefulness.progression },
{ ID = 2642187, Name = "Puppy 87", Usefulness = item_usefulness.progression },
{ ID = 2642188, Name = "Puppy 88", Usefulness = item_usefulness.progression },
{ ID = 2642189, Name = "Puppy 89", Usefulness = item_usefulness.progression },
{ ID = 2642190, Name = "Puppy 90", Usefulness = item_usefulness.progression },
{ ID = 2642191, Name = "Puppy 91", Usefulness = item_usefulness.progression },
{ ID = 2642192, Name = "Puppy 92", Usefulness = item_usefulness.progression },
{ ID = 2642193, Name = "Puppy 93", Usefulness = item_usefulness.progression },
{ ID = 2642194, Name = "Puppy 94", Usefulness = item_usefulness.progression },
{ ID = 2642195, Name = "Puppy 95", Usefulness = item_usefulness.progression },
{ ID = 2642196, Name = "Puppy 96", Usefulness = item_usefulness.progression },
{ ID = 2642197, Name = "Puppy 97", Usefulness = item_usefulness.progression },
{ ID = 2642198, Name = "Puppy 98", Usefulness = item_usefulness.progression },
{ ID = 2642199, Name = "Puppy 99", Usefulness = item_usefulness.progression },
{ ID = 2642201, Name = "Puppies 01-03", Usefulness = item_usefulness.progression },
{ ID = 2642202, Name = "Puppies 04-06", Usefulness = item_usefulness.progression },
{ ID = 2642203, Name = "Puppies 07-09", Usefulness = item_usefulness.progression },
{ ID = 2642204, Name = "Puppies 10-12", Usefulness = item_usefulness.progression },
{ ID = 2642205, Name = "Puppies 13-15", Usefulness = item_usefulness.progression },
{ ID = 2642206, Name = "Puppies 16-18", Usefulness = item_usefulness.progression },
{ ID = 2642207, Name = "Puppies 19-21", Usefulness = item_usefulness.progression },
{ ID = 2642208, Name = "Puppies 22-24", Usefulness = item_usefulness.progression },
{ ID = 2642209, Name = "Puppies 25-27", Usefulness = item_usefulness.progression },
{ ID = 2642210, Name = "Puppies 28-30", Usefulness = item_usefulness.progression },
{ ID = 2642211, Name = "Puppies 31-33", Usefulness = item_usefulness.progression },
{ ID = 2642212, Name = "Puppies 34-36", Usefulness = item_usefulness.progression },
{ ID = 2642213, Name = "Puppies 37-39", Usefulness = item_usefulness.progression },
{ ID = 2642214, Name = "Puppies 40-42", Usefulness = item_usefulness.progression },
{ ID = 2642215, Name = "Puppies 43-45", Usefulness = item_usefulness.progression },
{ ID = 2642216, Name = "Puppies 46-48", Usefulness = item_usefulness.progression },
{ ID = 2642217, Name = "Puppies 49-51", Usefulness = item_usefulness.progression },
{ ID = 2642218, Name = "Puppies 52-54", Usefulness = item_usefulness.progression },
{ ID = 2642219, Name = "Puppies 55-57", Usefulness = item_usefulness.progression },
{ ID = 2642220, Name = "Puppies 58-60", Usefulness = item_usefulness.progression },
{ ID = 2642221, Name = "Puppies 61-63", Usefulness = item_usefulness.progression },
{ ID = 2642222, Name = "Puppies 64-66", Usefulness = item_usefulness.progression },
{ ID = 2642223, Name = "Puppies 67-69", Usefulness = item_usefulness.progression },
{ ID = 2642224, Name = "Puppies 70-72", Usefulness = item_usefulness.progression },
{ ID = 2642225, Name = "Puppies 73-75", Usefulness = item_usefulness.progression },
{ ID = 2642226, Name = "Puppies 76-78", Usefulness = item_usefulness.progression },
{ ID = 2642227, Name = "Puppies 79-81", Usefulness = item_usefulness.progression },
{ ID = 2642228, Name = "Puppies 82-84", Usefulness = item_usefulness.progression },
{ ID = 2642229, Name = "Puppies 85-87", Usefulness = item_usefulness.progression },
{ ID = 2642230, Name = "Puppies 88-90", Usefulness = item_usefulness.progression },
{ ID = 2642231, Name = "Puppies 91-93", Usefulness = item_usefulness.progression },
{ ID = 2642232, Name = "Puppies 94-96", Usefulness = item_usefulness.progression },
{ ID = 2642233, Name = "Puppies 97-99", Usefulness = item_usefulness.progression },
{ ID = 2642240, Name = "All Puppies", Usefulness = item_usefulness.progression },
{ ID = 2643005, Name = "Treasure Magnet" },
{ ID = 2643006, Name = "Combo Plus" },
{ ID = 2643007, Name = "Air Combo Plus" },
{ ID = 2643008, Name = "Critical Plus" },
{ ID = 2643009, Name = "Second Wind" },
{ ID = 2643010, Name = "Scan" },
{ ID = 2643011, Name = "Sonic Blade" },
{ ID = 2643012, Name = "Ars Arcanum" },
{ ID = 2643013, Name = "Strike Raid" },
{ ID = 2643014, Name = "Ragnarok" },
{ ID = 2643015, Name = "Trinity Limit" },
{ ID = 2643016, Name = "Cheer" },
{ ID = 2643017, Name = "Vortex" },
{ ID = 2643018, Name = "Aerial Sweep" },
{ ID = 2643019, Name = "Counterattack" },
{ ID = 2643020, Name = "Blitz" },
{ ID = 2643021, Name = "Guard" , Usefulness = item_usefulness.progression },
{ ID = 2643022, Name = "Dodge Roll" , Usefulness = item_usefulness.progression },
{ ID = 2643023, Name = "MP Haste" },
{ ID = 2643024, Name = "MP Rage", Usefulness = item_usefulness.progression },
{ ID = 2643025, Name = "Second Chance", Usefulness = item_usefulness.progression },
{ ID = 2643026, Name = "Berserk" },
{ ID = 2643027, Name = "Jackpot" },
{ ID = 2643028, Name = "Lucky Strike" },
{ ID = 2643029, Name = "Charge" },
{ ID = 2643030, Name = "Rocket" },
{ ID = 2643031, Name = "Tornado" },
{ ID = 2643032, Name = "MP Gift" },
{ ID = 2643033, Name = "Raging Boar" },
{ ID = 2643034, Name = "Asp's Bite" },
{ ID = 2643035, Name = "Healing Herb" },
{ ID = 2643036, Name = "Wind Armor" },
{ ID = 2643037, Name = "Crescent" },
{ ID = 2643038, Name = "Sandstorm" },
{ ID = 2643039, Name = "Applause!" },
{ ID = 2643040, Name = "Blazing Fury" },
{ ID = 2643041, Name = "Icy Terror" },
{ ID = 2643042, Name = "Bolts of Sorrow" },
{ ID = 2643043, Name = "Ghostly Scream" },
{ ID = 2643044, Name = "Humming Bird" },
{ ID = 2643045, Name = "Time-Out" },
{ ID = 2643046, Name = "Storm's Eye" },
{ ID = 2643047, Name = "Ferocious Lunge" },
{ ID = 2643048, Name = "Furious Bellow" },
{ ID = 2643049, Name = "Spiral Wave" },
{ ID = 2643050, Name = "Thunder Potion" },
{ ID = 2643051, Name = "Cure Potion" },
{ ID = 2643052, Name = "Aero Potion" },
{ ID = 2643053, Name = "Slapshot" },
{ ID = 2643054, Name = "Sliding Dash" },
{ ID = 2643055, Name = "Hurricane Blast" },
{ ID = 2643056, Name = "Ripple Drive" },
{ ID = 2643057, Name = "Stun Impact" },
{ ID = 2643058, Name = "Gravity Break" },
{ ID = 2643059, Name = "Zantetsuken" },
{ ID = 2643060, Name = "Tech Boost" },
{ ID = 2643061, Name = "Encounter Plus" },
{ ID = 2643062, Name = "Leaf Bracer", Usefulness = item_usefulness.progression },
{ ID = 2643063, Name = "Evolution" },
{ ID = 2643064, Name = "EXP Zero" },
{ ID = 2643065, Name = "Combo Master", Usefulness = item_usefulness.progression },
--Stats Up
{ ID = 2644001, Name = "Max HP Increase" },
{ ID = 2644002, Name = "Max MP Increase" },
{ ID = 2644003, Name = "Max AP Increase" },
{ ID = 2644004, Name = "Strength Increase" },
{ ID = 2644005, Name = "Defense Increase" },
{ ID = 2644006, Name = "Accessory Slot Increase" },
{ ID = 2644007, Name = "Item Slot Increase" },
--Summons
{ ID = 2645000, Name = "Dumbo" , Usefulness = item_usefulness.progression },
{ ID = 2645001, Name = "Bambi" , Usefulness = item_usefulness.progression },
{ ID = 2645002, Name = "Genie" , Usefulness = item_usefulness.progression },
{ ID = 2645003, Name = "Tinker Bell" , Usefulness = item_usefulness.progression },
{ ID = 2645004, Name = "Mushu" , Usefulness = item_usefulness.progression },
{ ID = 2645005, Name = "Simba" , Usefulness = item_usefulness.progression },
--Magic
{ ID = 2646001, Name = "Progressive Fire", Usefulness = item_usefulness.progression },
{ ID = 2646002, Name = "Progressive Blizzard", Usefulness = item_usefulness.progression },
{ ID = 2646003, Name = "Progressive Thunder", Usefulness = item_usefulness.progression },
{ ID = 2646004, Name = "Progressive Cure", Usefulness = item_usefulness.progression },
{ ID = 2646005, Name = "Progressive Gravity", Usefulness = item_usefulness.progression },
{ ID = 2646006, Name = "Progressive Stop", Usefulness = item_usefulness.progression },
{ ID = 2646007, Name = "Progressive Aero", Usefulness = item_usefulness.progression },
--World unlocks
{ ID = 2647002, Name = "Wonderland", Usefulness = item_usefulness.progression },
{ ID = 2647003, Name = "Olympus Coliseum", Usefulness = item_usefulness.progression },
{ ID = 2647004, Name = "Deep Jungle", Usefulness = item_usefulness.progression },
{ ID = 2647005, Name = "Agrabah", Usefulness = item_usefulness.progression },
{ ID = 2647006, Name = "Halloween Town", Usefulness = item_usefulness.progression },
{ ID = 2647007, Name = "Atlantica", Usefulness = item_usefulness.progression },
{ ID = 2647008, Name = "Neverland", Usefulness = item_usefulness.progression },
{ ID = 2647009, Name = "Hollow Bastion", Usefulness = item_usefulness.progression },
{ ID = 2647010, Name = "End of the World", Usefulness = item_usefulness.progression },
{ ID = 2647011, Name = "Monstro", Usefulness = item_usefulness.progression },
--Trinities
{ ID = 2648001, Name = "Blue Trinity", Usefulness = item_usefulness.progression },
{ ID = 2648002, Name = "Red Trinity", Usefulness = item_usefulness.progression },
{ ID = 2648003, Name = "Green Trinity", Usefulness = item_usefulness.progression },
{ ID = 2648004, Name = "Yellow Trinity", Usefulness = item_usefulness.progression },
{ ID = 2648005, Name = "White Trinity", Usefulness = item_usefulness.progression },
--Cups
{ ID = 2649001, Name = "Phil Cup", Usefulness = item_usefulness.progression },
{ ID = 2649002, Name = "Pegasus Cup", Usefulness = item_usefulness.progression },
{ ID = 2649003, Name = "Hercules Cup", Usefulness = item_usefulness.progression },
{ ID = 2649004, Name = "Hades Cup", Usefulness = item_usefulness.progression },
}
return items
end
local items = define_items()
function get_item_by_id(item_id)
for i = 1, #items do
if items[i].ID == item_id then
return items[i]
end
end
end
function define_world_progress_location_threshholds()
--[[Defines an array of location_ids based on thressholds on story progress bytes.
This information is being obtained from https://retroachievements.org/codenotes.php?g=2780]]
world_progress_location_threshholds = {}
--Traverse Town
world_progress_location_threshholds[1] = {
{0x2B, 2656016} --Brave Warrior
,{0x31, 2656011} --Dodge Roll
,{0x31, 2656012} --Fire
,{0x31, 2656013} --Blue Trinity
,{0x3e, 2656014} --Earthshine
,{0x8c, 2656015}} --Oathkeeper
--Deep Jungle
world_progress_location_threshholds[2] = {
{0x17, 2656383} --Protect-G
,{0x42, 2656021} --White Fang
,{0x56, 2656022} --Cure
,{0x5C, 2656384} --Navi-G
,{0x6e, 2656023} --Jungle King
,{0x6e, 2656024}} --Red Trinity
--Olympus Coliseum
world_progress_location_threshholds[3] = {
{0x0D, 2656031} --Thunder
,{0x10, 2656386} --Entry Pass
,{0x25, 2656033} --Inferno Band
,{0x28, 2656380}} --Hero's License
--Wonderland
world_progress_location_threshholds[4] = {
{0x2E, 2656041} --Blizzard
,{0x2E, 2656042} --Ifrit's Horn
,{0x30, 2656385}} --Navi-G Piece
--Agrabah
world_progress_location_threshholds[5] = {
{0x35, 2656051} --Ray of Light
,{0x49, 2656052} --Blizzard
,{0x5A, 2656053} --Fire
,{0x78, 2656054} --Genie
,{0x78, 2656055} --Three Wishes
,{0x78, 2656056}} --Green Trinity
--Monstro
world_progress_location_threshholds[6] = {
{0x2E, 2656061} --Goofy Cheer
,{0x46, 2656062}} --Stop
--Atlantica
world_progress_location_threshholds[7] = {
{0x32, 2656381} --Crystal Trident
,{0x53, 2656071} --Mermaid Kick
,{0x5D, 2656072} --Thunder
,{0x64, 2656073}} --Crabclaw
--Unused
world_progress_location_threshholds[8] = {}
--Halloween Town
world_progress_location_threshholds[9] = {
{0x1E, 2656382} --Forget-Me-Not
,{0x62, 2656081} --Holy Circlet
,{0x6A, 2656082} --Gravity
,{0x6E, 2656083}} --Pumpkinhead
--Neverland
world_progress_location_threshholds[10] = {
{0x35, 2656091} --Raven's Claw
,{0x3F, 2656092} --Cure
,{0x56, 2656097} --Ars Arcanum
,{0x6E, 2656093} --Fairy Harp
,{0x6E, 2656094} --Tinker Bell
,{0x6E, 2656095} --Glide
,{0x96, 2656096}} --Stop
--Hollow Bastion
world_progress_location_threshholds[11] = {
{0x32, 2656101} --White Trinity
,{0x5A, 2656102} --Donald Cheer
,{0x6E, 2656103} --Fireglow
,{0x82, 2656104} --Ragnarok
,{0xB9, 2656105} --Omega Arts
,{0xC3, 2656106}} --Fire
--End of the World
world_progress_location_threshholds[12] = {
{0x33, 2656111}} --Superglide
--Extra Traverse Town Progress
world_progress_location_threshholds[13] = {
{0x14, 2656131}} --Aero
return world_progress_location_threshholds
end
world_progress_location_threshholds = define_world_progress_location_threshholds()
function read_chests_opened_array()
--Reads an array of bits which represent which chests have been opened by the player
chests_opened_address = {0x2DEA32C, 0x2DE992C} --changed for EGS 1.0.0.10
chest_array = ReadArray(chests_opened_address[game_version], 509)
return chest_array
end
function read_soras_level()
--[[Reads Sora's Current Level]]
soras_level_address = {0x2DE9D98, 0x2DE9398} --changed for EGS 1.0.0.10
return ReadShort(soras_level_address[game_version])
end
function read_soras_stats_array()
--[[Reads an array of Sora's stats]]
soras_stats_address = {0x2DE9D66, 0x2DE9366} --changed for EGS 1.0.0.10
sora_hp_offset = 0x0
sora_mp_offset = 0x2
sora_ap_offset = 0x3
sora_strength_offset = 0x4
sora_defense_offset = 0x5
sora_accessory_slots_offset = 0x16
sora_item_slots_offset = 0x1F
return {ReadByte(soras_stats_address[game_version] + sora_hp_offset)
, ReadByte(soras_stats_address[game_version] + sora_mp_offset)
, ReadByte(soras_stats_address[game_version] + sora_ap_offset)
, ReadByte(soras_stats_address[game_version] + sora_strength_offset)
, ReadByte(soras_stats_address[game_version] + sora_defense_offset)
, ReadByte(soras_stats_address[game_version] + sora_accessory_slots_offset)
, ReadByte(soras_stats_address[game_version] + sora_item_slots_offset)}
end
function read_check_number()
--[[Reads the current check number]]
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
check_number_item_address = gummi_address[game_version] + 0x77
check_number = ReadInt(check_number_item_address)
return check_number
end
function read_world()
--[[Gets the numeric value of the currently occupied world]]
world_address = {0x2340E5C, 0x233FE84} --changed for EGS 1.0.0.10
return ReadByte(world_address[game_version])
end
function read_ansems_secret_reports()
--[[Reads an array of the bytes who's bits correspond to which Secret Reports have
been unlocked in Jiminy's Journal]]
ansems_secret_reports = {0x2DEB720, 0x2DEAD20} --changed for EGS 1.0.0.10
ansems_secret_reports_array = ReadArray(ansems_secret_reports[game_version], 2)
return ansems_secret_reports_array
end
function read_olympus_cups_array()
--[[Reads an array of the bytes which correspond to which Olympus Coliseum
cups have been unlocked.]]
olympus_cups_address = {0x2DEBB60, 0x2DEB160} --changed for EGS 1.0.0.10
return ReadArray(olympus_cups_address[game_version], 4)
end
function read_world_progress_array()
--[[Reads an array of world progress bytes that correspond to Sora's progress through
each world. The order of worlds are as follows:
Traverse Town, Deep Jungle, Olympus Coliseum, Wonderland, Agrabah, Monstro,
Atlantica, Halloween Town, Neverland, Hollow Bastion, End of the World]]
world_progress_address = {0x2DEB264, 0x2DEA864} --changed for EGS 1.0.0.10
world_progress_array = ReadArray(world_progress_address[game_version], 12)
extra_traverse_town_progress_address = world_progress_address[game_version] + 0xE
world_progress_array[13] = ReadByte(extra_traverse_town_progress_address)
return world_progress_array
end
function read_postcards_mailed()
--[[Reads a byte that tracks how many postcards have been mailed]]
postcards_mailed_address = {0x2DEBA1F, 0x2DEB01F} --changed for EGS 1.0.0.10
postcards_mailed = ReadByte(postcards_mailed_address[game_version])
return postcards_mailed
end
function read_cup_locations_checked_array(ansems_secret_reports_array)
cup_locations_checked = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
cup_complete_address = {0x2E01896, 0x2E00E96} --changed for EGS 1.0.0.10
cup_rewards_address = {0x2E018A7, 0x2E00EA7} --changed for EGS 1.0.0.10
cup_complete_array = ReadArray(cup_complete_address[game_version], 4)
for i=1,#cup_complete_array do
for j=1,cup_complete_array[i] do
cup_locations_checked[((i-1)*3) + j] = 1
end
end
cup_rewards_array = ReadArray(cup_rewards_address[game_version], 4)
cup_locations_checked[13] = cup_rewards_array[1]
cup_locations_checked[14] = cup_rewards_array[2]
cup_locations_checked[15] = cup_rewards_array[3]
cup_locations_checked[16] = cup_rewards_array[4]
cup_locations_checked[17] = 0
if toBits(ansems_secret_reports_array[1])[1] == 1 then
cup_locations_checked[17] = 1
end
if cup_complete_array[3] > 0 then
cup_locations_checked[18] = 1
cup_locations_checked[19] = 1
end
return cup_locations_checked
end
function read_atlantica_clams()
atlantica_clams_bits_array = {}
atlantica_clams_address = {0x2DEBB09, 0x2DEB109} --changed for EGS 1.0.0.10
atlantica_clams_bytes_array = ReadArray(atlantica_clams_address[game_version], 2)
atlantica_byte_1_bits = toBits(atlantica_clams_bytes_array[1])
atlantica_byte_2_bits = toBits(atlantica_clams_bytes_array[2])
for i=1,8 do
if atlantica_byte_1_bits[i] ~= nil then
atlantica_clams_bits_array[i] = atlantica_byte_1_bits[i]
else
atlantica_clams_bits_array[i] = 0
end
end
for i=1,8 do
if atlantica_byte_2_bits[i] ~= nil then
atlantica_clams_bits_array[8+i] = atlantica_byte_2_bits[i]
else
atlantica_clams_bits_array[8+i] = 0
end
end
return atlantica_clams_bits_array
end
function read_magic_items()
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
magic_item_address = gummi_address[game_version] + 0x90
magic_items_array = ReadArray(magic_item_address, 7)
return magic_items_array
end
function read_world_items()
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
world_item_address = gummi_address[game_version] + 0x7B
world_items_array = ReadArray(world_item_address, 2)
return world_items_array
end
function read_summon_item()
summon_bits = {0,0,0,0,0,0}
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
summon_item_address = gummi_address[game_version] + 0x7E
summon_item_value = ReadByte(summon_item_address)
summon_item_bits = toBits(summon_item_value)
for k=0,#summon_item_bits do
summon_bits[k] = summon_item_bits[k]
end
return summon_bits
end
function read_trinity_item()
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
trinity_item_address = gummi_address[game_version] + 0x7D
trinity_item_value = ReadByte(trinity_item_address)
return toBits(trinity_item_value)
end
function read_olympus_cups_item()
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
cup_item_address = gummi_address[game_version] + 0x97
olympus_cups_item_value = ReadByte(cup_item_address)
return toBits(olympus_cups_item_value)
end
function read_victory_item()
gummi_address = {0x2DF5BD8, 0x2DF51D8} --changed for EGS 1.0.0.10
victory_item_address = gummi_address[game_version] + 0x7F
return ReadByte(victory_item_address)
end
function read_report_qty()
inventory_address = {0x2DEA1F9, 0x2DE97F9} --changed for EGS 1.0.0.10
reports_1 = ReadArray(inventory_address[game_version] + 149, 3)
reports_2 = ReadArray(inventory_address[game_version] + 168, 10)
reports_acquired = 0
for k,v in pairs(reports_1) do
if v > 0 then
reports_acquired = reports_acquired + 1
end
end
for k,v in pairs(reports_2) do
if v > 0 then
reports_acquired = reports_acquired + 1
end
end
return reports_acquired
end
function read_required_reports()
if file_exists(client_communication_path .. "required_reports.cfg") then
file = io.open(client_communication_path .. "required_reports.cfg", "r")
io.input(file)
required_reports = tonumber(io.read())
io.close(file)
end
if file_exists(client_communication_path .. "required_reports_eotw.cfg") then
file = io.open(client_communication_path .. "required_reports_eotw.cfg", "r")
io.input(file)
required_reports = tonumber(io.read())
io.close(file)
end
end
function read_misc_checks()
--[[Reads checks that are scattered throughout memory]]
location_ids = {}
lookup_table = {
--The first addresses in the arrays below were all changed for EGS for 1.0.0.10
{{0x2DEAA88, 0x2DEA088}, 2656300, 0, 0x1}
,{{0x2DEAA89, 0x2DEA089}, 2656301, 0, 0x1}
,{{0x2DEAA8A, 0x2DEA08A}, 2656302, 0, 0x1}
,{{0x2DEAA8F, 0x2DEA08F}, 2656303, 0, 0x1}
,{{0x2DEAA90, 0x2DEA090}, 2656304, 0, 0x1}
,{{0x2DEAA91, 0x2DEA091}, 2656305, 0, 0x1}
,{{0x2DEAA92, 0x2DEA092}, 2656306, 0, 0x1}
,{{0x2DEAA93, 0x2DEA093}, 2656307, 0, 0x1}
,{{0x2DEAA94, 0x2DEA094}, 2656308, 0, 0x1}
,{{0x2DEAA96, 0x2DEA096}, 2656309, 0, 0x1}
,{{0x2DEAA95, 0x2DEA095}, 2656310, 0, 0x1}
,{{0x2DEAA98, 0x2DEA098}, 2656311, 0, 0x1}
,{{0x2DEAA99, 0x2DEA099}, 2656312, 0, 0x1}
,{{0x2DEAA9A, 0x2DEA09A}, 2656313, 0, 0x1}
,{{0x2DEAB9C, 0x2DEA19C}, 2656314, 0, 0x1}
,{{0x2DEAB9D, 0x2DEA19D}, 2656315, 0, 0x1}
,{{0x2DEAB9E, 0x2DEA19E}, 2656316, 0, 0x1}
,{{0x2DEAB9F, 0x2DEA19F}, 2656317, 0, 0x1}
,{{0x2DEABA0, 0x2DEA1A0}, 2656318, 0, 0x1}
,{{0x2DEABA0, 0x2DEA1A0}, 2656319, 0, 0x1}
,{{0x2DEABA1, 0x2DEA1A1}, 2656320, 0, 0x1}
,{{0x2DEABA2, 0x2DEA1A2}, 2656321, 0, 0x1}
,{{0x2DEABA3, 0x2DEA1A3}, 2656322, 0, 0x1}
,{{0x2DEABA4, 0x2DEA1A4}, 2656324, 0, 0x1}
,{{0x2DEABA5, 0x2DEA1A5}, 2656326, 0, 0x1}
,{{0x2DEABA5, 0x2DEA1A5}, 2656327, 0, 0x1}
,{{0x2DEAC62, 0x2DEA262}, 2656032, 0, 0xA}
,{{0x2DEACCA, 0x2DEA2CA}, 2656328, 0, 0x1}
,{{0x2DEACC9, 0x2DEA2C9}, 2656329, 0, 0x1}
,{{0x2DEBB73, 0x2DEB173}, 2656330, 0, 0x1}
,{{0x2DEBB30, 0x2DEB130}, 2656331, 2, 0x0}
,{{0x2DEBBC2, 0x2DEB1C2}, 2656344, 2, 0x0}
,{{0x2DEB162, 0x2DEA762}, 2656345, 0, 0x2}
,{{0x2DEB163, 0x2DEA763}, 2656346, 0, 0x2}
,{{0x2DEB164, 0x2DEA764}, 2656347, 0, 0x2}
,{{0x2DEB165, 0x2DEA765}, 2656348, 0, 0x2}
,{{0x2DEB166, 0x2DEA766}, 2656349, 0, 0x2}
,{{0x2DEB16F, 0x2DEA76F}, 2656350, 0, 0x1}
,{{0x2DEB170, 0x2DEA770}, 2656351, 0, 0x1}
,{{0x2DEB171, 0x2DEA771}, 2656352, 0, 0x1}
,{{0x2DEB172, 0x2DEA772}, 2656353, 0, 0x1}
,{{0x2DEB173, 0x2DEA773}, 2656354, 0, 0x1}
,{{0x2DEB174, 0x2DEA774}, 2656355, 0, 0x1}
,{{0x2DEB186, 0x2DEA786}, 2656356, 0, 0x4}
,{{0x2DEBAA3, 0x2DEB0A3}, 2656357, 0, 0x4}
,{{0x2DEBAA4, 0x2DEB0A4}, 2656358, 0, 0x4}
,{{0x2DEBAA5, 0x2DEB0A5}, 2656359, 0, 0x4}
,{{0x2DEBAA6, 0x2DEB0A6}, 2656360, 0, 0x4}
,{{0x2DEBA7F, 0x2DEB07F}, 2656361, 0, 0x1}
,{{0x2DEBA7E, 0x2DEB07E}, 2656361, 0, 0x1} --Alternative, light stove before putting in potion
,{{0x2DEBA79, 0x2DEB079}, 2656362, 0, 0x1}
,{{0x2DEBA87, 0x2DEB087}, 2656363, 0, 0x1}
,{{0x2DEAF6D, 0x2DEA56D}, 2656364, 0, 0x1}
,{{0x2DEAF6E, 0x2DEA56E}, 2656365, 0, 0x1}
,{{0x2DEAF6F, 0x2DEA56F}, 2656366, 0, 0x1}
,{{0x2DEAF70, 0x2DEA570}, 2656367, 0, 0x1}
,{{0x2DEAF71, 0x2DEA571}, 2656368, 0, 0x1}
,{{0x2DEAC89, 0x2DEA289}, 2656369, 2, 0x0}
,{{0x2DEBA99, 0x2DEB099}, 2656370, 0, 0x1}
,{{0x2DEBA9A, 0x2DEB09A}, 2656371, 0, 0x1}
,{{0x2DEBA9B, 0x2DEB09B}, 2656372, 0, 0x1}
,{{0x2DEBA9C, 0x2DEB09C}, 2656373, 0, 0x1}
,{{0x2DEBA95, 0x2DEB095}, 2656374, 0, 0x1}
,{{0x2DEAA7A, 0x2DEA07A}, 2656375, 0, 0x1}
,{{0x2DEBA43, 0x2DEB043}, 2656376, 8, 0x0}