vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | Name: Tourist-2.0 |
||
3 | Revision: $Rev: 5925 $ |
||
4 | Author(s): ckknight (ckknight@gmail.com) |
||
5 | Website: http://ckknight.wowinterface.com/ |
||
6 | Documentation: http://wiki.wowace.com/index.php/Tourist-2.0 |
||
7 | SVN: http://svn.wowace.com/root/trunk/TouristLib/Tourist-2.0 |
||
8 | Description: A library to provide information about zones and instances. |
||
9 | Dependencies: AceLibrary, Babble-Zone-2.0, AceConsole-2.0 (optional) |
||
10 | ]] |
||
11 | |||
12 | local MAJOR_VERSION = "Tourist-2.0" |
||
13 | local MINOR_VERSION = "$Revision: 5925 $" |
||
14 | |||
15 | if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end |
||
16 | if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end |
||
17 | |||
18 | if not AceLibrary:HasInstance("Babble-Zone-2.0") then error(MAJOR_VERSION .. " requires Babble-Zone-2.0") end |
||
19 | |||
20 | local Tourist = {} |
||
21 | local events = {} |
||
22 | |||
23 | local loc |
||
24 | do |
||
25 | local Z = AceLibrary("Babble-Zone-2.0") |
||
26 | loc = { |
||
27 | BOOTY_BAY = Z"Booty Bay", |
||
28 | DEEPRUN_TRAM = Z"Deeprun Tram", |
||
29 | IRONFORGE = Z"Ironforge", |
||
30 | STORMWIND_CITY = Z"Stormwind City", |
||
31 | ELWYNN_FOREST = Z"Elwynn Forest", |
||
32 | DUN_MOROGH = Z"Dun Morogh", |
||
33 | TIRISFAL_GLADES = Z"Tirisfal Glades", |
||
34 | LOCH_MODAN = Z"Loch Modan", |
||
35 | SILVERPINE_FOREST = Z"Silverpine Forest", |
||
36 | WESTFALL = Z"Westfall", |
||
37 | REDRIDGE_MOUNTAINS = Z"Redridge Mountains", |
||
38 | DUSKWOOD = Z"Duskwood", |
||
39 | HILLSBRAD_FOOTHILLS = Z"Hillsbrad Foothills", |
||
40 | WETLANDS = Z"Wetlands", |
||
41 | ALTERAC_MOUNTAINS = Z"Alterac Mountains", |
||
42 | ARATHI_HIGHLANDS = Z"Arathi Highlands", |
||
43 | STRANGLETHORN_VALE = Z"Stranglethorn Vale", |
||
44 | BADLANDS = Z"Badlands", |
||
45 | SWAMP_OF_SORROWS = Z"Swamp of Sorrows", |
||
46 | DEADWIND_PASS = Z"Deadwind Pass", |
||
47 | HINTERLANDS = Z"The Hinterlands", |
||
48 | SEARING_GORGE = Z"Searing Gorge", |
||
49 | BLASTED_LANDS = Z"Blasted Lands", |
||
50 | BURNING_STEPPES = Z"Burning Steppes", |
||
51 | WESTERN_PLAGUELANDS = Z"Western Plaguelands", |
||
52 | EASTERN_PLAGUELANDS = Z"Eastern Plaguelands", |
||
53 | RATCHET = Z"Ratchet", |
||
54 | GADGETZAN = Z"Gadgetzan", |
||
55 | ORGRIMMAR = Z"Orgrimmar", |
||
56 | THUNDER_BLUFF = Z"Thunder Bluff", |
||
57 | UNDERCITY = Z"Undercity", |
||
58 | DUROTAR = Z"Durotar", |
||
59 | MULGORE = Z"Mulgore", |
||
60 | DARKSHORE = Z"Darkshore", |
||
61 | BARRENS = Z"The Barrens", |
||
62 | STONETALON_MOUNTAINS = Z"Stonetalon Mountains", |
||
63 | ASHENVALE = Z"Ashenvale", |
||
64 | THOUSAND_NEEDLES = Z"Thousand Needles", |
||
65 | DESOLACE = Z"Desolace", |
||
66 | DUSTWALLOW_MARSH = Z"Dustwallow Marsh", |
||
67 | FERALAS = Z"Feralas", |
||
68 | TANARIS = Z"Tanaris", |
||
69 | AZSHARA = Z"Azshara", |
||
70 | FELWOOD = Z"Felwood", |
||
71 | UN_GORO_CRATER = Z"Un'Goro Crater", |
||
72 | SILITHUS = Z"Silithus", |
||
73 | WINTERSPRING = Z"Winterspring", |
||
74 | HYJAL = Z"Hyjal", |
||
75 | MOONGLADE = Z"Moonglade", |
||
76 | DARNASSUS = Z"Darnassus", |
||
77 | TELDRASSIL = Z"Teldrassil", |
||
78 | ALTERAC_VALLEY = Z"Alterac Valley", |
||
79 | WARSONG_GULCH = Z"Warsong Gulch", |
||
80 | ARATHI_BASIN = Z"Arathi Basin", |
||
81 | STOCKADE = Z"The Stockade", |
||
82 | RAGEFIRE_CHASM = Z"Ragefire Chasm", |
||
83 | ZUL_FARRAK = Z"Zul'Farrak", |
||
84 | DEADMINES = Z"The Deadmines", |
||
85 | WAILING_CAVERNS = Z"Wailing Caverns", |
||
86 | GNOMEREGAN = Z"Gnomeregan", |
||
87 | RAZORFEN_KRAUL = Z"Razorfen Kraul", |
||
88 | BLACKFATHOM_DEEPS = Z"Blackfathom Deeps", |
||
89 | SHADOWFANG_KEEP = Z"Shadowfang Keep", |
||
90 | SCARLET_MONASTERY = Z"Scarlet Monastery", |
||
91 | ULDAMAN = Z"Uldaman", |
||
92 | RAZORFEN_DOWNS = Z"Razorfen Downs", |
||
93 | MARAUDON = Z"Maraudon", |
||
94 | ONYXIAS_LAIR = Z"Onyxia's Lair", |
||
95 | BLACKROCK_MOUNTAIN = Z"Blackrock Mountain", |
||
96 | CAVERNS_OF_TIME = Z"Caverns of Time", |
||
97 | TEMPLE_OF_ATAL_HAKKAR = Z"The Temple of Atal'Hakkar", |
||
98 | DIRE_MAUL = Z"Dire Maul", |
||
99 | BLACKROCK_DEPTHS = Z"Blackrock Depths", |
||
100 | BLACKROCK_SPIRE = Z"Blackrock Spire", |
||
101 | STRATHOLME = Z"Stratholme", |
||
102 | MOLTEN_CORE = Z"Molten Core", |
||
103 | SCHOLOMANCE = Z"Scholomance", |
||
104 | BLACKWING_LAIR = Z"Blackwing Lair", |
||
105 | ZUL_GURUB = Z"Zul'Gurub", |
||
106 | RUINS_OF_AHN_QIRAJ = Z"Ruins of Ahn'Qiraj", |
||
107 | TEMPLE_OF_AHN_QIRAJ = Z"Temple of Ahn'Qiraj", |
||
108 | NAXXRAMAS = Z"Naxxramas", |
||
109 | } |
||
110 | end |
||
111 | |||
112 | local playerLevel = 1 |
||
113 | local _,race = UnitRace("player") |
||
114 | local isHorde = (race == "Orc" or race == "Troll" or race == "Tauren" or race == "Scourge") |
||
115 | |||
116 | function events:PLAYER_LEVEL_UP() |
||
117 | playerLevel = UnitLevel("player") |
||
118 | for k in pairs(self.recZones) do |
||
119 | self.recZones[k] = nil |
||
120 | end |
||
121 | for k in pairs(self.recInstances) do |
||
122 | self.recInstances[k] = nil |
||
123 | end |
||
124 | for zone in self.lowZones do |
||
125 | if not self:IsHostile(zone) then |
||
126 | local low, high = self:GetLevel(zone) |
||
127 | if not self:IsInstance(zone) then |
||
128 | if low <= playerLevel and playerLevel <= high then |
||
129 | self.recZones[zone] = true |
||
130 | end |
||
131 | elseif self:IsBattleground(zone) then |
||
132 | if playerLevel >= low and (playerLevel == 60 or math.mod(playerLevel, 10) >= 6) then |
||
133 | self.recInstances[zone] = true |
||
134 | end |
||
135 | else |
||
136 | if low <= playerLevel and playerLevel <= high then |
||
137 | self.recInstances[zone] = true |
||
138 | end |
||
139 | end |
||
140 | end |
||
141 | end |
||
142 | end |
||
143 | |||
144 | events.PLAYER_ENTERING_WORLD = events.PLAYER_LEVEL_UP |
||
145 | |||
146 | function Tourist:GetLevel(zone) |
||
147 | self:argCheck(zone, 2, "string") |
||
148 | if self:IsBattleground(zone) then |
||
149 | if zone == loc.ALTERAC_VALLEY then |
||
150 | return 51, 60 |
||
151 | elseif playerLevel == 60 then |
||
152 | return 60, 60 |
||
153 | elseif playerLevel >= 50 then |
||
154 | return 50, 59 |
||
155 | elseif playerLevel >= 40 then |
||
156 | return 40, 49 |
||
157 | elseif playerLevel >= 30 then |
||
158 | return 30, 39 |
||
159 | elseif playerLevel >= 20 or zone == loc.ARATHI_BASIN then |
||
160 | return 20, 29 |
||
161 | else |
||
162 | return 10, 19 |
||
163 | end |
||
164 | end |
||
165 | return self.lowZones[zone] or -6, self.highZones[zone] or -6 |
||
166 | end |
||
167 | |||
168 | function Tourist:GetLevelColor(zone) |
||
169 | self:argCheck(zone, 2, "string") |
||
170 | if self:IsBattleground(zone) then |
||
171 | if (playerLevel < 51 and zone == loc.ALTERAC_VALLEY) or (playerLevel < 20 and zone == loc.ARATHI_BASIN) or (playerLevel < 10 and zone == loc.WARSONG_GULCH) then |
||
172 | return 1, 0, 0 |
||
173 | end |
||
174 | local playerLevel = playerLevel |
||
175 | if zone == loc.ALTERAC_VALLEY then |
||
176 | playerLevel = playerLevel - 1 |
||
177 | end |
||
178 | if playerLevel == 60 then |
||
179 | return 1, 1, 0 |
||
180 | end |
||
181 | playerLevel = math.mod(playerLevel, 10) |
||
182 | if playerLevel <= 5 then |
||
183 | return 1, playerLevel / 10, 0 |
||
184 | elseif playerLevel <= 7 then |
||
185 | return 1, (playerLevel - 3) / 4, 0 |
||
186 | else |
||
187 | return (9 - playerLevel) / 2, 1, 0 |
||
188 | end |
||
189 | end |
||
190 | local low, high = self:GetLevel(zone) |
||
191 | |||
192 | if playerLevel <= low - 3 then |
||
193 | return 1, 0, 0 |
||
194 | elseif playerLevel <= low then |
||
195 | return 1, (playerLevel - low - 3) / -6, 0 |
||
196 | elseif playerLevel <= (low + high) / 2 then |
||
197 | return 1, (playerLevel - low) / (high - low) + 0.5, 0 |
||
198 | elseif playerLevel <= high then |
||
199 | return 2 * (playerLevel - high) / (low - high), 1, 0 |
||
200 | elseif playerLevel <= high + 3 then |
||
201 | local num = (playerLevel - high) / 6 |
||
202 | return num, 1 - num, num |
||
203 | else |
||
204 | return 0.5, 0.5, 0.5 |
||
205 | end |
||
206 | end |
||
207 | |||
208 | function Tourist:GetFactionColor(zone) |
||
209 | self:argCheck(zone, 2, "string") |
||
210 | if self:IsAlliance(zone) then |
||
211 | if not isHorde then |
||
212 | return 0, 1, 0 |
||
213 | else |
||
214 | return 1, 0, 0 |
||
215 | end |
||
216 | elseif self:IsHorde(zone) then |
||
217 | if isHorde then |
||
218 | return 0, 1, 0 |
||
219 | else |
||
220 | return 1, 0, 0 |
||
221 | end |
||
222 | else |
||
223 | return 1, 1, 0 |
||
224 | end |
||
225 | end |
||
226 | |||
227 | local retNil = function() end |
||
228 | local retOne = function(zone, state) |
||
229 | if state ~= nil then |
||
230 | return |
||
231 | else |
||
232 | return zone |
||
233 | end |
||
234 | end |
||
235 | |||
236 | local function iterZoneInstances(zone, position) |
||
237 | local k = next(zone, position) |
||
238 | return k |
||
239 | end |
||
240 | |||
241 | function Tourist:IterateZoneInstances(zone) |
||
242 | self:argCheck(zone, 2, "string") |
||
243 | if type(self.zoneInstances[zone]) == nil then |
||
244 | return retNil, nil, nil |
||
245 | elseif type(self.zoneInstances[zone]) == "table" then |
||
246 | return iterZoneInstances, self.zoneInstances[zone], nil |
||
247 | else |
||
248 | return retOne, self.zoneInstances[zone], nil |
||
249 | end |
||
250 | end |
||
251 | |||
252 | function Tourist:DoesZoneHaveInstances(zone) |
||
253 | self:argCheck(zone, 2, "string") |
||
254 | return self.zoneInstances[zone] ~= nil |
||
255 | end |
||
256 | |||
257 | local zonesInstances |
||
258 | local function initZonesInstances() |
||
259 | if not zonesInstances then |
||
260 | zonesInstances = {} |
||
261 | for zone in pairs(self.lowZones) do |
||
262 | zonesInstances[zone] = true |
||
263 | end |
||
264 | end |
||
265 | initZonesInstances = nil |
||
266 | end |
||
267 | |||
268 | local function zoneInstanceIter(_, position) |
||
269 | local k = next(zonesInstances, position) |
||
270 | return k |
||
271 | end |
||
272 | function Tourist:IterateZonesAndInstances() |
||
273 | if initZonesInstances then |
||
274 | initZonesInstances() |
||
275 | end |
||
276 | return zoneInstanceIter, nil, nil |
||
277 | end |
||
278 | |||
279 | local function zoneIter(_, position) |
||
280 | local k = next(zonesInstances, position) |
||
281 | while k ~= nil and self:IsInstance(k) do |
||
282 | k = next(zonesInstances, k) |
||
283 | end |
||
284 | return k |
||
285 | end |
||
286 | function Tourist:IterateZones() |
||
287 | if initZonesInstances then |
||
288 | initZonesInstances() |
||
289 | end |
||
290 | return zoneIter, nil, nil |
||
291 | end |
||
292 | |||
293 | local function instanceIter(_, position) |
||
294 | local k = next(zonesInstances, position) |
||
295 | while k ~= nil and not self:IsInstance(k) do |
||
296 | k = next(zonesInstances, k) |
||
297 | end |
||
298 | return k |
||
299 | end |
||
300 | function Tourist:IterateInstances() |
||
301 | if initZonesInstances then |
||
302 | initZonesInstances() |
||
303 | end |
||
304 | return instanceIter, nil, nil |
||
305 | end |
||
306 | |||
307 | local function bgIter(_, position) |
||
308 | local k = next(zonesInstances, position) |
||
309 | while k ~= nil and not self:IsBattleground(k) do |
||
310 | k = next(zonesInstances, k) |
||
311 | end |
||
312 | return k |
||
313 | end |
||
314 | function Tourist:IterateBattlegrounds() |
||
315 | if initZonesInstances then |
||
316 | initZonesInstances() |
||
317 | end |
||
318 | return bgIter, nil, nil |
||
319 | end |
||
320 | |||
321 | local function allianceIter(_, position) |
||
322 | local k = next(zonesInstances, position) |
||
323 | while k ~= nil and not self:IsAlliance(k) do |
||
324 | k = next(zonesInstances, k) |
||
325 | end |
||
326 | return k |
||
327 | end |
||
328 | function Tourist:IterateAlliance() |
||
329 | if initZonesInstances then |
||
330 | initZonesInstances() |
||
331 | end |
||
332 | return allianceIter, nil, nil |
||
333 | end |
||
334 | |||
335 | local function hordeIter(_, position) |
||
336 | local k = next(zonesInstances, position) |
||
337 | while k ~= nil and not self:IsHorde(k) do |
||
338 | k = next(zonesInstances, k) |
||
339 | end |
||
340 | return k |
||
341 | end |
||
342 | function Tourist:IterateHorde() |
||
343 | if initZonesInstances then |
||
344 | initZonesInstances() |
||
345 | end |
||
346 | return hordeIter, nil, nil |
||
347 | end |
||
348 | |||
349 | function Tourist:IterateFriendly() |
||
350 | if isHorde then |
||
351 | return self:IterateHordeZonesInstances() |
||
352 | else |
||
353 | return self:IterateAllianceZonesInstances() |
||
354 | end |
||
355 | end |
||
356 | |||
357 | function Tourist:IterateHostile() |
||
358 | if isHorde then |
||
359 | return self:IterateAllianceZonesInstances() |
||
360 | else |
||
361 | return self:IterateHordeZonesInstances() |
||
362 | end |
||
363 | end |
||
364 | |||
365 | local function contestedIter(_, position) |
||
366 | local k = next(zonesInstances, position) |
||
367 | while k ~= nil and (self:IsAlliance(k) or self:IsHorde(k)) do |
||
368 | k = next(zonesInstances, k) |
||
369 | end |
||
370 | return k |
||
371 | end |
||
372 | function Tourist:IterateContested() |
||
373 | if initZonesInstances then |
||
374 | initZonesInstances() |
||
375 | end |
||
376 | return contestedIter, nil, nil |
||
377 | end |
||
378 | |||
379 | local function recZoneIter(recZones, position) |
||
380 | local k = next(recZones, position) |
||
381 | return k |
||
382 | end |
||
383 | function Tourist:IterateRecommendedZones() |
||
384 | return recZoneIter, self.recZones, nil |
||
385 | end |
||
386 | |||
387 | function Tourist:IterateRecommendedInstances() |
||
388 | return recZoneIter, self.recInstances, nil |
||
389 | end |
||
390 | |||
391 | function Tourist:HasRecommendedInstances() |
||
392 | return next(self.recInstances) ~= nil |
||
393 | end |
||
394 | |||
395 | function Tourist:IsInstance(zone) |
||
396 | self:argCheck(zone, 2, "string") |
||
397 | return self.instances[zone] ~= nil |
||
398 | end |
||
399 | |||
400 | function Tourist:IsZone(zone) |
||
401 | self:argCheck(zone, 2, "string") |
||
402 | return self.instances[zone] == nil and not self.lowZones[zone] ~= nil |
||
403 | end |
||
404 | |||
405 | function Tourist:IsZoneOrInstance(zone) |
||
406 | self:argCheck(zone, 2, "string") |
||
407 | return self.lowZones[zone] ~= nil |
||
408 | end |
||
409 | |||
410 | function Tourist:IsBattleground(zone) |
||
411 | self:argCheck(zone, 2, "string") |
||
412 | return zone == loc.WARSONG_GULCH or zone == loc.ARATHI_BASIN or zone == loc.ALTERAC_VALLEY |
||
413 | end |
||
414 | |||
415 | function Tourist:IsAlliance(zone) |
||
416 | self:argCheck(zone, 2, "string") |
||
417 | return zone == loc.IRONFORGE or zone == loc.STORMWIND_CITY or zone == loc.DUN_MOROGH or zone == loc.ELWYNN_FOREST or zone == loc.LOCH_MODAN or zone == loc.WESTFALL or zone == loc.DARNASSUS or zone == loc.TELDRASSIL or zone == loc.DARKSHORE or zone == loc.STOCKADE or zone == loc.GNOMEREGAN or zone == loc.DEADMINES |
||
418 | end |
||
419 | |||
420 | function Tourist:IsHorde(zone) |
||
421 | self:argCheck(zone, 2, "string") |
||
422 | return zone == loc.UNDERCITY or zone == loc.ORGRIMMAR or zone == loc.THUNDER_BLUFF or zone == loc.TIRISFAL_GLADES or zone == loc.SILVERPINE_FOREST or zone == loc.DUROTAR or zone == loc.MULGORE or zone == loc.BARRENS or zone == loc.RAGEFIRE_CHASM or zone == loc.SHADOWFANG_KEEP or zone == loc.WAILING_CAVERNS |
||
423 | end |
||
424 | |||
425 | function Tourist:IsFriendly(zone) |
||
426 | self:argCheck(zone, 2, "string") |
||
427 | if isHorde then |
||
428 | return self:IsHorde(zone) |
||
429 | else |
||
430 | return self:IsAlliance(zone) |
||
431 | end |
||
432 | end |
||
433 | |||
434 | function Tourist:IsHostile(zone) |
||
435 | self:argCheck(zone, 2, "string") |
||
436 | if isHorde then |
||
437 | return self:IsAlliance(zone) |
||
438 | else |
||
439 | return self:IsHorde(zone) |
||
440 | end |
||
441 | end |
||
442 | |||
443 | function Tourist:IsContested(zone) |
||
444 | self:argCheck(zone, 2, "string") |
||
445 | return not self:IsAlliance(zone) and not self:IsHorde(zone) |
||
446 | end |
||
447 | |||
448 | local function activate(self, oldLib, oldDeactivate) |
||
449 | if oldLib then |
||
450 | self.frame = oldLib.frame |
||
451 | self.frame:UnregisterAllEvents() |
||
452 | self.lowZones = oldLib.lowZones |
||
453 | self.highZones = oldLib.highZones |
||
454 | self.zoneInstances = oldLib.zoneInstances |
||
455 | self.instances = oldLib.instances |
||
456 | self.recZones = oldLib.recZones |
||
457 | self.recInstances = oldLib.recInstances |
||
458 | for k in pairs(self.lowZones) do |
||
459 | self.lowZones[k] = nil |
||
460 | end |
||
461 | for k in pairs(self.highZones) do |
||
462 | self.highZones[k] = nil |
||
463 | end |
||
464 | for k in pairs(self.zoneInstances) do |
||
465 | self.zoneInstances[k] = nil |
||
466 | end |
||
467 | for k in pairs(self.instances) do |
||
468 | self.instances[k] = nil |
||
469 | end |
||
470 | else |
||
471 | self.frame = CreateFrame("Frame", "TouristLibFrame", UIParent) |
||
472 | self.lowZones = {} |
||
473 | self.highZones = {} |
||
474 | self.zoneInstances = {} |
||
475 | self.instances = {} |
||
476 | self.recZones = {} |
||
477 | self.recInstances = {} |
||
478 | end |
||
479 | self.frame:RegisterEvent("PLAYER_LEVEL_UP") |
||
480 | self.frame:RegisterEvent("PLAYER_ENTERING_WORLD") |
||
481 | self.frame:SetScript("OnEvent", function() |
||
482 | events[event](self) |
||
483 | end) |
||
484 | -- Eastern Kingdoms |
||
485 | self.lowZones[loc.BOOTY_BAY] = -6 |
||
486 | self.highZones[loc.BOOTY_BAY] = -6 |
||
487 | self.lowZones[loc.DEEPRUN_TRAM] = -6 |
||
488 | self.highZones[loc.DEEPRUN_TRAM] = -6 |
||
489 | self.lowZones[loc.IRONFORGE] = -6 |
||
490 | self.highZones[loc.IRONFORGE] = -6 |
||
491 | self.lowZones[loc.STORMWIND_CITY] = -6 |
||
492 | self.highZones[loc.STORMWIND_CITY] = -6 |
||
493 | self.lowZones[loc.ELWYNN_FOREST] = 1 |
||
494 | self.highZones[loc.ELWYNN_FOREST] = 10 |
||
495 | self.lowZones[loc.DUN_MOROGH] = 1 |
||
496 | self.highZones[loc.DUN_MOROGH] = 10 |
||
497 | self.lowZones[loc.TIRISFAL_GLADES] = 1 |
||
498 | self.highZones[loc.TIRISFAL_GLADES] = 10 |
||
499 | self.lowZones[loc.LOCH_MODAN] = 10 |
||
500 | self.highZones[loc.LOCH_MODAN] = 20 |
||
501 | self.lowZones[loc.SILVERPINE_FOREST] = 10 |
||
502 | self.highZones[loc.SILVERPINE_FOREST] = 20 |
||
503 | self.lowZones[loc.WESTFALL] = 10 |
||
504 | self.highZones[loc.WESTFALL] = 20 |
||
505 | self.lowZones[loc.REDRIDGE_MOUNTAINS] = 15 |
||
506 | self.highZones[loc.REDRIDGE_MOUNTAINS] = 25 |
||
507 | self.lowZones[loc.DUSKWOOD] = 18 |
||
508 | self.highZones[loc.DUSKWOOD] = 30 |
||
509 | self.lowZones[loc.HILLSBRAD_FOOTHILLS] = 20 |
||
510 | self.highZones[loc.HILLSBRAD_FOOTHILLS] = 30 |
||
511 | self.lowZones[loc.WETLANDS] = 20 |
||
512 | self.highZones[loc.WETLANDS] = 30 |
||
513 | self.lowZones[loc.ALTERAC_MOUNTAINS] = 30 |
||
514 | self.highZones[loc.ALTERAC_MOUNTAINS] = 40 |
||
515 | self.lowZones[loc.ARATHI_HIGHLANDS] = 30 |
||
516 | self.highZones[loc.ARATHI_HIGHLANDS] = 40 |
||
517 | self.lowZones[loc.STRANGLETHORN_VALE] = 30 |
||
518 | self.highZones[loc.STRANGLETHORN_VALE] = 45 |
||
519 | self.lowZones[loc.BADLANDS] = 35 |
||
520 | self.highZones[loc.BADLANDS] = 45 |
||
521 | self.lowZones[loc.SWAMP_OF_SORROWS] = 35 |
||
522 | self.highZones[loc.SWAMP_OF_SORROWS] = 45 |
||
523 | self.lowZones[loc.DEADWIND_PASS] = 37 |
||
524 | self.highZones[loc.DEADWIND_PASS] = 60 |
||
525 | self.lowZones[loc.HINTERLANDS] = 40 |
||
526 | self.highZones[loc.HINTERLANDS] = 50 |
||
527 | self.lowZones[loc.SEARING_GORGE] = 43 |
||
528 | self.highZones[loc.SEARING_GORGE] = 50 |
||
529 | self.lowZones[loc.BLASTED_LANDS] = 45 |
||
530 | self.highZones[loc.BLASTED_LANDS] = 55 |
||
531 | self.lowZones[loc.BURNING_STEPPES] = 50 |
||
532 | self.highZones[loc.BURNING_STEPPES] = 58 |
||
533 | self.lowZones[loc.WESTERN_PLAGUELANDS] = 51 |
||
534 | self.highZones[loc.WESTERN_PLAGUELANDS] = 58 |
||
535 | self.lowZones[loc.EASTERN_PLAGUELANDS] = 53 |
||
536 | self.highZones[loc.EASTERN_PLAGUELANDS] = 60 |
||
537 | |||
538 | -- Kalimdor |
||
539 | self.lowZones[loc.RATCHET] = -6 |
||
540 | self.highZones[loc.RATCHET] = -6 |
||
541 | self.lowZones[loc.GADGETZAN] = -6 |
||
542 | self.highZones[loc.GADGETZAN] = -6 |
||
543 | self.lowZones[loc.ORGRIMMAR] = -6 |
||
544 | self.highZones[loc.ORGRIMMAR] = -6 |
||
545 | self.lowZones[loc.THUNDER_BLUFF] = -6 |
||
546 | self.highZones[loc.THUNDER_BLUFF] = -6 |
||
547 | self.lowZones[loc.UNDERCITY] = -6 |
||
548 | self.highZones[loc.UNDERCITY] = -6 |
||
549 | self.lowZones[loc.DUROTAR] = 1 |
||
550 | self.highZones[loc.DUROTAR] = 10 |
||
551 | self.lowZones[loc.MULGORE] = 1 |
||
552 | self.highZones[loc.MULGORE] = 10 |
||
553 | self.lowZones[loc.DARKSHORE] = 10 |
||
554 | self.highZones[loc.DARKSHORE] = 20 |
||
555 | self.lowZones[loc.BARRENS] = 10 |
||
556 | self.highZones[loc.BARRENS] = 25 |
||
557 | self.lowZones[loc.STONETALON_MOUNTAINS] = 15 |
||
558 | self.highZones[loc.STONETALON_MOUNTAINS] = 27 |
||
559 | self.lowZones[loc.ASHENVALE] = 18 |
||
560 | self.highZones[loc.ASHENVALE] = 30 |
||
561 | self.lowZones[loc.THOUSAND_NEEDLES] = 25 |
||
562 | self.highZones[loc.THOUSAND_NEEDLES] = 35 |
||
563 | self.lowZones[loc.DESOLACE] = 30 |
||
564 | self.highZones[loc.DESOLACE] = 40 |
||
565 | self.lowZones[loc.DUSTWALLOW_MARSH] = 35 |
||
566 | self.highZones[loc.DUSTWALLOW_MARSH] = 45 |
||
567 | self.lowZones[loc.FERALAS] = 40 |
||
568 | self.highZones[loc.FERALAS] = 50 |
||
569 | self.lowZones[loc.TANARIS] = 40 |
||
570 | self.highZones[loc.TANARIS] = 50 |
||
571 | self.lowZones[loc.AZSHARA] = 45 |
||
572 | self.highZones[loc.AZSHARA] = 55 |
||
573 | self.lowZones[loc.FELWOOD] = 48 |
||
574 | self.highZones[loc.FELWOOD] = 55 |
||
575 | self.lowZones[loc.UN_GORO_CRATER] = 48 |
||
576 | self.highZones[loc.UN_GORO_CRATER] = 55 |
||
577 | self.lowZones[loc.SILITHUS] = 55 |
||
578 | self.highZones[loc.SILITHUS] = 60 |
||
579 | self.lowZones[loc.WINTERSPRING] = 55 |
||
580 | self.highZones[loc.WINTERSPRING] = 60 |
||
581 | self.lowZones[loc.HYJAL] = 60 |
||
582 | self.highZones[loc.HYJAL] = 60 |
||
583 | self.lowZones[loc.MOONGLADE] = -6 |
||
584 | self.highZones[loc.MOONGLADE] = -6 |
||
585 | self.lowZones[loc.DARNASSUS] = -6 |
||
586 | self.highZones[loc.DARNASSUS] = -6 |
||
587 | self.lowZones[loc.TELDRASSIL] = 1 |
||
588 | self.highZones[loc.TELDRASSIL] = 10 |
||
589 | |||
590 | -- Battlegrounds (Tiered) |
||
591 | self.lowZones[loc.ALTERAC_VALLEY] = -6 |
||
592 | self.highZones[loc.ALTERAC_VALLEY] = -6 |
||
593 | self.lowZones[loc.WARSONG_GULCH] = -6 |
||
594 | self.highZones[loc.WARSONG_GULCH] = -6 |
||
595 | self.lowZones[loc.ARATHI_BASIN] = -6 |
||
596 | self.highZones[loc.ARATHI_BASIN] = -6 |
||
597 | |||
598 | -- Instances |
||
599 | if GetLocale() == "enUS" then |
||
600 | self.lowZones[loc.STOCKADE] = 24 |
||
601 | self.highZones[loc.STOCKADE] = 32 |
||
602 | self.lowZones[loc.RAGEFIRE_CHASM] = 13 |
||
603 | self.highZones[loc.RAGEFIRE_CHASM] = 18 |
||
604 | self.lowZones[loc.ZUL_FARRAK] = 44 |
||
605 | self.highZones[loc.ZUL_FARRAK] = 54 |
||
606 | self.lowZones[loc.DEADMINES] = 17 |
||
607 | self.highZones[loc.DEADMINES] = 26 |
||
608 | self.lowZones[loc.WAILING_CAVERNS] = 17 |
||
609 | self.highZones[loc.WAILING_CAVERNS] = 24 |
||
610 | self.lowZones[loc.GNOMEREGAN] = 29 |
||
611 | self.highZones[loc.GNOMEREGAN] = 38 |
||
612 | self.lowZones[loc.RAZORFEN_KRAUL] = 29 |
||
613 | self.highZones[loc.RAZORFEN_KRAUL] = 38 |
||
614 | self.lowZones[loc.BLACKFATHOM_DEEPS] = 24 |
||
615 | self.highZones[loc.BLACKFATHOM_DEEPS] = 32 |
||
616 | self.lowZones[loc.SHADOWFANG_KEEP] = 22 |
||
617 | self.highZones[loc.SHADOWFANG_KEEP] = 30 |
||
618 | self.lowZones[loc.SCARLET_MONASTERY] = 34 |
||
619 | self.highZones[loc.SCARLET_MONASTERY] = 45 |
||
620 | self.lowZones[loc.ULDAMAN] = 41 |
||
621 | self.highZones[loc.ULDAMAN] = 51 |
||
622 | self.lowZones[loc.RAZORFEN_DOWNS] = 37 |
||
623 | self.highZones[loc.RAZORFEN_DOWNS] = 46 |
||
624 | self.lowZones[loc.MARAUDON] = 46 |
||
625 | self.highZones[loc.MARAUDON] = 55 |
||
626 | self.lowZones[loc.ONYXIAS_LAIR] = 60 |
||
627 | self.highZones[loc.ONYXIAS_LAIR] = 62 |
||
628 | self.lowZones[loc.BLACKROCK_MOUNTAIN] = 42 |
||
629 | self.highZones[loc.BLACKROCK_MOUNTAIN] = 54 |
||
630 | self.lowZones[loc.CAVERNS_OF_TIME] = 43 |
||
631 | self.highZones[loc.CAVERNS_OF_TIME] = 61 |
||
632 | self.lowZones[loc.TEMPLE_OF_ATAL_HAKKAR] = 50 |
||
633 | self.highZones[loc.TEMPLE_OF_ATAL_HAKKAR] = 60 |
||
634 | self.lowZones[loc.DIRE_MAUL] = 56 |
||
635 | self.highZones[loc.DIRE_MAUL] = 60 |
||
636 | self.lowZones[loc.BLACKROCK_DEPTHS] = 52 |
||
637 | self.highZones[loc.BLACKROCK_DEPTHS] = 60 |
||
638 | self.lowZones[loc.BLACKROCK_SPIRE] = 55 |
||
639 | self.highZones[loc.BLACKROCK_SPIRE] = 60 |
||
640 | self.lowZones[loc.STRATHOLME] = 58 |
||
641 | self.highZones[loc.STRATHOLME] = 60 |
||
642 | self.lowZones[loc.MOLTEN_CORE] = 60 |
||
643 | self.highZones[loc.MOLTEN_CORE] = 62 |
||
644 | self.lowZones[loc.SCHOLOMANCE] = 58 |
||
645 | self.highZones[loc.SCHOLOMANCE] = 60 |
||
646 | self.lowZones[loc.BLACKWING_LAIR] = 60 |
||
647 | self.highZones[loc.BLACKWING_LAIR] = 62 |
||
648 | self.lowZones[loc.ZUL_GURUB] = 60 |
||
649 | self.highZones[loc.ZUL_GURUB] = 62 |
||
650 | self.lowZones[loc.RUINS_OF_AHN_QIRAJ] = 60 |
||
651 | self.highZones[loc.RUINS_OF_AHN_QIRAJ] = 65 |
||
652 | self.lowZones[loc.TEMPLE_OF_AHN_QIRAJ] = 60 |
||
653 | self.highZones[loc.TEMPLE_OF_AHN_QIRAJ] = 65 |
||
654 | self.lowZones[loc.NAXXRAMAS] = 60 |
||
655 | self.highZones[loc.NAXXRAMAS] = 70 |
||
656 | else |
||
657 | self.lowZones[loc.STOCKADE] = 23 |
||
658 | self.highZones[loc.STOCKADE] = 26 |
||
659 | self.lowZones[loc.RAGEFIRE_CHASM] = 13 |
||
660 | self.highZones[loc.RAGEFIRE_CHASM] = 15 |
||
661 | self.lowZones[loc.ZUL_FARRAK] = 43 |
||
662 | self.highZones[loc.ZUL_FARRAK] = 47 |
||
663 | self.lowZones[loc.DEADMINES] = 15 |
||
664 | self.highZones[loc.DEADMINES] = 20 |
||
665 | self.lowZones[loc.WAILING_CAVERNS] = 15 |
||
666 | self.highZones[loc.WAILING_CAVERNS] = 21 |
||
667 | self.lowZones[loc.GNOMEREGAN] = 24 |
||
668 | self.highZones[loc.GNOMEREGAN] = 33 |
||
669 | self.lowZones[loc.RAZORFEN_KRAUL] = 25 |
||
670 | self.highZones[loc.RAZORFEN_KRAUL] = 35 |
||
671 | self.lowZones[loc.BLACKFATHOM_DEEPS] = 20 |
||
672 | self.highZones[loc.BLACKFATHOM_DEEPS] = 27 |
||
673 | self.lowZones[loc.SHADOWFANG_KEEP] = 18 |
||
674 | self.highZones[loc.SHADOWFANG_KEEP] = 25 |
||
675 | self.lowZones[loc.SCARLET_MONASTERY] = 30 |
||
676 | self.highZones[loc.SCARLET_MONASTERY] = 40 |
||
677 | self.lowZones[loc.ULDAMAN] = 35 |
||
678 | self.highZones[loc.ULDAMAN] = 45 |
||
679 | self.lowZones[loc.RAZORFEN_DOWNS] = 35 |
||
680 | self.highZones[loc.RAZORFEN_DOWNS] = 40 |
||
681 | self.lowZones[loc.MARAUDON] = 40 |
||
682 | self.highZones[loc.MARAUDON] = 49 |
||
683 | self.lowZones[loc.ONYXIAS_LAIR] = 60 |
||
684 | self.highZones[loc.ONYXIAS_LAIR] = 62 |
||
685 | self.lowZones[loc.BLACKROCK_MOUNTAIN] = 42 |
||
686 | self.highZones[loc.BLACKROCK_MOUNTAIN] = 54 |
||
687 | self.lowZones[loc.CAVERNS_OF_TIME] = -6 |
||
688 | self.highZones[loc.CAVERNS_OF_TIME] = -6 |
||
689 | self.lowZones[loc.TEMPLE_OF_ATAL_HAKKAR] = 44 |
||
690 | self.highZones[loc.TEMPLE_OF_ATAL_HAKKAR] = 50 |
||
691 | self.lowZones[loc.DIRE_MAUL] = 56 |
||
692 | self.highZones[loc.DIRE_MAUL] = 60 |
||
693 | self.lowZones[loc.BLACKROCK_DEPTHS] = 48 |
||
694 | self.highZones[loc.BLACKROCK_DEPTHS] = 56 |
||
695 | self.lowZones[loc.BLACKROCK_SPIRE] = 53 |
||
696 | self.highZones[loc.BLACKROCK_SPIRE] = 60 |
||
697 | self.lowZones[loc.STRATHOLME] = 55 |
||
698 | self.highZones[loc.STRATHOLME] = 60 |
||
699 | self.lowZones[loc.MOLTEN_CORE] = 60 |
||
700 | self.highZones[loc.MOLTEN_CORE] = 62 |
||
701 | self.lowZones[loc.SCHOLOMANCE] = 56 |
||
702 | self.highZones[loc.SCHOLOMANCE] = 60 |
||
703 | self.lowZones[loc.BLACKWING_LAIR] = 60 |
||
704 | self.highZones[loc.BLACKWING_LAIR] = 62 |
||
705 | self.lowZones[loc.ZUL_GURUB] = 60 |
||
706 | self.highZones[loc.ZUL_GURUB] = 62 |
||
707 | self.lowZones[loc.RUINS_OF_AHN_QIRAJ] = 60 |
||
708 | self.highZones[loc.RUINS_OF_AHN_QIRAJ] = 65 |
||
709 | self.lowZones[loc.TEMPLE_OF_AHN_QIRAJ] = 60 |
||
710 | self.highZones[loc.TEMPLE_OF_AHN_QIRAJ] = 65 |
||
711 | self.lowZones[loc.NAXXRAMAS] = 60 |
||
712 | self.highZones[loc.NAXXRAMAS] = 70 |
||
713 | end |
||
714 | |||
715 | self.zoneInstances[loc.STORMWIND_CITY] = loc.STOCKADE |
||
716 | self.zoneInstances[loc.ELWYNN_FOREST] = self.zoneInstances[loc.ELWYNN_FOREST] |
||
717 | self.zoneInstances[loc.ORGRIMMAR] = loc.RAGEFIRE_CHASM |
||
718 | self.zoneInstances[loc.DUROTAR] = self.zoneInstances[loc.ORGRIMMAR] |
||
719 | self.zoneInstances[loc.DUN_MOROGH] = loc.GNOMEREGAN |
||
720 | self.zoneInstances[loc.IRONFORGE] = self.zoneInstances[loc.DUN_MOROGH] |
||
721 | self.zoneInstances[loc.TIRISFAL_GLADES] = loc.SCARLET_MONASTERY |
||
722 | self.zoneInstances[loc.UNDERCITY] = self.zoneInstances[loc.TIRISFAL_GLADES] |
||
723 | self.zoneInstances[loc.WESTFALL] = loc.DEADMINES |
||
724 | self.zoneInstances[loc.SILVERPINE_FOREST] = loc.SHADOWFANG_KEEP |
||
725 | self.zoneInstances[loc.ALTERAC_MOUNTAINS] = loc.ALTERAC_VALLEY |
||
726 | self.zoneInstances[loc.ARATHI_HIGHLANDS] = loc.ARATHI_BASIN |
||
727 | self.zoneInstances[loc.STRANGLETHORN_VALE] = loc.ZUL_GURUB |
||
728 | self.zoneInstances[loc.SWAMP_OF_SORROWS] = loc.TEMPLE_OF_ATAL_HAKKAR |
||
729 | self.zoneInstances[loc.SEARING_GORGE] = { |
||
730 | [loc.MOLTEN_CORE] = true, |
||
731 | [loc.BLACKWING_LAIR] = true, |
||
732 | [loc.BLACKROCK_SPIRE] = true, |
||
733 | [loc.BLACKROCK_DEPTHS] = true, |
||
734 | } |
||
735 | self.zoneInstances[loc.BLACKROCK_MOUNTAIN] = self.zoneInstances[loc.SEARING_GORGE] |
||
736 | self.zoneInstances[loc.BURNING_STEPPES] = self.zoneInstances[loc.SEARING_GORGE] |
||
737 | self.zoneInstances[loc.EASTERN_PLAGUELANDS] = { |
||
738 | [loc.STRATHOLME] = true, |
||
739 | [loc.NAXXRAMAS] = true |
||
740 | } |
||
741 | self.zoneInstances[loc.WESTERN_PLAGUELANDS] = loc.SCHOLOMANCE |
||
742 | self.zoneInstances[loc.BARRENS] = { |
||
743 | [loc.WAILING_CAVERNS] = true, |
||
744 | [loc.RAZORFEN_KRAUL] = true, |
||
745 | [loc.RAZORFEN_DOWNS] = true |
||
746 | } |
||
747 | self.zoneInstances[loc.ASHENVALE] = loc.BLACKFATHOM_DEEPS |
||
748 | if UnitFactionGroup("player") == "Horde" then |
||
749 | self.zoneInstances[loc.BARRENS][loc.WARSONG_GULCH] = true |
||
750 | else |
||
751 | self.zoneInstances[loc.ASHENVALE] = { |
||
752 | [loc.BLACKFATHOM_DEEPS] = true, |
||
753 | [loc.WARSONG_GULCH] = true |
||
754 | } |
||
755 | end |
||
756 | self.zoneInstances[loc.DESOLACE] = loc.MARAUDON |
||
757 | self.zoneInstances[loc.DUSTWALLOW_MARSH] = loc.ONYXIAS_LAIR |
||
758 | self.zoneInstances[loc.FERALAS] = loc.DIRE_MAUL |
||
759 | self.zoneInstances[loc.SILITHUS] = { |
||
760 | [loc.RUINS_OF_AHN_QIRAJ] = true, |
||
761 | [loc.TEMPLE_OF_AHN_QIRAJ] = true |
||
762 | } |
||
763 | self.zoneInstances[loc.TANARIS] = loc.ZUL_FARRAK |
||
764 | self.zoneInstances[loc.BADLANDS] = loc.ULDAMAN |
||
765 | |||
766 | for _,instances in pairs(self.zoneInstances) do |
||
767 | if type(instances) == "table" then |
||
768 | for instance in pairs(instances) do |
||
769 | self.instances[instance] = true |
||
770 | end |
||
771 | else |
||
772 | self.instances[instances] = true |
||
773 | end |
||
774 | end |
||
775 | |||
776 | events.PLAYER_LEVEL_UP(self) |
||
777 | |||
778 | if oldDeactivate then |
||
779 | oldDeactivate(oldLib) |
||
780 | end |
||
781 | end |
||
782 | |||
783 | local function external(self, major, instance) |
||
784 | if major == "AceConsole-2.0" then |
||
785 | local print = print |
||
786 | if DEFAULT_CHAT_FRAME then |
||
787 | function print(text) |
||
788 | DEFAULT_CHAT_FRAME:AddMessage(text) |
||
789 | end |
||
790 | end |
||
791 | instance.RegisterChatCommand(self, { "/tourist", "/touristLib" }, { |
||
792 | name = MAJOR_VERSION .. "." .. string.gsub(MINOR_VERSION, ".-(%d+).*", "%1"), |
||
793 | desc = "A library to provide information about zones and instances.", |
||
794 | type = "group", |
||
795 | args = { |
||
796 | zone = { |
||
797 | name = "Zone", |
||
798 | desc = "Get information about a zone", |
||
799 | type = "text", |
||
800 | usage = "<zone name>", |
||
801 | get = false, |
||
802 | set = function(text) |
||
803 | local type |
||
804 | if self:IsBattleground(text) then |
||
805 | type = "Battleground" |
||
806 | elseif self:IsInstance(text) then |
||
807 | type = "Instance" |
||
808 | else |
||
809 | type = "Zone" |
||
810 | end |
||
811 | local faction |
||
812 | if self:IsAlliance(text) then |
||
813 | faction = "Alliance" |
||
814 | elseif self:IsHorde(text) then |
||
815 | faction = "Horde" |
||
816 | else |
||
817 | faction = "Contested" |
||
818 | end |
||
819 | if self:IsHostile(text) then |
||
820 | faction = faction .. " (hostile)" |
||
821 | elseif self:IsFriendly(text) then |
||
822 | faction = faction .. " (friendly)" |
||
823 | end |
||
824 | local low, high = self:GetLevel(text) |
||
825 | print("|cffffff7f" .. text .. "|r") |
||
826 | print(" |cffffff7fType: [|r" .. type .. "|cffffff7f]|r") |
||
827 | print(" |cffffff7fFaction: [|r" .. faction .. "|cffffff7f]|r") |
||
828 | if low ~= -6 and high ~= -6 then |
||
829 | print(" |cffffff7fLevels: [|r" .. low .. "-" .. high .. "|cffffff7f]|r") |
||
830 | end |
||
831 | if self:DoesZoneHaveInstances(text) then |
||
832 | print(" |cffffff7fInstances:|r") |
||
833 | for instance in self:IterateZoneInstances(text) do |
||
834 | local isBG = self:IsBattleground(instance) and " (BG)" or "" |
||
835 | local low, high = self:GetLevel(instance) |
||
836 | local faction = "" |
||
837 | if self:IsAlliance(instance) then |
||
838 | faction = " - Alliance" |
||
839 | elseif self:IsHorde(instance) then |
||
840 | faction = " - Horde" |
||
841 | end |
||
842 | if self:IsHostile(instance) then |
||
843 | faction = faction .. " (hostile)" |
||
844 | elseif self:IsFriendly(instance) then |
||
845 | faction = faction .. " (friendly)" |
||
846 | end |
||
847 | print(" " .. instance .. isBG .. " - " .. low .. "-" .. high .. faction) |
||
848 | end |
||
849 | end |
||
850 | end, |
||
851 | validate = function(text) |
||
852 | return self:IsZoneOrInstance(text) |
||
853 | end |
||
854 | }, |
||
855 | recommend = { |
||
856 | name = "Recommended Zones", |
||
857 | desc = "List recommended zones", |
||
858 | type = "execute", |
||
859 | func = function() |
||
860 | print("|cffffff7fRecomended zones:|r") |
||
861 | for zone in self:IterateRecommendedZones() do |
||
862 | local low, high = self:GetLevel(zone) |
||
863 | local faction = "" |
||
864 | if self:IsAlliance(zone) then |
||
865 | faction = " - Alliance" |
||
866 | elseif self:IsHorde(zone) then |
||
867 | faction = " - Horde" |
||
868 | end |
||
869 | if self:IsHostile(zone) then |
||
870 | faction = faction .. " (hostile)" |
||
871 | elseif self:IsFriendly(zone) then |
||
872 | faction = faction .. " (friendly)" |
||
873 | end |
||
874 | print(" |cffffff7f" .. zone .. "|r - " .. low .. "-" .. high .. faction) |
||
875 | end |
||
876 | if self:HasRecommendedInstances() then |
||
877 | print("|cffffff7fRecomended instances:|r") |
||
878 | for instance in self:IterateRecommendedInstances() do |
||
879 | local isBG = self:IsBattleground(instance) and " (BG)" or "" |
||
880 | local low, high = self:GetLevel(instance) |
||
881 | local faction = "" |
||
882 | if self:IsAlliance(instance) then |
||
883 | faction = " - Alliance" |
||
884 | elseif self:IsHorde(instance) then |
||
885 | faction = " - Horde" |
||
886 | end |
||
887 | if self:IsHostile(instance) then |
||
888 | faction = faction .. " (hostile)" |
||
889 | elseif self:IsFriendly(instance) then |
||
890 | faction = faction .. " (friendly)" |
||
891 | end |
||
892 | print(" |cffffff7f" .. instance .. "|r" .. isBG .. " - " .. low .. "-" .. high .. faction) |
||
893 | end |
||
894 | end |
||
895 | end |
||
896 | } |
||
897 | } |
||
898 | }, "TOURIST") |
||
899 | end |
||
900 | end |
||
901 | |||
902 | AceLibrary:Register(Tourist, MAJOR_VERSION, MINOR_VERSION, activate, nil, external) |
||
903 | Tourist = nil |