if not (_NPCScan and _NPCScan.Overlay) then return end -- https://sites.google.com/site/wowsaiket/Add-Ons/NPCScanOverlay/API local core = LibStub("AceAddon-3.0"):GetAddon("SilverDragon") local overlay = LibStub("AceEvent-3.0"):Embed({}) local first, printed = true, {} local achievements, quests local function scan() for index, achievement in next, achievements do local numCriteria, numCompleted = GetAchievementNumCriteria(achievement), 0 for i = 1, numCriteria do local name, ctype, completed, _, _, _, _, npcid = GetAchievementCriteriaInfo(achievement, i) if ctype == 0 and completed then overlay:SendMessage("NpcOverlay_Remove", npcid, "SilverDragon") if not first and not printed[npcid] then printed[npcid] = true print("Objective complete:", npcid, name) end numCompleted = numCompleted + 1 end if numCompleted == numCriteria then --print("Achievement complete:", achievement, (select(2, GetAchievementInfo(achievement)))) achievements[index] = nil end end end for npcid, quest in next, quests do if IsQuestFlaggedCompleted(quest) then overlay:SendMessage("NpcOverlay_Remove", npcid, "SilverDragon") if not first and not printed[npcid] then printed[npcid] = true print("Quest complete:", quest, npcid) end quests[npcid] = nil end end first = nil end function overlay:PLAYER_REGEN_ENABLED() C_Timer.After(2, scan) end function overlay:PLAYER_LOGIN() self:SendMessage("NpcOverlay_RegisterScanner", "SilverDragon") for _, mobs in next, core.db.global.mobs_byzoneid do for id in next, mobs do self:SendMessage("NpcOverlay_Add", id, "SilverDragon") end end for _, mobs in next, _NPCScan.Overlay.PathData do for id in next, mobs do self:SendMessage("NpcOverlay_Add", id, "SilverDragon") end end self:RegisterEvent("PLAYER_REGEN_ENABLED") C_Timer.After(5, scan) end overlay:RegisterEvent("PLAYER_LOGIN") achievements = { 1312,--Bloody Rare 2257,--Frostbitten 7439,--Glorious! 8103,--Champions of Lei Shen } quests = { [77874]=33389,--[DISABLED] Void-Crazed Ancient [77664]=34182,--Aarko [84378]=37525,--Ak'ox the Slaughterer [86268]=37371,--Alkali [77140]=33061,--Amaukwa [77625]=34167,--Amethor [82899]=35778,--Ancient Blademaster [75425]=33073,--Ancient Saltsnap Turtle [86212]=37356,--Aqualir [86213]=37356,--Aqualir [91871]=38430,--Argosh the Destroyer [85568]=37410,--Avalanche [88043]=37338,--Avatar of Socrethar [81406]=35281,--Bahameye [82326]=35731,--Ba'ruun [87579]=35731,--Ba'ruun [82085]=35335,--Bashiok [86257]=37369,--Basten [78150]=34130,--Beastcarver Saramor (Huntmaster Kuang) [92552]=38609,--Belgork [82826]=35735,--Berserk T-300 Series Mark II [85907]=36597,--Berthora [84887]=36291,--Betsi Boombasket [90884]=38262,--Bilkor the Thrower [80614]=35599,--Blade-Dancer Aeryx [86579]=37368,--Blademaster Ro'gor [92657]=38696,--Bleeding Hollow Horror [84856]=36283,--Blightglow [77739]=34197,--Bloodbloom the Colossus [90936]=38266,--Bloodhunter Zulk [87597]=37339,--Bombardier Gu'gok [87837]=37396,--Bonebreaker [91093]=38209,--Bramblefell [81639]=33383,--Brambleking Fili [87484]=33383,--Brambleking Fili [78867]=34497,--Breathless [92429]=38589,--Broodlord Ixkor [74613]=33843,--Broodmother Reeg'ak [79065]=34519,--Brotoculus [87234]=37400,--Brutag Grimblade [71721]=32941,--Canyon Icemother [93264]=38820,--Captain Grok'mar [79725]=34727,--Captain Ironbeard [93076]=38756,--Captain Ironbeard [90434]=38031,--Ceraxas [82311]=35503,--Char the Burning [80242]=34843,--Chillfang [72294]=33014,--Cindermaw [90519]=37990,--Cindral the Wildfire [78169]=34130,--Cloudspeaker Daber (Huntmaster Kuang) [77513]=34129,--Coldstomp the Griever [76914]=34131,--Coldtusk [87577]=34131,--Coldtusk [91232]=38746,--Commander Krag'goth [89675]=38749,--Commander Org'mok [77620]=34165,--Cro Fleshrender [78621]=34477,--Cyclonic Fury [87578]=34477,--Cyclonic Fury [81681]=35221,--Da Keeper [77085]=33064,--Dark Emanation [82268]=35448,--Darkmaster Go'vid [82411]=35555,--Darktalon [95053]=39287,--Deathtalon [86566]=37362,--Defector Dazgo [84911]=37351,--Demidos [82058]=37370,--Depthroot [95056]=39289,--Doomroller [90887]=38265,--Dorg the Bloody [80581]=34966,--Doug Test - Hogger [77561]=34142,--Dr. Gloom [93028]=38736,--Driss Vile [90888]=38264,--Drivnul [87788]=37395,--Durg Spinecrusher [84807]=36267,--Durkath Steelmaw [86571]=37366,--Durp the Hated [84376]=37403,--Earthshaker Holar [80372]=37406,--Echidna [77795]=34221,--Echo of Murmur [82676]=35688,--Enavra [82742]=35688,--Enavra [91727]=38411,--Executor Riloth [82486]=35623,--Explorer Nozzand [84935]=36303,--Eyeless [82207]=35725,--Faebright [82975]=35836,--Fangler [80204]=35018,--Felbark [93168]=38775,--Felbore [82992]=37341,--Felfire Consort [92647]=38634,--Felsmith Damorka [91098]=38211,--Felspark [84890]=36297,--Festerbloom [87693]=36297,--Festerbloom [74971]=33504,--Firefury Giant [88580]=37373,--Firestarter Grash [83483]=35893,--Flinthide [85036]=37360,--Formless Nightmare [85250]=36387,--Fossilwood the Petrified [77614]=34145,--Frenzied Golem [78713]=35219,--Galzomar [79033]=34517,--Gargantuan Frostbeak [82764]=35715,--Gar'lua [86519]=35715,--Gar'lua [86978]=36943,--Gaze [80122]=34725,--Gaz'orda [81038]=36391,--Gelgor of the Blue Flame [80471]=34929,--Gennadian [71665]=32918,--Giant-Slayer Kul [77519]=34130,--Giantbane (Huntmaster Kuang) [78144]=34130,--Giantslayer Kimla (Huntmaster Kuang) [87352]=37380,--Gibblette the Cowardly [87029]=37393,--Giga Sentinel [77719]=34189,--Glimmerwing [92508]=38604,--Gloomtalon [93125]=38764,--Glub'glok [80868]=36204,--Glut [87019]=37390,--Gluttonous Giant [82778]=35717,--Gnarlhoof the Rabid [78269]=37413,--Gnarljaw [84951]=36305,--Gobblefin [84943]=36304,--Gochar [92941]=38709,--Gorabosh [83509]=35898,--Gorepetal [72364]=33512,--Gorg'ak the Lava Guzzler [82536]=37388,--Gorivax [87344]=37472,--Gortag Steelgrip [76380]=33664,--Gorum [78337]=34382,--Grand Warlock Duress [91695]=38400,--Grand Warlock Nethekurse [93057]=38750,--Grannok [84263]=36159,--Graveltooth [82758]=35714,--Greatfeather [84431]=36186,--Greldrok the Cunning [82912]=35784,--Grizzlemaw [78128]=34130,--Gronnstalker Dawarn (Huntmaster Kuang) [88583]=37375,--Grove Warden Yal [85572]=36919,--Grrbrrgle [80312]=34865,--Grutush the Pillager [80190]=34825,--Gruuk [83019]=37340,--Gug'tol [80235]=34839,--Gurun [83008]=37312,--Haakun the All-Consuming [77715]=34185,--Hammertooth [90094]=39046,--Harbormaster Korak [77626]=34167,--Hen-Mother Hami [87662]=34167,--Hen-Mother Hami [86724]=36887,--Hermit Palefur [90777]=38028,--High Priest Ikzan [83522]=35908,--Hive Queen Skrikka [87348]=37382,--Hoarfrost [86577]=37365,--Horgg [88672]=37377,--Hunter Bal'ra [83603]=35923,--Hunter Blacktooth [78151]=34130,--Huntmaster Kuang [78161]=34862,--Hyperious [79524]=35558,--Hypnocroak [77609]=34162,--Icklarv [90429]=38026,--Imp-Master Valessa [83553]=35909,--Insha'tar [86574]=37367,--Inventor Blammo [77453]=34134,--Isaari [82616]=37386,--Jabberjaw [87600]=37556,--Jaluk the Pacifist [90437]=38030,--Jax'zor [84955]=36306,--Jiasska the Sporegorger [77750]=34199,--Kaavu the Crimson Claw [84374]=37404,--Kaga the Ironbender [84810]=36268,--Kalos the Bloodbathed [77562]=34143,--Kal'rak the Drunk [86959]=37399,--Karosh Blackwind [85037]=37361,--Kenos the Unraveler [80398]=37407,--Keravnos [78710]=35219,--Kharazos the Triumphant [74206]=33043,--Killmaw [78260]=37412,--King Slime [78872]=34498,--Klikixx [87239]=37473,--Krahl Deadeye [92517]=38605,--Krell the Serene [93279]=38825,--Kris'kar the Unredeemed [88210]=37398,--Krud the Eviscerator [82988]=37348,--Kurlosh Doomfang [72362]=33039,--Ku'targ the Voidseer [82942]=37346,--Lady Demlash [90438]=38029,--Lady Oran [85121]=37355,--Lady Temptessa [72537]=33055,--Leaf-Reader Kurri [88494]=37342,--Legion Vanguard [80370]=37408,--Lernaea [77784]=34208,--Lo'marg Jawcrusher [82920]=37345,--Lord Korinak [77310]=35906,--Mad \"King\" Sporeon [93002]=38726,--Magwia [85451]=37357,--Malgosh Shadowkeeper [83643]=35932,--Malroc Stonesunder [84406]=36178,--Mandrakor [86562]=37363,--Maniacal Madgard [85001]=37353,--Master Sergeant Milgra [82998]=37349,--Matron of Sin [87026]=37391,--Mecha Plunderer [90442]=38032,--Mistress Thavra [88586]=37376,--Mogamago [77633]=34170,--Moltnar [82614]=37387,--Moltnoma [86582]=37364,--Morgo Kain [82362]=35523,--Morva Soultwister [76473]=34726,--Mother Araneae [77492]=34127,--Mother Bloodtusk [87351]=37381,--Mother of Goren [75071]=33642,--Mother Om'ra [84435]=36229,--Mr. Pinchy Sr. [84417]=36396,--Mutafen [85555]=37409,--Nagidna [82247]=36129,--Nas Dunberlin [83401]=35865,--Netherspawn [79959]=36479,--Nightmaw [77593]=34160,--Nixxie [79334]=34859,--No'losh [77452]=34128,--Norana Quelldawn [87622]=37402,--Ogom the Mangler [83409]=35875,--Ophiis [87668]=37344,--Orumo the Observer [84872]=36288,--Oskiira the Vengeful [83680]=35943,--Outrider Duretha [92411]=38580,--Overlord Ma'gruth [92274]=38557,--Painmistress Selora [78606]=34470,--Pale Fishmonger [78134]=34130,--Pathfinder Jalog (Huntmaster Kuang) [88208]=37637,--Pit Beast [87846]=37397,--Pit Slayer [91374]=38282,--Podlord Wakkawam [84838]=36279,--Poisonmaster Bortusk [76918]=33938,--Primalist Mur'og [91009]=38457,--Putre'thar [84925]=37352,--Quartermaster Hershak [84392]=37401,--Ragore Driftstalker [82374]=35553,--Rai'vosh [77741]=34196,--Ra'kahn [77876]=34243,--Rak'nar Muzzlebash [90782]=38034,--Rasthe [82755]=35712,--Redclaw the Feral [92197]=38496,--Relgor [91227]=39159,--Remnant of the Blood Moon [92627]=38631,--Rendrak [85970]=36600,--Riptar [72606]=34068,--Rockhoof [90885]=38263,--Rogond the Tracker [85264]=36393,--Rolkor [77136]=33057,--Rotbelcher [85504]=36470,--Rotcap [83526]=35900,--Ru'klaa [84833]=36276,--Sangrikass [77526]=34132,--Scout Goreseeker [83634]=35931,--Scout Pokhar [83542]=35912,--Sean Whitesea [90024]=37953,--Sergeant Mor'grak [87027]=37392,--Shadow Hulk [79938]=36478,--Shadowbark [82930]=37347,--Shadowflame Terrorwalker [85029]=37354,--Shadowspeaker Niir [85035]=37354,--Shadowspeaker Niir [93236]=38812,--Shadowthrash [82415]=35732,--Shinri [87582]=35732,--Shinri [79543]=34671,--Shirzir [78715]=35219,--Sikthiss, Maiden of Slaughter [85837]=37411,--Slivermaw [82617]=37385,--Slogtusk the Corpse-Eater [86689]=36880,--Sneevel [83990]=37394,--Solar Magnifier [82620]=37383,--Son of Goramal [80057]=36128,--Soulfang [87696]=36128,--Soulfang [92495]=38600,--Soulslicer [85026]=37358,--Soul-Twister Torek [92887]=38700,--Steelsnout [86549]=36858,--Steeltusk [87665]=36858,--Steeltusk [86520]=36837,--Stompalupagus [79629]=35910,--Stomper Kreego [84805]=36265,--Stonespite [77622]=34168,--Stormwave [88071]=37337,--Strategist Ankor [80725]=36394,--Sulfurious [86137]=36656,--Sunclaw [84912]=36298,--Sunderthorn [85520]=36472,--Swarmleaf [88582]=37374,--Swift Onyx Flayer [92606]=38628,--Sylissa [86410]=36794,--Sylldross [93001]=38752,--Szirek the Twisted [77634]=34171,--Taladorantula [84836]=36278,--Talonbreaker [79485]=34668,--Talonpriest Zorkra [87882]=34668,--Talonpriest Zorkra [77861]=34231,--Tanoboa [95044]=39288,--Terrorfist [84775]=36254,--Tesska the Broken [84982]=34208,--Tezzakel [77527]=34133,--The Beater [92465]=38597,--The Blackfang [78265]=34361,--The Bone Crawler [92694]=38654,--The Goreclaw [92977]=38751,--The Iron Houndmaster [92636]=38632,--The Night Haunter [73669]=33034,--The Obliterator [91243]=38747,--Tho'gar Gorefist [92574]=38620,--Thromma the Gutslicer [82618]=37384,--Tor'goroth [83591]=35920,--Tura'aka [80371]=37405,--Typhon [79104]=34522,--Ug'lok the Frozen [87432]=37389,--Ug'lok the Frozen [80524]=34945,--Underseer Bloodmane [77661]=34191,--Un'glok Blackfinger [87357]=37378,--Valkor [92451]=37937,--Varyx the Damned [75482]=33640,--Veloss [95054]=39290,--Vengeance [86266]=37372,--Venolasix [75492]=33643,--Venomshade [88436]=37350,--Vigilant Paarthos [85078]=37359,--Voidreaver Urnae [83385]=35847,--Voidseer Kalurg [87356]=37379,--Vrok the Ancient [77776]=34205,--Wandering Vindicator [79024]=34645,--Warmaster Blugthol [87694]=34645,--Warmaster Blugthol [83428]=35877,--Windcaller Korast [75434]=33038,--Windfang Matriarch [92408]=38579,--Xanzith the Everlasting [82922]=37343,--Xothear, the Destroyer [79145]=34559,--Yaga the Scarred [77529]=34135,--Yazheera the Incinerator [75435]=33389,--Yggdrel [91087]=38207,--Zeter'el [90122]=39045,--Zoug the Heavy }