changeset 540:b7f2e3b03853 7.3.0-1

Update for Patch 7.3.0, including a currency fix, constants update, and TOC bump.
author MMOSimca
date Wed, 30 Aug 2017 18:22:40 -0400
parents 1bcaf08ae424
children 9f5f023b361e
files Constants.lua Main.lua WoWDBProfiler.toc
diffstat 3 files changed, 105 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/Constants.lua	Fri Jun 16 03:58:13 2017 -0400
+++ b/Constants.lua	Wed Aug 30 18:22:40 2017 -0400
@@ -66,6 +66,7 @@
     [187534] = 127751,
     [231015] = 142447,
     [233325] = 143753,
+    [238040] = 146317,
 }
 
 -- Mapping of items that, when right-clicked, fire a spell (which can fail, so we have to check success).
@@ -419,6 +420,85 @@
     [243134] = 147384,
     [243135] = 147361,
     [243301] = 147875,
+    [244052] = 150581,
+    [246755] = 151470,
+    [246756] = 151471,
+    [246757] = 151469,
+    [246758] = 151468,
+    [246759] = 151464,
+    [246760] = 151466,
+    [246761] = 151465,
+    [246762] = 151467,
+    [247515] = 151638,
+    [249084] = 152102,
+    [249087] = 152105,
+    [249088] = 152106,
+    [249090] = 152107,
+    [249091] = 152108,
+    [252080] = 152649,
+    [252882] = 152733,
+    [252883] = 152735,
+    [252884] = 153144,
+    [252886] = 153154,
+    [252887] = 153156,
+    [252889] = 153141,
+    [252890] = 152742,
+    [252891] = 153135,
+    [252892] = 152740,
+    [252893] = 152734,
+    [252894] = 152736,
+    [252895] = 152738,
+    [253033] = 152799,
+    [253747] = 152922,
+    [253748] = 152923,
+    [254385] = 152650,
+    [254386] = 152652,
+    [254617] = 153142,
+    [254622] = 153150,
+    [254623] = 153158,
+    [254624] = 153136,
+    [254625] = 153152,
+    [254626] = 152743,
+    [254628] = 152737,
+    [254629] = 153146,
+    [254630] = 153138,
+    [254631] = 152744,
+    [254632] = 153140,
+    [254633] = 153148,
+    [254634] = 152739,
+    [254635] = 153149,
+    [254636] = 153157,
+    [254637] = 153137,
+    [254638] = 153145,
+    [254639] = 153153,
+    [254641] = 152741,
+    [254642] = 153143,
+    [254645] = 153151,
+    [254646] = 153139,
+    [254648] = 153147,
+    [254649] = 153155,
+    [254773] = 153215,
+    [254774] = 153209,
+    [254775] = 153208,
+    [254776] = 153206,
+    [254777] = 153210,
+    [254778] = 153205,
+    [254779] = 153212,
+    [254780] = 153207,
+    [254781] = 153214,
+    [254782] = 153216,
+    [254783] = 153211,
+    [254784] = 153213,
+    [254785] = 153059,
+    [254786] = 153060,
+    [254787] = 153061,
+    [254788] = 153062,
+    [254789] = 153063,
+    [254790] = 153064,
+    [254791] = 153065,
+    [254792] = 153066,
+    [254793] = 153067,
+    [254794] = 153068,
 }
 private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_BY_CLASS_ID_MAP = {
     [178209] = { [1] = 119318, [2] = 119305, [3] = 119318, [4] = 119315, [5] = 119305, [6] = 119315, [7] = 119318, [8] = 119315, [9] = 119305, [10] = 119318, [11] = 119315, },
@@ -475,8 +555,6 @@
     [49909] = true,
     [50160] = true,
     [50161] = true,
-    [50301] = true,
-    [54218] = true,
     [67414] = true,
     [69856] = true,
     [87701] = true,
@@ -540,21 +618,6 @@
     [95955] = true,
     [95956] = true,
     [95957] = true,
-    [96194] = true,
-    [96195] = true,
-    [96196] = true,
-    [96227] = true,
-    [96228] = true,
-    [96229] = true,
-    [96251] = true,
-    [96252] = true,
-    [96253] = true,
-    [96259] = true,
-    [96260] = true,
-    [96261] = true,
-    [96327] = true,
-    [96328] = true,
-    [96329] = true,
     [96566] = true,
     [96567] = true,
     [96568] = true,
@@ -570,25 +633,7 @@
     [96699] = true,
     [96700] = true,
     [96701] = true,
-    [96938] = true,
-    [96939] = true,
-    [96940] = true,
-    [96971] = true,
-    [96972] = true,
-    [96973] = true,
-    [96995] = true,
-    [96996] = true,
-    [96997] = true,
-    [97003] = true,
-    [97004] = true,
-    [97005] = true,
-    [97071] = true,
-    [97072] = true,
-    [97073] = true,
-    [97565] = true,
-    [102137] = true,
     [104260] = true,
-    [105751] = true,
     [110592] = true,
     [111598] = true,
     [111599] = true,
@@ -713,10 +758,12 @@
     [138476] = true,
     [139048] = true,
     [139049] = true,
+    [139467] = true,
     [139484] = true,
     [139486] = true,
     [139487] = true,
     [139488] = true,
+    [139706] = true,
     [139771] = true,
     [139879] = true,
     [139888] = true,
@@ -768,6 +815,8 @@
     [141995] = true,
     [142023] = true,
     [142342] = true,
+    [143606] = true,
+    [143607] = true,
     [143617] = true,
     [143948] = true,
     [146948] = true,
@@ -778,6 +827,10 @@
     [147520] = true,
     [147521] = true,
     [147905] = true,
+    [150924] = true,
+    [151557] = true,
+    [151558] = true,
+    [153132] = true,
 }
 for key, value in next, private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP do
     private.CONTAINER_ITEM_ID_LIST[value] = false
