any 'Id' => 'id' as i'm mighty tired of the conflicts between js (lower) and php (ucFirst)

added achievemnts-page to enable display of tooltips
This commit is contained in:
Sarjuuk
2013-03-05 23:21:19 +01:00
parent edd0ff5209
commit d848faa1fa
27 changed files with 643 additions and 236 deletions

View File

@@ -8,7 +8,7 @@ class AchievementList extends BaseType
public $criteria = []; public $criteria = [];
public $tooltip = []; public $tooltip = [];
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_achievement WHERE [filter] [cond] GROUP BY Id ORDER BY `orderInGroup` ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_achievement WHERE [filter] [cond] GROUP BY Id ORDER BY `orderInGroup` ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_achievement WHERE [filter] [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_achievement WHERE [filter] [cond]';
public function __construct($conditions) public function __construct($conditions)
@@ -19,7 +19,7 @@ class AchievementList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
if (!$this->curTpl['iconString']) if (!$this->curTpl['iconString'])
$this->templates[$this->Id]['iconString'] = 'INV_Misc_QuestionMark'; $this->templates[$this->id]['iconString'] = 'INV_Misc_QuestionMark';
//"rewards":[[11,137],[3,138]] [type, typeId] //"rewards":[[11,137],[3,138]] [type, typeId]
if (!empty($this->curTpl['rewardIds'])) if (!empty($this->curTpl['rewardIds']))
@@ -29,7 +29,7 @@ class AchievementList extends BaseType
foreach ($rewIds as $rewId) foreach ($rewIds as $rewId)
$rewards[] = ($rewId > 0 ? [TYPE_ITEM => $rewId] : ($rewId < 0 ? [TYPE_TITLE => -$rewId] : NULL)); $rewards[] = ($rewId > 0 ? [TYPE_ITEM => $rewId] : ($rewId < 0 ? [TYPE_TITLE => -$rewId] : NULL));
$this->templates[$this->Id]['rewards'] = $rewards; $this->templates[$this->id]['rewards'] = $rewards;
} }
} }
@@ -58,7 +58,7 @@ class AchievementList extends BaseType
(new ItemList(array(['i.entry', array_unique($lookup['item'])])))->addGlobalsToJscript($refs); (new ItemList(array(['i.entry', array_unique($lookup['item'])])))->addGlobalsToJscript($refs);
if (isset($lookup['title'])) if (isset($lookup['title']))
(new TitleList(array(['Id', array_unique($lookup['title'])])))->addGlobalsToJscript($refs); (new TitleList(array(['id', array_unique($lookup['title'])])))->addGlobalsToJscript($refs);
} }
public function addGlobalsToJscript(&$refs) public function addGlobalsToJscript(&$refs)
@@ -68,7 +68,7 @@ class AchievementList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$refs['gAchievements'][$this->Id] = array( $refs['gAchievements'][$this->id] = array(
'icon' => $this->curTpl['iconString'], 'icon' => $this->curTpl['iconString'],
'name' => Util::localizedString($this->curTpl, 'name') 'name' => Util::localizedString($this->curTpl, 'name')
); );
@@ -81,8 +81,8 @@ class AchievementList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'id' => $this->Id, 'id' => $this->id,
'name' => Util::localizedString($this->curTpl, 'name'), 'name' => Util::localizedString($this->curTpl, 'name'),
'description' => Util::localizedString($this->curTpl, 'description'), 'description' => Util::localizedString($this->curTpl, 'description'),
'points' => $this->curTpl['points'], 'points' => $this->curTpl['points'],
@@ -98,10 +98,10 @@ class AchievementList extends BaseType
foreach ($this->curTpl['rewards'] as $pair) foreach ($this->curTpl['rewards'] as $pair)
$rewards[] = '['.key($pair).','.current($pair).']'; $rewards[] = '['.key($pair).','.current($pair).']';
$data[$this->Id]['rewards'] = '['.implode(',', $rewards).']'; $data[$this->id]['rewards'] = '['.implode(',', $rewards).']';
} }
else if (!empty ($this->curTpl['reward'])) else if (!empty ($this->curTpl['reward']))
$data[$this->Id]['reward'] = Util::localizedString($this->curTpl, 'reward'); $data[$this->id]['reward'] = Util::localizedString($this->curTpl, 'reward');
} }
@@ -115,8 +115,8 @@ class AchievementList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'id' => $this->Id, 'id' => $this->id,
'name' => Util::localizedString($this->curTpl, 'name'), 'name' => Util::localizedString($this->curTpl, 'name'),
'description' => Util::localizedString($this->curTpl, 'description'), 'description' => Util::localizedString($this->curTpl, 'description'),
'points' => $this->curTpl['points'], 'points' => $this->curTpl['points'],
@@ -134,26 +134,26 @@ class AchievementList extends BaseType
{ {
if (empty($this->criteria)) if (empty($this->criteria))
{ {
$result = DB::Aowow()->Select('SELECT * FROM ?_achievementcriteria WHERE `refAchievement` = ? ORDER BY `order` ASC', $this->Id); $result = DB::Aowow()->Select('SELECT * FROM ?_achievementcriteria WHERE `refAchievement` = ? ORDER BY `order` ASC', $this->id);
if (!$result) if (!$result)
return []; return [];
if (is_array($result[0])) if (is_array($result[0]))
$this->criteria[$this->Id] = $result; $this->criteria[$this->id] = $result;
else else
$this->criteria[$this->Id][] = $result; $this->criteria[$this->id][] = $result;
} }
if ($idx < 0) if ($idx < 0)
return $this->criteria[$this->Id]; return $this->criteria[$this->id];
else else
return $this->criteria[$this->Id][$idx]; return $this->criteria[$this->id][$idx];
} }
public function renderTooltip() public function renderTooltip()
{ {
if (!empty($this->tooltip[$this->Id])) if (!empty($this->tooltip[$this->id]))
return $this->tooltip[$this->Id]; return $this->tooltip[$this->id];
$criteria = $this->getCriteria(); $criteria = $this->getCriteria();
$tmp = []; $tmp = [];
@@ -232,9 +232,9 @@ class AchievementList extends BaseType
$x .= '</td></tr></table>'; $x .= '</td></tr></table>';
// Completed // Completed
$this->tooltip[$this->Id] = $x; $this->tooltip[$this->id] = $x;
return $this->tooltip[$this->Id]; return $this->tooltip[$this->id];
} }
public function getSourceData() public function getSourceData()
@@ -243,11 +243,11 @@ class AchievementList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
"n" => Util::localizedString($this->curTpl, 'name'), "n" => Util::localizedString($this->curTpl, 'name'),
"s" => $this->curTpl['faction'], "s" => $this->curTpl['faction'],
"t" => TYPE_ACHIEVEMENT, "t" => TYPE_ACHIEVEMENT,
"ti" => $this->Id "ti" => $this->id
); );
} }
@@ -308,7 +308,7 @@ class AchievementList extends BaseType
// series parent(16) << child(16) // series parent(16) << child(16)
$series = $this->curTpl['parent'] << 16; $series = $this->curTpl['parent'] << 16;
$series |= DB::Aowow()->SelectCell('SELECT Id FROM ?_achievement WHERE parent = ?d', $acv->Id); $series |= DB::Aowow()->SelectCell('SELECT Id FROM ?_achievement WHERE parent = ?d', $acv->id);
// set rewards // set rewards
$rewardIds = []; $rewardIds = [];
@@ -330,12 +330,12 @@ class AchievementList extends BaseType
} }
else if (stristr($rStr, 'reward:')) // i haz item else if (stristr($rStr, 'reward:')) // i haz item
{ {
if (in_array($acv->Id, [3656, 3478])) // Pilgrim if (in_array($acv->id, [3656, 3478])) // Pilgrim
{ {
$rewardIds[] = -168; $rewardIds[] = -168;
$rewardIds[] = 44810; $rewardIds[] = 44810;
} }
else if (in_array($acv->Id, [1681, 1682])) // Loremaster else if (in_array($acv->id, [1681, 1682])) // Loremaster
{ {
$rewardIds[] = -125; $rewardIds[] = -125;
$rewardIds[] = 43300; $rewardIds[] = 43300;
@@ -345,7 +345,7 @@ class AchievementList extends BaseType
$rStr = explode(':', $rStr)[1]; // head-b-gone $rStr = explode(':', $rStr)[1]; // head-b-gone
$rewardIds[] = DB::Aowow()->SelectCell('SELECT entry FROM item_template WHERE name LIKE ?s', '%'.Util::sqlEscape(trim($rStr))); $rewardIds[] = DB::Aowow()->SelectCell('SELECT entry FROM item_template WHERE name LIKE ?s', '%'.Util::sqlEscape(trim($rStr)));
if ($acv->Id == 1956) // higher learning if ($acv->id == 1956) // higher learning
$rewardIds[] = 44738; // pet not in description $rewardIds[] = 44738; // pet not in description
} }
} }
@@ -368,7 +368,7 @@ class AchievementList extends BaseType
isset($rewardIds) ? implode(' ', $rewardIds) : '', isset($rewardIds) ? implode(' ', $rewardIds) : '',
$parentCat, $parentCat,
$icon, $icon,
$acv->Id $acv->id
); );
} }
} }

View File

@@ -5,7 +5,7 @@ if (!defined('AOWOW_REVISION'))
class CharClassList extends BaseType class CharClassList extends BaseType
{ {
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_classes WHERE [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_classes WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_classes WHERE [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_classes WHERE [cond]';
public function getListviewData() public function getListviewData()
@@ -14,9 +14,9 @@ class CharClassList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'Id' => $this->Id, 'id' => $this->id,
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'races' => $this->curTpl['raceMask'], 'races' => $this->curTpl['raceMask'],
'roles' => $this->curTpl['roles'], 'roles' => $this->curTpl['roles'],
'weapon' => $this->curTpl['weaponTypeMask'], 'weapon' => $this->curTpl['weaponTypeMask'],
@@ -25,10 +25,10 @@ class CharClassList extends BaseType
); );
if ($this->curTpl['expansion'] == 2) // todo: grr, move to db if ($this->curTpl['expansion'] == 2) // todo: grr, move to db
$data[$this->Id]['hero'] = 1; $data[$this->id]['hero'] = 1;
if ($this->curTpl['expansion']) if ($this->curTpl['expansion'])
$data[$this->Id]['expansion'] = $this->curTpl['expansion']; $data[$this->id]['expansion'] = $this->curTpl['expansion'];
} }
return $data; return $data;
@@ -40,7 +40,7 @@ class CharClassList extends BaseType
$refs['gClasses'] = []; $refs['gClasses'] = [];
while ($this->iterate()) while ($this->iterate())
$refs['gClasses'][$this->Id] = Util::jsEscape($this->names[$this->Id]); $refs['gClasses'][$this->id] = Util::jsEscape($this->names[$this->id]);
} }
public function addRewardsToJScript(&$ref) { } public function addRewardsToJScript(&$ref) { }

View File

@@ -5,7 +5,7 @@ if (!defined('AOWOW_REVISION'))
class CharRaceList extends BaseType class CharRaceList extends BaseType
{ {
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_races WHERE [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_races WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_races WHERE [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_races WHERE [cond]';
public function getListviewData() public function getListviewData()
@@ -14,9 +14,9 @@ class CharRaceList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'Id' => $this->Id, 'id' => $this->id,
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'classes' => $this->curTpl['classMask'], 'classes' => $this->curTpl['classMask'],
'faction' => $this->curTpl['factionId'], 'faction' => $this->curTpl['factionId'],
'leader' => $this->curTpl['leader'], 'leader' => $this->curTpl['leader'],
@@ -25,7 +25,7 @@ class CharRaceList extends BaseType
); );
if ($this->curTpl['expansion']) if ($this->curTpl['expansion'])
$data[$this->Id]['expansion'] = $this->curTpl['expansion']; $data[$this->id]['expansion'] = $this->curTpl['expansion'];
} }
return $data; return $data;
@@ -36,7 +36,7 @@ class CharRaceList extends BaseType
if (!isset($refs['gRaces'])) if (!isset($refs['gRaces']))
$refs['gRaces'] = []; $refs['gRaces'] = [];
$refs['gRaces'][$this->Id] = Util::jsEscape($this->names[$this->Id]); $refs['gRaces'][$this->id] = Util::jsEscape($this->names[$this->id]);
} }
public function addRewardsToJScript(&$ref) { } public function addRewardsToJScript(&$ref) { }

