- removed tooltip buffer from TypeClasses (only used by setup and caused bugs with the localization to boot)

- fixed broken dataset-scripts
- removed base-info.php wich wasn't really a dataset-script
This commit is contained in:
Sarjuuk
2014-09-01 23:51:30 +02:00
parent 0ab0cf133e
commit 96056161bd
21 changed files with 278 additions and 324 deletions

View File

@@ -12,7 +12,6 @@ class AchievementList extends BaseType
public static $brickFile = 'achievement';
public $criteria = [];
public $tooltip = [];
protected $queryBase = 'SELECT `a`.*, `ar`.*, `lar`.*, `a`.`id` AS ARRAY_KEY FROM ?_achievement a';
protected $queryOpts = array(
@@ -116,9 +115,6 @@ class AchievementList extends BaseType
public function renderTooltip()
{
if (isset($this->tooltip[$this->id]))
return $this->tooltip[$this->id];
$criteria = $this->getCriteria();
$tmp = [];
$rows = [];
@@ -209,10 +205,7 @@ class AchievementList extends BaseType
if ($description || $criteria)
$x .= '</td></tr></table>';
// Completed
$this->tooltip[$this->id] = $x;
return $this->tooltip[$this->id];
return $x;
}
public function getSourceData()

View File

@@ -294,7 +294,11 @@ abstract class BaseType
public function getEntry($id)
{
if (isset($this->templates[$id]))
{
$this->curTpl = $this->templates[$id];
$this->id = $id;
return $this->templates[$id];
}
return null;
}

View File

@@ -8,13 +8,11 @@ class CreatureList extends BaseType
{
use spawnHelper;
public static $type = TYPE_NPC;
public static $brickFile = 'creature';
public static $type = TYPE_NPC;
public static $brickFile = 'creature';
public $tooltips = [];
protected $queryBase = 'SELECT ct.*, ct.id AS ARRAY_KEY FROM ?_creature ct';
public $queryOpts = array(
protected $queryBase = 'SELECT ct.*, ct.id AS ARRAY_KEY FROM ?_creature ct';
public $queryOpts = array(
'ct' => [['ft', 'clsMin', 'clsMax', 'qse']],
'ft' => ['j' => '?_factiontemplate ft ON ft.id = ct.faction', 's' => ', ft.A, ft.H, ft.factionId'],
'clsMin' => ['j' => 'creature_classlevelstats clsMin ON ct.unitClass = clsMin.class AND ct.minLevel = clsMin.level', 's' => ', clsMin.attackpower AS mleAtkPwrMin, clsMin.rangedattackpower AS rngAtkPwrMin, clsMin.baseArmor * ct.armorMod AS armorMin, (CASE ct.exp WHEN 0 THEN clsMin.damage_base WHEN 1 THEN clsMin.damage_exp1 ELSE clsMin.damage_exp2 END) * ct.dmgMultiplier AS dmgMin, (CASE ct.exp WHEN 0 THEN clsMin.basehp0 WHEN 1 THEN clsMin.basehp1 ELSE clsMin.basehp2 END) * ct.healthMod AS healthMin, clsMin.baseMana * ct.manaMod AS manaMin'],
@@ -47,9 +45,6 @@ class CreatureList extends BaseType
if (!$this->curTpl)
return null;
if (isset($this->tooltips[$this->id]))
return $this->tooltips[$this->id];
$level = '??';
$type = $this->curTpl['type'];
$row3 = [Lang::$game['level']];
@@ -88,8 +83,6 @@ class CreatureList extends BaseType
$x .= '</table>';
$this->tooltips[$this->id] = $x;
return $x;
}

View File

@@ -8,11 +8,11 @@ class GameObjectList extends BaseType
{
use listviewHelper, spawnHelper;
public static $type = TYPE_OBJECT;
public static $brickFile = 'object';
public static $type = TYPE_OBJECT;
public static $brickFile = 'object';
protected $queryBase = 'SELECT o.*, o.id AS ARRAY_KEY FROM ?_objects o';
protected $queryOpts = array(
protected $queryBase = 'SELECT o.*, o.id AS ARRAY_KEY FROM ?_objects o';
protected $queryOpts = array(
'o' => [['ft', 'qse']],
'ft' => ['j' => ['?_factiontemplate ft ON ft.id = o.faction', true], 's' => ', ft.factionId, ft.A, ft.H'],
'qse' => ['j' => ['?_quests_startend qse ON qse.type = 2 AND qse.typeId = o.id', true], 's' => ', IF(min(qse.method) = 1 OR max(qse.method) = 3, 1, 0) AS startsQuests, IF(min(qse.method) = 2 OR max(qse.method) = 3, 1, 0) AS endsQuests', 'g' => 'o.id'],
@@ -100,9 +100,6 @@ class GameObjectList extends BaseType
if (!$this->curTpl)
return array();
if (isset($this->tooltips[$this->id]))
return $this->tooltips[$this->id];
$x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';
if ($_ = @Lang::$gameObject['type'][$this->curTpl['typeCat']])
@@ -115,9 +112,7 @@ class GameObjectList extends BaseType
$x .= '</table>';
$this->tooltips[$this->id] = $x;
return $this->tooltips[$this->id];
return $x;
}
public function getJSGlobals($addMask = 0)

View File

@@ -11,7 +11,6 @@ class ItemList extends BaseType
public static $type = TYPE_ITEM;
public static $brickFile = 'item';
public $tooltip = [];
public $json = [];
public $itemMods = [];
@@ -407,9 +406,6 @@ class ItemList extends BaseType
if ($this->error)
return;
if (!empty($this->tooltip[$this->id]))
return $this->tooltip[$this->id];
$_name = $this->getField('name', true);
$_reqLvl = $this->curTpl['requiredLevel'];
$_quality = $this->curTpl['quality'];
@@ -1035,9 +1031,7 @@ class ItemList extends BaseType
$x .= '<!--?'.implode(':', $link).'-->';
}
$this->tooltip[$this->id] = $x;
return $this->tooltip[$this->id];
return $x;
}
// from Trinity
@@ -1122,14 +1116,13 @@ class ItemList extends BaseType
$this->itemMods[$this->id] = [];
foreach (Util::$itemMods as $mod)
if (!empty($this->curTpl[$mod]))
@$this->itemMods[$this->id][$mod] += $this->curTpl[$mod];
if (isset($this->curTpl[$mod]) && ($_ = floatVal($this->curTpl[$mod])))
@$this->itemMods[$this->id][$mod] += $_;
// fetch and add socketbonusstats
if (@$this->json[$this->id]['socketbonus'] > 0)
$enchantments[$this->json[$this->id]['socketbonus']][] = $this->id;
// Item is a gem (don't mix with sockets)
if ($geId = $this->curTpl['gemEnchantmentId'])
$enchantments[$geId][] = -$this->id;

View File

@@ -9,11 +9,11 @@ if (!defined('AOWOW_REVISION'))
// class ArenaTeamList extends BaseType
class ProfileList extends BaseType
{
public static $type = 0; // profiles dont actually have one
public static $brickFile = 'profile';
public static $type = 0; // profiles dont actually have one
public static $brickFile = 'profile';
protected $queryBase = ''; // SELECT p.*, p.id AS ARRAY_KEY FROM ?_profiles p';
protected $queryOpts = array(
protected $queryBase = ''; // SELECT p.*, p.id AS ARRAY_KEY FROM ?_profiles p';
protected $queryOpts = array(
'p' => [['pa', 'pg']],
'pam' => [['?_profiles_arenateam_member pam ON pam.memberId = p.id', true], 's' => ', pam.status'],
'pa' => ['?_profiles_arenateam pa ON pa.id = pam.teamId', 's' => ', pa.mode, pa.name'],
@@ -149,9 +149,6 @@ class ProfileList extends BaseType
if (!$this->curTpl)
return [];
if (isset($this->tooltips[$this->id]))
return $this->tooltips[$this->id];
$x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name').'</b></td></tr>';
if ($g = $this->getField('name'))
@@ -161,9 +158,7 @@ class ProfileList extends BaseType
$x .= '<tr><td>'.Lang::$game['level'].' '.$this->getField('level').' '.Lang::$game['ra'][$this->curTpl['race']].' '.Lang::$game['cl'][$this->curTpl['classs']].'</td></tr>';
$x .= '</table>';
$this->tooltips[$this->id] = $x;
return $this->tooltips[$this->id];
return $x;
}
public function getJSGlobals($addMask = 0) {}

View File

@@ -273,9 +273,6 @@ class QuestList extends BaseType
if (!$this->curTpl)
return null;
if (isset($this->tooltips[$this->id]))
return $this->tooltips[$this->id];
$title = Util::jsEscape($this->getField('name', true));
$level = $this->curTpl['level'];
if ($level < 0)
@@ -339,8 +336,6 @@ class QuestList extends BaseType
$x .= '</td></tr></table>';
$this->tooltips[$this->id] = $x;
return $x;
}

View File

@@ -8,8 +8,6 @@ class SpellList extends BaseType
{
use listviewHelper;
public $tooltips = [];
public $buffs = [];
public $ranks = [];
public $relItems = null;
public $sources = [];
@@ -1438,9 +1436,6 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
if (!$this->curTpl)
return array();
if (isset($this->buffs[$this->id]))
return $this->buffs[$this->id];
// doesn't have a buff
if (!$this->getField('buff', true))
return array();
@@ -1473,9 +1468,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
// scaling information - spellId:min:max:curr
$x .= '<!--?'.$this->id.':1:'.($scaling ? MAX_LEVEL : 1).':'.$level.'-->';
$this->buffs[$this->id] = array($x, $btt[1]);
return $this->buffs[$this->id];
return array($x, $btt[1]);
}
public function renderTooltip($level = MAX_LEVEL, $interactive = false)
@@ -1483,9 +1476,6 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
if (!$this->curTpl)
return array();
if (isset($this->tooltips[$this->id]))
return $this->tooltips[$this->id];
$this->interactive = $interactive;
// fetch needed texts
@@ -1627,9 +1617,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
// scaling information - spellId:min:max:curr
$x .= '<!--?'.$this->id.':1:'.($scaling ? MAX_LEVEL : 1).':'.$level.'-->';
$this->tooltips[$this->id] = array($x, $desc ? $desc[1] : null);
return $this->tooltips[$this->id];
return array($x, $desc ? $desc[1] : null);
}
public function getTalentHeadForCurrent()

View File

@@ -83,7 +83,7 @@ class User
self::setLocale(intVal($query['locale'])); // reset, if changed
// stuff, that update on daily basis goes here (if you keep you session alive indefinitly, the signin-handler doesn't do very much)
// stuff, that updates on a daily basis goes here (if you keep you session alive indefinitly, the signin-handler doesn't do very much)
// - conscutive visits
// - votes per day
// - reputation for daily visit
@@ -228,7 +228,7 @@ class User
if (!DB::isConnectable(DB_AUTH))
return AUTH_INTERNAL_ERR;
$wow = DB::Auth()->selectRow('SELECT a.id, a.sha_pass_hash, ab.active AS hasBan FROM account a LEFT JOIN account_banned ab ON ab.id = a.id WHERE username = ? AND ORDER BY ab.active DESC LIMIT 1', $name);
$wow = DB::Auth()->selectRow('SELECT a.id, a.sha_pass_hash, ab.active AS hasBan FROM account a LEFT JOIN account_banned ab ON ab.id = a.id AND active <> 0 WHERE username = ? DESC LIMIT 1', $name);
if (!$wow)
return AUTH_WRONGUSER;
@@ -493,23 +493,20 @@ class User
public static function getCharacters()
{
// todo: do after profiler
@include('datasets/ProfilerExampleChar');
// existing chars on realm(s)
$characters = array(
array(
'id' => $character['id'],
'name' => $character['name'],
'realmname' => $character['realm'][1],
'region' => $character['region'][0],
'realm' => $character['realm'][0],
'race' => $character['race'],
'classs' => $character['classs'],
'level' => $character['level'],
'gender' => $character['gender'],
'pinned' => $character['pinned']
)
// array(
// 'id' => 22,
// 'name' => 'Example Char',
// 'realmname' => 'Example Realm',
// 'region' => 'eu',
// 'realm' => 'example-realm',
// 'race' => 6,
// 'classs' => 11,
// 'level' => 80,
// 'gender' => 1,
// 'pinned' => 1
// )
);
return $characters;
@@ -517,11 +514,10 @@ class User
public static function getProfiles()
{
// todo => do after profiler
// chars build in profiler
$profiles = array(
array('id' => 21, 'name' => 'Example Profile 1', 'race' => 4, 'classs' => 5, 'level' => 72, 'gender' => 1, 'icon' => 'inv_axe_04'),
array('id' => 23, 'name' => 'Example Profile 2', 'race' => 11, 'classs' => 3, 'level' => 17, 'gender' => 0)
// array('id' => 21, 'name' => 'Example Profile 1', 'race' => 4, 'classs' => 5, 'level' => 72, 'gender' => 1, 'icon' => 'inv_axe_04'),
// array('id' => 23, 'name' => 'Example Profile 2', 'race' => 11, 'classs' => 3, 'level' => 17, 'gender' => 0)
);
return $profiles;

View File

@@ -910,12 +910,11 @@ class ItemPage extends genericPage
if ($asError)
return '$WowheadPower.registerItem(\''.$itemString.'\', '.User::$localeId.', {})';
$this->subject->renderTooltip(false, 0, $this->enhancedTT);
$x = '$WowheadPower.registerItem(\''.$itemString.'\', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($this->subject->getField('name', true))."',\n";
$x .= "\tquality: ".$this->subject->getField('quality').",\n";
$x .= "\ticon: '".urlencode($this->subject->getField('iconString'))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->tooltip[$this->typeId])."'\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($this->subject->renderTooltip(false, 0, $this->enhancedTT))."'\n";
$x .= "});";
return $x;
@@ -967,7 +966,7 @@ class ItemPage extends genericPage
}
$xml->addChild('json')->addCData(substr($json, 1));
// jsonEquip missing: avgbuyout, cooldown
// jsonEquip missing: avgbuyout, cooldown, source, sourcemore
$json = '';
if ($_ = $this->subject->getField('sellPrice')) // sellprice
$json .= ',"sellprice":'.$_;

View File

@@ -1,53 +0,0 @@
<?php
/*
$clMasks = [];
$raMasks = [];
$tbl = DB::Aowow()->Select('SELECT * FROM dbc.CharBaseInfo');
foreach ($tbl as $data)
{
$cl = $data['class'];
$ra = $data['race'];
@$clMasks[$ra] |= (1 << ($cl - 1));
@$raMasks[$cl] |= (1 << ($ra - 1));
}
foreach ($clMasks as $ra => $msk)
DB::Aowow()->Query('UPDATE ?_races SET classmask = ?d WHERE Id = ?d', $msk, $ra);
foreach ($raMasks as $cl => $msk)
DB::Aowow()->Query('UPDATE ?_classes SET racemask = ?d WHERE Id = ?d', $msk, $cl);
DB::Aowow()->Query('UPDATE ?_races SET side = side + 1');
DB::Aowow()->Query('UPDATE ?_races SET side = 0 WHERE side = 3');
*/
// manually add infos about races
// leader, faction, startArea
$info = array(
null,
[29611, 72, 12],
[39605, 76, 14],
[2784, 47, 1],
[7999, 96, 141],
[10181, 68, 85],
[36648, 81, 215],
[7937, 54, 1],
[10540, 530, 14],
null,
[16802, 911, 3430],
[17468, 930, 3524]
);
foreach ($info as $id => $data)
if ($data)
DB::Aowow()->query(
'UPDATE ?_races SET leader = ?d, factionId = ?d, startAreaId = ?d WHERE Id = ?d',
$data[0],
$data[1],
$data[2],
$id
)
?>

View File

@@ -63,15 +63,22 @@ if (!defined('AOWOW_REVISION'))
if (!is_dir('datasets\\'.$dir))
mkdir('datasets\\'.$dir, 0755, true);
$enchIds = [];
foreach ($enchantSpells->iterate() as $__)
$enchIds[] = $enchantSpells->getField('effect1MiscValue');
$enchMisc = [];
$enchJSON = Util::parseItemEnchantment($enchIds, false, $enchMisc);
echo "script set up in ".Util::execTime()."<br>\n";
foreach ($locales as $lId)
{
set_time_limit(180);
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
$enchantsOut = [];
foreach ($enchantSpells->iterate() as $__)
{
// slots have to be recalculated
@@ -101,7 +108,6 @@ if (!defined('AOWOW_REVISION'))
}
$eId = $enchantSpells->getField('effect1MiscValue');
$jsonequip = Util::parseItemEnchantment($eId, false, $misc);
// defaults
$ench = array(
@@ -111,20 +117,20 @@ if (!defined('AOWOW_REVISION'))
'source' => [], // <0: item; >0:spell
'skill' => -1, // modified if skill
'slots' => [], // determined per spell but set per item
'enchantment' => $misc['name'],
'jsonequip' => $jsonequip,
'enchantment' => Util::localizedString($enchMisc[$eId]['text'], 'text'),
'jsonequip' => @$enchJSON[$eId] ?: [],
'temp' => 0, // always 0
'classes' => 0, // modified by item
);
if (isset($misc['reqskill']))
$ench['jsonequip']['reqskill'] = $misc['reqskill'];
if (isset($enchMisc[$eId]['reqskill']))
$ench['jsonequip']['reqskill'] = $enchMisc[$eId]['reqskill'];
if (isset($misc['reqskillrank']))
$ench['jsonequip']['reqskill'] = $misc['reqskillrank'];
if (isset($enchMisc[$eId]['reqskillrank']))
$ench['jsonequip']['reqskill'] = $enchMisc[$eId]['reqskillrank'];
if (isset($misc['requiredLevel']))
$ench['jsonequip']['requiredLevel'] = $misc['requiredLevel'];
if (isset($enchMisc[$eId]['requiredLevel']))
$ench['jsonequip']['requiredLevel'] = $enchMisc[$eId]['requiredLevel'];
// check if the spell has an entry in skill_line_ability -> Source:Profession
if ($skill = DB::Aowow()->SelectCell('SELECT skillLineId FROM dbc.skilllineability WHERE spellId = ?d', $enchantSpells->id))
@@ -196,17 +202,15 @@ if (!defined('AOWOW_REVISION'))
}
// walk over each entry and strip single-item arrays
foreach ($enchantsOut as $eId => $ench)
foreach ($enchantsOut as &$ench)
{
foreach ($ench as $k => $v)
if (is_array($v) && count($v) == 1 && $k != 'jsonequip')
$enchantsOut[$eId][$k] = $v[0];
$ench[$k] = $v[0];
}
ksort($enchantsOut);
$toFile = "var g_enchants = ";
$toFile .= json_encode($enchantsOut, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$toFile .= json_encode($enchantsOut, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$toFile .= ";";
$file = 'datasets\\'.User::$localeString.'\\enchants';
@@ -219,9 +223,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -26,22 +26,20 @@ if (!defined('AOWOW_REVISION'))
$gemQuery = "
SELECT
it.entry as itemId,
it.entry AS itemId,
it.name,
li.*,
IF (it.entry < 36000 OR it.ItemLevel < 70, 1 , 2) AS expansion,
(it.Quality) AS quality,
i.inventoryicon1 as icon,
ie.*,
gp.colorMask as colors
it.Quality AS quality,
i.inventoryicon1 AS icon,
gp.spellItemEnchantmentId AS enchId,
gp.colorMask AS colors
FROM
item_template it
LEFT JOIN
locales_item li ON li.entry = it.entry
JOIN
dbc.gemProperties gp ON gp.Id = it.GemProperties
JOIN
?_itemEnchantment ie ON gp.spellItemEnchantmentId = ie.Id
dbc.gemproperties gp ON gp.Id = it.GemProperties
JOIN
dbc.itemdisplayinfo i ON i.Id = it.displayid
WHERE
@@ -51,41 +49,44 @@ if (!defined('AOWOW_REVISION'))
;
";
$gems = Db::Aowow()->Select($gemQuery);
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
$jsonGems = [];
$gems = DB::Aowow()->Select($gemQuery);
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
// check directory-structure
foreach (Util::$localeStrings as $dir)
if (!is_dir('datasets\\'.$dir))
mkdir('datasets\\'.$dir, 0755, true);
$enchIds = [];
foreach ($gems as $pop)
$enchIds[] = $pop['enchId'];
$enchMisc = [];
$enchJSON = Util::parseItemEnchantment($enchIds, false, $enchMisc);
echo "script set up in ".Util::execTime()."<br>\n";
foreach ($locales as $lId)
{
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
$gemsOut = [];
foreach ($gems as $pop)
{
// costy and locale-independant -> cache
if (!isset($jsonGems[$pop['itemId']]))
$jsonGems[$pop['itemId']] = Util::parseItemEnchantment($pop);
$gemsOut[$pop['itemId']] = array(
'name' => Util::localizedString($pop, 'name'),
'quality' => $pop['quality'],
'icon' => strToLower($pop['icon']),
'enchantment' => Util::localizedString($pop, 'text'),
'jsonequip' => $jsonGems[$pop['itemId']],
'enchantment' => Util::localizedString(@$enchMisc[$pop['enchId']]['text'] ?: [], 'text'),
'jsonequip' => @$enchJSON[$pop['enchId']] ?: [],
'colors' => $pop['colors'],
'expansion' => $pop['expansion']
);
}
$toFile = "var g_gems = ";
$toFile .= json_encode($gemsOut, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$toFile .= json_encode($gemsOut, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$toFile .= ";";
$file = 'datasets\\'.User::$localeString.'\\gems';
@@ -98,9 +99,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -22,38 +22,31 @@ if (!defined('AOWOW_REVISION'))
$queryGlyphs = '
SELECT
i.entry as itemId,
i.name,
li.*,
IF (g.typeFlags & 0x1, 2, 1) as type,
i.subclass as classs,
i.requiredLevel as level,
s1.Id as glyphSpell,
s1.iconStringAlt as icon,
s1.skillLine1 as skillId,
s2.Id as glyphEffect,
s2.Id as ARRAY_KEY
i.id AS itemId,
i.*,
IF (g.typeFlags & 0x1, 2, 1) AS type,
i.subclass AS classs,
i.requiredLevel AS level,
s1.Id AS glyphSpell,
s1.iconStringAlt AS icon,
s1.skillLine1 AS skillId,
s2.Id AS glyphEffect,
s2.Id AS ARRAY_KEY
FROM
item_template i
LEFT JOIN
locales_item li ON
i.entry = li.entry
LEFT JOIN
?_spell s1 ON
s1.Id = i.spellid_1
LEFT JOIN
?_glyphproperties g ON
g.Id = s1.effect1MiscValue
LEFT JOIN
?_spell s2 ON
s2.Id = g.spellId
?_items i
JOIN
?_spell s1 ON s1.Id = i.spellid1
JOIN
?_glyphproperties g ON g.Id = s1.effect1MiscValue
JOIN
?_spell s2 ON s2.Id = g.spellId
WHERE
i.class = 16
i.classBak = 16
;
';
$glyphList = DB::Aowow()->Select($queryGlyphs);
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
$glyphList = DB::Aowow()->Select($queryGlyphs);
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
// check directory-structure
foreach (Util::$localeStrings as $dir)
@@ -62,11 +55,12 @@ if (!defined('AOWOW_REVISION'))
echo "script set up in ".Util::execTime()."<br>\n";
$glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)], 0));
$glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)], CFG_SQL_LIMIT_NONE));
foreach ($locales as $lId)
{
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
$glyphsOut = [];
foreach ($glyphSpells->iterate() as $__)
@@ -104,9 +98,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -4,7 +4,7 @@ if (!defined('AOWOW_REVISION'))
die('illegal access');
// Create 'itemsets'-file for available locales (and should probably order the itemests_dbc-table too (see below))
// Create 'itemsets'-file for available locales
// this script requires the following dbc-files to be parsed and available
// GlyphProperties, Spells, SkillLineAbility
@@ -29,32 +29,6 @@ if (!defined('AOWOW_REVISION'))
},
*/
/* Todo:
well .. strictly spoken this script is bogus. All data has to be assembled beforehand either by hand or by querying wowhead
we would need this script to prevent this type-fest and do it propperly ourselves.. *dang*
probably like this:
virtualId = 0
get itemsetIds ordered ascending
foreach itemsetId
lookup pieces
sort pieces by slot
if slots conflict
group items by ItemLevel ordered ascending
assign: first group => regularId
assign: other groups => --virtualId
end if
end foreach
this will probably screw the order of your set-pieces and will not result in the same virtualIds like wowhead, but
they are years beyond our content anyway, so what gives...
lets assume, you've done something like that, so ...
... onwards!
*/
$setList = DB::Aowow()->Select('SELECT * FROM ?_itemset ORDER BY refSetId DESC');
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
$jsonBonus = [];
@@ -69,11 +43,13 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $lId)
{
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
$itemsetOut = [];
foreach ($setList as $set)
{
set_time_limit(15);
$setOut = array(
'id' => $set['id'],
'name' => (7 - $set['quality']).Util::jsEscape(Util::localizedString($set, 'name')),
@@ -112,18 +88,13 @@ if (!defined('AOWOW_REVISION'))
// costy and locale-independant -> cache
if (!isset($jsonBonus[$set['spell'.$i]]))
{
$bSpell = new SpellList(array(['s.id', $set['spell'.$i]]));
$jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain()[$set['spell'.$i]];
}
$jsonBonus[$set['spell'.$i]] = (new SpellList(array(['s.id', (int)$set['spell'.$i]])))->getStatGain()[$set['spell'.$i]];
if (isset($setOut['setbonus'][$set['bonus'.$i]]))
{
if (!isset($setOut['setbonus'][$set['bonus'.$i]]))
$setOut['setbonus'][$set['bonus'.$i]] = $jsonBonus[$set['spell'.$i]];
else
foreach ($jsonBonus[$set['spell'.$i]] as $k => $v)
@$setOut['setbonus'][$set['bonus'.$i]][$k] += $v;
}
else
$setOut['setbonus'][$set['bonus'.$i]] = $jsonBonus[$set['spell'.$i]];
}
foreach ($setOut['setbonus'] as $k => $v)
@@ -150,7 +121,7 @@ if (!defined('AOWOW_REVISION'))
}
$toFile = "var g_itemsets = ";
$toFile .= json_encode($itemsetOut, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$toFile .= json_encode($itemsetOut, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$toFile .= ";";
$file = 'datasets\\'.User::$localeString.'\\itemsets';
@@ -163,9 +134,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -33,28 +33,28 @@ if (!defined('AOWOW_REVISION'))
$petQuery = '
SELECT
ct.entry as id,
ct.entry AS id,
ct.name,
lc.*,
ct.minlevel,
ct.maxlevel,
CONCAT("[", ft.A, ", ", ft.H, "]") as react,
ct.rank as classification,
CONCAT("[", ft.A, ", ", ft.H, "]") AS react,
ct.rank AS classification,
ct.family,
ct.modelId1 as displayId,
cdi.skin1 as skin,
SUBSTRING_INDEX(cf.iconFile, "\\\\", -1) as icon,
cf.petTalentType as type
ct.modelId1 AS displayId,
cdi.skin1 AS skin,
SUBSTRING_INDEX(cf.iconFile, "\\\\", -1) AS icon,
cf.petTalentType AS type
FROM
world.creature_template ct
creature_template ct
JOIN
?_factiontemplate ft ON
ft.Id = ct.faction -- no beast has different faction set for Horde
ft.Id = ct.faction
JOIN
dbc.creaturefamily cf ON
cf.Id = ct.family
LEFT JOIN
world.locales_creature lc ON
locales_creature lc ON
lc.entry = ct.entry
JOIN
dbc.creaturedisplayinfo cdi ON
@@ -68,9 +68,9 @@ if (!defined('AOWOW_REVISION'))
$queryZones = '
SELECT DISTINCT
z.id AS location
z.id
FROM
world.creature c
creature c
JOIN
?_zones z ON
z.xMin < c.position_x AND
@@ -84,9 +84,9 @@ if (!defined('AOWOW_REVISION'))
$queryInstanceZone = '
SELECT DISTINCT
z.id AS location
z.id
FROM
world.creature c,
creature c,
?_zones z
WHERE
z.mapId = c.map AND
@@ -107,9 +107,9 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $lId)
{
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
$petsOut = [];
foreach ($petList as $pet)
{
// get locations
@@ -124,7 +124,7 @@ if (!defined('AOWOW_REVISION'))
$locations[$pet['id']][] = $z;
}
$pet = array(
$petsOut[$pet['id']] = array(
'id' => $pet['id'],
'name' => Util::localizedString($pet, 'name'),
'minlevel' => $pet['minlevel'],
@@ -138,12 +138,10 @@ if (!defined('AOWOW_REVISION'))
'icon' => $pet['icon'],
'type' => $pet['type']
);
$petsOut[$pet['id']] = $pet;
}
$toFile = "var g_pets = ";
$toFile .= json_encode($petsOut, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$toFile .= json_encode($petsOut, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$toFile .= ";";
$file = 'datasets\\'.User::$localeString.'\\pets';
@@ -156,9 +154,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -40,18 +40,21 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
set_time_limit(20);
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-quests', "w");
if (!$handle)
die('could not create quests file '.$l);
$buff = "var _ = g_gatheredcurrencies;\n";
foreach($relCurr->getListviewData() as $id => $data)
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
$buff .= "\n\nvar _ = g_quests;\n";
foreach($questz->getListviewData() as $id => $data)
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
$buff .= "\ng_quest_catorder = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n";
@@ -68,6 +71,8 @@ if (!defined('AOWOW_REVISION'))
/* Achievements */
/****************/
{
set_time_limit(10);
$cnd = array(
CFG_SQL_LIMIT_NONE,
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
@@ -77,6 +82,7 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-achievements', "w");
if (!$handle)
die('could not create achievements file '.$l);
@@ -86,7 +92,7 @@ if (!defined('AOWOW_REVISION'))
foreach ($achievez->getListviewData(ACHIEVEMENTINFO_PROFILE) as $id => $data)
{
$sumPoints += $data['points'];
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
}
// categories to sort by
@@ -107,6 +113,8 @@ if (!defined('AOWOW_REVISION'))
/* Titles */
/**********/
{
set_time_limit(10);
$cnd = array(
CFG_SQL_LIMIT_NONE,
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
@@ -117,6 +125,7 @@ if (!defined('AOWOW_REVISION'))
foreach ([0, 1] as $g) // gender
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-titles-'.$g, "w");
if (!$handle)
die('could not create titles file '.$l.' '.$g);
@@ -126,7 +135,7 @@ if (!defined('AOWOW_REVISION'))
{
$data['name'] = Util::localizedString($titlez->getEntry($id), $g ? 'female' : 'male');
unset($data['namefemale']);
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
}
fWrite($handle, $buff);
fClose($handle);
@@ -142,6 +151,8 @@ if (!defined('AOWOW_REVISION'))
/* Mounts */
/**********/
{
set_time_limit(10);
$cnd = array(
CFG_SQL_LIMIT_NONE,
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
@@ -151,13 +162,18 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-mounts', "w");
if (!$handle)
die('could not create mounts file '.$l);
$buff = "var _ = g_spells;\n";
foreach ($mountz->getListviewData(ITEMINFO_MODEL) as $id => $data)
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
{
$data['quality'] = $data['name'][0];
$data['name'] = substr($data['name'], 1);
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
}
fWrite($handle, $buff);
fClose($handle);
@@ -172,6 +188,8 @@ if (!defined('AOWOW_REVISION'))
/* Companions */
/**************/
{
set_time_limit(10);
$cnd = array(
CFG_SQL_LIMIT_NONE,
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
@@ -181,13 +199,18 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-companions', "w");
if (!$handle)
die('could not create companions file '.$l);
$buff = "var _ = g_spells;\n";
foreach ($companionz->getListviewData(ITEMINFO_MODEL) as $id => $data)
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
{
$data['quality'] = $data['name'][0];
$data['name'] = substr($data['name'], 1);
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
}
fWrite($handle, $buff);
fClose($handle);
@@ -202,6 +225,8 @@ if (!defined('AOWOW_REVISION'))
/* Factions */
/************/
{
set_time_limit(10);
// todo (med): exclude non-gaining reputation-header
$cnd = array(
CFG_SQL_LIMIT_NONE,
@@ -211,13 +236,14 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$handle = fOpen('datasets\\'.User::$localeString.'\\p-factions', "w");
if (!$handle)
die('could not create factions file '.$l);
$buff = "var _ = g_factions;\n";
foreach ($factionz->getListviewData() as $id => $data)
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
$buff .= "\ng_faction_order = [0, 469, 891, 1037, 1118, 67, 1052, 892, 936, 1117, 169, 980, 1097];\n";
@@ -245,6 +271,8 @@ if (!defined('AOWOW_REVISION'))
);
foreach ($skills as $s)
{
set_time_limit(20);
$file = is_array($s) ? 'sec' : (string)$s;
$cnd = array_merge($baseCnd, [['skillLine1', $s]]);
$recipez = new SpellList($cnd);
@@ -261,13 +289,11 @@ if (!defined('AOWOW_REVISION'))
foreach ($locales as $l)
{
User::useLocale($l);
Lang::load(Util::$localeStrings[$l]);
$buff = '';
foreach ($recipez->getListviewData() as $id => $data)
{
$data['name'] = $data['quality'].$data['name'];
unset($data['quality']);
$buff .= '_['.$id.'] = '.json_encode($data, JSON_NUMERIC_CHECK).";\n";
}
$buff .= '_['.$id.'] = '.json_encode($data, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).";\n";
if (!$buff)
{
echo " - file: ".$file." has no content => skipping<br>\n";
@@ -293,8 +319,10 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\n";
}
User::useLocale(LOCALE_EN);
echo "<br>\nall done";
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

View File

@@ -86,7 +86,7 @@ if (!defined('AOWOW_REVISION'))
$offset = [20, 20, 20, 20, 20];
$rows = DB::Aowow()->select('SELECT pls.level AS ARRAY_KEY, str-?d, agi-?d, sta-?d, inte-?d, spi-?d, basehp, IF(basemana <> 0, basemana, 100), mlecrt.chance*100, splcrt.chance*100, mlecrt.chance*100 * ?f, baseHP5.ratio*1, extraHP5.ratio*1 ' .
'FROM world.player_levelstats pls JOIN world.player_classlevelstats pcls ON pls.level = pcls.level AND pls.class = pcls.class JOIN' .
'FROM player_levelstats pls JOIN player_classlevelstats pcls ON pls.level = pcls.level AND pls.class = pcls.class JOIN' .
' dbc.gtchancetomeleecrit mlecrt ON mlecrt.idx = ((pls.class - 1) * 100) + (pls.level - 1) JOIN' .
' dbc.gtchancetospellcrit splcrt ON splcrt.idx = ((pls.class - 1) * 100) + (pls.level - 1) JOIN' .
' dbc.gtoctregenhp baseHP5 ON baseHP5.idx = ((pls.class - 1) * 100) + (pls.level - 1) JOIN' .

View File

@@ -9,30 +9,16 @@ if (!defined('AOWOW_REVISION'))
// this script requires the following dbc-files to be parsed and available
// Talent, TalentTab, Spell
$query = '
SELECT
s.iconString
FROM
?_spell s
JOIN
dbc.talent t On
t.rank1 = s.Id
JOIN
dbc.talenttab tt ON
tt.Id = t.tabId
WHERE
tt.?# = ?d AND
tt.tabNumber = ?d
ORDER BY
t.row, t.column, t.petCategory1 ASC ;
';
$query = 'SELECT s.iconString FROM ?_spell s JOIN dbc.talent t ON t.rank1 = s.Id JOIN dbc.talenttab tt ON tt.Id = t.tabId WHERE tt.?# = ?d AND tt.tabNumber = ?d ORDER BY t.row, t.column, t.petCategory1 ASC;';
$dims = 36; //v-pets
$filenames = ['icons', 'warrior', 'paladin', 'hunter', 'rogue', 'priest', 'deathknight', 'shaman', 'mage', 'warlock', null, 'druid'];
// create directory if missing
if (!is_dir('images\\talent\\classes\\icons'))
mkdir('images\\talent\\classes\\icons', 0755, true);
if (!is_dir('static\\images\\wow\\talents\\icons'))
mkdir('static\\images\\wow\\talents\\icons', 0755, true);
if (!is_dir('static\\images\\wow\\hunterpettalents'))
mkdir('static\\images\\wow\\hunterpettalents', 0755, true);
echo "script set up in ".Util::execTime()."<br>\n";
@@ -41,12 +27,14 @@ if (!defined('AOWOW_REVISION'))
if (!$v)
continue;
set_time_limit(10);
for ($tree = 0; $tree < 3; $tree++)
{
$what = $k ? 'classMask' : 'creatureFamilyMask';
$set = $k ? 1 << ($k - 1) : 1 << $tree;
$subset = $k ? $tree : 0;
$path = $k ? 'classes\\icons' : 'pets';
$path = $k ? 'talents\\icons' : 'hunterpettalents';
$icons = DB::Aowow()->SelectCol($query, $what, $set, $subset);
@@ -57,7 +45,7 @@ if (!defined('AOWOW_REVISION'))
for($i = 0; $i < count($icons); $i++)
{
$im = @imagecreatefromjpeg('images\\icons\\medium\\'.$icons[$i].'.jpg');
$im = @imagecreatefromjpeg('static\\images\\wow\\icons\\medium\\'.$icons[$i].'.jpg');
if(!$im)
die('error: raw image '.$icons[$i]. ' not found');
@@ -71,12 +59,12 @@ if (!defined('AOWOW_REVISION'))
for ($j = 0; $j < imagecolorstotal($im); $j++)
{
$color = imagecolorsforindex($im, $j);
$gray = round(0.299 * $color['red'] + 0.587 * $color['green'] + 0.114 * $color['blue']);
$gray = round(0.299 * $color['red'] + 0.587 * $color['green'] + 0.114 * $color['blue']);
imagecolorset($im, $j, $gray, $gray, $gray);
}
imagecopymerge($res, $im, $i * $dims, $dims, 0, 0, imageSX($im), imageSY($im), 100);
if (!@imagejpeg($res, 'images\\talent\\'.$path.'\\'.$v.'_'.($tree + 1).'.jpg'))
if (@!imagejpeg($res, 'static\\images\\wow\\'.$path.'\\'.$v.'_'.($tree + 1).'.jpg'))
die('error: '.$v.'_'.($tree + 1).'.jpg could not be written!');
}
}
@@ -86,8 +74,6 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);

View File

@@ -25,9 +25,8 @@ if (!defined('AOWOW_REVISION'))
// t - array of talent-objects
// f - array:int [pets only] creatureFamilies in that category
function buildTree($class)
$buildTree = function ($class) use (&$petFamIcons, &$tSpells)
{
global $petFamIcons; // h8!
$petCategories = [];
$mask = $class ? 1 << ($class - 1) : 0;
@@ -116,12 +115,14 @@ if (!defined('AOWOW_REVISION'))
for ($k = 0; $k <= ($m - 1); $k++)
{
$tSpell = new SpellList(array(['s.id', (int)$talents[$j]['rank'.($k + 1)]]));
$d[] = $tSpell->parseText()[0];
if (!$tSpells->getEntry($talents[$j]['rank'.($k + 1)]))
continue;
$d[] = $tSpells->parseText()[0];
$s[] = $talents[$j]['rank'.($k + 1)];
if ($talents[$j]['talentSpell'])
$t[] = $tSpell->getTalentHeadForCurrent();
$t[] = $tSpells->getTalentHeadForCurrent();
}
if ($talents[$j]['reqTalent'])
@@ -130,7 +131,7 @@ if (!defined('AOWOW_REVISION'))
if (!isset($tNums[$talents[$j]['reqTalent']]))
$depLinks[$talents[$j]['reqTalent']] = $j;
$r = [$tNums[$talents[$j]['reqTalent']], $talents[$j]['reqRank'] + 1];
$r = @[$tNums[$talents[$j]['reqTalent']], $talents[$j]['reqRank'] + 1];
}
$result[$l]['t'][$j] = array(
@@ -169,7 +170,7 @@ if (!defined('AOWOW_REVISION'))
}
return $result;
}
};
$classes = [CLASS_WARRIOR, CLASS_PALADIN, CLASS_HUNTER, CLASS_ROGUE, CLASS_PRIEST, CLASS_DEATHKNIGHT, CLASS_SHAMAN, CLASS_MAGE, CLASS_WARLOCK, CLASS_DRUID];
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
@@ -182,11 +183,15 @@ if (!defined('AOWOW_REVISION'))
if (!is_dir('datasets\\'.$dir))
mkdir('datasets\\'.$dir, 0755, true);
$tSpellIds = DB::Aowow()->selectCol('SELECT rank1 FROM dbc.talent UNION SELECT rank2 FROM dbc.talent UNION SELECT rank3 FROM dbc.talent UNION SELECT rank4 FROM dbc.talent UNION SELECT rank5 FROM dbc.talent');
$tSpells = new SpellList(array(['s.id', $tSpellIds], CFG_SQL_LIMIT_NONE));
echo "script set up in ".Util::execTime()."<br>\n";
foreach ($locales as $lId)
{
User::useLocale($lId);
Lang::load(Util::$localeStrings[$lId]);
// TalentCalc
foreach ($classes as $cMask)
@@ -195,7 +200,7 @@ if (!defined('AOWOW_REVISION'))
$cId = log($cMask, 2) + 1;
$file = 'datasets\\'.User::$localeString.'\\talents-'.$cId;
$toFile = '$WowheadTalentCalculator.registerClass('.$cId.', '.json_encode(buildTree($cId), JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK).')';
$toFile = '$WowheadTalentCalculator.registerClass('.$cId.', '.json_encode($buildTree($cId), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK).')';
$handle = fOpen($file, "w");
fWrite($handle, $toFile);
@@ -208,11 +213,11 @@ if (!defined('AOWOW_REVISION'))
if (empty($petIcons))
{
$pets = DB::Aowow()->SelectCol('SELECT Id AS ARRAY_KEY, iconString FROM ?_pet');
$petIcons = json_encode($pets, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$petIcons = json_encode($pets, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
}
$toFile = "var g_pet_icons = ".$petIcons."\n\n";
$toFile .= 'var g_pet_talents = '.json_encode(buildTree(0), JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
$toFile .= 'var g_pet_talents = '.json_encode($buildTree(0), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK);
$file = 'datasets\\'.User::$localeString.'\\pet-talents';
$handle = fOpen($file, "w");
@@ -224,9 +229,8 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
User::useLocale(LOCALE_EN);
Lang::load(Util::$localeStrings[LOCALE_EN]);
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>

File diff suppressed because one or more lines are too long