Thread: Track Dolmen
View Single Post
07/18/15, 10:50 AM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I don't know enough about achievements, but maybe this will give you an Idea.
Like sirinsidiator said this should work until they max out the Anchor Devastater achievement at 250 anchors. After that though, unless the achievement updated event keeps firing to keep track of how many you have completed, I don't know any other easy way to do it.

Lua Code:
  1. -- id (621): Anchor Devastater
  2. local function OnAchievementUpdated(eventCode, id)
  3.     if id == 621 then
  4.         -- Do you want to separate the counters
  5.         -- for each individual dolmen?
  6.         -- if so figure out which one they completed like this:
  7.         local zone, poi = GetCurrentSubZonePOIIndices()
  8.         local dolmenName = GetPOIInfo(zone, poi)
  9.         UpdateDolmenCounter(dolmenName)
  10.     end
  11. end
  12. EVENT_MANAGER:RegisterForEvent(ADDON_NAME,  EVENT_ACHIEVEMENT_UPDATED, OnAchievementUpdated)

One possible problem is, I don't know how this works, what happens if you die & respawn somewhere else then an anchor is closed. Do you still get the achievement update for particpating in it? Even though you were not there when it closed? If so the code to get the dolmen name would not return the proper name because you would not be at that poi so you would have to check that the returned name is a proper dolmen name and filter it out or just add it to a global unspecified dolmen counter.
  Reply With Quote