View File

@@ -5,7 +5,7 @@ if (!defined('AOWOW_REVISION'))
class CurrencyList extends BaseType class CurrencyList extends BaseType
{ {
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_currencies WHERE [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_currencies WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_currencies WHERE [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_currencies WHERE [cond]';
public function getListviewData() public function getListviewData()
@@ -14,10 +14,10 @@ class CurrencyList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'Id' => $this->Id, 'id' => $this->id,
'category' => $this->curTpl['category'], 'category' => $this->curTpl['category'],
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'icon' => $this->curTpl['iconString'] 'icon' => $this->curTpl['iconString']
); );
} }
@@ -34,8 +34,8 @@ class CurrencyList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$refs['gCurrencies'][$this->Id] = array( $refs['gCurrencies'][$this->id] = array(
'name_'.User::$localeString => Util::jsEscape($this->names[$this->Id]), 'name_'.User::$localeString => Util::jsEscape($this->names[$this->id]),
'icon' => $this->curTpl['iconString'] 'icon' => $this->curTpl['iconString']
); );
} }

View File

@@ -90,8 +90,9 @@ class ItemList extends BaseType
if ($addInfoMask & ITEMINFO_JSON) if ($addInfoMask & ITEMINFO_JSON)
$this->extendJsonStats(); $this->extendJsonStats();
$tmp = array_merge($this->json[$this->Id], array( $tmp = array_merge($this->json[$this->id], array(
'name' => $this->names[$this->Id], 'id' => $this->id,
'name' => $this->names[$this->id],
'quality' => 7 - $this->curTpl['Quality'], 'quality' => 7 - $this->curTpl['Quality'],
'reqskill' => $this->curTpl['RequiredSkill'], 'reqskill' => $this->curTpl['RequiredSkill'],
'reqskillrank' => $this->curTpl['RequiredSkillRank'], 'reqskillrank' => $this->curTpl['RequiredSkillRank'],
@@ -112,7 +113,7 @@ class ItemList extends BaseType
if (!in_array($this->curTpl['AllowableClass'], [-1, 0, CLASS_MASK_ALL])) if (!in_array($this->curTpl['AllowableClass'], [-1, 0, CLASS_MASK_ALL]))
$tmp['reqclass'] = $this->curTpl['AllowableClass']; // $tmp['classes'] ?? $tmp['reqclass'] = $this->curTpl['AllowableClass']; // $tmp['classes'] ??
$data[$this->Id] = $tmp; $data[$this->id] = $tmp;
} }
/* even more complicated crap /* even more complicated crap
@@ -140,8 +141,8 @@ class ItemList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$refs['gItems'][$this->Id] = array( $refs['gItems'][$this->id] = array(
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'quality' => $this->curTpl['Quality'], 'quality' => $this->curTpl['Quality'],
'icon' => $this->curTpl['icon'], 'icon' => $this->curTpl['icon'],
); );
@@ -161,10 +162,10 @@ class ItemList extends BaseType
if ($this->error) if ($this->error)
return; return;
$name = $this->names[$this->Id]; $name = $this->names[$this->id];
if (!empty($this->tooltip[$this->Id])) if (!empty($this->tooltip[$this->id]))
return $this->tooltip[$this->Id]; return $this->tooltip[$this->id];
if (!empty($enhance['rand'])) if (!empty($enhance['rand']))
{ {
@@ -532,10 +533,10 @@ class ItemList extends BaseType
if ($itemSpellsAndTrigger) if ($itemSpellsAndTrigger)
{ {
$itemSpells = new SpellList(array(['Id', array_keys($itemSpellsAndTrigger)])); $itemSpells = new SpellList(array(['id', array_keys($itemSpellsAndTrigger)]));
while ($itemSpells->iterate()) while ($itemSpells->iterate())
if ($parsed = $itemSpells->parseText('description', $this->curTpl['RequiredLevel'])) if ($parsed = $itemSpells->parseText('description', $this->curTpl['RequiredLevel']))
$green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->Id]].$parsed; $green[] = Lang::$item['trigger'][$itemSpellsAndTrigger[$itemSpells->id]].$parsed;
} }
@@ -556,7 +557,7 @@ class ItemList extends BaseType
?_itemset ?_itemset
WHERE WHERE
(item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d)', (item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d)',
$this->Id, $this->Id, $this->Id, $this->Id, $this->Id, $this->Id, $this->Id, $this->Id, $this->Id, $this->Id $this->id, $this->id, $this->id, $this->id, $this->id, $this->id, $this->id, $this->id, $this->id, $this->id
); );
if ($itemset) if ($itemset)
@@ -573,7 +574,7 @@ class ItemList extends BaseType
} }
$tmpX .= implode('<br />', $pieces); $tmpX .= implode('<br />', $pieces);
$x .= '<br /><span class="q"><a href="?itemset='.$itemset['Id'].'" class="q">'.Util::localizedString($itemset, 'name').'</a> (0/'.$num.')</span>'; $x .= '<br /><span class="q"><a href="?itemset='.$itemset['id'].'" class="q">'.Util::localizedString($itemset, 'name').'</a> (0/'.$num.')</span>';
if ($itemset['skillID']) // bonus requires skill to activate if ($itemset['skillID']) // bonus requires skill to activate
{ {
@@ -598,13 +599,13 @@ class ItemList extends BaseType
// todo: get from static prop? // todo: get from static prop?
if ($setSpellsAndIdx) if ($setSpellsAndIdx)
{ {
$boni = new SpellList(array(['Id', array_keys($setSpellsAndIdx)])); $boni = new SpellList(array(['id', array_keys($setSpellsAndIdx)]));
while ($boni->iterate()) while ($boni->iterate())
{ {
$itemset['spells'][] = array( $itemset['spells'][] = array(
'tooltip' => $boni->parseText('description', $this->curTpl['RequiredLevel']), 'tooltip' => $boni->parseText('description', $this->curTpl['RequiredLevel']),
'entry' => $itemset['spell'.$setSpellsAndIdx[$boni->Id]], 'entry' => $itemset['spell'.$setSpellsAndIdx[$boni->id]],
'bonus' => $itemset['bonus'.$setSpellsAndIdx[$boni->Id]] 'bonus' => $itemset['bonus'.$setSpellsAndIdx[$boni->id]]
); );
} }
} }
@@ -632,7 +633,7 @@ class ItemList extends BaseType
// recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp // recipe handling (some stray Techniques have subclass == 0), place at bottom of tooltipp
if ($this->curTpl['class'] == ITEM_CLASS_RECIPE && ($this->curTpl['subclass'] || $this->curTpl['BagFamily'] == 16)) if ($this->curTpl['class'] == ITEM_CLASS_RECIPE && ($this->curTpl['subclass'] || $this->curTpl['BagFamily'] == 16))
{ {
$craftSpell = new SpellList(array(['Id', (int)$this->curTpl['spellid_2']])); $craftSpell = new SpellList(array(['id', (int)$this->curTpl['spellid_2']]));
$craftItem = new ItemList(array(['i.entry', (int)$craftSpell->curTpl["effect1CreateItemId"]])); $craftItem = new ItemList(array(['i.entry', (int)$craftSpell->curTpl["effect1CreateItemId"]]));
$reagentItems = []; $reagentItems = [];
@@ -648,7 +649,7 @@ class ItemList extends BaseType
$xCraft = '<div><br />'.$craftItem->renderTooltip(null, $interactive).'</div><br />'; $xCraft = '<div><br />'.$craftItem->renderTooltip(null, $interactive).'</div><br />';
while ($reagents->iterate()) while ($reagents->iterate())
$reqReag[] = '<a href="?item='.$reagents->Id.'">'.$reagents->names[$reagents->Id].'</a> ('.$reagentItems[$reagents->Id].')'; $reqReag[] = '<a href="?item='.$reagents->id.'">'.$reagents->names[$reagents->id].'</a> ('.$reagentItems[$reagents->id].')';
$xCraft .= '<span class="q1">'.Lang::$game['requires']." ".implode(", ", $reqReag).'</span>'; $xCraft .= '<span class="q1">'.Lang::$game['requires']." ".implode(", ", $reqReag).'</span>';
@@ -682,24 +683,24 @@ class ItemList extends BaseType
$x .= '</td></tr></table>'; $x .= '</td></tr></table>';
// heirloom tooltip scaling // heirloom tooltip scaling
if (isset($this->ssd[$this->Id])) if (isset($this->ssd[$this->id]))
{ {
$link = array( $link = array(
$this->Id, // itemId $this->id, // itemId
1, // scaleMinLevel 1, // scaleMinLevel
$this->ssd[$this->Id]['maxLevel'], // scaleMaxLevel $this->ssd[$this->id]['maxLevel'], // scaleMaxLevel
$this->ssd[$this->Id]['maxLevel'], // scaleCurLevel $this->ssd[$this->id]['maxLevel'], // scaleCurLevel
$this->curTpl['ScalingStatDistribution'], // scaleDist $this->curTpl['ScalingStatDistribution'], // scaleDist
$this->curTpl['ScalingStatValue'], // scaleFlags $this->curTpl['ScalingStatValue'], // scaleFlags
); );
$x .= '<!--?'.implode(':', $link).'-->'; $x .= '<!--?'.implode(':', $link).'-->';
} }
else else
$x .= '<!--?'.$this->Id.':1:'.MAX_LEVEL.':'.MAX_LEVEL.'-->'; $x .= '<!--?'.$this->id.':1:'.MAX_LEVEL.':'.MAX_LEVEL.'-->';
$this->tooltip[$this->Id] = $x; $this->tooltip[$this->id] = $x;
return $this->tooltip[$this->Id]; return $this->tooltip[$this->id];
} }
// from Trinity // from Trinity
@@ -783,7 +784,7 @@ class ItemList extends BaseType
if (!$this->curTpl['stat_type'.$h]) if (!$this->curTpl['stat_type'.$h])
continue; continue;
@$this->itemMods[$this->Id][$this->curTpl['stat_type'.$h]] += $this->curTpl['stat_value'.$h]; @$this->itemMods[$this->id][$this->curTpl['stat_type'.$h]] += $this->curTpl['stat_value'.$h];
} }
// convert Spells // convert Spells
@@ -802,33 +803,33 @@ class ItemList extends BaseType
if ($equipSpells) if ($equipSpells)
{ {
$eqpSplList = new SpellList(array(['Id', $equipSpells])); $eqpSplList = new SpellList(array(['id', $equipSpells]));
$stats = $eqpSplList->getStatGain(); $stats = $eqpSplList->getStatGain();
foreach ($stats as $mId => $qty) foreach ($stats as $mId => $qty)
@$this->itemMods[$this->Id][$mId] += $qty; @$this->itemMods[$this->id][$mId] += $qty;
} }
// fetch and add socketbonusstats // fetch and add socketbonusstats
if (@$this->json[$this->Id]['socketbonus'] > 0) if (@$this->json[$this->id]['socketbonus'] > 0)
{ {
$enh = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?;', $this->json[$this->Id]['socketbonus']); $enh = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?;', $this->json[$this->id]['socketbonus']);
$this->json[$this->Id]['socketbonusstat'] = []; $this->json[$this->id]['socketbonusstat'] = [];
$socketbonusstat = Util::parseItemEnchantment($enh); $socketbonusstat = Util::parseItemEnchantment($enh);
foreach ($socketbonusstat as $k => $v) foreach ($socketbonusstat as $k => $v)
$this->json[$this->Id]['socketbonusstat'][] = '"'.$k.'":'.$v; $this->json[$this->id]['socketbonusstat'][] = '"'.$k.'":'.$v;
$this->json[$this->Id]['socketbonusstat'] = "{".implode(',', $this->json[$this->Id]['socketbonusstat'])."}"; $this->json[$this->id]['socketbonusstat'] = "{".implode(',', $this->json[$this->id]['socketbonusstat'])."}";
} }
// readdress itemset .. is wrong for virtual sets // readdress itemset .. is wrong for virtual sets
if ($pieceAssoc) if ($pieceAssoc)
$this->json[$this->Id]['itemset'] = $pieceAssoc[$this->Id]; $this->json[$this->id]['itemset'] = $pieceAssoc[$this->id];
// gather random Enchantments // gather random Enchantments
// todo: !important! extremly high sql-load // todo: !important! extremly high sql-load
if (@$this->json[$this->Id]['commondrop'] && isset($this->subItems[$this->Id])) if (@$this->json[$this->id]['commondrop'] && isset($this->subItems[$this->id]))
{ {
foreach ($this->subItems[$this->Id] as $k => $sI) foreach ($this->subItems[$this->id] as $k => $sI)
{ {
$jsonEquip = []; $jsonEquip = [];
$jsonText = []; $jsonText = [];
@@ -856,27 +857,27 @@ class ItemList extends BaseType
} }
} }
$this->subItems[$this->Id][$k] = array( $this->subItems[$this->id][$k] = array(
'name' => Util::localizedString($sI, 'name'), 'name' => Util::localizedString($sI, 'name'),
'enchantment' => implode(', ', $jsonText), 'enchantment' => implode(', ', $jsonText),
'jsonequip' => $jsonEquip 'jsonequip' => $jsonEquip
); );
} }
$this->json[$this->Id]['subitems'] = json_encode($this->subItems[$this->Id], JSON_FORCE_OBJECT); $this->json[$this->id]['subitems'] = json_encode($this->subItems[$this->id], JSON_FORCE_OBJECT);
} }
foreach ($this->json[$this->Id] as $k => $v) foreach ($this->json[$this->id] as $k => $v)
{ {
if (!isset($v) || $v === "false") if (!isset($v) || $v === "false")
{ {
unset($this->json[$this->Id][$k]); unset($this->json[$this->id][$k]);
continue; continue;
} }
if (!in_array($k, ['classs', 'subclass', 'armor']) && $v === "0") if (!in_array($k, ['classs', 'subclass', 'armor']) && $v === "0")
{ {
unset($this->json[$this->Id][$k]); unset($this->json[$this->id][$k]);
continue; continue;
} }
} }
@@ -885,7 +886,7 @@ class ItemList extends BaseType
private function parseRating($type, $value, $interactive = false) private function parseRating($type, $value, $interactive = false)
{ {
// clamp level range // clamp level range
$ssdLvl = isset($this->ssd[$this->Id]) ? $this->ssd[$this->Id]['maxLevel'] : 1; $ssdLvl = isset($this->ssd[$this->id]) ? $this->ssd[$this->id]['maxLevel'] : 1;
$level = min(max($this->curTpl['RequiredLevel'], $ssdLvl), MAX_LEVEL); $level = min(max($this->curTpl['RequiredLevel'], $ssdLvl), MAX_LEVEL);
if (!Lang::$item['statType'][$type]) // unknown rating if (!Lang::$item['statType'][$type]) // unknown rating
@@ -925,45 +926,45 @@ class ItemList extends BaseType
if ($mask & (1 << $i)) if ($mask & (1 << $i))
$field = Util::$ssdMaskFields[$i]; $field = Util::$ssdMaskFields[$i];
return $field ? DB::Aowow()->selectCell("SELECT ?# FROM ?_scalingstatvalues WHERE charLevel = ?", $field, $this->ssd[$this->Id]['maxLevel']) : 0; return $field ? DB::Aowow()->selectCell("SELECT ?# FROM ?_scalingstatvalues WHERE charLevel = ?", $field, $this->ssd[$this->id]['maxLevel']) : 0;
} }
private function initScalingStats() private function initScalingStats()
{ {
$this->ssd[$this->Id] = DB::Aowow()->selectRow("SELECT * FROM ?_scalingstatdistribution WHERE id = ?", $this->curTpl['ScalingStatDistribution']); $this->ssd[$this->id] = DB::Aowow()->selectRow("SELECT * FROM ?_scalingstatdistribution WHERE id = ?", $this->curTpl['ScalingStatDistribution']);
// stats and ratings // stats and ratings
for ($i = 1; $i <= 10; $i++) for ($i = 1; $i <= 10; $i++)
{ {
if ($this->ssd[$this->Id]['statMod'.$i] <= 0) if ($this->ssd[$this->id]['statMod'.$i] <= 0)
{ {
$this->templates[$this->Id]['stat_type'.$i] = 0; $this->templates[$this->id]['stat_type'.$i] = 0;
$this->templates[$this->Id]['stat_value'.$i] = 0; $this->templates[$this->id]['stat_value'.$i] = 0;
} }
else else
{ {
$this->templates[$this->Id]['stat_type'.$i] = $this->ssd[$this->Id]['statMod'.$i]; $this->templates[$this->id]['stat_type'.$i] = $this->ssd[$this->id]['statMod'.$i];
$this->templates[$this->Id]['stat_value'.$i] = intVal(($this->getSSDMod('stats') * $this->ssd[$this->Id]['modifier'.$i]) / 10000); $this->templates[$this->id]['stat_value'.$i] = intVal(($this->getSSDMod('stats') * $this->ssd[$this->id]['modifier'.$i]) / 10000);
} }
} }
// armor: only replace if set // armor: only replace if set
if ($ssvArmor = $this->getSSDMod('armor')) if ($ssvArmor = $this->getSSDMod('armor'))
$this->templates[$this->Id]['armor'] = $ssvArmor; $this->templates[$this->id]['armor'] = $ssvArmor;
// if set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage // if set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
if ($extraDPS = $this->getSSDMod('dps')) // dmg_x2 not used for heirlooms if ($extraDPS = $this->getSSDMod('dps')) // dmg_x2 not used for heirlooms
{ {
$average = $extraDPS * $this->curTpl['delay'] / 1000; $average = $extraDPS * $this->curTpl['delay'] / 1000;
$this->templates[$this->Id]['dmg_min1'] = number_format(0.7 * $average); $this->templates[$this->id]['dmg_min1'] = number_format(0.7 * $average);
$this->templates[$this->Id]['dmg_max1'] = number_format(1.3 * $average); $this->templates[$this->id]['dmg_max1'] = number_format(1.3 * $average);
} }
// apply Spell Power from ScalingStatValue if set // apply Spell Power from ScalingStatValue if set
if ($spellBonus = $this->getSSDMod('spell')) if ($spellBonus = $this->getSSDMod('spell'))
{ {
$this->templates[$this->Id]['stat_type10'] = ITEM_MOD_SPELL_POWER; $this->templates[$this->id]['stat_type10'] = ITEM_MOD_SPELL_POWER;
$this->templates[$this->Id]['stat_value10'] = $spellBonus; $this->templates[$this->id]['stat_value10'] = $spellBonus;
} }
} }
@@ -977,22 +978,22 @@ class ItemList extends BaseType
$randomIds[$key] = -$val; $randomIds[$key] = -$val;
}); });
$this->subItems[$this->Id] = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM ?_itemRandomEnchant WHERE Id IN (?a)', $randomIds); $this->subItems[$this->id] = DB::Aowow()->select('SELECT *, Id AS ARRAY_KEY FROM ?_itemRandomEnchant WHERE Id IN (?a)', $randomIds);
// subitems may share enchantmentIds // subitems may share enchantmentIds
foreach ($this->subItems[$this->Id] as $sI) foreach ($this->subItems[$this->id] as $sI)
for ($i = 1; $i < 6; $i++) for ($i = 1; $i < 6; $i++)
if (!isset($this->rndEnchIds[$sI['enchantId'.$i]]) && $sI['enchantId'.$i]) if (!isset($this->rndEnchIds[$sI['enchantId'.$i]]) && $sI['enchantId'.$i])
if ($enchant = DB::Aowow()->selectRow('SELECT *, Id AS ARRAY_KEY FROM ?_itemenchantment WHERE Id = ?d', $sI['enchantId'.$i])) if ($enchant = DB::Aowow()->selectRow('SELECT *, Id AS ARRAY_KEY FROM ?_itemenchantment WHERE Id = ?d', $sI['enchantId'.$i]))
$this->rndEnchIds[$enchant['Id']] = $enchant; $this->rndEnchIds[$enchant['id']] = $enchant;
} }
} }
private function initJsonStats() private function initJsonStats()
{ {
$json = array( $json = array(
'id' => $this->Id, // note to self: lowercase for js-Ids.. ALWAYS!! 'id' => $this->id, // note to self: lowercase for js-Ids.. ALWAYS!!
'name' => (ITEM_QUALITY_HEIRLOOM - $this->curTpl['Quality']).$this->names[$this->Id], 'name' => (ITEM_QUALITY_HEIRLOOM - $this->curTpl['Quality']).$this->names[$this->id],
'icon' => $this->curTpl['icon'], 'icon' => $this->curTpl['icon'],
'classs' => $this->curTpl['class'], 'classs' => $this->curTpl['class'],
'subclass' => $this->curTpl['subclass'], 'subclass' => $this->curTpl['subclass'],

View File

@@ -9,7 +9,7 @@ class ItemsetList extends BaseType
public $pieces = []; // used to build g_items and search public $pieces = []; // used to build g_items and search
public $pieceToSet = []; public $pieceToSet = [];
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_itemset WHERE [filter] [cond] ORDER BY maxlevel ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_itemset WHERE [filter] [cond] ORDER BY maxlevel ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_itemset WHERE [filter] [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_itemset WHERE [filter] [cond]';
public function __construct($data) public function __construct($data)
@@ -19,7 +19,7 @@ class ItemsetList extends BaseType
// post processing // post processing
foreach ($this->templates as $this->curTpl) foreach ($this->templates as $this->curTpl)
{ {
$Id = $this->curTpl['Id']; $Id = $this->curTpl['id'];
$this->templates[$Id]['classes'] = []; $this->templates[$Id]['classes'] = [];
$this->templates[$Id]['pieces'] = []; $this->templates[$Id]['pieces'] = [];
@@ -39,7 +39,7 @@ class ItemsetList extends BaseType
{ {
$this->pieces[] = $piece; $this->pieces[] = $piece;
$this->templates[$Id]['pieces'][] = $piece; $this->templates[$Id]['pieces'][] = $piece;
$this->pieceToSet[$piece] = $this->Id; $this->pieceToSet[$piece] = $this->id;
} }
} }
} }
@@ -59,10 +59,10 @@ class ItemsetList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'Id' => $this->Id, 'id' => $this->id,
'idbak' => $this->curTpl['refSetId'], 'idbak' => $this->curTpl['refSetId'],
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'quality' => 7 - $this->curTpl['quality'], 'quality' => 7 - $this->curTpl['quality'],
'minlevel' => $this->curTpl['minLevel'], 'minlevel' => $this->curTpl['minLevel'],
'maxlevel' => $this->curTpl['maxLevel'], 'maxlevel' => $this->curTpl['maxLevel'],
@@ -81,7 +81,7 @@ class ItemsetList extends BaseType
public function addGlobalsToJscript(&$refs) public function addGlobalsToJscript(&$refs)
{ {
if ($this->classes) if ($this->classes)
(new CharClassList(array(['Id', $this->classes])))->addGlobalsToJscript($refs); (new CharClassList(array(['id', $this->classes])))->addGlobalsToJscript($refs);
if ($this->pieces) if ($this->pieces)
(new ItemList(array(['i.entry', $this->pieces])))->addGlobalsToJscript($refs); (new ItemList(array(['i.entry', $this->pieces])))->addGlobalsToJscript($refs);

View File

@@ -8,7 +8,7 @@ class QuestList extends BaseType
public $cat1 = 0; public $cat1 = 0;
public $cat2 = 0; public $cat2 = 0;
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM quest_template a LEFT JOIN locales_quest b ON a.Id = b.entry WHERE [filter] [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM quest_template a LEFT JOIN locales_quest b ON a.Id = b.entry WHERE [filter] [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM quest_template a LEFT JOIN locales_quest b ON a.Id = b.entry WHERE [filter] [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM quest_template a LEFT JOIN locales_quest b ON a.Id = b.entry WHERE [filter] [cond]';
// parent::__construct does the job // parent::__construct does the job
@@ -17,7 +17,7 @@ class QuestList extends BaseType
{ {
$r = parent::iterate($qty); $r = parent::iterate($qty);
if (!$this->Id) if (!$this->id)
{ {
$this->cat1 = 0; $this->cat1 = 0;
$this->cat2 = 0; $this->cat2 = 0;
@@ -75,10 +75,10 @@ class QuestList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
"n" => Util::localizedString($this->curTpl, 'Title'), "n" => Util::localizedString($this->curTpl, 'Title'),
"t" => TYPE_QUEST, "t" => TYPE_QUEST,
"ti" => $this->Id, "ti" => $this->id,
"c" => $this->cat1, "c" => $this->cat1,
"c2" => $this->cat2 "c2" => $this->cat2
); );
@@ -96,7 +96,7 @@ class QuestList extends BaseType
$set = array( $set = array(
'category' => $this->cat1, 'category' => $this->cat1,
'category2' => $this->cat2, 'category2' => $this->cat2,
'id' => $this->Id, 'id' => $this->id,
'level' => $this->curTpl['Level'], 'level' => $this->curTpl['Level'],
'reqlevel' => $this->curTpl['MinLevel'], 'reqlevel' => $this->curTpl['MinLevel'],
'name' => Util::localizedString($this->curTpl, 'Title'), 'name' => Util::localizedString($this->curTpl, 'Title'),
@@ -161,10 +161,10 @@ class QuestList extends BaseType
(new ItemList(array(['i.entry', $items])))->addGlobalsToJscript($refs); (new ItemList(array(['i.entry', $items])))->addGlobalsToJscript($refs);
if ($spells) if ($spells)
(new SpellList(array(['Id', $spells])))->addGlobalsToJscript($refs); (new SpellList(array(['id', $spells])))->addGlobalsToJscript($refs);
if ($titles) if ($titles)
(new TitleList(array(['Id', $titles])))->addGlobalsToJscript($refs); (new TitleList(array(['id', $titles])))->addGlobalsToJscript($refs);
} }
public function renderTooltip() public function renderTooltip()

View File

@@ -11,7 +11,7 @@ class SpellList extends BaseType
private $spellVars = []; private $spellVars = [];
private $refSpells = []; private $refSpells = [];
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_spell WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_spell WHERE [filter] [cond] GROUP BY Id ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell WHERE [filter] [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_spell WHERE [filter] [cond]';
public function __construct($conditions) public function __construct($conditions)
@@ -27,13 +27,13 @@ class SpellList extends BaseType
// if the spell creates an item use the itemIcon instead // if the spell creates an item use the itemIcon instead
while ($this->iterate()) while ($this->iterate())
if ($this->curTpl['effect1CreateItemId']) if ($this->curTpl['effect1CreateItemId'])
$itemIcons[(int)$this->curTpl['effect1CreateItemId']] = $this->Id; $itemIcons[(int)$this->curTpl['effect1CreateItemId']] = $this->id;
if ($itemIcons) if ($itemIcons)
{ {
$itemList = new ItemList(array(['i.entry', array_keys($itemIcons)])); $itemList = new ItemList(array(['i.entry', array_keys($itemIcons)]));
while ($itemList->iterate()) while ($itemList->iterate())
$this->templates[$itemIcons[$itemList->Id]]['createItemString'] = $itemList->getField('icon'); $this->templates[$itemIcons[$itemList->id]]['createItemString'] = $itemList->getField('icon');
} }
$this->reset(); // restore 'iterator' $this->reset(); // restore 'iterator'
@@ -266,7 +266,7 @@ class SpellList extends BaseType
// cache at least some lookups.. should be moved to single spellList :/ // cache at least some lookups.. should be moved to single spellList :/
if ($lookup && !isset($this->refSpells[$lookup])) if ($lookup && !isset($this->refSpells[$lookup]))
$this->refSpells[$lookup] = new SpellList(array(['Id', $lookup])); $this->refSpells[$lookup] = new SpellList(array(['id', $lookup]));
switch ($var) switch ($var)
{ {
@@ -750,31 +750,31 @@ class SpellList extends BaseType
return null; return null;
// step 1: if the text is supplemented with text-variables, get and replace them // step 1: if the text is supplemented with text-variables, get and replace them
if (empty($this->spellVars[$this->Id]) && $this->curTpl['spellDescriptionVariableId'] > 0) if (empty($this->spellVars[$this->id]) && $this->curTpl['spellDescriptionVariableId'] > 0)
{ {
$spellVars = DB::Aowow()->SelectCell('SELECT vars FROM ?_spellVariables WHERE id = ?d', $this->curTpl['spellDescriptionVariableId']); $spellVars = DB::Aowow()->SelectCell('SELECT vars FROM ?_spellVariables WHERE id = ?d', $this->curTpl['spellDescriptionVariableId']);
$spellVars = explode("\n", $spellVars); $spellVars = explode("\n", $spellVars);
foreach ($spellVars as $sv) foreach ($spellVars as $sv)
if (preg_match('/\$(\w*\d*)=(.*)/i', trim($sv), $matches)) if (preg_match('/\$(\w*\d*)=(.*)/i', trim($sv), $matches))
$this->spellVars[$this->Id][$matches[1]] = $matches[2]; $this->spellVars[$this->id][$matches[1]] = $matches[2];
// replace self-references // replace self-references
$reset = true; $reset = true;
while ($reset) while ($reset)
{ {
$reset = false; $reset = false;
foreach ($this->spellVars[$this->Id] as $k => $sv) foreach ($this->spellVars[$this->id] as $k => $sv)
{ {
if (preg_match('/\$<(\w*\d*)>/i', $sv, $matches)) if (preg_match('/\$<(\w*\d*)>/i', $sv, $matches))
{ {
$this->spellVars[$this->Id][$k] = str_replace('$<'.$matches[1].'>', '${'.$this->spellVars[$this->Id][$matches[1]].'}', $sv); $this->spellVars[$this->id][$k] = str_replace('$<'.$matches[1].'>', '${'.$this->spellVars[$this->id][$matches[1]].'}', $sv);
$reset = true; $reset = true;
} }
} }
} }
// finally, replace SpellDescVars // finally, replace SpellDescVars
foreach ($this->spellVars[$this->Id] as $k => $sv) foreach ($this->spellVars[$this->id] as $k => $sv)
$data = str_replace('$<'.$k.'>', $sv, $data); $data = str_replace('$<'.$k.'>', $sv, $data);
} }
@@ -944,7 +944,7 @@ class SpellList extends BaseType
{ {
while ($this->iterate()) while ($this->iterate())
{ {
if ($Id && $this->Id != $Id) if ($Id && $this->id != $Id)
continue; continue;
// doesn't have a buff // doesn't have a buff
@@ -973,7 +973,7 @@ class SpellList extends BaseType
$x .= '</td></tr></table>'; $x .= '</td></tr></table>';
$this->buffs[$this->Id] = $x; $this->buffs[$this->id] = $x;
} }
return $Id ? $this->buffs[$Id] : true; return $Id ? $this->buffs[$Id] : true;
@@ -983,7 +983,7 @@ class SpellList extends BaseType
{ {
while ($this->iterate()) while ($this->iterate())
{ {
if ($Id && $this->Id != $Id) if ($Id && $this->id != $Id)
continue; continue;
// get reagents // get reagents
@@ -1033,7 +1033,7 @@ class SpellList extends BaseType
$x .= '<table width="100%"><tr><td>'; $x .= '<table width="100%"><tr><td>';
// name // name
$x .= '<b>'.$this->names[$this->Id].'</b>'; $x .= '<b>'.$this->names[$this->id].'</b>';
// rank // rank
if (!empty($rankText)) if (!empty($rankText))
@@ -1161,7 +1161,7 @@ class SpellList extends BaseType
if ($reqWrapper2) if ($reqWrapper2)
$x .= "</table>"; $x .= "</table>";
$this->tooltips[$this->Id] = $x; $this->tooltips[$this->id] = $x;
} }
return $Id ? $this->tooltips[$Id] : true; return $Id ? $this->tooltips[$Id] : true;
@@ -1261,8 +1261,8 @@ class SpellList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
'icon' => $this->curTpl['iconString'], 'icon' => $this->curTpl['iconString'],
'level' => $this->curTpl['baseLevel'], 'level' => $this->curTpl['baseLevel'],
); );
@@ -1280,9 +1280,9 @@ class SpellList extends BaseType
{ {
$iconString = isset($this->curTpl['createItemString']) ? 'createItemString' : 'iconString'; $iconString = isset($this->curTpl['createItemString']) ? 'createItemString' : 'iconString';
$refs['gSpells'][$this->Id] = array( $refs['gSpells'][$this->id] = array(
'icon' => $this->curTpl[$iconString], 'icon' => $this->curTpl[$iconString],
'name' => $this->names[$this->Id], 'name' => $this->names[$this->id],
); );
} }
} }

View File

@@ -7,7 +7,7 @@ class TitleList extends BaseType
{ {
private $sources = []; private $sources = [];
protected $setupQuery = 'SELECT *, Id AS ARRAY_KEY FROM ?_titles WHERE [cond] ORDER BY Id ASC'; protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_titles WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_titles WHERE [cond]'; protected $matchQuery = 'SELECT COUNT(1) FROM ?_titles WHERE [cond]';
public function __construct($data) public function __construct($data)
@@ -18,9 +18,9 @@ class TitleList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
// overwrite names with gender-speciffics // overwrite names with gender-speciffics
$this->names[$this->Id][GENDER_MALE] = Util::localizedString($this->curTpl, 'male'); $this->names[$this->id][GENDER_MALE] = Util::localizedString($this->curTpl, 'male');
if ($this->curTpl['female_loc0'] || $this->curTpl['female_loc'.User::$localeId]) if ($this->curTpl['female_loc0'] || $this->curTpl['female_loc'.User::$localeId])
$this->names[$this->Id][GENDER_FEMALE] = Util::localizedString($this->curTpl, 'female'); $this->names[$this->id][GENDER_FEMALE] = Util::localizedString($this->curTpl, 'female');
// preparse sources // preparse sources
if (!empty($this->curTpl['source'])) if (!empty($this->curTpl['source']))
@@ -29,7 +29,7 @@ class TitleList extends BaseType
foreach ($sources as $src) foreach ($sources as $src)
{ {
$src = explode(':', $src); $src = explode(':', $src);
$this->sources[$this->Id][$src[0]][] = $src[1]; $this->sources[$this->id][$src[0]][] = $src[1];
} }
} }
} }
@@ -42,9 +42,9 @@ class TitleList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$data[$this->Id] = array( $data[$this->id] = array(
'Id' => $this->Id, 'id' => $this->id,
'name' => $this->names[$this->Id][GENDER_MALE], 'name' => $this->names[$this->id][GENDER_MALE],
'side' => $this->curTpl['side'], 'side' => $this->curTpl['side'],
'gender' => $this->curTpl['gender'], 'gender' => $this->curTpl['gender'],
'expansion' => $this->curTpl['expansion'], 'expansion' => $this->curTpl['expansion'],
@@ -52,7 +52,7 @@ class TitleList extends BaseType
); );
if (!empty($this->curTpl['source'])) if (!empty($this->curTpl['source']))
$data[$this->Id]['source'] = $this->curTpl['source']; $data[$this->id]['source'] = $this->curTpl['source'];
} }
if (isset($this->name[GENDER_FEMALE])) if (isset($this->name[GENDER_FEMALE]))
@@ -68,10 +68,10 @@ class TitleList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
$refs['gTitles'][$this->Id]['name'] = Util::jsEscape($this->names[$this->Id][GENDER_MALE]); $refs['gTitles'][$this->id]['name'] = Util::jsEscape($this->names[$this->id][GENDER_MALE]);
if (isset($this->names[$this->Id][GENDER_FEMALE])) if (isset($this->names[$this->id][GENDER_FEMALE]))
$refs['gTitles'][$this->Id]['namefemale'] = Util::jsEscape($this->names[$this->Id][GENDER_FEMALE]); $refs['gTitles'][$this->id]['namefemale'] = Util::jsEscape($this->names[$this->id][GENDER_FEMALE]);
} }
} }
@@ -85,20 +85,20 @@ class TitleList extends BaseType
while ($this->iterate()) while ($this->iterate())
{ {
if (empty($this->sources[$this->Id])) if (empty($this->sources[$this->id]))
continue; continue;
foreach (array_keys($sources) as $srcKey) foreach (array_keys($sources) as $srcKey)
if (isset($this->sources[$this->Id][$srcKey])) if (isset($this->sources[$this->id][$srcKey]))
$sources[$srcKey] = array_merge($sources[$srcKey], $this->sources[$this->Id][$srcKey]); $sources[$srcKey] = array_merge($sources[$srcKey], $this->sources[$this->id][$srcKey]);
} }
// fill in the details // fill in the details
if (!empty($sources[4])) if (!empty($sources[4]))
$sources[4] = (new QuestList(array(['Id', $sources[4]])))->getSourceData(); $sources[4] = (new QuestList(array(['id', $sources[4]])))->getSourceData();
if (!empty($sources[12])) if (!empty($sources[12]))
$sources[12] = (new AchievementList(array(['Id', $sources[12]])))->getSourceData(); $sources[12] = (new AchievementList(array(['id', $sources[12]])))->getSourceData();
if (!empty($sources[13])) if (!empty($sources[13]))
$sources[13] = DB::Aowow()->SELECT('SELECT *, Id AS ARRAY_KEY FROM ?_sourceStrings WHERE Id IN (?a)', $sources[13]); $sources[13] = DB::Aowow()->SELECT('SELECT *, Id AS ARRAY_KEY FROM ?_sourceStrings WHERE Id IN (?a)', $sources[13]);

View File

@@ -140,18 +140,18 @@ abstract class BaseType
$this->curTpl = current($this->templates); $this->curTpl = current($this->templates);
$field = $this->curTpl ? Util::getIdFieldName($this->curTpl) : null; $field = $this->curTpl ? Util::getIdFieldName($this->curTpl) : null;
$this->Id = $this->curTpl ? $this->curTpl[$field] : 0; $this->id = $this->curTpl ? $this->curTpl[$field] : 0;
while ($qty--) while ($qty--)
next($this->templates); next($this->templates);
return $this->Id; return $this->id;
} }
public function reset() public function reset()
{ {
$this->curTpl = reset($this->templates); $this->curTpl = reset($this->templates);
$this->Id = $this->curTpl[Util::getIdFieldName($this->curTpl)]; $this->id = $this->curTpl[Util::getIdFieldName($this->curTpl)];
} }
// read-access to templates // read-access to templates
@@ -1192,7 +1192,7 @@ class Util
break; break;
case 3: case 3:
case 7: case 7:
$spl = new SpellList(array(['Id', (int)$enchant['object'.$h]])); $spl = new SpellList(array(['id', (int)$enchant['object'.$h]]));
$gain = $spl->getStatGain(); $gain = $spl->getStatGain();
foreach ($gain as $k => $v) // array_merge screws up somehow... foreach ($gain as $k => $v) // array_merge screws up somehow...
@@ -1264,6 +1264,8 @@ class Util
return 'entry'; return 'entry';
else if (isset($tpl['Id'])) else if (isset($tpl['Id']))
return 'Id'; return 'Id';
else if (isset($tpl['id']))
return 'id';
else if (isset($tpl['ID'])) else if (isset($tpl['ID']))
return 'ID'; return 'ID';
else else

404
pages/achievement.php Normal file
View File

@@ -0,0 +1,404 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
/* Notes:
* maybe for future use:
* - wring something useful/displayable out of world.achievement_criteria_data
* - display on firstkills if achieved yet or not
*
* create bars with
* g_createProgressBar(c)
* var c = {
* text: "",
* hoverText: "",
* color: "", // cssClassName rep[0-7] | ach[0|1]
* width: , // 0 <=> 100
* }
*/
require 'includes/class.community.php';
$id = intVal($pageParam);
$acv = new AchievementList(array(['id', $id]));
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ACHIEVEMENT, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_ACHIEVEMENT, $id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
{
header('Content-type: application/x-javascript; charsetUTF-8');
Util::powerUseLocale(@$_GET['domain']);
if ($acv->error)
die('$WowheadPower.registerAchievement(\''.$id.'\', '.User::$localeId.', {})');
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$x = '$WowheadPower.registerAchievement('.$id.', '.User::$localeId.",{\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($acv->names[$id])."',\n";
$x .= "\ticon: '".$acv->getField('iconString')."',\n";
$x .= "\ttooltip_".User::$localeString.': \''.$acv->renderTooltip()."'\n";
$x .= "});";
$smarty->saveCache($cacheKeyTooltip, $x);
}
die($x);
}
// regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
if ($acv->error)
{
$smarty->updatePageVars(array(
'subject' => ucfirst(Lang::$achievement['achievement']),
'id' => $id,
'notFound' => sprintf(Lang::$main['pageNotFound'], Lang::$achievement['achievement']),
));
$smarty->assign('lang', Lang::$main);
$smarty->display('404.tpl');
exit();
}
$pageData['path'] = [];
$pageData['title'] = [ucfirst(Lang::$achievement['achievement'])];
$acv->renderTooltip();
// create page title and path
$curCat = $acv->getField('category');
do
{
$pageData['path'][] = $curCat;
$curCat = DB::Aowow()->SelectCell('SELECT parentCategory FROM ?_achievementcategory WHERE id = ?d', $curCat);
}
while ($curCat > 0);
$pageData['path'] = array_reverse(array_merge($pageData['path'], [9, 0]));
array_unshift($pageData['title'], $acv->names[$id]);
$acv->addRewardsToJscript($pageData);
$pageData['page'] = $acv->getDetailedData();
// infobox content
switch ($acv->getField('faction'))
{
case 0:
$pageData['page']['infoBox'][] = Lang::$main['side'].': <span class="alliance-icon">'.Lang::$game['alliance'].'</span>';
break;
case 1:
$pageData['page']['infoBox'][] = Lang::$main['side'].': <span class="horde-icon">'.Lang::$game['horde'].'</span>';
break;
default: // case 3
$pageData['page']['infoBox'][] = Lang::$main['side'].': '.Lang::$main['both'];
}
// todo: crosslink with charactersDB to check if realmFirsts are still available
$pageData['page']['infoBox'] = array_merge($pageData['page']['infoBox'], Lang::getInfoBoxForFlags($acv->getField('cuFlags')));
// listview: "see also"
$conditions = array(
['name_loc'.User::$localeId, $acv->names[$id]],
['id', $id, '!']
);
$saList = new AchievementList($conditions);
$pageData['page']['saData'] = $saList->getListviewData();
$pageData['page']['saParams'] = array(
'id' => 'see-also',
'name' => '$LANG.tab_seealso',
'visibleCols' => "$['category']"
);
$saList->addRewardsToJscript($pageData);
$saList->addGlobalsToJscript($pageData);
// listview: "criteria of"
$refs = DB::Aowow()->SelectCol('SELECT refAchievement FROM ?_achievementcriteria WHERE Type = ?d AND value1 = ?d',
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT,
$id
);
if (!empty($refs))
{
$coList = new AchievementList(array(['id', $refs]));
$pageData['page']['coData'] = $coList->getListviewData();
$pageData['page']['coParams'] = array(
'id' => 'criteria-of',
'name' => '$LANG.tab_criteriaof',
'visibleCols' => "$['category']"
);
$coList->addRewardsToJscript($pageData);
$coList->addGlobalsToJscript($pageData);
}
// create rewards
$pageData['page']['titleReward'] = [];
$pageData['page']['itemReward'] = [];
$acv->addRewardsToJscript($pageData);
foreach ($pageData['page']['titleReward'] as $k => $v)
$pageData['page']['titleReward'][$k] = sprintf(Lang::$achievement['titleReward'], $k, trim(str_replace('%s', '', $v['name'])));
// *****
// ACHIEVEMENT CRITERIA
// *****
$pageData['page']['criteria'] = [];
$iconId = 1;
$tmp_arr = [];
$pageData['page']['icons'] = [];
$pageData['page']['total_criteria'] = count($acv->getCriteria());
$i = 0; // stupid uninitialized iterator.....
foreach ($acv->getCriteria() as $crt)
{
// hide hidden criteria for regular users (really do..?)
// if (($crt['complete_flags'] & ACHIEVEMENT_CRITERIA_FLAG_HIDDEN) && User::$perms > 0)
// continue;
// alternative display option
$displayMoney = $crt['complete_flags'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER;
$crtName = Util::localizedString($crt, 'name');
$tmp = array(
'id' => $crt['id'],
'name' => $crtName,
'type' => $crt['type'],
);
switch ($crt['type'])
{
// link to npc
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE:
$tmp['link'] = array(
'href' => '?npc='.$crt['value1'],
'text' => $crtName,
);
$tmp['extra_text'] = Lang::$achievement['slain'];
break;
// link to area (by map)
case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA:
case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA:
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP:
if ($zoneId = DB::Aowow()->selectCell('SELECT areatableID FROM ?_zones WHERE mapID = ? LIMIT 1', $crt['value1']))
$tmp['link'] = array(
'href' => '?zone='.$zoneId,
'text' => $crtName,
);
else
$tmp['extra_text'] = $crtName;
break;
// link to area
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA:
$tmp['link'] = array(
'href' => '?zone='.$crt['value1'],
'text' => $crtName,
);
break;
// link to skills
case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE:
$tmp['link'] = array(
'href' => '?skill='.$crt['value1'],
'text' => $crtName,
);
break;
// link to class
case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS:
$tmp['link'] = array(
'href' => '?class='.$crt['value1'],
'text' => $crtName,
);
break;
// link to race
case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE:
$tmp['link'] = array(
'href' => '?race='.$crt['value1'],
'text' => $crtName,
);
break;
// link to title
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
// todo: crosslink
break;
// link to achivement (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
$tmp['link'] = array(
'href' => '?achievement='.$crt['value1'],
'text' => $crtName,
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_achievements',
'id' => $crt['value1'],
);
if ($crtAcv = new AchievementList(array(['id', $crt['value1']])))
$crtAcv->addGlobalsToJscript($pageData);
break;
// link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
$crtName = Quest::getName($crt['value1']);
$tmp['link'] = array(
'href' => '?quest='.$crt['value1'],
'text' => $crtName ? $crtName : $crtName,
);
break;
// link to spell (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
$crtSpl = new SpellList(array(['id', $crt['value1']]));
$crtSpl->addGlobalsToJscript($pageData);
$text = $crtName ? $crtName : $crtSpl->names[$crtSpl->id];
$tmp['link'] = array(
'href' => '?spell='.$crt['value1'],
'text' => $text
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_spells',
'id' => $crt['value1'],
);
break;
// link to item (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
$crtItm = new ItemList(array(['id', $crt['value1']]));
$crtItm->addGlobalsToJscript($pageData);
$text = $crtName ? $crtName : $crtItm->names[$crtItm->id];
$tmp['link'] = array(
'href' => '?item='.$crt['value1'],
'text' => $text,
'quality' => $crtItm->getField('Quality'),
'count' => $crt['value2'],
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_items',
'id' => $crt['value1'],
'count' => $crt['value2'],
);
break;
// link to faction (/w target reputation)
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
$crtName = Faction::getName($crt['value1']);
$tmp['link'] = array(
'href' => '?faction='.$crt['value1'],
'text' => $crtName ? $crtName : $crtName,
);
$tmp['extra_text'] = ' ('.Lang::getReputationLevelForPoints($crt['value2']).')';
break;
// link to GObject
case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT:
case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
$tmp['link'] = array(
'href' => '?object='.$crt['value1'],
'text' => $crtName,
);
break;
default:
$tmp['standard'] = true;
// Add a gold coin icon
$tmp['extra_text'] = $displayMoney ? Util::formatMoney($crt['value2']) : $crtName;
break;
}
// If the right column
if ($i++ % 2)
$tmp_arr[] = $tmp;
else
$pageData['page']['criteria'][] = $tmp;
}
// If you found the second column - merge data from it to the end of the main body
if ($tmp_arr)
$pageData['page']['criteria'] = array_merge($pageData['page']['criteria'], $tmp_arr);
// *****
// ACHIEVEMENT CHAIN
// *****
if ($acv->getField('series'))
{
$pageData['page']['series'] = array(
array(
'id' => $id,
'name' => $acv->names[$id],
'parent' => $acv->getField('series') >> 16,
)
);
$tmp = $pageData['page']['series'][0];
while ($tmp)
{
$tmp = DB::Aowow()->selectRow('SELECT id, name_loc0, name_loc?d, series >> 16 AS parent FROM ?_achievement WHERE id = ?',
User::$localeId,
$pageData['page']['series'][0]['parent']
);
if ($tmp)
{
$tmp['name'] = Util::localizedString($tmp, 'name');
array_unshift($pageData['page']['series'], $tmp);
}
}
$tmp = end($pageData['page']['series']);
while ($tmp)
{
$end = end($pageData['page']['series']);
$tmp = DB::Aowow()->selectRow('SELECT id, name_loc0, name_loc?d, series >> 16 AS parent FROM ?_achievement WHERE (series >> 16) = ?',
User::$localeId,
$end['id']
);
if ($tmp)
{
$tmp['name'] = Util::localizedString($tmp, 'name');
array_push($pageData['page']['series'], $tmp);
}
}
}
$smarty->saveCache($cacheKeyPage, $pageData);
}
$announcements = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE flags & 0x10 AND (page = "achievement" OR page = "*")');
foreach ($announcements as $k => $v)
$announcements[$k]['text'] = Util::localizedString($v, 'text');
$vars = array(
'title' => implode(" - ", $pageData['title']),
'path' => "[".implode(", ", $pageData['path'])."]",// menuId 9: Achievement (g_initPath)
'tab' => 0, // tabId 0: Database for g_initHeader($tab)
'type' => TYPE_ACHIEVEMENT,
'typeId' => $id,
);
$smarty->updatePageVars($vars);
$smarty->assign('community', CommunityContent::getAll(TYPE_ACHIEVEMENT, $id)); // comments, screenshots, videos
$smarty->assign('announcements', $announcements);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement));
$smarty->assign('data', $pageData);
// Mysql query execution statistics
$smarty->assign('mysql', DB::Aowow()->getStatistics());
// load the page
$smarty->display('achievement.tpl');
?>

