This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
GoA RAM.lua
3877 lines (3846 loc) · 156 KB
/
GoA RAM.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
--RAM Version
--Last Update: Drive Up leftover items removal, QoL embedded
--Todo: Determine what to do with vanilla form growth
LUAGUI_NAME = 'GoA RAM Randomizer Build'
LUAGUI_AUTH = 'SonicShadowSilver2 (Ported by Num)'
LUAGUI_DESC = 'A GoA build for use with the Randomizer.'
function _OnInit()
local VersionNum = 'GoA Version 1.53.3'
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)
OnPC = false
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
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 --Something about end-of-battle camera
TxtBox = 0x1D48D54 --Last Displayed Textbox
DemCln = 0x1D48DEC --Demyx Clone Status
ARDLoad = 0x034ECF4 --ARD Pointer Address
MSNLoad = 0x04FA440 --Base MSN Address
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('LuaBackend is Outdated. Things might not work properly.',2)
end
ConsolePrint(VersionNum,0)
OnPC = true
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
GamSpd = 0x07151D4 - 0x56454E
CutNow = 0x0B62758 - 0x56450E
CutLen = 0x0B62774 - 0x56450E
CutSkp = 0x0B6275C - 0x56450E
BtlTyp = 0x2A0EAC4 - 0x56450E
BtlEnd = 0x2A0D3A0 - 0x56450E
TxtBox = 0x074BC70 - 0x56454E
DemCln = 0x2A0CF74 - 0x56450E
ARDLoad = 0x2A0CEE8 - 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
--Detect errors
if ReadInt(ARD,OnPC) ~= 0x01524142 then --Header mismatch
return
elseif Subfile > ReadInt(ARD+4,OnPC) then --Subfile over count
return
elseif Offset >= ReadInt(Subpoint+4,OnPC) then --Offset exceed subfile length
return
end
--Get address
if not OnPC then
Address = ReadInt(Subpoint) + Offset
else
local x = ARD&0xFFFFFF000000 --Calculations are wrong if done in one step for some reason
local y = ReadInt(Subpoint,true)&0xFFFFFF
Address = x + y + Offset
end
--Change value
if Type == 'Read' then
ReadArray(Address,Value,OnPC)
elseif Type == 'Short' then
WriteShort(Address,Value,OnPC)
elseif Type == 'Float' then
WriteFloat(Address,Value,OnPC)
elseif Type == 'Int' then
WriteInt(Address,Value,OnPC)
elseif Type == 'String' then
WriteString(Address,Value,OnPC)
end
end
function BitOr(Address,Bit,Abs)
WriteByte(Address,ReadByte(Address)|Bit,Abs and OnPC)
end
function BitNot(Address,Bit,Abs)
WriteByte(Address,ReadByte(Address)&~Bit,Abs and OnPC)
end
function DriveRefill(Guaranteed)
if (Place ~= PrevPlace or ReadByte(Cntrl) == 3) and (ReadShort(Save+0x3524) ~= 0 or Guaranteed) then
WriteShort(Save+0x3524,0) --Revert/Dismiss
WriteByte(Save+0x3528,100) --Restore Drive
WriteByte(Save+0x3529,ReadByte(Save+0x352A))
end
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 _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 not OnPC then
ARD = ReadInt(ARDLoad) --Base ARD Address
else
ARD = ReadLong(ARDLoad) --Base ARD Address
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 ReadShort(Btl0+0x2EB4C) == 1000 then --MCP Vanilla HP
--Unequip Auron's Auto Limit
if ReadShort(Btl0+0x312E6) == 0x81A1 then
WriteShort(Btl0+0x312E6,0x01A1)
end
--Unequip Beast's Auto Limit
if ReadShort(Btl0+0x314EA) == 0x81A1 then
WriteShort(Btl0+0x314EA,0x01A1)
end
--Unequip Simba's Auto Limit
if ReadShort(Btl0+0x315EA) == 0x81A1 then
WriteShort(Btl0+0x315EA,0x01A1)
end
WriteShort(Btl0+0x2EB4C,500) --Fast MCP (50% Base HP)
WriteShort(Btl0+0x2EB8C,300) --Double Max Damage %
WriteShort(Btl0+0x2EB8E,100) --Double Min Damage %
WriteByte(Btl0+0x2AF32,0) --Remove Twilight Thorn's HP Increase
WriteByte(Sys3+0x1271B,3) --Protect AP Cost
WriteByte(Sys3+0x12733,4) --Protectra AP Cost
WriteByte(Sys3+0x1274B,5) --Protectga AP Cost
--Dummy Texts & Icon
WriteShort(Sys3+0x10C04,0x8AE2) --Dummy 23
WriteShort(Sys3+0x10C06,0x8AE2)
WriteByte(Sys3+0x10C13,0x1A)
WriteShort(Sys3+0x10C1C,0x8AE3) --Dummy 24
WriteShort(Sys3+0x10C1E,0x8AE3)
WriteByte(Sys3+0x10C2B,0x1A)
WriteShort(Sys3+0x10C34,0x8AE4) --Dummy 25
WriteShort(Sys3+0x10C36,0x8AE4)
WriteByte(Sys3+0x10C43,0x1A)
WriteShort(Sys3+0x10C4C,0x8AE7) --Dummy 26
WriteShort(Sys3+0x10C4E,0x8AE7)
WriteByte(Sys3+0x10C5B,0x1A)
WriteShort(Sys3+0x10C64,0x8AE6) --Dummy 27
WriteShort(Sys3+0x10C66,0x8AE6)
WriteByte(Sys3+0x10C73,0x1A)
WriteShort(Sys3+0x10B5C,0x8AE5) --Dummy 16
WriteShort(Sys3+0x10B5E,0x8AE5)
WriteByte(Sys3+0x10C6B,0x1A)
--Big Chest -> Small Chest
if ReadByte(Obj0+0x05295) == 0x34 then --SP chest causes SoS Wallpaper without this conditional
WriteString(Obj0+0x05290,'F_EX030')
WriteString(Obj0+0x052B0,'F_EX030.mset')
WriteString(Obj0+0x052F0,'F_EX030_TR')
WriteString(Obj0+0x05310,'F_EX030.mset')
WriteString(Obj0+0x0BD10,'F_EX030_BB')
WriteString(Obj0+0x0BD30,'F_EX030.mset')
WriteString(Obj0+0x0BD70,'F_EX030_HE')
WriteString(Obj0+0x0BD90,'F_EX030.mset')
WriteString(Obj0+0x0BDD0,'F_EX030_AL')
WriteString(Obj0+0x0BDF0,'F_EX030.mset')
WriteString(Obj0+0x0BE30,'F_EX030_CA')
WriteString(Obj0+0x0BE50,'F_EX030.mset')
WriteString(Obj0+0x0BE90,'F_EX030_NM')
WriteString(Obj0+0x0BEB0,'F_EX030.mset')
WriteString(Obj0+0x0BEF0,'F_EX030_MU')
WriteString(Obj0+0x0BF10,'F_EX030.mset')
WriteString(Obj0+0x0BF50,'F_EX030_PO')
WriteString(Obj0+0x0BF70,'F_EX030.mset')
WriteString(Obj0+0x0BFB0,'F_EX030_DC')
WriteString(Obj0+0x0BFD0,'F_EX030.mset')
WriteString(Obj0+0x0C010,'F_EX030_WI')
WriteString(Obj0+0x0C030,'F_EX030.mset')
WriteString(Obj0+0x0C070,'F_EX030_EH')
WriteString(Obj0+0x0C090,'F_EX030.mset')
WriteString(Obj0+0x231D0,'F_EX050')
WriteString(Obj0+0x231F0,'F_EX050.mset')
WriteString(Obj0+0x23590,'F_EX030_NM_XMAS')
WriteString(Obj0+0x235B0,'F_EX030.mset')
WriteString(Obj0+0x256F0,'F_EX030_TT')
WriteString(Obj0+0x25710,'F_EX030_TT.mset')
WriteString(Obj0+0x2C050,'F_EX030_EH')
WriteString(Obj0+0x2C070,'F_EX030.mset')
end
end
--Change Form's Icons in PC From Analog Stick
if OnPC and ReadByte(Sys3+0x116DB) == 0x19 then
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 not OnPC then
Warp(0x02,0x20,0x32,0x01,0x00,0x01) --Not warping here on PS2 causes freeze after skipping GoA Activation scene
else
Spawn('Short',0x03,0x300,0x01) --Day 1 Start -> Station of Serenity Weapons
Spawn('Short',0x03,0x304,0x20)
Spawn('Short',0x03,0x306,0x32)
Spawn('Short',0x03,0x308,0x00)
WriteByte(CutSkp,1) --Warping earlier on PC causes SoS Wallpaper
end
end
--Start New Game 2
if Place == 0x2002 then
Spawn('Short',0x0A,0x0E0,0x01) --Station of Serenity Nobodies -> Garden of Assemblage
Spawn('Short',0x0A,0x0E2,0x04)
Spawn('Short',0x0A,0x0E4,0x1A)
Spawn('Short',0x0A,0x0E8,0x00)
Spawn('Short',0x0E,0x034,0x745) --Dusk -> Mickey
Spawn('Short',0x0E,0x074,0x433) --Dusk -> Donald
Spawn('Short',0x0E,0x0B4,0x434) --Dusk -> Goofy
if Events(0x01,Null,0x01) then --Station of Serenity Weapons
BitNot(Save+0x1CD2,0x80) --TT_SCENARIO_1_START (Show Gameplay Elements)
BitOr(Save+0x1CEB,0x08) --TT_ROXAS_START (Prepare Roxas' Flag)
BitOr(Save+0x1CEA,0x01) --TT_ROXAS_END (Play as Sora)
BitOr(Save+0x1CEA,0x02) --TT_SORA_OLD_END (Play as KH2 Sora)
BitOr(Save+0x239E,0x08) --Show Journal
WriteByte(Pause,2) --Disable Pause
if ReadInt(CutLen) == 0x246 then --Dusks attack
WriteByte(CutSkp,1)
end
--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
--Place Scripts
WriteShort(Save+0x03D0,0x00) --Station of Serenity MAP (Chest, Save, Door)
WriteShort(Save+0x03D4,0x00) --Station of Serenity 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+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+0x1E35,0x01) --WI_START2
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
end
function GoA()
--Garden of Assemblage Rearrangement
if Place == 0x1A04 then
WriteInt(Save+0x3544,0x12020100) --Remove Riku
DriveRefill()
--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
--Right Chest
Spawn('Float',0x07,0x038,-160) --Position X
Spawn('Float',0x07,0x040,360) --Position Z
Spawn('Float',0x07,0x048,pi/2) --Rotation Y
--Left Chest
Spawn('Float',0x07,0x078,-160) --Position X
Spawn('Float',0x07,0x080,-360) --Position Z
Spawn('Float',0x07,0x088,pi/2) --Rotation Y
--Save Point & Moogle Shop
local GoASpawn = false
local File = 0x02
if Door == 0x32 then --Interacting with Computer
File = 0x0B
GoASpawn = 0x074
elseif Door == 0x00 then --100 Acre Wood
GoASpawn = 0xA60
elseif Door == 0x01 then --Atlantica
GoASpawn = 0xB4C
elseif Door == 0x15 then --The World that Never Was
GoASpawn = 0x074
elseif Door == 0x16 then --Land of Dragons
GoASpawn = 0x134
elseif Door == 0x17 then --Beast's Castle
GoASpawn = 0x1F4
elseif Door == 0x18 then --Halloween Town
GoASpawn = 0x2B4
elseif Door == 0x19 then --Agrabah
GoASpawn = 0x374
elseif Door == 0x1A then --Olympus Coliseum
GoASpawn = 0x434
elseif Door == 0x1B then --Pride Lands
GoASpawn = 0x4F4
elseif Door == 0x1C then --Twilight Town
GoASpawn = 0x5B4
elseif Door == 0x1D then --Hollow Bastion
GoASpawn = 0x674
elseif Door == 0x1E then --Port Royal
GoASpawn = 0x734
elseif Door == 0x1F then --Disney Castle
GoASpawn = 0x7F4
elseif Door == 0x20 then --Space Paranoids
GoASpawn = 0x8B4
elseif Door == 0x21 then --Simulated Twilight Town
GoASpawn = 0x974
end
if GoASpawn then --Saveguard if somehow none of the above are true
Spawn('Short',File,GoASpawn+0x00,0x23A) --Party 1 -> Save Point
Spawn('Float',File,GoASpawn+0x04,0) --Position X
Spawn('Float',File,GoASpawn+0x08,460) --Position Y
Spawn('Float',File,GoASpawn+0x0C,-900) --Position Z
if Evt == 0x01 then
Spawn('Short',File,GoASpawn+0x20,0x00) --Save Door
else
Spawn('Short',File,GoASpawn+0x20,0x32) --Save Door
end
Spawn('Short',File,GoASpawn+0x40,0x4A1) --Party 2 -> Moogle Shop
Spawn('Float',File,GoASpawn+0x44,0) --Position X
Spawn('Float',File,GoASpawn+0x48,460) --Position Y
Spawn('Float',File,GoASpawn+0x4C,900) --Position Z
Spawn('Float',File,GoASpawn+0x54,0) --Rotation Y
Spawn('Short',File,GoASpawn+0x6C,0x0D1) --RC
end
--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
if not OnPC then
Spawn('Short',0x06,0x05C,0x761) --Text
Spawn('Short',0x06,0x060,0x01F) --RC
if ReadByte(CamTyp) == 4 then
WriteByte(CamTyp,8)
end
else
if ReadInt(0x0C65C2E-0x56450E) == 0xADA7A89C then
WriteByte(0x0C6FA36-0x56450E,0x02) --Add 2nd Textbox
WriteArray(0x0C65C22-0x56450E,{0x41,0xA1,0xA2,0xAC,0x01,0x9D,0x9E,0xAF,0xA2,0x9C,0x9E,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x41,0xA1,0x9E,0x01,0x44,0xA8,0xAB,0xA5,0x9D,0x01,0xA8,0x9F,0x01,0x3B,0xA8,0xAD,0xA1,0xA2,0xA7,0xA0,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0xAB,0x9E,0x01,0xB2,0xA8,0xAE,0x01,0xA9,0xAB,0x9E,0xA9,0x9A,0xAB,0x9E,0x9D,0x01,0x9F,0xA8,0xAB,0x01,0xB0,0xA1,0x9A,0xAD,0x01,0xA5,0xA2,0x9E,0xAC,0x01,0x9A,0xA1,0x9E,0x9A,0x9D,0x49,0x02,0x15,0x33,0x00,0x36,0x01,0xA7,0x9E,0x9E,0x9D,0x01,0x9A,0x01,0xA6,0xA8,0xA6,0x9E,0xA7,0xAD,0x01,0xAD,0xA8,0x01,0x9C,0x9A,0xA5,0xA6,0x01,0x9D,0xA8,0xB0,0xA7,0x4F,0x02,0x15,0xA1,0x00,0x39,0x9E,0xAD,0xEE,0xAC,0x01,0x9E,0xA7,0x9D,0x01,0xAD,0xA1,0xA2,0xAC,0x48,0x48,0x48,0x00})
elseif ReadInt(0x0D45C2E-0x56450E) == 0xADA7A89C then
WriteByte(0x0D4FA36-0x56450E,0x02) --Add 2nd Textbox
WriteArray(0x0D45C22-0x56450E,{0x41,0xA1,0xA2,0xAC,0x01,0x9D,0x9E,0xAF,0xA2,0x9C,0x9E,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x41,0xA1,0x9E,0x01,0x44,0xA8,0xAB,0xA5,0x9D,0x01,0xA8,0x9F,0x01,0x3B,0xA8,0xAD,0xA1,0xA2,0xA7,0xA0,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0xAB,0x9E,0x01,0xB2,0xA8,0xAE,0x01,0xA9,0xAB,0x9E,0xA9,0x9A,0xAB,0x9E,0x9D,0x01,0x9F,0xA8,0xAB,0x01,0xB0,0xA1,0x9A,0xAD,0x01,0xA5,0xA2,0x9E,0xAC,0x01,0x9A,0xA1,0x9E,0x9A,0x9D,0x49,0x02,0x15,0x33,0x00,0x36,0x01,0xA7,0x9E,0x9E,0x9D,0x01,0x9A,0x01,0xA6,0xA8,0xA6,0x9E,0xA7,0xAD,0x01,0xAD,0xA8,0x01,0x9C,0x9A,0xA5,0xA6,0x01,0x9D,0xA8,0xB0,0xA7,0x4F,0x02,0x15,0xA1,0x00,0x39,0x9E,0xAD,0xEE,0xAC,0x01,0x9E,0xA7,0x9D,0x01,0xAD,0xA1,0xA2,0xAC,0x48,0x48,0x48,0x00})
end
end
end
--Data Portal Texts
if OnPC then
local XemnasPortalText = false
if ReadInt(0x0C65678-0x56450E) == 0xADAD9A2F then
XemnasPortalText = 0x0C65678-0x56450E
elseif ReadInt(0x0D45678-0x56450E) == 0xADAD9A2F then
XemnasPortalText = 0x0D45678-0x56450E
end
if XemnasPortalText then
local XigbarPortalText = 0x70 + XemnasPortalText
local XaldinPortalText = 0x70 + XigbarPortalText
local VexenPortalText = 0x70 + XaldinPortalText
local LexaeusPortalText = 0x6F + VexenPortalText
local ZexionPortalText = 0x71 + LexaeusPortalText
local SaixPortalText = 0x70 + ZexionPortalText
local AxelPortalText = 0x6E + SaixPortalText
local DemyxPortalText = 0x6E + AxelPortalText
local LuxordPortalText = 0x6F + DemyxPortalText
local MarluxiaPortalText = 0x70 + LuxordPortalText
local LarxenePortalText = 0x72 + MarluxiaPortalText
local RoxasPortalText = 0x72 + LarxenePortalText
WriteArray(XemnasPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x41,0xA1,0x9E,0x01,0x44,0xA8,0xAB,0xA5,0x9D,0x01,0x41,0xA1,0x9A,0xAD,0x01,0x3B,0x9E,0xAF,0x9E,0xAB,0x01,0x44,0x9A,0xAC,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA1,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(XigbarPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x41,0xA1,0x9E,0x01,0x39,0x9A,0xA7,0x9D,0x01,0xA8,0x9F,0x01,0x31,0xAB,0x9A,0xA0,0xA8,0xA7,0xAC,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA2,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(XaldinPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x2F,0x9E,0x9A,0xAC,0xAD,0xEE,0xAC,0x01,0x30,0x9A,0xAC,0xAD,0xA5,0x9E,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA3,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(VexenPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x35,0x9A,0xA5,0xA5,0xA8,0xB0,0x9E,0x9E,0xA7,0x01,0x41,0xA8,0xB0,0xA7,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA4,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(LexaeusPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x2E,0xA0,0xAB,0x9A,0x9B,0x9A,0xA1,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA5,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(ZexionPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x3C,0xA5,0xB2,0xA6,0xA9,0xAE,0xAC,0x01,0x30,0xA8,0xA5,0xA2,0xAC,0x9E,0xAE,0xA6,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA6,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(SaixPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x3D,0xAB,0xA2,0x9D,0x9E,0x01,0x39,0x9A,0xA7,0x9D,0xAC,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA7,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(AxelPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x41,0xB0,0xA2,0xA5,0xA2,0xA0,0xA1,0xAD,0x01,0x41,0xA8,0xB0,0xA7,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA8,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
if ReadByte(Save+0x1D2E) == 0 then --Hollow Bastion
WriteArray(DemyxPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x35,0xA8,0xA5,0xA5,0xA8,0xB0,0x01,0x2F,0x9A,0xAC,0xAD,0xA2,0xA8,0xA7,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA9,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
else --Radiant Garden
WriteArray(DemyxPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x3F,0x9A,0x9D,0xA2,0x9A,0xA7,0xAD,0x01,0x34,0x9A,0xAB,0x9D,0x9E,0xA7,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xA9,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
end
WriteArray(LuxordPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x3D,0xA8,0xAB,0xAD,0x01,0x3F,0xA8,0xB2,0x9A,0xA5,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xAA,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(MarluxiaPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x31,0xA2,0xAC,0xA7,0x9E,0xB2,0x01,0x30,0x9A,0xAC,0xAD,0xA5,0x9E,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xAB,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(LarxenePortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x40,0xA9,0x9A,0x9C,0x9E,0x01,0x3D,0x9A,0xAB,0x9A,0xA7,0xA8,0xA2,0x9D,0xAC,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xAC,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
WriteArray(RoxasPortalText,{0x41,0xA1,0xA2,0xAC,0x01,0xA9,0xA8,0xAB,0xAD,0x9A,0xA5,0x01,0xA5,0x9E,0x9A,0x9D,0xAC,0x01,0xAD,0xA8,0x66,0x66,0x02,0x40,0xA2,0xA6,0xAE,0xA5,0x9A,0xAD,0x9E,0x9D,0x01,0x41,0xB0,0xA2,0xA5,0xA2,0xA0,0xA1,0xAD,0x01,0x41,0xA8,0xB0,0xA7,0x4F,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,0x15,0x33,0x00,0x3B,0xA8,0xAD,0x01,0xAB,0xA2,0xA0,0xA1,0xAD,0x01,0xA7,0xA8,0xB0,0x4F,0x02,0x15,0xAD,0x00,0x43,0xA2,0xAC,0xA2,0xAD,0x48,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03})
end
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
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
--World Map Text
if OnPC and ReadInt(0x2AC6891-0x56450E) == 0xA5ABA844 then
local Text = {0x34,0x9A,0xAB,0x9D,0x9E,0xA7,0x03,0x03,0x03} --"Garden"
WriteArray(0x2AC6891-0x56450E,Text)
WriteArray(0x2AC68B0-0x56450E,Text)
WriteArray(0x2ACA848-0x56450E,Text)
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 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
if true then
for i = 0,34 do
WriteByte(Btl0 + 0x344A5 + 0x8*i,0) --Remove Innate Growth Abilities
end
local Growth = {0x805E,0x8062,0x8234,0x8066,0x806A}
for form = 0,4 do --Adjust Form Movement
local FormAddress = Save + 0x32F6 + 0x38*form
local FormLv = ReadByte(FormAddress)
for level = 0,6 do
WriteShort(FormAddress+6, Growth[form+1] + math.floor(level/2))
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
Ability[0x04B] = 0x13F36 --Mage's Staff
Ability[0x094] = 0x13F46 --Hammer Staff
Ability[0x095] = 0x13F56 --Victory Bell
Ability[0x097] = 0x13F76 --Comet Staff
Ability[0x098] = 0x13F86 --Lord's Broom
Ability[0x099] = 0x13F96 --Wisdom Wand
Ability[0x096] = 0x13F66 --Meteor Staff
Ability[0x09A] = 0x13FA6 --Rising Dragon
Ability[0x09C] = 0x13FC6 --Shaman's Relic
Ability[0x258] = 0x14406 --Shaman's Relic+
Ability[0x09B] = 0x13FB6 --Nobody Lance
Ability[0x221] = 0x14316 --Centurion
Ability[0x222] = 0x14326 --Centurion+
Ability[0x1E2] = 0x14186 --Save the Queen
Ability[0x1F7] = 0x142D6 --Save the Queen+
Ability[0x223] = 0x14336 --Plain Mushroom
Ability[0x224] = 0x14346 --Plain Mushroom+
Ability[0x225] = 0x14356 --Precious Mushroom
Ability[0x226] = 0x14366 --Precious Mushroom+
Ability[0x227] = 0x14376 --Premium Mushroom
Ability[0x0A1] = 0x13FD6 --Detection Staff
if Ability[Staff] ~= nil then
Ability = ReadShort(Sys3+Ability[Staff]) --Currently-equipped staff's 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 = {} --Offset for shield's ability within 03system.bar
Ability[0x031] = 0x13FE6 --Knight's Shield
Ability[0x08B] = 0x13FF6 --Adamant Shield
Ability[0x08C] = 0x14006 --Chain Gear
Ability[0x08E] = 0x14026 --Falling Star
Ability[0x08F] = 0x14036 --Dreamcloud
Ability[0x090] = 0x14046 --Knight Defender
Ability[0x08D] = 0x14016 --Ogre Shield
Ability[0x091] = 0x14056 --Genji Shield
Ability[0x092] = 0x14066 --Akashic Record
Ability[0x259] = 0x14416 --Akashic Record+
Ability[0x093] = 0x14076 --Nobody Guard
Ability[0x228] = 0x14386 --Frozen Pride
Ability[0x229] = 0x14396 --Frozen Pride+
Ability[0x1E3] = 0x14196 --Save the King
Ability[0x1F8] = 0x142E6 --Save the King+
Ability[0x22A] = 0x143A6 --Joyous Mushroom
Ability[0x22B] = 0x143B6 --Joyous Mushroom+
Ability[0x22C] = 0x143C6 --Majestic Mushroom
Ability[0x22D] = 0x143D6 --Majestic Mushroom+
Ability[0x22E] = 0x143E6 --Ultimate Mushroom
Ability[0x032] = 0x14086 --Detection Shield
Ability[0x033] = 0x14096 --Test the King
if Ability[Shield] ~= nil then
Ability = ReadShort(Sys3+Ability[Shield]) --Currently-equipped shield's 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
--Show all items in shops (ASSEMBLY edit)
if not OnPC then
WriteInt(0x264250,0)
else
WriteByte(0x2F9306 - 0x56454E,0)
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