WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Check for Learned Azerite Power? (https://www.wowinterface.com/forums/showthread.php?t=56476)

Dastano 07-30-18 05:43 AM

Check for Learned Azerite Power?
 
So I was woundering if we can easy check if we have learned a Azerite Power?

I tried to ask for KnownSpell and the ID/passiveID of Azerite Armor, but it seems they are not relied to a SpellID.

I saw a different Addon returning a PowerID, could we check for PowerID?

sezz 07-30-18 01:51 PM

Lua Code:
  1. local isSelected = C_AzeriteEmpoweredItem.IsPowerSelected(azeriteEmpoweredItemLocation, powerID)

Quick example to check for Arcane Pummeling (88) on the helmet (1):
Lua Code:
  1. /dump C_AzeriteEmpoweredItem.IsPowerSelected(ItemLocation:CreateFromEquipmentSlot(1), 88)

Dastano 07-31-18 04:03 AM

Thanks a lot :)

nick78 08-16-18 03:40 PM

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:

Quote:

function()
.....in_the_rhythm = 0
.....if "azerite trait 'In The Rythm' is chosen on ANY of my gear" then
..........in_the_rhythm = 1
.....end
end

cameljon 10-02-18 09:24 PM

Quote:

Originally Posted by nick78 (Post 329631)
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.


All times are GMT -6. The time now is 01:33 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI