|
|
|
@ -13,8 +13,32 @@ if not IsArtifactRelicItem then
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local WowVer = select(4, GetBuildInfo())
|
|
|
|
|
local IsClassic = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
|
|
|
|
|
local IsClassicBC = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
|
|
|
|
|
local IsClassic = false
|
|
|
|
|
local IsClassicBC = false
|
|
|
|
|
local IsClassicWrath = false
|
|
|
|
|
if GetClassicExpansionLevel then
|
|
|
|
|
IsClassic = GetClassicExpansionLevel() == 0
|
|
|
|
|
IsClassicBC = GetClassicExpansionLevel() == 1
|
|
|
|
|
IsClassicWrath = GetClassicExpansionLevel() == 2
|
|
|
|
|
else
|
|
|
|
|
IsClassic = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
|
|
|
|
|
IsClassicBC = false
|
|
|
|
|
IsClassicWrath = false
|
|
|
|
|
if WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
|
|
|
|
|
if not LE_EXPANSION_LEVEL_CURRENT or LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_BURNING_CRUSADE then
|
|
|
|
|
IsClassicBC = true
|
|
|
|
|
elseif LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_WRATH_OF_THE_LICH_KING then
|
|
|
|
|
IsClassicWrath = true
|
|
|
|
|
end
|
|
|
|
|
elseif WOW_PROJECT_WRATH_CLASSIC and WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC then
|
|
|
|
|
IsClassicWrath = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local ShouldHookTradeskillUpdate = WowVer < 80000
|
|
|
|
|
local ShouldShowTabardControls = WowVer >= 80000
|
|
|
|
|
local UseNonNativeEqManagerChecks = WowVer < 80000
|
|
|
|
|
local IgnoreEnchantingSkillLevelForDisenchant = WowVer >= 80000
|
|
|
|
|
|
|
|
|
|
local MillingId = 51005
|
|
|
|
|
local MillingItemSubType = babbleInv["Herb"]
|
|
|
|
@ -388,7 +412,7 @@ function Breakables:RegisterEvents()
|
|
|
|
|
|
|
|
|
|
self:RegisterEvent("MODIFIER_STATE_CHANGED", "FindBreakables")
|
|
|
|
|
|
|
|
|
|
if CanDisenchant and WowVer < 80000 then
|
|
|
|
|
if CanDisenchant and ShouldHookTradeskillUpdate then
|
|
|
|
|
self:RegisterEvent("TRADE_SKILL_UPDATE", "OnTradeSkillUpdate")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -498,6 +522,14 @@ function Breakables:GetEnchantingLevel()
|
|
|
|
|
self.EnchantingLevel = rank
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elseif GetSkillLineInfo then
|
|
|
|
|
for i=1,100 do
|
|
|
|
|
local skillName, header, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType = GetSkillLineInfo(i)
|
|
|
|
|
if skillName == babbleInv["Enchanting"] then
|
|
|
|
|
self.EnchantingLevel = skillRank
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -761,7 +793,7 @@ function Breakables:GetOptions()
|
|
|
|
|
order = 21,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
if WowVer >= 80000 then
|
|
|
|
|
if ShouldShowTabardControls then
|
|
|
|
|
opts.args.hideTabards = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Hide Tabards"],
|
|
|
|
@ -779,6 +811,25 @@ function Breakables:GetOptions()
|
|
|
|
|
order = 22,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not IgnoreEnchantingSkillLevelForDisenchant then
|
|
|
|
|
opts.args.ignoreEnchantingSkillLevel = {
|
|
|
|
|
type = "toggle",
|
|
|
|
|
name = L["Ignore Enchanting skill level"],
|
|
|
|
|
desc = L["Whether or not items should be shown when Breakables thinks you don't have the appropriate skill level to disenchant it."],
|
|
|
|
|
get = function(info)
|
|
|
|
|
return self.settings.ignoreEnchantingSkillLevel
|
|
|
|
|
end,
|
|
|
|
|
set = function(info, v)
|
|
|
|
|
self.settings.ignoreEnchantingSkillLevel = v
|
|
|
|
|
self:FindBreakables()
|
|
|
|
|
if info.uiType == "cmd" then
|
|
|
|
|
print("|cff33ff99Breakables|r: set |cffffff78ignoreEnchantingSkillLevel|r to " .. tostring(self.settings.ignoreEnchantingSkillLevel))
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
order = 10,
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if UnitCanPetBattle then
|
|
|
|
@ -1355,7 +1406,7 @@ do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Breakables:IsInEquipmentSet(itemId)
|
|
|
|
|
if WowVer < 80000 and GetNumEquipmentSets then
|
|
|
|
|
if UseNonNativeEqManagerChecks and GetNumEquipmentSets then
|
|
|
|
|
for setIdx=1, GetNumEquipmentSets() do
|
|
|
|
|
local set = GetEquipmentSetInfo(setIdx)
|
|
|
|
|
local itemArray = GetEquipmentSetItemIDs(set)
|
|
|
|
@ -1420,8 +1471,17 @@ end
|
|
|
|
|
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 or IsClassicBC then
|
|
|
|
|
-- bfa+ no longer has skill level requirements for disenchanting
|
|
|
|
|
if IgnoreEnchantingSkillLevelForDisenchant then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if self.settings.ignoreEnchantingSkillLevel then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- if we couldn't figure out the player's enchanting skill level, err on the side of showing stuff
|
|
|
|
|
if self.EnchantingLevel == 0 then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|