Files
aowow/includes/types/skill.class.php
Sarjuuk 51f2828f6f - moved shared setup functions from FileGen to new CLISetup
- removed web-setup
- new CLI parameters
  --account    : create initial account(s)
  --siteconfig : edit php/aowow config values
  --dbconfig   : set up db connection
  --sql        : create db content from world/dbc-tables
  --firstrun   : [NYI] step by step initial setup

- some fixes by the wayside
  * display required arena bracket for extendedCost
  * achievement chains are searchable again
  * category trees for factions should now be correct
  * trainer tab on spell detail page reapeared
  * userMenu item 'Settings' no longer breaks the page
  * display abilities of shapeshift in tab on spell detail page
  * corrected reading ?_sourcestrings for titles
  * fixed error on race detail page
  * added simple descriptions to skill detail page
  * fixed tab "reward from" (achievement) on title detail page
  * fixed alphabetical order of some filter-dropdowns
  * fixed skill colors for spells
  * fixed power display for rune-based spells, that also cost mana
  * added more information to zones
  * also check mail_loot_template for achivements
  * fixed bug, where loot_template-ids would be reused for multiple templates
  * display sourcemore for pvp-sources
2015-05-11 22:44:54 +02:00

78 lines
2.3 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class SkillList extends BaseType
{
public static $type = TYPE_SKILL;
public static $brickFile = 'skill';
protected $queryBase = 'SELECT *, sl.id AS ARRAY_KEY FROM ?_skillline sl';
protected $queryOpts = array(
'sl' => [['si']],
'si' => ['j' => '?_icons si ON si.id = sl.iconId', 's' => ', si.iconString'],
);
public function __construct($conditions = [])
{
parent::__construct($conditions);
// post processing
foreach ($this->iterate() as &$_curTpl)
{
$_ = &$_curTpl['specializations']; // shorthand
if (!$_)
$_ = [0, 0, 0, 0, 0];
else
{
$_ = explode(' ', $_);
while (count($_) < 5)
$_[] = 0;
}
}
}
public static function getName($id)
{
$n = DB::Aowow()->SelectRow('SELECT name_loc0, name_loc2, name_loc3, name_loc6, name_loc8 FROM ?_skillline WHERE id = ?d', $id);
return Util::localizedString($n, 'name');
}
public function getListviewData()
{
$data = [];
foreach ($this->iterate() as $__)
{
$data[$this->id] = array(
'category' => $this->curTpl['typeCat'],
'categorybak' => $this->curTpl['categoryId'],
'id' => $this->id,
'name' => Util::jsEscape($this->getField('name', true)),
'profession' => $this->curTpl['professionMask'],
'recipeSubclass' => $this->curTpl['recipeSubClass'],
'specializations' => Util::toJSON($this->curTpl['specializations']),
'icon' => Util::jsEscape($this->curTpl['iconString'])
);
}
return $data;
}
public function getJSGlobals($addMask = 0)
{
$data = [];
foreach ($this->iterate() as $__)
$data[self::$type][$this->id] = ['name' => Util::jsEscape($this->getField('name', true)), 'icon' => Util::jsEscape($this->curTpl['iconString'])];
return $data;
}
public function renderTooltip() { }
}
?>