|
|
|
@ -6,6 +6,7 @@ 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"]
|
|
|
|
@ -37,6 +38,7 @@ local AdditionalMillableItems = {
|
|
|
|
|
152509,
|
|
|
|
|
152510,
|
|
|
|
|
152511,
|
|
|
|
|
168487,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local AdditionalProspectableItems = {
|
|
|
|
@ -48,6 +50,7 @@ local AdditionalProspectableItems = {
|
|
|
|
|
152512,
|
|
|
|
|
152513,
|
|
|
|
|
152579,
|
|
|
|
|
168185,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local MassMilling = {
|
|
|
|
@ -109,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
|
|
|
|
@ -137,6 +144,7 @@ local PickableItems = {
|
|
|
|
|
88567, -- ghost iron lockbox
|
|
|
|
|
116920, -- true steel lockbox
|
|
|
|
|
121331, -- leystone lockbox
|
|
|
|
|
169475, -- barnacled lockbox
|
|
|
|
|
}
|
|
|
|
|
local CanPickLock = false
|
|
|
|
|
|
|
|
|
@ -404,7 +412,7 @@ function Breakables:OnTradeSkillUpdate()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:OnBagItemLockPicked()
|
|
|
|
|
nextCheck[1] = GetTime() + BagUpdateCheckDelay
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:FindLevelOfProfessionIndex(idx)
|
|
|
|
@ -415,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
|
|
|
|
@ -637,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
|
|
|
|
@ -1067,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[self:GetItemIdFromLink(itemLink)] then
|
|
|
|
|
local itemId = self:GetItemIdFromLink(itemLink)
|
|
|
|
|
if self.settings.ignoreList[itemId] then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -1076,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
|
|
|
|
@ -1091,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
|
|
|
|
@ -1124,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
|
|
|
|
@ -1226,7 +1240,7 @@ do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:IsInEquipmentSet(itemId)
|
|
|
|
|
if WowVer < 80000 then
|
|
|
|
|
if WowVer < 80000 and GetNumEquipmentSets then
|
|
|
|
|
for setIdx=1, GetNumEquipmentSets() do
|
|
|
|
|
local set = GetEquipmentSetInfo(setIdx)
|
|
|
|
|
local itemArray = GetEquipmentSetItemIDs(set)
|
|
|
|
@ -1237,7 +1251,7 @@ function Breakables:IsInEquipmentSet(itemId)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
elseif C_EquipmentSet then
|
|
|
|
|
local sets = C_EquipmentSet.GetEquipmentSetIDs()
|
|
|
|
|
for k, v in ipairs(sets) do
|
|
|
|
|
local itemArray = C_EquipmentSet.GetItemIDs(v)
|
|
|
|
@ -1288,11 +1302,11 @@ 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
|
|
|
|
|
if WowVer >= 80000 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
|
|
|
|
|
|
|
|
|
@ -1391,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
|
|
|
|
|