LilSparky's Workshop

20 - Support for crafted items with random drop

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
-- -----------------------------------------------

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.

  • WoWScrnShot_081709_111418.jpg
User When Change
lilsparky Aug 17, 2009 at 19:06 UTC Changed status from New to Accepted
Merkor Aug 17, 2009 at 15:19 UTC

Added attachment WoWScrnShot_081709_111418.jpg

Merkor Aug 17, 2009 at 15:19 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Merkor Merkor Sep 13, 2009 at 02:01 UTC - 0 likes

    Cost Basis: Purchase Cost

    Residual Material Value: Resale Value

    But the symptons happen independently of the Cost Basis settings.

  • Avatar of lilsparky lilsparky Sep 12, 2009 at 20:49 UTC - 0 likes

    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.

  • Avatar of Merkor Merkor Sep 12, 2009 at 08:10 UTC - 0 likes


    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:


    [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

  • Avatar of lilsparky lilsparky Sep 07, 2009 at 21:01 UTC - 0 likes

    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?!

  • Avatar of Merkor Merkor Sep 05, 2009 at 11:00 UTC - 0 likes


    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:


    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)
    [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:


    [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?

  • Avatar of lilsparky lilsparky Aug 21, 2009 at 17:17 UTC - 0 likes

    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.

  • Avatar of Merkor Merkor Aug 21, 2009 at 08:48 UTC - 0 likes

    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.

    Last edited Aug 21, 2009 by Merkor
  • Avatar of lilsparky lilsparky Aug 18, 2009 at 01:51 UTC - 0 likes

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

  • Avatar of Merkor Merkor Aug 18, 2009 at 01:33 UTC - 0 likes

    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.

    Last edited Aug 18, 2009 by Merkor
  • Avatar of lilsparky lilsparky Aug 17, 2009 at 23:49 UTC - 0 likes

    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

    Last edited Aug 18, 2009 by lilsparky


Last updated
Aug 17, 2009
Aug 17, 2009
Accepted - Problem reproduced / Need acknowledged.
Enhancement - A change which is intended to better the project in some way
Medium - Normal priority.

Reported by

Possible assignees