1
0
Bifurcation 0

A bunch of changes dealing with the replacement of Astrolabe.lua.

Cette révision appartient à :
Nathanial.C.Jones 2013-01-04 01:03:20 +00:00
Parent 302d44b8ac
révision cea96d1c2b
8 fichiers modifiés avec 823 ajouts et 855 suppressions

Voir le fichier

@ -17,14 +17,14 @@ local function getitall(name)
segments[dbi] = true
end
end
local segwork = {}
for k in pairs(segments) do
table.insert(segwork, {k, 1, k[1]})
end
local found = {}
while true do
local lowest = segwork[1][3]
local highest = segwork[1][3]
@ -41,7 +41,7 @@ local function getitall(name)
highest = v
end
end
if lowest == highest then
table.insert(found, lowest)
segwork[1][2] = segwork[1][2] + 1
@ -54,10 +54,10 @@ local function getitall(name)
segwork[lid][3] = segwork[lid][3] + segwork[lid][1][segwork[lid][2]]
end
end
if not segwork[lid][1][segwork[lid][2]] then break end
end
return found
end
@ -73,7 +73,7 @@ local function generate_objective(dbi)
QuestHelper: Assert(QuestHelper_ParentLookup[v.p], v.p)
table.insert(clooster, {loc = {x = v.x, y = v.y, c = QuestHelper_ParentLookup[v.p], p = v.p}, cluster = clooster, tracker_hidden = true, why = why, map_desc = {QuestHelper:HighlightText(dbi.name)}, tracker_desc = dbi.name, map_suppress_ignore = true, map_custom_menu = function (menu) QuestHelper:CreateMenuItem(menu, QHText("FIND_REMOVE")):SetFunction(function () QH_Route_ClusterRemove(clooster) end) end})
end
QH_Route_ClusterAdd(clooster)
custom_find[dbi.name] = clooster
else
@ -84,29 +84,30 @@ end
local msfires = {desc = QHText("FIND_CUSTOM_LOCATION"), tracker_desc = QHText("FIND_CUSTOM_LOCATION")}
local function QH_FindCoord(locx, locy, locz, label)
if type(locz) ~= "number" then -- If it is a number, we are probably doing an elder right now.
label = locz .. " (" .. locx .. ", " .. locy .. ")"
local function QH_FindCoord(locx, locy, locm, locf, label)
-- Note: this part will not work until something is done about QuestHelper_NameLookup
if type(locm) ~= "number" then -- If it is a number, we are probably doing an elder right now.
label = locm .. " (" .. locx .. ", " .. locy .. ")"
for z, nam in pairs(QuestHelper_NameLookup) do
if nam:lower():find(locz:lower()) then
locz = z
if nam:lower():find(locm:lower()) then
locm = z
break
end
end
end
if type(locz) == "number" then
if not custom_find[label] 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 = {desc = label, tracker_desc = label}, map_desc = {label}, tracker_desc = label, tracker_hidden = true}
if type(locm) == "number" then
if not custom_find[label] then
local em, ef = locm, locf
local x, y = locx / 100, locy / 100
local node = {loc = {x = x, y = y, m = em, f = ef}, why = {desc = label, tracker_desc = label}, map_desc = {label}, tracker_desc = label, tracker_hidden = true}
local cluster = {node}
node.cluster = cluster
custom_find[label] = cluster
custom_find[label] = cluster
node.map_suppress_ignore = true
node.map_custom_menu = function (menu) QuestHelper:CreateMenuItem(menu, QHText("FIND_REMOVE")):SetFunction(function () QH_Route_ClusterRemove(cluster); custom_find[cluster.tracker_desc] = nil end) end
QH_Route_ClusterAdd(cluster)
else
QH_Route_ClusterRemove(custom_find[label])
@ -118,18 +119,18 @@ end
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
QH_FindCoord(locx, locy, locz, QHText("FIND_CUSTOM_LOCATION"))
end
@ -144,7 +145,7 @@ local elders = {
["Horde"] = { -- Achievement 914
["Darkhorn"] = {321, 52, 60, 8677, 1991}, --"Orgrimmar 52 60",
["Wheathoof"] = {362, 73.0, 23.3, 8678, 1993}, --"Thunder Bluff 73.0 23.3",
["Darkcore"] = {382, 67, 38, 8648, 1992}, --"Undercity 67 38"
["Darkcore"] = {382, 67, 38, 8648, 1992}, --"Undercity 67 38" -- Might have a floor.
},
["Kalimdor"] = { -- Achievement 911
["Bladeleaf"] = { 41, 56.8, 53.1, 8715, 1951}, --"Teldrassil 56.8 53.1",
@ -219,6 +220,8 @@ local elders = {
["Firebeard"] = {700, 51, 71, 29737, 18161}, -- Dunward Town Square, Dunward Ruins, Twilight Highlands
["Darkfeather"] = {700, 52, 33, 29736, 18162} -- Thundermar Ruins, Twilight Highlands
},
["Pandaria"] = { -- Unknown atm.
},
--[===[ Placeholder for Elders of the Dungeons. If enabled prior to 2013, stored coordinates should be the map ID of the zone where the instance is located and the coordinates of the entrance. With any luck, by 2013 dungeons will be mapable. Coordinates listed in comment after each elder need to have floor numbers determined, where necessary, ASAP.
["Dungeons"] = { -- Achievement 910
["Wildmane"] = {,,,8676, 1910}, -- Zul'Farrak 34.52 39.35
@ -244,9 +247,9 @@ local function UpdateElders()
local elder, elderinfo
local qid = GetQuestID()
for elder, elderinfo in pairs(trackedElders) do
local z, x, y, id = unpack(elderinfo)
local m, x, y, id = unpack(elderinfo)
if id == qid then
QH_FindCoord(x, y, z, elder)
QH_FindCoord(x, y, m, 0, elder)
trackedElders[elder] = nil
return
end
@ -259,7 +262,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
if elder_or_achievement == "CLEAR" then
for elder, elderinfo in pairs(trackedElders) do
local z, x, y = unpack(elderinfo)
QH_FindCoord(x, y, z, elder)
QH_FindCoord(x, y, m, 0, elder)
end
trackedElders = {}
@ -276,41 +279,41 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
end
for elder, elder_info in pairs(eldrs) do
local locz, locx, locy, qid, aid = unpack(elder_info)
local locm, locx, locy, qid, aid = unpack(elder_info)
local okToAdd = true
if forAchievement then
if aid then
local _, _, completed = GetAchievementCriteriaInfo(aid)
if completed then okToAdd = false end
end
if aid then
local _, _, completed = GetAchievementCriteriaInfo(aid)
if completed then okToAdd = false end
end
elseif qid and QHQuestsCompleted and QHQuestsCompleted[qid] then
okToAdd = false
end
if okToAdd then
if not all_elders then
if not all_elders then
if achievement_match then -- just add it
QH_FindCoord(locx, locy, locz, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
elseif elder_or_achievement == string.upper(elder) then -- We have input and it's not an achievement, so it must be an elder.
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
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_FindCoord(locx, locy, locz, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
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_FindCoord(locx, locy, locz, elder)
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
@ -327,10 +330,10 @@ end
function QH_FindName(name)
local locd = name:match("^loc (.+)")
local forAchievement = false, elder_loc, temp
if not locd then
if name:find("^elders?") then
if name:find("^elders? achievement") then
if name:find("^elders? achievement") then
forAchievement = true
elder_loc = name:match("elders? achievement (.+)")
else
@ -350,52 +353,52 @@ function QH_FindName(name)
QuestHelper:TextOut(QHText("FIND_NOT_READY"))
return
end
if #name < 2 then
QuestHelper:TextOut(QHText("FIND_USAGE"))
return
end
local found = getitall(name)
local mennix = QuestHelper:CreateMenu()
QuestHelper:CreateMenuTitle(mennix, QHText("RESULTS_TITLE"))
local made_item = false
local found_db = {}
local has_name = {}
local needs_postfix = {}
for _, v in ipairs(found) do
local dbi = DB_GetItem("monster", v)
--[[ assert(dbi) ]]
if dbi.loc then
table.insert(found_db, dbi)
if has_name[dbi.name] then needs_postfix[dbi.name] = true end
has_name[dbi.name] = true
end
end
table.sort(found_db, function (a, b) return a.name < b.name end)
for _, v in ipairs(found_db) do
made_item = true
local name = v.name
if needs_postfix[name] then name = name .. " (" .. QuestHelper_NameLookup[v.loc[1].p] .. ")" end
local opt = QuestHelper:CreateMenuItem(mennix, name)
opt:SetFunction(generate_objective, v)
end
if not made_item then
QuestHelper:CreateMenuItem(mennix, QHText("NO_RESULTS"))
end
mennix:ShowAtCursor()
end
end
@ -407,5 +410,5 @@ end
QH_API.ARCHY_REMOVE = function (displayText)
if not custom_find[displayText] then return end
QH_Route_ClusterRemove(custom_find[displayText])
custom_find[displayText] = nil
custom_find[displayText] = nil
end

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -50,7 +50,7 @@ local poll_first = true
QH_Event("QUEST_QUERY_COMPLETE", function ()
quests = GetQuestsCompleted() -- entertainingly, we actually want exactly the output of this. How convenient! Blizzard does things right <3 forever
notify()
end)
@ -85,16 +85,16 @@ local waypoint_zone
function rescan()
if not waypoint_zone then return end
if not QuestHelper.Astrolabe.WorldMapVisible then return end
QH_POI_Reset()
if not completed_active then return end
local questlist = DB_GetItem("questlist", waypoint_zone, true)
if not questlist then return end
local donequests = QH_GetCompletedTable()
for _, v in ipairs(questlist) do
if donequests[v] then
--print("Done:", v)
@ -110,13 +110,13 @@ function rescan()
end
QH_AddCompletionNotifier(rescan)
QH_Event("WORLD_MAP_UPDATE", function ()
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
QH_Event("WORLD_MAP_UPDATE", function () -- NOTE: WILL NOT WORK UNTIL UPGRADE.LUA IS FIXED
local m, f = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
--print(c, z)
if not QuestHelper_IndexLookup[c] or not QuestHelper_IndexLookup[c][z] then return end
QuestHelper: Assert(QuestHelper_IndexLookup[c])
QuestHelper: Assert(QuestHelper_IndexLookup[c][z])
waypoint_zone = QuestHelper_IndexLookup[c][z]
rescan()
end)

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -16,11 +16,11 @@ QuestHelper_Loadtime["pathfinding.lua"] = GetTime()
-- So make one general setting for the 10 seconds plus 5 for the world to load
-- local porttime = 15
QueryQuestsCompleted();
local dependancy_quest_list = GetQuestsCompleted()
local static_alliance_landings =
local static_alliance_landings =
{
{471, 0.476, 0.598, "Exodar via portal"}, -- Exodar
{381, 0.435, 0.787, "Darnassus via portal"}, -- Darnassus
@ -28,7 +28,7 @@ local static_alliance_landings =
{341, 0.255, 0.084, "Ironforge via portal"}, -- Ironforge
{141, 0.660, 0.490, "Theramore via portal"}, -- Theramore, Dustwallow Marsh
}
local static_horde_landings =
{
{321, 0.483, 0.645, "Orgrimmar via portal"}, -- Orgrimmar
@ -37,7 +37,7 @@ local static_horde_landings =
{480, 0.583, 0.192, "Silvermoon City via portal"}, -- Silvermoon City
{38, 0.498, 0.558, "Stonard via portal"}, -- Stonard, Swamp of Sorrows
}
local static_shared_landings =
{
{504, 0.559, 0.468, "Dalaran via portal"}, -- Dalaran
@ -55,7 +55,7 @@ end
-- More storage
-- Contingent on player's faction controlling the zone
-- Contingent on player's faction controlling the zone
-- {{501, 0.491, 0.153}, {504, 0.268, 0.447}, 5, true}, -- Wingergrasp Keep --> Dalaran
-- {{708, 0.472, 0.519}, ORGRIMMAR_CATPORTAL_IN, 60, true}, -- Tol Barad --> Orgrimmar (If Horde Controlled)
-- {{708, 0.472, 0.519}, STORMWIND_CATPORTAL_IN, 60, true}, -- Tol Barad --> Stormwind (If Alliance Controlled)
@ -67,7 +67,7 @@ local BLASTED_LANDS_PORTAL_IN = {19, 0.539, 0.461, "Blasted Lands via portal"}
local ORGRIMMAR_CATPORTAL_IN = {321, 0.500, 0.377, "Orgrimmar via portal"}
-- local STORMWIND_CATPORTAL_IN
local static_horde_routes =
local static_horde_routes =
{
-- Portals
{{321, 0.471, 0.618}, BLASTED_LANDS_PORTAL_IN, 60, true, level_limit = 58}, -- Orgrimmar --> Dark Portal
@ -81,10 +81,10 @@ local static_horde_routes =
{{465, 0.886, 0.477}, {321, 0.483, 0.645}, 60, true}, -- Hellfire Peninsula --> Orgrimmar
{{700, 0.736, 0.535}, ORGRIMMAR_CATPORTAL_IN, 60, true}, -- Twilight Highlands --> Orgrimmar
{{321, 0.475, 0.392}, {709, 0.560, 0.799}, 60, false, level_limit = 85}, -- Orgrimmar <--> Tol Barad Peninsula
-- Okay, I give. Since I haven't actually been through these portals, I don't really have a frame
-- of reference, but from everything I can see, there are a jumble of dependancies woven throughout
-- the quest chains that open the connections from Cataclysm to and from Orgrimmar, and likewise
@ -93,21 +93,21 @@ local static_horde_routes =
-- of these portals, you're going to have started the quest chain, which can't happen before the
-- listed level. Once I've run these myself and understand just what's going on, then I can start
-- tying them to the proper quest-completion dependancy.
-- From what I understand, at some point a portal from Orgrimmar to the zone opens in the EarthShrine
-- area in Orgrimmar. When exactly is unclear. Some zones, but not all, have a return portal.
-- This, too, is unclear.
-- Orgrimmar --> Temple of Earth (Aqua)
-- Level limit because the quest to open requires level 82.
{{640, 0.509, 0.531}, ORGRIMMAR_CATPORTAL_IN, 60, true}, -- Temple of Earth (Aqua) --> Orgrimmar
{{321, 0.508, 0.363}, {640, 0.506, 0.529}, 60, true, level_limit = 82}, -- Orgrimmar --> Deepholm
-- Level limit because the quest to open requires level 82.
{{321, 0.511, 0.383}, {606, 0.635, 0.234}, 60, true, level_limit = 80}, -- Orgrimmar --> Mount Hyjal
-- Level limit because the quest to open requires level 80.
{{321, 0.502, 0.394}, {700, 0.736, 0.534}, 60, true, level_limit = 84}, -- Orgrimmar --> Twilight Highlands
-- Level limit because the quest to open requires level 84.
@ -126,7 +126,7 @@ local static_horde_routes =
{{20, 0.619, 0.591}, {37, 0.374, 0.509}, 210}, -- Tirisfal Glades <--> Grom'gol Base Camp, Northern Stranglethorn
{{20, 0.590, 0.590}, {491, 0.777, 0.282}, 210}, -- Tirisfal Glades <--> Vengeance Landing
-- Ships
{{700, 0.735, 0.528}, {700, 0.767, 0.152}, 210}, -- Dragonmaw Port, Twilight Highlands <--> Krazzworks, Twilight Highlands
-- QuestHelper does not appear to like transitions from within the same zone. Gonna have to figure this out.
@ -134,14 +134,14 @@ local static_horde_routes =
}
local static_alliance_routes =
local static_alliance_routes =
{
-- Portals
{{381,0.440,0.782}, BLASTED_LANDS_PORTAL_IN, 60, true, level_limit = 58}, -- Darnassus --> Dark Portal
{{471,0.482,0.630}, BLASTED_LANDS_PORTAL_IN, 60, true, level_limit = 58}, -- Exodar --> Dark Portal
{{341,0.273,0.070}, BLASTED_LANDS_PORTAL_IN, 5, true, level_limit = 58}, -- Ironforge --> Dark Portal
{{301,0.490,0.874}, BLASTED_LANDS_PORTAL_IN, 5, true, level_limit = 58}, -- Stormwind --> Dark Portal
{{465, 0.886, 0.528}, {301, 0.496, 0.865}, 60, true}, -- Hellfire Peninsula --> Stormwind
{{381, 0.442, 0.788}, {471, 0.476, 0.598}, 5, true}, -- Darnassus --> Exodar
{{471, 0.476, 0.619}, {381, 0.435, 0.787}, 5, true}, -- Exodar --> Darnassus
@ -151,7 +151,7 @@ local static_alliance_routes =
{{301, 0.734, 0.195}, {640, 0.487, 0.536}, 60, true, level_limit = 82}, -- Stormwind --> Temple of Earth (Amber)
-- Level limit because the quest to open requires level 82.
{{640, 0.486, 0.537}, {301, 0.745, 0.183}, 60, true}, -- Temple of Earth (Amber) --> Stormwind
-- Stormwind <--> Deepholm
-- Stormwind <--> Mount Hyjal
-- Stormwind <--> Twilight Highlands
@ -175,27 +175,27 @@ local static_alliance_routes =
{{684, 0.42, 0.36}, {41, 0.52, 0.89}, 86400}, -- Gilneas Zone <--> Teldrassil. Exists solely to fix some pathing crashes. 24-hour boat ride :D (This will be deleted later, when we can create the "official" path.)
}
local static_shared_routes =
local static_shared_routes =
{
-- Portals
{{504, 0.268, 0.447}, {504, 0.240, 0.394}, 5}, -- Dalaran (Violet Citadel) <--> Dalaran (Purple Parlor)
{{504, 0.559, 0.468}, {510, 0.158, 0.428}, 5}, -- Dalaran <--> Crystalsong Forest
--{{504, 0.559, 0.468}, {510, 0.158, 0.428}, 5, false, level_limit = 68}, -- Dalaran <--> Crystalsong Forest
{{41, 0.551, 0.885}, {381, 0.369, 0.584}, 5}, -- Rut'Theran Village, Teldrassil <--> Darnassus
{{19, 0.550, 0.541}, {465, 0.898, 0.502}, 60}, -- Blasted Lands <--> Hellfire Peninsula (Dark Portal)
{{504, 0.255, 0.514}, {161, 0.652, 0.498}, 60, true}, -- Dalaran --> Caverns of Time
{{481, 0.486, 0.420}, {499, 0.482, 0.345}, 60, true}, -- Shattrath --> Isle of Quel'Danas
{{481, 0.747, 0.316}, {161, 0.652, 0.498}, 60, true}, -- Shattrath --> Caverns of Time
-- Requires Revered with Keepers of Time
{{640, 0.493, 0.504}, {640, 0.571, 0.135}, 5, false, level_limit = 81}, -- Temple of Earth <--> Therazane's Throne
-- Requires Honored with Therazane and dependant on quest #26709
-- Ships
{{488, 0.497, 0.784}, {491, 0.234, 0.578}, 210}, -- Moa'ki <--> Kamagua
{{488, 0.479, 0.788}, {486, 0.789, 0.537}, 210}, -- Moa'ki <--> Unu'pe
@ -253,40 +253,40 @@ local static_shared_routes =
{{144, 0.500, 0.500}, {73, 0.416, 0.179}, 5}, -- Ulduar, zone-in link is incorrect
{{155, 0.426, 0.203}, {71, 0.548, 0.899}, 5}, -- Forge of Souls
{{157, 0.410, 0.801}, {71, 0.547, 0.916}, 5}, -- Pit of Saron
-- Wrath in-zone links, all currently incorrect
-- UK
{{80, 0.500, 0.500}, {82, 0.500, 0.500}, 5},
{{80, 0.500, 0.500}, {84, 0.500, 0.500}, 5},
-- AN
{{88, 0.500, 0.500}, {90, 0.500, 0.500}, 5},
{{88, 0.500, 0.500}, {92, 0.500, 0.500}, 5},
-- Drak
{{96, 0.500, 0.500}, {98, 0.500, 0.500}, 5},
-- HoL
{{106, 0.500, 0.500}, {108, 0.500, 0.500}, 5},
-- Oculus
{{110, 0.500, 0.500}, {112, 0.500, 0.500}, 5},
{{110, 0.500, 0.500}, {114, 0.500, 0.500}, 5},
{{110, 0.500, 0.500}, {116, 0.500, 0.500}, 5},
-- CoT
{{120, 0.500, 0.500}, {118, 0.500, 0.500}, 5},
-- UP
{{122, 0.500, 0.500}, {124, 0.500, 0.500}, 5},
-- Naxx
{{128, 0.500, 0.500}, {130, 0.500, 0.500}, 5},
{{128, 0.500, 0.500}, {132, 0.500, 0.500}, 5},
{{128, 0.500, 0.500}, {134, 0.500, 0.500}, 5},
{{128, 0.500, 0.500}, {136, 0.500, 0.500}, 5},
{{128, 0.500, 0.500}, {138, 0.500, 0.500}, 5},
-- Ulduar
{{144, 0.500, 0.500}, {146, 0.500, 0.500}, 5},
{{144, 0.500, 0.500}, {148, 0.500, 0.500}, 5},
@ -300,11 +300,11 @@ local dark_portal_route = {{19, 0.550, 0.541}, {465, 0.898, 0.502}, 60}
-- Waygate
local ridingLevel = (select(4,GetAchievementInfo(892)) and 300) or (select(4,GetAchievementInfo(890)) and 225) or (select(4,GetAchievementInfo(889)) and 150) or (select(4,GetAchievementInfo(891)) and 75) or 0 -- this is thanks to Maldivia, who is a fucking genius
local has_fmsl = not not GetSpellInfo(GetSpellInfo(90267))
if ridingLevel >= 225 and has_fmsl then
local has_fmsl = not not GetSpellInfo(GetSpellInfo(90267))
if ridingLevel >= 225 and has_fmsl then
table.insert(static_shared_routes, {{201, 0.505, 0.078}, {493, 0.403, 0.830}, 60, false, level_limit = 77}) -- Un'Goro Crater <--> Sholazar Basin
-- Dependant on completion of quest #12613
end
end
-- Cataclysm Quest-dependant static routes
-- STILL WORKING ON THESE. See Notes under Static_Horde.
@ -322,21 +322,21 @@ local static_zone_transitions =
-- Eastern Kingdoms
-- Kalimdor
--Outland
--Northrend
{486, 493, 0.527, 0.322}, -- Borean Tundra <--> Scholazar Basin
--Cataclysm zones
-- Work
{4, 321, 0.117, 0.936}, -- Durotar <--> Orgrimmar (Front)
{4, 321, 0.366, 0.253}, -- Durotar <--> Orgrimmar (Side)
{181, 321, 0.792, 0.017}, -- Azshara <--> Orgrimmar (Back)
{772, 261, 0.687, 0.2}, -- Ahn'Qiraj <--> Silithus
{37, 673, 0.50, 0.61}, -- Northern Stranglethorn <--> Cape of Stranglethorn
--{38, 168, 0, 0}, -- Stranglethorn World Map Wonkiness
{43, 11, 0.687, 0.872}, -- Ashenvale <--> Northern Barrens
@ -401,7 +401,7 @@ local static_zone_transitions =
{24, 26, 0.899, 0.253}, -- Hillsbrad Foothills <--> The Hinterlands
{40, 700, 0.80, 0.47}, -- Wetlands <--> Twilight Highlands
{35, 40, 0.252, 0}, -- Loch Modan <--> Wetlands
-- Outland
{477, 481, 0.783, 0.545}, -- Nagrand <--> Shattrath City -- this is aldor-only
{481, 478, 0.782, 0.492}, -- Shattrath City <--> Terokkar Forest
@ -415,10 +415,10 @@ local static_zone_transitions =
{477, 467, 0.754, 0.331}, -- Nagrand <--> Zangarmarsh
{473, 478, 0.208, 0.271}, -- Shadowmoon Valley <--> Terokkar Forest
{478, 467, 0.341, 0.098}, -- Terokkar Forest <--> Zangarmarsh
-- Northrend
{486, 488, 0.967, 0.359}, -- Borean Tundra <--> Dragonblight
{501, 493, 0.208, 0.191}, -- Wintergrasp <--> Sholazar
{501, 493, 0.208, 0.191}, -- Wintergrasp <--> Sholazar
{488, 501, 0.250, 0.410}, -- Dragonblight <--> Wintergrasp
{488, 492, 0.359, 0.155}, -- Dragonblight <--> Icecrown
{488, 510, 0.612, 0.142}, -- Dragonblight <--> Crystalsong
@ -451,44 +451,11 @@ end
function load_graph_links()
local function convert_coordinate(coord)
QuestHelper: Assert(coord[1] and coord[2] and coord[3])
--[==[
-- I hate Blizzard... They can't make up their mind weather we are on TwilightHighlands or TwilightHiglands_terrain1, but we only seem to be on one or the other.
if coord[1] == 177 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 184
elseif coord[1] == 184 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 177
end
-- I hate Blizzard... They can't make up their mind weather we are on Hyjal or Hyjal_terrain1, but we only seem to be on one or the other.
if coord[1] == 198 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 185
elseif coord[1] == 185 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 198
end
-- I hate Blizzard... They can't make up their mind weather we are on Uldum or Uldum_terrain1, but we only seem to be on one or the other.
if coord[1] == 164 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 210
elseif coord[1] == 210 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 164
end
-- I hate Blizzard... They can't make up their mind whether we are on LostIsles, LostIsles_terrain1 or LostIsles_terrain2, but we only seem to be on one.
-- Create a lookup table.
local converter = {}
converter[181] = function() return convertLostIsles(181, 208, 209) end
converter[208] = function() return convertLostIsles(208, 181, 209) end
converter[209] = function() return convertLostIsles(209, 181, 208) end
-- Use the lookup table to get the real coordinate.
if converter[coord[1]] then coord[1] = converter[coord[1]]() end
]==]
local QHZL = QuestHelper_ZoneLookup
QuestHelper: Assert(QuestHelper_ZoneLookup[coord[1]], string.format("Coord[1] = %d", coord[1]))
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(QuestHelper_ZoneLookup[coord[1]][1], QuestHelper_ZoneLookup[coord[1]][2], coord[2], coord[3])
-- QuestHelper: Assert(QuestHelper_ZoneLookup[coord[1]], string.format("Coord[1] = %d", coord[1]))
-- local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(QuestHelper_ZoneLookup[coord[1]][1], QuestHelper_ZoneLookup[coord[1]][2], coord[2], coord[3])
QuestHelper: Assert(c)
return {x = x, y = y, p = coord[1], c = c}
return {x = coord[2], y = coord[3], m = coord[1], f = coord[4] or 0}
end
local function do_routes(routes)
@ -499,16 +466,16 @@ QuestHelper:Assert(v[2], tostring(k) .. " is the key, v[2]. v[1] is " .. tostrin
local src = convert_coordinate(v[1])
local dst = convert_coordinate(v[2])
QuestHelper: Assert(src.x and dst.x)
src.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[2][1]])}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[1][1]])}
src.map_desc = {QHFormat("WAYPOINT_REASON", "SOURCE")} --QuestHelper_NameLookup[v[2][1]])}
dst.map_desc = {QHFormat("WAYPOINT_REASON", "DEST")} --QuestHelper_NameLookup[v[1][1]])}
local rev_cost = v[3]
if v[4] then rev_cost = nil end
QH_Graph_Plane_Makelink("static_route", src, dst, v[3], rev_cost) -- this couldn't possibly fail
end
end
end
-- Generating landing_db for potential use in adding Mage portals and Hearthstone to routing
local faction_db
local landing_db
@ -519,11 +486,11 @@ QuestHelper:Assert(v[2], tostring(k) .. " is the key, v[2]. v[1] is " .. tostrin
faction_db = static_horde_routes
landing_db = static_horde_landings
end
-- Not adding landing_db or static_shared_landings here because it depend on implimentation
do_routes(faction_db)
do_routes(static_shared_routes)
for k, v in ipairs(static_zone_transitions) do
QuestHelper:Assert(v[1], tostring(k) .. " is the key, v[1]-2.")
QuestHelper:Assert(v[3], tostring(k) .. " is the key, v[3]-2.")
@ -531,18 +498,18 @@ QuestHelper:Assert(v[4], tostring(k) .. " is the key, v[4]-2.")
local src = convert_coordinate({v[1], v[3], v[4]})
local dst = convert_coordinate({v[1], v[3], v[4]})
dst.p = v[2]
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[v[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[v[1]]))}
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "BORDER SOURCE"))} --QuestHelper_NameLookup[v[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "BORDER DEST"))} --QuestHelper_NameLookup[v[1]]))}
QH_Graph_Plane_Makelink("static_transition", src, dst, 0, 0)
end
do
QuestHelper:Assert(dark_portal_route[1], "DPR1")
QuestHelper:Assert(dark_portal_route[2], "DPR2")
local src = convert_coordinate(dark_portal_route[1])
local dst = convert_coordinate(dark_portal_route[2])
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[dark_portal_route[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[dark_portal_route[1]]))}
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "DKPTL SOURCE"))} --QuestHelper_NameLookup[dark_portal_route[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "DKPTL DEST"))} --QuestHelper_NameLookup[dark_portal_route[1]]))}
QH_Graph_Plane_Makelink("dark_portal", src, dst, 15, 15)
end
end

