-
Notifications
You must be signed in to change notification settings - Fork 1
/
createRuneBoxData.php
168 lines (155 loc) · 6.95 KB
/
createRuneBoxData.php
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
<?php
if (php_sapi_name() != "cli") die("Can only be run from command line!");
$TABLE_SUFFIX = "";
$REPLACE_PAIRS = array(
"Storm Lord" => "Stormlord",
"Fire Drake" => "Firedrake",
"Dwemer Theodolite Pet" => "Dwarven Theodolite",
"Dwarven Theodolite Pet" => "Dwarven Theodolite",
"Sixth House Robe Costume" => "Sixth House Robe",
"Clockwork Reliquary" => "Clockwork Curator",
"Soul-Shriven Skin" => "Soul-Shriven",
"Big-Eared Ginger Kitten Pet" => "Big-Eared Ginger Kitten",
"Psijic Glowglobe Emote" => "Psijic Glowglobe",
"Arena Gladiator Costume" => "Arena Gladiator",
"Arena Gladiator Emote" => "Gladiator Taunt",
"Blood Spawn's Shoulder" => "Bloodspawn's Shoulder",
"Blood Spawn's Mask" => "Bloodspawn's Mask",
"Sellistrix' Shoulder" => "Sellistrix's Shoulder",
"Sellistrix' Mask" => "Sellistrix Mask",
"Engine Guardian Shoulder" => "Engine Guardian's Shoulder",
"Engine Guardian Mask" => "Engine Guardian's Mask",
"Abner Tharn's Jerkin" => "Abnur Tharn's Jerkin",
"Abner Tharn's Hat" => "Abnur Tharn's Hat",
"Abner Tharn's Breeches" => "Abnur Tharn's Breeches",
"Abner Tharn's Epaulets" => "Abnur Tharn's Epaulets",
"Abner Tharn's Shoes" => "Abnur Tharn's Shoes",
"Abner Tharn's Gloves" => "Abnur Tharn's Gloves",
"Abner Tharn's Sash" => "Abnur Tharn's Sash",
"Abner Tharn's Dagger" => "Abnur Tharn's Dagger",
"Abner Tharn's Staff" => "Abnur Tharn's Staff",
"Guar Stomp Emote" => "Guar Stomp",
"Grothdar " => "Grothdarr ",
"Mummified Alfiq Pet" => "Grisly Mummy Tabby",
"Banner Emote" => "Banner",
"Siegemaster's" => "Siegemaster",
"Opal Ilambris' " => "Opal Ilambris ",
"Snowhawk Mage " => "Snowhawk Mage's ",
"Balorgh's " => "Balorgh ",
"Iceheart's Mask" => "Iceheart Mask",
"Troll King's Mask" => "Troll King Mask",
"Bloodspawn's Mask" => "Bloodspawn Mask",
"Sellistrix's Mask" => "Sellistrix Mask",
"Swarm Mother's Mask" => "Swarm Mother Mask",
"Valkyn Skoria's Mask" => "Valkyn Skoria Mask",
"Nightflame's Mask" => "Nightflame Mask",
"Lord Warden's Mask" => "Lord Warden Mask",
"Shadowrend's Mask" => "Shadowrend Mask",
"Ilambris' Mask" => "Ilambris Mask",
"Molag Kena's Mask" => "Molag Kena Mask",
"Grothdar's Mask" => "Grothdarr Mask",
"Grothdar's Shoulder" => "Grothdarr's Shoulder",
"Grothdarr's Mask" => "Grothdarr Mask",
"Mighty Chudan's Mask" => "Mighty Chudan Mask",
"Velidreth's Mask" => "Velidreth Mask",
"Pirate Skeleton's Mask" => "Pirate Skeleton Mask",
"Chokethorn's Mask" => "Chokethorn Mask",
"Spawn of Mephala's Mask" => "Spawn of Mephala Mask",
"Slimecraw's Mask" => "Slimecraw Mask",
"Maw of the Infernal's Mask" => "Maw of the Infernal Mask",
"Nerien'eth's Mask" => "Nerien'eth Mask",
" Chitinous Jack" => "Chitinous Jack",
"Earthgore's Mask" => "Earthgore Mask",
"Tremorscale's Mask" => "Tremorscale Mask",
"Timbercrow Wanderer Costume" => "Timbercrow Wanderer",
"Doctrine Ordinator Cuirass" => "Doctrine Ordinator Jack",
"Doctrine Ordinator Greaves" => "Doctrine Ordinator Guards",
"Opal Troll King's Mask" => "Opal Troll King Mask",
"Opal Bloodspawn's Mask" => "Opal Bloodspawn Mask",
"Opal Nightflame's Mask" => "Opal Nightflame Mask",
"Opal Iceheart's Mask" => "Opal Iceheart Mask",
"Opal Iceheart Shoulder" => "Opal Iceheart's Shoulder",
"Opal Lord Warden's Mask" => "Opal Lord Warden Mask",
"Opal Nightflame's Mask" => "Opal Nightflame Mask",
"Opal Nightflame Shoulder" => "Opal Nightflame's Shoulder",
"Opal Swarm Mother's Mask" => "Opal Swarm Mother Mask",
"Opal Swarm Mother Shoulder" => "Opal Swarm Mother's Shoulder",
"Aldmeri Breton Terrier Pet" => "Dominion Breton Terrier",
"Daggerfall Breton Terrier Pet" => "Covenant Breton Terrier",
"Ebonheart Breton Terrier Pet" => "Pact Breton Terrier",
"Rage of the Reach Emote" => "Rage of the Reach",
"Nibenese Court Wizard Robe" => "Nibenese Court Wizard Jerkin",
"Rage of The Reach Emote" => "Rage of the Reach",
"Marshmallow Toasty Treat Emote" => "Marshmallow Toasty Treat",
"Witch's Bonfire Memento" => "Witch's Bonfire Dust",
"Black Drake's Face Warpaint" => "The Black Drake's Face Warpaint",
"Black Drake's Body Warpaint" => "The Black Drake's Body Warpaint",
"Siegestomper Emote" => "Siegestomper",
"Mother Ciannait Shoulder" => "Mother Ciannait's Shoulder",
"Second Seed Jerkin" => "Second Seed Raiment Jerkin",
"Second Seed Hat" => "Second Seed Raiment Hat",
"Second Seed Breeches" => "Second Seed Raiment Breeches",
"Second Seed Epaulets" => "Second Seed Raiment Epaulets",
"Second Seed Epaulet" => "Second Seed Raiment Epaulet",
"Second Seed Shoes" => "Second Seed Raiment Shoes",
"Second Seed Glove" => "Second Seed Raiment Glove",
"Second Seed Sash" => "Second Seed Raiment Sash",
"Saberkeel Cuirass" => "Saberkeel Panoply Cuirass",
"Saberkeel Helm" => "Saberkeel Panoply Helm",
"Saberkeel Greaves" => "Saberkeel Panoply Greaves",
"Saberkeel Pauldrons" => "Saberkeel Panoply Pauldrons",
"Saberkeel Sabatons" => "Saberkeel Panoply Sabatons",
"Saberkeel Gauntlets" => "Saberkeel Panoply Gauntlets",
"Saberkeel Girdle" => "Saberkeel Panoply Girdle",
"Ghastly Visitation Memento" => "Ghastly Visitation",
"Witchmother's Servant's " => "Witchmother's Servant ",
"Sellistrix Shoulder" => "Sellistrix's Shoulder",
"Valkyn Skoria's " => "Valkyn Skoria ",
"Grothdar's Shoulder" => "Grothdarr Shoulder",
"Maw of the Infernal " => "Maw of the Infernal's ",
"Opal Lord Warden's " => "Opal Lord Warden ",
"Opal Domihaus " => "Domihaus ",
"Y'ffre's Fallen-Wood Pauldron" => "Y'ffre's Fallen-Wood Pauldrons",
"Ilambris " => "Ilambris' ",
);
require("/home/uesp/secrets/esolog.secrets");
require("esoCommon.php");
$db = new mysqli($uespEsoLogReadDBHost, $uespEsoLogReadUser, $uespEsoLogReadPW, $uespEsoLogDatabase);
if ($db->connect_error) exit("Could not connect to mysql database!");
print("Looking for all container data...\n");
$query = "SELECT * FROM minedItemSummary$TABLE_SUFFIX WHERE type=18 or type=34;";
$result = $db->query($query);
if (!$result) exit("DB query error!");
while (($row = $result->fetch_assoc()))
{
$name = $row['name'];
$itemId = $row['itemId'];
if (preg_match("/(Runebox|Style Page)\: (.*)/i", $name, $matches))
{
$suffix = $matches[2];
//print ("\tFound $name ($suffix)!\n");
$safeName = $db->real_escape_string($suffix);
$query = "SELECT * FROM collectibles WHERE name='$safeName' LIMIT 1;";
$result2 = $db->query($query);
if ($result2->num_rows == 0)
{
$oldSuffix = $suffix;
$suffix = strtr($suffix, $REPLACE_PAIRS);
//print("\tNew Suffix: '$oldSuffix' => '$suffix'\n");
$safeName = $db->real_escape_string($suffix);
$query = "SELECT * FROM collectibles WHERE name='$safeName' LIMIT 1;";
$result2 = $db->query($query);
}
if ($result2->num_rows == 0)
{
//print("\tWarning: No collectible matching '$suffix' found!\n");
print("\t-- [$itemId] = ?, \t-- $suffix\n");
}
else
{
$row2 = $result2->fetch_assoc();
$collectId = $row2['id'];
print("\t[$itemId] = $collectId, \t-- $suffix\n");
}
}
}