Getting the UnitID of an unseen NPC.

UI and Macro
Hey I was wondering if it was possible to get the UnitID of an NPC not currently visible to the player, what I am trying to do is create a frame and put the image of like any type of NPC inside that frame. I was wondering if that was possible.
This is using http://www.wowwiki.com/API_CreateFramejavascript:;
If you want a 3D model, you may be able to use a PlayerModel frame and call :SetDisplayInfo with the displayID of the NPC you want to show.

http://www.wowpedia.org/Widget_API#PlayerModel

You can figure out an NPC's displayID by going to the NPC's Wowhead page, viewing its source and searching that for "ModelViewer.show" (with that capitalisation). You should see something like this:onclick="this.blur(); ModelViewer.show({ type: 1, typeId: 6466, displayId: 5205, humanoid: 1 })"

The number next to displayId is the displayID of the NPC (obviously).

I don't think you can do the same for a 2D portrait, since you need an actual unitID for that and these are the only valid unitIDs:
http://www.wowpedia.org/UnitId
Exactly what I was looking for, thank you so much!

Join the Conversation

Return to Forum