Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battle for Azeroth #6

Closed
5 tasks done
Rainrider opened this issue May 10, 2018 · 0 comments
Closed
5 tasks done

Battle for Azeroth #6

Rainrider opened this issue May 10, 2018 · 0 comments

Comments

@Rainrider
Copy link
Member

Rainrider commented May 10, 2018

  • spellbook (player and pet) - nothing changed
  • talents - nothing changed
  • honor talents
  • artifact weapon traits - removed
  • azerite traits

Azerite traits

  • do not trigger SPELLS_CHANGED
  • events of interest are UNIT_INVENTORY_CHANGED and AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED

Event independent code:

local azeriteItemLocation = C_AzeriteItem.FindActiveAzeriteItem()
if (not azeriteItemLocation) then return end

local azeritePowerLevel = C_AzeriteItem.GetPowerLevel(azeriteItemLocation)
local specID = GetSpecializationInfo(GetSpecialization())

for slot = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED - 1 do -- exclude tabard
	local item = Item:CreateFromEquipmentSlot(slot)
	if (not item:IsItemEmpty()) then
		local itemLocation = item:GetItemLocation()
		if (C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(itemLocation)) then
			local tierInfo = C_AzeriteEmpoweredItem.GetAllTierInfo(itemLocation)
			for tier, info in next, tierInfo do
				if (info.unlockLevel <= azeritePowerLevel) then
					for _, powerID in next, info.azeritePowerIDs do
						local powerInfo = C_AzeriteEmpoweredItem.GetPowerInfo(itemLocation, powerID)
						if (powerInfo.selected and C_AzeriteEmpoweredItem.IsPowerAvailableForSpec(powerID, specID)) then
							print('Azerite power:', powerID, powerInfo.spellID)
						end
					end
				end
			end
		end
	end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant