forked from KH2FM-Mods-Num/GoA-ROM-Edition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
F266B00B GoA ROM.lua
2957 lines (2928 loc) · 108 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: Post-Final Fights & Patch 1.0.0.8 Fixes
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()
local VersionNum = 'GoA Version 1.52.10'
if (GAME_ID == 0xF266B00B or GAME_ID == 0xFAF99301) and ENGINE_TYPE == "ENGINE" then --PCSX2
if ENGINE_VERSION < 3.0 then
print('LuaEngine is Outdated. Things might not work properly.')
end
print(VersionNum)
Platform = 0
Now = 0x032BAE0 --Current Location
Sve = 0x1D5A970 --Saved Location
BGM = 0x0347D34 --Background Music
Save = 0x032BB30 --Save File
Obj0 = 0x1C94100 --00objentry.bin
Sys3 = 0x1CCB300 --03system.bin
Btl0 = 0x1CE5D80 --00battle.bin
Pause = 0x0347E08 --Ability to Pause
React = 0x1C5FF4E --Reaction Command
Cntrl = 0x1D48DB8 --Sora Controllable
Timer = 0x0349DE8
Combo = 0x1D49080
Songs = 0x035DAC4 --Atlantica Stuff
GScre = 0x1F8039C --Gummi Score
GMdal = 0x1F803C0 --Gummi Medal
GKill = 0x1F80856 --Gummi Kills
CamTyp = 0x0348750 --Camera Type
CutNow = 0x035DE20 --Cutscene Timer
CutLen = 0x035DE28 --Cutscene Length
CutSkp = 0x035DE08 --Cutscene Skip
BtlTyp = 0x1C61958 --Battle Status (Out-of-Battle, Regular, Forced)
BtlEnd = 0x1D490C0 --Something about end-of-battle camera
TxtBox = 0x1D48D54 --Last Displayed Textbox
DemCln = 0x1D48DEC --Demyx Clone Status
MSNLoad = 0x04FA440
Slot1 = 0x1C6C750 --Unit Slot 1
NextSlot = 0x268
Point1 = 0x1D48EFC
NxtPoint = 0x38
Gauge1 = 0x1D48FA4
NxtGauge = 0x34
Menu1 = 0x1C5FF18 --Menu 1 (main command menu)
NextMenu = 0x4
elseif GAME_ID == 0x431219CC and ENGINE_TYPE == 'BACKEND' then --PC
if ENGINE_VERSION < 5.0 then
ConsolePrint('LuaFrontend is Outdated. Things might not work properly.',2)
end
ConsolePrint(VersionNum,0)
Platform = 1
Now = 0x0714DB8 - 0x56454E
Sve = 0x2A09C00 - 0x56450E
BGM = 0x0AB8504 - 0x56450E
Save = 0x09A7070 - 0x56450E
Obj0 = 0x2A22B90 - 0x56450E
Sys3 = 0x2A59DB0 - 0x56450E
Btl0 = 0x2A74840 - 0x56450E
Pause = 0x0AB9038 - 0x56450E
React = 0x2A0E822 - 0x56450E
Cntrl = 0x2A148A8 - 0x56450E
Timer = 0x0AB9010 - 0x56450E
Songs = 0x0B63534 - 0x56450E
GScre = 0x0728E90 - 0x56454E
GMdal = 0x0729024 - 0x56454E
GKill = 0x0AF4906 - 0x56450E
CamTyp = 0x0716A58 - 0x56454E
CutNow = 0x0B62758 - 0x56450E
CutLen = 0x0B62774 - 0x56450E
CutSkp = 0x0B6275C - 0x56450E
BtlTyp = 0x2A0EAC4 - 0x56450E
BtlEnd = 0x2A0D3A0 - 0x56450E
TxtBox = 0x074BC70 - 0x56454E
DemCln = 0x2A0CF74 - 0x56450E
MSNLoad = 0x0BF08C0 - 0x56450E
Slot1 = 0x2A20C58 - 0x56450E
NextSlot = 0x278
Point1 = 0x2A0D108 - 0x56450E
NxtPoint = 0x50
Gauge1 = 0x2A0D1F8 - 0x56450E
NxtGauge = 0x48
Menu1 = 0x2A0E7D0 - 0x56450E
NextMenu = 0x8
end
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
pi = math.pi
end
function Warp(W,R,D,M,B,E) --Warp into the appropriate World, Room, Door, Map, Btl, Evt
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 Spawn(Type,Subfile,Offset,Value)
local Subpoint = ARD + 0x08 + 0x10*Subfile
local Address
if Platform == 0 and ReadInt(ARD) == 0x01524142 and Subfile <= ReadInt(ARD+4) then
--Exclusions on Crash Spots in PCSX2-EX
Address = ReadInt(Subpoint) + Offset
if Type == 'Short' then
WriteShort(Address,Value)
elseif Type == 'Float' then
WriteFloat(Address,Value)
elseif Type == 'Int' then
WriteInt(Address,Value)
elseif Type == 'String' then
WriteString(Address,Value)
end
elseif Platform == 1 then
local x = ARD&0xFFFFFF000000
if ENGINE_VERSION < 5.0 then --LuaBackend
if ReadIntA(ARD) == 0x01524142 and Subfile <= ReadIntA(ARD+4) then
local y = ReadIntA(Subpoint)&0xFFFFFF
Address = x + y + Offset
if Type == 'Short' then
WriteShortA(Address,Value)
elseif Type == 'Float' then
WriteFloatA(Address,Value)
elseif Type == 'Int' then
WriteIntA(Address,Value)
elseif Type == 'String' then
WriteStringA(Address,Value)
end
end
else --LuaFrontend
if ReadInt(ARD,true) == 0x01524142 and Subfile <= ReadInt(ARD+4,true) then
local y = ReadInt(Subpoint,true)&0xFFFFFF
Address = x + y + Offset
if Type == 'Short' then
WriteShort(Address,Value,true)
elseif Type == 'Float' then
WriteFloat(Address,Value,true)
elseif Type == 'Int' then
WriteInt(Address,Value,true)
elseif Type == 'String' then
WriteString(Address,Value,true)
end
end
end
end
end
function BitOr(Address,Bit,Abs)
if Abs and Platform == 1 then
if ENGINE_VERSION < 5.0 then
WriteByteA(Address,ReadByte(Address)|Bit)
else
WriteByte(Address,ReadByte(Address)|Bit,true)
end
else
WriteByte(Address,ReadByte(Address)|Bit)
end
end
function BitNot(Address,Bit,Abs)
if Abs and Platform == 1 then
if ENGINE_VERSION < 5.0 then
WriteByteA(Address,ReadByte(Address)&~Bit)
else
WriteByte(Address,ReadByte(Address)&~Bit,true)
end
else
WriteByte(Address,ReadByte(Address)&~Bit)
end
end
function Faster(Toggle)
if Platform == 0 then
if Toggle then
WriteByte(0x0349E1C,0x00) --Faster Speed
WriteByte(0x0349E20,0x00)
else
WriteByte(0x0349E1C,0x01) --Normal Speed
WriteByte(0x0349E20,0x01)
end
elseif Platform == 1 then
if Toggle then
WriteFloat(0x07151D4 - 0x56454E,2) --Faster Speed
else
WriteFloat(0x07151D4 - 0x56454E,1) --Normal Speed
end
end
end
function RemoveTTBarriers() --Remove All TT & STT Barriers
WriteShort(Save+0x207C,0x0000) --Sunset Station
WriteShort(Save+0x2080,0x0000) --Central Station
WriteShort(Save+0x20E4,0x0000) --Underground Concourse
WriteShort(Save+0x20E8,0x0000) --Woods
WriteShort(Save+0x20EC,0x0000) --Sandlot
WriteShort(Save+0x20F0,0x0000) --Tram Commons
WriteShort(Save+0x20F4,0x0000) --The Mysterious Tower
WriteShort(Save+0x20F8,0x0000) --Tower Wardrobe
WriteShort(Save+0x20FC,0x0000) --Basement Corridor
WriteShort(Save+0x2100,0x0000) --Mansion Library
WriteShort(Save+0x2110,0x0000) --Tunnelway
WriteShort(Save+0x2114,0x0000) --Station Plaza
WriteShort(Save+0x211C,0x0000) --The Old Mansion
WriteShort(Save+0x2120,0x0000) --Mansion Foyer
end
function _OnFrame()
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)
MSN = MSNLoad + (ReadInt(MSNLoad+4)+1) * 0x10
if Platform == 0 then
ARD = ReadInt(0x034ECF4) --Base ARD Address
elseif Platform == 1 then
ARD = ReadLong(0x2A0CEE8 - 0x56450E) --Base ARD Address
if GetHertz() < 240 then
SetHertz(240)
ConsolePrint('Frequency set to 240Hz to accommodate GoA mod.\n',0)
end
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 Platform == 1 and ReadByte(Sys3+0x116DB) == 0x19 then --Change Form's Icons in PC From Analog Stick
WriteByte(Sys3+0x116DB,0x3B) --Valor
WriteByte(Sys3+0x116F3,0x3B) --Wisdom
WriteByte(Sys3+0x1170B,0x3B) --Limit
WriteByte(Sys3+0x11723,0x3B) --Master
WriteByte(Sys3+0x1173B,0x3B) --Final
WriteByte(Sys3+0x11753,0x3B) --Anti
end
--Start New Game 1
if Place == 0x0102 and Events(0x34,0x34,0x34) then --Opening Cutscene
WriteShort(Save+0x03D0,0x01) --Station of Serenity MAP (Dream Weapons)
WriteShort(Save+0x03D4,0x01) --Station of Serenity EVT
if Platform == 0 then
Warp(0x02,0x20,0x32,0x01,0x00,0x01) --Not warping here on PS2 causes crash later
end
end
--Start New Game 2
if Place == 0x2002 and Events(0x01,Null,0x01) then --Station of Serenity Weapons
BitNot(Save+0x1CD2,0x80) --TT_SCENARIO_1_START (Show Gameplay Elements)
BitOr(Save+0x1CEA,0x02) --TT_SORA_OLD_END (Play as KH2 Sora)
BitOr(Save+0x1CEB,0x08) --TT_ROXAS_START (Prepare Roxas' Flag)
WriteByte(Pause,2) --Disable Pause
if ReadInt(CutLen) == 0x246 then --Dusks attack
WriteByte(CutSkp,1)
end
--Starting Stats
WriteByte(Save+0x35AE,1) --Have 1 Battlefields of War
WriteByte(Save+0x35AF,1) --Have 1 Sword of the Ancestors
WriteByte(Save+0x35B3,1) --Have 1 Beast's Claw
WriteByte(Save+0x35B4,1) --Have 1 Bone Fist
WriteByte(Save+0x35B5,1) --Have 1 Proud Fang
WriteByte(Save+0x35B6,1) --Have 1 Skill and Crossbones
WriteByte(Save+0x35C0,1) --Have 1 Scimitar
WriteByte(Save+0x35C1,1) --Have 1 Way to the Dawn
WriteByte(Save+0x35C2,1) --Have 1 Identity Disk
WriteByte(Save+0x363F,1) --Have 1 Tournament Poster
WriteByte(Save+0x3640,1) --Have 1 Poster
WriteByte(Save+0x3641,1) --Have 1 Letter
WriteByte(Slot1+0x1B0,100) --Starting Drive %
WriteByte(Slot1+0x1B1,5) --Starting Drive Current
WriteByte(Slot1+0x1B2,5) --Starting Drive Max
--Place Scripts
WriteShort(Save+0x023A,0x01) --Roxas' Room EVT
WriteShort(Save+0x06AC,0x01) --Garden of Assemblage MAP (Before Computer)
WriteShort(Save+0x06B0,0x03) --Garden of Assemblage EVT
WriteShort(Save+0x0C10,0x01) --Bamboo Grove MAP (Burning Village)
WriteShort(Save+0x0C14,0x01) --Bamboo Grove EVT
WriteShort(Save+0x0F6E,0x01) --Wildebeest Valley (Past) EVT
WriteShort(Save+0x10BE,0x01) --The Shore (Night) EVT
WriteShort(Save+0x1238,0x01) --Gummi Hangar EVT
WriteShort(Save+0x1B1A,0x01) --Alley to Between EVT
WriteShort(Save+0x1B5E,0x01) --Proof of Existence MAP (Lock Progress)
--Tutorial Flags & Form Weapons
BitOr(Save+0x239E,0x07) --Pause Menu (1=Items, 2=Party, 4=Customize)
BitNot(Save+0x239E,0x80) --Show Struggle Bats Outside STT
BitOr(Save+0x36E8,0x01) --Enable Item in Command Menu
WriteShort(Save+0x32F4,0x051) --Valor Form equips FAKE
WriteShort(Save+0x339C,0x02C) --Master Form equips Detection Saber
WriteShort(Save+0x33D4,0x02D) --Final Form equips Edge of Ultima
WriteShort(Save+0x4270,0x1FF) --Pause Menu Tutorial Prompts Seen Flags
WriteShort(Save+0x4274,0x1FF) --Status Form & Summon Seen Flags
--Unlock Shop Weapons
BitOr(Save+0x49F0,0x03) --Shop Tutorial Prompt Flags (1=Big Shops, 2=Small Shops)
BitOr(Save+0x2396,0x10) --Comet Staff & Falling Star (Olympus Coliseum)
BitOr(Save+0x2396,0x40) --Victory Bell & Chain Gear (Port Royal)
BitOr(Save+0x2397,0x80) --Lord's Broom & Dreamcloud (Pride Lands)
BitOr(Save+0x2398,0x04) --Wisdom Wand & Knight Defender (The World that Never Was)
--Unlock Data Portals
BitOr(Save+0x1D35,0x01) --BB_216_END (Xaldin)
BitOr(Save+0x1D23,0x08) --HB_FM_COM_VEX_END (Vexen)
BitOr(Save+0x1D23,0x10) --HB_FM_COM_LEX_END (Lexaeus)
BitOr(Save+0x1D23,0x40) --HB_FM_COM_ZEX_END (Zexion)
BitOr(Save+0x1CE9,0x04) --TT_013_END (Axel)
BitOr(Save+0x1D15,0x08) --HB_418_END (Demyx)
BitOr(Save+0x1D23,0x80) --HB_FM_COM_MAR_END (Marluxia)
BitOr(Save+0x1D23,0x20) --HB_FM_COM_LAR_END (Larxene)
BitOr(Save+0x1ED9,0x01) --EH_GAME_COMPLETE (TWtNW Members)
--Story Flag (Prevent Start-of-Visit Spawn ID Change)
BitOr(Save+0x1CED,0x10) --TT_START_01
BitOr(Save+0x1CED,0x20) --TT_START_02
BitOr(Save+0x1D10,0x01) --HB_START
BitOr(Save+0x1D11,0x02) --HB_START1_2
BitOr(Save+0x1D12,0x08) --HB_tr_107_END
BitOr(Save+0x1D13,0x01) --HB_tr_117_END
BitOr(Save+0x1D15,0x10) --HB_START2
BitOr(Save+0x1D15,0x20) --HB_START_wi_dc
BitOr(Save+0x1D16,0x02) --HB_START_Pooh
BitOr(Save+0x1D19,0x20) --HB_TR_202_END
BitOr(Save+0x1D1A,0x02) --HB_TR_tr04_ms202
BitOr(Save+0x1D1A,0x08) --HB_TR_tr09_ms205
BitOr(Save+0x1D20,0x10) --HB_POOH_CLEAR
BitOr(Save+0x1D21,0x10) --HB_RTN_ON
BitOr(Save+0x1D21,0x80) --HB_TR05_HIDDEN_ON
BitOr(Save+0x1D22,0x01) --HB_TR05_HIDDEN_OFF
BitOr(Save+0x1D22,0x02) --HB_TR08_HIDDEN_ON
BitOr(Save+0x1D22,0x04) --HB_TR08_HIDDEN_OFF
BitOr(Save+0x1D22,0x80) --HB_RTN_ON_OFF
BitOr(Save+0x1D30,0x01) --BB_START
BitOr(Save+0x1D33,0x01) --BB_START2
BitOr(Save+0x1D50,0x01) --HE_START
BitOr(Save+0x1D55,0x02) --HE_W_COL_ON
BitOr(Save+0x1D50,0x80) --HE_START2A
BitOr(Save+0x1D51,0x02) --HE_START2B
BitOr(Save+0x1D70,0x01) --AL_START
BitOr(Save+0x1D72,0x20) --AL_START2
BitOr(Save+0x1D90,0x01) --MU_START
BitOr(Save+0x1D92,0x08) --MU_START2
BitOr(Save+0x1DD0,0x01) --LK_START
BitOr(Save+0x1DD3,0x01) --LK_START2
BitOr(Save+0x1DF0,0x01) --LM_START
BitOr(Save+0x1E10,0x02) --DC_START
BitOr(Save+0x1E50,0x01) --NM_START
BitOr(Save+0x1E50,0x02) --NM_START2
BitOr(Save+0x1E90,0x01) --CA_START
BitOr(Save+0x1E90,0x04) --CA_START2
BitOr(Save+0x1EB0,0x01) --TR_START
BitOr(Save+0x1EB2,0x10) --TR_START2
BitOr(Save+0x1EB4,0x10) --TR_hb_304_END
BitOr(Save+0x1EB5,0x01) --TR_hb_501_END
BitOr(Save+0x1EB5,0x02) --TR_hb_502_END
BitOr(Save+0x1EB5,0x04) --TR_503_END
BitOr(Save+0x1EB7,0x04) --TR_HB05_HIDDEN_OFF
BitOr(Save+0x1ED0,0x01) --EH_START
BitOr(Save+0x1CD6,0x02) --TT_203_END_L (Show Jiminy and TT in Journal)
BitOr(Save+0x1ED8,0x04) --EH_FINAL_CHANCE_START
end
end
function GoA()
--Garden of Assemblage Rearrangement
if Place == 0x1A04 then
--Shop
WriteString(Obj0+0x13450,'SHOP_POINT\0') --Wallace -> Moogle
WriteString(Obj0+0x13470,'N_EX960_RTN.mset\0')
WriteShort(Sys3+0x16F40,0x001) --Stock Potion
WriteShort(Sys3+0x16F42,0x003) --Stock Ether
--Open Promise Charm Path
if ReadByte(Save+0x36B2) > 0 and ReadByte(Save+0x36B3) > 0 and ReadByte(Save+0x36B4) > 0 and ReadByte(Save+0x3694) > 0 then --All Proofs & Promise Charm
Spawn('Short',0x06,0x05C,0x77A) --Text
end
--Demyx's Portal Text
if ReadByte(Save+0x1D2E) > 0 then --Hollow Bastion Cleared
Spawn('Short',0x05,0x25C,0x779) --Radiant Garden
end
else --Revert Shop
WriteString(Obj0+0x13450,'N_EX700_TT_WEAPON_RTN') --Moogle -> Wallace
WriteString(Obj0+0x13470,'N_EX700_SHOP_RTN.mset')
WriteShort(Sys3+0x16F40,0x094) --Stock Hammer Staff
WriteShort(Sys3+0x16F42,0x08B) --Stock Adamant Shield
end
--Spawn Middle Chest
if ReadShort(Save+0x06AC) == 0x02 then
WriteShort(Save+0x06AC,0x00) --Garden of Assemblage MAP
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
WriteByte(Save+0x1CFF,0)
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,0x00,0x00,0x02)
end
end
--Battle Level
if true then
local Bitmask, Visit = false
if World == 0x02 then --Twilight Town & Simulated Twilight Town
Visit = ReadByte(Save+0x3FF5)
if Visit == 1 or Visit == 2 or Visit == 3 then
Bitmask = 0x040001
elseif Visit == 4 or Visit == 5 then
Bitmask = 0x140001
elseif Visit == 6 then
Bitmask = 0x140401
elseif Visit == 7 or Visit == 8 then
Bitmask = 0x141C01
elseif Visit == 9 then
Bitmask = 0x143D01
elseif Visit == 10 then
Bitmask = 0x157D79
elseif Visit == 13 then --Road to Data
Bitmask = 0x060000
end
elseif World == 0x04 then --Hollow Bastion
Visit = ReadByte(Save+0x3FFD)
if Visit == 1 or Visit == 2 or Visit == 3 then
Bitmask = 0x141C01
elseif Visit == 4 then
Bitmask = 0x147D09
elseif Visit == 5 then
Bitmask = 0x15FD79
end
elseif World == 0x05 then --Beast's Castle
Visit = ReadByte(Save+0x4001)
if Visit == 1 then
Bitmask = 0x141C01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x06 then --Olympus Coliseum
Visit = ReadByte(Save+0x4005)
if Visit == 1 then
Bitmask = 0x141C01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x07 then --Agrabah
Visit = ReadByte(Save+0x4009)
if Visit == 1 then
Bitmask = 0x141D01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x08 then --The Land of Dragons
Visit = ReadByte(Save+0x400D)
if Visit == 1 then
Bitmask = 0x141C01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x0A then --Pride Lands
Visit = ReadByte(Save+0x4015)
if Visit == 1 then
Bitmask = 0x141D01
elseif Visit == 2 then
Bitmask = 0x15FDF9
end
elseif World == 0x0C or World == 0x0D then --Disney Castle & Timeless River
Bitmask = 0x141D01
elseif World == 0x0E then --Halloween Town
Visit = ReadByte(Save+0x4025)
if Visit == 1 then
Bitmask = 0x141D01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x10 then --Port Royal
Visit = ReadByte(Save+0x402D)
if Visit == 1 then
Bitmask = 0x141C01
elseif Visit == 2 then
Bitmask = 0x147D19
end
elseif World == 0x11 then --Space Paranoids
Visit = ReadByte(Save+0x4031)
if Visit == 1 then
Bitmask = 0x147D01
elseif Visit == 2 then
Bitmask = 0x15FD79
end
elseif World == 0x12 then --The World that Never Was
Bitmask = 0x157D79
end
if not Bitmask then --Safeguard if all above are false
Bitmask = 0x040000
end
WriteInt(Save+0x3724,Bitmask)
end
--Fix Genie Crash
if true then --No Valor, Wisdom, Master, or Final
local CurSubmenu
if Platform == 0 then
CurSubmenu = ReadInt(Menu2)
CurSubmenu = ReadByte(CurSubmenu)
elseif Platform == 1 then
CurSubmenu = ReadLong(Menu2)
if ENGINE_VERSION < 5.0 then
CurSubmenu = ReadByteA(CurSubmenu)
else
CurSubmenu = ReadByte(CurSubmenu,true)
end
end
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
--Progressive Growth Abilities & Fixed Trinity Limit Slot
for Slot = 0,68 do
local Current = Save+0x2544 + 2*Slot
local Ability = ReadShort(Current)
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)
elseif ReadShort(Slot70)|0x8000 >= 0x8061 then
else
WriteShort(Slot70,ReadShort(Slot70)+0x0001)
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)
elseif ReadShort(Slot71)|0x8000 >= 0x8065 then
else
WriteShort(Slot71,ReadShort(Slot71)+0x0001)
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)
elseif ReadShort(Slot72)|0x8000 >= 0x8237 then
else
WriteShort(Slot72,ReadShort(Slot72)+0x0001)
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)
elseif ReadShort(Slot73)|0x8000 >= 0x8069 then
else
WriteShort(Slot73,ReadShort(Slot73)+0x0001)
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)
elseif ReadShort(Slot74)|0x8000 >= 0x806D then
else
WriteShort(Slot74,ReadShort(Slot74)+0x0001)
end
elseif Ability == 0x0C6 then --Trinity Limit
WriteShort(Current,0)
WriteShort(Save+0x25D8,0x00C6)
end
end
--Munny Pouch (Olette)
if ReadByte(Save+0x363C) > ReadByte(Save+0x35C4) then
WriteShort(Save+0x2440,ReadShort(Save+0x2440)+5000)
WriteByte(Save+0x35C4,ReadByte(Save+0x35C4)+1)
end
--Munny Pouch (Mickey)
if ReadByte(Save+0x3695) > ReadByte(Save+0x35C5) then
WriteShort(Save+0x2440,ReadShort(Save+0x2440)+5000)
WriteByte(Save+0x35C5,ReadByte(Save+0x35C5)+1)
end
--DUMMY 23 = Maximum HP Increased!
if ReadByte(Save+0x3671) > 0 then
local Bonus
if ReadByte(Save+0x2498) < 0x03 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!
if ReadByte(Save+0x3672) > 0 then
local Bonus
if ReadByte(Save+0x2498) < 0x03 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!
if ReadByte(Save+0x3673) > 0 then
WriteByte(Slot1+0x1B1,ReadByte(Slot1+0x1B1)+1)
WriteByte(Slot1+0x1B2,ReadByte(Slot1+0x1B2)+1)
WriteByte(Save+0x3673,ReadByte(Save+0x3673)-1)
end
--DUMMY 26 = Gained Armor Slot!
if ReadByte(Save+0x3674) > 0 and ReadByte(Save+0x2500) < 8 then
WriteByte(Save+0x2500,ReadByte(Save+0x2500)+1)
WriteByte(Save+0x3674,ReadByte(Save+0x3674)-1)
end
--DUMMY 27 = Gained Accessory Slot!
if ReadByte(Save+0x3675) > 0 and ReadByte(Save+0x2501) < 8 then
WriteByte(Save+0x2501,ReadByte(Save+0x2501)+1)
WriteByte(Save+0x3675,ReadByte(Save+0x3675)-1)
end
--DUMMY 16 = Gained Item Slot!
if ReadByte(Save+0x3660) > 0 and ReadByte(Save+0x2502) < 8 then
WriteByte(Save+0x2502,ReadByte(Save+0x2502)+1)
WriteByte(Save+0x3660,ReadByte(Save+0x3660)-1)
end
--Donald's Staff Active Abilities
if true then
local Staff = ReadShort(Save+0x2604)
local Ability = false
if Staff == 0x04B then --Mage's Staff
Ability = 0x13F36
elseif Staff == 0x094 then --Hammer Staff
Ability = 0x13F46
elseif Staff == 0x095 then --Victory Bell
Ability = 0x13F56
elseif Staff == 0x097 then --Comet Staff
Ability = 0x13F76
elseif Staff == 0x098 then --Lord's Broom
Ability = 0x13F86
elseif Staff == 0x099 then --Wisdom Wand
Ability = 0x13F96
elseif Staff == 0x096 then --Meteor Staff
Ability = 0x13F66
elseif Staff == 0x09A then --Rising Dragon
Ability = 0x13FA6
elseif Staff == 0x09C then --Shaman's Relic
Ability = 0x13FC6
elseif Staff == 0x258 then --Shaman's Relic+
Ability = 0x14406
elseif Staff == 0x09B then --Nobody Lance
Ability = 0x13FB6
elseif Staff == 0x221 then --Centurion
Ability = 0x14316
elseif Staff == 0x222 then --Centurion+
Ability = 0x14326
elseif Staff == 0x1E2 then --Save the Queen
Ability = 0x14186
elseif Staff == 0x1F7 then --Save the Queen+
Ability = 0x142D6
elseif Staff == 0x223 then --Plain Mushroom
Ability = 0x14336
elseif Staff == 0x224 then --Plain Mushroom+
Ability = 0x14346
elseif Staff == 0x225 then --Precious Mushroom
Ability = 0x14356
elseif Staff == 0x226 then --Precious Mushroom+
Ability = 0x14366
elseif Staff == 0x227 then --Premium Mushroom
Ability = 0x14376
elseif Staff == 0x0A1 then --Detection Staff
Ability = 0x13FD6
end
if Ability then
Ability = ReadShort(Sys3+Ability)
if Ability == 0x0A5 then --Donald Fire
WriteShort(Save+0x26F6,0x80A5)
WriteByte(Sys3+0x11F0B,0)
elseif Ability == 0x0A6 then --Donald Blizzard
WriteShort(Save+0x26F6,0x80A6)
WriteByte(Sys3+0x11F23,0)
elseif Ability == 0x0A7 then --Donald Thunder
WriteShort(Save+0x26F6,0x80A7)
WriteByte(Sys3+0x11F3B,0)
elseif Ability == 0x0A8 then --Donald Cure
WriteShort(Save+0x26F6,0x80A8)
WriteByte(Sys3+0x11F53,0)
else
WriteShort(Save+0x26F6,0) --Remove Ability Slot 80
WriteByte(Sys3+0x11F0B,2) --Restore Original AP Costs
WriteByte(Sys3+0x11F23,2)
WriteByte(Sys3+0x11F3B,2)
WriteByte(Sys3+0x11F53,3)
end
end
end
--Goofy's Shield Active Abilities
if true then
local Shield = ReadShort(Save+0x2718)
local Ability = false
if Shield == 0x031 then --Knight's Shield
Ability = 0x13FE6
elseif Shield == 0x08B then --Adamant Shield
Ability = 0x13FF6
elseif Shield == 0x08C then --Chain Gear
Ability = 0x14006
elseif Shield == 0x08E then --Falling Star
Ability = 0x14026
elseif Shield == 0x08F then --Dreamcloud
Ability = 0x14036
elseif Shield == 0x090 then --Knight Defender
Ability = 0x14046
elseif Shield == 0x08D then --Ogre Shield
Ability = 0x14016
elseif Shield == 0x091 then --Genji Shield
Ability = 0x14056
elseif Shield == 0x092 then --Akashic Record
Ability = 0x14066
elseif Shield == 0x259 then --Akashic Record+
Ability = 0x14416
elseif Shield == 0x093 then --Nobody Guard
Ability = 0x14076
elseif Shield == 0x228 then --Frozen Pride
Ability = 0x14386
elseif Shield == 0x229 then --Frozen Pride+
Ability = 0x14396
elseif Shield == 0x1E3 then --Save the King
Ability = 0x14196
elseif Shield == 0x1F8 then --Save the King+
Ability = 0x142E6
elseif Shield == 0x22A then --Joyous Mushroom
Ability = 0x143A6
elseif Shield == 0x22B then --Joyous Mushroom+
Ability = 0x143B6
elseif Shield == 0x22C then --Majestic Mushroom
Ability = 0x143C6
elseif Shield == 0x22D then --Majestic Mushroom+
Ability = 0x143D6
elseif Shield == 0x22E then --Ultimate Mushroom
Ability = 0x143E6
elseif Shield == 0x032 then --Detection Shield
Ability = 0x14086
elseif Shield == 0x033 then --Test the King
Ability = 0x14096
end
if Ability then --Safeguard if none of the above (i.e. Main Menu)
Ability = ReadShort(Sys3+Ability)
if Ability == 0x1A7 then --Goofy Tornado
WriteShort(Save+0x280A,0x81A7)
WriteByte(Sys3+0x11F6B,0)
elseif Ability == 0x1AD then --Goofy Bash
WriteShort(Save+0x280A,0x81AD)
WriteByte(Sys3+0x11F83,0)
elseif Ability == 0x1A9 then --Goofy Turbo
WriteShort(Save+0x280A,0x81A9)
WriteByte(Sys3+0x11F9B,0)
else
WriteShort(Save+0x280A,0) --Remove Ability Slot 80
WriteByte(Sys3+0x11F6B,2) --Restore Original AP Costs
WriteByte(Sys3+0x11F83,2)
WriteByte(Sys3+0x11F9B,2)
end
end
end
--Enable Secret Movie after All Worlds are Cleared
if Place == 0x0001 then
local PostStorySaves = {0x1EDE,0x1D9E,0x1D3E,0x1E5E,0x1D7E,0x1D6E,0x1DDE,0x1CFD,0x1D2E,0x1E9E,0x1E1E,0x1EBE,0x1CFE} --Ordered by Portal Number
local Completed = true
for index in pairs(PostStorySaves) do
if ReadByte(Save+PostStorySaves[index]) == 0 then --World Not Cleared
Completed = false
break
end
end
if Completed then
BitOr(Save+0x1D1E,0x80) --HB_SCENARIO_5_END (100AW and Atlantica should be automatic)
else
BitNot(Save+0x1D1E,0x80) --In case someone did HB 5
end
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.
WriteByte(Sys3+0x00500,ReadByte(Slot1+0x1B2))--]]
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
Spawn('Short',0x0A,0x07C,WarpRoom)
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
BitOr(Save+0x1EDA,0x04) --EH_FM_XEM_RE_CLEAR (Change Portal Color)
WriteByte(Save+0x1EDE,5) --Post-Story Save
WriteShort(Save+0x1B24,0x03) --Memory's Skyscraper BTL
WriteShort(Save+0x1B7C,0x0D) --The Altar of Naught MAP (Data Door)
BitOr(Save+0x1ED6,0x80) --EH_JIMMNY_FULL_OPEN
elseif Place == 0x1412 then --Xemnas II
if ReadInt(Slot3) == 1 then --Laser Dome Skip
WriteInt(Slot3,0)
elseif ReadByte(Pause) == 2 then --Enable Pause
WriteByte(Pause,0)
end
WriteArray(Save+0x1BA6,ReadArray(Save+0x1B22,6)) --Save Memory Skyscraper Spawn ID
WriteArray(Save+0x1BAC,ReadArray(Save+0x1B7C,6)) --Save The Altar of Naught Spawn ID
elseif Place == 0x0001 and not Events(0x39,0x39,0x39) then --Post Xemnas II Cutscenes
if ReadByte(Pause) == 2 then --Enable Pause
WriteByte(Pause,0)
end
WriteArray(Save+0x1B22,ReadArray(Save+0x1BA6,6)) --Load Memory Skyscraper Spawn ID
WriteArray(Save+0x1B7C,ReadArray(Save+0x1BAC,6)) --Load The Altar of Naught Spawn ID
WriteInt(Save+0x000C,0x321A04) --Post-Game Save at Garden of Assemblage
BitNot(Save+0x1CEE,0x0C) --TT_TT21 (Computer Room Flag Fix)
end
--The World that Never Was Post-Story Save
if Place == 0x1A04 and ReadByte(Save+0x1EDE) > 0 then
if PrevPlace == 0x0112 then --Alley to Between
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 and Data Xemnas Warp
if Place == 0x1212 and Events(0x04,0x00,0x04) then
if ReadByte(Save+0x36B2) > 0 and ReadByte(Save+0x36B3) > 0 and ReadByte(Save+0x36B4) > 0 then --All Proofs Obtained
Spawn('Short',0x05,0x060,0x13D) --Spawn Door RC
else
Spawn('Short',0x05,0x060,0x000) --Despawn Door RC
end
end
--[[Skip Dragon Xemnas
if Place == 0x1D12 then
Spawn('Short',0x03,0x038,0x5C)
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
elseif Progress == 2 then --Before Summit Rapid Heartless
WarpRoom = 0x0C
elseif Progress == 3 then --[After Summit Heartless, Before Shan Yu]
WarpRoom = 0x00
elseif Progress == 4 then --Post 1st Visit
WarpRoom = 0x0C
elseif Progress == 5 then --[2nd Visit, Before Riku]
WarpRoom = 0x0C
elseif Progress == 6 then --[Before Imperial Square Heartless II, Before Antechamber Nobodies]
WarpRoom = 0x00
elseif Progress == 7 then --Before Storm Rider
WarpRoom = 0x0B
end
elseif PostSave == 1 then --Bamboo Grove
WarpRoom = 0x00
elseif PostSave == 2 then --Village (Intact)
WarpRoom = 0x04
elseif PostSave == 3 then --Throne Room
WarpRoom = 0x0B
end
Spawn('Short',0x0A,0x09C,WarpRoom)
end
--World Progress
if Place == 0x0308 and Events(0x47,0x47,0x47) then --Mountain Climb
WriteByte(Save+0x1D9F,1)
elseif Place == 0x0C08 and Events(Null,Null,0x01) then --Attack on the Camp
WriteByte(Save+0x1D9F,2)
elseif Place == 0x0708 and Events(Null,Null,0x02) then --Avalanche
WriteByte(Save+0x1D9F,3)
if ReadInt(CutLen) == 0x064 then --Remove Mulan's Auto Limit
for Slot = 0,79 do
local AbilitySlot = Save + 0x2AA8 + Slot*2
if ReadShort(AbilitySlot) == 0x81A1 then
WriteShort(AbilitySlot,0x01A1)
break
end
end