@@ -814,6 +867,12 @@
     [242970] = 117239, -- 7.2 Raid World Boss - Bonus Roll Prompt (Brutallus)
     [242971] = 117303, -- 7.2 Raid World Boss - Bonus Roll Prompt (Malificus)
     [242972] = 117470, -- 7.2 Raid World Boss - Bonus Roll Prompt (Si'vash)
+    --[254435] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
+    --[254437] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
+    --[254439] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
+    --[254441] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
+    --[254443] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
+    --[254446] = ???, -- 7.3 Raid World Boss - Bonus Roll Prompt (Unknown)
 
     -----------------------------------------------------------------------
     -- Hellfire Citadel
--- a/Main.lua	Fri Jun 16 03:58:13 2017 -0400
+++ b/Main.lua	Wed Aug 30 18:22:40 2017 -0400
@@ -313,45 +313,6 @@
 end -- do-block
 
 
-local CurrencyInfoToID
-local PopulateCurrencyInfoLookup
-do
-    local MAX_CURRENCY_ID_GAP = 800
-
-    local currency_info_lookup = {}
-
-
-	-- Going to have to support paths until Patch 7.2.5 comes out (after that, the 'tostring' use can go away)
-    function CurrencyInfoToID(name, texture_id)
-        if not name or not texture_id then return nil end
-        return currency_info_lookup[("%s:%s"):format(name, tostring(texture_id))]
-    end
-
-
-	-- Going to have to support paths until Patch 7.2.5 comes out (after that, the 'tostring' use can go away)
-    function PopulateCurrencyInfoLookup()
-        local currency_index = 1
-        local gap_since_last_currency = 0
-        repeat
-            -- Store ID by info (name and texture_id combined)
-            local name, _, texture_id = GetCurrencyInfo(currency_index)
-
-            -- If we found nothing, increment gap
-            if name and texture_id and name ~= "" and tostring(texture_id) ~= "0" and tostring(texture_id) ~= "" then
-				currency_info_lookup[("%s:%s"):format(name, tostring(texture_id))] = currency_index
-                gap_since_last_currency = 0
-            else
-                gap_since_last_currency = gap_since_last_currency + 1
-            end
-
-            -- Increment loop counter
-            currency_index = currency_index + 1
-
-        until (gap_since_last_currency > MAX_CURRENCY_ID_GAP)
-    end
-end
-
-
 local function InstanceDifficultyToken()
     -- Sometimes, instance information is returned when not in an instance. This check protects against that.
     if _G.IsInInstance() then
@@ -514,8 +475,7 @@
     if not currency_link then
         return nil
     end
-    return tonumber(currency_link:match("currency:(%d+)")) or 0
-    --texture_path:match("[^\\]+$"):lower()
+    return tonumber(tostring(currency_link):match("currency:(%d+)"))
 end
 
 
@@ -977,9 +937,6 @@
         languages_known[_G.GetLanguageByIndex(index)] = true
     end
 
-    -- Populate currency data from known currency information
-    PopulateCurrencyInfoLookup()
-
     -- These timers loop indefinitely using Lua's infinity constant
     item_process_timer_handle = C_Timer.NewTicker(DELAY_PROCESS_ITEMS, WDP.ProcessItems, math.huge)
     target_location_timer_handle = C_Timer.NewTicker(DELAY_UPDATE_TARGET_LOCATION, WDP.UpdateTargetLocation, math.huge)
@@ -1078,13 +1035,13 @@
 
     -- Get current continent and zones in current continent
     local continentIndex, continentID = GetCurrentMapContinent()
-	local continentMaps = { GetMapZones(continentIndex) }
+    local continentMaps = { GetMapZones(continentIndex) }
 
     -- Iterate over zones in continent
-	for i = 1, #continentMaps, 2 do
+    for i = 1, #continentMaps, 2 do
     
         -- Get data for World Quests
-		local api_data = C_TaskQuest.GetQuestsForPlayerByMapID(continentMaps[i], continentID);
+        local api_data = C_TaskQuest.GetQuestsForPlayerByMapID(continentMaps[i], continentID);
 
         -- Iterate over the questIDs for each map, doing preload reward requests and creating SavedVariables entries
         if api_data and type(api_data) == "table" and #api_data > 0 then
@@ -2553,20 +2510,22 @@
 
                     for cost_index = 1, item_count do
                         -- The third return (Blizz calls "currency_link") of GetMerchantItemCostItem only returns item links as of Patch 5.3.0.
-                        local texture_id, amount_required, item_link, name = _G.GetMerchantItemCostItem(item_index, cost_index)
+                        local texture_id, amount_required, hyperlink, name = _G.GetMerchantItemCostItem(item_index, cost_index)
 
                         -- Try to get item ID
-                        local item_id = ItemLinkToID(item_link)
+                        local item_id = ItemLinkToID(hyperlink)
 
                         -- FUTURE: At some point, we should make the output from these two cases (item_id vs currency_id) slightly different, so that WoWDB doesn't have to guess if it is a currency or item
                         -- Handle cases when the additional cost is another item
                         if item_id and item_id > 0 then
                             currency_list[#currency_list + 1] = ("(%s:%d)"):format(amount_required, item_id)
-                        -- Handle cases when the additional cost is another currency
                         else
-                            local currency_id = CurrencyInfoToID(name, texture_id)
+                            -- Try to get currency ID
+                            local currency_id = CurrencyLinkToID(hyperlink)
                             if currency_id and currency_id > 0 then
                                 currency_list[#currency_list + 1] = ("(%s:%d)"):format(amount_required, currency_id)
+                            else
+                                Debug("UpdateMerchantItems: Failed to get item ID and failed to get currency ID for item index %d and cost index %d", item_index, cost_index)
                             end
                         end
                     end
--- a/WoWDBProfiler.toc	Fri Jun 16 03:58:13 2017 -0400
+++ b/WoWDBProfiler.toc	Wed Aug 30 18:22:40 2017 -0400
@@ -1,4 +1,4 @@
-## Interface: 70200
+## Interface: 70300
 ## Title: WoWDB Profiler
 ## Notes: WoW datamining tool.
 ## Author: James D. Callahan III (Torhal)