Voir le fichier

@ -33,15 +33,15 @@ QH_OnUpdate(function()
return
end
quieted = false
if not rc then rc = LibStub("LibRangeCheck-2.0") end
if tick <= GetTime() then
tick = tick + 1
if tick < GetTime() then
tick = GetTime()
end
local targ = UnitGUID("target")
if targ ~= anchor or UnitIsDead("target") then
for _, v in pairs(map) do QuestHelper:ReleaseTable(v) end
@ -52,25 +52,25 @@ QH_OnUpdate(function()
end
anchor = targ
end
local minRange, maxRange = rc:GetRange('target')
if minRange then
if not maxRange then maxRange = 120 end
minRange = math.max(0, minRange - 1)
maxRange = maxRange + 1
local mnr, mxr = minRange * minRange, maxRange * maxRange
local px, py = QuestHelper.routing_ax, QuestHelper.routing_ay
-- first we blur
local newmap = QuestHelper:CreateTable("radar")
for x, d in pairs(map) do
if not newmap[x - grid] then newmap[x - grid] = QuestHelper:CreateTable("radar") end
if not newmap[x] then newmap[x] = QuestHelper:CreateTable("radar") end
if not newmap[x + grid] then newmap[x + grid] = QuestHelper:CreateTable("radar") end
for y, v in pairs(d) do
newmap[x - grid][y - grid] = (newmap[x - grid][y - grid] or 0) + v
newmap[x - grid][y] = (newmap[x - grid][y] or 0) + v * 2
@ -82,13 +82,13 @@ QH_OnUpdate(function()
newmap[x + grid][y] = (newmap[x + grid][y] or 0) + v * 2
newmap[x + grid][y + grid] = (newmap[x + grid][y + grid] or 0) + v
end
QuestHelper:ReleaseTable(d)
end
QuestHelper:ReleaseTable(map)
map = newmap
-- then we crop
local highest = 0
local newmap = QuestHelper:CreateTable("radar")
@ -107,7 +107,7 @@ QH_OnUpdate(function()
something = true
end
end
if something then
newmap[x] = newk
end
@ -115,7 +115,7 @@ QH_OnUpdate(function()
end
QuestHelper:ReleaseTable(map)
map = newmap
-- then we normalize
if highest > 0 then
highest = 1 / highest -- I don't know if mult is faster in lua or not, but it often is
@ -125,7 +125,7 @@ QH_OnUpdate(function()
end
end
end
-- then we add
-- probably a more efficient way to do this
px, py = math.floor(px / grid + 0.5) * grid, math.floor(py / grid + 0.5) * grid
@ -148,7 +148,7 @@ QH_OnUpdate(function()
end
end
end
-- then we post
local widgetofs = 1
for x, d in pairs(map) do
@ -162,7 +162,7 @@ QH_OnUpdate(function()
widg[1]:SetHeight(lheight)
end
widgetofs = widgetofs + 1
widg[1]:SetTexture(0, 1, 0, math.min(1, v * 1.2))
widg[1]:Show()
widg[2] = x
@ -170,25 +170,25 @@ QH_OnUpdate(function()
end
end
end
for rem = widgetofs, #widgets do
widgets[rem][1]:Hide()
widgets[rem][3] = nil
end
end
end
-- here we replace the widgets
local rotatey = (GetCVar("rotateMinimap") == "0") and 0 or GetPlayerFacing()
rotatey = rotatey * 180 / 3.14159
-- WILL FAIL HERE.
local mapdiam = QuestHelper.Astrolabe:GetMapDiameter()
local minimap = QuestHelper.Astrolabe:GetMinimapObject()
local mapwid, maphei = minimap:GetWidth(), minimap:GetHeight()
local xds, yds = mapwid / mapdiam, maphei / mapdiam
local nwidth, nheight = xds * grid, yds * grid
if nwidth ~= lwidth or nheight ~= lheight then
for _, widg in pairs(widgets) do
@ -197,18 +197,18 @@ QH_OnUpdate(function()
end
end
lwidth, lheight = nwidth, nheight
local xdx, xdy, ydx, ydy = cos(rotatey), -sin(rotatey), -sin(rotatey), -cos(rotatey) -- this will be wrong, but I'll figure it out
xdx, ydx = xdx * xds, ydx * xds
xdy, ydy = xdy * yds, ydy * yds
local px, py = QuestHelper.routing_ax, QuestHelper.routing_ay
for _, v in pairs(widgets) do
if not v[3] then break end
local dx, dy = v[2] - px, v[3] - py
v[1]:SetPoint("CENTER", Minimap, "CENTER", dx * xdx + dy * ydx, dx * xdy + dy * ydy)
--print("placing", dx * xdx + dy * ydx, dx * xdy + dy * ydy)
end

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -30,7 +30,7 @@ local default_colour_theme =
menu_text={1, 1, 1},
menu_text_highlight={0, 0, 0},
menu={0, 0, 0},
menu_highlight={0.3, 0.5, 0.7},
menu_highlight={0.3, 0.5, 0.7},
menu_title_text={1, 1, 1},
menu_title_text_highlight={1, 1, 1},
menu_title={0, 0.2, 0.6},
@ -54,7 +54,7 @@ function QuestHelper:GetColourTheme()
if date("%b%d") == "Dec25" then
return xmas_colour_theme
end
return default_colour_theme
end
@ -75,30 +75,30 @@ function QuestHelper:CreateUID(length)
local characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
for k = 1, (math.floor(GetTime() % 1000) + 5) do math.random() end -- it's sort of like seeding. only worse.
local base = GetUnitName("player")..":"..GetRealmName()..":"..math.random(0, 2147483647)..":"..GetTime()..":"..time()
for c = 1,(length or 32) do
local pos = 1+math.floor(self:HashString(result..base..math.random(0, 2147483647))%string.len(characters))
result = result .. string.sub(characters, pos, pos)
end
return result
end
function QuestHelper:ZoneSanity()
local sane = true
for c in pairs(self.Astrolabe:GetMapVirtualContinents()) do
local pz = self.Astrolabe:GetMapVirtualZones(c)
pz[0] = true
for z in pairs(pz) do
local name
if z == 0 then
name = self.Astrolabe:GetMapVirtualContinents()[c]
else
name = self.Astrolabe:GetMapVirtualZones(c)[z]
end
--[[ assert(name) ]]
-- c,z should be equal to name, unless c = 5 and z = 0, in which case it should be equal to name .. " Continent"
if QuestHelper_Zones[c][z] ~= name then
@ -106,7 +106,7 @@ function QuestHelper:ZoneSanity()
QuestHelper_ErrorCatcher_ExplicitError(false, string.format("'%s' has the wrong ID (should be %d,%d).", name, c, z))
--QuestHelper:TextOut(string.format("'%s' has the wrong ID (should be %d,%d).", name, c, z))
end
local pair = QuestHelper_ZoneLookup[name]
if not pair then
sane = false
@ -116,14 +116,14 @@ function QuestHelper:ZoneSanity()
QuestHelper_ErrorCatcher_ExplicitError(false, string.format("ZoneLookup['%s'] maps to wrong pair. It should be (%d, %d) but is (%d, %d)", name, c, z, pair[1], pair[2]))
--QuestHelper:TextOut("ZoneLookup['"..name.."'] maps to wrong pair.")
end
local index = QuestHelper_IndexLookup[name]
if QuestHelper_ZoneLookup[index] ~= pair then
sane = false
QuestHelper_ErrorCatcher_ExplicitError(false, "ZoneLookup['"..name.."'] isn't equal to ZoneLookup["..index.."] they are "..tostring(QuestHelper_ZoneLookup[name]).." and "..tostring(QuestHelper_ZoneLookup[index])..", respectively.")
--QuestHelper:TextOut("ZoneLookup['"..name.."'] isn't equal to ZoneLookup["..index.."] they are "..tostring(QuestHelper_ZoneLookup[name]).." and "..tostring(QuestHelper_ZoneLookup[index])..", respectively.")
end
if not index or QuestHelper_NameLookup[index] ~= name then
sane = false
QuestHelper_ErrorCatcher_ExplicitError(false, "NameLookup["..(index or "???").."] doesn't equal '"..name.."', it is "..tostring(QuestHelper_NameLookup[index]))
@ -131,7 +131,7 @@ function QuestHelper:ZoneSanity()
end
end
end
return sane
end
@ -160,11 +160,11 @@ end
function QuestHelper:GetUnitID(unit)
local id = UnitGUID(unit)
if id then
return (string.sub(id, 5, 5) == "3") and tonumber(string.sub(id, 6, 12), 16) or nil
end
return nil
end
@ -179,7 +179,7 @@ end
function QuestHelper:CountItem(item_id)
local count = 0
for bag = 0,NUM_BAG_SLOTS do
for slot = 1,GetContainerNumSlots(bag) do
local link = GetContainerItemLink(bag, slot)
@ -188,14 +188,14 @@ function QuestHelper:CountItem(item_id)
end
end
end
return count
end
function QuestHelper:ItemCooldown(item_id)
local now = GetTime()
local cooldown = nil
for bag = 0,NUM_BAG_SLOTS do
for slot = 1,GetContainerNumSlots(bag) do
local link = GetContainerItemLink(bag, slot)
@ -213,7 +213,7 @@ function QuestHelper:ItemCooldown(item_id)
end
end
end
return cooldown
end
@ -222,7 +222,7 @@ function QuestHelper:TimeString(seconds)
--self:AppendNotificationError("2008-10-8 nil-timestring") -- we're just going to do away with this entirely, the fact is that a lot of this is going to be ripped to shreds soon anyway
return "(unknown)"
end
local seconds = math.ceil(seconds)
local h, m, s = math.floor(seconds/(60*60)), math.floor(seconds/60)%60, seconds%60
if h > 0 then
@ -257,20 +257,13 @@ function QuestHelper:PercentString(pct)
end
function QuestHelper:PlayerPosition()
return self.i, self.x, self.y
return self.m, self.f, self.x, self.y
end
function QuestHelper:UnitPosition(unit)
local c, z, x, y = self.Astrolabe:GetUnitPosition(unit,true)
if c then
if z == 0 then
SetMapToCurrentZone()
z = GetCurrentMapZone()
if z ~= 0 then
x, y = self.Astrolabe:TranslateWorldMapPosition(c, 0, x, y, c, z)
end
end
return QuestHelper_IndexLookup[c][z], x, y
local m, f, x, y = self.Astrolabe:GetUnitPosition(unit,true)
if m then
return m, f, x, y
else
return self:PlayerPosition()
end
@ -290,22 +283,21 @@ function QuestHelper:Location_AbsoluteString(delayed, c, x, y)
return ("[|cffffffff%s/%s,%s,%s|r]"):format(delayed and "D" or "c", c and string.format("%d", c) or tostring(c), x and string.format("%.3f", x) or tostring(x), y and string.format("%.3f", y) or tostring(y))
end
function QuestHelper:Distance(i1, x1, y1, i2, x2, y2)
local p1, p2 = QuestHelper_ZoneLookup[i1], QuestHelper_ZoneLookup[i2]
return self.Astrolabe:ComputeDistance(p1[1], p1[2], x1, y1, p2[1], p2[2], x2, y2) or 10000
function QuestHelper:Distance(m1, x1, y1, m2, x2, y2)
return self.Astrolabe:ComputeDistance(m1, 0, x1, y1, m2, 0, x2, y2) or 10000
end
function QuestHelper:AppendPosition(list, index, x, y, w, min_dist)
if not x or not y or (x == 0 and y == 0) or x <= -0.1 or y <= -0.1 or x >= 1.1 or y >= 1.1 then
local nc, nz, nx, ny = self.Astrolabe:GetCurrentPlayerPosition()
local nm, nf, nx, ny = self.Astrolabe:GetCurrentPlayerPosition()
--self:AppendNotificationError("2008-10-6 nil-position", string.format("nilposition, %s %s %s %s vs %s %s", tostring(nc), tostring(nz), tostring(nx), tostring(ny), tostring(x), tostring(y))) -- We're just not worrying about this too much anymore. Slash and burn.
return list -- This isn't a real position.
end
local closest, distance = nil, 0
w = w or 1
min_dist = min_dist or 200
for i, p in ipairs(list) do
if index == p[1] then
local d = self:Distance(index, x, y, p[1], p[2], p[3])
@ -314,7 +306,7 @@ function QuestHelper:AppendPosition(list, index, x, y, w, min_dist)
end
end
end
if closest and distance < min_dist then
local p = list[closest]
p[2] = (p[2]*p[4]+x*w)/(p[4]+w)
@ -323,7 +315,7 @@ function QuestHelper:AppendPosition(list, index, x, y, w, min_dist)
else
table.insert(list, {index, x, y, w})
end
return list
end
@ -459,6 +451,6 @@ function QH_fixedmessage(text)
whileDead = 1,
hideOnEscape = 1
}
StaticPopup_Show(msgtext)
end