vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | |||
3 | Icon set definitions |
||
4 | |||
5 | ]] |
||
6 | |||
7 | Gather_IconSet = { |
||
8 | ["original"] = { |
||
9 | ["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"}, |
||
10 | ["Ore"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Ore"}, |
||
11 | ["Herb"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Herb"}, |
||
12 | ["Treasure"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Chest"}, |
||
13 | ["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Test"}, |
||
14 | }, |
||
15 | ["iconshade"] = { |
||
16 | ["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Test"}, |
||
17 | }, |
||
18 | ["shaded"] = { |
||
19 | ["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"}, |
||
20 | ["Ore"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Red"}, |
||
21 | ["Herb"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Green"}, |
||
22 | ["Treasure"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Yellow"}, |
||
23 | ["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Test"}, |
||
24 | }, |
||
25 | ["iconic"] = { |
||
26 | ["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"}, |
||
27 | ["Ore"] = { |
||
28 | ["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Red", |
||
29 | [ORE_COPPER] = "Interface\\AddOns\\Gatherer\\Icons\\OreCopper", |
||
30 | [ORE_TIN] = "Interface\\AddOns\\Gatherer\\Icons\\OreTin", |
||
31 | [ORE_SILVER] = "Interface\\AddOns\\Gatherer\\Icons\\OreSilver", |
||
32 | [ORE_IRON] = "Interface\\AddOns\\Gatherer\\Icons\\OreIron", |
||
33 | [ORE_GOLD] = "Interface\\AddOns\\Gatherer\\Icons\\OreGold", |
||
34 | [ORE_MITHRIL] = "Interface\\AddOns\\Gatherer\\Icons\\OreMithril", |
||
35 | [ORE_TRUESILVER] = "Interface\\AddOns\\Gatherer\\Icons\\OreTruesilver", |
||
36 | [ORE_THORIUM] = "Interface\\AddOns\\Gatherer\\Icons\\OreThorium", |
||
37 | [ORE_RTHORIUM] = "Interface\\Addons\\Gatherer\\Icons\\OreRThorium", |
||
38 | [ORE_DARKIRON] = "Interface\\Addons\\Gatherer\\Icons\\OreDarkIron", |
||
39 | }, |
||
40 | ["Herb"] = { |
||
41 | ["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Green", |
||
42 | [HERB_ARTHASTEAR] = "Interface\\AddOns\\Gatherer\\Icons\\HerbArthasTears", |
||
43 | [HERB_BLACKLOTUS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBlackLotus", |
||
44 | [HERB_BLINDWEED] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBlindweed", |
||
45 | [HERB_BRIARTHORN] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBriarthorn", |
||
46 | [HERB_BRUISEWEED] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBruiseweed", |
||
47 | [HERB_DREAMFOIL] = "Interface\\AddOns\\Gatherer\\Icons\\HerbDreamfoil", |
||
48 | [HERB_EARTHROOT] = "Interface\\AddOns\\Gatherer\\Icons\\HerbEarthroot", |
||
49 | [HERB_FADELEAF] = "Interface\\AddOns\\Gatherer\\Icons\\HerbFadeleaf", |
||
50 | [HERB_FIREBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbFirebloom", |
||
51 | [HERB_GHOSTMUSHROOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGhostMushroom", |
||
52 | [HERB_GOLDENSANSAM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGoldenSansam", |
||
53 | [HERB_GOLDTHORN] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGoldthorn", |
||
54 | [HERB_GRAVEMOSS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGraveMoss", |
||
55 | [HERB_GROMSBLOOD] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGromsblood", |
||
56 | [HERB_ICECAP] = "Interface\\AddOns\\Gatherer\\Icons\\HerbIcecap", |
||
57 | [HERB_KHADGARSWHISKER] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKhadgarsWhisker", |
||
58 | [HERB_KINGSBLOOD] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKingsblood", |
||
59 | [HERB_LIFEROOT] = "Interface\\AddOns\\Gatherer\\Icons\\HerbLiferoot", |
||
60 | [HERB_MAGEROYAL] = "Interface\\AddOns\\Gatherer\\Icons\\HerbMageroyal", |
||
61 | [HERB_MOUNTAINSILVERSAGE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbMountainSilversage", |
||
62 | [HERB_PEACEBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPeacebloom", |
||
63 | [HERB_PLAGUEBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPlaguebloom", |
||
64 | [HERB_PURPLELOTUS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPurpleLotus", |
||
65 | [HERB_SILVERLEAF] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSilverleaf", |
||
66 | [HERB_STRANGLEKELP] = "Interface\\AddOns\\Gatherer\\Icons\\HerbStranglekelp", |
||
67 | [HERB_SUNGRASS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSungrass", |
||
68 | [HERB_SWIFTTHISTLE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSwiftthistle", |
||
69 | [HERB_WILDSTEELBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbWildSteelbloom", |
||
70 | [HERB_WINTERSBITE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbWintersbite", |
||
71 | [HERB_WILDVINE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKingsblood", |
||
72 | }, |
||
73 | ["Treasure"] = { |
||
74 | ["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Yellow", |
||
75 | [TREASURE_BOX] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureCrate", |
||
76 | [TREASURE_CHEST] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureChest", |
||
77 | [TREASURE_CLAM] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureClam", |
||
78 | [TREASURE_CRATE] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureCrate", |
||
79 | [TREASURE_BARREL] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBarrel", |
||
80 | [TREASURE_CASK] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBarrel", |
||
81 | [TREASURE_FOOTLOCKER] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureChest", |
||
82 | [TREASURE_UNGOROSOIL] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroDirtPile", |
||
83 | [TREASURE_BLOODPETAL] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroSprout", |
||
84 | [TREASURE_POWERCRYST] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroCrystal", |
||
85 | [TREASURE_BLOODHERO] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBloodHero", |
||
86 | [TREASURE_SHELLFISHTRAP] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureShellfishTrap", |
||
87 | [TREASURE_FISHNODE] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishnode", |
||
88 | [TREASURE_FISHWRECK] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishwreck", |
||
89 | [TREASURE_FISHELEM] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishElem", |
||
90 | [TREASURE_NIGHTDRAGON] = "Interface\\Icons\\INV_Misc_Food_45", |
||
91 | [TREASURE_WHIPPERROOT] = "Interface\\Icons\\INV_Misc_Food_55", |
||
92 | [TREASURE_WINDBLOSSOM] = "Interface\\Icons\\INV_Misc_Food_58", |
||
93 | [TREASURE_SONGFLOWER] = "Interface\\Icons\\Spell_Holy_MindVision", |
||
94 | }, |
||
95 | ["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Test"}, |
||
96 | }, |
||
97 | }; |
||
98 | |||
99 | -- Ore rare spawn/Herbs find with matching table |
||
100 | Gather_RareMatch = { |
||
101 | [ORE_TIN] = ORE_SILVER, |
||
102 | [ORE_IRON] = ORE_GOLD, |
||
103 | [ORE_MITHRIL] = ORE_TRUESILVER, |
||
104 | [HERB_MAGEROYAL] = HERB_SWIFTTHISTLE, |
||
105 | [HERB_BRIARTHORN] = HERB_SWIFTTHISTLE, |
||
106 | [HERB_PURPLELOTUS] = HERB_WILDVINE, |
||
107 | }; |
||
108 | |||
109 | -- Skill levels required |
||
110 | Gather_SkillLevel = { |
||
111 | -- Ores |
||
112 | [ORE_COPPER] = 1, |
||
113 | [ORE_TIN] = 65, |
||
114 | [ORE_SILVER] = 75, |
||
115 | [ORE_IRON] = 125, |
||
116 | [ORE_GOLD] = 155, |
||
117 | [ORE_MITHRIL] = 175, |
||
118 | [ORE_TRUESILVER] = 230, |
||
119 | [ORE_THORIUM] = 245, |
||
120 | [ORE_RTHORIUM] = 270, |
||
121 | [ORE_DARKIRON] = 230, |
||
122 | -- Herbs |
||
123 | [HERB_PEACEBLOOM] = 1, |
||
124 | [HERB_SILVERLEAF] = 1, |
||
125 | [HERB_EARTHROOT] = 15, |
||
126 | [HERB_MAGEROYAL] = 50, |
||
127 | [HERB_BRIARTHORN] = 75, |
||
128 | [HERB_SWIFTTHISTLE] = 50, |
||
129 | [HERB_STRANGLEKELP] = 85, |
||
130 | [HERB_BRUISEWEED] = 100, |
||
131 | [HERB_WILDSTEELBLOOM] = 115, |
||
132 | [HERB_GRAVEMOSS] = 120, |
||
133 | [HERB_KINGSBLOOD] = 125, |
||
134 | [HERB_LIFEROOT] = 150, |
||
135 | [HERB_FADELEAF] = 160, |
||
136 | [HERB_GOLDTHORN] = 175, |
||
137 | [HERB_KHADGARSWHISKER] = 185, |
||
138 | [HERB_WINTERSBITE] = 195, |
||
139 | [HERB_FIREBLOOM] = 205, |
||
140 | [HERB_PURPLELOTUS] = 210, |
||
141 | [HERB_WILDVINE] = 210, |
||
142 | [HERB_SUNGRASS] = 230, |
||
143 | [HERB_BLINDWEED] = 235, |
||
144 | [HERB_GHOSTMUSHROOM] = 245, |
||
145 | [HERB_GROMSBLOOD] = 250, |
||
146 | [HERB_GOLDENSANSAM] = 260, |
||
147 | [HERB_ARTHASTEAR] = 220, |
||
148 | [HERB_DREAMFOIL] = 270, |
||
149 | [HERB_MOUNTAINSILVERSAGE]= 280, |
||
150 | [HERB_PLAGUEBLOOM] = 285, |
||
151 | [HERB_ICECAP] = 290, |
||
152 | [HERB_BLACKLOTUS] = 300, |
||
153 | }; |
||
154 | |||
155 | -- Match tables for shorter DB format |
||
156 | -- converting IconIndex to IconName and vice versa |
||
157 | function Gatherer_GetDB_IconIndex(iconIndex, gatherType) |
||
158 | -- type: (Icon, Optional[Gatherer_EGatherType]) -> Tuple[Icon, Optional[Gatherer_EGatherType]] |
||
159 | local iconName, gatherTypeIndex; |
||
160 | |||
161 | -- if gatherType wasn't set while icon was searched by name |
||
162 | if ( not gatherType and type(iconIndex) == "string" ) then |
||
163 | -- try to find icon index by looking through *every* possible gatherType |
||
164 | for myGather in Gatherer_EGatherType do |
||
165 | local icon = Gatherer_GetDB_IconIndex(iconIndex, myGather); |
||
166 | if (icon) then |
||
167 | -- this time return both index and hitted gatherType |
||
168 | return icon, myGather; |
||
169 | end; |
||
170 | end |
||
171 | end |
||
172 | |||
173 | gatherTypeIndex = Gatherer_EGatherType_ensureIndex(gatherType) |
||
174 | -- when gatherType isn't set and type(iconIndex) ~= 'string' |
||
175 | -- it'll loudly fail since gatherTypeIndex would be nil |
||
176 | for iconName in Gather_DB_IconIndex[gatherTypeIndex] do |
||
177 | if ( type(iconIndex) == "string" and iconName == iconIndex ) then |
||
178 | -- return index number |
||
179 | return Gather_DB_IconIndex[gatherTypeIndex][iconName]; |
||
180 | elseif ( type(iconIndex) == "number" and Gather_DB_IconIndex[gatherTypeIndex][iconName] == iconIndex ) then |
||
181 | -- return icon string |
||
182 | return iconName; |
||
183 | end |
||
184 | end |
||
185 | |||
186 | return nil; |
||
187 | end |
||
188 | |||
189 | function Gatherer_GetDB_IconByGatherName(gatherName) |
||
190 | local iconName, numType; |
||
191 | local iconName = Gatherer_FindOreType(gatherName); |
||
192 | if (iconName) then -- Ore |
||
193 | numType = 2; |
||
194 | else |
||
195 | iconName = Gatherer_FindTreasureType(gatherName); |
||
196 | if (iconName) then -- Treasure |
||
197 | numType = 0; |
||
198 | else -- Herb |
||
199 | iconName = gatherName; |
||
200 | numType = 1; |
||
201 | end |
||
202 | end |
||
203 | if (not iconName) then |
||
204 | iconName = "default"; |
||
205 | numType = 3; |
||
206 | end |
||
207 | |||
208 | return iconName, numType; |
||
209 | end |
||
210 | |||
211 | -- Icon indexes |
||
212 | -- 0 => Treasures |
||
213 | -- 1 => Herbs |
||
214 | -- 2 => Ores |
||
215 | -- Note: If you add new items, use icon index numbers starting from 100 |
||
216 | |||
217 | Gather_DB_IconIndex = {}; -- type: Dict[Gatherer_EGatherType, Dict[IconName, IconIndex]] |
||
218 | Gather_DB_IconIndex[0] = { |
||
219 | ["default"] = 0, |
||
220 | [TREASURE_BOX] = 1, |
||
221 | [TREASURE_CHEST] = 2, |
||
222 | [TREASURE_CLAM] = 3, |
||
223 | [TREASURE_CRATE] = 4, |
||
224 | [TREASURE_BARREL] = 5, |
||
225 | [TREASURE_CASK] = 6, |
||
226 | [TREASURE_FOOTLOCKER] = 7, |
||
227 | [TREASURE_UNGOROSOIL] = 8, |
||
228 | [TREASURE_BLOODPETAL] = 9, |
||
229 | [TREASURE_POWERCRYST] = 10, |
||
230 | [TREASURE_BLOODHERO] = 11, |
||
231 | [TREASURE_SHELLFISHTRAP]= 12, |
||
232 | [TREASURE_FISHNODE] = 13, |
||
233 | [TREASURE_FISHWRECK] = 14, |
||
234 | [TREASURE_FISHELEM] = 15, |
||
235 | [TREASURE_NIGHTDRAGON] = 16, |
||
236 | [TREASURE_WHIPPERROOT] = 17, |
||
237 | [TREASURE_WINDBLOSSOM] = 18, |
||
238 | [TREASURE_SONGFLOWER] = 19, |
||
239 | }; |
||
240 | |||
241 | Gather_DB_IconIndex[1] = { |
||
242 | ["default"] = 0, |
||
243 | [HERB_PEACEBLOOM] = 1, |
||
244 | [HERB_SILVERLEAF] = 2, |
||
245 | [HERB_EARTHROOT] = 3, |
||
246 | [HERB_MAGEROYAL] = 4, |
||
247 | [HERB_BRIARTHORN] = 5, |
||
248 | [HERB_SWIFTTHISTLE] = 6, |
||
249 | [HERB_STRANGLEKELP] = 7, |
||
250 | [HERB_BRUISEWEED] = 8, |
||
251 | [HERB_WILDSTEELBLOOM] = 9, |
||
252 | [HERB_GRAVEMOSS] = 10, |
||
253 | [HERB_KINGSBLOOD] = 11, |
||
254 | [HERB_LIFEROOT] = 12, |
||
255 | [HERB_FADELEAF] = 13, |
||
256 | [HERB_GOLDTHORN] = 14, |
||
257 | [HERB_KHADGARSWHISKER] = 15, |
||
258 | [HERB_WINTERSBITE] = 16, |
||
259 | [HERB_FIREBLOOM] = 17, |
||
260 | [HERB_PURPLELOTUS] = 18, |
||
261 | [HERB_WILDVINE] = 19, |
||
262 | [HERB_SUNGRASS] = 20, |
||
263 | [HERB_BLINDWEED] = 21, |
||
264 | [HERB_GHOSTMUSHROOM] = 22, |
||
265 | [HERB_GROMSBLOOD] = 23, |
||
266 | [HERB_GOLDENSANSAM] = 24, |
||
267 | [HERB_ARTHASTEAR] = 25, |
||
268 | [HERB_DREAMFOIL] = 26, |
||
269 | [HERB_MOUNTAINSILVERSAGE]= 27, |
||
270 | [HERB_PLAGUEBLOOM] = 28, |
||
271 | [HERB_ICECAP] = 29, |
||
272 | [HERB_BLACKLOTUS] = 30, |
||
273 | }; |
||
274 | |||
275 | Gather_DB_IconIndex[2] = { |
||
276 | ["default"] = 0, |
||
277 | [ORE_COPPER] = 1, |
||
278 | [ORE_TIN] = 2, |
||
279 | [ORE_SILVER] = 3, |
||
280 | [ORE_IRON] = 4, |
||
281 | [ORE_GOLD] = 5, |
||
282 | [ORE_MITHRIL] = 6, |
||
283 | [ORE_TRUESILVER] = 7, |
||
284 | [ORE_THORIUM] = 8, |
||
285 | [ORE_RTHORIUM] = 9, |
||
286 | [ORE_DARKIRON] = 10, |
||
287 | }; |
||
288 | |||
289 | Gather_DB_IconIndex[3] = { |
||
290 | ["default"] = 0, |
||
291 | } |