-
Notifications
You must be signed in to change notification settings - Fork 15
/
Questing Autoloader.xml
167 lines (154 loc) · 8.1 KB
/
Questing Autoloader.xml
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
<HBProfile xsi:noNamespaceSchemaLocation="../Questing Profile Pack/Schemas/EchoSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Original contribution by EchoTiger -->
<Name>Questing Autoloader ($ShortHash$)</Name>
<MinDurability>-1</MinDurability>
<MinFreeBagSlots>-1</MinFreeBagSlots>
<QuestOrder>
<!-- Check function status -->
<Code File="RunCode" Type="Definition">
<![CDATA[
private static bool? profileFunctionsEnabled => (bool?)AppDomain.CurrentDomain.GetData("QuestingProfiles_FunctionsEnabled");
private static bool IsStoreProfile(string path) => path.StartsWith("store://");
private static string Slashify(string path) => IsStoreProfile(path) ? path.Replace(@"\", "/") : path.Replace("/", @"\");
public __CompiledBatchClass__()
{
ActivateFunctions();
}
private static void ActivateFunctions()
{
if (profileFunctionsEnabled == null || profileFunctionsEnabled == false)
{
Bots.Professionbuddy.PBLog.Log(Colors.MediumPurple, "[Profile Message!]: ", Colors.Yellow, "Please stand by as the functions are being activated!");
LoadProfile(@"Functions\Activate Functions.xml");
}
else
{
if (Styx.Helpers.CharacterSettings.Instance.IgnoreCheckpoints && Styx.Helpers.CharacterSettings.Instance.OverrideProfileSettings)
Bots.Professionbuddy.PBLog.Log(Colors.MediumPurple, "[Profile Message!]: ", Colors.Yellow, "Ignore checkpoints is active! The autoloader will load by checking achievement progress.");
else
Bots.Professionbuddy.PBLog.Log(Colors.MediumPurple, "[Profile Message!]: ", Colors.Yellow, "Ignore checkpoints is disabled! The autoloader will load by checking player level.");
}
}
private static void LoadProfile(string path)
{
var profile = GetNewPath(path);
if (!IsStoreProfile(profile) && !File.Exists(profile))
{
Bots.Professionbuddy.PBLog.Log(Colors.MediumPurple, "[Profile Message!]: ", Colors.Yellow, "Profile does not exist.\n" + profile);
return;
}
Bots.Professionbuddy.PBLog.Log(Colors.MediumPurple, "[Profile Message!]: ", Colors.Yellow, "Loading: " + profile);
ProfileManager.LoadNew(profile, false);
}
private static string GetNewPath(string path)
{
if (IsStoreProfile(path))
return Slashify(path);
var currentProfile = ProfileManager.XmlLocation;
if (IsStoreProfile(currentProfile))
return Slashify(currentProfile + "/../" + path);
var absolutePath = Path.Combine(Path.GetDirectoryName(currentProfile), path);
absolutePath = Path.GetFullPath(absolutePath);
var canonicalPath = new Uri(absolutePath).LocalPath;
return Slashify(canonicalPath);
}]]>
</Code>
<Code File="RunCode" Code="ActivateFunctions();" />
<!-- END Check function status -->
<Code File="RunCode" Type="Definition"><![CDATA[
bool LoremasterCheckpointCheck(float levelToCheck, int achievementId = 0, int achievementIndex = 0)
{
if (Me.LevelFraction < levelToCheck) return true;
if (achievementId == 0) return false;
return (Styx.Helpers.CharacterSettings.Instance.IgnoreCheckpoints && !IsAchievementCompleted(achievementId, achievementIndex));
}
]]>
</Code>
<If Condition="Me.IsAlliance" >
<If Condition="Me.Class == WoWClass.DeathKnight && Me.Level < 90 && !IsQuestCompleted(13188)" >
<Code File="LoadProfile" ProfileName="Alliance\Starters\Death Knight.xml" />
</If>
<If Condition="Me.Race == WoWRace.Worgen && Me.Level < 90 && Me.Class != WoWClass.DeathKnight && !IsQuestCompleted(26706)" >
<Code File="LoadProfile" ProfileName="Alliance\Starters\Worgen.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(58, 1676)" >
<Code File="LoadProfile" ProfileName="Alliance\1-58 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(68, 1262)" >
<Code File="LoadProfile" ProfileName="Alliance\58-68 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(80, 41)" >
<Code File="LoadProfile" ProfileName="Alliance\68-80 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(85, 4875)" >
<Code File="LoadProfile" ProfileName="Alliance\80-85 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(90, 6541)" >
<Code File="LoadProfile" ProfileName="Alliance\85-90 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(100, 9833)" >
<Code File="LoadProfile" ProfileName="Alliance\90-100 Autoloader.xml" />
</If>
<If Condition="Lua.GetReturnVal<uint>("return GetAccountExpansionLevel();", 0) >= 6" >
<Code File="LoadProfile" ProfileName="Alliance\100-110 Autoloader.xml" />
</If>
</If>
<If Condition="Me.IsHorde" >
<If Condition="Me.Class == WoWClass.DeathKnight && Me.Level < 90 && !IsQuestCompleted(13189)" >
<Code File="LoadProfile" ProfileName="Horde\Starters\Death Knight.xml" />
</If>
<If Condition="Me.Race == WoWRace.Goblin && Me.Level < 90 && Me.Class != WoWClass.DeathKnight && !IsQuestCompleted(25267)" >
<Code File="LoadProfile" ProfileName="Horde\Starters\Goblin.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(41, 1678)" >
<Code File="LoadProfile" ProfileName="Horde\1-41 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(58, 1678)" >
<Code File="LoadProfile" ProfileName="Horde\41-58 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(68, 1262)" >
<Code File="LoadProfile" ProfileName="Horde\58-68 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(80, 41)" >
<Code File="LoadProfile" ProfileName="Horde\68-80 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(85, 4875)" >
<Code File="LoadProfile" ProfileName="Horde\80-85 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(90, 6541)" >
<Code File="LoadProfile" ProfileName="Horde\85-90 Autoloader.xml" />
</If>
<If Condition="LoremasterCheckpointCheck(100, 9923) || Lua.GetReturnVal<uint>("return GetAccountExpansionLevel();", 0) < 6" >
<Code File="LoadProfile" ProfileName="Horde\90-100 Autoloader.xml" />
</If>
<If Condition="Lua.GetReturnVal<uint>("return GetAccountExpansionLevel();", 0) >= 6" >
<Code File="LoadProfile" ProfileName="Horde\100-110 Autoloader.xml" />
</If>
</If>
<If Condition="Me.IsNeutralPandaren" >
<Code File="RunCode" Type="Definition" Code="bool LoadAlliance = false; bool LoadHorde = false;" />
<Code File="RunCode" >
<![CDATA[
System.Windows.Forms.DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("It looks like you're loading this as a Pandaren!\n\nPush Yes to load Alliance profiles.\nPush No to load Horde profiles.", "Choose Your Destiny!", System.Windows.Forms.MessageBoxButtons.YesNo);
if(dialogResult == System.Windows.Forms.DialogResult.Yes)
LoadAlliance = true;
else if (dialogResult == System.Windows.Forms.DialogResult.No)
LoadHorde = true;
]]>
</Code>
<Code File="WaitTimer" WaitTime="5000" TerminateWhen="LoadAlliance || LoadHorde" />
<If Condition="LoadAlliance" >
<Code File="RunCode" Code="Logging.Write(System.Windows.Media.Colors.Yellow, "[Notification]: We will finish the Pandaren starting zone as Alliance!");" />
<Code File="RunCode" Code="Logging.Write(System.Windows.Media.Colors.Yellow, "[Notification]: If you want to change the faction, you must RELOAD the autoloader!");" />
<Code File="WaitTimer" WaitTime="5000" />
<Code File="LoadProfile" ProfileName="Alliance\Starters\Pandaren.xml" />
</If>
<If Condition="LoadHorde" >
<Code File="RunCode" Code="Logging.Write(System.Windows.Media.Colors.Yellow, "[Notification]: We will finish the Pandaren starting zone as Horde!");" />
<Code File="RunCode" Code="Logging.Write(System.Windows.Media.Colors.Yellow, "[Notification]: If you want to change the faction, you must RELOAD the autoloader!");" />
<Code File="WaitTimer" WaitTime="5000" />
<Code File="LoadProfile" ProfileName="Horde\Starters\Pandaren.xml" />
</If>
</If>
</QuestOrder>
</HBProfile>