-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLiveSplit.WarcraftIII.asl
74 lines (66 loc) · 1.71 KB
/
LiveSplit.WarcraftIII.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
state("Warcraft III")
{
uint igt : "Warcraft III.exe", 0xD78A5C;
byte status : "Warcraft III.exe", 0xD61B18, 0x400;
string8 victorySplash : "Warcraft III.exe", 0x648D24, 0x174, 0x54, 0x0;
// string7 starter1 : "Game.dll", 0xCB1C94, 0x200, 0x1E8, 0x0;
// byte starter2 : "Game.dll", 0xD321AB;
string24 map : "Warcraft III.exe", 0xD3F89E;
}
startup
{
settings.Add("starttype", true, "On=Campaign mode; Off=Mission mode");
}
init
{
vars.atInterlude = false;
vars.prevPhase = null;
vars.currIGT = 0;
vars.totalIGT = 0;
vars.storedIGT = 0;
vars.reloadedTime = 0;
}
update
{
if (!current.map.Contains("Interlude") && !vars.atInterlude) {//Don't include interludes
vars.currIGT = current.igt;
} else {
vars.currIGT = 0;
vars.atInterlude = true;
}
if (vars.prevPhase == TimerPhase.NotRunning && timer.CurrentPhase == TimerPhase.Running && !vars.atInterlude) {//New game
vars.currIGT = 0;
vars.totalIGT = 0;
vars.storedIGT = 0;
vars.reloadedTime = 0;
}
if (current.igt == 0 && old.igt > 0 && !vars.atInterlude) {//Beat mission
vars.storedIGT += vars.reloadedTime + old.igt;
vars.reloadedTime = 0;
}
if (current.igt > 500 && old.igt == 0 && !vars.atInterlude)//Reloaded
vars.reloadedTime -= current.igt;
vars.totalIGT = vars.storedIGT + vars.reloadedTime + vars.currIGT;
vars.prevPhase = timer.CurrentPhase;
if (current.igt > 0 && old.igt == 0 && !current.map.Contains("Interlude")) {
vars.atInterlude = false;
}
}
start
{
return (current.status == 4 && current.igt == 0);
}
split
{
return (
(current.victorySplash == "Overview" && old.victorySplash == "Victory!") && !current.map.Contains("Interlude")
);
}
isLoading
{
return true;
}
gameTime
{
return TimeSpan.FromMilliseconds(vars.totalIGT);
}