示例#1
0
  print_update('aowow_zones', $dbc, array(0=>"mapID", 1=>"areatableID"), array(2=>"name_loc$L"));
*/
/// Alternative version of zones extraction (based on Fog's file)
//$dbc = dbc2array_("AreaTable.dbc", L("nxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxx"));
//print_update('aowow_zones', $dbc, array(0=>"areatableID"), array(1=>"name_loc$L"));
//$dbc = dbc2array_("Map.dbc", L("nxixSxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
//print_update('aowow_zones', $dbc, array(0=>"mapID", 3=>"areatableID"), array(2=>"name_loc$L"));
/// debug check for collisions in Fog's version (shows >20 collisions)
//$dbc = dbc2array_("AreaTable.dbc", L("nxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxx"));
//$mapnames = array();
//foreach ($dbc as $row) $mapnames[$row[0]] = $row[1];
//$dbc = dbc2array_("Map.dbc", L("nxixSxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
//foreach ($dbc as $row)
//  if (isset($mapnames[$row[3]]) && $mapnames[$row[3]] != $row[2])
//    echo "Collision: '", $row[2], "' (", $row[0], ",", $row[3], ") != '", $mapnames[$row[3]], "'\n";
//unset($mapnames);
/// Last version, the most simple one
$dbc = dbc2array_("AreaTable.dbc", L("nxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxx"));
print_update('aowow_zones', $dbc, array(0 => "areatableID"), array(1 => "name_loc{$L}"));
$dbc = dbc2array_("Faction.dbc", L("nxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxx"));
print_update('aowow_factions', $dbc, array(0 => "factionID"), array(1 => "name_loc{$L}", 2 => "description1_loc{$L}"));
$dbc = dbc2array_("SpellItemEnchantment.dbc", L("nxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxx"));
print_update('aowow_itemenchantmet', $dbc, array(0 => "itemenchantmetID"), array(1 => "text_loc{$L}"));
// 3.1.3.new: nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// 3.2.2a:    nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// 3.3.2:     nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// 3.3.3a:    nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$dbc = dbc2array_("Spell.dbc", L("nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
print_update('aowow_spell', $dbc, array(0 => "spellID"), array(1 => "spellname_loc{$L}", 2 => "rank_loc{$L}", 3 => "tooltip_loc{$L}", 4 => "buff_loc{$L}"));
$dbc = dbc2array_("TalentTab.dbc", L("nSxxxxxxxxxxxxxxxxxxxxxx"));
print_update('aowow_talenttab', $dbc, array(0 => "id"), array(1 => "name_loc{$L}"));
示例#2
0
    echo $message;
    @ob_flush();
    flush();
    @ob_end_flush();
}
status("Reading subzones list...");
$dbc = dbc2array_("WorldMapOverlay.dbc", "nixxxxxxsiiiixxxx");
$wmo = array();
foreach ($dbc as $row) {
    if ($row[2]) {
        $wmo[$row[1]][] = array("name" => strtolower($row[2]), "width" => $row[3], "height" => $row[4], "left" => $row[5], "top" => $row[6]);
    }
}
status(count($dbc) . "\n");
status("Reading zones list...");
$dbc = dbc2array_("WorldMapArea.dbc", "nxisxxxxxxx");
status(count($dbc) . "\n");
$count = 0;
foreach ($dbc as $row) {
    $count++;
    if ($row[1]) {
        $zid = $row[0];
        $mapid = $row[1];
        $mapname = $row[2];
        status($mapname . "[" . $mapid . "]");
        $mapname = strtolower($mapname);
        $map = imagecreatetruecolor(1024, 768);
        $mapfg = imagecreatetruecolor(1024, 768);
        imagesavealpha($mapfg, true);
        imagealphablending($mapfg, false);
        $bgcolor = imagecolorallocatealpha($mapfg, 0, 0, 0, 127);
-- SkillLine.dbc
DROP TABLE IF EXISTS `freedomhead_skill`;
CREATE TABLE `freedomhead_skill` (
  `skillID` mediumint(11) unsigned NOT NULL,
  `categoryID` mediumint(11) NOT NULL,
  `name_loc0` varchar(255) NOT NULL,
  PRIMARY KEY  (`skillID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;

<?php 
$dbc = dbc2array_("SkillLine.dbc", "nixsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
print_insert('INSERT INTO `freedomhead_skill` VALUES', $dbc);
示例#4
0
}
$dbc_tmp = dbc2array_("AreaTable.dbc", "niixxxxxxxxsxxxxxxxxxxxxxxxxxxxxxxxx");
foreach ($dbc_tmp as $row) {
    $type = 0;
    if (isset($maptype[$row[1]])) {
        $type = $maptype[$row[1]];
    }
    if (isset($areatype[$row[1] . "@" . $row[0]])) {
        $type = $areatype[$row[1] . "@" . $row[0]];
    }
    $dbc[$row[0]] = array($row[1], $row[0], $row[3], 0, 0, 0, 0, $type, $row[2]);
}
// Update data with coords, where available
// 3.1.3.new: xiisffffxx
// 3.2.2a:    xiisffffxxx
$dbc_tmp = dbc2array_("WorldMapArea.dbc", "xiisffffxxx");
foreach ($dbc_tmp as $row) {
    if (isset($dbc[$row[1]])) {
        $dbc[$row[1]][3] = $row[5] < $row[6] ? $row[5] : $row[6];
        // x_min
        $dbc[$row[1]][4] = $row[3] < $row[4] ? $row[3] : $row[4];
        // y_min
        $dbc[$row[1]][5] = $row[5] < $row[6] ? $row[6] : $row[5];
        // x_max
        $dbc[$row[1]][6] = $row[3] < $row[4] ? $row[4] : $row[3];
        // y_max
    }
}
unset($dbc_tmp);
print_insert('INSERT INTO `aowow_zones` VALUES', $dbc);
// TODO: Get duplicates from Map.dbc automatically. Currently they are:
示例#5
0
function process($dbcfile, $dbcfmt)
{
    global $mpqdir, $largedir, $mediumdir, $smalldir, $tinydir;
    status("Reading icons list from {$dbcfile}...");
    $dbc = dbc2array_($dbcfile, $dbcfmt);
    $count = count($dbc);
    status($count . " icons found\n");
    $current = 0;
    $status = array();
    $lastfile = array();
    foreach ($dbc as $row) {
        $srcfilename = strtolower(str_replace("\\", "/", $row[1]));
        if (strpos($srcfilename, "/") === FALSE) {
            $srcfilename = "interface/icons/" . $srcfilename;
        }
        $src = $mpqdir . $srcfilename . ".blp";
        $stat_src = @stat($src);
        if ($row[1] == "") {
            echo " ";
        } else {
            if ($stat_src == NULL || $stat_src['size'] == 0) {
                $msg = "Not found";
                $status[$msg] = isset($status[$msg]) ? $status[$msg] + 1 : 1;
                $lastfile[$msg][] = $src;
                echo "-";
            } else {
                $dstfilename = strtolower(substr(strrchr($srcfilename, "/"), 1));
                $stat_dst = @stat($largedir . $dstfilename . ".jpg");
                if ($stat_dst != NULL && $stat_dst['mtime'] >= $stat_src['mtime']) {
                    $msg = "Already up-to-date";
                    $status[$msg] = isset($status[$msg]) ? $status[$msg] + 1 : 1;
                    //$lastfile[$msg][] = $src;
                    $lastfile[$msg][0] = "...";
                    $lastfile[$msg][1] = $src;
                    echo ".";
                } else {
                    $img = imagecreatefromblp($src);
                    resave($largedir . $dstfilename . ".jpg", $img, 56, 56);
                    resave($mediumdir . $dstfilename . ".jpg", $img, 36, 36);
                    resave($smalldir . $dstfilename . ".jpg", $img, 18, 18);
                    resave($tinydir . $dstfilename . ".gif", $img, 15, 15);
                    echo "+";
                }
            }
        }
        $current++;
        if ($current % 60 == 0) {
            status(" " . $current . "/" . $count . " (" . round(100 * $current / $count) . "%)\n");
        }
    }
    if ($current % 60 != 0) {
        status(" " . $current . "/" . $count . " (100%)\n");
    }
    echo "Done\n";
    if (count($status) > 0) {
        echo "Status:\n";
        foreach ($status as $s => $row) {
            echo "  " . $s . ": " . $row . "\n";
            //        foreach ($lastfile[$s] as $file)
            //          echo "    $file\n";
        }
    }
}