-
Notifications
You must be signed in to change notification settings - Fork 1
/
gedonia.asl
160 lines (138 loc) · 3.9 KB
/
gedonia.asl
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
state("Gedonia")
{}
startup
{
Assembly.Load(File.ReadAllBytes("Components/asl-help")).CreateInstance("Unity");
// Scene manager to get a scene name
vars.Helper.LoadSceneManager = true;
// Max level for current patch
vars.maxLvl = 80;
// Levels settings
settings.Add("Levels", false, "Levels");
for (int i = 2; i <= vars.maxLvl; i++)
{
settings.Add(i.ToString() + "lvl", false, i.ToString(), "Levels");
}
// Data for Mounts settings
// Item1 - index in array
// Item2 - mount name
vars.mountsData = new Tuple<int, string>[]
{
Tuple.Create(1, "Royal Knight's Horse"),
Tuple.Create(2, "Battle Boar"),
Tuple.Create(3, "Enchanted mystical deer"),
Tuple.Create(4, "Zebuar"),
Tuple.Create(5, "Armalak"),
Tuple.Create(6, "Innoroth"),
Tuple.Create(7, "Az'gor")
};
// Mounts settings
settings.Add("Mounts", false, "Mounts");
foreach (var md in vars.mountsData)
{
settings.Add(md.Item1.ToString() + "mnt", false, md.Item2, "Mounts");
}
// Story settings
settings.Add("Story", false, "Story");
settings.Add("DarkGod", false, "Defeated Dark god", "Story");
settings.Add("LightGod", false, "Defeated God of light", "Story");
settings.Add("End", false, "Ending - Return to your village", "Story");
vars.completedSplits = new HashSet<string>();
}
init
{
vars.Helper.TryLoad = (Func<dynamic, bool>)(mono =>
{
// level
// Сhanges to 1 (few seconds) on loading screen
vars.Helper["level"] = mono.Make<int>("PlayerScript", "instance", "level");
// mounts
// [0] - Spirit (true by default)
// [1] - Royal Knight's Horse
// [2] - Battle Boar
// [3] - Enchanted mystical deer
// [4] - Zebuar
// [5] - Armalak
// [6] - Innoroth
// [7] - Az'gor
vars.Helper["mounts"] = mono.MakeArray<bool>("GameManager", "instance", "availableMounts");
// mainStory
// -1 - On cutscenes
// 34 - Defeated Dark god
// 36 - Defeated God of light (change after cutscene)
vars.Helper["mainStory"] = mono.Make<int>("GameManager", "instance", "mainStoryProgress");
// loading
// after a few seconds of loading, the value changes to false, a listPanels is used to fix it
// true - loading
// false - game
vars.Helper["loading"] = mono.Make<bool>("InterfaceManager", "instance", "panels", 0x70, 0x10, 0x57);
// listPanels
// contains a list of open panels
// 0 - loading (few seconds)
vars.Helper["listPanels"] = mono.MakeArray<bool>("UIPanel", "list");
return true;
});
}
update
{
current.Scene = vars.Helper.Scenes.Active.Name ?? old.Scene;
}
start
{
return old.Scene == "StartCutscene" && current.Scene == "Game";
}
onStart
{
vars.completedSplits.Clear();
}
split
{
for (int i = 2; i <= vars.maxLvl; i++)
{
if (settings[i.ToString() + "lvl"] == true
&& current.level == i
&& old.level != current.level
&& current.loading == false
&& current.listPanels.Length != 0
&& vars.completedSplits.Add(i.ToString() + "lvl"))
{
return true;
}
}
if (settings["DarkGod"] == true
&& current.mainStory == 34
&& old.mainStory != current.mainStory
&& vars.completedSplits.Add("DarkGod"))
{
return true;
}
if (settings["LightGod"] == true
&& current.mainStory == 36
&& old.mainStory == 35
&& vars.completedSplits.Add("LightGod"))
{
return true;
}
if (settings["End"] == true
&& current.mainStory == -1
&& old.mainStory == 36
&& vars.completedSplits.Add("End"))
{
return true;
}
for (int i = 1; i <= vars.mountsData.Length; i++)
{
if (settings[i.ToString() + "mnt"] == true
&& vars.mountsData[i-1].Item1 == i
&& current.mounts[i] == true
&& old.mounts[i] == false
&& vars.completedSplits.Add(i.ToString() + "mnt"))
{
return true;
}
}
}
isLoading
{
return current.loading == true || current.listPanels.Length == 0;
}