Mercurial > wow > wowdb-profiler
comparison Main.lua @ 566:244aec3f15b0 8.0.1-5
Updated world quest parsing and recording to work on all continents, not just ones with emissaries.
author | Caleb Atherton <atcaleb@twitch.tv> |
---|---|
date | Wed, 01 Aug 2018 17:17:33 -0400 |
parents | 19c59ee05ab1 |
children | 1f472a5452a8 |
comparison
equal
deleted
inserted
replaced
565:19c59ee05ab1 | 566:244aec3f15b0 |
---|---|
31 | 31 |
32 local DatamineTT = _G.CreateFrame("GameTooltip", "WDPDatamineTT", _G.UIParent, "GameTooltipTemplate") | 32 local DatamineTT = _G.CreateFrame("GameTooltip", "WDPDatamineTT", _G.UIParent, "GameTooltipTemplate") |
33 DatamineTT:SetOwner(_G.WorldFrame, "ANCHOR_NONE") | 33 DatamineTT:SetOwner(_G.WorldFrame, "ANCHOR_NONE") |
34 | 34 |
35 | 35 |
36 -- CONSTANTS ---------------------------------------------------------- | 36 -- SIMPLE CONSTANTS ---------------------------------------------------------- |
37 | 37 |
38 local AF = private.ACTION_TYPE_FLAGS | 38 local AF = private.ACTION_TYPE_FLAGS |
39 local CLIENT_LOCALE = _G.GetLocale() | 39 local CLIENT_LOCALE = _G.GetLocale() |
40 local DB_VERSION = 19 | 40 local DB_VERSION = 19 |
41 local DEBUGGING = false | 41 local DEBUGGING = false |
42 local EVENT_DEBUG = false | 42 local EVENT_DEBUG = false |
43 | 43 |
44 -- Timer durations in seconds | 44 -- Timer durations in seconds |
45 local DELAY_PROCESS_ITEMS = 30 | 45 local DELAY_PROCESS_ITEMS = 30 |
46 local DELAY_PROCESS_WORLD_QUESTS = 60 | 46 local DELAY_PROCESS_WORLD_QUESTS = 90 |
47 local DELAY_UPDATE_TARGET_LOCATION = 0.5 | 47 local DELAY_UPDATE_TARGET_LOCATION = 0.5 |
48 | 48 |
49 local ITEM_ID_TIMBER = 114781 | 49 local ITEM_ID_TIMBER = 114781 |
50 | 50 |
51 local LOOT_SLOT_CURRENCY = _G.LOOT_SLOT_CURRENCY | 51 local LOOT_SLOT_CURRENCY = _G.LOOT_SLOT_CURRENCY |
66 local PLAYER_LEVEL = _G.UnitLevel("player") | 66 local PLAYER_LEVEL = _G.UnitLevel("player") |
67 local PLAYER_NAME = _G.UnitName("player") | 67 local PLAYER_NAME = _G.UnitName("player") |
68 local PLAYER_RACE = _G.select(2, _G.UnitRace("player")) | 68 local PLAYER_RACE = _G.select(2, _G.UnitRace("player")) |
69 | 69 |
70 local SPELL_ID_UPDATE_INTERACTIONS = 161006 | 70 local SPELL_ID_UPDATE_INTERACTIONS = 161006 |
71 | |
72 local UI_MAP_COSMIC = 946 | |
71 | 73 |
72 local ALLOWED_LOCALES = { | 74 local ALLOWED_LOCALES = { |
73 enUS = true, | 75 enUS = true, |
74 enGB = true, | 76 enGB = true, |
75 enTW = true, | 77 enTW = true, |
1010 | 1012 |
1011 function WDP:ProcessWorldQuests() | 1013 function WDP:ProcessWorldQuests() |
1012 -- Ignore if player is low level (there are some world quests before max level now, but we can collect enough data from 110s alone still) | 1014 -- Ignore if player is low level (there are some world quests before max level now, but we can collect enough data from 110s alone still) |
1013 if _G.UnitLevel("player") < 110 then return end | 1015 if _G.UnitLevel("player") < 110 then return end |
1014 | 1016 |
1015 local current_ui_map_id = C_Map.GetBestMapForUnit("player") | 1017 -- Check all first-order continents |
1016 local bounty_maps = MapUtil.GetRelatedBountyZoneMaps(current_ui_map_id) | 1018 local continents = C_Map.GetMapChildrenInfo(UI_MAP_COSMIC, Enum.UIMapType.Continent, true); |
1017 | 1019 for i, continentInfo in ipairs(continents) do |
1018 -- Iterate over zones in continent | 1020 |
1019 for i = 1, #bounty_maps do | 1021 -- Get continent data for World Quests |
1020 | 1022 local continent_api_data = C_TaskQuest.GetQuestsForPlayerByMapID(continentInfo.mapID) |
1021 -- Get data for World Quests | 1023 |
1022 local api_data = C_TaskQuest.GetQuestsForPlayerByMapID(bounty_maps[i]); | 1024 -- If the continent has WQ data, continue |
1023 local continent_ui_map_id = MapUtil.GetMapParentInfo(bounty_maps[i], _G.Enum.UIMapType.Continent) | 1025 if continent_api_data and type(continent_api_data) == "table" and #continent_api_data > 0 then |
1024 | 1026 -- Iterate over zones on continents |
1025 -- Iterate over the questIDs for each map, doing preload reward requests and creating SavedVariables entries | 1027 local zones = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Zone) |
1026 if api_data and type(api_data) == "table" and #api_data > 0 then | 1028 for j, zoneInfo in ipairs(zones) do |
1027 for j = 1, #api_data do | 1029 |
1028 | 1030 -- Get zone data for World Quests |
1029 -- Check if we had a valid API table returned to us | 1031 local zone_api_data = C_TaskQuest.GetQuestsForPlayerByMapID(zoneInfo.mapID); |
1030 if api_data[j] and type(api_data[j]) == "table" and api_data[j].questId then | 1032 |
1031 local quest_id = tonumber(api_data[j].questId) or 0 | 1033 -- Iterate over the questIDs for each zone, doing preload reward requests and creating SavedVariables entries |
1032 | 1034 if zone_api_data and type(zone_api_data) == "table" and #zone_api_data > 0 then |
1033 -- Check if we have quest data | 1035 for k = 1, #zone_api_data do |
1034 if quest_id > 0 and _G.HaveQuestData(quest_id) and QuestUtils_IsQuestWorldQuest(quest_id) and api_data[j].mapID == bounty_maps[i] then | 1036 |
1035 _G.C_TaskQuest.RequestPreloadRewardData(quest_id) | 1037 -- Check if we had a valid API table returned to us |
1036 RecordWorldQuestData(quest_id, api_data[j]) | 1038 if zone_api_data[k] and type(zone_api_data[k]) == "table" and zone_api_data[k].questId then |
1039 local quest_id = tonumber(zone_api_data[k].questId) or 0 | |
1040 | |
1041 -- Check if we have quest data and the quest is within this zone directly | |
1042 if quest_id > 0 and _G.HaveQuestData(quest_id) and QuestUtils_IsQuestWorldQuest(quest_id) and zone_api_data[k].mapID == zoneInfo.mapID then | |
1043 _G.C_TaskQuest.RequestPreloadRewardData(quest_id) | |
1044 RecordWorldQuestData(quest_id, zone_api_data[k]) | |
1045 end | |
1046 end | |
1037 end | 1047 end |
1038 end | 1048 end |
1039 end | 1049 end |
1040 end | 1050 end |
1041 end | 1051 end |