View Single Post
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,934
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)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 08-31-18 at 10:33 AM.
  Reply With Quote