This commit is contained in:
@@ -58,26 +58,76 @@ function TSM:OnEnable()
|
||||
-- fix vellum issue
|
||||
for spellid, data in pairs(TSM.db.factionrealm.crafts) do
|
||||
for itemString in pairs(data.mats) do
|
||||
if itemString == "item:52510" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:52510:0:0:0:0:0:0"] = 1
|
||||
-- if itemString == "item:38682" then
|
||||
-- TSM.db.factionrealm.crafts[spellid].mats["item:38682:0:0:0:0:0:0"] = 1
|
||||
if itemString == "item:43146" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:43146:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
elseif itemString == "item:52511" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:52511:0:0:0:0:0:0"] = 1
|
||||
elseif itemString == "item:43145" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:43145:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
elseif itemString == "item:39350" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:39350:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
elseif itemString == "item:37602" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:37602:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
elseif itemString == "item:39349" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:39349:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
elseif itemString == "item:38682" then
|
||||
TSM.db.factionrealm.crafts[spellid].mats["item:38682:0:0:0:0:0:0"] = 1
|
||||
TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:52510"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:52510:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:52510:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:52510:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:52510"] = nil
|
||||
-- if TSM.db.factionrealm.mats["item:38682"] then
|
||||
-- local name = TSMAPI:GetSafeItemInfo("item:38682:0:0:0:0:0:0") or (GetLocale() == "enUS" and "Enchanting Vellum") or nil
|
||||
-- TSM.db.factionrealm.mats["item:38682:0:0:0:0:0:0"] = {}
|
||||
-- TSM.db.factionrealm.mats["item:38682:0:0:0:0:0:0"].name = name
|
||||
-- TSM.db.factionrealm.mats["item:38682"] = nil
|
||||
-- end
|
||||
if TSM.db.factionrealm.mats["item:43146"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:43146:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:43146:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:43146:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:43146"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:52511"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:52511:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:52511:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:52511:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:52511"] = nil
|
||||
if TSM.db.factionrealm.mats["item:43145"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:43145:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:43145:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:43145:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:43145"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:39350"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:39350:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:39350:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:39350:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:39350"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:39350"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:39350:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:39350:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:39350:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:39350"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:37602"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:37602:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:37602:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:37602:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:37602"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:39349"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:39349:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:39349:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:39349:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:39349"] = nil
|
||||
end
|
||||
if TSM.db.factionrealm.mats["item:38682"] then
|
||||
local name = TSMAPI:GetSafeItemInfo("item:38682:0:0:0:0:0:0") or nil
|
||||
TSM.db.factionrealm.mats["item:38682:0:0:0:0:0:0"] = {}
|
||||
TSM.db.factionrealm.mats["item:38682:0:0:0:0:0:0"].name = name
|
||||
TSM.db.factionrealm.mats["item:38682"] = nil
|
||||
end
|
||||
|
||||
local func, err = TSMAPI:ParseCustomPrice(TSM.db.global.defaultCraftPriceMethod, "crafting")
|
||||
@@ -188,6 +238,33 @@ function TSM:GetTooltip(itemString)
|
||||
local name, _, quality = TSMAPI:GetSafeItemInfo(matItemString)
|
||||
if name then
|
||||
local mat = TSM.db.factionrealm.mats[matItemString]
|
||||
|
||||
|
||||
|
||||
-- Get Cheapest vellum, lower vellum types can be replaced by III
|
||||
local velName
|
||||
if strfind(name, "Vellum") then
|
||||
velName = name
|
||||
end
|
||||
if (velName ~= nil) and (not strfind(velName, "III")) then
|
||||
local VellumReplacePrice = TSM.Cost:GetMatCost(matItemString)
|
||||
|
||||
if strfind(velName, "Weapon Vellum") then
|
||||
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") then
|
||||
matItemString = "item:43146:0:0:0:0:0:0"
|
||||
name = TSMAPI:GetSafeItemInfo(matItemString)
|
||||
end
|
||||
else
|
||||
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") then
|
||||
matItemString = "item:43145:0:0:0:0:0:0"
|
||||
name = TSMAPI:GetSafeItemInfo(matItemString)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if mat then
|
||||
local cost = TSM:GetCustomPrice(mat.customValue or TSM.db.global.defaultMatCostMethod, matItemString)
|
||||
if cost then
|
||||
@@ -358,4 +435,4 @@ function TSM:RestockHelp(link)
|
||||
end
|
||||
|
||||
print("This item will be added to the queue when you restock its group. If this isn't happening, make a post on the TSM forums with a screenshot of the item's tooltip, operation settings, and your general TSM_Crafting options.")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user