Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MoP portal for tranport module #293

Merged
merged 4 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions APR-Core/ChangeLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ end

function APR.changelog:SetChangeLog()
local news = {
{ "v3.2.9", "2024-06-01" },
"#Features",
"- Changed event for GetFP to detect new taxi node",

"#Bug",
"- Added fillers to 31286 cave waypoints (Robbing Robbers of Robbers)",
"- Adjust coords for 30624 (It Does You No Good In The Keg)",
"- Added MoP portal coord for Isle of thunder to avoid transport module bug",
"- Removed useless waypoints in Jade forest route",

{ "v3.2.8", "2024-05-25" },
"#Features",
"- Remove force reset with the v3.2.0",
Expand Down
8 changes: 3 additions & 5 deletions APR-Core/QuestHandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1724,11 +1724,9 @@ APR_QH_EventFrame:SetScript("OnEvent", function(self, event, ...)
end

if (event == "UI_INFO_MESSAGE") then
local arg1, arg2, arg3, arg4, arg5 = ...;
if Contains({ 280, 281, 282, 283 }, arg1) then
if (steps and steps.GetFP) then
_G.UpdateNextStep()
end
local errorType, msg = ...;
if steps and steps.GetFP and (msg == _G.ERR_NEWTAXIPATH or msg == _G.ERR_TAXINOPATHS) then
_G.UpdateNextStep()
end
end

Expand Down
8 changes: 4 additions & 4 deletions APR-Core/Transport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function APR.transport:GetPortal(CurContinent, nextContinent, nextZone)

for _, portal in ipairs(portalMappings) do
if CurContinent == portal.continent and (nextContinent == portal.nextContinent or nextZone == portal.nextZone) then
local portalPosition = APR.Portals[APR.Faction][portal.continent][portal.portalKey]
local portalPosition = APR.Portals.Coords[APR.Faction][portal.continent][portal.portalKey]
local distance = math.sqrt((playerX - portalPosition.x) ^ 2 + (playerY - portalPosition.y) ^ 2)

if closestDistance == nil or distance < closestDistance then
Expand All @@ -215,7 +215,7 @@ function APR.transport:GetPortal(CurContinent, nextContinent, nextZone)
local function handlePortalsCapital(portalMappings, capitalNextContinent, capitalNextZone)
for _, portal in ipairs(portalMappings) do
if CurContinent == portal.continent and (capitalNextContinent == portal.nextContinent or capitalNextZone == portal.nextZone) then
local portalPosition = APR.Portals[APR.Faction][portal.continent][portal.portalKey]
local portalPosition = APR.Portals.Coords[APR.Faction][portal.continent][portal.portalKey]
return portal, portalPosition
end
end
Expand All @@ -228,7 +228,7 @@ function APR.transport:GetPortal(CurContinent, nextContinent, nextZone)
end

-- Portal
local portalsDB = APR.ZonesData.SwitchCont[APR.Faction]
local portalsDB = APR.Portals.SwitchCont[APR.Faction]
local portal, portalPosition = handlePortals(portalsDB)

-- If no portal is found, redirect to the default capital
Expand All @@ -254,7 +254,7 @@ function APR.transport:GetPortal(CurContinent, nextContinent, nextZone)
-- handle the Alliance portals room
if APR.Faction == "Alliance" and CurContinent == 13 and (posY > -8981.3 and posX < 866.7) then
APR.currentStep:AddExtraLineText("GO_PORTAL_ROOM", L["GO_PORTAL_ROOM"])
local portalRoom = APR.Portals["Alliance"][CurContinent]["StormwindPortalRoom"]
local portalRoom = APR.Portals.Coords["Alliance"][CurContinent]["StormwindPortalRoom"]
APR.Arrow:SetArrowActive(true, portalRoom.x, portalRoom.y)
else
local extraText = portal.extraText or "USE_PORTAL_TO"
Expand Down
109 changes: 105 additions & 4 deletions APR-Core/database/Portals.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
APR.Portals = {
APR.Portals = {}
APR.Portals.Coords = {
["Alliance"] = {
[12] = {
["Stormwind"] = { x = -11576.5, y = -4053 },
Expand All @@ -22,7 +23,12 @@ APR.Portals = {
},
[101] = { ["Stormwind"] = { x = 5388.7, y = -1893.5 }, ["Stormwind DarkPortal"] = { x = 931.9, y = -274.6 } },
[113] = { ["Stormwind"] = { x = 720.2, y = 5719.5 } },
[424] = { ["Stormwind"] = { x = -1776, y = -311.3 } },
[424] = {
["Stormwind Jade Forest"] = { x = -1776, y = -311.3 },
["Stormwind Blossom"] = { x = 176.9, y = 828.6 },
["Isle of Thunder"] = { x = 4222, y = 1928.8 },
["Townlong Steppes"] = { x = 4977.8, y = 6122.6, }
},
[572] = { ["Stormwind"] = { x = -4042.4, y = 3735.5 } },
[619] = {
["Stormwind"] = { x = 4548.5, y = -929.5 },
Expand Down Expand Up @@ -77,8 +83,13 @@ APR.Portals = {
["DarkPortal BC"] = { x = 55.8, y = 1768.7 }
},
[101] = { ["Orgrimmar"] = { x = 5394.1, y = -1898.9 }, ["Orgrimmar DarkPortal"] = { x = 932.3, y = -222.8 } },
[113] = { ["Orgrimmar"] = { x = 593.7, y = 5926.2 } },
[424] = { ["Orgrimmar"] = { x = -539.3, y = 3000.4 } },
[113] = { ["Orgrimmar"] = { x = 593.7, y = 5926.2 }, },
[424] = {
["Orgrimmar Jade Forest"] = { x = -539.3, y = 3000.4 },
["Orgrimmar Blossom"] = { x = 873.10003662109, y = 1735 },
["Isle of Thunder"] = { x = 4170.20, y = 1747.5 },
["Townlong Steppes"] = { x = 4170.1000976562, y = 1747.5, }
},
[572] = { ["Orgrimmar"] = { x = -4074.7, y = 5267 } },
[619] = {
["Orgrimmar"] = { x = 4418.6, y = -714.8 },
Expand All @@ -102,3 +113,93 @@ APR.Portals = {
[1978] = { ["Orgrimmar"] = { x = -1023, y = 278 } }
}
}

APR.Portals.SwitchCont = {
["Alliance"] = {
{ continent = 13, nextContinent = 12, nextZone = 103, portalKey = "Exodar", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 101, nextZone = 111, portalKey = "Shattrath", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 113, nextZone = 125, portalKey = "DalaranLichKing", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 424, nextZone = 371, portalKey = "JadeForestMoP", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 12, nextZone = 17, portalKey = "DarkPortal Talk", closestTaxiNode = "Stormwind, Elwynn", extraText = "TALK_TO" },
{ continent = 13, nextContinent = 572, nextZone = 577, portalKey = "DarkPortal Talk", closestTaxiNode = "Stormwind, Elwynn", extraText = "TALK_TO" },
{ continent = 13, nextContinent = 572, nextZone = 577, portalKey = "DarkPortal" },
{ continent = 13, nextContinent = 572, nextZone = 622, portalKey = "StormshieldWoD", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 619, nextZone = 630, portalKey = "AzsunaLegion", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 876, nextZone = 1161, portalKey = "BoralusBFA", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 1550, nextZone = 1670, portalKey = "Oribos", closestTaxiNode = "Stormwind, Elwynn" },
{ continent = 13, nextContinent = 1978, nextZone = 2112, portalKey = "Valdrakken", closestTaxiNode = "Stormwind, Elwynn" },

{ continent = 12, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "The Exodar" },
{ continent = 12, nextContinent = 13, nextZone = 84, portalKey = "Exodar", closestTaxiNode = "Darnassus, Teldrassil" },
{ continent = 12, nextContinent = 12, nextZone = 103, portalKey = "Exodar" },
{ continent = 12, nextContinent = 101, nextZone = 530, portalKey = "DarkPortal BC" },
{ continent = 101, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Shattrath, Terokkar Forest" },
{ continent = 101, nextContinent = 13, nextZone = 84, portalKey = "Stormwind DarkPortal", closestTaxiNode = "Hellfire Peninsula, The Dark Portal" },
{ continent = 113, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Dalaran" },
{ continent = 424, nextContinent = 13, nextZone = 84, portalKey = "Stormwind Blossom", closestTaxiNode = "Shrine of Seven Stars, Vale of Eternal Blossoms", extraText = "UPSTAIRS" },
{ continent = 424, nextContinent = 13, nextZone = 84, portalKey = "Stormwind Jade Forest", closestTaxiNode = "Paw'Don Village, Jade Forest" },
{ continent = 424, nextContinent = 424, nextZone = 504, portalKey = "Isle of Thunder", },
{ continent = 424, nextContinent = 424, nextZone = 388, portalKey = "Townlong Steppes", },
{ continent = 572, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Stormshield (Alliance), Ashran" },
{ continent = 619, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Dalaran" },
{ continent = 619, nextContinent = 13, nextZone = 84, portalKey = "Stormwind AzsunaLegion", },
{ continent = 619, nextContinent = 13, nextZone = 84, portalKey = "Stormwind Telogrus Rift", },
{ continent = 619, nextContinent = 13, nextZone = 84, portalKey = "Stormwind Vindicaar", },
{ continent = 875, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", },
{ continent = 876, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Tradewinds Market, Tiragarde Sound" },
{ continent = 1550, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Oribos" },
{ continent = 1978, nextContinent = 13, nextZone = 84, portalKey = "Stormwind", closestTaxiNode = "Valdrakken, Thaldraszus" },

{ continent = 875, nextContinent = 875, nextZone = 862, portalKey = "Zuldazar", closestTaxiNode = "Xibala, Zuldazar", extraText = "TALK_TO" },
{ continent = 875, nextContinent = 875, nextZone = 863, portalKey = "Nazmir", closestTaxiNode = "Fort Victory, Nazmir", extraText = "TALK_TO" },
{ continent = 875, nextContinent = 875, nextZone = 864, portalKey = "Vol'dun", closestTaxiNode = "Shatterstone Harbor, Vol'dun", extraText = "TALK_TO" },
{ continent = 876, nextContinent = 875, nextZone = 862, portalKey = "Zuldazar", closestTaxiNode = "Tradewinds Market, Tiragarde Sound", extraText = "SAIL_TO" },
{ continent = 876, nextContinent = 875, nextZone = 863, portalKey = "Nazmir", closestTaxiNode = "Tradewinds Market, Tiragarde Sound", extraText = "SAIL_TO" },
{ continent = 876, nextContinent = 875, nextZone = 864, portalKey = "Vol'dun", closestTaxiNode = "Tradewinds Market, Tiragarde Sound", extraText = "SAIL_TO" },
},
["Horde"] = {
{ continent = 12, nextContinent = 13, nextZone = 224, portalKey = "STVZep", closestTaxiNode = "Orgrimmar, Durotar", extraText = "USE_ZEPPELIN_TO" },
{ continent = 12, nextContinent = 13, nextZone = 90, portalKey = "Undercity", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 101, nextZone = 111, portalKey = "Shattrath", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 113, nextZone = 126, portalKey = "DalaranLichKing", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 424, nextZone = 371, portalKey = "JadeForest", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 572, nextZone = 577, portalKey = "DarkPortal Talk", closestTaxiNode = "Orgrimmar, Durotar", extraText = "TALK_TO" },
{ continent = 12, nextContinent = 12, nextZone = 17, portalKey = "DarkPortal Talk", closestTaxiNode = "Orgrimmar, Durotar", extraText = "TALK_TO" },
{ continent = 12, nextContinent = 572, nextZone = 624, portalKey = "WarspearWoD", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 619, nextZone = 630, portalKey = "AzsunaLegion", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 875, nextZone = 862, portalKey = "Zuldazar", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 1550, nextZone = 1670, portalKey = "Oribos", closestTaxiNode = "Orgrimmar, Durotar" },
{ continent = 12, nextContinent = 1978, nextZone = 2112, portalKey = "Valdrakken", closestTaxiNode = "Orgrimmar, Durotar" },

{ continent = 13, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar" },
{ continent = 13, nextContinent = 572, nextZone = 577, portalKey = "DarkPortal" },
{ continent = 13, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Silvermoon", closestTaxiNode = "Silvermoon City" },
{ continent = 13, nextContinent = 101, nextZone = 530, portalKey = "DarkPortal BC" },
{ continent = 13, nextContinent = 113, nextZone = 571, portalKey = "Howling Fjord" },

{ continent = 101, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Shattrath, Terokkar Forest" },
{ continent = 101, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar DarkPortal", closestTaxiNode = "Hellfire Peninsula, The Dark Portal" },
{ continent = 113, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Dalaran" },
{ continent = 424, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Blossom", closestTaxiNode = "Shrine of Two Moons, Vale of Eternal Blossoms", extraText = "UPSTAIRS" },
{ continent = 424, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Jade Forest", closestTaxiNode = "Honeydew Village, Jade Forest" },
{ continent = 424, nextContinent = 424, nextZone = 388, portalKey = "Townlong Steppes", },
{ continent = 424, nextContinent = 424, nextZone = 504, portalKey = "Isle of Thunder", },
{ continent = 572, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Warspear, Ashran" },
{ continent = 619, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Dalaran" },
{ continent = 619, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Suramar", },
{ continent = 619, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar AzsunaLegion", },
{ continent = 619, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Highmountain", },
{ continent = 875, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Port of Zandalar, Zuldazar" },
{ continent = 875, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar Dazaralor", },
{ continent = 1550, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Oribos" },
{ continent = 1978, nextContinent = 12, nextZone = 85, portalKey = "Orgrimmar", closestTaxiNode = "Valdrakken, Thaldraszus" },

{ continent = 875, nextContinent = 876, nextZone = 876, portalKey = "Drustvar", closestTaxiNode = "Port of Zandalar, Zuldazar", extraText = "SAIL_TO" },
{ continent = 875, nextContinent = 876, nextZone = 942, portalKey = "StormsongValley", closestTaxiNode = "Port of Zandalar, Zuldazar", extraText = "SAIL_TO" },
{ continent = 875, nextContinent = 876, nextZone = 895, portalKey = "TiragardeSound", closestTaxiNode = "Port of Zandalar, Zuldazar", extraText = "SAIL_TO" },
{ continent = 876, nextContinent = 876, nextZone = 896, portalKey = "DrustvarSail", closestTaxiNode = "Anyport, Drustvar", extraText = "TALK_TO" },
{ continent = 876, nextContinent = 876, nextZone = 942, portalKey = "StormsongValleySail", closestTaxiNode = "Warfang Hold, Stormsong Valley", extraText = "TALK_TO" },
{ continent = 876, nextContinent = 876, nextZone = 895, portalKey = "TiragardeSoundSail", closestTaxiNode = "Plunder Harbor, Tiragarde Sound", extraText = "TALK_TO" },
{ continent = 1550, nextContinent = 1550, nextZone = 1536, portalKey = "OribosInMaldraxxus", closestTaxiNode = "Theater of Pain, Maldraxxus" },
},
}
Loading