Thread Tools Display Modes
07-23-14, 01:36 AM   #1
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 193
Simple NPC ID addon for WoD beta

Hey there,

Is there any addon available to show NPC IDs in WoD Beta yet?

In case of not, I found the very lightweight IdTip quite useful in the past and it's partially working in the Beta already, showing IDs for items and spell/auras but unfortunately not for the NPCs.

As the author told us that he isn't actively playing wow anymore would someone take a look at the .lua and correct the "Unit" section for the beta please? (it seems to be a very simple code but I don't have lua knowledge even that close.)

thank you very much.
  Reply With Quote
07-23-14, 01:48 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
This should do it..
Lua Code:
  1. GameTooltip:HookScript('OnTooltipSetUnit', function(self)
  2.     local name, unit = self:GetUnit()
  3.     if unit then
  4.         local unitType, _, _, _, _, npcID = strsplit(':', UnitGUID(unit) or '')
  5.         if npcID then
  6.             self:AddDoubleLine(unitType, npcID)
  7.             self:Show()
  8.         end
  9.     end
  10. end)

Last edited by semlar : 08-07-14 at 02:22 PM. Reason: Changed strmatch to strsplit which appears to be about 40% faster
  Reply With Quote
07-23-14, 03:02 AM   #3
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 193
Thank you so much, works very well!
  Reply With Quote
07-23-14, 03:58 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I think I want that for my tooltip addon aswell. Marked.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-23-14, 08:45 AM   #5
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Haha, yep - just pinched this for my own use too. Thanks!
  Reply With Quote
07-27-14, 10:48 AM   #6
silverwind
A Murloc Raider
 
silverwind's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 4
Originally Posted by semlar View Post
This should do it..
Excuse me for asking, but I wonder how this pattern of your example could match a GUID. Did the UnitGUID() return value change in WOD?

Lua Code:
  1. > = string.match("0xF130890300002235", "^([^:]+):%d+:%d+:%d+:%d+:(%d+)")
  2. nil

My approach to extract the ID would probably be:

Lua Code:
  1. > = tonumber(string.sub("0xF130890300002235", 6, 10), 16)
  2. 35075
  Reply With Quote
07-27-14, 11:14 AM   #7
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Yes silverwind, it changed.

http://wowpedia.org/Patch_6.0.1/API_changes
__________________
Profile: Curse | Wowhead
  Reply With Quote
07-27-14, 11:49 AM   #8
silverwind
A Murloc Raider
 
silverwind's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 4
Ah, of course. I shall RTFM next time.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Simple NPC ID addon for WoD beta

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off