-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdumpSetDamageStats.php
52 lines (38 loc) · 1.38 KB
/
dumpSetDamageStats.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
<?php
if (php_sapi_name() != "cli") die("Can only be run from command line!");
require("/home/uesp/secrets/esolog.secrets");
$db = new mysqli($uespEsoLogReadDBHost, $uespEsoLogReadUser, $uespEsoLogReadPW, $uespEsoLogDatabase);
if ($db->connect_error) exit("Could not connect to mysql database!");
$result = $db->query("SELECT * FROM setSummary ORDER BY setName;");
if (!$result) die("Failed to load sets!");
while (($set = $result->fetch_assoc()))
{
$matchSetCount = 0;
//print ($set['setBonusDesc4'] . "\n");
for ($i = 1; $i <= 12; ++$i)
{
$match = preg_match("# ([A-Za-z]+) ([0-9\-]+) ((?:[a-zA-Z]+)|)( |)Damage#i", $set["setBonusDesc$i"], $matches);
if ($match)
{
if ($matches[1] == "absorbs") continue;
if ($matches[3] == "Spell") continue;
if ($matches[3] == "Weapon") continue;
$matchSetCount = $i;
}
}
if ($matchSetCount == 0) continue;
$setName = strtolower($set['setName']);
$desc = $set["setBonusDesc$matchSetCount"];
$desc = explode(". ", $desc);
$desc = implode("\n\t// ", $desc);
$items = 0;
$match = preg_match("#\(([0-9]+) items\)#", $desc, $matches);
if ($match) $items = $matches[1];
print("\"$setName\" : {\n");
print("\t// $desc\n");
print("\tisAoE : false,\n");
print("\tisDoT : false,\n");
print("\tindex : $matchSetCount,\n");
print("\titems : $items,\n");
print("},\n");
}