Thread Tools Display Modes
07-30-18, 05:43 AM   #1
Dastano
A Defias Bandit
Join Date: Jul 2018
Posts: 3
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?
  Reply With Quote
07-30-18, 01:51 PM   #2
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
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)
  Reply With Quote
07-31-18, 04:03 AM   #3
Dastano
A Defias Bandit
Join Date: Jul 2018
Posts: 3
Thanks a lot
  Reply With Quote
08-16-18, 03:40 PM   #4
nick78
A Kobold Labourer
Join Date: Jan 2016
Posts: 1
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:

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

Last edited by nick78 : 08-18-18 at 12:52 PM.
  Reply With Quote
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

WoWInterface » Developer Discussions » Lua/XML Help » Check for Learned Azerite Power?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off