-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFinal Fantasy VI Advance.lua
More file actions
608 lines (567 loc) · 16.3 KB
/
Final Fantasy VI Advance.lua
File metadata and controls
608 lines (567 loc) · 16.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
dofile("KLib/KLib.lua")
Address =
{
Character =
{
Base = 0x001600,
Size = 0x25,
Max = 16,
Offset =
{
ID = 0x00,
Sprite = 0x01,
Name = 0x02,
Level = 0x08,
CurrentHP = 0x09,
MaxHP = 0x0B,
CurrentMP = 0x0D,
MaxMP = 0x0F,
Experience = 0x11,
Status = 0x14,
Commands = 0x16,
Strength = 0x1A,
Speed = 0x1B,
Stamina = 0x1C,
Magic = 0x1D,
Esper = 0x1E,
RightHand = 0x1F,
LeftHand = 0x20,
Head = 0x21,
Body = 0x22,
Relic1 = 0x23,
Relic2 = 0x24
}
},
Items =
{
Gil = 0x001860,
Base = 0x039010,
Quantity = 0x039130,
Key = 0x001EBA,
Magicite = 0x039000
},
Abilities =
{
Bushido = 0x001CF7,
Blitz = 0x001D28,
Lore = 0x001D29,
Rage = 0x001D2C,
Dance = 0x001D4C
},
WorldFlags = 0x0011DF,
Bestiary = 0x239800,
Steps = 0x001866,
Time = 0x00021B,
MenuIndex = 0x020C34
}
Characters =
{
[0x00] = "Terra",
[0x01] = "Locke",
[0x02] = "Cyan",
[0x03] = "Shadow",
[0x04] = "Edgar",
[0x05] = "Sabin",
[0x06] = "Celes",
[0x07] = "Strago",
[0x08] = "Relm",
[0x09] = "Setzer",
[0x0A] = "Mog",
[0x0B] = "Gau",
[0x0C] = "Gogo",
[0x0D] = "Umaro",
[0x0E] = "Guest 1",
[0x0F] = "Guest 2",
[0x20] = "Wedge",
[0x21] = "Biggs"
}
Items =
{
[0x00] = "Dagger",
[0x01] = "Mythril Knife",
[0x02] = "Main Gauche",
[0x03] = "Air Knife",
[0x04] = "Thief's Knife",
[0x05] = "Assassin's Dagger",
[0x06] = "Man-Eater",
[0x07] = "Swordbreaker",
[0x08] = "Gladius",
[0x09] = "Valiant Knife",
[0x0A] = "Mythril Sword",
[0x0B] = "Great Sword",
[0x0C] = "Rune Blade",
[0x0D] = "Flametongue",
[0x0E] = "Icebrand",
[0x0F] = "Thunder Blade",
[0x10] = "Bastard Sword",
[0x11] = "Stoneblade",
[0x12] = "Blood Sword",
[0x13] = "Enhancer",
[0x14] = "Crystal Sword",
[0x15] = "Falchion",
[0x16] = "Soul Sabre",
[0x17] = "Organyx",
[0x18] = "Excalibur",
[0x19] = "Zantetsuken",
[0x1A] = "Lightbringer",
[0x1B] = "Ragnarok",
[0x1C] = "Ultima Weapon",
[0x1D] = "Mythril Spear",
[0x1E] = "Trident",
[0x1F] = "Heavy Lance",
[0x20] = "Partisan",
[0x21] = "Holy Lance",
[0x22] = "Golden Spear",
[0x23] = "Radiant Lance",
[0x24] = "Impartisan",
[0x25] = "Kunai",
[0x26] = "Kodachi",
[0x27] = "Sakura",
[0x28] = "Sasuke",
[0x29] = "Ichigeki",
[0x2A] = "Kagenui",
[0x2B] = "Ashura",
[0x2C] = "Kotetsu",
[0x2D] = "Kiku-ichimonji",
[0x2E] = "Kazekiri",
[0x2F] = "Murasame",
[0x30] = "Masamune",
[0x31] = "Murakumo",
[0x32] = "Nutsunokami",
[0x33] = "Healing Rod",
[0x34] = "Mythril Rod",
[0x35] = "Flame Rod",
[0x36] = "Ice Rod",
[0x37] = "Thunder Rod",
[0x38] = "Poison Rod",
[0x39] = "Holy Rod",
[0x3A] = "Gravity Rod",
[0x3B] = "Punisher",
[0x3C] = "Magus Rod",
[0x3D] = "Chocobo Brush",
[0x3E] = "Da Vinci Brush",
[0x3F] = "Magical Brush",
[0x40] = "Rainbow Brush",
[0x41] = "Shuriken",
[0x42] = "Fuma Shuriken",
[0x43] = "Pinwheel",
[0x44] = "Chain Flail",
[0x45] = "Moonring Blade",
[0x46] = "Morning Star",
[0x47] = "Boomerang",
[0x48] = "Rising Sun",
[0x49] = "Hawkeye",
[0x4A] = "Bone Club",
[0x4B] = "Sniper",
[0x4C] = "Wing Edge",
[0x4D] = "Cards",
[0x4E] = "Darts",
[0x4F] = "Death Tarot",
[0x50] = "Viper Darts",
[0x51] = "Dice",
[0x52] = "Fixed Dice",
[0x53] = "Metal Knuckles",
[0x54] = "Mythril Claws",
[0x55] = "Kaiser Knuckles",
[0x56] = "Venom Claws",
[0x57] = "Burning Fist",
[0x58] = "Dragon Claws",
[0x59] = "Tigerfang",
[0x5A] = "Buckler",
[0x5B] = "Heavy Shield",
[0x5C] = "Mythril Shield",
[0x5D] = "Golden Shield",
[0x5E] = "Aegis Shield",
[0x5F] = "Diamond Shield",
[0x60] = "Flame Shield",
[0x61] = "Ice Shield",
[0x62] = "Thunder Shield",
[0x63] = "Crystal Shield",
[0x64] = "Genji Shield",
[0x65] = "Tortoise Shield",
[0x66] = "Cursed Shield",
[0x67] = "Paladin's Shield",
[0x68] = "Force Shield",
[0x69] = "Leather Cap",
[0x6A] = "Hairband",
[0x6B] = "Plumed Hat",
[0x6C] = "Beret",
[0x6D] = "Magus Hat",
[0x6E] = "Bandana",
[0x6F] = "Iron Helm",
[0x70] = "Hypno Crown",
[0x71] = "Priest's Miter",
[0x72] = "Green Beret",
[0x73] = "Twist Headband",
[0x74] = "Mythril Helm",
[0x75] = "Tiara",
[0x76] = "Golden Helm",
[0x77] = "Tiger Mask",
[0x78] = "Red Cap",
[0x79] = "Mystery Veil",
[0x7A] = "Circlet",
[0x7B] = "Royal Crown",
[0x7C] = "Diamond Helm",
[0x7D] = "Black Cowl",
[0x7E] = "Crystal Helm",
[0x7F] = "Oath Veil",
[0x80] = "Cat-Ear Hood",
[0x81] = "Genji Helm",
[0x82] = "Thornlet",
[0x83] = "Saucer",
[0x84] = "Leather Armor",
[0x85] = "Cotton Robe",
[0x86] = "Kenpo Gi",
[0x87] = "Iron Armor",
[0x88] = "Silk Robe",
[0x89] = "Mythril Vest",
[0x8A] = "Ninja Gear",
[0x8B] = "White Dress",
[0x8C] = "Mythril Mail",
[0x8D] = "Gaia Gear",
[0x8E] = "Mirage Vest",
[0x8F] = "Golden Armor",
[0x90] = "Power Sash",
[0x91] = "Luminous Robe",
[0x92] = "Diamond Vest",
[0x93] = "Red Jacket",
[0x94] = "Force Armor",
[0x95] = "Diamond Armor",
[0x96] = "Black Garb",
[0x97] = "Magus Robe",
[0x98] = "Crystal Mail",
[0x99] = "Regal Gown",
[0x9A] = "Genji Armor",
[0x9B] = "Reed Cloak",
[0x9C] = "Minerva Bustier",
[0x9D] = "Tabby Suit",
[0x9E] = "Chocobo Suit",
[0x9F] = "Moogle Suit",
[0xA0] = "Nutkin Suit",
[0xA1] = "Behemoth Suit",
[0xA2] = "Snow Scarf",
[0xA3] = "Noiseblaster",
[0xA4] = "Bioblaster",
[0xA5] = "Flash",
[0xA6] = "Chainsaw",
[0xA7] = "Debilitator",
[0xA8] = "Drill",
[0xA9] = "Air Anchor",
[0xAA] = "Auto Crossbow",
[0xAB] = "Flame Scroll",
[0xAC] = "Water Scroll",
[0xAD] = "Lightning Scroll",
[0xAE] = "Invisibility Scroll",
[0xAF] = "Shadow Scroll",
[0xB0] = "Silver Spectacles",
[0xB1] = "Star Pendant",
[0xB2] = "Peace Ring",
[0xB3] = "Amulet",
[0xB4] = "White Cape",
[0xB5] = "Jeweled Ring",
[0xB6] = "Fairy Ring",
[0xB7] = "Barrier Ring",
[0xB8] = "Mythril Glove",
[0xB9] = "Protect Ring",
[0xBA] = "Hermes Sandals",
[0xBB] = "Reflect Ring",
[0xBC] = "Angel Wings",
[0xBD] = "Angel Ring",
[0xBE] = "Knight's Code",
[0xBF] = "Dragoon Boots",
[0xC0] = "Zephyr Cloak",
[0xC1] = "Princess Ring",
[0xC2] = "Cursed Ring",
[0xC3] = "Earring",
[0xC4] = "Gigas Glove",
[0xC5] = "Blizzard Orb",
[0xC6] = "Berserker Ring",
[0xC7] = "Thief's Bracer",
[0xC8] = "Guard Bracelet",
[0xC9] = "Hero's Ring",
[0xCA] = "Ribbon",
[0xCB] = "Muscle Belt",
[0xCC] = "Crystal Orb",
[0xCD] = "Gold Hairpin",
[0xCE] = "Celestriad",
[0xCF] = "Brigand's Glove",
[0xD0] = "Gauntlet",
[0xD1] = "Genji Glove",
[0xD2] = "Hyper Wrist",
[0xD3] = "Master's Scroll",
[0xD4] = "Prayer Beads",
[0xD5] = "Black Belt",
[0xD6] = "Heiji's Jitte",
[0xD7] = "Fake Mustache",
[0xD8] = "Soul of Thamasa",
[0xD9] = "Dragon Horn",
[0xDA] = "Merit Award",
[0xDB] = "Memento Ring",
[0xDC] = "Safety Bit",
[0xDD] = "Lich Ring",
[0xDE] = "Molulu's Charm",
[0xDF] = "Ward Bangle",
[0xE0] = "Miracle Shoes",
[0xE1] = "Alarm Earring",
[0xE2] = "Gale Hairpin",
[0xE3] = "Sniper Eye",
[0xE4] = "Growth Egg",
[0xE5] = "Tintinnabulum",
[0xE6] = "Sprint Shoes",
[0xE7] = "Rename Card",
[0xE8] = "Potion",
[0xE9] = "Hi-Potion",
[0xEA] = "X-Potion",
[0xEB] = "Ether",
[0xEC] = "High Ether",
[0xED] = "X-Ether",
[0xEE] = "Elixer",
[0xEF] = "Megalixer",
[0xF0] = "Phoenix Down",
[0xF1] = "Holy Water",
[0xF2] = "Antidote",
[0xF3] = "Eye Drops",
[0xF4] = "Gold Needle",
[0xF5] = "Remedy",
[0xF6] = "Sleeping Bag",
[0xF7] = "Tent",
[0xF8] = "Green Cherry",
[0xF9] = "Magicite Shard",
[0xFA] = "Super Ball",
[0xFB] = "Echo Screen",
[0xFC] = "Smoke Bomb",
[0xFD] = "Teleport Stone",
[0xFE] = "Dried Meat",
[0xFF] = "Nothing"
}
KeyItems =
{
"Cider",
"Old Clock Key",
"Fish",
"Fish",
"Fish",
"Fish",
"Lump of Metal",
"Lola's Letter",
"Coral",
"Books",
"Emperor's Letter",
"Rust-Rid",
"Autograph",
"Manicure",
"Opera Record",
"Magnifying Glass",
"Rare Stone",
"Odd Picture",
"Ordinary Picture",
"Pendant",
"Stone Tablet",
"Master's Crown"
}
Magicite =
{
"Ramuh",
"Ifrit",
"Shiva",
"Siren",
"Midgardsormr",
"Catoblepas",
"Maduin",
"Bismarck",
"Cait Sith",
"Quetzalli",
"Valigarmanda",
"Odin",
"Raiden",
"Bahamut",
"Alexander",
"Crusader",
"Ragnarok",
"Kirin",
"Zona Seeker",
"Carbuncle",
"Phantom",
"Seraph",
"Golem",
"Unicorn",
"Fenrir",
"Lakshmi",
"Phoenix",
"Leviathan",
"Cactuar",
"Diabolos",
"Gilgamesh"
}
Espers =
{
[0x00] = "Ramuh",
[0x01] = "Ifrit",
[0x02] = "Shiva",
[0x03] = "Siren",
[0x04] = "Midgardsormr",
[0x05] = "Catoblepas",
[0x06] = "Maduin",
[0x07] = "Bismarck",
[0x08] = "Cait Sith",
[0x09] = "Quetzalli",
[0x0A] = "Valigarmanda",
[0x0B] = "Odin",
[0x0C] = "Raiden",
[0x0D] = "Bahamut",
[0x0E] = "Alexander",
[0x0F] = "Crusader",
[0x10] = "Ragnarok",
[0x11] = "Kirin",
[0x12] = "Zona Seeker",
[0x13] = "Carbuncle",
[0x14] = "Phantom",
[0x15] = "Seraph",
[0x16] = "Golem",
[0x17] = "Unicorn",
[0x18] = "Fenrir",
[0x19] = "Lakshmi",
[0x1A] = "Phoenix",
[0x1B] = "Leviathan",
[0x1C] = "Cactuar",
[0x1D] = "Diabolos",
[0x1E] = "Gilgamesh"
}
Commands =
{
[0x00] = "Attack",
[0x01] = "Items",
[0x02] = "Magic",
[0x03] = "Trance",
[0x04] = "Revert",
[0x05] = "Steal",
[0x06] = "Mug",
[0x07] = "Bushido",
[0x08] = "Throw",
[0x09] = "Tools",
[0x0A] = "Blitz",
[0x0B] = "Runic",
[0x0C] = "Lore",
[0x0D] = "Sketch",
[0x0E] = "Control",
[0x0F] = "Slots",
[0x10] = "Rage",
[0x11] = "(No Command)",
[0x12] = "Mimic",
[0x13] = "Dance",
[0x14] = "Row",
[0x15] = "Defend",
[0x16] = "Jump",
[0x17] = "Dualcast",
[0x18] = "Gil Toss",
[0x19] = "Summon",
[0x1A] = "Pray",
[0x1B] = "Shock",
[0x1C] = "Possess",
[0x1D] = "Magitek"
}
WorldFlags =
{
"Unknown",
"Sprint Shoes",
"Unknown",
"Unknown",
"Unknown",
"Unknown",
"Moogle Charm",
"Unknown"
}
MaxItems = 288
memory.usememorydomain("Combined WRAM")
function CreateMenu()
KLib.Menu.Color(KLib.Color.White, KLib.Color.Make(32, 32, 128, 192))
KLib.Menu.Page("Final Fantasy VI Advance\r")
KLib.Menu.SubPage("Characters", CreateCharacterPage)
KLib.Menu.SubPage("Items", CreateItemsPage)
KLib.Menu.SubPage("Abilities", CreateAbilitiesPage)
KLib.Menu.SubPage("World", CreateWorldPage)
KLib.Menu.Separator()
KLib.Menu.SubPage("Misc/Debug", CreateMiscPage)
end
function CreateCharacterPage()
local barOffset = 112
local barWidth = 120
KLib.Menu.Offset(nil, Address.Character.Max, Address.Character.Size)
KLib.Menu.Text("Basic", KLib.Color.Green, true)
KLib.Menu.Enum("ID", Address.Character.Base + Address.Character.Offset.ID, "byte", Characters)
KLib.Menu.Field("Level", Address.Character.Base + Address.Character.Offset.Level, "byte", 1, 99, barOffset, barWidth, KLib.Color.White)
KLib.Menu.Field("Current HP", Address.Character.Base + Address.Character.Offset.CurrentHP, "u16_le", 0, 9999, barOffset, barWidth, KLib.Color.Green)
KLib.Menu.Field("Max HP", Address.Character.Base + Address.Character.Offset.MaxHP, "u16_le", 0, 9999, barOffset, barWidth, KLib.Color.Green)
KLib.Menu.Field("Current MP", Address.Character.Base + Address.Character.Offset.CurrentMP, "u16_le", 0, 999, barOffset, barWidth, KLib.Color.Cyan)
KLib.Menu.Field("Max MP", Address.Character.Base + Address.Character.Offset.MaxMP, "u16_le", 0, 999, barOffset, barWidth, KLib.Color.Cyan)
KLib.Menu.Field("Experience", Address.Character.Base + Address.Character.Offset.Experience, "u24_le", 0, 9999999)
KLib.Menu.Bitfield("Status", Address.Character.Base + Address.Character.Offset.Status, "u16_le", {})
KLib.Menu.Separator()
KLib.Menu.Text("Commands", KLib.Color.Orange, true)
for i = 1, 4 do
KLib.Menu.Enum("Command " .. i, Address.Character.Base + Address.Character.Offset.Commands + (i - 1), "byte", Commands)
end
KLib.Menu.Separator()
KLib.Menu.Text("Stats", KLib.Color.Green, true)
KLib.Menu.Field("Strength", Address.Character.Base + Address.Character.Offset.Strength, "byte", 0, 255, barOffset, barWidth, KLib.Color.Orange)
KLib.Menu.Field("Speed", Address.Character.Base + Address.Character.Offset.Speed, "byte", 0, 255, barOffset, barWidth, KLib.Color.Yellow)
KLib.Menu.Field("Stamina", Address.Character.Base + Address.Character.Offset.Stamina, "byte", 0, 255, barOffset, barWidth, KLib.Color.Green)
KLib.Menu.Field("Magic", Address.Character.Base + Address.Character.Offset.Magic, "byte", 0, 255, barOffset, barWidth, KLib.Color.Cyan)
KLib.Menu.Separator()
KLib.Menu.Text("Equipment", KLib.Color.Cyan, true)
KLib.Menu.Enum("Esper", Address.Character.Base + Address.Character.Offset.Esper, "byte", Espers)
KLib.Menu.Enum("Right Hand", Address.Character.Base + Address.Character.Offset.RightHand, "byte", Items)
KLib.Menu.Enum("Left Hand", Address.Character.Base + Address.Character.Offset.LeftHand, "byte", Items)
KLib.Menu.Enum("Head", Address.Character.Base + Address.Character.Offset.Head, "byte", Items)
KLib.Menu.Enum("Body", Address.Character.Base + Address.Character.Offset.Body, "byte", Items)
KLib.Menu.Enum("Relic 1", Address.Character.Base + Address.Character.Offset.Relic1, "byte", Items)
KLib.Menu.Enum("Relic 2", Address.Character.Base + Address.Character.Offset.Relic2, "byte", Items)
end
function CreateItemsPage()
KLib.Menu.Field("Gil", Address.Items.Gil, "u24_le", 0, 9999999)
KLib.Menu.Separator()
KLib.Menu.SubPage("Items", function()
KLib.Menu.EnumGroup(MaxItems, "Item", Address.Items.Base, "byte", Items)
end)
KLib.Menu.SubPage("Quantities", function()
KLib.Menu.FieldGroup(MaxItems, "Quantity", Address.Items.Quantity, "byte")
end)
KLib.Menu.Separator()
KLib.Menu.Bitfield("Key Items", Address.Items.Key, "u32_le", KeyItems)
KLib.Menu.Separator()
KLib.Menu.Bitfield("Magicite", Address.Items.Magicite, "u32_le", Magicite)
end
function CreateMiscPage()
KLib.Menu.Text("Misc", KLib.Color.Blue, true)
KLib.Menu.Field("Steps", Address.Steps, "u16_le", 0, 9999999)
KLib.Menu.Separator()
KLib.Menu.Text("Time", KLib.Color.Blue, true)
KLib.Menu.Field("Time (Hours)", Address.Time, "byte", 0, 99)
KLib.Menu.Field("Time (Minutes)", Address.Time + 1, "byte", 0, 59)
KLib.Menu.Field("Time (Seconds)", Address.Time + 2, "byte", 0, 59)
KLib.Menu.Field("Time (Centiseconds)", Address.Time + 3, "byte", 0, 59)
KLib.Menu.Separator()
KLib.Menu.Text("Debug", KLib.Color.Blue, true)
KLib.Menu.Field("Main Menu Index", Address.MenuIndex, "byte")
end
function CreateAbilitiesPage()
KLib.Menu.Bitfield("Bushido", Address.Abilities.Bushido, "byte", {})
KLib.Menu.Bitfield("Blitz", Address.Abilities.Blitz, "byte", {})
KLib.Menu.Bitfield("Lore", Address.Abilities.Lore, "byte", {})
KLib.Menu.Bitfield("Rage", Address.Abilities.Rage, "byte", {})
KLib.Menu.Bitfield("Dance", Address.Abilities.Dance, "byte", {})
end
function CreateWorldPage()
KLib.Menu.Bitfield("Flags", Address.WorldFlags, "byte", WorldFlags)
end
function Mods()
-- Save Anywhere
KLib.Memory.WriteByte(0x001EB7, 0x86)
end
CreateMenu()
while true do
KLib.Update()
Mods()
emu.frameadvance()
KLib.PostUpdate()
end