Thread Tools Display Modes
08-30-18, 10:07 AM   #1
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
Detecting when a player has completed an Emissary quest

I'm trying to detect when the player completes the objectives for an Emissary quest ("Complete 4 World Quests in Drustvar").

With Paragon reward quests I was able to detect that via QUEST_ACCEPTED, but with Emissary quests you actually accept it as soon as the Emissary is available on the World Map.

So I tried QUEST_WATCH_UPDATE and then check if there are no incomplete objectives, but at the time of that event the update hasn't necessarily happened.

Is there an event I can listen to that will do what I need, or do I need to mess around with timers so I can catch delayed updates?
  Reply With Quote
08-30-18, 11:16 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
You could try /eventtrace ( I think that's what it is called ). You may have to activate it shortly before you complete it and clear out ( click the x ) the events you definitely aren't interested in. Once it stops throwing out events happening around you, start working towards completion of that last world quest and see what events trigger.

I don't recall seeing any world quest specific events off the top of my head nor any world quest specific function.
__________________
  Reply With Quote
08-30-18, 12:41 PM   #3
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
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.
  Reply With Quote
08-30-18, 05:53 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by MuffinManKen View Post
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:
  1. local isWorldQuest = QuestUtils_IsQuestWorldQuest(taskInfo.questId)
  2. local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(taskInfo.questId)
  3. local factionName = factionID and GetFactionInfoByID(factionID) or "No Faction"
  4. local zoneTaskInfo =   {
  5.     ["Zone"] = zoneInfo.name,
  6.     ["QuestID"] = taskInfo.questId,
  7.     ["FactionID"] = factionID,
  8.     ["FactionName"] = factionName,
  9.     ["QuestTitle"] = questTitle,
  10.     ["Completed"] = IsQuestComplete(taskInfo.questId),
  11. }

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:
  1. local function OnEvent(self,event,...)
  2.     local args = {...}
  3.     if event == "ADDON_LOADED" and args[1] == addonName then
  4.         if not IsAddOnLoaded("Blizzard_WorldMap") then
  5.             LoadAddOn("Blizzard_WorldMap")            
  6.         end
  7.         if not IsAddOnLoaded("Blizzard_ObjectiveTracker") then
  8.             LoadAddOn("Blizzard_ObjectiveTracker")
  9.         end
  10.        
  11.     elseif event == "PLAYER_ENTERING_WORLD" and args[1] == true then
  12.         UpdateBountyQuestList()
  13.        
  14.     end        
  15. end
  16.  
  17. local eventWatcher = CreateFrame("Frame")
  18. eventWatcher:RegisterEvent("ADDON_LOADED")
  19. eventWatcher:RegisterEvent("PLAYER_ENTERING_WORLD")
  20. eventWatcher:SetScript("OnEvent",OnEvent)

My code to generate a list of quests per zone along with their bounty related details
Lua Code:
  1. local mapInfo = {}
  2.     local getAncestor = true
  3.     local getDescendants = true
  4.     local cosmicMapID = 946
  5.     mapInfo.cosmicMapInfo = MapUtil.GetMapParentInfo(cosmicMapID, Enum.UIMapType.Cosmic, getAncestor)
  6.     mapInfo.Continents = C_Map.GetMapChildrenInfo(mapInfo.cosmicMapInfo.mapID, Enum.UIMapType.Continent, getDescendants)
  7.     for i,continentInfo in ipairs(mapInfo.Continents) do
  8.         continentInfo.Zones = C_Map.GetMapChildrenInfo(continentInfo.mapID, Enum.UIMapType.Zone, getDescendants)
  9.         for i,zoneInfo in ipairs(continentInfo.Zones) do
  10.             local bounties, displayLocation, lockedQuestID = GetQuestBountyInfoForMapID(zoneInfo.mapID);
  11.             local tasks = C_TaskQuest.GetQuestsForPlayerByMapID(zoneInfo.mapID)
  12.             -- bounties = { numObjectives, questID, icon, factionID }
  13.             -- tasks = { questId, questName, factionID }
  14.             for k,taskInfo in ipairs(tasks) do
  15.                 local isWorldQuest = QuestUtils_IsQuestWorldQuest(taskInfo.questId)
  16.                 local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(taskInfo.questId)
  17.                 local factionName = factionID and GetFactionInfoByID(factionID) or "No Faction"
  18.                 if (taskInfo and isWorldQuest) then
  19.                     for j,bountyInfo in ipairs(bounties) do
  20.                         local isBountyQuest = IsQuestCriteriaForBounty(taskInfo.questId, bountyInfo.questID)
  21.                         local factionName = GetFactionInfoByID(bountyInfo.factionID)
  22.                         if isBountyQuest then
  23.                             print("Bounty Tasks: ", zoneInfo.name, bountyInfo.questID, bountyInfo.factionID, factionName, taskInfo.questId, questTitle, IsQuestComplete(taskInfo.questId))
  24.                         end
  25.                     end
  26.                 end
  27.             end
  28.         end
  29.     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.
  Reply With Quote
08-31-18, 07:17 AM   #5
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
That's a very different direction than I was going, but I guess it would work. I was trying to track the completion of the master Emissary quest, but I guess if I have a list of the WQs that would satisfy it I could use the completion of THOSE quests to trigger the check to see if the Emissary is done.

I thought I'd found the perfect event: QUEST_LOG_CRITERIA_UPDATE. The payload is a quest id, description of the criteria, how many of the criteria you've fulfilled and the number needed. It was followed by code that looked like what puts the "Gathered feathers: 6/9" up on the UI whenever you advance a quest. The only problem? The event never fires. Never. I checked with my code and verified with eventtrace. Wherever the code is that puts up the quest progress, I can't find it.
  Reply With Quote
08-31-18, 08:04 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by MuffinManKen View Post
That's a very different direction than I was going, but I guess it would work. I was trying to track the completion of the master Emissary quest, but I guess if I have a list of the WQs that would satisfy it I could use the completion of THOSE quests to trigger the check to see if the Emissary is done.

I thought I'd found the perfect event: QUEST_LOG_CRITERIA_UPDATE. The payload is a quest id, description of the criteria, how many of the criteria you've fulfilled and the number needed. It was followed by code that looked like what puts the "Gathered feathers: 6/9" up on the UI whenever you advance a quest. The only problem? The event never fires. Never. I checked with my code and verified with eventtrace. Wherever the code is that puts up the quest progress, I can't find it.
I thought I would add the extra information as I wasn't sure what your addon as a whole was aiming to do. On my Emissary Quest idea I would have available all the quests for each emissary available for the user and also monitor events for completion which invariably only returns the questID so being able to access a table of details accessible by questID or mapID would be advantageous rather than grab the data again unnecessarily.

That WORLD_QUEST_COMPLETED_BY_SPELL may be for the emissary quest as that wasn't there before so is new to either Legion or BfA. I would suggest you try that event alongside the other QUEST_COMPLETE/QUEST_AUTOCOMPLETE events and see which triggers when. I also noticed QUEST_TURNED_IN event which may or may not have been there before but that returns questID and this may trigger before QUEST_COMPLETE does so you test for the questID last turned in when you get a QUEST_COMPLETE event appear. Just an idea to consider anyway. After some tests QUEST_COMPLETE gets called before QUEST_TURNED_IN. So it may be the latter you need to monitor for manual quest completes.

This is the Blizzard API Documentation for the Quest System
https://github.com/tomrus88/Blizzard...umentation.lua

If you work on the following understanding it may help highlight potential functions and events.

QUEST -> access to all quest information
TASK -> access to world quests / world objectives quest information
BOUNTY -> access to emissary quest details

Also, identified the event to wait for before generating a list of quests ..
QUEST_LOG_UPDATE

This triggers several times so may help with keeping your list ( if you have one ) updated. Although you can always disable it if you don't want to use it more than the one time when you log in.

Edit:
Okay, Just doing some world quests for the emissary .. so will note what I found
QUEST_TURNED_IN triggers when you complete a world quest as well returning a questID and the xp and money rewards given.
QUEST_TURNED_IN triggers when you hand in the Emissary quest .. however, it didn't turn up with the same questID I had stored before .. but just as I started this quest run the daily quests ticked over which changed the bounty order. So it is possible that each day a different quest for the emissary is used. So you will likely need the bounty information at least before you start doing them. Especially once you complete them you can't see them anymore, makes sense I suppose, annoying as I was hoping to find out whether the questID for the emissary turn in was the same as the one on the map but too late now to test. As I said before will probably need a few tests to get the right order of process for your addon to work.

Edit2: Final findings
If you do the retrieval of the bounty info at the continent level it will result in less output if printing at the same time.
Lua Code:
  1. local bounties, displayLocation, lockedQuestID = GetQuestBountyInfoForMapID(continentInfo.mapID)
This in essence will tell you that the continent specified by the map has bounties if the bounties table has entries. This seems to be the only way to get information on those emissary quests so you will need to fill that table when people first log in and the quest log updates. And as I found out, it will only list those bounties able to be done.
Also noticed that more than one bounty may be achieved by one quest ( if I am coding this right rofl)
The following code blocked marked Darkheart Thicket quest as being for both Kirin Tor and Dreamweavers bounties, handy to know if you want to do the least work for the most results
Lua Code:
  1. local isBountyQuest1 = bounties[1] and IsQuestCriteriaForBounty(taskInfo.questId, bounties[1].questID)
  2. local isBountyQuest2 = bounties[2] and IsQuestCriteriaForBounty(taskInfo.questId, bounties[2].questID)
  3. local isBountyQuest3 = bounties[3] and IsQuestCriteriaForBounty(taskInfo.questId, bounties[3].questID)
__________________

Last edited by Xrystal : 08-31-18 at 10:33 AM.
  Reply With Quote
08-31-18, 10:17 AM   #7
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
Okay, I have things working the way I want. I'll document it all here in case it's helpful to someone else.

My goal is to show players a Toast when they have an Emissary or Paragon reward to claim.

On login, this is easy. I just scan all of the known Emissary and Paragon quests on PLAYER_ENTERING_WORLD to see if the player has one and it's objectives are complete. There are less than a dozen so this is nice, fast, and easy. (Actually it runs on a 4 second timer after this event). I will probably change this to use QUEST_LOG_UPDATE as you noted since it should be more reliable than a timer.

When the player earns a Paragon reward while logged in, there's a QUEST_ACCEPTED. It has a quest_id with its payload, so that's a simple dictionary look up to see if it's a Quest I care about.

Emissary quests are another matter since you automatically accept them when they're available, though they are hidden from your quest log. On QUEST_WATCH_UPDATE I check if it's an Emissary quest that was updated. I can't then check if the Emissary quest is complete because that event fires BEFORE the completion info is updated. Instead I note which emissary quest it was. On successive QUEST_LOG_UPDATES I then check the completion status of the emissary quests that I noted. If one is completed, I show a toast.

It's a shame that QUEST_LOG_CRITERIA_UPDATE appears to not be implemented since it looks like it would be a much simpler process.
  Reply With Quote
08-31-18, 10:36 AM   #8
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I did notice the Emissary Quest appeared in the log after all 4 quests were completed, all it says is to turn in to get the reward .. so maybe a QUEST_ACCEPTED check for the Emissary QuestID ( assuming its the same) will help speed the process. I hadn't had that set up to see the output so can't confirm there yet.

But glad that you sorted out or getting closer to your toast addon requirements. Good luck.

The reason why QUEST_LOG_CRITERIA_UPDATE doesn't work for Emissary quests is because they are used for the criteria for quests with physical critera. Seeing as Emissary quests can be any 4 quests there isn't really a criteria flag to monitor for.

So, what I can see as a possible chain of events are ..

QUEST_TURNED_IN > questID .. is questID for one of your available bounties ? bountyQuestCount + 1 update display ( pretend criteria )
QUEST_ACCEPTED > questID .. is this a bountyQuest ? show toast
QUEST_TURNED_IN > questID .. is this a bountyQuest ? hide toast if not on a display timer

Or something to that affect

Edit:
QUEST_ACCEPTED still works and returns the QuestLogIndex and the QuestID. With various functions using one or the other so it appears you will need to identify both at the same time and/or store it somewhere until you need to use one with knowledge of the other.. EG an Index2ID table as you can get the Index from the ID via a function GetQuestLogIndexByID(id)

QUEST_LOG_UPDATE updates whenever the questmap is open and closed and when an individual quest entry is updated in the log. So, you can use the QUEST_LOG_UPDATED to check if any of the quests are completed but unfortunately only via going through the whole list.
__________________

Last edited by Xrystal : 08-31-18 at 11:30 AM.
  Reply With Quote
08-31-18, 11:16 AM   #9
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
Originally Posted by Xrystal View Post
I did notice the Emissary Quest appeared in the log after all 4 quests were completed, all it says is to turn in to get the reward .. so maybe a QUEST_ACCEPTED check for the Emissary QuestID ( assuming its the same) will help speed the process. I hadn't had that set up to see the output so can't confirm there yet.
You're actually on the quest as soon as the emissary is available, it's just hidden. I guess I could scan for the quests on login and then catch any QUEST_ACCEPTED in case you're logged in during the daily reset.
The reason why QUEST_LOG_CRITERIA_UPDATE doesn't work for Emissary quests is because they are used for the criteria for quests with physical critera. Seeing as Emissary quests can be any 4 quests there isn't really a criteria flag to monitor for.
No, it's not firing at all. I did a WQ gathering feathers. The UI showed my progress ("Gathered: 6 of 9 feathers"), but that event did not fire. I tried a normal quest ("Kill 10 Ashvane guards") and no event.
  Reply With Quote
08-31-18, 11:34 AM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by MuffinManKen View Post
You're actually on the quest as soon as the emissary is available, it's just hidden. I guess I could scan for the quests on login and then catch any QUEST_ACCEPTED in case you're logged in during the daily reset.

No, it's not firing at all. I did a WQ gathering feathers. The UI showed my progress ("Gathered: 6 of 9 feathers"), but that event did not fire. I tried a normal quest ("Kill 10 Ashvane guards") and no event.
No, I meant after you get all 4 world quests completed your emissary quest then appears in your log. It showed on my screen telling me I can now go to my emissary to hand it in to receive the rewards for completing the quests. I don't have any QUEST_ACCEPT events for my uncompleted emissary quests. Only the one I completed all 4 quests for. After all it doesn't know you have even started it until you make the first kill/find for a world quest they are interested in.

And yes I now agree with you on the other events. It appears they have removed them sometime since I last played with my ObjectiveTracker addon which was before Legion went beta.

Edit:
Okay, just completed the Dreamweavers quests and I got the following Events Trigger out of the 8 I am watching for.

QUEST_LOG_UPDATE every time I do something to change the quest status, and when I open the map which also updates the quest log now.

QUEST_TURNED_IN whenever I complete a world quest as they automatically turn in when complete and cause the Emissary Quest markers to tick as I go through them.

Once all 4 quests are done the Emissary Quest pops up in your quest log under the name of the faction.

The Dreamweavers
Complete any 4 world quests in Val'sharah
4/4 Completed

I am going to see if I can confirm that the quest ID for this quest is the same as the bounty quest id as that may help as you then only need to check each questID in the questLog every QuestLogUpdate for one that matches the three emissary quest IDs. In theory. Will let you know the outcome.
__________________

Last edited by Xrystal : 08-31-18 at 12:09 PM.
  Reply With Quote
08-31-18, 12:34 PM   #11
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Oh, I found a way for you to keep track of the status ..

local objectives = C_QuestLog.GetQuestObjectives(bountyInfo.questID)
for objIndex, objInfo in ipairs(objectives) do
print(objIndex,objInfo.type,objInfo.text,objInfo.numRequired,objInfo.numFulfilled, objInfo.finished)
end

On my 2 emissary quests yet to complete/turn in this is what that print line returned for each bounty/emissary

1 object 4/4 Complete 4 world quests in Val'sharah 4 4 true
1 object 0/3 Complete 3 Kirin Tor World Quests 3 0 false

But unfortunately no Objectives update.. however, I just noticed the TASK_PROGRESS_UPDATE which may be what they now use instead of the Objectives Update one. Testing it with my last remaining emissary quest chain.

Edit:
Still no TASK_PROGRESS_UPDATE event flagging up yet but I did find that the C_QuestLog.GetQuestObjectives(bountyInfo.questID) function only returns data when you first build the bountyInfo from the map for some reason, despite calling it with the questID again, after that first update cycle it only returns nil.

Just to confirm that as long as you rebuild the bounty info on each QUEST_LOG_UPDATE ( at least until a better event is found ) you will get an update to the emissary criteria. Done all my Emissary Quests now so will take another stab again another day to try and narrow it down to a simple set of tables.

But I think for your scenario a simple check for "QUEST_TURNED_IN" to identify which quests you have completed that relate to one of the emissary quests and the emissary quest itself. And also "QUEST_LOG_UPDATE" to find out which emissary quests you have access to.

And to confirm my earlier thoughts. The Emissary Quest that appears in your Log when all the world quests linked to them are completed that they want, has the same QuestID that you can get from the Bounty List request.
__________________

Last edited by Xrystal : 08-31-18 at 08:01 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Detecting when a player has completed an Emissary quest

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off