andrew6180 / TradeSkillMaster

TradeSkillMaster 2.8 backported to 3.3.5
48 stars 13 forks source link

Enchating Vellums and Ascension WoW #18

Closed P1nnky closed 2 years ago

P1nnky commented 2 years ago

Hello, when the crafting tool trys to calculate the price for enchanting it takes the vellums into account. The IDs for vellums on the Ascension server changed tough so it spits out errors, does not add it to the gathering options and so forth. I changed all the Vellums in the following documents

*\TradeSkillMaster_Crafting\Modules\VellumInfo.lua 38682, 37602, 43145 to 52510 and 39349, 39350, 43146 to 52511

also I went into *\TradeSkillMaster_Crafting\Modules\CraftingGUI.lua and changed those there as well.

I haven't gotten any LUA errors since I made those changes and the prices are calculated correctly + it shows up under the gathering option and buys em from the vendor. I saw alot more instances of the WotLK vellums but atm I didn't bother changing them cause what I wanted works now.

Hope I could help a little bit

P1nnky commented 2 years ago

Edit: I also changed the vellums in all other *.lua where I could find em and it fixed crafting cost tooltip + craft next now enchants a vellum in your backpack with out clicking it (like retail WoW) wich it wouldn't do before. I am pretty happy how it turned out

adamz01h commented 2 years ago

create a pull request?

BanditTech commented 2 years ago

hehe I just made some similar adjustments for myself and then I found this on the github after the fact :P I will go ahead and display the adjustments for anyone else wondering how to fix this issue.

Inside VellumInfo.lua replace the array with this one:

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

Then I edited the function for CheapestVellum in CraftingGui.lua to always return one of the two appropriate vellum:

function CheapestVellum(itemPassed)

        local MatName = GetItemInfo(itemPassed)
        -- MatName is sometimes nil ???
        if MatName ~= nil then          
            local velName
            if strfind(MatName, "Vellum") then
                velName = MatName
            end
            if (velName ~= nil) then                        
                if strfind(velName, "Weapon") then                      
                    itemPassed = "item:52511:0:0:0:0:0:0"
                else
                    itemPassed = "item:52510:0:0:0:0:0:0"
                end
            end
        end
        return itemPassed   
end
BanditTech commented 2 years ago

Edit: I also changed the vellums in all other *.lua where I could find em and it fixed crafting cost tooltip + craft next now enchants a vellum in your backpack with out clicking it (like retail WoW) wich it wouldn't do before. I am pretty happy how it turned out

I thought I had figured out how to fix it, but I am just unable to make the edit work where it applies to the vellum in the bag. And the vellum is not appearing in the materials list.

Would you mind sharing your edited version so that I could compare what you changed?

BanditTech commented 2 years ago

I made a bit of progress at least trying to get the vellums working, and figured out how to make it happen!

there is an issue with the altVerb returning a blank string. Which the script requires to be ENSCRIBE in order to make the button for enchanting a vellum. For some reason, when looking at the header in my crafting panel it is indeed blank. I was wondering why it looked a bit odd! :P

In CraftingGUI.lua I rewrote the logic for determining the craft is an enchant: change if altVerb == ENSCRIBE then to if altVerb ~= nil and strfind(name,"Enchant ") then

along with the changes outlined above replacing all the instances of those digits with the proper two scrolls ID.

Now the Craft All button changes to Enchant Vellum and it works as expected.

Here is the code snippet after changes:

        if altVerb ~= nil and strfind(name,"Enchant ") then
            createAllBtn:SetText(L["Enchant Vellum"])
            if strfind(name, "Weapon") or strfind(name, "Staff") then
                createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52511:0:0:0:0:0:0") -- Weapon Vellum
            else
                createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52510:0:0:0:0:0:0") -- Armor Vellum
            end
        else
            createAllBtn:SetText(CREATE_ALL)
            createAllBtn.vellum = nil
        end
BanditTech commented 2 years ago

I made a fork of the edits for ascension, to make this much simpler for anyone else coming across this.

P1nnky commented 2 years ago

Edit: I also changed the vellums in all other *.lua where I could find em and it fixed crafting cost tooltip + craft next now enchants a vellum in your backpack with out clicking it (like retail WoW) wich it wouldn't do before. I am pretty happy how it turned out

I thought I had figured out how to fix it, but I am just unable to make the edit work where it applies to the vellum in the bag. And the vellum is not appearing in the materials list.

Would you mind sharing your edited version so that I could compare what you changed?

Here is a link to my TSM . https://www.dropbox.com/t/mR6340LfFZlPoDWG I made a few additional changes like adding the Ascension recipes under EnchantingInfo.lua I made those changes and tweaks a while ago and I have since stopped playing. I never had problems after the tweaks. Hope this helps you out