View Single Post
08-15-20, 07:08 PM   #8
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,925
Ah .. it looks like they still haven't implemented the problems we noticed a few years back ..
https://www.wowinterface.com/forums/...ad.php?t=56622

I tried the following events to know joy .. whether QuestReward items or Quest Goals or actual Quest Items looted for the quest .. they never triggered at all.

f:RegisterEvent("QUEST_LOG_CRITERIA_UPDATE")
f:RegisterEvent("QUEST_LOOT_RECEIVED")

QUEST_LOG_UPDATE works often and best registered after QUEST_WATCH_UPDATE to have it trigger less often

However, QuestLogUpdate does not have any quest reference you can use to get specific quest details so you would have to look through all the quests you have to retrieve the information you need...

Here is the code I got kinda working .. it still has errors though..

Lua Code:
  1. local addonName, addonData = ...
  2.  
  3. local QuestIndexInfo = {}
  4. local ID_IDX = {}
  5. local QuestDataRequested = {}
  6.  
  7. local function EventWatcher(self,event,...)
  8.     local args = {...}
  9.     print(event)    
  10.     if event == "QUEST_ACCEPTED" then
  11.         ID_IDX[args[2]] = args[1]
  12.         QuestIndexInfo[args[1]] = {}
  13.         QuestIndexInfo[args[1]].ID = args[2]
  14.         QuestIndexInfo[args[1]].Name = C_QuestLog.GetQuestInfo(args[2])
  15.         self:RegisterEvent("QUEST_DATA_LOAD_RESULT")
  16.         C_QuestLog.RequestLoadQuestByID(args[2])
  17.         print("Accepted Quest ID ", args[2], " at index ", args[1], " named ", QuestIndexInfo[args[1]].Name)
  18.  
  19.     elseif event == "QUEST_WATCH_UPDATE" then
  20.         print("Quest Index: ", args[1])
  21.         self:RegisterEvent("QUEST_LOG_UPDATE")
  22.         local questID = QuestIndexInfo[args[1]].ID
  23.         self:RegisterEvent("QUEST_DATA_LOAD_RESULT")
  24.         C_QuestLog.RequestLoadQuestByID(questID)
  25.  
  26.     elseif event == "QUEST_LOG_UPDATE" then        
  27.         self:UnregisterEvent("QUEST_LOG_UPDATE")
  28.  
  29.     elseif event == "QUEST_LOG_CRITERA_UPDATE" then        
  30.         for i,v in pairs(args) do
  31.             print(i,v)
  32.         end
  33.  
  34.     elseif event == "QUEST_DATA_LOAD_RESULT" then
  35.         self:UnregisterEvent("QUEST_DATA_LOAD_RESULT")
  36.         print("QuestID: ",args[1],"Success:",args[2])
  37.         if not args[2] then return end
  38.         local questIndex = ID_IDX[args[1]]
  39.         QuestIndexInfo[questIndex].DataRequested = C_QuestLog.GetQuestObjectives(args[1])  
  40.         for i,v in pairs(QuestIndexInfo[questIndex].DataRequested) do
  41.             print(i,v)
  42.         end
  43.  
  44.     end    
  45. end
  46.  
  47. local f = CreateFrame("Frame")
  48. f:RegisterEvent("PLAYER_LOGIN")
  49. f:RegisterEvent("QUEST_ACCEPTED")
  50. f:RegisterEvent("QUEST_LOG_CRITERIA_UPDATE")
  51. f:RegisterEvent("QUEST_LOOT_RECEIVED")
  52. f:RegisterEvent("QUEST_WATCH_UPDATE")
  53. f:SetScript("OnEvent", EventWatcher)

Using this addon code .. When I first accepted the quest I told it to create a QuestIndex and QuestID and QuestInfo table so that I could keep it updated. At this point QuestID was 25545 and QuestIndex was 5 ... great, so far so good. Then QUEST_WATCH_UPDATE triggered when I picked up the loot for that new quest picked up. That's what we wanted right ? Yes, but this time it returned QuestIndex 3 not 5. And thats where the error happens .. as I have a QuestIndex 5 = QuestID 25545 connection and the reverse but not with QuestIndex 3.

Looking at the issues and the only solution to the issues .. there is simply no point as you would be practically creating your personal quest watching system.

Anyway, that's my thoughts on this and unfortunately it hasn't resolved the problem for you.

Hopefully someone has a better knowledge of quest info grabbing to get at the information you want .. but I really dont think there is a way until blizzard fixes these almost perfect events/functions only to have them mess up along the way or plain not work, at least for addons.
__________________


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
  Reply With Quote