View Single Post
03-02-21, 05:11 AM   #8
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Ty, you already helped alot

I was just confused because it worked for friendly units but I noticed for enemys it is a bit more tricky.

Blizzard gives opportunities to detect specialization in closed PvP areas (skrims, rated arena, normal-, epic-bgs, rated bgs).

Something like this worked well with friendly units and some Tooltip Addons use this and Inspect for friendly player specs too:

Code:
 local specID = GetInspectSpecialization(unit)
        if specID then
            local _, _, _, icon = GetSpecializationInfoByID(specID)
            texture = icon
For arena enemys/opponents its always something like that:

Code:
 for i=1,5 do
      if UnitIsUnit(nameplateId, "arena"..i) then
         addIcon(data[i], nameplate);
      end
   end
end

-----------------------------------------------------------------------------------

function SetupIcons()
   for i = 1, GetNumArenaOpponentSpecs() do
      local specID = GetArenaOpponentSpec(i)
      if specID > 0 then
         local id, name, description, icon, role, class = GetSpecializationInfoByID(specID);
         data[i] = icon;
      end
   end
end

Last edited by rulezyx : 03-02-21 at 05:23 AM.
  Reply With Quote