-
Notifications
You must be signed in to change notification settings - Fork 13
/
F266B00B GoA ROM.lua
2646 lines (2614 loc) · 95 KB
/
F266B00B GoA ROM.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
--ROM Version
--Last Update: v1.0.0.9 Epic & Steam addresses
LUAGUI_NAME = 'GoA ROM Randomizer Build'
LUAGUI_AUTH = 'SonicShadowSilver2 (Ported by Num)'
LUAGUI_DESC = 'A GoA build for use with the Randomizer. Requires ROM patching.'
function _OnInit()
GameVersion = 0
print('GoA v1.54.1')
GoAOffset = 0x7C
SeedCleared = false
end
function GetVersion() --Define anchor addresses
if (GAME_ID == 0xF266B00B or GAME_ID == 0xFAF99301) and ENGINE_TYPE == "ENGINE" then --PCSX2
OnPC = false
GameVersion = 1
print('GoA PS2 Version')
Now = 0x032BAE0 --Current Location
Sve = 0x1D5A970 --Saved Location
Save = 0x032BB30 --Save File
Obj0Pointer = 0x1D5BA10 --00objentry.bin Pointer Address
Sys3Pointer = 0x1C61AF8 --03system.bin Pointer Address
Btl0Pointer = 0x1C61AFC --00battle.bin Pointer Address
ARDPointer = 0x034ECF4 --ARD Pointer Address
Music = 0x0347D34 --Background Music
Pause = 0x0347E08 --Ability to Pause
React = 0x1C5FF4E --Reaction Command
Cntrl = 0x1D48DB8 --Sora Controllable
Timer = 0x0349DE8
Songs = 0x035DAC4 --Atlantica Stuff
GScre = 0x1F8039C --Gummi Score
GMdal = 0x1F803C0 --Gummi Medal
GKill = 0x1F80856 --Gummi Kills
CamTyp = 0x0348750 --Camera Type
GamSpd = 0x0349E0C --Game Speed
CutNow = 0x035DE20 --Cutscene Timer
CutLen = 0x035DE28 --Cutscene Length
CutSkp = 0x035DE08 --Cutscene Skip
BtlTyp = 0x1C61958 --Battle Status (Out-of-Battle, Regular, Forced)
BtlEnd = 0x1D490C0 --End-of-Battle camera & signal
TxtBox = 0x1D48D54 --Last Displayed Textbox
DemCln = 0x1D48DEC --Demyx Clone Status (might have to do with other mission status/signal?)
Slot1 = 0x1C6C750 --Unit Slot 1
NextSlot = 0x268
Point1 = 0x1D48EFC
NxtPoint = 0x38
Gauge1 = 0x1D48FA4
NxtGauge = 0x34
Menu1 = 0x1C5FF18 --Menu 1 (main command menu)
NextMenu = 0x4
Obj0 = ReadInt(Obj0Pointer)
Sys3 = ReadInt(Sys3Pointer)
Btl0 = ReadInt(Btl0Pointer)
MSN = 0x04FA440
elseif GAME_ID == 0x431219CC and ENGINE_TYPE == 'BACKEND' then --PC
OnPC = true
if ReadString(0x09A92F0,4) == 'KH2J' then --EGS
GameVersion = 2
print('GoA Epic Version')
Now = 0x0716DF8
Sve = 0x2A0BF80
Save = 0x09A92F0
Obj0Pointer = 0x2A24A70
Sys3Pointer = 0x2AE5890
Btl0Pointer = 0x2AE5898
ARDPointer = 0x2A0F268
Music = 0x0ABA784
Pause = 0x0ABB2B8
React = 0x2A10BA2
Cntrl = 0x2A16C28
Timer = 0x0ABB290
Songs = 0x0B657B4
GScre = 0x072AEB0
GMdal = 0x072B044
GKill = 0x0AF6B86
CamTyp = 0x0718A98
GamSpd = 0x0717214
CutNow = 0x0B649D8
CutLen = 0x0B649F4
CutSkp = 0x0B649DC
BtlTyp = 0x2A10E44
BtlEnd = 0x2A0F720
TxtBox = 0x074DCB0
DemCln = 0x2A0F2F4
Slot1 = 0x2A22FD8
NextSlot = 0x278
Point1 = 0x2A0F488
NxtPoint = 0x50
Gauge1 = 0x2A0F578
NxtGauge = 0x48
Menu1 = 0x2A10B50
NextMenu = 0x8
Obj0 = ReadLong(Obj0Pointer)
Sys3 = ReadLong(Sys3Pointer)
Btl0 = ReadLong(Btl0Pointer)
MSN = 0x0BF2C40
elseif ReadString(0x09A9830,4) == 'KH2J' then --Steam Global
GameVersion = 3
print('GoA Steam Global Version')
Now = 0x0717008
Sve = 0x2A0C4C0
Save = 0x09A9830
Obj0Pointer = 0x2A24FB0
Sys3Pointer = 0x2AE5DD0
Btl0Pointer = 0x2AE5DD8
ARDPointer = 0x2A0F7A8
Music = 0x0ABACC4
Pause = 0x0ABB7F8
React = 0x2A110E2
Cntrl = 0x2A17168
Timer = 0x0ABB7D0
Songs = 0x0B65CF4
GScre = 0x072B130
GMdal = 0x072B2C4
GKill = 0x0AF70C6
CamTyp = 0x0718CA8
GamSpd = 0x0717424
CutNow = 0x0B64F18
CutLen = 0x0B64F34
CutSkp = 0x0B64F1C
BtlTyp = 0x2A11384
BtlEnd = 0x2A0FC60
TxtBox = 0x074DF20
DemCln = 0x2A0F834
Slot1 = 0x2A23518
NextSlot = 0x278
Point1 = 0x2A0F9C8
NxtPoint = 0x50
Gauge1 = 0x2A0FAB8
NxtGauge = 0x48
Menu1 = 0x2A11090
NextMenu = 0x8
Obj0 = ReadLong(Obj0Pointer)
Sys3 = ReadLong(Sys3Pointer)
Btl0 = ReadLong(Btl0Pointer)
MSN = 0x0BF3340
elseif ReadString(0x09A8830,4) == 'KH2J' then --Steam JP
GameVersion = 4
print('GoA Steam JP Version')
Now = 0x0716008
Sve = 0x2A0B4C0
Save = 0x09A8830
Obj0Pointer = 0x2A23FB0
Sys3Pointer = 0x2AE4DD0
Btl0Pointer = 0x2AE4DD8
ARDPointer = 0x2A0E7A8
Music = 0x0AB9CC4
Pause = 0x0ABA7F8
React = 0x2A100E2
Cntrl = 0x2A16168
Timer = 0x0ABA7D0
Songs = 0x0B64CF4
GScre = 0x072A130
GMdal = 0x072A2C4
GKill = 0x0AF60C6
CamTyp = 0x0717CA8
GamSpd = 0x0716424
CutNow = 0x0B63F18
CutLen = 0x0B63F34
CutSkp = 0x0B63F1C
BtlTyp = 0x2A10384
BtlEnd = 0x2A0EC60
TxtBox = 0x074CF20
DemCln = 0x2A0E834
Slot1 = 0x2A22518
NextSlot = 0x278
Point1 = 0x2A0E9C8
NxtPoint = 0x50
Gauge1 = 0x2A0EAB8
NxtGauge = 0x48
Menu1 = 0x2A10090
NextMenu = 0x8
Obj0 = ReadLong(Obj0Pointer)
Sys3 = ReadLong(Sys3Pointer)
Btl0 = ReadLong(Btl0Pointer)
MSN = 0x0BF2340
end
end
if GameVersion ~= 0 then
--[[Slot2 = Slot1 - NextSlot
Slot3 = Slot2 - NextSlot
Slot4 = Slot3 - NextSlot
Slot5 = Slot4 - NextSlot
Slot6 = Slot5 - NextSlot
Slot7 = Slot6 - NextSlot
Slot8 = Slot7 - NextSlot
Slot9 = Slot8 - NextSlot
Slot10 = Slot9 - NextSlot
Slot11 = Slot10 - NextSlot
Slot12 = Slot11 - NextSlot
Point2 = Point1 + NxtPoint
Point3 = Point2 + NxtPoint
Gauge2 = Gauge1 + NxtGauge
Gauge3 = Gauge2 + NxtGauge--]]
Menu2 = Menu1 + NextMenu
--Menu3 = Menu2 + NextMenu
end
end
function Warp(W,R,D,M,B,E) --Warp into the appropriate World, Room, Door, Map, Btl, Evt
M = M or ReadShort(Save + 0x10 + 0x180*W + 0x6*R)
B = B or ReadShort(Save + 0x10 + 0x180*W + 0x6*R + 2)
E = E or ReadShort(Save + 0x10 + 0x180*W + 0x6*R + 4)
WriteByte(Now+0x00,W)
WriteByte(Now+0x01,R)
WriteShort(Now+0x02,D)
WriteShort(Now+0x04,M)
WriteShort(Now+0x06,B)
WriteShort(Now+0x08,E)
--Record Location in Save File
WriteByte(Save+0x000C,W)
WriteByte(Save+0x000D,R)
WriteShort(Save+0x000E,D)
end
function Events(M,B,E) --Check for Map, Btl, and Evt
return ((Map == M or not M) and (Btl == B or not B) and (Evt == E or not E))
end
function BAR(File,Subfile,Offset) --Get address within a BAR file
local Subpoint = File + 0x08 + 0x10*Subfile
local Address
--Detect errors
if ReadInt(File,OnPC) ~= 0x01524142 then --Header mismatch
return
elseif Subfile > ReadInt(File+4,OnPC) then --Subfile over count
return
elseif Offset >= ReadInt(Subpoint+4,OnPC) then --Offset exceed subfile length
return
end
--Get address
Address = File + (ReadInt(Subpoint,OnPC) - ReadInt(File+8,OnPC)) + Offset
return Address
end
function BitOr(Address,Bit,Abs)
WriteByte(Address, ReadByte(Address, Abs and OnPC)|Bit, Abs and OnPC)
end
function BitNot(Address,Bit,Abs)
WriteByte(Address, ReadByte(Address, Abs and OnPC)&~Bit, Abs and OnPC)
end
function Faster(Toggle)
if Toggle then
WriteFloat(GamSpd,2) --Faster Speed
elseif ReadFloat(GamSpd) > 1 then
WriteFloat(GamSpd,1) --Normal Speed
end
end
function RemoveTTBlocks() --Remove All TT & STT Blocks
WriteShort(Save+0x207C,0) --Sunset Station
WriteShort(Save+0x2080,0) --Central Station
WriteShort(Save+0x20E4,0) --Underground Concourse
WriteShort(Save+0x20E8,0) --The Woods
WriteShort(Save+0x20EC,0) --Sandlot
WriteShort(Save+0x20F0,0) --Tram Commons
WriteShort(Save+0x20F4,0) --The Mysterious Tower
WriteShort(Save+0x20F8,0) --Tower Wardrobe
WriteShort(Save+0x20FC,0) --Basement Corridor
WriteShort(Save+0x2100,0) --Mansion Library
WriteShort(Save+0x2110,0) --Tunnelway
WriteShort(Save+0x2114,0) --Station Plaza
WriteShort(Save+0x211C,0) --The Old Mansion
WriteShort(Save+0x2120,0) --Mansion Foyer
end
function VisitLock(ItemAddress, RequiredCount, Address, Bit)
local ItemCount = ReadByte(ItemAddress)
if ItemCount < RequiredCount then
BitNot(Address, Bit)
elseif ReadByte(Address) & Bit == 0 then
BitOr(Address, Bit)
end
end
function _OnFrame()
if GameVersion == 0 then --Get anchor addresses
GetVersion()
return
end
if true then --Define current values for common addresses
World = ReadByte(Now+0x00)
Room = ReadByte(Now+0x01)
Place = ReadShort(Now+0x00)
Door = ReadShort(Now+0x02)
Map = ReadShort(Now+0x04)
Btl = ReadShort(Now+0x06)
Evt = ReadShort(Now+0x08)
PrevPlace = ReadShort(Now+0x30)
if not OnPC then
ARD = ReadInt(ARDPointer)
else
ARD = ReadLong(ARDPointer)
end
end
NewGame()
GoA()
TWtNW()
LoD()
BC()
HT()
Ag()
OC()
PL()
TT()
HB()
PR()
DC()
SP()
STT()
AW()
At()
Data()
end
function NewGame()
--Before New Game
if OnPC and ReadByte(BAR(Sys3,0x6,0x0E5F),OnPC) == 0x19 then --Change Form's Icons in PC from Analog Stick
WriteByte(BAR(Sys3,0x6,0x0E5F),0xCE,OnPC) --Valor
WriteByte(BAR(Sys3,0x6,0x0E77),0xCE,OnPC) --Wisdom
WriteByte(BAR(Sys3,0x6,0x0E8F),0xCE,OnPC) --Limit
WriteByte(BAR(Sys3,0x6,0x0EA7),0xCE,OnPC) --Master
WriteByte(BAR(Sys3,0x6,0x0EBF),0xCE,OnPC) --Final
WriteByte(BAR(Sys3,0x6,0x0ED7),0xCE,OnPC) --Anti
WriteByte(BAR(Sys3,0x6,0x253F),0xCE,OnPC) --Valor DUMMY (Navigational Map)
WriteByte(BAR(Sys3,0x6,0x265F),0xCE,OnPC) --Final DUMMY (Window of Time 2 Map)
end
--Start New Game
if Place == 0x2002 and Events(0x01,Null,0x01) then --Station of Serenity Weapons
WriteByte(Pause,2) --Disable Pause
--Starting Stats
WriteByte(Slot1+0x1B0,100) --Starting Drive %
WriteByte(Slot1+0x1B1,5) --Starting Drive Current
WriteByte(Slot1+0x1B2,5) --Starting Drive Max
BitNot(Save+0x41A5,0x06) --Default No Summon Animations
--Tutorial Flags & Form Weapons
BitOr(Save+0x36E8,0x01) --Enable Item in Command Menu
WriteShort(Save+0x4270,0x1FF) --Pause Menu Tutorial Prompts Seen Flags
WriteShort(Save+0x4274,0x1FF) --Status Form & Summon Seen Flags
BitOr(Save+0x49F0,0x03) --Shop Tutorial Prompt Flags (1=Big Shops, 2=Small Shops)
end
end
function GoA()
--Clear Conditions
if not SeedCleared then
local ObjectiveCount = ReadShort(BAR(Sys3,0x6,0x4F4),OnPC)
if ObjectiveCount == 0 then
if ReadByte(Save+0x36B2) > 0 and ReadByte(Save+0x36B3) > 0 and ReadByte(Save+0x36B4) > 0 then --All Proofs Obtained
SeedCleared = true
end
else
if ReadByte(Save+0x363D) >= ObjectiveCount then --Requisite Objective Count Achieved
SeedCleared = true
end
end
end
--Garden of Assemblage Rearrangement
if Place == 0x1A04 then
--Open Promise Charm Path
if SeedCleared and ReadByte(Save+0x3694) > 0 then --Seed Cleared & Promise Charm
WriteShort(BAR(ARD,0x06,0x05C),0x77A,OnPC) --Text
end
--Demyx's Portal Text
if ReadByte(Save+0x1D2E) > 0 then --Hollow Bastion Cleared
WriteShort(BAR(ARD,0x05,0x25C),0x779,OnPC) --Radiant Garden
end
end
--World Map -> Garden of Assemblage
if Place == 0x000F then
local WarpDoor = false
if Door == 0x0C then --The World that Never Was
WarpDoor = 0x15
elseif Door == 0x03 then --Land of Dragons
WarpDoor = 0x16
elseif Door == 0x04 then --Beast's Castle
WarpDoor = 0x17
elseif Door == 0x09 then --Halloween Town
WarpDoor = 0x18
elseif Door == 0x0A then --Agrabah
WarpDoor = 0x19
elseif Door == 0x05 then --Olympus Coliseum
WarpDoor = 0x1A
elseif Door == 0x0B then --Pride Lands
WarpDoor = 0x1B
elseif Door == 0x01 then --Twilight Town
if ReadByte(Save+0x1CFF) == 8 then --Twilight Town
WarpDoor = 0x1C
elseif ReadByte(Save+0x1CFF) == 13 then --Simulated Twilight Town
WarpDoor = 0x21
end
elseif Door == 0x02 then --Hollow Bastion
WarpDoor = 0x1D
elseif Door == 0x08 then --Port Royal
WarpDoor = 0x1E
elseif Door == 0x06 then --Disney Castle
WarpDoor = 0x1F
elseif Door == 0x07 then --Atlantica
WarpDoor = 0x01
end
if WarpDoor then
Warp(0x04,0x1A,WarpDoor)
end
end
--Visit Locks
if true then
--Namine's Sketches
VisitLock(Save+0x3642, 1, Save+0x1CD0, 0x01) --TT_START_1
--Ice Cream
VisitLock(Save+0x3649, 1, Save+0x1CD2, 0x10) --TT_INIT
VisitLock(Save+0x3649, 2, Save+0x1C92, 0x08) --ZZ_TT_CHECK_1_GOA
VisitLock(Save+0x3649, 3, Save+0x1C92, 0x10) --ZZ_TT_CHECK_2_GOA
--Membership Card
VisitLock(Save+0x3643, 1, Save+0x1D1B, 0x08) --HB_INIT
VisitLock(Save+0x3643, 2, Save+0x1C92, 0x20) --ZZ_HB_CHECK_1_GOA
VisitLock(Save+0x3643, 0, Save+0x1C92, 0x40) --ZZ_HB_CHECK_2_GOA
--Beast's Claw
VisitLock(Save+0x35B3, 1, Save+0x1D31, 0x08) --BB_INIT
VisitLock(Save+0x35B3, 2, Save+0x1C92, 0x80) --ZZ_BB_CHECK_GOA
--Battlefields of War
VisitLock(Save+0x35AE, 1, Save+0x1D53, 0x20) --HE_INIT
VisitLock(Save+0x35AE, 2, Save+0x1C93, 0x01) --ZZ_HE_CHECK_GOA
--Scimitar
VisitLock(Save+0x35C0, 1, Save+0x1D73, 0x02) --AL_INIT
VisitLock(Save+0x35C0, 2, Save+0x1C93, 0x02) --ZZ_AL_CHECK_GOA
--Sword of the Ancestors
VisitLock(Save+0x35AF, 1, Save+0x1D91, 0x01) --MU_INIT
VisitLock(Save+0x35AF, 2, Save+0x1C93, 0x04) --ZZ_MU_CHECK_GOA
--Proud Fang
VisitLock(Save+0x35B5, 1, Save+0x1DD5, 0x04) --LK_INIT
VisitLock(Save+0x35B5, 2, Save+0x1C94, 0x01) --ZZ_LK_CHECK_GOA
--Royal Summons (DUMMY 13)
VisitLock(Save+0x365D, 1, Save+0x1E12, 0x08) --DC_INIT
VisitLock(Save+0x365D, 2, Save+0x1C94, 0x20) --ZZ_DC_CHECK_GOA
--Bone Fist
VisitLock(Save+0x35B4, 1, Save+0x1E56, 0x08) --NM_INIT
VisitLock(Save+0x35B4, 2, Save+0x1C94, 0x40) --ZZ_NM_CHECK_GOA
--Skill and Crossbones
VisitLock(Save+0x35B6, 1, Save+0x1E99, 0x04) --CA_INIT
VisitLock(Save+0x35B6, 2, Save+0x1C94, 0x80) --ZZ_CA_CHECK_GOA
--Identity Disk
VisitLock(Save+0x35C2, 1, Save+0x1EB5, 0x20) --TR_INIT
VisitLock(Save+0x35C2, 2, Save+0x1C95, 0x01) --ZZ_TR_CHECK_GOA
--Way to the Dawn
VisitLock(Save+0x35C1, 1, Save+0x1C95, 0x02) --ZZ_EH_CHECK_1_GOA
VisitLock(Save+0x35C1, 2, Save+0x1C95, 0x04) --ZZ_EH_CHECK_2_GOA
else --Remove the item requirements
--Namine's Sketches
VisitLock(Save+0x3642, 0, Save+0x1CD0, 0x01) --TT_START_1
--Ice Cream
VisitLock(Save+0x3649, 0, Save+0x1CD2, 0x10) --TT_INIT
VisitLock(Save+0x3649, 0, Save+0x1C92, 0x08) --ZZ_TT_CHECK_1_GOA
VisitLock(Save+0x3649, 0, Save+0x1C92, 0x10) --ZZ_TT_CHECK_2_GOA
--Membership Card
VisitLock(Save+0x3643, 0, Save+0x1D1B, 0x08) --HB_INIT
VisitLock(Save+0x3643, 0, Save+0x1C92, 0x20) --ZZ_HB_CHECK_1_GOA
VisitLock(Save+0x3643, 0, Save+0x1C92, 0x40) --ZZ_HB_CHECK_2_GOA
--Beast's Claw
VisitLock(Save+0x35B3, 0, Save+0x1D31, 0x08) --BB_INIT
VisitLock(Save+0x35B3, 0, Save+0x1C92, 0x80) --ZZ_BB_CHECK_GOA
--Battlefields of War
VisitLock(Save+0x35AE, 0, Save+0x1D53, 0x20) --HE_INIT
VisitLock(Save+0x35AE, 0, Save+0x1C93, 0x01) --ZZ_HE_CHECK_GOA
--Scimitar
VisitLock(Save+0x35C0, 0, Save+0x1D73, 0x02) --AL_INIT
VisitLock(Save+0x35C0, 0, Save+0x1C93, 0x02) --ZZ_AL_CHECK_GOA
--Sword of the Ancestors
VisitLock(Save+0x35AF, 0, Save+0x1D91, 0x01) --MU_INIT
VisitLock(Save+0x35AF, 0, Save+0x1C93, 0x04) --ZZ_MU_CHECK_GOA
--Proud Fang
VisitLock(Save+0x35B5, 0, Save+0x1DD5, 0x04) --LK_INIT
VisitLock(Save+0x35B5, 0, Save+0x1C94, 0x01) --ZZ_LK_CHECK_GOA
--Royal Summons (DUMMY 13)
VisitLock(Save+0x365D, 0, Save+0x1E12, 0x08) --DC_INIT
VisitLock(Save+0x365D, 0, Save+0x1C94, 0x20) --ZZ_DC_CHECK_GOA
--Bone Fist
VisitLock(Save+0x35B4, 0, Save+0x1E56, 0x08) --NM_INIT
VisitLock(Save+0x35B4, 0, Save+0x1C94, 0x40) --ZZ_NM_CHECK_GOA
--Skill and Crossbones
VisitLock(Save+0x35B6, 0, Save+0x1E99, 0x04) --CA_INIT
VisitLock(Save+0x35B6, 0, Save+0x1C94, 0x80) --ZZ_CA_CHECK_GOA
--Identity Disk
VisitLock(Save+0x35C2, 0, Save+0x1EB5, 0x20) --TR_INIT
VisitLock(Save+0x35C2, 0, Save+0x1C95, 0x01) --ZZ_TR_CHECK_GOA
--Way to the Dawn
VisitLock(Save+0x35C1, 0, Save+0x1C95, 0x02) --ZZ_EH_CHECK_1_GOA
VisitLock(Save+0x35C1, 0, Save+0x1C95, 0x04) --ZZ_EH_CHECK_2_GOA
--Disable GoA Visit Skip
--BitOr(Save+0x1CED,0x01) --TT_MISTERY_SKIP_GOA
--BitOr(Save+0x1D20,0x20) --HB_SCENARIO_5_SKIP_GOA
--BitOr(Save+0x1DB6,0x08) --PO_SCENARIO_0_SKIP_GOA
--BitOr(Save+0x1EB1,0x01) --TR_LIGHTCYCLE_SKIP_GOA
end
--Battle Level
if true then
local Bitmask = 0x00001
local Visit
--Bitmask 0x00001 for all Lv 1
--Bitmask 0x00002 for all Lv 50
--Bitmask 0x00004 for all Lv 80
--Bitmask 0x00008 for all Lv 99
if World == 0x02 then --Twilight Town & Simulated Twilight Town
Visit = ReadByte(Save+0x3FF5)
if Visit == 1 or Visit == 2 or Visit == 3 then
Bitmask = 0x00010
elseif Visit == 4 or Visit == 5 then
Bitmask = 0x00020
elseif Visit == 6 then
Bitmask = 0x00040
elseif Visit == 7 or Visit == 8 then
Bitmask = 0x00100
elseif Visit == 9 then
Bitmask = 0x00200
elseif Visit == 10 then
Bitmask = 0x00800
end
--0x00080 actual TT7
--0x00400 post-HB4
--Lv 1, 2, 3, 6, 7, 28, 34, 47
elseif World == 0x04 then --Hollow Bastion
Visit = ReadByte(Save+0x3FFD)
if Visit == 1 or Visit == 2 or Visit == 3 then
Bitmask = 0x00010
elseif Visit == 4 then
Bitmask = 0x00080
elseif Visit == 5 then
Bitmask = 0x00200
end
--0x00020 actual HB2 & HB3
--0x00040 HB4 pre-SP1
--0x00100 post-HB4
--Lv 8, 15, 28, 30, 34, 45
elseif World == 0x05 then --Beast's Castle
Visit = ReadByte(Save+0x4001)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00020
end
--Lv 13, 36
elseif World == 0x06 then --Olympus Coliseum
Visit = ReadByte(Save+0x4005)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00020
end
--Lv 16, 39
elseif World == 0x07 then --Agrabah
Visit = ReadByte(Save+0x4009)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00040
end
--0x00020 AG1 post HB4
--Lv 22, 38, 40
elseif World == 0x08 then --The Land of Dragons
Visit = ReadByte(Save+0x400D)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00020
end
--Lv 10, 35
elseif World == 0x09 then --100 Acre Wood
Bitmask = 0x00010
--Lv 1
elseif World == 0x0A then --Pride Lands
Visit = ReadByte(Save+0x4015)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00040
end
--0x00020 PL1 post HB4
--Lv 26, 41, 43
elseif World == 0x0C or World == 0x0D then --Disney Castle & Timeless River
Bitmask = 0x00010
if ReadByte(Save+0x1E1E) > 0 then --Post-HB4
Bitmask = 0x00020
end
--Lv 18, 34 for DC
--Lv 19, 34 for TR
elseif World == 0x0E then --Halloween Town
Visit = ReadByte(Save+0x4025)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00040
end
--0x00020 HT1 post HB4
--Lv 24, 39, 41
elseif World == 0x10 then --Port Royal
Visit = ReadByte(Save+0x402D)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00020
end
--Lv 20, 37
elseif World == 0x11 then --Space Paranoids
Visit = ReadByte(Save+0x4031)
if Visit == 1 then
Bitmask = 0x00010
elseif Visit == 2 then
Bitmask = 0x00040
end
--0x00020 post HB4
--Lv 28, 34, 45
elseif World == 0x12 then --The World that Never Was
Bitmask = 0x00010
--Lv 50
end
WriteInt(Save+0x3724,Bitmask)
end
--Fix Genie Crash
if ReadByte(Save+0x36C4)&0x10 == 0x10 then --If Lamp Charm is obtained
local CurSubmenu
if not OnPC then
CurSubmenu = ReadInt(Menu2)
else
CurSubmenu = ReadLong(Menu2)
end
CurSubmenu = ReadByte(CurSubmenu,OnPC)
if CurSubmenu == 7 and ReadByte(Save+0x36C0)&0x56 == 0x00 then --In Summon menu without Forms
BitOr(Save+0x36C0,0x02) --Add Valor Form
BitOr(Save+0x06B2,0x01)
elseif ReadShort(React) == 0x059 and ReadByte(Save+0x36C0)&0x56 == 0x00 then --Genie in Auto Summon RC without Forms
BitOr(Save+0x36C0,0x02) --Add Valor Form
BitOr(Save+0x06B2,0x01)
elseif CurSubmenu ~= 7 and ReadShort(React) ~= 0x059 and ReadByte(Save+0x06B2)&0x01==0x01 then --None of the above
BitNot(Save+0x36C0,0x02) --Remove Valor Form
BitNot(Save+0x06B2,0x01)
end
end
--Invincibility on Cutscenes
if ReadByte(Cntrl) == 3 then --Cutscene
WriteByte(Slot1+0x1AE,0)
else --Gameplay
WriteByte(Slot1+0x1AE,100)
end
--Progressive Growth Abilities & Fixed Trinity Limit Slot
for Slot = 0,68 do
local Current = Save + 0x2544 + 2*Slot
local Ability = ReadShort(Current) & 0x0FFF
local Initial = ReadShort(Current) & 0xF000
if Ability >= 0x05E and Ability <= 0x061 then --High Jump
local Slot70 = Save+0x25CE
WriteShort(Current,0)
if ReadShort(Slot70)|0x8000 < 0x805E then
WriteShort(Slot70,0x005E|Initial)
elseif ReadShort(Slot70)|0x8000 < 0x8061 then
WriteShort(Slot70,ReadShort(Slot70)+1)
end
elseif Ability >= 0x062 and Ability <= 0x065 then --Quick Run
local Slot71 = Save+0x25D0
WriteShort(Current,0)
if ReadShort(Slot71)|0x8000 < 0x8062 then
WriteShort(Slot71,0x0062|Initial)
elseif ReadShort(Slot71)|0x8000 < 0x8065 then
WriteShort(Slot71,ReadShort(Slot71)+1)
end
elseif Ability >= 0x234 and Ability <= 0x237 then --Dodge Roll
local Slot72 = Save+0x25D2
WriteShort(Current,0)
if ReadShort(Slot72)|0x8000 < 0x8234 then
WriteShort(Slot72,0x0234|Initial)
elseif ReadShort(Slot72)|0x8000 < 0x8237 then
WriteShort(Slot72,ReadShort(Slot72)+1)
end
elseif Ability >= 0x066 and Ability <= 0x069 then --Aerial Dodge
local Slot73 = Save+0x25D4
WriteShort(Current,0)
if ReadShort(Slot73)|0x8000 < 0x8066 then
WriteShort(Slot73,0x0066|Initial)
elseif ReadShort(Slot73)|0x8000 < 0x8069 then
WriteShort(Slot73,ReadShort(Slot73)+1)
end
elseif Ability >= 0x06A and Ability <= 0x06D then --Glide
local Slot74 = Save+0x25D6
WriteShort(Current,0)
if ReadShort(Slot74)|0x8000 < 0x806A then
WriteShort(Slot74,0x006A|Initial)
elseif ReadShort(Slot74)|0x8000 < 0x806D then
WriteShort(Slot74,ReadShort(Slot74)+1)
end
elseif Ability == 0x0C6 and false then --Trinity Limit
WriteShort(Current,0)
WriteShort(Save+0x25D8,0x00C6)
end
end
--Remove Growth Abilities from Forms
if ReadByte(BAR(Btl0,0x10,0x41),0,OnPC) ~= 0 then
for i = 0,34 do
WriteByte(BAR(Btl0,0x10,0x41+0x8*i),0,OnPC) --Remove Innate Growth Abilities
end
end
--Growth Abilities during Forms
if true then
local Growth = {0x805E,0x8062,0x8234,0x8066,0x806A}
for form = 0,4 do --Adjust Form Movement
local FormAddress = Save + 0x32F6 + 0x38*form
for level = 0,6 do
if ReadByte(FormAddress) == level+1 then
WriteShort(FormAddress+6, Growth[form+1] + math.floor(level/2))
end
end
end
end
--Munny Pouch (Olette)
while ReadByte(Save+0x363C) > ReadByte(Save+0x35C4) do
WriteInt(Save+0x2440,ReadInt(Save+0x2440)+5000)
WriteByte(Save+0x35C4,ReadByte(Save+0x35C4)+1)
end
--Munny Pouch (Mickey)
while ReadByte(Save+0x3695) > ReadByte(Save+0x35C5) do
WriteInt(Save+0x2440,ReadInt(Save+0x2440)+5000)
WriteByte(Save+0x35C5,ReadByte(Save+0x35C5)+1)
end
--DUMMY 23 = Maximum HP Increased!
while ReadByte(Save+0x3671) > 0 do
local Bonus
if ReadByte(Save+0x2498) < 3 then --Non-Critical
Bonus = 5
else --Critical
Bonus = 2
end
WriteInt(Slot1+0x000,ReadInt(Slot1+0x000)+Bonus)
WriteInt(Slot1+0x004,ReadInt(Slot1+0x004)+Bonus)
WriteByte(Save+0x3671,ReadByte(Save+0x3671)-1)
end
--DUMMY 24 = Maximum MP Increased!
while ReadByte(Save+0x3672) > 0 do
local Bonus
if ReadByte(Save+0x2498) < 3 then --Non-Critical
Bonus = 10
else --Critical
Bonus = 5
end
WriteInt(Slot1+0x180,ReadInt(Slot1+0x180)+Bonus)
WriteInt(Slot1+0x184,ReadInt(Slot1+0x184)+Bonus)
WriteByte(Save+0x3672,ReadByte(Save+0x3672)-1)
end
--DUMMY 25 = Drive Gauge Powered Up!
while ReadByte(Save+0x3673) > 0 do
if ReadByte(Slot1+0x1B2) < 9 then
WriteByte(Slot1+0x1B1,ReadByte(Slot1+0x1B1)+1)
WriteByte(Slot1+0x1B2,ReadByte(Slot1+0x1B2)+1)
end
WriteByte(Save+0x3673,ReadByte(Save+0x3673)-1)
end
--DUMMY 26 = Gained Armor Slot!
while ReadByte(Save+0x3674) > 0 do
if ReadByte(Save+0x2500) < 8 then
WriteByte(Save+0x2500,ReadByte(Save+0x2500)+1)
end
WriteByte(Save+0x3674,ReadByte(Save+0x3674)-1)
end
--DUMMY 27 = Gained Accessory Slot!
while ReadByte(Save+0x3675) > 0 do
if ReadByte(Save+0x2501) < 8 then
WriteByte(Save+0x2501,ReadByte(Save+0x2501)+1)
end
WriteByte(Save+0x3675,ReadByte(Save+0x3675)-1)
end
--DUMMY 16 = Gained Item Slot!
while ReadByte(Save+0x3660) > 0 do
if ReadByte(Save+0x2502) < 8 then
WriteByte(Save+0x2502,ReadByte(Save+0x2502)+1)
end
WriteByte(Save+0x3660,ReadByte(Save+0x3660)-1)
end
--Donald's Staff Active Abilities
if true then
local Staff = ReadShort(Save+0x2604)
local Ability = {} --Offset for staff's ability within 03system.bar's item
Ability[0x04B] = 0x48A --Mage's Staff
Ability[0x094] = 0x49A --Hammer Staff
Ability[0x095] = 0x4AA --Victory Bell
Ability[0x097] = 0x4CA --Comet Staff
Ability[0x098] = 0x4DA --Lord's Broom
Ability[0x099] = 0x4EA --Wisdom Wand
Ability[0x096] = 0x4BA --Meteor Staff
Ability[0x09A] = 0x4FA --Rising Dragon
Ability[0x09C] = 0x51A --Shaman's Relic
Ability[0x258] = 0x95A --Shaman's Relic+
Ability[0x09B] = 0x50A --Nobody Lance
Ability[0x221] = 0x86A --Centurion
Ability[0x222] = 0x87A --Centurion+
Ability[0x1E2] = 0x6DA --Save the Queen
Ability[0x1F7] = 0x82A --Save the Queen+
Ability[0x223] = 0x88A --Plain Mushroom
Ability[0x224] = 0x89A --Plain Mushroom+
Ability[0x225] = 0x8AA --Precious Mushroom
Ability[0x226] = 0x8BA --Precious Mushroom+
Ability[0x227] = 0x8CA --Premium Mushroom
Ability[0x0A1] = 0x52A --Detection Staff
if Ability[Staff] ~= nil then
local StatOffset = 0x8 + ReadInt(BAR(Sys3,0x6,4),OnPC) * 0x18
Ability = ReadShort(BAR(Sys3,0x6,StatOffset+Ability[Staff]),OnPC) --Currently-equipped staff's ability
if Ability == 0x0A5 then --Donald Fire
WriteShort(Save+0x26F6,0x80A5)
WriteByte(BAR(Sys3,0x6,0x168F),0,OnPC)
elseif Ability == 0x0A6 then --Donald Blizzard
WriteShort(Save+0x26F6,0x80A6)
WriteByte(BAR(Sys3,0x6,0x16A7),0,OnPC)
elseif Ability == 0x0A7 then --Donald Thunder
WriteShort(Save+0x26F6,0x80A7)
WriteByte(BAR(Sys3,0x6,0x16BF),0,OnPC)
elseif Ability == 0x0A8 then --Donald Cure
WriteShort(Save+0x26F6,0x80A8)
WriteByte(BAR(Sys3,0x6,0x16D7),0,OnPC)
elseif ReadShort(Save+0x26F6) ~= 0 then
WriteShort(Save+0x26F6,0) --Remove Ability Slot 80
WriteByte(BAR(Sys3,0x6,0x168F),2,OnPC) --Restore Original AP Costs
WriteByte(BAR(Sys3,0x6,0x16A7),2,OnPC)
WriteByte(BAR(Sys3,0x6,0x16BF),2,OnPC)
WriteByte(BAR(Sys3,0x6,0x16D7),3,OnPC)
end
end
end
--Goofy's Shield Active Abilities
if true then
local Shield = ReadShort(Save+0x2718)
local Ability = {} --Offset for shield's ability within 03system.bar's item
Ability[0x031] = 0x53A --Knight's Shield
Ability[0x08B] = 0x54A --Adamant Shield
Ability[0x08C] = 0x55A --Chain Gear
Ability[0x08E] = 0x57A --Falling Star
Ability[0x08F] = 0x58A --Dreamcloud
Ability[0x090] = 0x59A --Knight Defender
Ability[0x08D] = 0x56A --Ogre Shield
Ability[0x091] = 0x5AA --Genji Shield
Ability[0x092] = 0x5BA --Akashic Record
Ability[0x259] = 0x96A --Akashic Record+
Ability[0x093] = 0x5CA --Nobody Guard
Ability[0x228] = 0x8DA --Frozen Pride
Ability[0x229] = 0x8EA --Frozen Pride+
Ability[0x1E3] = 0x6EA --Save the King
Ability[0x1F8] = 0x83A --Save the King+
Ability[0x22A] = 0x8FA --Joyous Mushroom
Ability[0x22B] = 0x90A --Joyous Mushroom+
Ability[0x22C] = 0x91A --Majestic Mushroom
Ability[0x22D] = 0x92A --Majestic Mushroom+
Ability[0x22E] = 0x93A --Ultimate Mushroom
Ability[0x032] = 0x5DA --Detection Shield
Ability[0x033] = 0x5EA --Test the King
if Ability[Shield] ~= nil then
local StatOffset = 0x8 + ReadInt(BAR(Sys3,0x6,4),OnPC) * 0x18
Ability = ReadShort(BAR(Sys3,0x6,StatOffset+Ability[Shield]),OnPC) --Currently-equipped shield's ability
if Ability == 0x1A7 then --Goofy Tornado
WriteShort(Save+0x280A,0x81A7)
WriteByte(BAR(Sys3,0x6,0x16EF),0,OnPC)
elseif Ability == 0x1AD then --Goofy Bash
WriteShort(Save+0x280A,0x81AD)
WriteByte(BAR(Sys3,0x6,0x1707),0,OnPC)
elseif Ability == 0x1A9 then --Goofy Turbo
WriteShort(Save+0x280A,0x81A9)
WriteByte(BAR(Sys3,0x6,0x171F),0,OnPC)
elseif ReadShort(Save+0x280A) ~= 0 then
WriteShort(Save+0x280A,0) --Remove Ability Slot 80
WriteByte(BAR(Sys3,0x6,0x16EF),2,OnPC) --Restore Original AP Costs
WriteByte(BAR(Sys3,0x6,0x1707),2,OnPC)
WriteByte(BAR(Sys3,0x6,0x171F),2,OnPC)
end
end
end
--Show all items in shops (ASSEMBLY edit)
if not OnPC then
WriteInt(0x264250,0)
elseif ReadLong(0x2FAA22) == 0x43B70F0D74D68541 then --Epic Global
WriteByte(0x2FAA26,0)
elseif ReadLong(0x2FA682) == 0x43B70F0D74D68541 then --Epic JP
WriteByte(0x2FA686,0)
elseif ReadLong(0x2FB562) == 0x43B70F0D74D68541 then --Steam Global
WriteByte(0x2FB566,0)
elseif ReadLong(0x2FB2E2) == 0x43B70F0D74D68541 then --Steam JP
WriteByte(0x2FB2E6,0)
end
--Alternate Party Models (adding new UCM using MEMT causes problems when shopping)
if World == 0x0C and Place ~= 0x070C then --Mage & Knight (KH I)
WriteString(Obj0+0x16F0,'P_EX020_DC\0',OnPC)
WriteString(Obj0+0x1750,'P_EX030_DC\0',OnPC)
WriteString(Obj0+0x3250,'P_EX020_DC_ANGRY_NPC\0',OnPC)
WriteString(Obj0+0x40F0,'H_ZZ020_DC\0',OnPC)
WriteString(Obj0+0x4150,'H_ZZ030_DC\0',OnPC)
elseif Place == 0x2004 or Place == 0x2104 or Place == 0x2204 or Place == 0x2604 then --Casual (CoM)
WriteString(Obj0+0x16F0,'P_EX020_CM\0',OnPC)
WriteString(Obj0+0x1750,'P_EX030_CM\0',OnPC)
elseif ReadString(Obj0+0x16F0,8,OnPC) ~= 'P_EX020\0' then --Revert costume changes
WriteString(Obj0+0x16F0,'P_EX020\0',OnPC)
WriteString(Obj0+0x1750,'P_EX030\0',OnPC)
WriteString(Obj0+0x3250,'P_EX020_ANGRY_NPC\0',OnPC)
WriteString(Obj0+0x40F0,'H_ZZ020\0',OnPC)
WriteString(Obj0+0x4150,'H_ZZ030\0',OnPC)
end
--Navigational Map Unlocks Valor Form
if ReadByte(Save+0x36C0)&0x80 == 0x80 then
BitOr(Save+0x36C0,0x02)
end
--Window of Time Map 2 Unlocks Final Form
if ReadByte(Save+0x36C2)&0x02 == 0x02 then
BitOr(Save+0x36C0,0x10)
end
--[[Enable Anti Form Forcing
if ReadByte(Save+0x3524) == 6 then --In Anti Form
BitOr(Save+0x36C0,0x20) --Unlocks Anti Form
end--]]
--Anti Form Costs Max Drive Instead of a Static 9.
if ReadByte(BAR(Sys3,0x2,0x0264),OnPC) >= 5 and ReadByte(Slot1+0x1B2) >= 5 then
WriteByte(BAR(Sys3,0x2,0x0264),ReadByte(Slot1+0x1B2),OnPC)
end
end
function TWtNW()
--Data Xemnas -> The World that Never Was
if Place == 0x1A04 then
local PostSave = ReadByte(Save+0x1EDE)
local Progress = ReadByte(Save+0x1EDF)
local WarpRoom
if PostSave == 0 then
if Progress == 0 then --[1st Visit, Before Entering Castle that Never Was]
WarpRoom = 0x01
WriteInt(Save+0x357C,0x12020100)
elseif Progress == 1 then --Before Xigbar
WarpRoom = 0x04
WriteInt(Save+0x357C,0x12020100)
elseif Progress == 2 then --[After Xigbar, After Reunion with Riku & Kairi]
WarpRoom = 0x09
WriteInt(Save+0x357C,0x12020100)
elseif Progress == 3 then --[Before Luxord, After Saix]
WarpRoom = 0x0D
WriteInt(Save+0x357C,0x12020100)
elseif Progress == 4 then --[After Riku Joins the Party, Before Xemnas I]
WarpRoom = 0x0D
end
elseif PostSave == 1 then --Alley to Between
WarpRoom = 0x01
elseif PostSave == 2 then --The Brink of Despair
WarpRoom = 0x04
elseif PostSave == 3 then --Twilight's View
WarpRoom = 0x09
elseif PostSave == 4 then --Proof of Existence
WarpRoom = 0x0D
elseif PostSave == 5 then --The Altar of Naught
WarpRoom = 0x12
end
WriteShort(BAR(ARD,0x0A,GoAOffset+0x010),WarpRoom,OnPC)
end
--World Progress
if Place == 0x0412 and Events(Null,Null,0x02) then --The Path to the Castle
WriteByte(Save+0x1EDF,1)
elseif Place == 0x1012 and Events(Null,Null,0x01) then --Riku!
WriteByte(Save+0x1EDF,2)
elseif Place == 0x1012 and Events(Null,Null,0x02) then --Ansem's Wager
WriteByte(Save+0x1EDF,3)
elseif Place == 0x1012 and Events(Null,Null,0x05) then --Back to His Old Self
WriteByte(Save+0x1EDF,4)
elseif Place == 0x1212 and Events(Null,Null,0x03) then --The Door to Kingdom Hearts
WriteByte(Save+0x1EDE,5) --Post-Story Save
elseif Place == 0x0001 and ReadInt(Save+0x000C) == 0x631212 then --END
WriteInt(Save+0x000C,0x321A04) --Post-Game Save at Garden of Assemblage
end
--The World that Never Was Post-Story Save
if ReadByte(Save+0x1EDE) > 0 then
if PrevPlace == 0x0112 and not Events(0x40,0x40,0x40) then --Alley to Between (except TT2)
WriteByte(Save+0x1EDE,1)
elseif PrevPlace == 0x0412 then --The Brink of Despair
WriteByte(Save+0x1EDE,2)
elseif PrevPlace == 0x0912 then --Twilight's View
WriteByte(Save+0x1EDE,3)
elseif PrevPlace == 0x0D12 then --Proof of Existence
WriteByte(Save+0x1EDE,4)
elseif PrevPlace == 0x1212 then --The Altar of Naught
WriteByte(Save+0x1EDE,5)
end
end
--Final Door Requirements
if ReadShort(Save+0x1B7C) == 0x04 and SeedCleared then
WriteShort(Save+0x1B7C, 0x0D) --The Altar of Naught MAP (Door RC Available)
end
end
function LoD()
--Data Xigbar -> The Land of Dragons
if Place == 0x1A04 then
local PostSave = ReadByte(Save+0x1D9E)
local Progress = ReadByte(Save+0x1D9F)
local WarpRoom
if PostSave == 0 then
if Progress == 0 then --[1st Visit, Before Mountain Climb]
WarpRoom = 0x00
elseif Progress == 1 then --Before Village Cave Heartless
WarpRoom = 0x04