xmyno / Broker_WorldQuests

World of Warcraft addon for displaying world quests in list form.
http://www.wowinterface.com/downloads/info23964-Broker_WorldQuests.html
MIT License
11 stars 11 forks source link

Add support for new zones, factions and currencies in 8.2 #38

Closed speedwaystar closed 4 years ago

speedwaystar commented 5 years ago

might have missed a few things, but this is mostly what needs to be done:

diff --git "a/WorldQuests.lua" "b/WorldQuests.lua"
index 9779f42..80bd984 100644
--- "a/WorldQuests.lua"
+++ "b/WorldQuests.lua"
@@ -69,6 +69,8 @@ local MAP_ZONES = {
        [1161] = { id = 1161, name = GetMapInfo(1161).name, faction = FACTION_ALLIANCE, quests = {}, buttons = {}, },  -- Boralus
         [14] = { id = 14, name = GetMapInfo(14).name,  quests = {}, buttons = {}, },  -- Arathi
         [62] = { id = 62, name = GetMapInfo(62).name,  quests = {}, buttons = {}, },  -- Darkshore
+        [1355] = { id = 1355, name = GetMapInfo(1355).name,  quests = {}, buttons = {}, },  -- Nazjatar
+        [1462] = { id = 1462, name = GetMapInfo(1462).name,  quests = {}, buttons = {}, },  -- Mechagon Island

    },
    ["LEGION"] = {
@@ -87,7 +89,7 @@ local MAP_ZONES = {
 }
 local MAP_ZONES_SORT = {
    ["BFA"] = {
-       62, 14, 863, 864, 862, 895, 942, 896, 1161
+       1355, 62, 14, 863, 864, 862, 895, 942, 896, 1161
    },
    ["LEGION"] = {
        630, 790, 641, 650, 634, 680, 627, 646, 830, 882, 885
@@ -169,6 +171,7 @@ local defaultConfig = {
    alwaysShowEpicQuests = true,
    onlyShowRareOrAbove = false,
    showTotalsInBrokerText = true,
+       brokerShowPrismaticManapearls = true,
        brokerShowAP = true,
        brokerShowServiceMedals = true,
        brokerShowWakeningEssences = true,
@@ -186,6 +189,7 @@ local defaultConfig = {
        brokerShowBloodOfSargeras = false,
    sortByTimeRemaining = false,
    -- reward type
+   showPrismaticManapearls = true,
    showArtifactPower = true,
    showItems = true,
        showGear = true,
@@ -224,7 +228,17 @@ local defaultConfig = {
    showPvP = true,
    hideFactionColumn = false,
    hideFactionParagonBars = false,
-   --legion
+   --Legion
+   alwaysShowCourtOfFarondis = false,
+   alwaysShowDreamweavers = false,
+   alwaysShowHighmountainTribe = false,
+   alwaysShowNightfallen = false,
+   alwaysShowWardens = false,
+   alwaysShowValarjar = false,
+   alwaysShowArmiesOfLegionfall = false,
+   alwaysShowArmyOfTheLight = false,
+   alwaysShowArgussianReach = false,
+   --BFA
    alwaysShow7thLegion = false,
    alwaysShowStormsWake = false,
    alwaysShowOrderOfEmbers = false,
@@ -235,15 +249,9 @@ local defaultConfig = {
    alwaysShowVoldunai = false,
    alwaysShowTortollanSeekers = false,
    alwaysShowChampionsOfAzeroth = false,
-       alwaysShowCourtOfFarondis = false,
-       alwaysShowDreamweavers = false,
-       alwaysShowHighmountainTribe = false,
-       alwaysShowNightfallen = false,
-       alwaysShowWardens = false,
-       alwaysShowValarjar = false,
-       alwaysShowArmiesOfLegionfall = false,
-       alwaysShowArmyOfTheLight = false,
-       alwaysShowArgussianReach = false,
+   alwaysShowWavebladeAnkoan = false,
+   alwaysShowTheUnshackled = false,
+   alwaysShowRustboltResistance = false,
    showPetBattle = true,
    hidePetBattleBountyQuests = false,
    alwaysShowPetBattleFamilyFamiliar = true,
@@ -618,7 +626,7 @@ local Row_OnClick = function(row)
 end

-local REWARD_TYPES = { ARTIFACTPOWER = 0, RESOURCES = 1, MONEY = 2, GEAR = 3, BLOODOFSARGERAS = 4, LEGIONFALL_SUPPLIES = 5, HONOR = 6, NETHERSHARD = 7, ARGUNITE = 8, WAKENING_ESSENCES = 9, WAR_RESOURCES = 10, MARK_OF_HONOR = 11, SERVICE_MEDALS = 12 }
+local REWARD_TYPES = { ARTIFACTPOWER = 0, RESOURCES = 1, MONEY = 2, GEAR = 3, BLOODOFSARGERAS = 4, LEGIONFALL_SUPPLIES = 5, HONOR = 6, NETHERSHARD = 7, ARGUNITE = 8, WAKENING_ESSENCES = 9, WAR_RESOURCES = 10, MARK_OF_HONOR = 11, SERVICE_MEDALS = 12, PRISMATIC_MANAPEARL = 13 }
 local QUEST_TYPES = { HERBALISM = 0, MINING = 1, FISHING = 2, SKINNING = 3, }
 local lastUpdate, updateTries = 0, 0
 local needsRefresh = false
@@ -710,6 +718,8 @@ local RetrieveWorldQuests = function(mapId)
                    local rewardType = {}
                    if GetNumQuestLogRewards(quest.questId) > 0 then
                        local itemName, itemTexture, quantity, quality, isUsable, itemId = GetQuestLogRewardInfo(1, quest.questId)
+                       --print( itemName, itemTexture, quantity, quality, isUsable, itemId )
+
                        if itemName then
                            hasReward = true
                            quest.reward.itemTexture = itemTexture
@@ -770,6 +780,7 @@ local RetrieveWorldQuests = function(mapId)
                    for i = 1, numQuestCurrencies do

                        local name, texture, numItems, currencyId = GetQuestLogRewardCurrencyInfo(i, quest.questId)
+                       -- print (name, texture, numItems, currencyID)
                        if name then
                            hasReward = true

@@ -787,6 +798,10 @@ local RetrieveWorldQuests = function(mapId)
                                rewardType[#rewardType+1] = REWARD_TYPES.ARTIFACTPOWER
                                quest.reward.azeriteAmount = currency.amount -- todo: improve broker text values?
                                if C("showArtifactPower") then quest.hide = false end
+                           elseif currencyID == 1721 then -- prismatic manapearls
+                               currency.name = string.format("|cffe5cc80[%d %s]|r", currency.amount, name)
+                               rewardType[#rewardType+1] = REWARD_TYPES.PRISMATIC_MANAPEARL
+                               quest.reward.prismaticManapearlAmount = currency.amount -- todo: improve broker text values?
                            elseif BFA_REPUTATION_CURRENCY_IDS[currencyId] then
                                currency.name = string.format("%s: %d %s", name, currency.amount, REPUTATION)
                                if C("showBFAReputation") then quest.hide = false end
@@ -895,6 +910,9 @@ local RetrieveWorldQuests = function(mapId)
                        (C("alwaysShowVoldunai") and quest.factionId == 2158) or
                        (C("alwaysShowTortollanSeekers") and quest.factionId == 2163) or
                        (C("alwaysShowChampionsOfAzeroth") and quest.factionId == 2164) or
+                       (C("alwaysShowWavebladeAnkoan") and quest.factionId == 2400) or
+                       (C("alwaysShowTheUnshackled") and quest.factionId == 2373) or
+                       (C("alwaysShowRustboltResistance") and quest.factionId == 2391) or
                        -- legion
                        (C("alwaysShowCourtOfFarondis")         and (mapId == 630 or mapId == 790)) or
                        (C("alwaysShowDreamweavers")        and mapId == 641) or
@@ -925,6 +943,8 @@ local RetrieveWorldQuests = function(mapId)
                            for _, rtype in next, rewardType do
                                if rtype == REWARD_TYPES.ARTIFACTPOWER and quest.reward.azeriteAmount then
                                    BWQ.totalArtifactPower = BWQ.totalArtifactPower + (quest.reward.azeriteAmount or 0) end
+                               if rtype == REWARD_TYPES.PRISMATIC_MANAPEARL and quest.reward.prismaticManapearlAmount then
+                                   BWQ.totalPrismaticManapearls = BWQ.totalPrismaticManapearls + (quest.reward.prismaticManapearlAmount or 0) end
                                if rtype == REWARD_TYPES.WAKENING_ESSENCES and quest.reward.wakeningEssencesAmount then
                                    BWQ.totalWakeningEssences = BWQ.totalWakeningEssences + quest.reward.wakeningEssencesAmount end
                                if rtype == REWARD_TYPES.WAR_RESOURCES and quest.reward.warResourceAmount then
@@ -1098,6 +1118,8 @@ local factions = {
        [2158] = "inv__faction_voldunai", -- voldunai
        [2163] = "inv__faction_tortollanseekers", -- tortollan
        [2164] = "inv__faction_championsofazeroth", -- coa
+       [2373] = "inv__faction_unshackled", -- unshackled
+       [2391] = "inv__faction_rustboltresistance", -- rustbolt resistance
    },
    bfaalliance = {
        order = { 2160, 2161, 2162, 2159, 2163, 2164 },
@@ -1107,6 +1129,8 @@ local factions = {
        [2162] = "inv__faction_stormswake", -- storms wake
        [2163] = "inv__faction_tortollanseekers", -- tortollan
        [2164] = "inv__faction_championsofazeroth", -- coa
+       [2400] = "inv__faction_wavebladeankoan", -- waveblade ankoan
+       [2391] = "inv__faction_rustboltresistance", -- rustbolt resistance
    },

 }
@@ -1223,7 +1247,7 @@ end
 local originalMap, originalContinent, originalDungeonLevel
 function BWQ:UpdateQuestData()
    questIds = BWQcache.questIds or {}
-   BWQ.totalArtifactPower, BWQ.totalGold, BWQ.totalWarResources, BWQ.totalServiceMedals, BWQ.totalResources, BWQ.totalLegionfallSupplies, BWQ.totalHonor, BWQ.totalGear, BWQ.totalHerbalism, BWQ.totalMining, BWQ.totalFishing, BWQ.totalSkinning, BWQ.totalBloodOfSargeras, BWQ.totalWakeningEssences, BWQ.totalMarkOfHonor = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+   BWQ.totalPrismaticManapearls, BWQ.totalArtifactPower, BWQ.totalGold, BWQ.totalWarResources, BWQ.totalServiceMedals, BWQ.totalResources, BWQ.totalLegionfallSupplies, BWQ.totalHonor, BWQ.totalGear, BWQ.totalHerbalism, BWQ.totalMining, BWQ.totalFishing, BWQ.totalSkinning, BWQ.totalBloodOfSargeras, BWQ.totalWakeningEssences, BWQ.totalMarkOfHonor = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

    for mapId in next, MAP_ZONES[expansion] do
        RetrieveWorldQuests(mapId)
@@ -1731,6 +1755,7 @@ function BWQ:UpdateBlock()

    if C("showTotalsInBrokerText") then
        local brokerString = ""
+       if C("brokerShowPrismaticManapearls") and BWQ.totalPrismaticManapearls > 0 then brokerString = string.format("%s|TInterface\\Icons\\inv_misc_enchantedpearlf:16:16|t %s  ", brokerString, AbbreviateNumber(BWQ.totalPrismaticManapearls)) end
        if C("brokerShowAP")                  and BWQ.totalArtifactPower > 0      then brokerString = string.format("%s|TInterface\\Icons\\inv_smallazeriteshard:16:16|t %s  ", brokerString, AbbreviateNumber(BWQ.totalArtifactPower)) end
        if C("brokerShowServiceMedals")       and BWQ.totalServiceMedals > 0      then brokerString = string.format("%s|T%s:16:16|t %s  ", brokerString, isHorde and "Interface\\Icons\\ui_horde_honorboundmedal" or "Interface\\Icons\\ui_alliance_7legionmedal", BWQ.totalServiceMedals) end
        if C("brokerShowWakeningEssences")    and BWQ.totalWakeningEssences > 0   then brokerString = string.format("%s|TInterface\\Icons\\achievement_dungeon_ulduar80_25man:16:16|t %s  ", brokerString, BWQ.totalWakeningEssences) end
@@ -1772,6 +1797,7 @@ function BWQ:SetupConfigMenu()
        { text = "Only show world quests with |cff0070ddrare|r or above quality", check = "onlyShowRareOrAbove" },
        { text = "Don't filter quests for active bounties", check = "alwaysShowBountyQuests" },
        { text = "Show total counts in broker text", check = "showTotalsInBrokerText", submenu = {
+               { text = ("|T%1$s:16:16|t  Prismatic Manapearls"):format("Interface\\Icons\\inv_misc_enchantedpearlf"), check = "brokerShowPrismaticManapearls" },      
                { text = ("|T%1$s:16:16|t  Artifact Power"):format("Interface\\Icons\\inv_smallazeriteshard"), check = "brokerShowAP" },
                { text = ("|T%1$s:16:16|t  Service Medals"):format(isHorde and "Interface\\Icons\\ui_horde_honorboundmedal" or "Interface\\Icons\\ui_alliance_7legionmedal"), check = "brokerShowServiceMedals" },
                { text = ("|T%1$s:16:16|t  Wakening Essences"):format("Interface\\Icons\\achievement_dungeon_ulduar80_25man"), check = "brokerShowWakeningEssences" },
@@ -1792,6 +1818,7 @@ function BWQ:SetupConfigMenu()
        { text = "Sort list by time remaining instead of reward type", check = "sortByTimeRemaining" },
        { text = "" },
        { text = "Filter by reward...", isTitle = true },
+       { text = ("|T%1$s:16:16|t  Prismatic Manapearls"):format("Interface\\Icons\\inv_misc_enchantedpearlf"), check = "showPrismaticManapearls" },
        { text = ("|T%1$s:16:16|t  Azerite"):format("Interface\\Icons\\inv_smallazeriteshard"), check = "showArtifactPower" },
        { text = ("|T%1$s:16:16|t  Items"):format("Interface\\Minimap\\Tracking\\Banker"), check = "showItems", submenu = {
                { text = ("|T%1$s:16:16|t  Gear"):format("Interface\\Icons\\Inv_chest_plate_legionendgame_c_01"), check = "showGear" },
@@ -1847,12 +1874,15 @@ function BWQ:SetupConfigMenu()
        { text = "Hide faction paragon bars", check="hideFactionParagonBars" },
        { text = "Always show quests for faction...", isTitle = true },
        { text = "       Battle for Azeroth", submenu = {
+               { text = "Rustbolt Resistance", check="alwaysShowRustboltResistance" },     
                { text = "Tortollan Seekers", check="alwaysShowTortollanSeekers" },
                { text = "Champions of Azeroth", check="alwaysShowChampionsOfAzeroth" },
+               { text = ("|T%1$s:16:16|t  Waveblade Ankoan"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShowWavebladeAnkoan" },
                { text = ("|T%1$s:16:16|t  7th Legion"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShow7thLegion" },
                { text = ("|T%1$s:16:16|t  Storm's Wake"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShowStormsWake" },
                { text = ("|T%1$s:16:16|t  Order of Embers"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShowOrderOfEmbers" },
-               { text = ("|T%1$s:16:16|t  Proudmoore Admiralty"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShowProudmooreAdmiralty" },
+               { text = ("|T%1$s:16:16|t  Proudmoore Admiralty"):format("Interface\\Icons\\inv_misc_tournaments_banner_human"), check="alwaysShowProudmooreAdmiralty" },                   
+               { text = ("|T%1$s:16:16|t  The Unshackled"):format("Interface\\Icons\\inv_misc_tournaments_banner_orc"), check="alwaysShowTheUnshackled" },
                { text = ("|T%1$s:16:16|t  The Honorbound"):format("Interface\\Icons\\inv_misc_tournaments_banner_orc"), check="alwaysShowTheHonorbound" },
                { text = ("|T%1$s:16:16|t  Zandalari Empire"):format("Interface\\Icons\\inv_misc_tournaments_banner_orc"), check="alwaysShowZandalariEmpire" },
                { text = ("|T%1$s:16:16|t  Talanji's Expedition"):format("Interface\\Icons\\inv_misc_tournaments_banner_orc"), check="alwaysShowTalanjisExpedition" },
yoshimo commented 5 years ago

lets compare with https://github.com/xmyno/Broker_WorldQuests/pull/37 :)

yoshimo commented 5 years ago

@speedwaystar What about the Nazjatar Bodyguards, while we are talking about rep?

https://www.wowhead.com/currency=1745/nazjatar-bodyguard-neri-sharpfin https://www.wowhead.com/currency=1746/nazjatar-bodyguard-vim-brineheart https://www.wowhead.com/currency=1747/nazjatar-bodyguard-poen-gillbrack https://www.wowhead.com/currency=1748/nazjatar-bodyguard-bladesman-inowari https://www.wowhead.com/currency=1749/nazjatar-bodyguard-hunter-akana https://www.wowhead.com/currency=1750/nazjatar-bodyguard-farseer-ori

xmyno commented 5 years ago

I've tagged an alpha build with the changes merged from both of you. Can one of you check if everything is okay? Can't test myself at the moment.

Also thanks for collecting these changes!

xmyno commented 5 years ago

@yoshimo Are these bodyguard currencies world quest rewards? Maybe we can add them to this https://github.com/xmyno/Broker_WorldQuests/blob/master/WorldQuests.lua#L131

yoshimo commented 5 years ago

Kind of. Each day there is a blue quest in nazjatar where you select a bodyguard. When you chose one out of three 3 new quests appear on the map. They are marked with a blue ! and have the type combat ally quest. On the ptr they partially counted a worldquests. The reward where xp for the guard, mana pearls and gold. Not sure if that fulfills the definition of this addon and wether there are other quests to level them up. War resources quest from the table in Dazarlor maybe.

xmyno commented 5 years ago

If they are in the quests list returned by C_TaskQuest.GetQuestsForPlayerByMapID(mapId) I see no reason not to add them via the currency id array that I posted.

edit: Nevermind, It's experience, not reputation. So we would need something kind of new for it, but that wouldn't be a big hassle.

yoshimo commented 5 years ago

[6]={ mapID=1355, isCombatAllyQuest=true, questId=56035, y=0.2368351817131, x=0.48420137166977, numObjectives=1, isQuestStart=true, childDepth=0, inProgress=false, isDaily=true }, [7]={ mapID=1355, isCombatAllyQuest=false, questId=56057, y=0.3595604300499, x=0.83921849727631, numObjectives=3, isQuestStart=false, childDepth=0, inProgress=false, isDaily=false },

yes that lua function reports these quests.

Cluuey commented 5 years ago

I downloaded the zip from this commit: https://github.com/xmyno/Broker_WorldQuests/commit/a06a79cc7664692d1e29ecdad06a1062cf31254b

It's been working fine from what I can tell, I've not got to Mechagon yet but it is already listing the pet battle there. After you choose the bodyguard the three quests they offer show up as blue exclamation marks on the map, which indicates to me they're daily quests not world quests. They seem to have gone for a combination of the old daily quests and the new WQ ones they added with Legion.