nUI Maintainer
Join Date: Feb 2006
Posts: 5,934
|
Originally Posted by MuffinManKen
The Emissary quest itself is a normal (though hidden) quest in your log, so it should just be a matter of detecting when a quest has had all of its objectives completed and is ready to turn in. World Quests are just part of the objectives.
|
The following are Quest Complete events which hopefully one will flag up on all emissary world quests
QUEST_COMPLETE - you will need to identify which questID is complete via other means
QUEST_AUTOCOMPLETE questID of the quest autocompleted
WORLD_QUEST_COMPLETED_BY_SPELL questID of the world quest completed
I suspect the last one is the one you need to monitor and react on the questID returned
Using the information in this Blizzard code file ( which is the code behind the emissary bounty board ) I managed to rig up what I would initially do to gather a list of available quests in the world for a particular bounty. I put it in PLAYER_ENTERING_WORLD so test for arg1 being true to only run this when you first log in. However, it only produced the list after doing a reload of the UI until I made sure that the blizzard addons ( Blizzard_WorldMap and Blizzard_ObjectiveTracker) were loaded as soon as mine was. Although it doesn't seem consistent so it may take some investigation to find the right time to generate the list. Also, the bounty board faction names have 'Other' for one of them but you can get the correct factionID and name from the task info itself using this:
Lua Code:
local isWorldQuest = QuestUtils_IsQuestWorldQuest(taskInfo.questId) local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(taskInfo.questId) local factionName = factionID and GetFactionInfoByID(factionID) or "No Faction" local zoneTaskInfo = { ["Zone"] = zoneInfo.name, ["QuestID"] = taskInfo.questId, ["FactionID"] = factionID, ["FactionName"] = factionName, ["QuestTitle"] = questTitle, ["Completed"] = IsQuestComplete(taskInfo.questId), }
https://www.townlong-yak.com/framexm...ountyBoard.lua
Feel free to utilise this code to get your addon idea working. It has definitely give me some ideas to look into at some point.
My code to ensure the information is available at PlayerEnteringWorld.
Lua Code:
local function OnEvent(self,event,...) local args = {...} if event == "ADDON_LOADED" and args[1] == addonName then if not IsAddOnLoaded("Blizzard_WorldMap") then LoadAddOn("Blizzard_WorldMap") end if not IsAddOnLoaded("Blizzard_ObjectiveTracker") then LoadAddOn("Blizzard_ObjectiveTracker") end elseif event == "PLAYER_ENTERING_WORLD" and args[1] == true then UpdateBountyQuestList() end end local eventWatcher = CreateFrame("Frame") eventWatcher:RegisterEvent("ADDON_LOADED") eventWatcher:RegisterEvent("PLAYER_ENTERING_WORLD") eventWatcher:SetScript("OnEvent",OnEvent)
My code to generate a list of quests per zone along with their bounty related details
Lua Code:
local mapInfo = {} local getAncestor = true local getDescendants = true local cosmicMapID = 946 mapInfo.cosmicMapInfo = MapUtil.GetMapParentInfo(cosmicMapID, Enum.UIMapType.Cosmic, getAncestor) mapInfo.Continents = C_Map.GetMapChildrenInfo(mapInfo.cosmicMapInfo.mapID, Enum.UIMapType.Continent, getDescendants) for i,continentInfo in ipairs(mapInfo.Continents) do continentInfo.Zones = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Zone, getDescendants) for i,zoneInfo in ipairs(continentInfo.Zones) do local bounties, displayLocation, lockedQuestID = GetQuestBountyInfoForMapID(zoneInfo.mapID); local tasks = C_TaskQuest.GetQuestsForPlayerByMapID(zoneInfo.mapID) -- bounties = { numObjectives, questID, icon, factionID } -- tasks = { questId, questName, factionID } for k,taskInfo in ipairs(tasks) do local isWorldQuest = QuestUtils_IsQuestWorldQuest(taskInfo.questId) local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(taskInfo.questId) local factionName = factionID and GetFactionInfoByID(factionID) or "No Faction" if (taskInfo and isWorldQuest) then for j,bountyInfo in ipairs(bounties) do local isBountyQuest = IsQuestCriteriaForBounty(taskInfo.questId, bountyInfo.questID) local factionName = GetFactionInfoByID(bountyInfo.factionID) if isBountyQuest then print("Bounty Tasks: ", zoneInfo.name, bountyInfo.questID, bountyInfo.factionID, factionName, taskInfo.questId, questTitle, IsQuestComplete(taskInfo.questId)) end end end end end end
Writing this out to a saved variables file resulted in the following output
Code:
EmissaryQuestDetails = {
[0] = {
["completeCount"] = 0,
["name"] = "Other",
["Quests"] = {
[790] = {
},
[630] = {
{
["Completed"] = false,
["QuestID"] = 46126,
["QuestTitle"] = "Fel-Corrupted Feathers",
["Zone"] = "Azsuna",
}, -- [1]
},
[646] = {
{
["Completed"] = false,
["QuestID"] = 46111,
["QuestTitle"] = "Illidari Masters: Sissix",
["Zone"] = "Broken Shore",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 46201,
["QuestTitle"] = "By Water Be Purged",
["Zone"] = "Broken Shore",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 46126,
["QuestTitle"] = "Fel-Corrupted Feathers",
["Zone"] = "Broken Shore",
}, -- [3]
{
["Completed"] = false,
["QuestID"] = 45472,
["QuestTitle"] = "Kraken Eggs",
["Zone"] = "Broken Shore",
}, -- [4]
{
["Completed"] = false,
["QuestID"] = 46068,
["QuestTitle"] = "Brute Wrangling",
["Zone"] = "Broken Shore",
}, -- [5]
{
["Completed"] = false,
["QuestID"] = 46236,
["QuestTitle"] = "Stonebound Soldiers",
["Zone"] = "Broken Shore",
}, -- [6]
},
[641] = {
},
[650] = {
},
[680] = {
},
[885] = {
},
[634] = {
},
},
},
[1883] = {
["completeCount"] = 0,
["name"] = "Dreamweavers",
["Quests"] = {
[790] = {
},
[630] = {
},
[646] = {
},
[641] = {
{
["Completed"] = false,
["QuestID"] = 44895,
["QuestTitle"] = "Sharptalon Swarm!",
["Zone"] = "Val'sharah",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 43183,
["QuestTitle"] = "Warden Tower Assault: Starstalker's Point",
["Zone"] = "Val'sharah",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 42087,
["QuestTitle"] = "Green Horror",
["Zone"] = "Val'sharah",
}, -- [3]
{
["Completed"] = false,
["QuestID"] = 43457,
["QuestTitle"] = "WANTED: Theryssia",
["Zone"] = "Val'sharah",
}, -- [4]
{
["Completed"] = false,
["QuestID"] = 41961,
["QuestTitle"] = "Black Rook Holdings",
["Zone"] = "Val'sharah",
}, -- [5]
{
["Completed"] = false,
["QuestID"] = 42075,
["QuestTitle"] = "Botanical Backlash",
["Zone"] = "Val'sharah",
}, -- [6]
{
["Completed"] = false,
["QuestID"] = 44033,
["QuestTitle"] = "Aw, Nuts!",
["Zone"] = "Val'sharah",
}, -- [7]
},
[650] = {
{
["Completed"] = false,
["QuestID"] = 42087,
["QuestTitle"] = "Green Horror",
["Zone"] = "Highmountain",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 43457,
["QuestTitle"] = "WANTED: Theryssia",
["Zone"] = "Highmountain",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 44895,
["QuestTitle"] = "Sharptalon Swarm!",
["Zone"] = "Highmountain",
}, -- [3]
{
["Completed"] = false,
["QuestID"] = 41961,
["QuestTitle"] = "Black Rook Holdings",
["Zone"] = "Highmountain",
}, -- [4]
{
["Completed"] = false,
["QuestID"] = 42075,
["QuestTitle"] = "Botanical Backlash",
["Zone"] = "Highmountain",
}, -- [5]
{
["Completed"] = false,
["QuestID"] = 44033,
["QuestTitle"] = "Aw, Nuts!",
["Zone"] = "Highmountain",
}, -- [6]
},
[680] = {
{
["Completed"] = false,
["QuestID"] = 42087,
["QuestTitle"] = "Green Horror",
["Zone"] = "Suramar",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 42075,
["QuestTitle"] = "Botanical Backlash",
["Zone"] = "Suramar",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 44033,
["QuestTitle"] = "Aw, Nuts!",
["Zone"] = "Suramar",
}, -- [3]
},
[885] = {
},
[634] = {
},
},
},
[1859] = {
["completeCount"] = 0,
["name"] = "The Nightfallen",
["Quests"] = {
[790] = {
},
[630] = {
{
["Completed"] = false,
["QuestID"] = 42169,
["QuestTitle"] = "Left for Dead",
["Zone"] = "Azsuna",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 44799,
["QuestTitle"] = "Safe Keeping",
["Zone"] = "Azsuna",
}, -- [2]
},
[646] = {
},
[641] = {
{
["Completed"] = false,
["QuestID"] = 42082,
["QuestTitle"] = "The Shattered Locus",
["Zone"] = "Val'sharah",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 41280,
["QuestTitle"] = "Huge Runescale Koi",
["Zone"] = "Val'sharah",
}, -- [2]
},
[650] = {
},
[680] = {
{
["Completed"] = false,
["QuestID"] = 42169,
["QuestTitle"] = "Left for Dead",
["Zone"] = "Suramar",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 42082,
["QuestTitle"] = "The Shattered Locus",
["Zone"] = "Suramar",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 42799,
["QuestTitle"] = "DANGER: Oglok the Furious",
["Zone"] = "Suramar",
}, -- [3]
{
["Completed"] = false,
["QuestID"] = 44817,
["QuestTitle"] = "Stirring the Swarm",
["Zone"] = "Suramar",
}, -- [4]
{
["Completed"] = false,
["QuestID"] = 44799,
["QuestTitle"] = "Safe Keeping",
["Zone"] = "Suramar",
}, -- [5]
{
["Completed"] = false,
["QuestID"] = 41280,
["QuestTitle"] = "Huge Runescale Koi",
["Zone"] = "Suramar",
}, -- [6]
},
[885] = {
},
[634] = {
{
["Completed"] = false,
["QuestID"] = 42799,
["QuestTitle"] = "DANGER: Oglok the Furious",
["Zone"] = "Stormheim",
}, -- [1]
{
["Completed"] = false,
["QuestID"] = 44817,
["QuestTitle"] = "Stirring the Swarm",
["Zone"] = "Stormheim",
}, -- [2]
{
["Completed"] = false,
["QuestID"] = 41280,
["QuestTitle"] = "Huge Runescale Koi",
["Zone"] = "Stormheim",
}, -- [3]
},
},
},
}
Last edited by Xrystal : 08-31-18 at 07:00 AM.
|