View Single Post
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