-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgathererdb.php
More file actions
599 lines (550 loc) · 20.3 KB
/
Copy pathgathererdb.php
File metadata and controls
599 lines (550 loc) · 20.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
<?php
require('includes/game.php');
set_time_limit(0);
$filename = "GathererDB_DataBase.zip";
$addon_site = $_SERVER['SERVER_NAME'];
$addon_link = $addon_site."/".$filename;
$queryx = $_SERVER['QUERY_STRING'];
list($str, $trash) = explode('&', $queryx, 2);
list($razdel, $podrazdel) = explode('=', $str, 2);
switch($podrazdel)
{
case 'renew';
break;
default;
echo "<b>Файл:</b> $filename</br><b>Последние изменения: </b>" . date ("d F Y H:i:s.", filemtime($filename));
echo"<br><b>Сегодня: </b>".date("d F Y H:i:s.")."<br><a href='/?gdb=renew'>Renew Addon Data</a><br />";
echo "<br><br> Скачать <a href='http://".$addon_link."'>GathererDB_DataBase.zip</a>";
die;
break;
}
$gatherer_objects = array(
// MINE
324, 1610, 1731, 1732, 1733, 1734, 1735, 2040, 2047, 2653, 19903, 73940,
73941, 123309, 123310, 123848, 165658, 175404, 177388, 180215, 181555,
181556, 181557, 181569, 185877, 189978, 189979, 189980, 189981, 191133,
// HERB
1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1628, 2041, 2042, 2043,
2044, 2045, 2046, 2866, 142140, 142141, 142142, 142143, 142144, 142145,
176583, 176584, 176586, 176587, 176588, 176589, 181166, 181270, 181271,
181275, 181276, 181277, 181278, 181279, 181280, 181281, 185881, 189973,
190169, 190170, 190171, 190172, 190175, 190176, 191019, 191303,
// OPEN
2039, 2744, 2843, 2844, 2850, 3658, 3659, 3660, 3661, 3662, 3705, 3706,
3714, 19019, 28604, 74447, 74448, 75293, 123330, 131978, 131979, 142191,
157936, 164958, 176213, 176582, 178244, 179486, 179487, 179492, 179493,
179498, 181628, 182053, 164881, 164882, 174662, 164884, 185881, 185877,
179697, 182069, 142184, 177784, 2560, 141931, 2883, 152608, 105176,
123330, 181665, 184793, 105570, 179486, 179487, 179492, 179493, 184740,
184742, 181798, 181800, 181802, 181804, 185915, 182258, 181598, 193997,
);
$gatherer_areas = array(
36 => "ALTERAC_MOUNTAINS",
45 => "ARATHI_HIGHLANDS",
331 => "ASHENVALE",
16 => "AZSHARA",
3524 => "AZUREMYST_ISLE",
3 => "BADLANDS",
17 => "BARRENS",
3522 => "BLADES_EDGE_MOUNTAINS",
4 => "BLASTED_LANDS",
3525 => "BLOODMYST_ISLE",
3537 => "BOREAN_TUNDRA",
46 => "BURNING_STEPPES",
2817 => "CRYSTALSONG_FOREST",
4395 => "DALARAN",
148 => "DARKSHORE",
1657 => "DARNASSUS",
41 => "DEADWIND_PASS",
405 => "DESOLACE",
65 => "DRAGONBLIGHT",
1 => "DUN_MOROGH",
14 => "DUROTAR",
10 => "DUSKWOOD",
15 => "DUSTWALLOW_MARSH",
139 => "EASTERN_PLAGUELANDS",
12 => "ELWYNN_FOREST",
3430 => "EVERSONG_WOODS",
3557 => "EXODAR",
361 => "FELWOOD",
357 => "FERALAS",
3433 => "GHOSTLANDS",
394 => "GRIZZLY_HILLS",
3483 => "HELLFIRE_PENINSULA",
267 => "HILLSBRAD_FOOTHILLS",
47 => "HINTERLANDS",
495 => "HOWLING_FJORD",
4742 => "HROTHGARS_LANDING",
210 => "ICECROWN_GLACIER",
1537 => "IRONFORGE",
4197 => "LAKE_WINTERGRASP",
38 => "LOCH_MODAN",
493 => "MOONGLADE",
215 => "MULGORE",
3518 => "NAGRAND",
3523 => "NETHERSTORM",
1637 => "ORGRIMMAR",
4080 => "QUEL_DANAS",
44 => "REDRIDGE_MOUNTAINS",
51 => "SEARING_GORGE",
3520 => "SHADOWMOON_VALLEY",
3703 => "SHATTRATH",
3711 => "SHOLAZAR_BASIN",
1377 => "SILITHUS",
3487 => "SILVERMOON",
130 => "SILVERPINE_FOREST",
406 => "STONETALON_MOUNTAINS",
1519 => "STORMWIND",
67 => "STORM_PEAKS",
33 => "STRANGLETHORN_VALE",
8 => "SWAMP_OF_SORROWS",
440 => "TANARIS",
141 => "TELDRASSIL",
3519 => "TEROKKAR_FOREST",
400 => "THOUSAND_NEEDLES",
1638 => "THUNDER_BLUFF",
85 => "TIRISFAL_GLADES",
1497 => "UNDERCITY",
490 => "UNGORO_CRATER",
28 => "WESTERN_PLAGUELANDS",
40 => "WESTFALL",
11 => "WETLANDS",
618 => "WINTERSPRING",
3521 => "ZANGARMARSH",
66 => "ZULDRAK",
);
$version = @$DB->selectCell('SELECT db_version FROM version');
if (!$version)
$version = @$DB->selectCell('SELECT version FROM db_version');
if (!$version)
$version = "DataBase";
echo "Scroll down to download link<br>Generating positions...";
$gathererdb = array();
$current = 0;
$total = count($gatherer_objects);
foreach($gatherer_objects as $object)
{
echo "$current/$total <br>"; $current++;
$positions = position($object, 'gameobject');
foreach($positions as $area)
if (isset($gatherer_areas[$area['atid']]))
{
$areaname = $gatherer_areas[$area['atid']];
if (!isset($gathererdb[$areaname]))
$gathererdb[$areaname] = array();
if (!isset($gathererdb[$areaname][$object]))
$gathererdb[$areaname][$object] = array();
foreach($area['points'] as $point)
{
$x = $point['x'];
$y = $point['y'];
if ($x >= 0 && $x <= 99.9 && $y >= 0 && $y <= 99.9)
$gathererdb[$areaname][$object][] = sprintf("%03d%03d", $x*10, $y*10);
}
}
// Workaround for buggy position() function, should be fixed in game.php
global $cached_images;
$cached_images = array();
}
echo "<br>Done";
// print_r($gathererdb);
$gathererdata = "-- Generated from {$version}
if not GathererDB.FreedomHead.isLoading then return end
GathererDB.FreedomHead.data = {
";
foreach($gathererdb as $areaname => $areainfo)
{
$gathererdata .= "\t$areaname = {\n";
foreach($areainfo as $object => $list)
{
$gathererdata .= "\t\t[$object] = {";
$counter = 0;
foreach($list as $value)
{
if ($counter == 0)
$gathererdata .= "\n\t\t\t";
$gathererdata .= "$value,";
$counter = ($counter + 1)%8;
}
$gathererdata .= "\n\t\t},\n";
}
$gathererdata .= "\t},\n";
}
$gathererdata .= "}\n";
unset($gathererdb);
// print($gathererdata);
echo "<br>Generating addon archive...";
// Fallback code for users without zip support
if (class_exists('ZipArchive'))
{
$zip = new ZipArchive();
if ($zip->open('GathererDB_DataBase.zip', ZIPARCHIVE::OVERWRITE) !== TRUE)
die ("Error creating archive");
}
else
{
class ZipFallback
{
function addFromString($filename, $data)
{
@mkdir(dirname($filename), 0777, true); // suppress "Directory exists" warning
file_put_contents($filename, $data);
}
function close(){}
}
$zip = new ZipFallback();
}
$zip->addFromString("GathererDB_FreedomHead/Data.lua", $gathererdata);
///////////////////////////////////////////////////////////////////////////
$zip->addFromString("GathererDB_FreedomHead/Main.lua", <<<THEEND
--[[
Portions of data included here may belong to either Wowhead or Blizzard.
Code in this file is hereby released into the Public Domain.
No warranty of merchantability or fitness of purpose is provided or
implied. Use this code at your own risk.
]]
if not GathererDB then GathererDB = {} end
local lib = {}
GathererDB.FreedomHead = lib
lib.isLoading = true
if not Gatherer then lib.isLoading = false
elseif not Gatherer.Api then lib.isLoading = false
elseif not Gatherer.Api.AddGather then lib.isLoading = false
elseif not Gatherer.ZoneTokens then lib.isLoading = false
elseif not Gatherer.Config.AddCallback then
DEFAULT_CHAT_FRAME:AddMessage("GathererDB_FreedomHead: Please upgrade to the latest version of Gatherer.")
lib.isLoading = false
end
if not lib.isLoading then
DEFAULT_CHAT_FRAME:AddMessage("GathererDB_FreedomHead: Not loading due to missing or old Gatherer.")
return
end
local zonelut
local updateFrame
local co
local YIELD_AT = 20
local function beginImport()
-- Disable minimap updates for the duration of the update
local curMini = Gatherer.Config.GetSetting("minimap.enable")
local curHud = Gatherer.Config.GetSetting("hud.enable")
Gatherer.Config.SetSetting("minimap.enable", false)
Gatherer.Config.SetSetting("hud.enable", false)
-- Count the total number of inserts needed, so that we can do a progress bar!
local position, total, counter = 0,0,0
for zone, zdata in pairs(lib.data) do
for node, ndata in pairs(zdata) do
total = total + #ndata
end
end
-- Neutralize all of the unvalidated nodes by us from the current database...
for zone, zonedef in pairs(zonelut) do
local c,z = unpack(zonedef)
for node, ntype in pairs(Gatherer.Nodes.Objects) do
Gatherer.Storage.RemoveGather(c, z, node, "DB:FreedomHead")
end
counter = counter + 1
if counter > YIELD_AT then
coroutine.yield()
counter = 0
end
end
-- Add all the nodes from the current database
for zone, zdata in pairs(lib.data) do
local zonedef = zonelut[zone]
if zonedef then
local c,z = unpack(zonedef)
for node, ndata in pairs(zdata) do
for pos, coord in ipairs(ndata) do
local x = math.floor(coord/1000)/1000
local y = (coord%1000)/1000
local success = Gatherer.Api.AddGather(node, nil, nil, 'DB:FreedomHead', nil, nil, false, c, z, x, y)
position = position + 1
counter = counter + 1
if counter > YIELD_AT then
updateFrame:SetPct(position/total)
coroutine.yield()
counter = 0
end
end
end
end
end
-- Restore the minimap and hud display settings
Gatherer.Config.SetSetting("minimap.enable", curMini)
Gatherer.Config.SetSetting("hud.enable", curHud)
end
function lib:PerformImport()
if not updateFrame then
zonelut = {}
for c, zones in pairs(Gatherer.ZoneTokens.Tokens) do
for zone, z in pairs(zones) do
if type(zone)=='string' and type(z)=='number' then
zonelut[zone] = {c, z}
end
end
end
updateFrame = CreateFrame("Frame", nil, UIParent)
updateFrame:SetPoint("CENTER", UIParent, "CENTER")
updateFrame:SetFrameStrata("TOOLTIP")
updateFrame:SetWidth("320")
updateFrame:SetHeight("50")
updateFrame:SetScript("OnUpdate", function()
if not coroutine.resume(co) then
this:Hide()
end
end)
updateFrame.text = updateFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
updateFrame.text:SetPoint("TOPLEFT", updateFrame, "TOPLEFT", 10,-5)
updateFrame.text:SetHeight(16)
updateFrame.text:SetJustifyH("LEFT")
updateFrame.text:SetJustifyV("TOP")
updateFrame.text:SetText("Importing FreedomHead database:")
updateFrame.back = updateFrame:CreateTexture(nil, "BACKGROUND")
updateFrame.back:SetPoint("TOPLEFT")
updateFrame.back:SetPoint("BOTTOMRIGHT")
updateFrame.back:SetTexture("Interface\\\\QuestFrame\\\\UI-QuestTitleHighlight")
updateFrame.bar = updateFrame:CreateTexture(nil, "BORDER")
updateFrame.bar:SetTexture(1,1,1)
updateFrame.bar:SetPoint("BOTTOMLEFT", updateFrame, "BOTTOMLEFT", 10, 5)
updateFrame.bar:SetPoint("BOTTOMRIGHT", updateFrame, "BOTTOMRIGHT", -10, 5)
updateFrame.bar:SetHeight(18)
updateFrame.bar:SetAlpha(0.2)
updateFrame.bar.pct = updateFrame:CreateTexture(nil, "ARTWORK")
updateFrame.bar.pct:SetTexture(1,1,1)
updateFrame.bar.pct:SetGradientAlpha("Vertical", 0,0,0.4, 1, 0,0,0.7, 1)
updateFrame.bar.pct:SetPoint("BOTTOMLEFT", updateFrame.bar, "BOTTOMLEFT")
updateFrame.bar.pct:SetPoint("TOPLEFT", updateFrame.bar, "TOPLEFT")
updateFrame.bar.text = updateFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
updateFrame.bar.text:SetPoint("TOPLEFT", updateFrame.bar, "TOPLEFT", 0,0)
updateFrame.bar.text:SetPoint("BOTTOMRIGHT", updateFrame.bar, "BOTTOMRIGHT", 0,0)
updateFrame.bar.text:SetJustifyH("CENTER")
updateFrame.bar.text:SetJustifyV("CENTER")
updateFrame.bar.text:SetText("0%")
function updateFrame:SetPct(pct)
pct = math.max(0, math.min((tonumber(pct) or 0), 1))
local width = updateFrame:GetWidth() - 20
updateFrame.bar.pct:SetWidth(width * pct)
updateFrame.bar.text:SetText(("%0.1f%%"):format(pct*100))
end
end
updateFrame:Show()
co = coroutine.create(beginImport)
end
local function setupGui(gui)
local id
if (GathererDB.guiId) then
id = GathererDB.guiId
else
id = gui:AddTab("Database")
gui:AddControl(id, "Header", 0, "GathererDB Imports")
gui:MakeScrollable(id)
GathererDB.guiId = id
end
local version = GetAddOnMetadata("GathererDB_FreedomHead", "Version")
gui:AddControl(id, "Subhead", 0, "Perform import of FreedomHead "..version.." DB:")
local buttonFrame = CreateFrame("Frame", nil, gui.tabs[id][3])
buttonFrame:SetHeight(24)
gui:AddControl(id, "Custom", 0, 1, buttonFrame)
local button = CreateFrame("Button", nil, buttonFrame, "OptionsButtonTemplate")
button:SetPoint("TOPLEFT", buttonFrame, "TOPLEFT", 0,0)
button:SetScript("OnClick", lib.PerformImport)
button:SetText("Import")
button.text = button:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
button.text:SetPoint("LEFT", button, "RIGHT", 5, 0)
button.text:SetPoint("RIGHT", buttonFrame, "RIGHT", 0, 0)
button.text:SetJustifyH("LEFT")
button.text:SetText("Data generated from FreedomHead database")
end
Gatherer.Config.AddCallback("GathererDB_FreedomHead", setupGui)
local nodeBasics = {
[324] = { "MINE", "Small Thorium Vein" },
[1610] = { "MINE", "Incendicite Mineral Vein" },
[1731] = { "MINE", "Copper Vein" },
[1732] = { "MINE", "Tin Vein" },
[1733] = { "MINE", "Silver Vein" },
[1734] = { "MINE", "Gold Vein" },
[1735] = { "MINE", "Iron Deposit" },
[2040] = { "MINE", "Mithril Deposit" },
[2047] = { "MINE", "Truesilver Deposit" },
[2653] = { "MINE", "Lesser Bloodstone Deposit" },
[19903] = { "MINE", "Indurium Mineral Vein" },
[73940] = { "MINE", "Ooze Covered Silver Vein" },
[73941] = { "MINE", "Ooze Covered Gold Vein" },
[123309] = { "MINE", "Ooze Covered Truesilver Deposit" },
[123310] = { "MINE", "Ooze Covered Mithril Deposit" },
[123848] = { "MINE", "Ooze Covered Thorium Vein" },
[165658] = { "MINE", "Dark Iron Deposit" },
[175404] = { "MINE", "Rich Thorium Vein" },
[177388] = { "MINE", "Ooze Covered Rich Thorium Vein" },
[180215] = { "MINE", "Hakkari Thorium Vein" },
[181555] = { "MINE", "Fel Iron Deposit" },
[181556] = { "MINE", "Adamantite Deposit" },
[181557] = { "MINE", "Khorium Vein" },
[181569] = { "MINE", "Rich Adamantite Deposit" },
[185877] = { "MINE", "Nethercite Deposit" },
[189978] = { "MINE", "Cobalt Node" },
[189979] = { "MINE", "Rich Cobalt Node" },
[189980] = { "MINE", "Saronite Node" },
[189981] = { "MINE", "Rich Saronite Node" },
[191133] = { "MINE", "Titanium Node" },
[1617] = { "HERB", "Silverleaf" },
[1618] = { "HERB", "Peacebloom" },
[1619] = { "HERB", "Earthroot" },
[1620] = { "HERB", "Mageroyal" },
[1621] = { "HERB", "Briarthorn" },
[1622] = { "HERB", "Bruiseweed" },
[1623] = { "HERB", "Wild Steelbloom" },
[1624] = { "HERB", "Kingsblood" },
[1628] = { "HERB", "Grave Moss" },
[2041] = { "HERB", "Liferoot" },
[2042] = { "HERB", "Fadeleaf" },
[2043] = { "HERB", "Khadgar's Whisker" },
[2044] = { "HERB", "Wintersbite" },
[2045] = { "HERB", "Stranglekelp" },
[2046] = { "HERB", "Goldthorn" },
[2866] = { "HERB", "Firebloom" },
[142140] = { "HERB", "Purple Lotus" },
[142141] = { "HERB", "Arthas' Tears" },
[142142] = { "HERB", "Sungrass" },
[142143] = { "HERB", "Blindweed" },
[142144] = { "HERB", "Ghost Mushroom" },
[142145] = { "HERB", "Gromsblood" },
[176583] = { "HERB", "Golden Sansam" },
[176584] = { "HERB", "Dreamfoil" },
[176586] = { "HERB", "Mountain Silversage" },
[176587] = { "HERB", "Plaguebloom" },
[176588] = { "HERB", "Icecap" },
[176589] = { "HERB", "Black Lotus" },
[181166] = { "HERB", "Bloodthistle" },
[181270] = { "HERB", "Felweed" },
[181271] = { "HERB", "Dreaming Glory" },
[181275] = { "HERB", "Ragveil" },
[181276] = { "HERB", "Flame Cap" },
[181277] = { "HERB", "Terocone" },
[181278] = { "HERB", "Ancient Lichen" },
[181279] = { "HERB", "Netherbloom" },
[181280] = { "HERB", "Nightmare Vine" },
[181281] = { "HERB", "Mana Thistle" },
[185881] = { "HERB", "Netherdust Bush" },
[189973] = { "HERB", "Goldclover" },
[190169] = { "HERB", "Tiger Lily" },
[190170] = { "HERB", "Talandra's Rose" },
[190171] = { "HERB", "Lichbloom" },
[190172] = { "HERB", "Icethorn" },
[190175] = { "HERB", "Frozen Herb" },
[190176] = { "HERB", "Frost Lotus" },
[191019] = { "HERB", "Adder's Tongue" },
[191303] = { "HERB", "Firethorn" },
[2039] = { "OPEN", "Hidden Strongbox" },
[2744] = { "OPEN", "Giant Clam" },
[2843] = { "OPEN", "Battered Chest" },
[2844] = { "OPEN", "Tattered Chest" },
[2850] = { "OPEN", "Solid Chest" },
[3658] = { "OPEN", "Water Barrel" },
[3659] = { "OPEN", "Barrel of Melon Juice" },
[3660] = { "OPEN", "Armor Crate" },
[3661] = { "OPEN", "Weapon Crate" },
[3662] = { "OPEN", "Food Crate" },
[3705] = { "OPEN", "Barrel of Milk" },
[3706] = { "OPEN", "Barrel of Sweet Nectar" },
[3714] = { "OPEN", "Alliance Strongbox" },
[19019] = { "OPEN", "Box of Assorted Parts" },
[28604] = { "OPEN", "Scattered Crate" },
[74447] = { "OPEN", "Large Iron Bound Chest" },
[74448] = { "OPEN", "Large Solid Chest" },
[75293] = { "OPEN", "Large Battered Chest" },
[123330] = { "OPEN", "Buccaneer's Strongbox" },
[131978] = { "OPEN", "Large Mithril Bound Chest" },
[131979] = { "OPEN", "Large Darkwood Chest" },
[142191] = { "OPEN", "Horde Supply Crate" },
[157936] = { "OPEN", "Un'Goro Dirt Pile" },
TREASURE_POWERCRYST = { "OPEN", "Blue Power Crystal" },
TREASURE_POWERCRYST = { "OPEN", "Green Power Crystal" },
TREASURE_POWERCRYST = { "OPEN", "Red Power Crystal" },
TREASURE_POWERCRYST = { "OPEN", "Yellow Power Crystal" },
[164958] = { "OPEN", "Bloodpetal Sprout" },
[176213] = { "OPEN", "Blood of Heroes" },
[176582] = { "OPEN", "Shellfish Trap" },
[178244] = { "OPEN", "Practice Lockbox" },
[179486] = { "OPEN", "Battered Footlocker" },
[179487] = { "OPEN", "Waterlogged Footlocker" },
[179492] = { "OPEN", "Dented Footlocker" },
[179493] = { "OPEN", "Mossy Footlocker" },
[179498] = { "OPEN", "Scarlet Footlocker" },
[181628] = { "OPEN", "Empty Barrel" },
[182053] = { "OPEN", "Glowcap" },
[164881] = { "OPEN", "Cleansed Night Dragon" },
[164882] = { "OPEN", "Cleansed Songflower" },
[174662] = { "OPEN", "Cleansed Whipper Root" },
[164884] = { "OPEN", "Cleansed Windblossom" },
[185881] = { "OPEN", "Netherdust Bush" },
[185877] = { "OPEN", "Nethercite Deposit" },
[179697] = { "OPEN", "Arena Treasure Chest" },
[182069] = { "OPEN", "Mature Spore Sac" },
[142184] = { "OPEN", "Captain's Chest" },
[177784] = { "OPEN", "Giant Softshell Clam" },
[2560] = { "OPEN", "Half-Buried Bottle" },
[141931] = { "OPEN", "Hippogryph Egg" },
[2883] = { "OPEN", "Ripe Pumpkin" },
[152608] = { "OPEN", "Kolkar's Booty" },
[105176] = { "OPEN", "Venture Co. Strongbox" },
[123330] = { "OPEN", "Buccaneer's Strongbox" },
[181665] = { "OPEN", "Burial Chest" },
[184793] = { "OPEN", "Primitive Chest" },
[105570] = { "OPEN", "Alliance Strongbox" },
[179486] = { "OPEN", "Battered Footlocker" },
[179487] = { "OPEN", "Waterlogged Footlocker" },
[179492] = { "OPEN", "Dented Footlocker" },
[179493] = { "OPEN", "Mossy Footlocker" },
[184740] = { "OPEN", "Wicker Chest" },
[184742] = { "OPEN", "Dented Footlocker" },
[181798] = { "OPEN", "Fel Iron Chest" },
[181800] = { "OPEN", "Heavy Fel Iron Chest" },
[181802] = { "OPEN", "Adamantite Bound Chest" },
[181804] = { "OPEN", "Felsteel Chest" },
[185915] = { "OPEN", "Netherwing Egg" },
[182258] = { "OPEN", "Oshu'gun Crystal Fragment" },
[181598] = { "OPEN", "Silithyst Geyser" },
[193997] = { "OPEN", "Everfrost Chip" },
}
local locale = GetLocale()
for nodeId, nData in pairs(nodeBasics) do
local nodeType, nodeName = unpack(nData)
if not Gatherer.Nodes.Objects[nodeId] then
Gatherer.Nodes.Objects[nodeId] = nodeType
end
if locale == "enUS" then
if not Gatherer.Nodes.Names[nodeName] then
Gatherer.Nodes.Names[nodeName] = nodeId
end
if not Gatherer.Categories.CategoryNames[nodeId] then
Gatherer.Categories.CategoryNames[nodeId] = nodeName
end
end
end
THEEND
);
///////////////////////////////////////////////////////////////////////////
$date = date("Y-m-d");
$zip->addFromString("GathererDB_FreedomHead/GathererDB_FreedomHead.toc", <<<THEEND
## Interface: 30000
##
## Title: GathererDB: |cffce0a11FreedomHead|r
## Notes: Gatherer preloaded database, based on GathererDB_FreedomHead
## Version: 1.0.{$date}
##
## X-Website: http://db.freedomcore.ru
## X-CompatibleLocales: enUS, enGB, deDE, frFR, koKR, zhCN, zhTW, esES
## X-Category: Tradeskill
## X-Date: {$date}
##
## RequiredDeps: Gatherer
Main.lua
Data.lua
THEEND
);
///////////////////////////////////////////////////////////////////////////
$zip->close();
echo "<br>Job done";
echo "<br><br> Download <a href='http://".$addon_link."'>GathererDB_DataBase.zip</a>";
?>