View Single Post
  #2  
Old 05-28-2008, 03:26 PM
ndnet
Hill Giant
 
Join Date: Oct 2003
Posts: 105
Default

Some groundwork for this. If you're able to run SQL queries against your database, these could be helpful in going the rest of the way towards what you're wanting.

"What tradeskill-resultant items are in my databaes?" The recipe names seem to be a good enough description.
Code:
SELECT 
a.name as 'Recipe Name',
b.item_id as 'Items Table ID'
FROM
tradeskill_recipe as a,
tradeskill_recipe_entries as b
WHERE
a.id = b.recipe_id AND
b.successcount >= 1

If you want not only the tradeskill items but also their components, you might be more interested in this query. Essentially, the above query without the constraint that the item is returned on success:
Code:
SELECT 
a.name as 'Recipe Name',
b.item_id as 'Items Table ID'
FROM
tradeskill_recipe as a,
tradeskill_recipe_entries as b
WHERE
a.id = b.recipe_id
You're gonna get a lot of items from these queries so it might be best to break up your purchasable item list by tradeskill:

Code:
SELECT 
a.name as 'Recipe Name',
b.item_id as 'Items Table ID'
FROM
tradeskill_recipe as a,
tradeskill_recipe_entries as b
WHERE
a.id = b.recipe_id AND
a.tradeskill = TRADESKILLNUMBER
Where you match TRADESKILLNUMBER with one of the following values:
55 FISHING
56 MAKE_POISON
57 TINKERING
58 RESEARCH
59 ALCHEMY
60 BAKING
61 TAILORING
62 SENSE_TRAPS
63 BLACKSMITHING
64 FLETCHING
65 BREWING
66 ALCOHOL_TOLERANCE
67 BEGGING
68 JEWELRY_MAKING
69 POTTERY

What's left is to go after the merchantlist and npc_types tables. merchantlist is a very simple table comprised of only merchantid, slot, and itemid -- The merchantid corresponds to the npc_types's field merchant_id -- Match these up and the NPC should sell what's listed in merchantlist (Well you also have to make the npc_type class '41' for merchant).
Reply With Quote