|
|
|
@ -5,6 +5,9 @@ local LBF = LibStub("Masque", true)
|
|
|
|
|
|
|
|
|
|
local lbfGroup
|
|
|
|
|
|
|
|
|
|
local WowVer = select(4, GetBuildInfo())
|
|
|
|
|
local IsClassic = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
|
|
|
|
|
|
|
|
|
|
local MillingId = 51005
|
|
|
|
|
local MillingItemSubType = babbleInv["Herb"]
|
|
|
|
|
local MillingItemSecondarySubType = babbleInv["Other"]
|
|
|
|
@ -26,12 +29,28 @@ local AdditionalMillableItems = {
|
|
|
|
|
124105,
|
|
|
|
|
124106,
|
|
|
|
|
128304,
|
|
|
|
|
151565,
|
|
|
|
|
-- BfA herbs
|
|
|
|
|
152505,
|
|
|
|
|
152506,
|
|
|
|
|
152507,
|
|
|
|
|
152508,
|
|
|
|
|
152509,
|
|
|
|
|
152510,
|
|
|
|
|
152511,
|
|
|
|
|
168487,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local AdditionalProspectableItems = {
|
|
|
|
|
-- Legion ore
|
|
|
|
|
123918,
|
|
|
|
|
123919,
|
|
|
|
|
151564,
|
|
|
|
|
-- BfA ore
|
|
|
|
|
152512,
|
|
|
|
|
152513,
|
|
|
|
|
152579,
|
|
|
|
|
168185,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local MassMilling = {
|
|
|
|
@ -50,6 +69,7 @@ local MassMilling = {
|
|
|
|
|
[124105] = 209662,
|
|
|
|
|
[124106] = 209664,
|
|
|
|
|
[128304] = 210116,
|
|
|
|
|
[151565] = 247861,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local HerbCombineItems = {
|
|
|
|
@ -92,6 +112,10 @@ local DisenchantTypes = {babbleInv["Armor"], babbleInv["Weapon"]}
|
|
|
|
|
local CanDisenchant = false
|
|
|
|
|
local EnchantingProfessionId = 333
|
|
|
|
|
|
|
|
|
|
local AdditionalDisenchantableItems = {
|
|
|
|
|
137195, -- highmountain armor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local PickLockId = 1804
|
|
|
|
|
local PickableItems = {
|
|
|
|
|
16882, -- battered junkbox
|
|
|
|
@ -119,6 +143,8 @@ local PickableItems = {
|
|
|
|
|
68729, -- elementium lockbox
|
|
|
|
|
88567, -- ghost iron lockbox
|
|
|
|
|
116920, -- true steel lockbox
|
|
|
|
|
121331, -- leystone lockbox
|
|
|
|
|
169475, -- barnacled lockbox
|
|
|
|
|
}
|
|
|
|
|
local CanPickLock = false
|
|
|
|
|
|
|
|
|
@ -181,6 +207,7 @@ function Breakables:OnInitialize()
|
|
|
|
|
buttonScale = 1,
|
|
|
|
|
fontSize = 11,
|
|
|
|
|
growDirection = 2,
|
|
|
|
|
ignoreList = {},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
self.db = LibStub("AceDB-3.0"):New("BreakablesDB", self.defaults, true)
|
|
|
|
@ -313,7 +340,7 @@ function Breakables:RegisterEvents()
|
|
|
|
|
|
|
|
|
|
self:RegisterEvent("MODIFIER_STATE_CHANGED", "FindBreakables")
|
|
|
|
|
|
|
|
|
|
if CanDisenchant then
|
|
|
|
|
if CanDisenchant and WowVer < 80000 then
|
|
|
|
|
self:RegisterEvent("TRADE_SKILL_UPDATE", "OnTradeSkillUpdate")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -385,7 +412,7 @@ function Breakables:OnTradeSkillUpdate()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:OnBagItemLockPicked()
|
|
|
|
|
nextCheck[1] = GetTime() + BagUpdateCheckDelay
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:FindLevelOfProfessionIndex(idx)
|
|
|
|
@ -396,15 +423,17 @@ function Breakables:FindLevelOfProfessionIndex(idx)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:GetEnchantingLevel()
|
|
|
|
|
local prof1, prof2 = GetProfessions()
|
|
|
|
|
if GetProfessions then
|
|
|
|
|
local prof1, prof2 = GetProfessions()
|
|
|
|
|
|
|
|
|
|
local skillId, rank = self:FindLevelOfProfessionIndex(prof1)
|
|
|
|
|
if skillId ~= nil and skillId == EnchantingProfessionId then
|
|
|
|
|
self.EnchantingLevel = rank
|
|
|
|
|
else
|
|
|
|
|
skillId, rank = self:FindLevelOfProfessionIndex(prof2)
|
|
|
|
|
local skillId, rank = self:FindLevelOfProfessionIndex(prof1)
|
|
|
|
|
if skillId ~= nil and skillId == EnchantingProfessionId then
|
|
|
|
|
self.EnchantingLevel = rank
|
|
|
|
|
else
|
|
|
|
|
skillId, rank = self:FindLevelOfProfessionIndex(prof2)
|
|
|
|
|
if skillId ~= nil and skillId == EnchantingProfessionId then
|
|
|
|
|
self.EnchantingLevel = rank
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -412,9 +441,9 @@ end
|
|
|
|
|
local function GetIgnoreListOptions()
|
|
|
|
|
local ret = {}
|
|
|
|
|
|
|
|
|
|
if Breakables.settings.ignoreList ~= nil then
|
|
|
|
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
|
|
|
|
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(k)
|
|
|
|
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
|
|
|
|
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(k)
|
|
|
|
|
if texture ~= nil and name ~= nil then
|
|
|
|
|
ret[k] = ("|T%s:0|t %s"):format(texture, name)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -422,6 +451,16 @@ local function GetIgnoreListOptions()
|
|
|
|
|
return ret
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function IsIgnoringAnything()
|
|
|
|
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
|
|
|
|
if v ~= nil then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:GetOptions()
|
|
|
|
|
local opts = {
|
|
|
|
|
name = L["Breakables"],
|
|
|
|
@ -570,6 +609,7 @@ function Breakables:GetOptions()
|
|
|
|
|
return L["Are you sure you want to remove this item from the ignore list?"]
|
|
|
|
|
end,
|
|
|
|
|
values = GetIgnoreListOptions,
|
|
|
|
|
hidden = function() return not IsIgnoringAnything() end,
|
|
|
|
|
order = 30,
|
|
|
|
|
},
|
|
|
|
|
clearIgnoreList = {
|
|
|
|
@ -584,19 +624,7 @@ function Breakables:GetOptions()
|
|
|
|
|
confirm = function()
|
|
|
|
|
return L["Are you sure you want to clear the ignore list?"]
|
|
|
|
|
end,
|
|
|
|
|
disabled = function()
|
|
|
|
|
if Breakables.settings.ignoreList == nil then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
|
|
|
|
if v ~= nil then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
end,
|
|
|
|
|
hidden = function() return not IsIgnoringAnything() end,
|
|
|
|
|
order = 31,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
@ -619,41 +647,45 @@ function Breakables:GetOptions()
|
|
|
|
|
end,
|
|
|
|
|
order = 20,
|
|
|
|
|
}
|
|
|
|
|
opts.args.hideEqManagerItems = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Hide Eq. Mgr items"],
|
|
|
|
|
desc = L["Whether or not to hide items that are part of an equipment set in the game's equipment manager."],
|
|
|
|
|
get = function(info)
|
|
|
|
|
return self.settings.hideEqManagerItems
|
|
|
|
|
end,
|
|
|
|
|
set = function(info, v)
|
|
|
|
|
self.settings.hideEqManagerItems = v
|
|
|
|
|
if info.uiType == "cmd" then
|
|
|
|
|
print("|cff33ff99Breakables|r: set |cffffff78hideEqManagerItems|r to " .. tostring(self.settings.hideEqManagerItems))
|
|
|
|
|
end
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end,
|
|
|
|
|
hidden = function()
|
|
|
|
|
return not self.settings.showSoulbound
|
|
|
|
|
end,
|
|
|
|
|
order = 21,
|
|
|
|
|
}
|
|
|
|
|
opts.args.hideTabards = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Hide Tabards"],
|
|
|
|
|
desc = L["Whether or not to hide tabards from the disenchantable items list."],
|
|
|
|
|
get = function(info)
|
|
|
|
|
return self.settings.hideTabards
|
|
|
|
|
end,
|
|
|
|
|
set = function(info, v)
|
|
|
|
|
self.settings.hideTabards = v
|
|
|
|
|
if info.uiType == "cmd" then
|
|
|
|
|
print("|cff33ff99Breakables|r: set |cffffff78hideTabards|r to " .. tostring(self.settings.hideTabards))
|
|
|
|
|
end
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end,
|
|
|
|
|
order = 22,
|
|
|
|
|
}
|
|
|
|
|
if GetNumEquipmentSets or C_EquipmentSet then
|
|
|
|
|
opts.args.hideEqManagerItems = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Hide Eq. Mgr items"],
|
|
|
|
|
desc = L["Whether or not to hide items that are part of an equipment set in the game's equipment manager."],
|
|
|
|
|
get = function(info)
|
|
|
|
|
return self.settings.hideEqManagerItems
|
|
|
|
|
end,
|
|
|
|
|
set = function(info, v)
|
|
|
|
|
self.settings.hideEqManagerItems = v
|
|
|
|
|
if info.uiType == "cmd" then
|
|
|
|
|
print("|cff33ff99Breakables|r: set |cffffff78hideEqManagerItems|r to " .. tostring(self.settings.hideEqManagerItems))
|
|
|
|
|
end
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end,
|
|
|
|
|
hidden = function()
|
|
|
|
|
return not self.settings.showSoulbound
|
|
|
|
|
end,
|
|
|
|
|
order = 21,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
if WowVer >= 80000 then
|
|
|
|
|
opts.args.hideTabards = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Hide Tabards"],
|
|
|
|
|
desc = L["Whether or not to hide tabards from the disenchantable items list."],
|
|
|
|
|
get = function(info)
|
|
|
|
|
return self.settings.hideTabards
|
|
|
|
|
end,
|
|
|
|
|
set = function(info, v)
|
|
|
|
|
self.settings.hideTabards = v
|
|
|
|
|
if info.uiType == "cmd" then
|
|
|
|
|
print("|cff33ff99Breakables|r: set |cffffff78hideTabards|r to " .. tostring(self.settings.hideTabards))
|
|
|
|
|
end
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end,
|
|
|
|
|
order = 22,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return opts
|
|
|
|
@ -735,7 +767,7 @@ end
|
|
|
|
|
function Breakables:GetSpellIdFromProfessionButton(itemType, itemId)
|
|
|
|
|
if itemType == BREAKABLE_HERB and itemId ~= nil then
|
|
|
|
|
if MassMilling[itemId] ~= nil and IsPlayerSpell(MassMilling[itemId]) then
|
|
|
|
|
return MassMilling[itemId]
|
|
|
|
|
--return MassMilling[itemId]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -787,10 +819,6 @@ end
|
|
|
|
|
|
|
|
|
|
local function IgnoreFunc(self, button)
|
|
|
|
|
if button == "RightButton" and not InCombatLockdown() then
|
|
|
|
|
if Breakables.settings.ignoreList == nil then
|
|
|
|
|
Breakables.settings.ignoreList = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Breakables.settings.ignoreList[self.itemId] = true
|
|
|
|
|
Breakables:FindBreakables()
|
|
|
|
|
LibStub("AceConfigRegistry-3.0"):NotifyChange("Breakables")
|
|
|
|
@ -1053,7 +1081,8 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|
|
|
|
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagId, slotId)
|
|
|
|
|
if texture then
|
|
|
|
|
local itemLink = GetContainerItemLink(bagId, slotId)
|
|
|
|
|
if self.settings.ignoreList and self.settings.ignoreList[self:GetItemIdFromLink(itemLink)] then
|
|
|
|
|
local itemId = self:GetItemIdFromLink(itemLink)
|
|
|
|
|
if self.settings.ignoreList[itemId] then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -1062,7 +1091,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|
|
|
|
self.myTooltip:SetBagItem(bagId, slotId)
|
|
|
|
|
|
|
|
|
|
if CanDisenchant and itemRarity and itemRarity >= RARITY_UNCOMMON and itemRarity < RARITY_HEIRLOOM
|
|
|
|
|
and self:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink) then
|
|
|
|
|
and self:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId) then
|
|
|
|
|
local i = 1
|
|
|
|
|
local soulbound = false
|
|
|
|
|
for i=1,15 do
|
|
|
|
@ -1077,7 +1106,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|
|
|
|
|
|
|
|
|
local isInEquipmentSet = false
|
|
|
|
|
if self.settings.hideEqManagerItems then
|
|
|
|
|
isInEquipmentSet = self:IsInEquipmentSet(self:GetItemIdFromLink(itemLink))
|
|
|
|
|
isInEquipmentSet = self:IsInEquipmentSet(itemId)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local isTabard = false
|
|
|
|
@ -1110,7 +1139,6 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local itemId = self:GetItemIdFromLink(itemLink)
|
|
|
|
|
if CanMill and not millable then
|
|
|
|
|
for i=1,#AdditionalMillableItems do
|
|
|
|
|
if AdditionalMillableItems[i] == itemId then
|
|
|
|
@ -1212,13 +1240,26 @@ do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:IsInEquipmentSet(itemId)
|
|
|
|
|
for setIdx=1, GetNumEquipmentSets() do
|
|
|
|
|
local set = GetEquipmentSetInfo(setIdx)
|
|
|
|
|
local itemArray = GetEquipmentSetItemIDs(set)
|
|
|
|
|
if WowVer < 80000 and GetNumEquipmentSets then
|
|
|
|
|
for setIdx=1, GetNumEquipmentSets() do
|
|
|
|
|
local set = GetEquipmentSetInfo(setIdx)
|
|
|
|
|
local itemArray = GetEquipmentSetItemIDs(set)
|
|
|
|
|
|
|
|
|
|
for i=1, EQUIPPED_LAST do
|
|
|
|
|
if itemArray[i] and itemArray[i] == itemId then
|
|
|
|
|
return true
|
|
|
|
|
for i=1, EQUIPPED_LAST do
|
|
|
|
|
if itemArray[i] and itemArray[i] == itemId then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elseif C_EquipmentSet then
|
|
|
|
|
local sets = C_EquipmentSet.GetEquipmentSetIDs()
|
|
|
|
|
for k, v in ipairs(sets) do
|
|
|
|
|
local itemArray = C_EquipmentSet.GetItemIDs(v)
|
|
|
|
|
|
|
|
|
|
for i=1, EQUIPPED_LAST do
|
|
|
|
|
if itemArray[i] and itemArray[i] == itemId then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -1232,10 +1273,8 @@ function Breakables:GetItemIdFromLink(itemLink)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:MergeBreakables(foundBreakable, breakableList)
|
|
|
|
|
local foundItemId = self:GetItemIdFromLink(foundBreakable[IDX_LINK])
|
|
|
|
|
for n=1,#breakableList do
|
|
|
|
|
local listItemId = self:GetItemIdFromLink(breakableList[n][IDX_LINK])
|
|
|
|
|
if foundItemId == listItemId then
|
|
|
|
|
if foundBreakable[IDX_LINK] == breakableList[n][IDX_LINK] then
|
|
|
|
|
-- always prefer the larger stack
|
|
|
|
|
if foundBreakable[IDX_COUNT] > breakableList[n][IDX_COUNT] then
|
|
|
|
|
breakableList[n][IDX_BAG] = foundBreakable[IDX_BAG]
|
|
|
|
@ -1263,9 +1302,14 @@ function Breakables:SortBreakables(foundBreakables)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink)
|
|
|
|
|
function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId)
|
|
|
|
|
for i=1,#DisenchantTypes do
|
|
|
|
|
if DisenchantTypes[i] == itemType or IsArtifactRelicItem(itemLink) then
|
|
|
|
|
-- temp hack for bfa until disenchant item level scales are identified. and for classic until finding the profession level api
|
|
|
|
|
if WowVer >= 80000 or IsClassic then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- account for WoD and higher no longer needing specific ilvl. numbers from http://wow.gamepedia.com/Item_level
|
|
|
|
|
if (itemRarity == RARITY_UNCOMMON and itemLevel >= 483)
|
|
|
|
|
or (itemRarity == RARITY_RARE and itemLevel >= 515)
|
|
|
|
@ -1361,5 +1405,11 @@ function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, i
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i=1,#AdditionalDisenchantableItems do
|
|
|
|
|
if AdditionalDisenchantableItems[i] == itemId then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|