Beispiel #1
0
<?php

require_once __DIR__ . '/../DBC/db2/src/autoload.php';
use Erorus\DB2\Reader;
$manifest = new Reader(__DIR__ . '/../DBC/current/enUS/ManifestInterfaceData.db2');
$manifest->setFieldNames(['path', 'name']);
foreach ($manifest->generateRecords() as $record) {
    if (strtolower($record['path']) == 'interface\\icons\\' && strtolower(substr($record['name'], -4)) == '.blp') {
        echo $record['path'], $record['name'], "\n";
    }
}
Beispiel #2
0
    EchoProgress(false);
    unset($reader);
    $stmt = $db->prepare("insert ignore into tblDBCItemRandomSuffix (locale, suffix) (select distinct '{$locale}', name_{$locale} from tblDBCRandEnchants where trim(name_{$locale}) != '' and id < 0)");
    $stmt->execute();
    $stmt->close();
    LogLine("{$locale} tblDBCPet");
    $battlePetReader = new Reader($dirnm . '/BattlePetSpecies.db2');
    $battlePetReader->setFieldNames(['npc']);
    $creatureReader = new Reader($dirnm . '/Creature.db2');
    $creatureReader->setFieldNames([4 => 'name']);
    $stmt = $db->prepare("insert into tblDBCPet (id, name_{$locale}) values (?, ?) on duplicate key update name_{$locale} = values(name_{$locale})");
    $species = $name = null;
    $stmt->bind_param('is', $species, $name);
    $x = 0;
    $recordCount = count($battlePetReader->getIds());
    foreach ($battlePetReader->generateRecords() as $id => $rec) {
        EchoProgress(++$x / $recordCount);
        $species = $id;
        $creature = $creatureReader->getRecord($rec['npc']);
        if (is_null($creature)) {
            continue;
        }
        $name = $creature['name'];
        $stmt->execute();
    }
    $stmt->close();
    EchoProgress(false);
    unset($creatureReader);
    unset($battlePetReader);
    /* */
}