Support for crafted items with random drop #20


  • Accepted
  • Enhancment
Open
Assigned to _ForgeUser280725
  • _ForgeUser149304 created this issue Aug 17, 2009

    First of all, I would like to thank you for this great addon.

    ***What is the enhancement in mind? How should it look and feel?***

    I have been looking into a way to change the addon so it calculates the profit from crafting items which contain or transform into random items, for example: Darkmoon Card of the North and Icy Prism. Right now I have been partially successful but it seems I'm missing something.

    I figured the best way to do it is to hack the disenchant query to Enchantrix, so I modified disenchanting_support and after line 333 I added the following:
    -- -----------------------------------------------
    if itemID == 44318 then
        itemType = ArmorID
        itemLevel = 300
    end
    -- -----------------------------------------------

    Of course that only flags the item as able to be disenchanted. I also added the following to the armor section of the reagentSourceTable
                [300] = "[Ace of Nobles]     2%     1-1x",

    Unfortunately, I can't get LSW to show "Ace of Nobles" as one of the (fake) results of disenchanting the Darkmoon Card of the North. Could you please point me in the right direction?

    By modifying milling_support.lua and adding a few of the cards as the byproduct and Darkmoon Card of the North as the "fake" yerb, I was also able to get LSW to list the cards as a result of the disenchanting, but the calculated total value is incorrect, as you can see from my attached screenshot.

  • _ForgeUser149304 added the tags New Enhancment Aug 17, 2009
  • _ForgeUser149304 added an attachment WoWScrnShot_081709_111418.jpg Aug 17, 2009

    WoWScrnShot_081709_111418.jpg

  • _ForgeUser149304 posted a comment Aug 17, 2009

    By the way, I'm not sure if a ticket is the best way to get help about this. If it is not, please accept my apologies.

  • _ForgeUser280725 posted a comment Aug 17, 2009

    actually, you're on the right track.

    i'll look into the de total being wrong, but i think that's actually unrelated to your case here. the tooltips are calculated on the fly but cached data is used for the totals. something seems to be amiss there.

    i would probably not do this as a processing of the cards or prism, i would do it as a properly spoofed recipe.

    instead of adding it as a fake herb, you can actually use the commonSkills_support.lua file to add better descriptions of the recipe itself.

    the commonSkills file is there to create recipes for things like converting essences from greater to lesser or making primals from motes. it would be trivial, really, to add better descriptions of those recipes. maybe i should do this by default. there are lots of "random" craft recipes...

    if you want to poke around, the tables in the commonSkills lua file are really straight forward.

    basically, it's indexed by recipeID. the results subtable is indexed by itemID and the value is the number of items created for that item per run. this can be fractional. the reagents subtable is the same deal, indexed by itemID with the value being the number needed.

    you can leave off the name field since you'd be using the real spellID as the main index (the name field is only used to over-ride instances where the spellID is not a real spell).

  • _ForgeUser280725 posted a comment Aug 17, 2009

    the more i think about it, the more i link the solution.

    i will be adding a randomRecipe support file that will address all the random craft result items.

    i just need to figure out how to collect all the data. :P

  • _ForgeUser280725 removed a tag New Aug 17, 2009
  • _ForgeUser280725 added a tag Accepted Aug 17, 2009
  • _ForgeUser280725 posted a comment Aug 17, 2009

    hmm... i'll have to figure out how to add random enchant items, too, since they all share the same base itemID....

  • _ForgeUser149304 posted a comment Aug 17, 2009

    Lilsparky,

    Thanks a lot for your promptly reply. I was looking at commonSkills table and there is one problem: randomness factor. From what I gather looking at it, you make a direct conversion from one item to the other:
    1 x egg + 2 x veggies = 1 x omelet

    but I don't see how to do it for something as random as Darkmoon Card or Icy Prism where you will definitely get an item but not always the same one.

    After you add the randomRecipe support file, the data can be easily collected from WoWhead. Of course it wouldn't have everything from the beginning, but it could be updated as needed.

  • _ForgeUser280725 posted a comment Aug 17, 2009

    the numbers for craftables don't need to be whole numbers.

    so you could have:

    1 x egg + 2 x veggies = .5 spicy omelet + .75 great omelet + .5 bland omelet + .25 burned omelet

    in fact, they don't even need to add up to a whole number. prospecting and herbalism turn 5 ores/herbs into fractional amounts of items that add up to all sorts of weird numbers.

    so for darkmoon cards, you'd add an entry for each recipeID that is the normal darkmoon card spellID with the normal reagent requirements and instead of a single entry for the craft results, you'd have 32 entries. each entry would be [itemID] = 1/32 where itemID is the itemID of each different card (i believe it's not biased in any way so 1/32 should be accurate for all cards).

    it's not hard to look up the information from wowhead, it's just a pain in the ass trying to copy it all down. normally i like to mine the data, so i just need to come up with the mining strategy.

    edit: here's some code

    [59504] = {
    	name = "Random Darkmoon Card of the North",
    	reagents = {
    		[39502] = 1, -- resil parchment
    		[43127] = 6, -- snowfall ink
    		[35625] = 3, -- eternal life
    		[43126] = 3, -- ink of the sea
    	},
    	results = {
    		[itemID] = .03125,  -- card #1
    		...
    		[itemID] = .03125,  -- card #32
    	},
    },
    

    i dunno all the itemID's for the different cards you can get, but they'd all go into the result table


    Edited Aug 17, 2009
  • _ForgeUser149304 posted a comment Aug 17, 2009

    Thank you man!
    That worked almost perfectly, except that now for almost every recipe it is suggesting I should prospect [the really expensive] Titanium Ore. The suggestion would be good except that my in my server the epic gems are not selling that fast. I guess people would rather buy them with emblems instead of spending gold.

    Thank you for all your help :)

    Edit: Actually now I don't know where all the mad suggestions about prospecting Titanium Ore suddenly came from. Looking at the code I modified, I don't think adding Icy Prism would create such havoc. I think instead it was caused by updating to the latest version of Auctioneer.


    Edited Aug 17, 2009
  • _ForgeUser280725 posted a comment Aug 17, 2009

    glad it's working! i'd be interested to get your data once i get the random recipe stuff sorted thru.

  • _ForgeUser149304 posted a comment Aug 21, 2009

    Hey LilSparky,

    Is it possible somehow to create "fake recipes"? I love how LSW suggests the cheapest route to craft an item and I was wondering if I could get it to do the same for stuff like creating the Nobles Deck, something like this:

            [60262] = {
                name = "Create Nobles Deck",
                reagents = {
                    [44268] = 1, -- Ace
                    [44269] = 1, -- Two
                    [44270] = 1, -- Three
                    [44271] = 1, -- Four
                    [44272] = 1, -- Five
                    [44273] = 1, -- Six
                    [44274] = 1, -- Seven
                    [44275] = 1, -- Eight
                },
                results = {
                    [44326] = 1, -- Nobles Deck
                },
            },

    This added to the modification to "Darkmoon Card of the North" would give us a clear idea of how much (based on your server prices and supposing a constant yield) you would have to spend to get a whole deck of cards.


    Edited Aug 21, 2009
  • _ForgeUser280725 posted a comment Aug 21, 2009

    yes, what you've got there would go nicely into the common skill stuff. basically, that file is there to spoof "recipes" for such item conversions that all people can accomplish. lsw doesn't need to know them all, but for anything that relates to reagents or crafted items it's good to have them in there.

    what you posted is exactly how it should look, too.

    in cases where there's not a hidden spellid, you could use the itemID of the created object, negated. so if the itemID of the crafted itemis 1234 you'd use -1234 just to ensure that you're not stepping on a spellID.

    fwiw, this system can also be used to extend normal crafting recipes to include random procs of additional items. not sure of the current state of things, but transmutes used to occasionally proc an extra item. or spellthread would creation would summon mobs that dropped additional reagents. those recipes could be extended to include the % drop rates for those items to better reflect the real value.

  • _ForgeUser149304 posted a comment Sep 5, 2009

    Lilsparky,

    Thanks for your help. Either I wasn't very clear wording my question or I didn't completely understand your answer, hehe. Either way, you answered a question I didn't even know I had :P

    My question was if it was possible to create a fake, non existent recipe, something which is not part of the skills you learn from the trainers or which are not possible in the game and have it show on Skillet window. For example "Create Nobles Deck" is not something that you can cast or do by using a trade skill like JC or Inscription. I hope my question is more clear now.

    On a totally unrelated matter, I'm having two issues with LSW and I don't know why:

    1) Whenever I change Cost Basis Options from Resale Value to Purchase Cost or vice versa, I get the following error:

    Quote:

    Date: 2009-09-05 06:49:17
    ID: 1
    Error occured in: Global
    Count: 1
    Message: ...ace\AddOns\LilSparkysWorkshop\lilsparkysworkshop.lua line 71:
    attempt to call field 'callback' (a nil value)
    Debug:
    [C]: callback()
    ...ace\AddOns\LilSparkysWorkshop\lilsparkysworkshop.lua:71: func()
    ..\FrameXML\UIDropDownMenu.lua:563: UIDropDownMenuButton_OnClick()
    [string "*:OnClick"]:1:
    [string "*:OnClick"]:1

    2) In my realm, the cost of 1 x Eternal Earth is around 7g right now yet the cost of a Crystallized Earth is around 1.15g
    Even so, for a recipe which uses 2xCrystallized Earth (2.30g total), I can't get LSW to consider buying an Eternal Earth and converting it to Crystallized Earth. I have tried everything, even turning on the option of "Alwayz Craft". Additionally, I noticed that the information in commSkills_support.lua file for this conversion is wrong. It has the same itemid for both the reagent and the results.

    Anyway, even after fixing it and trying to force the skill, I can't get it to work. It is like it just ignores it. Here is copy/paste of what I have tried, please ignore the space between the dashes:

    Quote:

    [56041] = {
    name = "Create Crystallized Earth",
    reagents = {
    [35624] = 1, - - Eternal Earth
    },
    results = {
    [37701] = 10, - - Crystallized Earth
    },
    },
    [-37701] = {
    name = "Create Crystallized Earth",
    reagents = {
    [35624] = 1, - - Eternal Earth
    },
    results = {
    [37701] = 10, - - Crystallized Earth
    },
    },

    Could you please help me find the reason for this?

  • _ForgeUser280725 posted a comment Sep 7, 2009

    oh, you want them to show up in skillet?  now THAT is something that's been on my mind for as long as i've been hacking skillet.  it's always been my intention to make spoofed recipes fit into the scheme, but it's never materialized.  it's very much something i'd love to get working.  how nice would it be to have skillet auto-convert lessers to greaters (or vice versa)?

    that little error that pops should be fixed now, but i suspect you haven't updated since you're hacking your local version...

    what i would suggest is to put all the changes you're making into another file -- like just save what you've got to customPrices.lua (or something) then you can stuff that into the .toc file after the other price support lua files have been read in.  your changes would then over-ride whatever those files do (or at least, they should).  that way you can upgrade and retain your changes by simply re-editing the .toc file.

    and wow.  i just looked at the commonSkills file and boy is it messed up!  the data is mined, so i didn't examine it closely.  i'll try to figure out why it's so messed up.  and i'm not sure why it wouldnt' tell you to buy an eternal earth... could be a very deep problem since the way the commonSkills is now, it would create major loops if it was actually to parse them.. (3 lesser mystics from 1 lesser mystics, for example).  wtf?!

  • _ForgeUser149304 posted a comment Sep 12, 2009

    Lilsparky,

    Thanks for your answer. Something weird is going on. I replaced the content of the commonSkills file with just the following and it still won't suggest buying 1xEternal Shadow. In order to have it show, you got to completely remove the entry about creating Eternal Shadow:

    Quote:

    [49246] = {
    name = "Create Eternal Shadow",
    reagents = {
    [37703] = 10, - -Crystallized Shadow
    },
    results = {
    [35627] = 1, - -Eternal Shadow
    },
    },

    [56044] = {
    name = "Create Crystallized Shadow",
    reagents = {
    [35627] = 1, - -Eternal Shadow
    },
    results = {
    [37703] = 10, - -Crystallized Shadow
    },
    },

  • _ForgeUser280725 posted a comment Sep 12, 2009

    so what are your settings?  cost basis and residual material value in particular.

    the latest commonSkills file should be fixed now.  apparently wowhead doesn't connect certain items and recipes so i had to change my mining scheme a bit.

  • _ForgeUser149304 posted a comment Sep 12, 2009

    Cost Basis: Purchase Cost

    Residual Material Value: Resale Value

    But the symptons happen independently of the Cost Basis settings.


To post a comment, please login or register a new account.