Quantcast
WoWInterface - View Single Post - Determine active essences
View Single Post
05-16-20, 01:23 AM   #3
doofus
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 126
OK thanks for the pointers. The following code stores your equipped essences, in case anyone wants to know.

Code:
  local essences = C_AzeriteEssence.GetEssences();
  BA_Data["function LogTextLine"](string.format("**** essences ****"));
  for _, ve in pairs(essences) do
    local eid = ve["ID"];
    local name = ve["name"];
    local rank = ve["rank"];
    local unlocked = ve["unlocked"];
    local valid = ve["valid"];
    local icon = ve["icon"];
    -- BA_Data["function LogTextLine"](string.format("essence id: %d - name: %s - rank: %d - unl: %s - valid: %s ",eid,name,rank,tostring(unlocked),tostring(valid)));
  end
  local wornEssences = { };
  local milestones = C_AzeriteEssence.GetMilestones();
  for _, vm in pairs(milestones) do
    local mid = vm["ID"];
    local slot = vm["slot"];
    if ( slot ) then 
      local essenceID = C_AzeriteEssence.GetMilestoneEssence(mid);
      for _, ve in pairs(essences) do
        local eid = ve["ID"];
        if ( eid == essenceID ) then
          wornEssences[#wornEssences+1] = { essenceID, ve["name"], ve["rank"], slot };
          break;
        end
      end
    end
  end
 for _, we in pairs(wornEssences) do
    BA_Data["function LogTextLine"](string.format("essence id: %d - [%s] - rank: %d - slot: %d",we[1],we[2],we[3],we[4]));
  end
  Reply With Quote