From 7b04cc48a2fa927ad29b671f768e9c3de47fc0cc Mon Sep 17 00:00:00 2001 From: Tekkub Stoutwrithe Date: Sun, 14 Oct 2007 01:10:59 +0000 Subject: [PATCH] TourGuide - Reworked mapping, now passes guide title as zone to map in... no more mapping in IF when you log in! - Added |Z| tag to define the zone to map in if different from the guide title - Added |NODEBUG| tag to suppress debug warnings about bad title case on an objective if it's been tested to not fit the normal rules - More ally guide data git-svn-id: https://tekkub-wow.googlecode.com/svn/trunk/TourGuide@634 86fe6d9a-1522-0410-a387-bf9db416f0a0 --- Alliance/51_52_UnGoro_Crater.lua | 18 +++++------ Alliance/51_Kalimdor.lua | 10 +++--- Alliance/52_53_Azshara.lua | 44 ++++++++++++++++++++++++++ Mapping.lua | 31 +++++++++++++++++++ StatusFrame.lua | 9 ++---- TourGuide.lua | 67 +++++++++++++++++++++------------------- TourGuide.toc | 2 ++ 7 files changed, 129 insertions(+), 52 deletions(-) create mode 100644 Alliance/52_53_Azshara.lua create mode 100644 Mapping.lua diff --git a/Alliance/51_52_UnGoro_Crater.lua b/Alliance/51_52_UnGoro_Crater.lua index 4f496f3..bc6368f 100644 --- a/Alliance/51_52_UnGoro_Crater.lua +++ b/Alliance/51_52_UnGoro_Crater.lua @@ -1,7 +1,7 @@ -TourGuide:RegisterGuide("Un'Goro Crater (51-52)", nil, "Alliance", function() +TourGuide:RegisterGuide("Un'Goro Crater (51-52)", "Azshara (52-53)", "Alliance", function() return [[ -R Un'Goro Crater |N|Southewest corner of the zone (26,52)| +R Un'Goro Crater |N|Southewest corner of the zone (26,52)| |Z|Tanaris| N Look for loot... |N|There are many loot nodes scattered across this zone. You'll need 7 of each color of power crystal. Also loot any dirt piles or sprouts you find.| A The Apes of Un'Goro |N|From a tauren at the bottom of the ramp entering the zone (71.69, 75.97)| @@ -10,7 +10,7 @@ A The Fare of Lar'korwi |N|From a tauren at the bottom of the ramp entering the A It's a Secret to Everybody (Part 1) |N|Find the wrecked raft (63.04, 68.54)| T It's a Secret to Everybody (Part 1) |N|Just underwater nearby| A It's a Secret to Everybody (Part 2) -C The Fare of Lar'korwi |N|Find the Threshadon Carcass (68.8,56.7) amongst the raptors.| +C The Fare of Lar'korwi |N|Find the Threshadon Carcass (68.8, 56.7) amongst the raptors.| T The Fare of Lar'korwi A The Scent of Lar'korwi @@ -19,7 +19,7 @@ T The Scent of Lar'korwi A The Bait for Lar'korwi G Grind on raptors |N|Until you find [A Mangled Journal]| |L|11116| A Williden's Journal |U|11116| -C The Bait for Lar'korwi |N|Use the meat and mixture at the flat rock behind the east pylon (79.9,49.9)| |U|11568| +C The Bait for Lar'korwi |N|Use the meat and mixture at the flat rock behind the east pylon (79.9, 49.9)| |U|11568| N Find 7 Red power crystals |L|11186 7| N Find 7 Yellow power crystals |L|11188 7| @@ -50,13 +50,13 @@ C The Northern Pylon |N|Along the north edge of the zone to the east (56,12). K T Chasing A-Me 01 |N|East in the gorilla cave (63,17). Skip the follow-up.| C The Apes of Un'Goro C Super Sticky |N|At the tarpits in the north half of the zone| -N Find [Crate of Foodstuffs] |N|At the abandoned camp in the east side of the zone (68.5, 36.6)| |L|11113| +N Find [Crate of Foodstuffs] |N|At the abandoned camp in the east side of the zone (68.52, 36.59)| |L|11113| C Shizzle's Flyer |N|Kill them dinos!| C The Eastern Pylon |N|To the east, of course (76,51)| T The Bait for Lar'korwi T The Apes of Un'Goro |N|Skip the follow-up| -C Alien Ecology |N|Down in the Slithering Scar (50,77). Head left inside to the big room, use the vial| |U|11132| +C Alien Ecology |N|Down in the Slithering Scar (50,77). Head left inside to the big room (48.62, 85.33), use the vial| |U|11132| N Kill bugs for [Gorishi Scent Gland] |L|11837| C Expedition Salvation |N|At the other camp (38.5, 66.0)| C The Western Pylon |N|(23,59)| @@ -72,9 +72,9 @@ T Finding the Source A The New Springs T Lost! |N|In a cave (51,49)| -A A Little Help From My Friends -C A Little Help From My Friends |N|Use the canteen on him if he faints. Run back to Marshal's Refuge.| |U|11804| -T A Little Help From My Friends +A A Little Help From My Friends |NODEBUG| +C A Little Help From My Friends |NODEBUG| |N|Use the canteen on him if he faints. Run back to Marshal's Refuge.| |U|11804| +T A Little Help From My Friends |NODEBUG| T Beware of Pterrordax T Shizzle's Flyer T Muigin and Larion |N|Skip the follow-up| diff --git a/Alliance/51_Kalimdor.lua b/Alliance/51_Kalimdor.lua index f997d80..09e82ca 100644 --- a/Alliance/51_Kalimdor.lua +++ b/Alliance/51_Kalimdor.lua @@ -11,13 +11,13 @@ F Darnassus |N|You probably want to hearth to IF| T Prayer to Elune (Part 2) |N|Upstairs in the Temple of the Moon| T Rise of the Silithid A March of the Silithid -T Assisting Arch Druid Staghelm |N|In a tower in the Cenarion Enclave (34.8, 8.7)| +T Assisting Arch Druid Staghelm |N|In a tower in the Cenarion Enclave (34.8, 8.7)| |Z|Darnassus| A Un'Goro Soil -h Darnassus |N|The inn is in the Craftsman's Terrace (67.2,15.7) +h Darnassus |N|The inn is in the Craftsman's Terrace (67.2, 15.7)| |Z|Darnassus| F Theramore -C Ledger from Tanaris |N|Find the package in the wreckage of a zepplin (54.1,55.9)| -T Cortello's Riddle (Part 2) |N|Find a Musty Scroll in a cave to the southwest (31.1,66.1)| +C Ledger from Tanaris |N|Find the package in the wreckage of a zepplin (54.1, 55.9)| |Z|Dustwallow Marsh| +T Cortello's Riddle (Part 2) |N|Find a Musty Scroll in a cave to the southwest (31.1, 66.1)| |Z|Dustwallow Marsh| A Cortello's Riddle (Part 3) F Gadgetzan |N|Deathport to Theramore if you must| @@ -36,7 +36,7 @@ T March of the Silithid A Bungle in the Jungle T Ledger from Tanaris -T The Stone Circle |N|South of Gadget at the ruins (52.7,45.9). Skip the follow-up.| +T The Stone Circle |N|South of Gadget at the ruins (52.7, 45.9). Skip the follow-up.| |Z|Tanaris| ]] end) diff --git a/Alliance/52_53_Azshara.lua b/Alliance/52_53_Azshara.lua new file mode 100644 index 0000000..748a2bc --- /dev/null +++ b/Alliance/52_53_Azshara.lua @@ -0,0 +1,44 @@ + +TourGuide:RegisterGuide("Azshara (52-53)", nil, "Alliance", function() +return [[ +F Azshara |N|Fly to Forest Song or Astranaar and run east if you don't have the FP| + +f Grab the flight point |N|(11,77)| +A Spiritual Unrest +A A Land Filled With Hatred + +C Spiritual Unrest |N|Kill ghosts to the north (14,72)| +C A Land Filled With Hatred |N|Further north (19,61)| + +T Spiritual Unrest +T A Land Filled With Hatred + +N Get Markri Rubbing |N|(39,55)| |L|10565| +N Get Beth’Amara Rubbing |N|(36,53)| |L|10563| +N Get Jin’yael Rubbing |N|(39,50)| |L|10564| + +T The Hunter's Charm |C|Hunter| |N|(42,42)| +A Courser Antlers |C|Hunter| +A Kim'jael Indeed |N|(53,18)| +C Kim'jael Indeed |N|To the south (56,29)| +T Kim'jael Indeed +A Kim’jael’s “Missing” Equipment +C Kim'jael's "Missing" Equipment |N|Kill naga in the ruins (37,52)| +T Kim'jael's "Missing" Equipment + +C Courser Antlers |C|Hunter| +T Courser Antlers |C|Hunter| |N|(42,42)| +A Wavethrashing +C Wavethrashing |N|Down in teh water, of course (87,26)| |C|Hunter| +T Wavethrashing |N|Skip the next part if you don't plan on doing Sunken Temple| + +C Arcane Runes |N|Get Sael'hai Rubbing (42,64)| +T Arcane Runes |N|Use your flare gun at the helipad in the far southeastern edge of the zone (77,91)| +A Return to Tymor + +H Darnassus +T Morrowgrain Research (Part 2) |N|Save 10 soil for later| +]] + +end) + diff --git a/Mapping.lua b/Mapping.lua new file mode 100644 index 0000000..32a1edd --- /dev/null +++ b/Mapping.lua @@ -0,0 +1,31 @@ + + +local zonei, zonec = {}, {} +for ci,c in pairs{GetMapContinents()} do + for zi,z in pairs{GetMapZones(ci)} do + zonei[z], zonec[z] = zi, ci + end +end + + +local function MapPoint(zone, x, y, desc) + local zi, zc = zone and zonei[zone], zone and zonec[zone] + if not zi then + if zone then TourGuide:PrintF("Cannot find zone %q, using current zone.", zone) + else TourGuide:Print("No zone provided, using current zone.") end + + zi, zc = GetCurrentMapZone(), GetCurrentMapContinent() + end + + if TomTom then TomTom:AddZWaypoint(zc, zi, x, y, desc) --AddZWaypoint(c,z,x,y,desc) select(z, GetMapZones(c)) + elseif Cartographer_Waypoints then Cartographer_Waypoints:AddLHWaypoint(zc, zi, x, y, desc) end -- continent, zone, x, y desc +end + + +function TourGuide:ParseAndMapCoords(note, desc, zone) + for x,y in note:gmatch("%(([%d.]+),%s?([%d.]+)%)") do MapPoint(zone, tonumber(x), tonumber(y), desc) end +end + + +--~ TODO: function TourGuide:PurgeWaypoints(desc) +--~ end diff --git a/StatusFrame.lua b/StatusFrame.lua index 6cc58f4..1adac2f 100644 --- a/StatusFrame.lua +++ b/StatusFrame.lua @@ -174,15 +174,12 @@ function TourGuide:UpdateStatusFrame() local action, quest, fullquest = self:GetObjectiveInfo(nextstep) local turnedin, logi, complete = self:GetObjectiveStatus(nextstep) local note, useitem, optional = self:GetObjectiveTag("N", nextstep), self:GetObjectiveTag("U", nextstep), self:GetObjectiveTag("O", nextstep) + local zonename = self:GetObjectiveTag("Z", nextstep) or self.zonename - - -- TomTom coord mapping + -- Mapping if note and (TomTom or Cartographer_Waypoints) and not mapped[action..quest] then mapped[action..quest] = true - for x,y in note:gmatch("%(([%d.]+),%s?([%d.]+)%)") do - if TomTom then TomTom:AddWaypoint(tonumber(x), tonumber(y), quest) - elseif Cartographer_Waypoints then Cartographer_Waypoints:AddLHWaypoint(nil, nil, tonumber(x), tonumber(y), quest) end - end + self:ParseAndMapCoords(note, quest, zonename) --, zone) end diff --git a/TourGuide.lua b/TourGuide.lua index 0b71f64..e0106eb 100644 --- a/TourGuide.lua +++ b/TourGuide.lua @@ -87,17 +87,6 @@ function TourGuide:RegisterGuide(name, nextzone, faction, sequencefunc) end -function TourGuide:LoadGuide(name) - if not name then return end - - self.db.char.currentguide = name - if not self.guides[name] then self.db.char.currentguide = self.guidelist[1] end - self:DebugF(1, "Loading guide: %s", name) - self.guidechanged = true - self:ParseObjectives(self.guides[self.db.char.currentguide]()) -end - - function TourGuide:LoadNextGuide() local name = self.nextzones[self.db.char.currentguide] if not name then return end @@ -160,6 +149,7 @@ function TourGuide:GetObjectiveTag(tag, i) elseif tag == "N" then return self.notes[i] elseif tag == "U" then return self.useitems[i] elseif tag == "O" then return self.optional[i] + elseif tag == "Z" then return self.zones[i] elseif tag == "L" then local _, _, lootitem, lootqty = string.find(self.lootitems[i] or "", "(%d+)%s?(%d*)") lootqty = tonumber(lootqty) or 1 @@ -174,7 +164,7 @@ local titlematches = {"For", "A", "The", "Or", "In", "Then", "From", "To"} local function ParseQuests(...) local accepts, turnins, completes = {}, {}, {} local uniqueid = 1 - local actions, notes, quests, useitems, optionals, lootitems, levels = {}, {}, {}, {}, {}, {}, {} + local actions, notes, quests, useitems, optionals, lootitems, levels, zones = {}, {}, {}, {}, {}, {}, {}, {} local i, haserrors = 1, false for j=1,select("#", ...) do @@ -201,6 +191,9 @@ local function ParseQuests(...) local _, _, useitem = string.find(text, "|U|(%d+)|") if useitem then useitems[i] = useitem end + local _, _, zone = string.find(text, "|Z|([^|]+)|") + if zone then zones[i] = zone end + local _, _, lootitem = string.find(text, "|L|(%d+%s?%d*)|") if lootitem then lootitems[i] = lootitem end @@ -209,30 +202,32 @@ local function ParseQuests(...) i = i + 1 -- Debuggery - if action == "A" then accepts[quest] = true - elseif action == "T" then turnins[quest] = true - elseif action == "C" then completes[quest] = true end - - if action == "A" or action == "C" or action == "T" then - -- Catch bad Title Case - for _,word in pairs(titlematches) do - if quest:find("[^:]%s"..word.."%s") or quest:find("[^:]%s"..word.."$") or quest:find("[^:]%s"..word.."@") then - TourGuide:DebugF(1, "%s %s -- Contains bad title case", action, quest) + if not string.find(text, "|NODEBUG|") then + if action == "A" then accepts[quest] = true + elseif action == "T" then turnins[quest] = true + elseif action == "C" then completes[quest] = true end + + if action == "A" or action == "C" or action == "T" then + -- Catch bad Title Case + for _,word in pairs(titlematches) do + if quest:find("[^:]%s"..word.."%s") or quest:find("[^:]%s"..word.."$") or quest:find("[^:]%s"..word.."@") then + TourGuide:DebugF(1, "%s %s -- Contains bad title case", action, quest) + haserrors = true + end + end + + if quest:find("[“”’]") then + TourGuide:DebugF(1, "%s %s -- Contains bad char", action, quest) haserrors = true end end - if quest:find("[“”’]") then - TourGuide:DebugF(1, "%s %s -- Contains bad char", action, quest) + local _, _, comment = string.find(text, "(|[NLUC]V?|[^|]+)$") or string.find(text, "(|[NLUC]V?|[^|]+) |[NLUC]V?|") + if comment then + TourGuide:Debug(1, "Unclosed comment: ".. comment) haserrors = true end end - - local _, _, comment = string.find(text, "(|[NLUC]V?|[^|]+)$") or string.find(text, "(|[NLUC]V?|[^|]+) |[NLUC]V?|") - if comment then - TourGuide:Debug(1, "Unclosed comment: ".. comment) - haserrors = true - end end end @@ -243,12 +238,20 @@ local function ParseQuests(...) if haserrors and TourGuide:IsDebugEnabled() then TourGuide:Print("This guide contains errors") end - return actions, notes, quests, useitems, optionals, lootitems, levels + return actions, notes, quests, useitems, optionals, lootitems, levels, zones end -function TourGuide:ParseObjectives(text) - self.actions, self.notes, self.quests, self.useitems, self.optional, self.lootitems, self.levels = ParseQuests(string.split("\n", text)) +function TourGuide:LoadGuide(name) + if not name then return end + + self.db.char.currentguide = name + if not self.guides[name] then self.db.char.currentguide = self.guidelist[1] end + self:DebugF(1, "Loading guide: %s", name) + self.guidechanged = true + local _, _, zonename = name:find("^(.*) %(.*%)$") + self.zonename = zonename + self.actions, self.notes, self.quests, self.useitems, self.optional, self.lootitems, self.levels, self.zones = ParseQuests(string.split("\n", self.guides[self.db.char.currentguide]())) end diff --git a/TourGuide.toc b/TourGuide.toc index 1e28df7..e49e51d 100644 --- a/TourGuide.toc +++ b/TourGuide.toc @@ -20,6 +20,7 @@ OptionHouse.lua WidgetWarlock.lua TourGuide.lua +Mapping.lua StatusFrame.lua OHFrame.lua OHGuides.lua @@ -52,6 +53,7 @@ Alliance\49_50_Blasted_Lands.lua Alliance\50_51_Searing_Gorge.lua Alliance\51_Kalimdor.lua Alliance\51_52_UnGoro_Crater.lua +Alliance\52_53_Azshara.lua Alliance\66_67_BladesEdge.lua Alliance\67_70_Netherstorm.lua -- 2.11.4.GIT