-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathQuestFunctions.lua
325 lines (325 loc) · 15.2 KB
/
QuestFunctions.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
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
AAPClassic.QF = {}
if (tonumber(string.sub(AAPClassic.Build, 1,1)) > 2) then
--return
end
function AAPClassic.QF.GroupQuestFrame()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["QaskPopup"]
local gnr = Step["Group"]
if (IdList and AAPClassic["questsNames"][IdList]) then
if (AAPClassic["quests"][IdList] and AAPClassic["quests"][IdList]["lvl"]) then
AAPClassic.GroupQuestFrameFS1:SetText("["..AAPClassic["quests"][IdList]["lvl"].."] "..AAPClassic["questsNames"][IdList]["T"])
else
AAPClassic.GroupQuestFrameFS1:SetText(AAPClassic["questsNames"][IdList])
end
AAPClassic.GroupQuestFrameFS2:SetText("Suggested Players: "..gnr)
end
AAPClassic.GroupQuestFrame:Show()
end
function AAPClassic.QF.PickUp()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["PickUp"]
--print("PickUp!")
local NrLeft = 0
local Flagged = 0
local Total = 0
for h=1, getn(IdList) do
local theqid = IdList[h]
Total = Total + 1
if (not AAPClassic.QuestList[theqid] and IsQuestFlaggedCompleted(theqid) == false) then
NrLeft = NrLeft + 1
end
if (IsQuestFlaggedCompleted(theqid) or AAPClassic.QuestList[theqid] or (AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"][theqid])) then
Flagged = Flagged + 1
end
end
if (Step["PickUp2"] and (AAPClassic.QuestList[Step["PickUp2"]] or IsQuestFlaggedCompleted(Step["PickUp2"]))) then
Total = Flagged
end
if (Total == Flagged) then
--print("PickUp Done!")
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Step["GroupTask"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
else
AAPClassic.QH.BookingList.SetQPTT = 1
--print("PickUp: "..Flagged.."/"..Total)
end
if (Step and Step["Button"]) then
AAPClassic.QH.BookingList.ShowButton = Step["Button"]
end
if (Step["PickUpClass"]) then
local Class = AAPClassic.Class[3]
if (Step["PickUpClass"][Class] and Step["PickUpClass"][Class][AAPClassic.Race]) then
local Questids = Step["PickUpClass"][Class][AAPClassic.Race]["Qid"]
if (IsQuestFlaggedCompleted(Questids) or AAPClassic.QuestList[Questids]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
end
end
end
function AAPClassic.QF.Qpart()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["Qpart"]
local Flagged = 0
local Total = 0
local Missing = 0
if (Step and Step["Button"]) then
AAPClassic.QH.BookingList.ShowButton = Step["Button"]
end
local AAP_index, AAP_value, AAP_index2, AAP_value2
for AAP_index,AAP_value in pairs(IdList) do
for AAP_index2,AAP_value2 in pairs(AAP_value) do
Total = Total + 1
if (IsQuestFlaggedCompleted(AAP_index) or (AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"][AAP_index])) then
Flagged = Flagged + 1
elseif (AAPClassic.QuestList[AAP_index] and AAPClassic.QuestList[AAP_index]["Objectives"] and AAPClassic.QuestList[AAP_index]["Objectives"][tonumber(AAP_index2)] and AAPClassic.QuestList[AAP_index]["Objectives"][tonumber(AAP_index2)]["isComplete"] == 1) then
Flagged = Flagged + 1
elseif (AAPClassic.QuestList[AAP_index] and AAPClassic.QuestList[AAP_index]["Objectives"] and AAPClassic.QuestList[AAP_index]["Objectives"][tonumber(AAP_index2)] and AAPClassic.QuestList[AAP_index]["Objectives"][tonumber(AAP_index2)]) then
elseif (not AAPClassic.QuestList[AAP_index]) then
Missing = 1
end
end
end
AAPClassic.Level = UnitLevel("player")
if (Step["Qpart2"] and (AAPClassic.QuestList[Step["Qpart2"]] or IsQuestFlaggedCompleted(Step["Qpart2"]))) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Step["AutoSkipLevel"] and AAPClassic.Level >= Step["AutoSkipLevel"]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Missing == 1) then
-- print("Qpart: Quest Missing!")
elseif (Total == Flagged) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Step["GroupTask"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
else
--print("Qpart "..Flagged.."/"..Total)
AAPClassic.QH.BookingList.SetQPTT = 1
end
end
function AAPClassic.QF.Done()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["Done"]
--print("Done!")
local Flagged = 0
local Total = 0
local Missing = 0
if (Step and Step["Button"]) then
AAPClassic.QH.BookingList.ShowButton = Step["Button"]
end
for h=1, getn(IdList) do
local theqid = IdList[h]
Total = Total + 1
if (not AAPClassic.QuestList[theqid] and IsQuestFlaggedCompleted(theqid) == false) then
Missing = 1
end
if (IsQuestFlaggedCompleted(theqid)) then
Flagged = Flagged + 1
elseif (AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Completed"][theqid]) then
Flagged = Flagged + 1
end
end
if (Step["Done2"] and (AAPClassic.QuestList[Step["Done2"]] or IsQuestFlaggedCompleted(Step["Done2"]))) then
Total = Flagged
Missing = 0
end
if (Missing == 1) then
--print("Done: Quest Missing")
elseif (Total == Flagged) then
--print("Done Done!")
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Step["GroupTask"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
if (Step["DoneClass"]) then
local Class = AAPClassic.Class[3]
if (Step["DoneClass"][Class] and Step["DoneClass"][Class][AAPClassic.Race]) then
local Questids = Step["DoneClass"][Class][AAPClassic.Race]["Qid"]
if (IsQuestFlaggedCompleted(Questids)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
end
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.SetHS()
--print("SetHS!")
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["SetHS"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.TrainAbilitys()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["TrainAbilitys"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.LearnCooking()
--print("Cooking!")
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["LearnCooking"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.Explore()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["Explore"]
if (AAPClassic.Explored[IdList]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.UseHS()
--print("UseHS!")
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["UseHS"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
else
AAPClassic.QH.BookingList.ShowButton = "HS"
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QAskPopWantedAsk(Answer)
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
if (Step["QaskPopup"]) then
if (Answer == "no") then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]] = 1
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
else
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]] = nil
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]] = 1
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
end
AAPClassic.GroupQuestFrame:Hide()
end
function AAPClassic.QF.Treasure()
--print("Treasure!")
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.Grind()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
AAPClassic.Level = UnitLevel("player")
AAPClassic.experience = UnitXP("player")
local IdList = Step["Grind"]
if ((AAPClassic.Level > Step["level"]) or (AAPClassic.Level == Step["level"] and AAPClassic.experience > Step["xp"])) then
AAPClassic.XpLine = 0
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (AAPClassic.XpLine ~= 0) then
AAPClassic.Level = UnitLevel("player")
AAPClassic.experience = UnitXP("player")
local xps = Step["xp"] - AAPClassic.experience
if (AAPClassic.Level == Step["level"]-1) then
xps = (UnitXPMax("player")-AAPClassic.experience)+Step["xp"]
end
AAPClassic.QL.QuestFrames["FS"..AAPClassic.XpLine]:SetText(xps.." exp to go!")
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.Cookingupdate()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["Cookingupdate"]
if (IdList and IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.CRange()
--print("CRange!")
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList
if (Step) then
IdList = Step["CRange"]
end
if (Step and Step["Button"]) then
AAPClassic.QH.BookingList.ShowButton = Step["Button"]
end
if (IdList and IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
elseif (Step and Step["GroupTask"] and AAPC1[AAPClassic.Realm][AAPClassic.Name]["Elite"][Step["GroupTask"]]) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.GetFP()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["GetFP"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.UseFP()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
local IdList = Step["UseFlightPath"]
if (IsQuestFlaggedCompleted(IdList)) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.DropQ()
--print("DropQ!")
AAPClassic.QH.BookingList.SetQPTT = 1
end
function AAPClassic.QF.ExtraQ()
local CurStep = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr]
local Step = AAPClassic.Path[AAPClassic.QH.ZoneNr][CurStep]
if (Step and Step["Button"]) then
AAPClassic.QH.BookingList.ShowButton = Step["Button"]
end
if (Step) then
local ammountz = GetItemCount(Step["ItemID"])
--print(IsQuestFlaggedCompleted(Step["Qid"]))
if ((Step and Step["Qid"] and IsQuestFlaggedCompleted(Step["Qid"])) or (Step and ammountz and Step["Ammount"] and ammountz >= Step["Ammount"])) then
AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] = AAPC1[AAPClassic.Realm][AAPClassic.Name]["Zones"][AAPClassic.QH.ZoneNr] + 1
AAPClassic.QH.FuncLoopNumber = 1
end
AAPClassic.QH.BookingList.SetQPTT = 1
end
end