Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --azerite traits
- function(event)
- if (aura_env.config["mode"] == 3 or aura_env.config["mode"] == 5)
- and aura_env.config["showMaxTiers"] ~= 1
- and (event == "PLAYER_EQUIPMENT_CHANGED" or event == "AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED")
- then
- local data = {}
- local header = "trait"
- local count = aura_env.config["mode"] == 5 and 1 or 80
- local specID = GetSpecializationInfo(GetSpecialization())
- for _, slot in next, {1,3,5} do
- local item = Item:CreateFromEquipmentSlot(slot)
- if (not item:IsItemEmpty()) then
- local itemLocation = item:GetItemLocation()
- if (C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(itemLocation)) then
- local itemID = GetInventoryItemLink("player", slot)
- local name, _, quality, ilvl = GetItemInfo(itemID)
- name = name or ""
- local circle = 1
- local tierInfo = C_AzeriteEmpoweredItem.GetAllTierInfo(itemLocation)
- for tier, info in next, tierInfo do
- if aura_env.config["showMaxTiers"] == 2 or tier <= aura_env.config["showMaxTiers"]-2 then
- for _, powerID in next, info.azeritePowerIDs do
- local powerInfo = C_AzeriteEmpoweredItem.GetPowerInfo(powerID)
- local id = name..powerInfo.spellID
- local spellName, _, spellIcon = GetSpellInfo(powerInfo.spellID)
- local description = GetSpellDescription(powerInfo.spellID)
- local canSelect = C_AzeriteEmpoweredItem.CanSelectPower(itemLocation, powerID)
- if powerInfo.spellID == 263978 then
- spellIcon = aura_env.config["upgradeTexture"]
- end
- if powerID and specID then
- if powerInfo.spellID ~= 263978 and C_AzeriteEmpoweredItem.IsPowerSelected(itemLocation, powerID) then
- if not data[powerInfo.spellID] then
- data[powerInfo.spellID] = {
- header = header,
- name = spellName,
- icon = spellIcon,
- spellid = powerInfo.spellID,
- count = count,
- totalTraits = 1,
- description = description,
- notWorking = not C_AzeriteEmpoweredItem.IsPowerAvailableForSpec(powerID, specID),
- ilvl = "|cFFbbbbbb1|r",
- canSelect = false,
- relativeTo = itemSlot,
- changed = true,
- show = true,
- }
- count = count + 1
- elseif data[powerInfo.spellID] then
- data[powerInfo.spellID].totalTraits = data[powerInfo.spellID].totalTraits + 1
- data[powerInfo.spellID].ilvl = "|cFFbbbbbb"..data[powerInfo.spellID].totalTraits.."|r"
- end
- elseif canSelect then
- data[id] = {
- header = header,
- name = spellName,
- icon = spellIcon,
- spellid = powerInfo.spellID,
- count = count,
- description = description,
- notWorking = not C_AzeriteEmpoweredItem.IsPowerAvailableForSpec(powerID, specID),
- ilvl = "|cFFbbbbbbT"..circle.."|r",
- canSelect = true,
- relativeTo = itemSlot,
- changed = true,
- show = true,
- }
- count = count + 1
- end
- end
- end
- end
- circle = circle + 1
- end
- end
- end
- end
- WeakAuras.ScanEvents("WA_TALENT_SETUP", header, data)
- elseif (aura_env.config["mode"] == 1 or aura_env.config["mode"] == 2 or aura_env.config["mode"] == 4)
- and aura_env.config["showAzeriteEmpoweredItems"]
- and (event == "PLAYER_EQUIPMENT_CHANGED" or event == "AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED")
- then
- local data = {}
- local header = "trait"
- local count = aura_env.config["mode"] == 4 and 15 or 80
- local specID = GetSpecializationInfo(GetSpecialization())
- for _, slot in next, {1,3,5} do
- local item = Item:CreateFromEquipmentSlot(slot)
- if (not item:IsItemEmpty()) then
- local itemLocation = item:GetItemLocation()
- if (C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(itemLocation)) then
- local itemID = GetInventoryItemLink("player", slot)
- local name, _, quality, ilvl = GetItemInfo(itemID)
- name = name or ""
- ilvl = ilvl or 1
- quality = quality or 2
- local icon = GetItemIcon(itemID)
- local itemSlot = slot == 1 and "HEAD" or slot == 3 and "SHOULDERS" or slot == 5 and "CHEST"
- data[count] = {
- header = header,
- name = aura_env.config["hideItems"] and "" or ITEM_QUALITY_COLORS[quality].hex..name.."|r",
- icon = icon,
- count = count,
- link = itemID,
- description = "",
- hideMe = aura_env.config["hideItems"],
- ilvl = aura_env.config["hideItems"] and "" or ITEM_QUALITY_COLORS[quality].hex..ilvl.."|r",
- itemSlot = itemSlot,
- changed = true,
- show = true,
- }
- count = count + 1
- if aura_env.config["showMaxTiers"] ~= 1 then
- local circle = 1
- local tierInfo = C_AzeriteEmpoweredItem.GetAllTierInfo(itemLocation)
- for tier, info in next, tierInfo do
- if aura_env.config["showMaxTiers"] == 2 or tier <= aura_env.config["showMaxTiers"]-2 then
- for _, powerID in next, info.azeritePowerIDs do
- local powerInfo = C_AzeriteEmpoweredItem.GetPowerInfo(powerID)
- local id = name..powerInfo.spellID
- local spellName, _, spellIcon = GetSpellInfo(powerInfo.spellID)
- if powerInfo.spellID == 263978 then
- spellIcon = aura_env.config["upgradeTexture"]
- end
- local description = GetSpellDescription(powerInfo.spellID)
- local canSelect = C_AzeriteEmpoweredItem.CanSelectPower(itemLocation, powerID)
- if powerID and specID and (C_AzeriteEmpoweredItem.IsPowerSelected(itemLocation, powerID) or canSelect) then
- if powerInfo.spellID == 263978 and not canSelect then
- if aura_env.config["showUpgrade"] and aura_env.config["showMaxTiers"] == 2 then
- data[id] = {
- header = header,
- name = spellName,
- icon = spellIcon,
- spellid = powerInfo.spellID,
- count = count,
- description = description,
- notWorking = not C_AzeriteEmpoweredItem.IsPowerAvailableForSpec(powerID, specID),
- ilvl = "|cFFbbbbbbT"..circle.."|r",
- canSelect = canSelect,
- relativeTo = itemSlot,
- changed = true,
- show = true,
- }
- end
- else
- data[id] = {
- header = header,
- name = spellName,
- icon = spellIcon,
- spellid = powerInfo.spellID,
- count = count,
- description = description,
- notWorking = not C_AzeriteEmpoweredItem.IsPowerAvailableForSpec(powerID, specID),
- ilvl = "|cFFbbbbbbT"..circle.."|r",
- canSelect = canSelect,
- relativeTo = itemSlot,
- changed = true,
- show = true,
- }
- count = count + 1
- end
- end
- end
- end
- circle = circle + 1
- end
- end
- end
- end
- end
- WeakAuras.ScanEvents("WA_TALENT_SETUP", header, data)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement