Mercurial > wow > reagentmaker
comparison data.lua @ 67:cd7e41015586
Separate Mill and Prospect, and load them only if needed
author | contrebasse |
---|---|
date | Sat, 14 May 2011 16:27:34 +0200 |
parents | 2ca04183f5f9 |
children | 42aac950bd67 |
comparison
equal
deleted
inserted
replaced
66:2ca04183f5f9 | 67:cd7e41015586 |
---|---|
1 local addonName, A = ... | 1 local addonName, A = ... |
2 | 2 |
3 -- @todo: complete jewelcrafting items | 3 -- @todo: complete jewelcrafting items |
4 | 4 -- @todo: enchants, elementals, prospecting |
5 local MillID = 51005 | |
6 local macroMill = "/cast "..GetSpellInfo(MillID).."\n/use " | |
7 local MillLink = GetSpellLink(MillID) | |
8 MillID = nil | |
9 local ProspectID = 31252 | |
10 local macroProspect = "/cast "..GetSpellInfo(ProspectID).."\n/use " | |
11 local ProspectLink = GetSpellLink(ProspectID) | |
12 ProspectID = nil | |
13 A.data = { | |
14 -- Mill | |
15 -- Normal pigments | |
16 [39151] = { -- Alabaster Pigment | |
17 spell = macroMill, | |
18 spellLink = MillLink, | |
19 {2447,5,2,3}, -- Peacebloom | |
20 { 765,5,2,3}, -- Silverleaf | |
21 {2449,5,2,4}}, -- Earthroot | |
22 [39334] = { -- Dusky Pigment | |
23 spell = macroMill, | |
24 spellLink = MillLink, | |
25 { 785,5,2,3}, -- Mageroyal | |
26 {2450,5,2,3}, -- Briarthorn | |
27 {2452,5,2,3}, -- Swiftthistle | |
28 {2453,5,2,4}, -- Bruiseweed | |
29 {3820,5,2,4}}, -- Stranglekelp | |
30 [39338] = { -- Golden Pigment | |
31 spell = macroMill, | |
32 spellLink = MillLink, | |
33 {3369,5,2,3}, -- Grave Moss | |
34 {3355,5,2,3}, -- Wild Steelbloom | |
35 {3356,5,2,4}, -- Kingsblood | |
36 {3357,5,2,4}}, -- Liferoot | |
37 [39339] = { -- Emerald Pigment | |
38 spell = macroMill, | |
39 spellLink = MillLink, | |
40 {3818,5,2,3}, -- Fadeleaf | |
41 {3821,5,2,3}, -- Goldthorn | |
42 {3358,5,3,4}, -- Khadgar's Whisker | |
43 {3819,5,3,4}}, -- Dragon's Teeth | |
44 [39340] = { -- Violet Pigment | |
45 spell = macroMill, | |
46 spellLink = MillLink, | |
47 {4625,5,2,3}, -- Firebloom | |
48 {8831,5,2,3}, -- Purple Lotus | |
49 {8836,5,2,3}, -- Arthas' Tears | |
50 {8838,5,2,3}, -- Sungrass | |
51 {8839,5,2,4}, -- Blindweed | |
52 {8845,5,2,4}, -- Ghost Mushroom | |
53 {8846,5,2,4}}, -- Gromsblood | |
54 [39341] = { -- Silvery Pigment | |
55 spell = macroMill, | |
56 spellLink = MillLink, | |
57 {13464,5,2,3}, -- Golden Sansam | |
58 {13463,5,2,3}, -- Dreamfoil | |
59 {13465,5,2,4}, -- Mountain Silversage | |
60 {13466,5,2,4}, -- Sorrowmoss | |
61 {13467,5,2,4}}, -- Icecap | |
62 [39342] = { -- Nether Pigment | |
63 spell = macroMill, | |
64 spellLink = MillLink, | |
65 {22786,5,2,3}, -- Dreaming Glory | |
66 {22785,5,2,3}, -- Felweed | |
67 {22789,5,2,3}, -- Terocone | |
68 {22787,5,2,3}, -- Ragveil | |
69 {22790,5,2,4}, -- Ancient Lichen | |
70 {22793,5,2,4}, -- Mana Thistle | |
71 {22791,5,2,4}, -- Netherbloom | |
72 {22792,5,2,4}}, -- Nightmare Vine | |
73 [39343] = { -- Azure Pigment | |
74 spellLink = MillLink, | |
75 spell = macroMill, | |
76 {37921,5,2,3}, -- Deadnettle | |
77 {36901,5,2,3}, -- Goldclover | |
78 {36907,5,2,3}, -- Talandra's Rose | |
79 {36904,5,2,3}, -- Tiger Lily | |
80 {39970,5,2,3}, -- Fire Leaf | |
81 {39969,5,2.3,3}, -- Fire Seed (2:33%/3:67%) | |
82 {36903,5,2,4}, -- Adder's Tongue | |
83 {36906,5,2,4}, -- Icethorn | |
84 {36905,5,2,4}}, -- Lichbloom | |
85 [61979] = { -- Ashen Pigment | |
86 spell = macroMill, | |
87 spellLink = MillLink, | |
88 {52983,5,2,3}, -- Cinderbloom | |
89 {52985,5,2,3}, -- Azshara's Veil | |
90 {52984,5,2,3}, -- Stormvine | |
91 {52986,5,2,3}, -- Heartblossom | |
92 {52988,5,2,4}, -- Whiptail | |
93 {52987,5,2,4}}, -- Twilight Jasmine | |
94 -- Rare pigments | |
95 [43103] = { -- Verdant Pigment | |
96 spell = macroMill, | |
97 spellLink = MillLink, | |
98 {785,5,0.25}, -- Mageroyal | |
99 {2450,5,0.25}, -- Briarthorn | |
100 {2452,5,0.25}, -- Swiftthistle | |
101 {2453,5,0.5}, -- Bruiseweed | |
102 {3820,5,0.5}}, -- Stranglekelp | |
103 [43104] = { -- Burnt Pigment | |
104 spell = macroMill, | |
105 spellLink = MillLink, | |
106 {3369,5,0.25}, -- Grave Moss | |
107 {3355,5,0.25}, -- Wild Steelbloom | |
108 {3356,5,0.5}, -- Kingsblood | |
109 {3357,5,0.5}}, -- Liferoot | |
110 [43105] = { -- Indigo Pigment | |
111 spell = macroMill, | |
112 spellLink = MillLink, | |
113 {3818,5,0.25}, -- Fadeleaf | |
114 {3821,5,0.25}, -- Goldthorn | |
115 {3358,5,0.5}, -- Khadgar's Whisker | |
116 {3819,5,0.5}}, -- Dragon's Teeth | |
117 [43106] = { -- Ruby Pigment | |
118 spell = macroMill, | |
119 spellLink = MillLink, | |
120 {4625,5,0.25}, -- Firebloom | |
121 {8831,5,0.25}, -- Purple Lotus | |
122 {8836,5,0.25}, -- Arthas' Tears | |
123 {8838,5,0.25}, -- Sungrass | |
124 {8839,5,0.5}, -- Blindweed | |
125 {8845,5,0.5}, -- Ghost Mushroom | |
126 {8846,5,0.5}}, -- Gromsblood | |
127 [43107] = { -- Sapphire Pigment | |
128 spell = macroMill, | |
129 spellLink = MillLink, | |
130 {13464,5,0.25}, -- Golden Sansam | |
131 {13463,5,0.25}, -- Dreamfoil | |
132 {13465,5,0.5}, -- Mountain Silversage | |
133 {13466,5,0.5}, -- Sorrowmoss | |
134 {13467,5,0.5}}, -- Icecap | |
135 [43108] = { -- Ebon Pigment | |
136 spell = macroMill, | |
137 spellLink = MillLink, | |
138 {22786,5,0.25}, -- Dreaming Glory | |
139 {22785,5,0.25}, -- Felweed | |
140 {22789,5,0.25}, -- Terocone | |
141 {22787,5,0.25}, -- Ragveil | |
142 {22790,5,0.5}, -- Ancient Lichen | |
143 {22793,5,0.5}, -- Mana Thistle | |
144 {22791,5,0.5}, -- Netherbloom | |
145 {22792,5,0.5}}, -- Nightmare Vine | |
146 [43109] = { -- Icy Pigment | |
147 spellLink = MillLink, | |
148 spell = macroMill, | |
149 {37921,5,0.25}, -- Deadnettle | |
150 {36901,5,0.25}, -- Goldclover | |
151 {36907,5,0.25}, -- Talandra's Rose | |
152 {36904,5,0.25}, -- Tiger Lily | |
153 {39970,5,0.25}, -- Fire Leaf | |
154 {39969,5,0.25}, -- Fire Seed | |
155 {36903,5,0.5}, -- Adder's Tongue | |
156 {36906,5,0.5}, -- Icethorn | |
157 {36905,5,0.5}}, -- Lichbloom | |
158 [61980] = { -- Burning Embers | |
159 spell = macroMill, | |
160 spellLink = MillLink, | |
161 {52983,5,0.25}, -- Cinderbloom | |
162 {52985,5,0.25}, -- Azshara's Veil | |
163 {52984,5,0.25}, -- Stormvine | |
164 {52986,5,0.25}, -- Heartblossom | |
165 {52988,5,0.5}, -- Whiptail | |
166 {52987,5,0.5}}, -- Twilight Jasmine | |
167 | |
168 -- Prospect | |
169 [774] = { -- Malachite | |
170 spell = macroProspect, | |
171 spellLink = ProspectLink, | |
172 {2770,5,0.5}}, -- Copper Ore | |
173 [818] = { -- Tigerseye | |
174 spell = macroProspect, | |
175 spellLink = ProspectLink, | |
176 {2770,5,0.5}}, -- Copper Ore | |
177 [1210] = { -- Shadowgem | |
178 spell = macroProspect, | |
179 spellLink = ProspectLink, | |
180 {2771,5,0.38}, -- Tin Ore | |
181 {2770,5,0.1}}, -- Copper Ore | |
182 [1705] = { -- Lesser Moonstone | |
183 spell = macroProspect, | |
184 spellLink = ProspectLink, | |
185 {2771,5,0.38}, -- Tin Ore | |
186 {2772,5,0.35}}, -- Iron Ore | |
187 [1206] = { -- Moss Agate | |
188 spell = macroProspect, | |
189 spellLink = ProspectLink, | |
190 {2771,5,0.37}}, -- Tin Ore | |
191 [1529] = { -- Jade | |
192 spell = macroProspect, | |
193 spellLink = ProspectLink, | |
194 {2772,5,0.35}, -- Iron Ore | |
195 {2771,5,0.03}}, -- Tin Ore | |
196 [7909] = { -- Aquamarine | |
197 spell = macroProspect, | |
198 spellLink = ProspectLink, | |
199 {3858,5,0.35}, -- Mithril Ore | |
200 {2772,5,0.05}, -- Iron Ore | |
201 {2771,5,0.03}}, -- Tin Ore | |
202 [3864] = { -- Citrine | |
203 spell = macroProspect, | |
204 spellLink = ProspectLink, | |
205 {2772,5,0.36}, -- Iron Ore | |
206 {3858,5,0.35}, -- Mithril Ore | |
207 {2771,5,0.03}}, -- Tin Ore | |
208 [7910] = { -- Star Ruby | |
209 spell = macroProspect, | |
210 spellLink = ProspectLink, | |
211 {3858,5,0.36}, -- Mithril Ore | |
212 {10620,5,0.15}, -- Thorium Ore | |
213 {2772,5,0.05}}, -- Iron Ore | |
214 [12799] = { -- Large Opal | |
215 spell = macroProspect, | |
216 spellLink = ProspectLink, | |
217 {10620,5,0.31}, -- Thorium Ore | |
218 {3858,5,0.03}}, -- Mithril Ore | |
219 [12361] = { -- Blue Sapphire | |
220 spell = macroProspect, | |
221 spellLink = ProspectLink, | |
222 {10620,5,0.31}, -- Thorium Ore | |
223 {3858,5,0.02}}, -- Mithril Ore | |
224 [12800] = { -- Azerothian Diamond | |
225 spell = macroProspect, | |
226 spellLink = ProspectLink, | |
227 {10620,5,0.31}, -- Thorium Ore | |
228 {3858,5,0.02}}, -- Mithril Ore | |
229 [12364] = { -- Huge Emerald | |
230 spell = macroProspect, | |
231 spellLink = ProspectLink, | |
232 {10620,5,0.31}, -- Thorium Ore | |
233 {3858,5,0.02}}, -- Mithril Ore | |
234 [23112] = { -- Golden Draenite | |
235 spell = macroProspect, | |
236 spellLink = ProspectLink, | |
237 {23424,5,0.19}, -- Fel Iron Ore | |
238 {23425,5,0.18}}, -- Adamantite Ore | |
239 -- To be continued... | |
240 | |
241 | |
242 -- To add : enchants, elementals, prospecting | |
243 } | |
244 | 5 |
245 -- @todo improve scanning | 6 -- @todo improve scanning |
246 -- @todo rescan when a new refipe appears (TRADESKILL_UPDATE ?) | |
247 -- @todo be sure that skillName is unique, or use something else | 7 -- @todo be sure that skillName is unique, or use something else |
248 -- @todo add support for multi-reagents recipes | 8 -- @todo add support for multi-reagents recipes |
9 | |
10 A.data = {} | |
11 | |
249 do | 12 do |
250 -- lua functions | 13 -- lua functions |
251 local print = print | 14 local print = print |
252 local ipairs = ipairs | 15 local ipairs = ipairs |
253 local tinsert = tinsert | 16 local tinsert = tinsert |
17 local select = select | |
254 | 18 |
255 -- Wow functions | 19 -- Wow functions |
256 local GetNumTradeSkills = GetNumTradeSkills | 20 local GetNumTradeSkills = GetNumTradeSkills |
257 local GetTradeSkillInfo = GetTradeSkillInfo | 21 local GetTradeSkillInfo = GetTradeSkillInfo |
258 local GetTradeSkillNumReagents = GetTradeSkillNumReagents | 22 local GetTradeSkillNumReagents = GetTradeSkillNumReagents |
259 local GetTradeSkillItemLink = GetTradeSkillItemLink | 23 local GetTradeSkillItemLink = GetTradeSkillItemLink |
24 local GetTradeSkillRecipeLink = GetTradeSkillRecipeLink | |
260 local GetTradeSkillReagentItemLink = GetTradeSkillReagentItemLink | 25 local GetTradeSkillReagentItemLink = GetTradeSkillReagentItemLink |
261 local GetTradeSkillReagentInfo = GetTradeSkillReagentInfo | 26 local GetTradeSkillReagentInfo = GetTradeSkillReagentInfo |
262 local GetTradeSkillNumMade = GetTradeSkillNumMade | 27 local GetTradeSkillNumMade = GetTradeSkillNumMade |
28 local GetSpellInfo = GetSpellInfo | |
29 | |
30 -- Wow objects | |
31 local GetTradeSkillLine = GetTradeSkillLine | |
263 | 32 |
264 -- the function who scans the tradeskill | 33 -- the function who scans the tradeskill |
265 function A:ScanSimpleRecipes() | 34 function A:ScanSimpleRecipes() |
266 -- Check if the tradeskill is loaded | 35 -- Check if the tradeskill is loaded |
267 -- Has to have recipes and begin with a header | 36 -- Has to have recipes and begin with a header |
268 local NRecipes = GetNumTradeSkills() | 37 local NRecipes = GetNumTradeSkills() |
269 if NRecipes==0 or select(2,GetTradeSkillInfo(1))~="header" then | 38 if NRecipes==0 or select(2,GetTradeSkillInfo(1))~="header" then |
270 return | 39 return |
271 end | 40 end |
272 | 41 |
42 -- Check if the pseudo tradeskills have to be added | |
43 if GetTradeSkillLine() == GetSpellInfo(25229) then -- Jewelcrafting | |
44 if not A.ProspectingDataLoaded then | |
45 for itemID,data in A.ProspectingData do | |
46 A.data[itemID] = data | |
47 end | |
48 A.ProspectingDataLoaded = true | |
49 end | |
50 elseif GetTradeSkillLine:GetText() == GetSpellInfo(45357) then -- Inscription | |
51 if not A.MillingDataLoaded then | |
52 for itemID,data in A.MillingData do | |
53 A.data[itemID] = data | |
54 end | |
55 A.MillingDataLoaded = true | |
56 end | |
57 end | |
58 | |
273 for i = 2,NRecipes do -- The first one is a header | 59 for i = 2,NRecipes do -- The first one is a header |
274 local skillName, skillType, numAvailable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(i) | 60 local skillName, skillType, numAvailable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(i) |
275 if skillType ~= "header" then | 61 if skillType ~= "header" then |
276 --if GetTradeSkillNumReagents(i) == 1 then | 62 --if GetTradeSkillNumReagents(i) == 1 then |
277 -- item ID | 63 -- item ID |
278 local itemID = A.link2ID(GetTradeSkillItemLink(i)) | 64 local itemID = A.link2ID(GetTradeSkillItemLink(i)) |
279 | 65 |
280 -- reagent ID | 66 -- reagent ID, valid only if there's only one reagent as we take only the first one |
281 local reagentID = A.link2ID(GetTradeSkillReagentItemLink(i, 1)) | 67 local reagentID = A.link2ID(GetTradeSkillReagentItemLink(i, 1)) |
282 | 68 |
283 -- reagent number needed | 69 -- reagent number needed |
284 local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(i, 1) | 70 local _, _, reagentCount, _ = GetTradeSkillReagentInfo(i, 1) |
285 | 71 |
286 -- number of reagent created by the recipe | 72 -- number of reagent created by the recipe |
287 local minMade, maxMade = GetTradeSkillNumMade(i) | 73 local minMade, maxMade = GetTradeSkillNumMade(i) |
288 | 74 |
289 -- recipe link (for tooltips) | 75 -- recipe link (for tooltips) |