View Single Post
10-02-18, 09:24 PM   #5
cameljon
A Kobold Labourer
Join Date: Oct 2018
Posts: 1
Originally Posted by nick78 View Post
I am not very good at LUA, but I have to use something like this as custom code in WeakAuras. So I have four questions:


1. How do I have to name the item location like?

2. Where can I check for the powerID's?

3. Is there a possibility to ask if a specific azerite trait was selected on ANY item instead of a specific one?

4. What are the results of "the selected azerite trait is actually selected / not selected"? "true" and "false"?


In the end, I need something like this:
Hope you found the answer already. If not here is what I use:

Code:
local function isPowerLearned(powerid)
    local isSelected        
    for _, itemLocation in AzeriteUtil.EnumerateEquipedAzeriteEmpoweredItems() do
        isSelected = C_AzeriteEmpoweredItem.IsPowerSelected(itemLocation, powerid)
        if isSelected then return true end
    end
    return false
end
If you are just throwing it in a WA trigger you could change it to:

Code:
function()       
    local isSelected 
    for _, itemLocation in AzeriteUtil.EnumerateEquipedAzeriteEmpoweredItems() do
        isSelected = C_AzeriteEmpoweredItem.IsPowerSelected(itemLocation, powerid)
        if isSelected then return true end
    end
    return false
end
Both of these return true or false based on if powerid is selected.

Last edited by cameljon : 10-02-18 at 09:29 PM. Reason: logic is hard
  Reply With Quote