Setup/Scripts

* restructure setup to allow for self contained setup steps to self register (just the sql for now)
 * should ease adding new scripts in future
This commit is contained in:
Sarjuuk
2019-07-31 23:25:44 +02:00
parent 163e3d82b0
commit ccef11323b
51 changed files with 5345 additions and 4964 deletions

View File

@@ -7,35 +7,38 @@ if (!CLI)
die('not in cli mode');
$customData = array(
);
$reqDBC = ['talent', 'talenttab'];
function talents()
SqlGen::register(new class extends SetupScript
{
// class: 0 => hunter pets
for ($i = 1; $i < 6; $i++)
DB::Aowow()->query('
REPLACE INTO
?_talents
SELECT
t.id,
IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0),
tt.creatureFamilyMask,
IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber),
t.row,
t.column,
t.rank?d,
?d
FROM
dbc_talenttab tt
JOIN
dbc_talent t ON tt.id = t.tabId
WHERE
t.rank?d <> 0
', $i, $i, $i);
protected $command = 'talents';
return true;
}
protected $dbcSourceFiles = ['talent', 'talenttab'];
public function generate(array $ids = []) : bool
{
// class: 0 => hunter pets
for ($i = 1; $i < 6; $i++)
DB::Aowow()->query('
REPLACE INTO
?_talents
SELECT
t.id,
IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0),
tt.creatureFamilyMask,
IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber),
t.row,
t.column,
t.rank?d,
?d
FROM
dbc_talenttab tt
JOIN
dbc_talent t ON tt.id = t.tabId
WHERE
t.rank?d <> 0
', $i, $i, $i);
return true;
}
});
?>