Oops, I did it all in the wrong file.
Cette révision appartient à :
Parent
89f5743b84
révision
af7b77aecc
|
@ -71,43 +71,160 @@ end
|
|||
|
||||
local msfires = {desc = QHText("FIND_CUSTOM_LOCATION"), tracker_desc = QHText("FIND_CUSTOM_LOCATION")}
|
||||
|
||||
local function QH_FindLoc(locd)
|
||||
-- I just know some guy's gonna get pissed off because he was trying to find "loc crocolisk" or something, but screw him
|
||||
local locx, locy, locz
|
||||
|
||||
locx, locy = locd:match("^(%d+) (%d+)$")
|
||||
if locx and locy then
|
||||
locx, locy = tonumber(locx), tonumber(locy)
|
||||
locz = QuestHelper_NameLookup[QuestHelper_IndexLookup[QuestHelper.routing_c][QuestHelper.routing_z]]
|
||||
end
|
||||
|
||||
if not locx then
|
||||
locz, locx, locy = locd:match("^(.+) (%d+) (%d+)$")
|
||||
locx, locy = tonumber(locx), tonumber(locy)
|
||||
end
|
||||
|
||||
if locz then
|
||||
for z, nam in pairs(QuestHelper_NameLookup) do
|
||||
if nam:lower():find(locz:lower()) then
|
||||
locz = z
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if type(locz) == "number" then
|
||||
local ec, ez = unpack(QuestHelper_ZoneLookup[locz])
|
||||
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(ec, ez, locx / 100, locy / 100)
|
||||
local node = {loc = {x = x, y = y, p = locz, c = QuestHelper_ParentLookup[locz]}, why = msfires, map_desc = {QHText("FIND_CUSTOM_LOCATION")}, tracker_desc = QHText("FIND_CUSTOM_LOCATION"), tracker_hidden = true}
|
||||
local cluster = {node}
|
||||
node.cluster = cluster
|
||||
|
||||
node.map_suppress_ignore = true
|
||||
node.map_custom_menu = function (menu) QuestHelper:CreateMenuItem(menu, QHText("FIND_REMOVE")):SetFunction(function () QH_Route_ClusterRemove(cluster) end) end
|
||||
|
||||
QH_Route_ClusterAdd(cluster)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local elders = {
|
||||
["Alliance"] = {
|
||||
["Bladeswift"] = "Darnassus 39 32",
|
||||
["Bronzebeard"] = "Ironforge 29 16",
|
||||
["Hammershout"] = "Elwynn Forest 34 50"
|
||||
},
|
||||
["Horde"] = {
|
||||
["Darkhorn"] = "Orgrimmar 52 60",
|
||||
["Wheathoof"] = "Thunder Bluff 72 33",
|
||||
["Darkcore"] = "Undercity 67 38"
|
||||
},
|
||||
["Kalimdor"] = {
|
||||
["Riversong"] = "Ashenvale 35 48",
|
||||
["Skygleam"] = "Azshara 64 79",
|
||||
["High Mountain"] = "Southern Barrens 41 47", -- 41.5 47.5
|
||||
["Moonwarden"] = "Northern Barrens 48 59", -- 48.5 59.2
|
||||
["Windtotem"] = "Northern Barrens 68 69",
|
||||
["Starweave"] = "Darkshore 49 19", -- 49.5 19.0
|
||||
["Runetotem"] = "Durotar 54 44",
|
||||
["Nightwind"] = "Felwood 37 52",
|
||||
["Grimtotem"] = "Feralas 76 37",
|
||||
["Mistwalker"] = "Feralas 62 31",
|
||||
["Bloodhoof"] = "Mulgore 48 53",
|
||||
["Bladesing"] = "Silithus 53 35",
|
||||
["Primestone"] = "Silithus 30 13", -- 30.7 13.3
|
||||
["Dreamseer"] = "Tanaris 50 28",
|
||||
["Ragetotem"] = "Tanaris 36 80",
|
||||
["Bladeleaf"] = "Teldrassil 57 53",
|
||||
["Skyseer"] = "Thousand Needles 45 50",
|
||||
["Morningdew"] = "Thousand Needles 77 75", -- 77.0 75.6
|
||||
["Thunderhorn"] = "Un'Goro Crater 51 75",
|
||||
["Brightspear"] = "Winterspring 53 56", -- 53.0 56.7
|
||||
["Stonespire"] = "Winterspring 60 50", -- 60.0 50.0
|
||||
},
|
||||
["Eastern Kingdoms"] = {
|
||||
["Bellowrage"] = "Blasted Lands 54 49",
|
||||
["Rumblerock"] = "Burning Steppes 70 45",
|
||||
["Dawnstrider"] = "Burning Steppes 53 24",
|
||||
["Goldwell"] = "Dun Morogh 53 49",
|
||||
["Windrun"] = "Eastern Plaguelands 35 68",
|
||||
["Snowcrown"] = "Eastern Plaguelands 75 54",
|
||||
["Stormbrow"] = "Elwynn Forest 40 63",
|
||||
["Highpeak"] = "Hinterlands 50 48",
|
||||
["Silvervein"] = "Loch Modan 33 46",
|
||||
["Ironband"] = "Searing Gorge 21 79",
|
||||
["Obsidian"] = "Silverpine Forest 45 41",
|
||||
["Starglade"] = "Stranglethorn Vale 63 22", -- Jungle 71 34
|
||||
["Winterhoof"] = "Stranglethorn Vale 37 79", -- Cape 39 72
|
||||
["Graveborn"] = "Tirisfal Glades 61 53",
|
||||
["Moonstrike"] = "Western Plaguelands 69 73",
|
||||
["Meadowrun"] = "Western Plaguelands 63 36",
|
||||
["Skychaser"] = "Westfall 56 47"
|
||||
},
|
||||
["Northrend"] = {
|
||||
["Arp"] = "Borean Tundra 57 44",
|
||||
["Northal"] = "Borean Tundra 34 34",
|
||||
["Pamuya"] = "Borean Tundra 43 50",
|
||||
["Sardis"] = "Borean Tundra 59 66",
|
||||
["Morthie"] = "Dragonblight 30 56",
|
||||
["Skywarden"] = "Dragonblight 35 48",
|
||||
["Thoim"] = "Dragonblight 49 78",
|
||||
["Beldak"] = "Grizzly Hills 61 28",
|
||||
["Lunaro"] = "Grizzly Hills 81 37",
|
||||
["Whurain"] = "Grizzly Hills 64 47",
|
||||
["Bluewolf"] = "Lake Wintergrasp 49 14",
|
||||
["Sandrene"] = "Sholazar Basin 50 64",
|
||||
["Wanikaya"] = "Sholazar Basin 64 49",
|
||||
["Fargal"] = "Storm Peaks 29 74",
|
||||
["Graymane"] = "Storm Peaks 41 85",
|
||||
["Muraco"] = "Storm Peaks 64 51",
|
||||
["Stonebeard"] = "Storm Peaks 31 38",
|
||||
["Tauros"] = "Zul'Drak 59 56"
|
||||
}
|
||||
}
|
||||
|
||||
local function QH_FindElders(elder_or_achievement, all_elders)
|
||||
local achievement_match, elder_match = false, false
|
||||
for achievement, eldrs in pairs(elders) do
|
||||
if not all_elders then
|
||||
if elder_or_achievement == string.upper(achievement) then achievement_match = true end
|
||||
end
|
||||
|
||||
for elder, elder_loc in pairs(eldrs) do
|
||||
if not all_elders then
|
||||
if achievement_match then -- just add it
|
||||
QH_FindLoc(string.upper(elder_loc))
|
||||
elseif elder_or_achievement == string.upper(elder) then -- We have input and it's not an achievement, so it must be an elder.
|
||||
elder_match = true
|
||||
QH_FindLoc(string.upper(elder_loc))
|
||||
break -- We've found him or her.
|
||||
end -- No need for else here. We alread know we don't need everything so we either have an achievement or we have an elder.
|
||||
else -- We came in without an input, therefore we add all.
|
||||
QH_FindLoc(string.upper(elder_loc))
|
||||
end
|
||||
end
|
||||
|
||||
if achievement_match or elder_match then break end -- We've done our match.
|
||||
end
|
||||
end
|
||||
|
||||
function QH_FindName(name)
|
||||
local locd = name:match("^loc (.+)")
|
||||
local elder_loc
|
||||
|
||||
if not locd then
|
||||
if name:find("^elders?") then
|
||||
elder_loc = name:match("elders? (.+)")
|
||||
if not elder_loc then elder_loc = true end
|
||||
end
|
||||
end
|
||||
|
||||
if locd then
|
||||
-- I just know some guy's gonna get pissed off because he was trying to find "loc crocolisk" or something, but screw him
|
||||
local locx, locy, locz
|
||||
|
||||
locx, locy = locd:match("^(%d+) (%d+)$")
|
||||
if locx and locy then
|
||||
locx, locy = tonumber(locx), tonumber(locy)
|
||||
locz = QuestHelper_NameLookup[QuestHelper_IndexLookup[QuestHelper.routing_c][QuestHelper.routing_z]]
|
||||
end
|
||||
|
||||
if not locx then
|
||||
locz, locx, locy = locd:match("^(.+) (%d+) (%d+)$")
|
||||
locx, locy = tonumber(locx), tonumber(locy)
|
||||
end
|
||||
|
||||
if locz then
|
||||
for z, nam in pairs(QuestHelper_NameLookup) do
|
||||
if nam:lower():find(locz:lower()) then
|
||||
locz = z
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if type(locz) == "number" then
|
||||
local ec, ez = unpack(QuestHelper_ZoneLookup[locz])
|
||||
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(ec, ez, locx / 100, locy / 100)
|
||||
local node = {loc = {x = x, y = y, p = locz, c = QuestHelper_ParentLookup[locz]}, why = msfires, map_desc = {QHText("FIND_CUSTOM_LOCATION")}, tracker_desc = QHText("FIND_CUSTOM_LOCATION"), tracker_hidden = true}
|
||||
local cluster = {node}
|
||||
node.cluster = cluster
|
||||
|
||||
node.map_suppress_ignore = true
|
||||
node.map_custom_menu = function (menu) QuestHelper:CreateMenuItem(menu, QHText("FIND_REMOVE")):SetFunction(function () QH_Route_ClusterRemove(cluster) end) end
|
||||
|
||||
QH_Route_ClusterAdd(cluster)
|
||||
end
|
||||
QH_FindLoc(locd)
|
||||
elseif elder_loc then
|
||||
if elder_loc == true then QH_FindElders(nil, true)
|
||||
else QH_FindElders(elder_loc)
|
||||
end
|
||||
else
|
||||
if not DB_Ready() then
|
||||
|
|
Référencer dans un nouveau ticket