View Single Post
09/17/20, 01:37 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,985
Afaik there is not such an event or easy method as it's just the normal loot.
You can maybe check the current name below the crosshair/reticle every 500milliseconds via RegisterForUpdate at the EVENT_MANAGER, starting at the time you have used a treasure map from your inventrory (but users must not use the map to dig for it so this would not always be the case!).
If the name is some treasure chest and the loot window opens afterwards you'd kind of know you are looting a treasure.

Maybe there is a better way but afaik there is no API function or similar.
Hint:
The BeamMeUp addon provides some treasure map checks and survey checks. It is somehow able to detect that you have looted the survey materials from the overland and if you got the same survey in your inventory again (so it must somehow know you currently ARE at the survey location AND are finihed with looting all of them) it will warn you with an onscreen message that you should leave the area and return to do the same survey loot again.
Maybe this code can help you for the treasure maps but I do not know how and where it was implemented in detail, sorry.
  Reply With Quote