View File

@@ -34,14 +34,14 @@ if ($compareString)
// MATCH() AGAINST() for integers would be nice... // MATCH() AGAINST() for integers would be nice...
$res = DB::Aowow()->SelectRow( $res = DB::Aowow()->SelectRow(
"SELECT Id FROM ?_itemset WHERE "SELECT id FROM ?_itemset WHERE
item1 = ? OR item2 = ? OR item3 = ? OR item4 = ? OR item5 = ? OR item1 = ? OR item2 = ? OR item3 = ? OR item4 = ? OR item5 = ? OR
item6 = ? OR item7 = ? OR item8 = ? OR item9 = ? OR item10 = ?", item6 = ? OR item7 = ? OR item8 = ? OR item9 = ? OR item10 = ?",
(int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0] (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0]
); );
if ($res) if ($res)
$piecesAssoc[(int)$params[0]] = $res['Id']; $piecesAssoc[(int)$params[0]] = $res['id'];
} }
$outSet[] = "[".implode(',', $outString)."]"; $outSet[] = "[".implode(',', $outString)."]";
} }
@@ -53,16 +53,16 @@ if ($compareString)
$iList->extendJsonStats(); $iList->extendJsonStats();
$stats = []; $stats = [];
foreach ($iList->json[$iList->Id] as $k => $v) foreach ($iList->json[$iList->id] as $k => $v)
$stats[] = is_numeric($v) || $v[0] == "{" ? '"'.$k.'":'.$v.'' : '"'.$k.'":"'.$v.'"'; $stats[] = is_numeric($v) || $v[0] == "{" ? '"'.$k.'":'.$v.'' : '"'.$k.'":"'.$v.'"';
foreach ($iList->itemMods[$iList->Id] as $k => $v) foreach ($iList->itemMods[$iList->id] as $k => $v)
if ($v) if ($v)
$stats[] = '"'.Util::$itemMods[$k].'":'.$v; $stats[] = '"'.Util::$itemMods[$k].'":'.$v;
$pageData['items'][] = [ $pageData['items'][] = [
$iList->Id, $iList->id,
Util::jsEscape($iList->names[$iList->Id]), Util::jsEscape($iList->names[$iList->id]),
$iList->getField('Quality'), $iList->getField('Quality'),
$iList->getField('icon'), $iList->getField('icon'),
"{".implode(",", $stats)."}" "{".implode(",", $stats)."}"

View File

@@ -58,10 +58,10 @@ if (isset($_GET['power']))
$item->renderTooltip($enh); $item->renderTooltip($enh);
$x .= '$WowheadPower.registerItem(\''.$itemString.'\', '.User::$localeId.", {\n"; $x .= '$WowheadPower.registerItem(\''.$itemString.'\', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($item->names[$item->Id])."',\n"; $x .= "\tname_".User::$localeString.": '".Util::jsEscape($item->names[$id])."',\n";
$x .= "\tquality: ".$item->getField('Quality').",\n"; $x .= "\tquality: ".$item->getField('Quality').",\n";
$x .= "\ticon: '".Util::jsEscape($item->getField('icon'))."',\n"; $x .= "\ticon: '".Util::jsEscape($item->getField('icon'))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($item->tooltip[$item->Id])."'\n"; $x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($item->tooltip[$id])."'\n";
$x .= "});"; $x .= "});";
$smarty->saveCache($cacheKeyTooltip, $x); $smarty->saveCache($cacheKeyTooltip, $x);

View File

@@ -8,10 +8,10 @@ if (!defined('AOWOW_REVISION'))
// require 'includes/allquests.php'; // require 'includes/allquests.php';
// require 'includes/class.community.php'; // not needed .. yet // require 'includes/class.community.php'; // not needed .. yet
$Id = intVal($pageParam); $id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SPELL, $Id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SPELL, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_SPELL, $Id, -1, User::$localeId]); $cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_SPELL, $id, -1, User::$localeId]);
if (isset($_GET['power'])) if (isset($_GET['power']))
{ {
@@ -21,19 +21,19 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x)) if (!$smarty->loadCache($cacheKeyTooltip, $x))
{ {
$spell = new SpellList(array(['Id', $Id])); $spell = new SpellList(array(['id', $id]));
if ($spell->error) if ($spell->error)
die('$WowheadPower.registerSpell('.$Id.', '.User::$localeId.', {});'); die('$WowheadPower.registerSpell('.$id.', '.User::$localeId.', {});');
$x = '$WowheadPower.registerSpell('.$Id.', '.User::$localeId.", {\n"; $x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n";
if ($n = $spell->names[$Id]) if ($n = $spell->names[$id])
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($n)."',\n"; $x .= "\tname_".User::$localeString.": '".Util::jsEscape($n)."',\n";
if ($i = $spell->getField('iconString')) if ($i = $spell->getField('iconString'))
$x .= "\ticon: '".Util::jsEscape($i)."',\n"; $x .= "\ticon: '".Util::jsEscape($i)."',\n";
if ($t = $spell->renderTooltip($Id)) if ($t = $spell->renderTooltip($id))
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'"; $x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($t)."'";
if ($b = $spell->renderBuff($Id)) if ($b = $spell->renderBuff($id))
$x .= ",\n\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'\n"; $x .= ",\n\tbuff_".User::$localeString.": '".Util::jsEscape($b)."'\n";
$x .= '});'; $x .= '});';
@@ -44,17 +44,17 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyPage, $pageData)) if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$spell = new SpellList(array(['Id', $Id])); $spell = new SpellList(array(['id', $id]));
// v there be dragons v // v there be dragons v
// Spelldata // Spelldata
if ($spellObj = new SpellList(array(['Id', $Id]))) if ($spellObj = new SpellList(array(['id', $id])))
{ {
$row = $spellObj->template; // equivalent to 5 layers of panzertape $row = $spellObj->template; // equivalent to 5 layers of panzertape
// Номер спелла // Номер спелла
$spell['entry'] = $row['Id']; $spell['entry'] = $row['id'];
// Имя спелла // Имя спелла
$spell['name'] = Util::localizedString($row, 'name'); $spell['name'] = Util::localizedString($row, 'name');
// Иконка спелла // Иконка спелла
@@ -148,14 +148,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$spell['effect'] = []; $spell['effect'] = [];
for ($j=1;$j<=3;$j++) for ($j=1;$j<=3;$j++)
{ {
if($row['effect'.$j.'Id'] > 0) if($row['effect'.$j.'id'] > 0)
{ {
// Название эффекта // Название эффекта
$spell['effect'][$i]['name'] = '('.$row['effect'.$j.'Id'].') '.Util::$spellEffectStrings[$row['effect'.$j.'Id']]; $spell['effect'][$i]['name'] = '('.$row['effect'.$j.'id'].') '.Util::$spellEffectStrings[$row['effect'.$j.'id']];
// Доп информация в имени // Доп информация в имени
if($row['effect'.$j.'MiscValue']) if($row['effect'.$j.'MiscValue'])
{ {
switch ($row['effect'.$j.'Id']) switch ($row['effect'.$j.'id'])
{ {
// Если эффект - создание обекта, создаем информацию о нём // Если эффект - создание обекта, создаем информацию о нём
case 50: // "Summon Object" // 103 spells, OK case 50: // "Summon Object" // 103 spells, OK
@@ -199,7 +199,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// Если просто урон школой - добавляем подпись школы // Если просто урон школой - добавляем подпись школы
if($row['effect'.$j.'Id'] == 2 && $spell['school']) if($row['effect'.$j.'id'] == 2 && $spell['school'])
$spell['effect'][$i]['name'] .= ' ('.$spell['school'].')'; $spell['effect'][$i]['name'] .= ' ('.$spell['school'].')';
// Радиус действия эффекта // Радиус действия эффекта
if($row['effect'.$j.'RadiusMax']) if($row['effect'.$j.'RadiusMax'])
@@ -233,7 +233,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
elseif($row['effect'.$j.'AuraId'] > 0) elseif($row['effect'.$j.'AuraId'] > 0)
$spell['effect'][$i]['name'] .= ': Unknown Aura ('.$row['effect'.$j.'AuraId'].')'; $spell['effect'][$i]['name'] .= ': Unknown Aura ('.$row['effect'.$j.'AuraId'].')';
// Создает вещь: // Создает вещь:
if($row['effect'.$j.'Id'] == 24) if($row['effect'.$j.'id'] == 24)
{ {
$spell['effect'][$i]['item'] = []; $spell['effect'][$i]['item'] = [];
$spell['effect'][$i]['item']['entry'] = $row['effect'.$j.'CreateItemId']; $spell['effect'][$i]['item']['entry'] = $row['effect'.$j.'CreateItemId'];

View File

@@ -6,18 +6,18 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php'; require 'includes/class.community.php';
$Id = intVal($pageParam); $id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, $Id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, $id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData)) if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$title = new TitleList(array(['Id', $Id])); $title = new TitleList(array(['id', $id]));
if ($title->error) if ($title->error)
{ {
$smarty->updatePageVars(array( $smarty->updatePageVars(array(
'subject' => ucfirst(Lang::$game['title']), 'subject' => ucfirst(Lang::$game['title']),
'id' => $Id, 'id' => $id,
'notFound' => sprintf(Lang::$main['pageNotFound'], Lang::$game['title']), 'notFound' => sprintf(Lang::$main['pageNotFound'], Lang::$game['title']),
)); ));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
@@ -46,19 +46,19 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$pageData = array( $pageData = array(
'page' => array( 'page' => array(
'name' => $title->getHtmlizedName(), 'name' => $title->getHtmlizedName(),
'id' => $Id, 'id' => $id,
'expansion' => Util::$expansionString[$title->getField('expansion')] 'expansion' => Util::$expansionString[$title->getField('expansion')]
), ),
'infobox' => '[li][ul]'.implode('[/ul][ul]', $infobox).'[/ul][/li]', 'infobox' => '[li][ul]'.implode('[/ul][ul]', $infobox).'[/ul][/li]',
); );
foreach ($title->sources[$Id] as $type => $entries) foreach ($title->sources[$id] as $type => $entries)
{ {
// todo: hidden-/visibleCols by actual use // todo: hidden-/visibleCols by actual use
switch ($type) switch ($type)
{ {
case 4: case 4:
$quests = new QuestList(array(['Id', $entries])); $quests = new QuestList(array(['id', $entries]));
$quests->addRewardsToJscript($pageData); $quests->addRewardsToJscript($pageData);
$pageData['page']['questReward'] = $quests->getListviewData(); $pageData['page']['questReward'] = $quests->getListviewData();
@@ -70,7 +70,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
break; break;
case 12: case 12:
$acvs = new AchievementList(array(['Id', $entries])); $acvs = new AchievementList(array(['id', $entries]));
$acvs->addGlobalsToJscript($pageData); $acvs->addGlobalsToJscript($pageData);
$acvs->addRewardsToJscript($pageData); $acvs->addRewardsToJscript($pageData);
@@ -98,7 +98,7 @@ $smarty->updatePageVars(array(
'path' => $pageData['path'], 'path' => $pageData['path'],
'tab' => 0, // for g_initHeader($tab) 'tab' => 0, // for g_initHeader($tab)
'type' => TYPE_TITLE, // 11:Titles 'type' => TYPE_TITLE, // 11:Titles
'typeId' => $Id 'typeId' => $id
)); ));
@@ -107,7 +107,7 @@ $announcements = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE flags
foreach ($announcements as $k => $v) foreach ($announcements as $k => $v)
$announcements[$k]['text'] = Util::localizedString($v, 'text'); $announcements[$k]['text'] = Util::localizedString($v, 'text');
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $Id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main)); $smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('data', $pageData); $smarty->assign('data', $pageData);
$smarty->assign('mysql', DB::Aowow()->getStatistics()); $smarty->assign('mysql', DB::Aowow()->getStatistics());

View File

@@ -113,7 +113,7 @@ if ($searchMask & 0x1)
if ($data = $classes->getListviewData()) if ($data = $classes->getListviewData())
{ {
while ($classes->iterate()) while ($classes->iterate())
$data[$classes->Id]['param1'] = '"class_'.strToLower($classes->getField('fileString')).'"'; $data[$classes->id]['param1'] = '"class_'.strToLower($classes->getField('fileString')).'"';
$found['class'] = array( $found['class'] = array(
'type' => TYPE_CLASS, 'type' => TYPE_CLASS,
@@ -138,7 +138,7 @@ if ($searchMask & 0x2)
if ($data = $races->getListviewData()) if ($data = $races->getListviewData())
{ {
while ($races->iterate()) while ($races->iterate())
$data[$races->Id]['param1'] = '"race_'.strToLower($races->getField('fileString')).'_male"'; $data[$races->id]['param1'] = '"race_'.strToLower($races->getField('fileString')).'_male"';
$found['race'] = array( $found['race'] = array(
'type' => TYPE_RACE, 'type' => TYPE_RACE,
@@ -212,7 +212,7 @@ if ($searchMask & 0x10)
if ($data = $money->getListviewData()) if ($data = $money->getListviewData())
{ {
while ($money->iterate()) while ($money->iterate())
$data[$money->Id]['param1'] = strToLower($money->getField('iconString')); $data[$money->id]['param1'] = strToLower($money->getField('iconString'));
$found['currency'] = array( $found['currency'] = array(
'type' => TYPE_CURRENCY, 'type' => TYPE_CURRENCY,
@@ -232,7 +232,7 @@ if ($searchMask & 0x20)
if ($data = $sets->getListviewData()) if ($data = $sets->getListviewData())
{ {
while ($sets->iterate()) while ($sets->iterate())
$data[$sets->Id]['param1'] = $sets->getField('quality'); $data[$sets->id]['param1'] = $sets->getField('quality');
$found['itemset'] = array( $found['itemset'] = array(
'type' => TYPE_ITEMSET, 'type' => TYPE_ITEMSET,
@@ -248,7 +248,7 @@ if ($searchMask & 0x20)
if ($searchMask & 0x40) if ($searchMask & 0x40)
{ {
if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEMSET && $found['itemset']['pieces']) if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEMSET && $found['itemset']['pieces'])
$conditions = [['i.class', [2, 4]], ['i.entry', $foundItems]]; $conditions = [['i.class', [2, 4]], ['i.entry', $found['itemset']['pieces']]];
else else
$conditions = [[User::$localeId ? 'name_loc'.User::$localeId : 'name', $query], 0]; $conditions = [[User::$localeId ? 'name_loc'.User::$localeId : 'name', $query], 0];
$items = new ItemList($conditions); $items = new ItemList($conditions);
@@ -258,8 +258,8 @@ if ($searchMask & 0x40)
{ {
while ($items->iterate()) while ($items->iterate())
{ {
$data[$items->Id]['param1'] = '"'.$items->getField('icon').'"'; $data[$items->id]['param1'] = '"'.$items->getField('icon').'"';
$data[$items->Id]['param2'] = $items->getField('Quality'); $data[$items->id]['param2'] = $items->getField('Quality');
} }
$found['item'] = array( $found['item'] = array(
@@ -380,7 +380,7 @@ else if ($searchMask & SEARCH_TYPE_OPEN)
break; break;
$names[] = '"'.$data['name'].$set['appendix'].'"'; $names[] = '"'.$data['name'].$set['appendix'].'"';
$extra = [$set['type'], $data['Id']]; $extra = [$set['type'], $data['id']];
if (isset($data['param1'])) if (isset($data['param1']))
$extra[] = $data['param1']; $extra[] = $data['param1'];
@@ -405,7 +405,7 @@ else /* if ($searchMask & SEARCH_TYPE_REGULAR) */
// // only one match -> redirect to find // // only one match -> redirect to find
// if ($foundTotal == 1) // if ($foundTotal == 1)
// { // {
// header("Location: ?".Util::$typeStrings[$found[0]['type']].'='.$found[0]['data'][0]['Id']); // header("Location: ?".Util::$typeStrings[$found[0]['type']].'='.$found[0]['data'][0]['id']);
// die(); // die();
// } // }

View File

@@ -105,8 +105,8 @@ if (!defined('AOWOW_REVISION'))
} }
// costy and locale-independant -> cache // costy and locale-independant -> cache
if (!isset($jsonEnchants[$enchant['Id']])) if (!isset($jsonEnchants[$enchant['id']]))
$jsonEnchants[$enchant['Id']] = Util::parseItemEnchantment($enchant); $jsonEnchants[$enchant['id']] = Util::parseItemEnchantment($enchant);
// defaults // defaults
$ench = array( $ench = array(
@@ -117,7 +117,7 @@ if (!defined('AOWOW_REVISION'))
'skill' => -1, // modified if skill 'skill' => -1, // modified if skill
'slots' => [], // determied per spell but set per item 'slots' => [], // determied per spell but set per item
'enchantment' => Util::jsEscape(Util::localizedString($enchant, 'text')), 'enchantment' => Util::jsEscape(Util::localizedString($enchant, 'text')),
'jsonequip' => $jsonEnchants[$enchant['Id']], 'jsonequip' => $jsonEnchants[$enchant['id']],
'temp' => 0, // always 0 'temp' => 0, // always 0
'classes' => 0, // modified by item 'classes' => 0, // modified by item
); );
@@ -132,23 +132,23 @@ if (!defined('AOWOW_REVISION'))
$ench['jsonequip']['reqlevel'] = $enchant['requiredLevel']; $ench['jsonequip']['reqlevel'] = $enchant['requiredLevel'];
// check if the spell has an entry in skill_line_ability -> Source:Profession // check if the spell has an entry in skill_line_ability -> Source:Profession
if ($skill = DB::Aowow()->SelectCell('SELECT skillId FROM ?_skill_line_ability WHERE spellId = ?d', $enchantSpells->Id)) if ($skill = DB::Aowow()->SelectCell('SELECT skillId FROM ?_skill_line_ability WHERE spellId = ?d', $enchantSpells->id))
{ {
$ench['name'][] = Util::jsEscape($enchantSpells->names[$enchantSpells->Id])); $ench['name'][] = Util::jsEscape($enchantSpells->names[$enchantSpells->id]));
$ench['source'][] = $enchantSpells->Id; $ench['source'][] = $enchantSpells->id;
$ench['skill'] = $skill; $ench['skill'] = $skill;
$ench['slots'][] = $slot; $ench['slots'][] = $slot;
} }
// check if this item can be cast via item -> Source:Item // check if this item can be cast via item -> Source:Item
if (!isset($castItems[$enchantSpells->Id])) if (!isset($castItems[$enchantSpells->id]))
$castItems[$enchantSpells->Id] = new ItemList([['spellid_1', $enchantSpells->Id], ['name', 'Scroll of Enchant%', '!']]); // do not reuse enchantment scrolls $castItems[$enchantSpells->id] = new ItemList([['spellid_1', $enchantSpells->id], ['name', 'Scroll of Enchant%', '!']]); // do not reuse enchantment scrolls
$cI &= $castItems[$enchantSpells->Id]; // this construct is a bit .. unwieldy $cI &= $castItems[$enchantSpells->id]; // this construct is a bit .. unwieldy
while ($cI->iterate()) while ($cI->iterate())
{ {
$ench['name'][] = Util::jsEscape($cI->names[$cI->Id]); $ench['name'][] = Util::jsEscape($cI->names[$cI->id]);
$ench['source'][] = -$cI->Id; $ench['source'][] = -$cI->id;
$ench['icon'] = strTolower($cI->getField('icon')); $ench['icon'] = strTolower($cI->getField('icon'));
$ench['slots'][] = $slot; $ench['slots'][] = $slot;
@@ -171,33 +171,33 @@ if (!defined('AOWOW_REVISION'))
continue; continue;
// everything gathered // everything gathered
if (isset($enchantsOut[$enchant['Id']])) // already found, append data if (isset($enchantsOut[$enchant['id']])) // already found, append data
{ {
foreach ($enchantsOut[$enchant['Id']] as $k => $v) foreach ($enchantsOut[$enchant['id']] as $k => $v)
{ {
if (is_array($v)) if (is_array($v))
{ {
while ($pop = array_pop($ench[$k])) while ($pop = array_pop($ench[$k]))
$enchantsOut[$enchant['Id']][$k][] = $pop; $enchantsOut[$enchant['id']][$k][] = $pop;
} }
else else
{ {
if ($k == 'quality') // quality:-1 if spells and items are mixed if ($k == 'quality') // quality:-1 if spells and items are mixed
{ {
if ($enchantsOut[$enchant['Id']]['source'][0] > 0 && $ench['source'][0] < 0) if ($enchantsOut[$enchant['id']]['source'][0] > 0 && $ench['source'][0] < 0)
$enchantsOut[$enchant['Id']][$k] = -1; $enchantsOut[$enchant['id']][$k] = -1;
else if ($enchantsOut[$enchant['Id']]['source'][0] < 0 && $ench['source'][0] > 0) else if ($enchantsOut[$enchant['id']]['source'][0] < 0 && $ench['source'][0] > 0)
$enchantsOut[$enchant['Id']][$k] = -1; $enchantsOut[$enchant['id']][$k] = -1;
else else
$enchantsOut[$enchant['Id']][$k] = $ench[$k]; $enchantsOut[$enchant['id']][$k] = $ench[$k];
} }
else if ($enchantsOut[$enchant['Id']][$k] <= 0) else if ($enchantsOut[$enchant['id']][$k] <= 0)
$enchantsOut[$enchant['Id']][$k] = $ench[$k]; $enchantsOut[$enchant['id']][$k] = $ench[$k];
} }
} }
} }
else // nothing yet, create new else // nothing yet, create new
$enchantsOut[$enchant['Id']] = $ench; $enchantsOut[$enchant['id']] = $ench;
} }
// walk over each entry and strip single-item arrays // walk over each entry and strip single-item arrays

View File

@@ -132,7 +132,7 @@ if (!defined('AOWOW_REVISION'))
if ($pop['glyphEffect']) if ($pop['glyphEffect'])
$glyphSpells[] = $pop['glyphEffect']; $glyphSpells[] = $pop['glyphEffect'];
$glyphSpells = new SpellList(array(['Id', $glyphSpells])); $glyphSpells = new SpellList(array(['id', $glyphSpells]));
foreach ($locales as $lId) foreach ($locales as $lId)
{ {
@@ -145,7 +145,7 @@ if (!defined('AOWOW_REVISION'))
if (!$pop['glyphEffect']) if (!$pop['glyphEffect'])
continue; continue;
while ($glyphSpells->Id != $pop['glyphEffect']) while ($glyphSpells->id != $pop['glyphEffect'])
$glyphSpells->iterate(); $glyphSpells->iterate();
if ($glyphSpells->getField('effect1Id') != 6 && $glyphSpells->getField('effect2Id') != 6 && $glyphSpells->getField('effect3Id') != 6) if ($glyphSpells->getField('effect1Id') != 6 && $glyphSpells->getField('effect2Id') != 6 && $glyphSpells->getField('effect3Id') != 6)
@@ -193,7 +193,7 @@ if (!defined('AOWOW_REVISION'))
$m2 = $glyphSpells->getField('effect2SpellClassMask'.$l[$i]); $m2 = $glyphSpells->getField('effect2SpellClassMask'.$l[$i]);
$m3 = $glyphSpells->getField('effect3SpellClassMask'.$l[$i]); $m3 = $glyphSpells->getField('effect3SpellClassMask'.$l[$i]);
if ($glyphSpells->getField('effect'.$i.'Id') != 6 || (!$m1 && !$m2 && !$m3)) if ($glyphSpells->getField('effect'.$i.'id') != 6 || (!$m1 && !$m2 && !$m3))
continue; continue;
$where = "SpellFamilyId = ?d AND ((SpellFamilyFlags3 & 0xFFFFFFFF) & ?d OR (SpellFamilyFlags2 & 0xFFFFFFFF) & ?d OR (SpellFamilyFlags1 & 0xFFFFFFFF) & ?d)"; $where = "SpellFamilyId = ?d AND ((SpellFamilyFlags3 & 0xFFFFFFFF) & ?d OR (SpellFamilyFlags2 & 0xFFFFFFFF) & ?d OR (SpellFamilyFlags1 & 0xFFFFFFFF) & ?d)";

View File

@@ -113,7 +113,7 @@ if (!defined('AOWOW_REVISION'))
// costy and locale-independant -> cache // costy and locale-independant -> cache
if (!isset($jsonBonus[$set['spell'.$i]])) if (!isset($jsonBonus[$set['spell'.$i]]))
{ {
$bSpell = new SpellList(array(['Id', $set['spell'.$i]])); $bSpell = new SpellList(array(['id', $set['spell'.$i]]));
$jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain(); $jsonBonus[$set['spell'.$i]] = $bSpell->getStatGain();
} }

View File

@@ -114,7 +114,7 @@ if (!defined('AOWOW_REVISION'))
for ($k = 0; $k <= ($m - 1); $k++) for ($k = 0; $k <= ($m - 1); $k++)
{ {
$tSpell = new SpellList(array(['Id', $talents[$j]['rank'.($k + 1)]])); $tSpell = new SpellList(array(['id', $talents[$j]['rank'.($k + 1)]]));
$d[] = $tSpell->parseText(); $d[] = $tSpell->parseText();
$s[] = $talents[$j]['rank'.($k + 1)]; $s[] = $talents[$j]['rank'.($k + 1)];

View File

@@ -1,5 +1,5 @@
{strip} {strip}
{math equation="abs(x)" x=$an.Id assign="pId"} {math equation="abs(x)" x=$an.id assign="pId"}
{math equation="(x & 0xF)" x=$an.flags assign="mode"} {math equation="(x & 0xF)" x=$an.flags assign="mode"}
{math equation="(x & 0xF0) >> 4" x=$an.flags assign="status"} {math equation="(x & 0xF0) >> 4" x=$an.flags assign="status"}
{math equation="(x & 0xF00) >> 8" x=$an.flags assign="jsVar"} {math equation="(x & 0xF00) >> 8" x=$an.flags assign="jsVar"}
@@ -8,7 +8,7 @@
<script type="text/javascript"> <script type="text/javascript">
new Announcement({ldelim} new Announcement({ldelim}
parent: 'announcement-{$pId}', parent: 'announcement-{$pId}',
id: {$an.Id}, id: {$an.id},
text: {if $jsVar}{$an.text}{else}'{$an.text}'{/if}, text: {if $jsVar}{$an.text}{else}'{$an.text}'{/if},
name: '{$an.name}', name: '{$an.name}',
style: '{$an.style}', style: '{$an.style}',

View File

@@ -16,7 +16,7 @@
data:[ data:[
{foreach name=i from=$data item=curr} {foreach name=i from=$data item=curr}
{ldelim} {ldelim}
id:{$curr.Id}, id:{$curr.id},
name:'{$curr.name|escape:"javascript"}', name:'{$curr.name|escape:"javascript"}',
races:{$curr.races}, races:{$curr.races},
roles:{$curr.roles}, roles:{$curr.roles},

View File

@@ -30,7 +30,7 @@ var lv_comments = [
var lv_screenshots = [ var lv_screenshots = [
{foreach name=forSc from=$community.sc key=number item=sc} {foreach name=forSc from=$community.sc key=number item=sc}
{ldelim} {ldelim}
id:{$sc.Id}, id:{$sc.id},
user:'{$sc.user}', user:'{$sc.user}',
date:'{$sc.date|date_format:"%Y/%m/%d %H:%M:%S"}', date:'{$sc.date|date_format:"%Y/%m/%d %H:%M:%S"}',
width:{$sc.width}, width:{$sc.width},
@@ -50,7 +50,7 @@ var lv_screenshots = [
var lv_videos = [ var lv_videos = [
{foreach name=forVi from=$community.vi key=number item=vi} {foreach name=forVi from=$community.vi key=number item=vi}
{ldelim} {ldelim}
id:{$vi.Id}, id:{$vi.id},
user:'{$vi.user}', user:'{$vi.user}',
date:'{$vi.date|date_format:"%Y/%m/%d %H:%M:%S"}', date:'{$vi.date|date_format:"%Y/%m/%d %H:%M:%S"}',
videoType:1, {* there is only youtube *} videoType:1, {* there is only youtube *}

View File

@@ -16,7 +16,7 @@
data:[ data:[
{foreach name=i from=$data item=curr} {foreach name=i from=$data item=curr}
{ldelim} {ldelim}
id:{$curr.Id}, id:{$curr.id},
category:{$curr.category}, category:{$curr.category},
name:'{$curr.name|escape:"javascript"}', name:'{$curr.name|escape:"javascript"}',
icon:'{$curr.icon}', icon:'{$curr.icon}',

View File

@@ -24,7 +24,7 @@
{if $curr.note}note:{$curr.note},{/if} {if $curr.note}note:{$curr.note},{/if}
{if $curr.pieces}pieces:[{section name=j loop=$curr.pieces}{$curr.pieces[j]}{if $smarty.section.j.last}{else},{/if}{/section}],{/if} {if $curr.pieces}pieces:[{section name=j loop=$curr.pieces}{$curr.pieces[j]}{if $smarty.section.j.last}{else},{/if}{/section}],{/if}
{if isset($curr.type)}type:{$curr.type},{/if} {if isset($curr.type)}type:{$curr.type},{/if}
id:{$curr.Id} id:{$curr.id}
{rdelim} {rdelim}
{if $smarty.foreach.i.last}{else},{/if} {if $smarty.foreach.i.last}{else},{/if}
{/foreach} {/foreach}

View File

@@ -16,7 +16,7 @@
data:[ data:[
{foreach name=i from=$data item=curr} {foreach name=i from=$data item=curr}
{ldelim} {ldelim}
id:{$curr.Id}, id:{$curr.id},
name:'{$curr.name|escape:"javascript"}', name:'{$curr.name|escape:"javascript"}',
classes:{$curr.classes}, classes:{$curr.classes},
faction:{$curr.faction}, faction:{$curr.faction},

View File

@@ -16,7 +16,7 @@
data:[ data:[
{foreach name=i from=$data item=curr} {foreach name=i from=$data item=curr}
{ldelim} {ldelim}
id:{$curr.Id}, id:{$curr.id},
name:'{$curr.name|escape:"javascript"}', name:'{$curr.name|escape:"javascript"}',
category:{$curr.category}, category:{$curr.category},
expansion:{$curr.expansion}, expansion:{$curr.expansion},