aowow/includes/class.pet.php
Sarjuuk 360f2e6878 - work agains items + some random fixes .. use own item-table
- do not display serverside events in calendar
- include gems in item comparison .. also parse their stats in setup
- filters use conditions and are more restrictive
- changed DBSimple version so it uses mysqli (mysql is deprecated as of php 5.5)
- moved each filter class to matching type; file for baseType and BaseFilter
- baseType querys are somewhat modular, trying to avoid ridiculous joins that WILL occur sometimes (especially with items) as far as possible
2013-09-22 18:20:47 +02:00

65 lines
2 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class PetList extends BaseType
{
use ListviewHelper;
public static $type = TYPE_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() { }
}
?>