Files
aowow/includes/types/pet.class.php
Sarjuuk 0c4c7ea9ae * Factions: set titles for ListPage
* GameObjects: initial implementation (some filter missing; positions not
yet availabe; some custom data to be set; required table will be added
later)
* MiscTools: fixed random page; 'implemented' missing Screenshots; fixed
access to template file
* Search: implemented check for CUSTOM_EXCLUDE_FOR_LISTVIEW if user is not
 in U_GROUP_STAFF; searches should now be cachable
* NPCs: three more tabs on detailPage

* some work against Quests
* fighting the template-system :<
2014-02-19 16:39:15 +01:00

68 lines
2.1 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class PetList extends BaseType
{
use ListviewHelper;
public static $type = TYPE_PET;
public static $brickFile = 'pet';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_pet p';
public function getListviewData()
{
$data = [];
foreach ($this->iterate() as $__)
{
$data[$this->id] = array(
'armor' => $this->curTpl['armor'],
'damage' => $this->curTpl['damage'],
'health' => $this->curTpl['health'],
'diet' => $this->curTpl['foodMask'],
'icon' => $this->curTpl['iconString'],
'id' => $this->id,
'maxlevel' => $this->curTpl['maxLevel'],
'minlevel' => $this->curTpl['minLevel'],
'name' => $this->getField('name', true),
'type' => $this->curTpl['type'],
'exotic' => $this->curTpl['exotic'],
'spells' => []
);
if ($this->curTpl['expansion'] > 0)
$data[$this->id]['expansion'] = $this->curTpl['expansion'];
for ($i = 1; $i <= 4; $i++)
if ($this->curTpl['spellId'.$i] > 0)
$data[$this->id]['spells'][] = $this->curTpl['spellId'.$i];
$data[$this->id]['spells'] = json_encode($data[$this->id]['spells'], JSON_NUMERIC_CHECK);
}
return $data;
}
public function addGlobalsToJscript(&$template, $addMask = GLOBALINFO_ANY)
{
foreach ($this->iterate() as $__)
{
if ($addMask & GLOBALINFO_RELATED)
for ($i = 1; $i <= 4; $i++)
if ($this->curTpl['spellId'.$i] > 0)
$template->extendGlobalIds(TYPE_SPELL, $this->curTpl['spellId'.$i]);
if ($addMask & GLOBALINFO_SELF)
$template->extendGlobalData(self::$type, [$this->id => ['icon' => $this->curTpl['iconString']]]);
}
}
public function renderTooltip() { }
}
?>