-
Notifications
You must be signed in to change notification settings - Fork 26
/
1fmInstantGummi.lua
52 lines (44 loc) · 1.39 KB
/
1fmInstantGummi.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
LUAGUI_NAME = "1fmInstantGummi"
LUAGUI_AUTH = "denhonator (edited by deathofall84)"
LUAGUI_DESC = "Instantly arrive at gummi destination"
function _OnInit()
if GAME_ID == 0xAF71841E and ENGINE_TYPE == "BACKEND" then
require("VersionCheck")
else
ConsolePrint("KH1 not detected, not running script")
end
end
function _OnFrame()
if canExecute then
local selection = ReadInt(gummiSelect)
local curDest = ReadInt(dest)
if curDest >= 40 then
WriteInt(gummiStart, selection)
else
deepJungleState = ReadByte(cutsceneFlagBase) < 16
neverlandState = ReadByte(cutsceneFlagBase + 8) < 20
WriteByte(worldWarpBase, deepJungleState and 0 or 14)
WriteByte(worldWarpBase + 2, deepJungleState and 0 or 45)
WriteByte(worldWarpBase2, neverlandState and 6 or 7)
WriteByte(worldWarpBase2 + 2, neverlandState and 24 or 37)
-- Replace HT and Atlantica with Monstro at first
if ReadByte(monstro) < 2 and (selection == 10 or selection == 9) then
selection = selection == 9 and 18 or 17
end
-- Change warp to Hollow Bastion
if selection == 25 then
selection = 15
WriteInt(gummiSelect, selection)
end
-- Change warp to Agrabah
if selection == 21 then
selection = 8
WriteInt(gummiSelect, selection)
end
selection = selection > 20 and 0 or selection
WriteInt(dest, selection)
WriteInt(gummiStart, selection)
WriteInt(normalDrive, 0)
end
end
end