Browse Source

Enchanting fixes, reverted Crafting module to previous version that supports Ascension specific crafts and Vellums.

pull/1/head
xanthics 3 years ago
parent
commit
e5995fec55
  1. 4
      TradeSkillMaster/Data/Vendor.lua
  2. 12
      TradeSkillMaster_Crafting/Modules/Cost.lua
  3. 44
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua
  4. 104
      TradeSkillMaster_Crafting/Modules/EnchantingInfo.lua
  5. 79
      TradeSkillMaster_Crafting/Modules/SpellNames2IDs.lua
  6. 53
      TradeSkillMaster_Crafting/Modules/Util.lua
  7. 567
      TradeSkillMaster_Crafting/Modules/VellumInfo.lua
  8. 107
      TradeSkillMaster_Crafting/TradeSkillMaster_Crafting.lua

4
TradeSkillMaster/Data/Vendor.lua

@ -55,7 +55,9 @@ local vendorItems = {
["item:39684:0:0:0:0:0:0"] = 9000, ["item:39684:0:0:0:0:0:0"] = 9000,
["item:40533:0:0:0:0:0:0"] = 50000, ["item:40533:0:0:0:0:0:0"] = 50000,
["item:44835:0:0:0:0:0:0"] = 10, ["item:44835:0:0:0:0:0:0"] = 10,
["item:44853:0:0:0:0:0:0"] = 25, ["item:52510:0:0:0:0:0:0"] = 30000,
["item:52511:0:0:0:0:0:0"] = 30000,
["item:8925:0:0:0:0:0:0"] = 500,
-- ["item:52188:0:0:0:0:0:0"] = 15000, -- ["item:52188:0:0:0:0:0:0"] = 15000,
-- ["item:58274:0:0:0:0:0:0"] = 11000, -- ["item:58274:0:0:0:0:0:0"] = 11000,
-- ["item:58278:0:0:0:0:0:0"] = 16000, -- ["item:58278:0:0:0:0:0:0"] = 16000,

12
TradeSkillMaster_Crafting/Modules/Cost.lua

@ -72,12 +72,12 @@ function Cost:GetCraftCost(itemID)
for matID, matQuantity in pairs(craft.mats) do for matID, matQuantity in pairs(craft.mats) do
local MatName = GetItemInfo(matID) local MatName = GetItemInfo(matID)
if MatName ~= nil and strfind(MatName, "Vellum") then -- if MatName ~= nil and strfind(MatName, "Vellum") then
local NewItemString = CheapestVellum(matID) -- local NewItemString = CheapestVellum(matID)
if matID ~= NewItemString then -- if matID ~= NewItemString then
matID = NewItemString -- matID = NewItemString
end -- end
end -- end
local matCost = Cost:GetMatCost(matID) local matCost = Cost:GetMatCost(matID)
if not matCost or matCost == 0 then if not matCost or matCost == 0 then
costIsValid = false costIsValid = false

44
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -675,21 +675,15 @@ function GUI:CreateQueueFrame(parent)
if strfind(name, "Vellum") then if strfind(name, "Vellum") then
velName = name velName = name
end end
if (velName ~= nil) and (not strfind(velName, "III")) then if (velName ~= nil) then
local VellumReplacePrice = TSM.Cost:GetMatCost(itemIDx) if strfind(velName, "Weapon") then
itemIDx = "item:52511:0:0:0:0:0:0"
if strfind(velName, "Weapon Vellum") then
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") then
itemIDx = "item:43146:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx) name = TSMAPI:GetSafeItemInfo(itemIDx)
end
else else
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") then itemIDx = "item:52510:0:0:0:0:0:0"
itemIDx = "item:43145:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx) name = TSMAPI:GetSafeItemInfo(itemIDx)
end end
end end
end
local inventory = TSM.Inventory:GetPlayerBagNum(itemIDx) local inventory = TSM.Inventory:GetPlayerBagNum(itemIDx)
local need = matQuantity * data.numQueued local need = matQuantity * data.numQueued
@ -1455,7 +1449,7 @@ function GUI:CreateCraftInfoFrame(parent)
-- Enable display of items created -- Enable display of items created
local lNum, hNum = GetTradeSkillNumMade(skillIndex) local lNum, hNum = GetTradeSkillNumMade(skillIndex)
local numMade = floor(((lNum or 1) + (hNum or 1)) / 2) local numMade = floor(((lNum or 1) + (hNum or 1)) / 2)
if altVerb == ENSCRIBE then if altVerb ~= nil and strfind(name,"Enchant ") then
numMade = 1 numMade = 1
end end
if numMade > 1 then if numMade > 1 then
@ -1469,7 +1463,7 @@ function GUI:CreateCraftInfoFrame(parent)
-- The code below is heavily based on the code in Blizzard_TradeSkillUI.lua. -- The code below is heavily based on the code in Blizzard_TradeSkillUI.lua.
local toolsInfo = BuildColoredListString(GetTradeSkillTools(skillIndex)) local toolsInfo = BuildColoredListString(GetTradeSkillTools(skillIndex))
self.infoFrame.toolsText:SetText(toolsInfo and REQUIRES_LABEL .. " " .. toolsInfo or "") self.infoFrame.toolsText:SetText(toolsInfo and REQUIRES_LABEL .. " " .. toolsInfo or "")
local cooldown, isDayCooldown = GetTradeSkillCooldown(skillIndex) local cooldown = GetTradeSkillCooldown(skillIndex)
if not cooldown then if not cooldown then
self.infoFrame.cooldownText:SetText(""); self.infoFrame.cooldownText:SetText("");
elseif cooldown > 60 * 60 * 24 then --Cooldown is greater than 1 day. elseif cooldown > 60 * 60 * 24 then --Cooldown is greater than 1 day.
@ -1492,15 +1486,14 @@ function GUI:CreateCraftInfoFrame(parent)
end end
end end
if altVerb == ENSCRIBE then -- if altVerb == ENSCRIBE then
if altVerb ~= nil and strfind(name,"Enchant ") then
createAllBtn:SetText(L["Enchant Vellum"]) createAllBtn:SetText(L["Enchant Vellum"])
-- createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:38682:0:0:0:0:0:0")
if strfind(name, "Weapon") or strfind(name, "Staff") then if strfind(name, "Weapon") or strfind(name, "Staff") then
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:43146:0:0:0:0:0:0") -- Weapon Vellum III createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52511:0:0:0:0:0:0") -- Weapon Vellum
else else
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:43145:0:0:0:0:0:0") -- Armor Vellum III createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52510:0:0:0:0:0:0") -- Armor Vellum
end end
else else
createAllBtn:SetText(CREATE_ALL) createAllBtn:SetText(CREATE_ALL)
createAllBtn.vellum = nil createAllBtn.vellum = nil
@ -1824,12 +1817,6 @@ function GUI:UpdateQueue()
canCraft = min(canCraft, floor(numHave / quantity)) canCraft = min(canCraft, floor(numHave / quantity))
end end
-- local velName
-- local VELLUM_ID = "item:38682:0:0:0:0:0:0"
-- if TSM.db.factionrealm.crafts[spellID].mats[VELLUM_ID] then
-- velName = GetItemInfo(VELLUM_ID) or TSM.db.factionrealm.mats[VELLUM_ID].name
-- end
local color local color
local craftIndex = skillIndexLookup[spellID] local craftIndex = skillIndexLookup[spellID]
if canCraft >= numQueued then if canCraft >= numQueued then
@ -2753,7 +2740,7 @@ end
function CheapestVellum(itemPassed) function CheapestVellum(itemPassed)
-- Get Cheapest vellum, lower vellum types can be replaced by III -- Return one of the two vellum available
local MatName = GetItemInfo(itemPassed) local MatName = GetItemInfo(itemPassed)
-- MatName is sometimes nil ??? -- MatName is sometimes nil ???
if MatName ~= nil then if MatName ~= nil then
@ -2761,12 +2748,11 @@ function CheapestVellum(itemPassed)
if strfind(MatName, "Vellum") then if strfind(MatName, "Vellum") then
velName = MatName velName = MatName
end end
if (velName ~= nil) and (not strfind(velName, "III")) then if (velName ~= nil) then
local VellumReplacePrice = TSM.Cost:GetMatCost(itemPassed) or 0 if strfind(velName, "Weapon") then
if strfind(velName, "Weapon Vellum") then itemPassed = "item:52511:0:0:0:0:0:0"
if VellumReplacePrice > (TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") or 0) then itemPassed = "item:43146:0:0:0:0:0:0" end
else else
if VellumReplacePrice > (TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") or 0) then itemPassed = "item:43145:0:0:0:0:0:0" end itemPassed = "item:52510:0:0:0:0:0:0"
end end
end end
end end

104
TradeSkillMaster_Crafting/Modules/EnchantingInfo.lua

@ -14,7 +14,7 @@ TSM.enchantingName = GetSpellInfo(7411)
-- looks up the itemID of the scroll that the enchant makes -- looks up the itemID of the scroll that the enchant makes
-- index = spellID of the enchant -- index = spellID of the enchant
-- value = itemID of scroll -- value = itemID of scroll
TSM.enchantingItemIDs = { --TSM.enchantingItemIDs = {
-- -- MOP -- -- MOP
-- [110764] = 79061, -- Enchant Weapon - Pandamonium -- [110764] = 79061, -- Enchant Weapon - Pandamonium
-- [104338] = 74700, -- Enchant Bracer - Mastery -- [104338] = 74700, -- Enchant Bracer - Mastery
@ -341,6 +341,58 @@ TSM.enchantingItemIDs = {
-- [28003] = 38926, -- Enchant Weapon - Spellsurge -- [28003] = 38926, -- Enchant Weapon - Spellsurge
-- [28004] = 38927, -- Enchant Weapon - Battlemaster -- [28004] = 38927, -- Enchant Weapon - Battlemaster
-- High Risk Ascension Content
-- [968676] = 967760, -- Enchant Weapon - Unstoppable Assault I
-- [968677] = 967761, -- Enchant Weapon - Unstoppable Assault II
-- [968678] = 967762, -- Enchant Weapon - Unstoppable Assault III
-- [968679] = 967763, -- Enchant Weapon - Lucid Assault I
-- [968680] = 967764, -- Enchant Weapon - Lucid Assault II
-- [968681] = 967765, -- Enchant Weapon - Lucid Assault III
-- [968682] = 967766, -- Enchant Weapon - Spellbinder's Rage I
-- [968683] = 967767, -- Enchant Weapon - Spellbinder's Rage II
-- [968684] = 967768, -- Enchant Weapon - Spellbinder's Rage III
-- [968685] = 967769, -- Enchant Weapon - Ninja's Focus I
-- [968686] = 967770, -- Enchant Weapon - Ninja's Focus II
-- [968687] = 967771, -- Enchant Weapon - Ninja's Focus III
-- [968688] = 967772, -- Enchant Weapon - Grovewarden's Blessing I
-- [968689] = 967773, -- Enchant Weapon - Grovewarden's Blessing II
-- [968690] = 967774, -- Enchant Weapon - Grovewarden's Blessing III
-- [968691] = 967775, -- Enchant Weapon - Viscious Assault I
-- [968692] = 967776, -- Enchant Weapon - Viscious Assault II
-- [968693] = 967777, -- Enchant Weapon - Viscious Assault III
-- [968694] = 967778, -- Enchant Weapon - Arcane Dexterity I
-- [968695] = 967779, -- Enchant Weapon - Arcane Dexterity II
-- [968696] = 967780, -- Enchant Weapon - Arcane Dexterity III
-- [968697] = 967781, -- Enchant Weapon - Arcane Artillery I
-- [968698] = 967782, -- Enchant Weapon - Arcane Artillery II
-- [968699] = 967783, -- Enchant Weapon - Arcane Artillery III
-- [968700] = 967784, -- Enchant Weapon - Arcane Precision I
-- [968701] = 967785, -- Enchant Weapon - Arcane Precision II
-- [968702] = 967786, -- Enchant Weapon - Arcane Precision III
-- [968770] = 967787, -- Enchant Weapon - Crusader II
-- [968771] = 967788, -- Enchant Weapon - Crusader III
-- [1968677] = 1204125, -- Enchant Weapon - Void Assault
-- [1968678] = 1204126, -- Enchant Weapon - Overpowering Void Assault
-- [1968680] = 1204127, -- Enchant Weapon - Dread Assault
-- [1968681] = 1204128, -- Enchant Weapon - Overpowering Dread Assault
-- [1968683] = 1204129, -- Enchant Weapon - Twisted Evoker
-- [1968684] = 1204130, -- Enchant Weapon - Overpowering Twisted Evoker
-- [1968686] = 1204131, -- Enchant Weapon - Twisted Assault
-- [1968687] = 1204132, -- Enchant Weapon - Overpowering Twisted Assault
-- [1968689] = 1204133, -- Enchant Weapon - Twisted Channeler
-- [1968690] = 1204134, -- Enchant Weapon - Overpowering Twisted Channeler
-- [1968692] = 1204135, -- Enchant Weapon - Dread Omen Strikes
-- [1968693] = 1204136, -- Enchant Weapon - Overpowering Dread Omen Strikes
-- [1968695] = 1204137, -- Enchant Weapon - Void Flows
-- [1968696] = 1204138, -- Enchant Weapon - Overpowering Void Flows
-- [1968698] = 1204139, -- Enchant Weapon - Void Blasting
-- [1968699] = 1204140, -- Enchant Weapon - Overpowering Void Blasting
-- [1968701] = 1204141, -- Enchant Weapon - Dread Precision
-- [1968702] = 1204142, -- Enchant Weapon - Overpowering Dread Precision
-- [1968770] = 1204143, -- Enchant Weapon - Twisted Crusader
-- [1968771] = 1204144, -- Enchant Weapon - Overpowering Twisted Crusader
TSM.enchantingItemIDs = {
[7418] = 38679, -- Scroll of Enchant Bracer - Minor Health [7418] = 38679, -- Scroll of Enchant Bracer - Minor Health
[7420] = 38766, -- Scroll of Enchant Chest - Minor Health [7420] = 38766, -- Scroll of Enchant Chest - Minor Health
[7426] = 38767, -- Scroll of Enchant Chest - Minor Absorption [7426] = 38767, -- Scroll of Enchant Chest - Minor Absorption
@ -600,4 +652,54 @@ TSM.enchantingItemIDs = {
[64441] = 46026, -- Scroll of Enchant Weapon - Blade Ward [64441] = 46026, -- Scroll of Enchant Weapon - Blade Ward
[64579] = 46098, -- Scroll of Enchant Weapon - Blood Draining [64579] = 46098, -- Scroll of Enchant Weapon - Blood Draining
[71692] = 50816, -- Scroll of Enchant Gloves - Angler [71692] = 50816, -- Scroll of Enchant Gloves - Angler
[968676] = 967760, -- Scroll of Enchant Weapon - Unstoppable Assault I
[968677] = 967761, -- Scroll of Enchant Weapon - Unstoppable Assault II
[968678] = 967762, -- Scroll of Enchant Weapon - Unstoppable Assault III
[968679] = 967763, -- Scroll of Enchant Weapon - Lucid Assault I
[968680] = 967764, -- Scroll of Enchant Weapon - Lucid Assault II
[968681] = 967765, -- Scroll of Enchant Weapon - Lucid Assault III
[968682] = 967766, -- Scroll of Enchant Weapon - Spellbinder's Rage I
[968683] = 967767, -- Scroll of Enchant Weapon - Spellbinder's Rage II
[968684] = 967768, -- Scroll of Enchant Weapon - Spellbinder's Rage III
[968685] = 967769, -- Scroll of Enchant Weapon - Ninja's Focus I
[968686] = 967770, -- Scroll of Enchant Weapon - Ninja's Focus II
[968687] = 967771, -- Scroll of Enchant Weapon - Ninja's Focus III
[968688] = 967772, -- Scroll of Enchant Weapon - Grovewarden's Blessing I
[968689] = 967773, -- Scroll of Enchant Weapon - Grovewarden's Blessing II
[968690] = 967774, -- Scroll of Enchant Weapon - Grovewarden's Blessing III
[968691] = 967775, -- Scroll of Enchant Weapon - Viscious Assault I
[968692] = 967776, -- Scroll of Enchant Weapon - Viscious Assault II
[968693] = 967777, -- Scroll of Enchant Weapon - Viscious Assault III
[968694] = 967778, -- Scroll of Enchant Weapon - Arcane Dexterity I
[968695] = 967779, -- Scroll of Enchant Weapon - Arcane Dexterity II
[968696] = 967780, -- Scroll of Enchant Weapon - Arcane Dexterity III
[968697] = 967781, -- Scroll of Enchant Weapon - Arcane Artillery I
[968698] = 967782, -- Scroll of Enchant Weapon - Arcane Artillery II
[968699] = 967783, -- Scroll of Enchant Weapon - Arcane Artillery III
[968700] = 967784, -- Scroll of Enchant Weapon - Arcane Precision I
[968701] = 967785, -- Scroll of Enchant Weapon - Arcane Precision II
[968702] = 967786, -- Scroll of Enchant Weapon - Arcane Precision III
[968770] = 967787, -- Scroll of Enchant Weapon - Crusader II
[968771] = 967788, -- Scroll of Enchant Weapon - Crusader III
[1968677] = 1204125, -- Scroll of Enchant Weapon - Void Assault
[1968678] = 1204126, -- Scroll of Enchant Weapon - Overpowering Void Assault
[1968680] = 1204127, -- Scroll of Enchant Weapon - Dread Assault
[1968681] = 1204128, -- Scroll of Enchant Weapon - Overpowering Dread Assault
[1968683] = 1204129, -- Scroll of Enchant Weapon - Twisted Evoker
[1968684] = 1204130, -- Scroll of Enchant Weapon - Overpowering Twisted Evoker
[1968686] = 1204131, -- Scroll of Enchant Weapon - Twisted Assault
[1968687] = 1204132, -- Scroll of Enchant Weapon - Overpowering Twisted Assault
[1968689] = 1204133, -- Scroll of Enchant Weapon - Twisted Channeler
[1968690] = 1204134, -- Scroll of Enchant Weapon - Overpowering Twisted Channeler
[1968692] = 1204135, -- Scroll of Enchant Weapon - Dread Omen Strikes
[1968693] = 1204136, -- Scroll of Enchant Weapon - Overpowering Dread Omen Strikes
[1968695] = 1204137, -- Scroll of Enchant Weapon - Void Flows
[1968696] = 1204138, -- Scroll of Enchant Weapon - Overpowering Void Flows
[1968698] = 1204139, -- Scroll of Enchant Weapon - Void Blasting
[1968699] = 1204140, -- Scroll of Enchant Weapon - Overpowering Void Blasting
[1968701] = 1204141, -- Scroll of Enchant Weapon - Dread Precision
[1968702] = 1204142, -- Scroll of Enchant Weapon - Overpowering Dread Precision
[1968770] = 1204143, -- Scroll of Enchant Weapon - Twisted Crusader
[1968771] = 1204144, -- Scroll of Enchant Weapon - Overpowering Twisted Crusader
} }

79
TradeSkillMaster_Crafting/Modules/SpellNames2IDs.lua

@ -764,6 +764,12 @@ TSM.SpellName2ID = {
["Treads of Destiny"] = 63190, ["Treads of Destiny"] = 63190,
["Indestructible Plate Girdle"] = 63191, ["Indestructible Plate Girdle"] = 63191,
["Spiked Deathdealers"] = 63192, ["Spiked Deathdealers"] = 63192,
["Breastplate of the White Knight"] = 67091,
["Saronite Swordbreakers"] = 67092,
["Titanium Razorplate"] = 67093,
["Titanium Spikeguards"] = 67094,
["Sunforged Breastplate"] = 67095,
["Sunforged Bracers"] = 67096,
["Breastplate of the White Knight"] = 67130, ["Breastplate of the White Knight"] = 67130,
["Saronite Swordbreakers"] = 67131, ["Saronite Swordbreakers"] = 67131,
["Titanium Razorplate"] = 67132, ["Titanium Razorplate"] = 67132,
@ -877,6 +883,7 @@ TSM.SpellName2ID = {
["Lesser Mystic Wand"] = 14809, ["Lesser Mystic Wand"] = 14809,
["Greater Mystic Wand"] = 14810, ["Greater Mystic Wand"] = 14810,
["Smoking Heart of the Mountain"] = 15596, ["Smoking Heart of the Mountain"] = 15596,
["Enchanted Thorium"] = 17180,
["Enchanted Leather"] = 17181, ["Enchanted Leather"] = 17181,
["Enchant Bracer - Greater Intellect"] = 20008, ["Enchant Bracer - Greater Intellect"] = 20008,
["Enchant Bracer - Superior Spirit"] = 20009, ["Enchant Bracer - Superior Spirit"] = 20009,
@ -1079,7 +1086,55 @@ TSM.SpellName2ID = {
["Enchant Weapon - Blood Draining"] = 64579, ["Enchant Weapon - Blood Draining"] = 64579,
["Abyssal Shatter"] = 69412, ["Abyssal Shatter"] = 69412,
["Enchant Gloves - Angler"] = 71692, ["Enchant Gloves - Angler"] = 71692,
["Enchant Weapon - Unstoppable Assault I"] = 968676,
["Enchant Weapon - Unstoppable Assault II"] = 968677,
["Enchant Weapon - Unstoppable Assault III"] = 968678,
["Enchant Weapon - Lucid Assault I"] = 968679,
["Enchant Weapon - Lucid Assault II"] = 968680,
["Enchant Weapon - Lucid Assault III"] = 968681,
["Enchant Weapon - Spellbinder's Rage I"] = 968682,
["Enchant Weapon - Spellbinder's Rage II"] = 968683,
["Enchant Weapon - Spellbinder's Rage III"] = 968684,
["Enchant Weapon - Ninja's Focus I"] = 968685,
["Enchant Weapon - Ninja's Focus II"] = 968686,
["Enchant Weapon - Ninja's Focus III"] = 968687,
["Enchant Weapon - Grovewarden's Blessing I"] = 968688,
["Enchant Weapon - Grovewarden's Blessing II"] = 968689,
["Enchant Weapon - Grovewarden's Blessing III"] = 968690,
["Enchant Weapon - Viscious Assault I"] = 968691,
["Enchant Weapon - Viscious Assault II"] = 968692,
["Enchant Weapon - Viscious Assault III"] = 968693,
["Enchant Weapon - Arcane Dexterity I"] = 968694,
["Enchant Weapon - Arcane Dexterity II"] = 968695,
["Enchant Weapon - Arcane Dexterity III"] = 968696,
["Enchant Weapon - Arcane Artillery I"] = 968697,
["Enchant Weapon - Arcane Artillery II"] = 968698,
["Enchant Weapon - Arcane Artillery III"] = 968699,
["Enchant Weapon - Arcane Precision I"] = 968700,
["Enchant Weapon - Arcane Precision II"] = 968701,
["Enchant Weapon - Arcane Precision III"] = 968702,
["Enchant Weapon - Crusader II"] = 968770,
["Enchant Weapon - Crusader III"] = 968771,
["Enchant Weapon - Void Assault"] = 1968677,
["Enchant Weapon - Overpowering Void Assault"] = 1968678,
["Enchant Weapon - Dread Assault"] = 1968680,
["Enchant Weapon - Overpowering Dread Assault"] = 1968681,
["Enchant Weapon - Twisted Evoker"] = 1968683,
["Enchant Weapon - Overpowering Twisted Evoker"] = 1968684,
["Enchant Weapon - Twisted Assault"] = 1968686,
["Enchant Weapon - Overpowering Twisted Assault"] = 1968687,
["Enchant Weapon - Twisted Channeler"] = 1968689,
["Enchant Weapon - Overpowering Twisted ChannelerI"] = 1968690,
["Enchant Weapon - Dread Omen Strikes"] = 1968692,
["Enchant Weapon - Overpowering Dread Omen Strikes"] = 1968693,
["Enchant Weapon - Void Flows"] = 1968695,
["Enchant Weapon - Overpowering Void Flows"] = 1968696,
["Enchant Weapon - Void Blasting"] = 1968698,
["Enchant Weapon - Overpowering Void Blasting"] = 1968699,
["Enchant Weapon - Dread Precision"] = 1968701,
["Enchant Weapon - Overpowering Dread Precision"] = 1968702,
["Enchant Weapon - Twisted Crusader"] = 1968770,
["Enchant Weapon - Overpowering Twisted Crusader"] = 1968771,
-- Engineering -- Engineering
@ -1343,6 +1398,7 @@ TSM.SpellName2ID = {
["Gnomish Army Knife"] = 56462, ["Gnomish Army Knife"] = 56462,
["Explosive Decoy"] = 56463, ["Explosive Decoy"] = 56463,
["Overcharged Capacitor"] = 56464, ["Overcharged Capacitor"] = 56464,
["Mechanized Snow Goggles"] = 56465,
["Sonic Booster"] = 56466, ["Sonic Booster"] = 56466,
["Noise Machine"] = 56467, ["Noise Machine"] = 56467,
["Box of Bombs"] = 56468, ["Box of Bombs"] = 56468,
@ -1369,6 +1425,8 @@ TSM.SpellName2ID = {
["Mekgineer's Chopper"] = 60867, ["Mekgineer's Chopper"] = 60867,
["Nesingwary 4000"] = 60874, ["Nesingwary 4000"] = 60874,
["Diamond-cut Refractor Scope"] = 61471, ["Diamond-cut Refractor Scope"] = 61471,
["Mechanized Snow Goggles"] = 61481,
["Mechanized Snow Goggles"] = 61482,
["Mechanized Snow Goggles"] = 61483, ["Mechanized Snow Goggles"] = 61483,
["Unbreakable Healing Amplifiers"] = 62271, ["Unbreakable Healing Amplifiers"] = 62271,
["High-powered Flashlight"] = 63750, ["High-powered Flashlight"] = 63750,
@ -2588,6 +2646,7 @@ TSM.SpellName2ID = {
["Rugged Leather"] = 22331, ["Rugged Leather"] = 22331,
["Shadowskin Gloves"] = 22711, ["Shadowskin Gloves"] = 22711,
["Core Armor Kit"] = 22727, ["Core Armor Kit"] = 22727,
["Gordok Ogre Suit"] = 22815,
["Girdle of Insight"] = 22921, ["Girdle of Insight"] = 22921,
["Mongoose Boots"] = 22922, ["Mongoose Boots"] = 22922,
["Swift Flight Bracers"] = 22923, ["Swift Flight Bracers"] = 22923,
@ -2907,6 +2966,14 @@ TSM.SpellName2ID = {
["Belt of Arctic Life"] = 63200, ["Belt of Arctic Life"] = 63200,
["Boots of Wintry Endurance"] = 63201, ["Boots of Wintry Endurance"] = 63201,
["Borean Leather"] = 64661, ["Borean Leather"] = 64661,
["Ensorcelled Nerubian Breastplate"] = 67080,
["Black Chitin Bracers"] = 67081,
["Crusader's Dragonscale Breastplate"] = 67082,
["Crusader's Dragonscale Bracers"] = 67083,
["Lunar Eclipse Robes"] = 67084,
["Moonshadow Armguards"] = 67085,
["Knightbane Carapace"] = 67086,
["Bracers of Swift Death"] = 67087,
["Ensorcelled Nerubian Breastplate"] = 67136, ["Ensorcelled Nerubian Breastplate"] = 67136,
["Black Chitin Bracers"] = 67137, ["Black Chitin Bracers"] = 67137,
["Crusader's Dragonscale Breastplate"] = 67138, ["Crusader's Dragonscale Breastplate"] = 67138,
@ -3281,6 +3348,7 @@ TSM.SpellName2ID = {
["Duskweave Robe"] = 55921, ["Duskweave Robe"] = 55921,
["Duskweave Gloves"] = 55922, ["Duskweave Gloves"] = 55922,
["Duskweave Shoulders"] = 55923, ["Duskweave Shoulders"] = 55923,
["Duskweave Boots"] = 55924,
["Black Duskweave Leggings"] = 55925, ["Black Duskweave Leggings"] = 55925,
["Black Duskweave Robe"] = 55941, ["Black Duskweave Robe"] = 55941,
["Black Duskweave Wristwraps"] = 55943, ["Black Duskweave Wristwraps"] = 55943,
@ -3345,6 +3413,10 @@ TSM.SpellName2ID = {
["Emerald Bag"] = 63924, ["Emerald Bag"] = 63924,
["Frostguard Drape"] = 64729, ["Frostguard Drape"] = 64729,
["Cloak of Crimson Snow"] = 64730, ["Cloak of Crimson Snow"] = 64730,
["Royal Moonshroud Robe"] = 67064,
["Royal Moonshroud Bracers"] = 67065,
["Merlin's Robe"] = 67066,
["Bejeweled Wizard's Bracers"] = 67079,
["Royal Moonshroud Robe"] = 67144, ["Royal Moonshroud Robe"] = 67144,
["Bejeweled Wizard's Bracers"] = 67145, ["Bejeweled Wizard's Bracers"] = 67145,
["Merlin's Robe"] = 67146, ["Merlin's Robe"] = 67146,
@ -3549,6 +3621,11 @@ TSM.SpellName2ID = {
["Haunted Herring"] = 58525, ["Haunted Herring"] = 58525,
["Gigantic Feast"] = 58527, ["Gigantic Feast"] = 58527,
["Small Feast"] = 58528, ["Small Feast"] = 58528,
["Pumpkin Pie"] = 62044,
["Slow-Roasted Turkey"] = 62045,
["Cranberry Chutney"] = 62049,
["Spice Bread Stuffing"] = 62050,
["Candied Sweet Potato"] = 62051,
["Worg Tartare"] = 62350, ["Worg Tartare"] = 62350,
["Clamlette Magnifique"] = 64054, ["Clamlette Magnifique"] = 64054,
["Black Jelly"] = 64358, ["Black Jelly"] = 64358,

53
TradeSkillMaster_Crafting/Modules/Util.lua

@ -102,34 +102,10 @@ function Util:ScanCurrentProfession()
if itemID and spellID then if itemID and spellID then
local lNum, hNum = GetTradeSkillNumMade(index) local lNum, hNum = GetTradeSkillNumMade(index)
local numMade = floor(((lNum or 1) + (hNum or 1))/2) local numMade = floor(((lNum or 1) + (hNum or 1))/2)
local hasCD = select(2, GetTradeSkillCooldown(index)) and true or nil local hasCD = GetTradeSkillCooldown(index) and true or nil
local mats = {} local mats = {}
if currentTradeSkill == TSM.enchantingName and strfind(itemLink, "enchant:") then if currentTradeSkill == TSM.enchantingName and strfind(itemLink, "enchant:") then
-- mats[VELLUM_ID] = 1
-- local name = TSMAPI:GetSafeItemInfo(VELLUM_ID) or (GetLocale() == "enUS" and "Enchanting Vellum") or nil
-- TSM.db.factionrealm.mats[VELLUM_ID] = TSM.db.factionrealm.mats[VELLUM_ID] or {}
-- TSM.db.factionrealm.mats[VELLUM_ID].name = TSM.db.factionrealm.mats[VELLUM_ID].name or name
local VellumString = "item:"..TSM.VellumInfo[spellID]..":0:0:0:0:0:0" local VellumString = "item:"..TSM.VellumInfo[spellID]..":0:0:0:0:0:0"
-- -- Get Cheapest vellum, lower vellum types can be replaced by III
-- local velName
-- if TSM.VellumInfo[spellID] then
-- velName = GetItemInfo(TSM.VellumInfo[spellID])
-- end
-- if (velName ~= nil) and (not strfind(velName, "III")) then
-- local VellumReplacePrice = TSM.Cost:GetMatCost(VellumString)
-- if strfind(GetSpellInfo(spellID), "Weapon") or strfind(GetSpellInfo(spellID), "Staff")then
-- if VellumReplacePrice > TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") then VellumString = "item:43146:0:0:0:0:0:0" end
-- else
-- if VellumReplacePrice > TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") then VellumString = "item:4314:0:0:0:0:0:0" end
-- end
-- end
mats[VellumString] = 1 mats[VellumString] = 1
local name = TSMAPI:GetSafeItemInfo(VellumString) or nil local name = TSMAPI:GetSafeItemInfo(VellumString) or nil
TSM.db.factionrealm.mats[VellumString] = TSM.db.factionrealm.mats[VellumString] or {} TSM.db.factionrealm.mats[VellumString] = TSM.db.factionrealm.mats[VellumString] or {}
@ -251,36 +227,11 @@ function Util.ScanSyncedProfessionThread(self)
if itemID and spellID then if itemID and spellID then
local lNum, hNum = GetTradeSkillNumMade(index) local lNum, hNum = GetTradeSkillNumMade(index)
local numMade = floor(((lNum or 1) + (hNum or 1))/2) local numMade = floor(((lNum or 1) + (hNum or 1))/2)
local hasCD = select(2, GetTradeSkillCooldown(index)) and true or nil local hasCD = GetTradeSkillCooldown(index) and true or nil
local mats = {} local mats = {}
if currentTradeSkill == TSM.enchantingName and strfind(itemLink, "enchant:") then if currentTradeSkill == TSM.enchantingName and strfind(itemLink, "enchant:") then
-- mats[VELLUM_ID] = 1
-- local name = TSMAPI:GetSafeItemInfo(VELLUM_ID) or (GetLocale() == "enUS" and "Enchanting Vellum") or nil
-- TSM.db.factionrealm.mats[VELLUM_ID] = TSM.db.factionrealm.mats[VELLUM_ID] or {}
-- TSM.db.factionrealm.mats[VELLUM_ID].name = TSM.db.factionrealm.mats[VELLUM_ID].name or name
local VellumString = "item:"..TSM.VellumInfo[spellID]..":0:0:0:0:0:0" local VellumString = "item:"..TSM.VellumInfo[spellID]..":0:0:0:0:0:0"
-- -- Get Cheapest vellum, lower vellum types can be replaced by III
-- local velName
-- if TSM.VellumInfo[spellID] then
-- velName = GetItemInfo(TSM.VellumInfo[spellID])
-- end
-- if (velName ~= nil) and (not strfind(velName, "III")) then
-- local VellumReplacePrice = TSM.Cost:GetMatCost(VellumString)
-- if strfind(GetSpellInfo(spellID), "Weapon") or strfind(GetSpellInfo(spellID), "Staff")then
-- if VellumReplacePrice > TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") then VellumString = "item:43146:0:0:0:0:0:0" end
-- else
-- if VellumReplacePrice > TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") then VellumString = "item:4314:0:0:0:0:0:0" end
-- end
-- end
mats[VellumString] = 1 mats[VellumString] = 1
local name = TSMAPI:GetSafeItemInfo(VellumString) or nil local name = TSMAPI:GetSafeItemInfo(VellumString) or nil
TSM.db.factionrealm.mats[VellumString] = TSM.db.factionrealm.mats[VellumString] or {} TSM.db.factionrealm.mats[VellumString] = TSM.db.factionrealm.mats[VellumString] or {}

567
TradeSkillMaster_Crafting/Modules/VellumInfo.lua

@ -2,262 +2,311 @@
local TSM = select(2, ...) local TSM = select(2, ...)
TSM.VellumInfo = { TSM.VellumInfo = {
[7418] = 38682, [7418] = 52510,
[7420] = 38682, [7420] = 52510,
[7426] = 38682, [7426] = 52510,
[7428] = 38682, [7428] = 52510,
[7443] = 38682, [7443] = 52510,
[7454] = 38682, [7454] = 52510,
[7457] = 38682, [7457] = 52510,
[7745] = 39349, [7745] = 52511,
[7748] = 38682, [7748] = 52510,
[7766] = 38682, [7766] = 52510,
[7771] = 38682, [7771] = 52510,
[7776] = 38682, [7776] = 52510,
[7779] = 38682, [7779] = 52510,
[7782] = 38682, [7782] = 52510,
[7786] = 39349, [7786] = 52511,
[7788] = 39349, [7788] = 52511,
[7793] = 39349, [7793] = 52511,
[7857] = 38682, [7857] = 52510,
[7859] = 38682, [7859] = 52510,
[7861] = 38682, [7861] = 52510,
[7863] = 38682, [7863] = 52510,
[7867] = 38682, [7867] = 52510,
[13378] = 38682, [13378] = 52510,
[13380] = 39349, [13380] = 52511,
[13419] = 38682, [13419] = 52510,
[13421] = 38682, [13421] = 52510,
[13464] = 38682, [13464] = 52510,
[13485] = 38682, [13485] = 52510,
[13501] = 38682, [13501] = 52510,
[13503] = 39349, [13503] = 52511,
[13522] = 38682, [13522] = 52510,
[13529] = 39349, [13529] = 52511,
[13536] = 38682, [13536] = 52510,
[13538] = 38682, [13538] = 52510,
[13607] = 38682, [13607] = 52510,
[13612] = 38682, [13612] = 52510,
[13617] = 38682, [13617] = 52510,
[13620] = 38682, [13620] = 52510,
[13622] = 38682, [13622] = 52510,
[13626] = 38682, [13626] = 52510,
[13631] = 38682, [13631] = 52510,
[13635] = 38682, [13635] = 52510,
[13637] = 38682, [13637] = 52510,
[13640] = 38682, [13640] = 52510,
[13642] = 38682, [13642] = 52510,
[13644] = 38682, [13644] = 52510,
[13646] = 38682, [13646] = 52510,
[13648] = 38682, [13648] = 52510,
[13653] = 39349, [13653] = 52511,
[13655] = 39349, [13655] = 52511,
[13657] = 38682, [13657] = 52510,
[13659] = 38682, [13659] = 52510,
[13661] = 38682, [13661] = 52510,
[13663] = 38682, [13663] = 52510,
[13687] = 38682, [13687] = 52510,
[13689] = 38682, [13689] = 52510,
[13693] = 39349, [13693] = 52511,
[13695] = 39349, [13695] = 52511,
[13698] = 38682, [13698] = 52510,
[13700] = 38682, [13700] = 52510,
[13746] = 38682, [13746] = 52510,
[13794] = 38682, [13794] = 52510,
[13815] = 38682, [13815] = 52510,
[13817] = 38682, [13817] = 52510,
[13822] = 38682, [13822] = 52510,
[13836] = 38682, [13836] = 52510,
[13841] = 38682, [13841] = 52510,
[13846] = 38682, [13846] = 52510,
[13858] = 38682, [13858] = 52510,
[13868] = 38682, [13868] = 52510,
[13882] = 38682, [13882] = 52510,
[13887] = 38682, [13887] = 52510,
[13890] = 38682, [13890] = 52510,
[13898] = 39349, [13898] = 52511,
[13905] = 38682, [13905] = 52510,
[13915] = 39349, [13915] = 52511,
[13917] = 38682, [13917] = 52510,
[13931] = 38682, [13931] = 52510,
[13933] = 38682, [13933] = 52510,
[13935] = 38682, [13935] = 52510,
[13937] = 39349, [13937] = 52511,
[13939] = 38682, [13939] = 52510,
[13941] = 38682, [13941] = 52510,
[13943] = 39349, [13943] = 52511,
[13945] = 38682, [13945] = 52510,
[13947] = 38682, [13947] = 52510,
[13948] = 38682, [13948] = 52510,
[20008] = 38682, [20008] = 52510,
[20009] = 38682, [20009] = 52510,
[20010] = 38682, [20010] = 52510,
[20011] = 38682, [20011] = 52510,
[20012] = 38682, [20012] = 52510,
[20013] = 38682, [20013] = 52510,
[20014] = 38682, [20014] = 52510,
[20015] = 38682, [20015] = 52510,
[20016] = 38682, [20016] = 52510,
[20017] = 38682, [20017] = 52510,
[20020] = 38682, [20020] = 52510,
[20023] = 38682, [20023] = 52510,
[20024] = 38682, [20024] = 52510,
[20025] = 38682, [20025] = 52510,
[20026] = 38682, [20026] = 52510,
[20028] = 38682, [20028] = 52510,
[20029] = 39349, [20029] = 52511,
[20030] = 39349, [20030] = 52511,
[20031] = 39349, [20031] = 52511,
[20032] = 39349, [20032] = 52511,
[20033] = 39349, [20033] = 52511,
[20034] = 39349, [20034] = 52511,
[20035] = 39349, [20035] = 52511,
[20036] = 39349, [20036] = 52511,
[21931] = 39349, [21931] = 52511,
[22749] = 39349, [22749] = 52511,
[22750] = 39349, [22750] = 52511,
[23799] = 39349, [23799] = 52511,
[23800] = 39349, [23800] = 52511,
[23801] = 38682, [23801] = 52510,
[23802] = 38682, [23802] = 52510,
[23803] = 39349, [23803] = 52511,
[23804] = 39349, [23804] = 52511,
[25072] = 38682, [25072] = 52510,
[25073] = 38682, [25073] = 52510,
[25074] = 38682, [25074] = 52510,
[25078] = 38682, [25078] = 52510,
[25079] = 38682, [25079] = 52510,
[25080] = 38682, [25080] = 52510,
[25081] = 38682, [25081] = 52510,
[25082] = 38682, [25082] = 52510,
[25083] = 38682, [25083] = 52510,
[25084] = 38682, [25084] = 52510,
[25086] = 37602, [25086] = 52510,
[27837] = 39349, [27837] = 52511,
[27899] = 37602, [27899] = 52510,
[27905] = 37602, [27905] = 52510,
[27906] = 37602, [27906] = 52510,
[27911] = 37602, [27911] = 52510,
[27913] = 37602, [27913] = 52510,
[27914] = 37602, [27914] = 52510,
[27917] = 37602, [27917] = 52510,
[27944] = 37602, [27944] = 52510,
[27945] = 37602, [27945] = 52510,
[27946] = 37602, [27946] = 52510,
[27947] = 37602, [27947] = 52510,
[27948] = 37602, [27948] = 52510,
[27950] = 37602, [27950] = 52510,
[27951] = 37602, [27951] = 52510,
[27954] = 37602, [27954] = 52510,
[27957] = 37602, [27957] = 52510,
[27958] = 43145, [27958] = 52510,
[27960] = 37602, [27960] = 52510,
[27961] = 37602, [27961] = 52510,
[27962] = 37602, [27962] = 52510,
[27967] = 39350, [27967] = 52511,
[27968] = 39350, [27968] = 52511,
[27971] = 39350, [27971] = 52511,
[27972] = 39350, [27972] = 52511,
[27975] = 39350, [27975] = 52511,
[27977] = 39350, [27977] = 52511,
[27981] = 39350, [27981] = 52511,
[27982] = 39350, [27982] = 52511,
[27984] = 39350, [27984] = 52511,
[28003] = 39350, [28003] = 52511,
[28004] = 39350, [28004] = 52511,
[33990] = 37602, [33990] = 52510,
[33991] = 37602, [33991] = 52510,
[33992] = 37602, [33992] = 52510,
[33993] = 37602, [33993] = 52510,
[33994] = 37602, [33994] = 52510,
[33995] = 37602, [33995] = 52510,
[33996] = 37602, [33996] = 52510,
[33997] = 37602, [33997] = 52510,
[33999] = 37602, [33999] = 52510,
[34001] = 37602, [34001] = 52510,
[34002] = 37602, [34002] = 52510,
[34003] = 37602, [34003] = 52510,
[34004] = 37602, [34004] = 52510,
[34005] = 37602, [34005] = 52510,
[34006] = 37602, [34006] = 52510,
[34007] = 37602, [34007] = 52510,
[34008] = 37602, [34008] = 52510,
[34009] = 37602, [34009] = 52510,
[34010] = 39350, [34010] = 52511,
[42620] = 39350, [42620] = 52511,
[42974] = 43146, [42974] = 52511,
[44383] = 37602, [44383] = 52510,
[44483] = 43145, [44483] = 52510,
[44484] = 43145, [44484] = 52510,
[44488] = 43145, [44488] = 52510,
[44489] = 43145, [44489] = 52510,
[44492] = 43145, [44492] = 52510,
[44494] = 43145, [44494] = 52510,
[44500] = 43145, [44500] = 52510,
[44506] = 43145, [44506] = 52510,
[44508] = 43145, [44508] = 52510,
[44509] = 43145, [44509] = 52510,
[44510] = 43146, [44510] = 52511,
[44513] = 43145, [44513] = 52510,
[44524] = 43146, [44524] = 52511,
[44528] = 43145, [44528] = 52510,
[44529] = 43145, [44529] = 52510,
[44555] = 43145, [44555] = 52510,
[44556] = 43145, [44556] = 52510,
[44575] = 43145, [44575] = 52510,
[44576] = 43146, [44576] = 52511,
[44582] = 43145, [44582] = 52510,
[44584] = 43145, [44584] = 52510,
[44588] = 43145, [44588] = 52510,
[44589] = 43145, [44589] = 52510,
[44590] = 43145, [44590] = 52510,
[44591] = 43145, [44591] = 52510,
[44592] = 43145, [44592] = 52510,
[44593] = 43145, [44593] = 52510,
[44595] = 43146, [44595] = 52511,
[44596] = 43145, [44596] = 52510,
[44598] = 43145, [44598] = 52510,
[44612] = 43145, [44612] = 52510,
[44616] = 43145, [44616] = 52510,
[44621] = 43146, [44621] = 52511,
[44623] = 43145, [44623] = 52510,
[44625] = 43145, [44625] = 52510,
[44629] = 43146, [44629] = 52511,
[44630] = 43146, [44630] = 52511,
[44631] = 43145, [44631] = 52510,
[44633] = 43146, [44633] = 52511,
[44635] = 43145, [44635] = 52510,
[46578] = 43146, [46578] = 52511,
[46594] = 37602, [46594] = 52510,
[47051] = 37602, [47051] = 52510,
[47672] = 43145, [47672] = 52510,
[47766] = 43145, [47766] = 52510,
[47898] = 43145, [47898] = 52510,
[47899] = 43145, [47899] = 52510,
[47900] = 43145, [47900] = 52510,
[47901] = 43145, [47901] = 52510,
[59619] = 43146, [59619] = 52511,
[59621] = 43146, [59621] = 52511,
[59625] = 43146, [59625] = 52511,
[60606] = 43145, [60606] = 52510,
[60609] = 43145, [60609] = 52510,
[60616] = 43145, [60616] = 52510,
[60621] = 43146, [60621] = 52511,
[60623] = 43145, [60623] = 52510,
[60653] = 43145, [60653] = 52510,
[60663] = 43145, [60663] = 52510,
[60668] = 43145, [60668] = 52510,
[60691] = 43146, [60691] = 52511,
[60692] = 43145, [60692] = 52510,
[60707] = 43146, [60707] = 52511,
[60714] = 43146, [60714] = 52511,
[60763] = 43145, [60763] = 52510,
[60767] = 43145, [60767] = 52510,
[62256] = 43145, [62256] = 52510,
[62257] = 43146, [62257] = 52511,
[62948] = 43146, [62948] = 52511,
[62959] = 43146, [62959] = 52511,
[63746] = 38682, [63746] = 52510,
[64441] = 39349, [64441] = 52511,
[64579] = 39349, [64579] = 52511,
[71692] = 38682} [71692] = 52510,
[968676] = 52511,
[968677] = 52511,
[968678] = 52511,
[968679] = 52511,
[968680] = 52511,
[968681] = 52511,
[968682] = 52511,
[968683] = 52511,
[968684] = 52511,
[968685] = 52511,
[968686] = 52511,
[968687] = 52511,
[968688] = 52511,
[968689] = 52511,
[968690] = 52511,
[968691] = 52511,
[968692] = 52511,
[968693] = 52511,
[968694] = 52511,
[968695] = 52511,
[968696] = 52511,
[968697] = 52511,
[968698] = 52511,
[968699] = 52511,
[968700] = 52511,
[968701] = 52511,
[968702] = 52511,
[968770] = 52511,
[968771] = 52511,
[1968677] = 52511,
[1968678] = 52511,
[1968680] = 52511,
[1968681] = 52511,
[1968683] = 52511,
[1968684] = 52511,
[1968686] = 52511,
[1968687] = 52511,
[1968689] = 52511,
[1968690] = 52511,
[1968692] = 52511,
[1968693] = 52511,
[1968695] = 52511,
[1968696] = 52511,
[1968698] = 52511,
[1968699] = 52511,
[1968701] = 52511,
[1968702] = 52511,
[1968770] = 52511,
[1968771] = 52511}

107
TradeSkillMaster_Crafting/TradeSkillMaster_Crafting.lua

@ -58,76 +58,26 @@ function TSM:OnEnable()
-- fix vellum issue -- fix vellum issue
for spellid, data in pairs(TSM.db.factionrealm.crafts) do for spellid, data in pairs(TSM.db.factionrealm.crafts) do
for itemString in pairs(data.mats) do for itemString in pairs(data.mats) do
-- if itemString == "item:38682" then if itemString == "item:52510" then
-- TSM.db.factionrealm.crafts[spellid].mats["item:38682:0:0:0:0:0:0"] = 1 TSM.db.factionrealm.crafts[spellid].mats["item:52510: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 TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
elseif itemString == "item:43145" then elseif itemString == "item:52511" then
TSM.db.factionrealm.crafts[spellid].mats["item:43145:0:0:0:0:0:0"] = 1 TSM.db.factionrealm.crafts[spellid].mats["item:52511: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 TSM.db.factionrealm.crafts[spellid].mats[itemString] = nil
end end
end end
end end
-- if TSM.db.factionrealm.mats["item:38682"] then if TSM.db.factionrealm.mats["item:52510"] then
-- local name = TSMAPI:GetSafeItemInfo("item:38682:0:0:0:0:0:0") or (GetLocale() == "enUS" and "Enchanting Vellum") or nil local name = TSMAPI:GetSafeItemInfo("item:52510: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:52510: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:52510:0:0:0:0:0:0"].name = name
-- TSM.db.factionrealm.mats["item:38682"] = nil TSM.db.factionrealm.mats["item:52510"] = nil
-- end end
if TSM.db.factionrealm.mats["item:43146"] then if TSM.db.factionrealm.mats["item:52511"] then
local name = TSMAPI:GetSafeItemInfo("item:43146:0:0:0:0:0:0") or nil local name = TSMAPI:GetSafeItemInfo("item:52511: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:52511: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:52511:0:0:0:0:0:0"].name = name
TSM.db.factionrealm.mats["item:43146"] = nil TSM.db.factionrealm.mats["item:52511"] = nil
end
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 end
local func, err = TSMAPI:ParseCustomPrice(TSM.db.global.defaultCraftPriceMethod, "crafting") local func, err = TSMAPI:ParseCustomPrice(TSM.db.global.defaultCraftPriceMethod, "crafting")
@ -238,33 +188,6 @@ function TSM:GetTooltip(itemString)
local name, _, quality = TSMAPI:GetSafeItemInfo(matItemString) local name, _, quality = TSMAPI:GetSafeItemInfo(matItemString)
if name then if name then
local mat = TSM.db.factionrealm.mats[matItemString] 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 if mat then
local cost = TSM:GetCustomPrice(mat.customValue or TSM.db.global.defaultMatCostMethod, matItemString) local cost = TSM:GetCustomPrice(mat.customValue or TSM.db.global.defaultMatCostMethod, matItemString)
if cost then if cost then

Loading…
Cancel
Save