mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
implemented detail-page for pets
- plus food and talents, minus zones (those are just madning) - also addes some bc/classic information on pet scaling * mucked about the modelviewer, always uses high quality version .. should muck about some more to add animation-info and remove the java-option * fixed some minor issues in spell maxaffectedtaregs in spell is displayed properly and erronous adding all classes/races to globals if none where selected * created own table for creatures which unifies creature_template, locales_creature, creature_template_addon and some creatureDisplayInfo.dbc information * more work against listviews and general structure in global.js .. should probably split this file by class and reassemble it for use
This commit is contained in:
@@ -10,8 +10,8 @@ class CreatureList extends BaseType
|
||||
|
||||
public $tooltips = [];
|
||||
|
||||
protected $setupQuery = 'SELECT *, ct.entry AS ARRAY_KEY, ct.entry AS id FROM creature_template ct LEFT JOIN locales_creature lc ON lc.entry = ct.entry LEFT JOIN creature_template_addon cta on cta.entry = ct.entry WHERE [filter] [cond]';
|
||||
protected $matchQuery = 'SELECT COUNT(*) FROM creature_template ct WHERE [filter] [cond]';
|
||||
protected $setupQuery = 'SELECT ct.*, ct.id AS ARRAY_KEY, ft.A, ft.H, ft.factionId FROM ?_creature ct LEFT JOIN ?_factiontemplate ft ON ft.id = ct.faction_A WHERE [filter] [cond]';
|
||||
protected $matchQuery = 'SELECT COUNT(*) FROM ?_creature ct WHERE [filter] [cond]';
|
||||
|
||||
public static function getName($id)
|
||||
{
|
||||
@@ -23,13 +23,9 @@ class CreatureList extends BaseType
|
||||
name_loc6,
|
||||
name_loc8
|
||||
FROM
|
||||
creature_template ct
|
||||
LEFT JOIN
|
||||
locales_creature lc
|
||||
ON
|
||||
lc.entry = ct.entry
|
||||
?_creature
|
||||
WHERE
|
||||
ct.entry = ?d',
|
||||
id = ?d',
|
||||
$id
|
||||
);
|
||||
return Util::localizedString($n, 'name');
|
||||
@@ -95,8 +91,81 @@ class CreatureList extends BaseType
|
||||
return !$data ? 0 : $data[array_rand($data)];
|
||||
}
|
||||
|
||||
public function getListviewData() { }
|
||||
public function addGlobalsToJScript(&$refs) { }
|
||||
public function getListviewData($addInfoMask = 0x0)
|
||||
{
|
||||
/* looks like this data differs per occasion
|
||||
*
|
||||
* NPCINFO_TAMEABLE (0x1): include texture & react
|
||||
* NPCINFO_MODEL (0x2):
|
||||
*/
|
||||
|
||||
$data = [];
|
||||
|
||||
while ($this->iterate())
|
||||
{
|
||||
if ($addInfoMask & NPCINFO_MODEL)
|
||||
{
|
||||
$texStr = strtolower($this->curTpl['textureString']);
|
||||
|
||||
if (isset($data[$texStr]))
|
||||
{
|
||||
if ($data[$texStr]['minlevel'] > $this->curTpl['minlevel'])
|
||||
$data[$texStr]['minlevel'] = $this->curTpl['minlevel'];
|
||||
|
||||
if ($data[$texStr]['maxlevel'] < $this->curTpl['maxlevel'])
|
||||
$data[$texStr]['maxlevel'] = $this->curTpl['maxlevel'];
|
||||
|
||||
$data[$texStr]['count']++;
|
||||
}
|
||||
else
|
||||
$data[$texStr] = array(
|
||||
'family' => $this->curTpl['family'],
|
||||
'minlevel' => $this->curTpl['minlevel'],
|
||||
'maxlevel' => $this->curTpl['maxlevel'],
|
||||
'modelId' => $this->curTpl['modelId'],
|
||||
'displayId' => $this->curTpl['displayId1'],
|
||||
'skin' => $texStr,
|
||||
'count' => 1
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data[$this->id] = array(
|
||||
'family' => $this->curTpl['family'],
|
||||
'minlevel' => $this->curTpl['minlevel'],
|
||||
'maxlevel' => $this->curTpl['maxlevel'],
|
||||
'id' => $this->id,
|
||||
'boss' => $this->curTpl['type_flags'] & 0x4,
|
||||
'rank' => $this->curTpl['rank'],
|
||||
'location' => json_encode($this->getSpawns(SPAWNINFO_ZONES), JSON_NUMERIC_CHECK),
|
||||
'name' => $this->getField('name', true),
|
||||
'tag' => $this->getField('subname', true),
|
||||
'type' => $this->curTpl['type']
|
||||
);
|
||||
|
||||
if ($addInfoMask & NPCINFO_TAMEABLE)
|
||||
{
|
||||
// only first skin of first model ... we're omitting potentially 11 skins here .. but the lv accepts only one .. w/e
|
||||
$data[$this->id]['skin'] = $this->curTpl['textureString'];
|
||||
|
||||
$data[$this->id]['react'] = '['.$this->curTpl['A'].', '.$this->curTpl['H'].']';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function addGlobalsToJScript(&$refs)
|
||||
{
|
||||
if (!isset($refs['gCreatures']))
|
||||
$refs['gCreatures'] = [];
|
||||
|
||||
while ($this->iterate())
|
||||
$refs['gCreatures'][$this->id] = ['name' => $this->getField('name', true)];
|
||||
}
|
||||
|
||||
public function addRewardsToJScript(&$refs) { }
|
||||
|
||||
}
|
||||
|
||||
@@ -582,9 +582,9 @@ class SpellList extends BaseType
|
||||
case 'i': // MaxAffectedTargets
|
||||
case 'I':
|
||||
if ($lookup)
|
||||
$base = $this->refSpells[$lookup]->getField('targets');
|
||||
$base = $this->refSpells[$lookup]->getField('maxAffectedTargets');
|
||||
else
|
||||
$base = $this->getField('targets');
|
||||
$base = $this->getField('maxAffectedTargets');
|
||||
|
||||
if (in_array($op, $signs) && is_numeric($oparg) && is_numeric($base))
|
||||
eval("\$base = $base $op $oparg;");
|
||||
@@ -1606,8 +1606,11 @@ class SpellList extends BaseType
|
||||
);
|
||||
}
|
||||
|
||||
(new CharClassList(array(['id', $classes])))->addGlobalsToJScript($refs);
|
||||
(new CharRaceList(array(['id', $races])))->addGlobalsToJScript($refs);
|
||||
if ($classes)
|
||||
(new CharClassList(array(['id', $classes])))->addGlobalsToJScript($refs);
|
||||
|
||||
if ($races)
|
||||
(new CharRaceList(array(['id', $races])))->addGlobalsToJScript($refs);
|
||||
}
|
||||
|
||||
public function addRewardsToJScript(&$refs) { }
|
||||
|
||||
@@ -80,7 +80,6 @@ define('U_GROUP_MODERATOR', (U_GROUP_ADMIN|U_GROUP_MOD|U_GROUP_B
|
||||
define('U_GROUP_COMMENTS_MODERATOR', (U_GROUP_MODERATOR|U_GROUP_LOCALIZER));
|
||||
define('U_GROUP_PREMIUM_PERMISSIONS', (U_GROUP_PREMIUM|U_GROUP_STAFF|U_GROUP_VIP));
|
||||
|
||||
|
||||
// Locales
|
||||
define('LOCALE_EN', 0);
|
||||
define('LOCALE_FR', 2);
|
||||
@@ -88,12 +87,19 @@ define('LOCALE_DE', 3);
|
||||
define('LOCALE_ES', 6);
|
||||
define('LOCALE_RU', 8);
|
||||
|
||||
// Additional info in item-listviews
|
||||
// conditional information in listviews
|
||||
define('ITEMINFO_JSON', 0x1);
|
||||
define('ITEMINFO_SUBITEMS', 0x2);
|
||||
define('ITEMINFO_VENDOR', 0x4);
|
||||
define('ITEMINFO_LOOT', 0x8);
|
||||
|
||||
define('NPCINFO_TAMEABLE', 0x1);
|
||||
define('NPCINFO_MODEL', 0x2);
|
||||
|
||||
define('SPAWNINFO_ZONES', 1); // not a mask, mutually exclusive
|
||||
define('SPAWNINFO_SHORT', 2);
|
||||
define('SPAWNINFO_FULL', 3);
|
||||
|
||||
/*
|
||||
* Game
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,8 @@ abstract class BaseType
|
||||
|
||||
foreach ($c as $foo)
|
||||
if (is_array($foo))
|
||||
$sql[] = $resolveCondition($foo, $supLink);
|
||||
if ($x = $resolveCondition($foo, $supLink))
|
||||
$sql[] = $x;
|
||||
|
||||
return '('.implode($subLink, $sql).')';
|
||||
}
|
||||
@@ -99,6 +100,9 @@ abstract class BaseType
|
||||
$field = $resolveCondition($c[0], $supLink);
|
||||
else if ($c[0])
|
||||
$field = '`'.implode('`.`', explode('.', Util::sqlEscape($c[0]))).'`';
|
||||
else
|
||||
return null;
|
||||
|
||||
if (is_array($c[1]))
|
||||
{
|
||||
$val = implode(',', Util::sqlEscape($c[1]));
|
||||
@@ -128,10 +132,7 @@ abstract class BaseType
|
||||
if (isset($c[2]) && $c[2] != '!')
|
||||
$op = $c[2];
|
||||
|
||||
if (isset($field) && isset($op) && isset($val))
|
||||
return '('.$field.' '.$op.' '.$val.')';
|
||||
else
|
||||
return null;
|
||||
return '('.$field.' '.$op.' '.$val.')';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -152,6 +153,7 @@ abstract class BaseType
|
||||
unset($conditions[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($conditions as $c)
|
||||
if ($x = $resolveCondition($c, $linking))
|
||||
$sql[] = $x;
|
||||
@@ -308,7 +310,6 @@ trait listviewHelper
|
||||
|
||||
}
|
||||
|
||||
|
||||
trait spawnHelper
|
||||
{
|
||||
private static $spawnQuery = " SELECT a.guid AS ARRAY_KEY, map, position_x, position_y, spawnMask, phaseMask, spawntimesecs, eventEntry, pool_entry AS pool FROM ?# a LEFT JOIN ?# b ON a.guid = b.guid LEFT JOIN ?# c ON a.guid = c.guid WHERE id = ?d";
|
||||
@@ -329,17 +330,21 @@ trait spawnHelper
|
||||
}
|
||||
}
|
||||
|
||||
public function getSpawns($short = false)
|
||||
/*
|
||||
todo (med): implement this alpha-map-check-virtual-map-transform-wahey!
|
||||
note: map in tooltips is activated by either '#map' as anchor (will automatic open mapviewer, when clicking link) in the href or as parameterless rel-parameter e.g. rel="map" in the anchor
|
||||
*/
|
||||
public function getSpawns($spawnInfo)
|
||||
{
|
||||
// short: true => only the most populated area and only coordinates
|
||||
// SPAWNINFO_SHORT: true => only the most populated area and only coordinates
|
||||
$data = [];
|
||||
|
||||
$raw = $this->fetch();
|
||||
if (!$raw)
|
||||
return [];
|
||||
// $raw = $this->fetch();
|
||||
// if (!$raw)
|
||||
// return [];
|
||||
|
||||
/*
|
||||
long:
|
||||
SPAWNINFO_FULL:
|
||||
$data = array(
|
||||
areaId => array(
|
||||
floorNo => array (
|
||||
@@ -354,8 +359,9 @@ trait spawnHelper
|
||||
)
|
||||
)
|
||||
|
||||
short: zoneId, [pos-sets]
|
||||
$data = [6456, [[51,42.2],[51,43]]];
|
||||
SPAWNINFO_SHORT: [zoneId, [[x1, y1], [x2, y2], ..]] // only the most populated zone
|
||||
|
||||
SPAWNINFO_ZONES: [zoneId1, zoneId2, ..] // only zones
|
||||
*/
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -114,6 +114,7 @@ $lang = array(
|
||||
'mechAbbr' => "Ausw.",
|
||||
'pet' => "Begleiter",
|
||||
'pets' => "Begleiter",
|
||||
'petCalc' => "Begleiterrechner",
|
||||
'requires' => "Benötigt %s",
|
||||
'requires2' => "Benötigt",
|
||||
'reqLevel' => "Benötigt Stufe %s",
|
||||
@@ -286,9 +287,8 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'pet' => array(
|
||||
'cat' => array(
|
||||
'Wildheit', 'Hartnäckigkeit', 'Gerissenheit'
|
||||
)
|
||||
'exotic' => "Exotisch",
|
||||
'cat' => ["Wildheit", "Hartnäckigkeit", "Gerissenheit"]
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> ist das <b>%s</b>. Es enthält %s Teile.",
|
||||
|
||||
@@ -109,6 +109,7 @@ $lang = array(
|
||||
'mechAbbr' => "Mech.",
|
||||
'pet' => "Pet",
|
||||
'pets' => "Hunter Pets",
|
||||
'petCalc' => "Hunter Pet Calculator",
|
||||
'requires' => "Requires %s",
|
||||
'requires2' => "Requires",
|
||||
'reqLevel' => "Requires Level %s",
|
||||
@@ -282,9 +283,8 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'pet' => array(
|
||||
'cat' => array(
|
||||
'Ferocity', 'Tenacity', 'Cunning'
|
||||
)
|
||||
'exotic' => "Exotic",
|
||||
'cat' => ["Ferocity", "Tenacity", "Cunning"]
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> is the <b>%s</b>. It contains %s pieces.",
|
||||
|
||||
@@ -106,6 +106,7 @@ $lang = array(
|
||||
'mechAbbr' => "Mec.",
|
||||
'pet' => "Mascota",
|
||||
'pets' => "Mascotas de cazador",
|
||||
'petCalc' => "Calculadora de mascotas",
|
||||
'requires' => "Requiere %s",
|
||||
'requires2' => "Requiere",
|
||||
'reqLevel' => "Necesitas ser de nivel %s",
|
||||
@@ -240,9 +241,8 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'pet' => array(
|
||||
'cat' => array(
|
||||
'Ferocidad', 'Tenacidad', 'Astucia'
|
||||
)
|
||||
'exotic' => "Exótica",
|
||||
"cat" => ["Ferocidad", "Tenacidad", "Astucia"]
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> es el <b>%s</b>. Contiene %s piezas.",
|
||||
|
||||
@@ -106,6 +106,7 @@ $lang = array(
|
||||
'mechAbbr' => "Mécan.",
|
||||
'pet' => "Familier",
|
||||
'pets' => "Familiers de chasseur",
|
||||
'petCalc' => "Calculateur de familiers",
|
||||
'requires' => "%s requis",
|
||||
'requires2' => "Requiert",
|
||||
'reqLevel' => "Niveau %s requis",
|
||||
@@ -239,9 +240,8 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'pet' => array(
|
||||
'cat' => array(
|
||||
'Férocité', 'Tenacité', 'Ruse'
|
||||
)
|
||||
'exotic' => "Exotique"
|
||||
"cat" => ["Férocité", "Tenacité", "Ruse"]
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> est le <b>%s</b>. Il contient %s pièces.",
|
||||
|
||||
@@ -106,6 +106,7 @@ $lang = array(
|
||||
'mechAbbr' => "Механика",
|
||||
'pet' => "Питомец",
|
||||
'pets' => "Питомцы охотников",
|
||||
'petCalc' => "Расчёт умений питомцев",
|
||||
'requires' => "Требует %s",
|
||||
'requires2' => "Требуется:",
|
||||
'reqLevel' => "Требуется уровень: %s",
|
||||
@@ -239,9 +240,8 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'pet' => array(
|
||||
'cat' => array(
|
||||
'Свирепость', 'Упорство', 'Хитрость'
|
||||
)
|
||||
'exotic' => "Экзотический",
|
||||
"cat" => ["Свирепость", "Упорство", "Хитрость"]
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> — <b>%s</b>. Он состоит из %s предметов.",
|
||||
|
||||
@@ -75,13 +75,16 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
|
||||
array_unshift($title, Util::ucFirst(Lang::$game['achievements']));
|
||||
}
|
||||
|
||||
// listview content
|
||||
$pageData = array(
|
||||
'data' => $acvList->getListviewData(),
|
||||
'params' => []
|
||||
);
|
||||
|
||||
// fill g_items, g_titles, g_achievements
|
||||
$acvList->addGlobalsToJscript($pageData);
|
||||
$acvList->addRewardsToJScript($pageData);
|
||||
|
||||
// listview content
|
||||
$pageData['data'] = $acvList->getListviewData();
|
||||
|
||||
// if we are have different cats display field
|
||||
if ($acvList->hasDiffFields(['category']))
|
||||
$pageData['params']['visibleCols'] = "$['category']";
|
||||
|
||||
186
pages/pet.php
Normal file
186
pages/pet.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
require 'includes/class.community.php';
|
||||
|
||||
$id = intVal($pageParam);
|
||||
$petCalc = '0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789';
|
||||
|
||||
|
||||
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_PET, $id, -1, User::$localeId]);
|
||||
|
||||
if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
{
|
||||
$pet = new PetList(array(['id', $id]));
|
||||
if ($pet->error)
|
||||
$smarty->notFound(Lang::$game['pet']);
|
||||
|
||||
$pet->addGlobalsToJscript($pageData);
|
||||
$pet->reset();
|
||||
|
||||
$infobox = [];
|
||||
|
||||
// level range
|
||||
$infobox[] = '[li]'.Lang::$game['level'].Lang::$colon.$pet->getField('minLevel').' - '.$pet->getField('maxLevel').'[/li]';
|
||||
|
||||
// exotic
|
||||
if ($pet->getField('exotic'))
|
||||
$infobox[] = '[li][url=?spell=53270]'.Lang::$pet['exotic'].'[/url][/li]';
|
||||
|
||||
$pageData = array(
|
||||
'title' => $pet->getField('name', true),
|
||||
'path' => '[0, 8, '.$pet->getField('type').']',
|
||||
'page' => array(
|
||||
'petCalc' => $petCalc[(int)($id / 10)] . $petCalc[(2 * ($id % 10) + ($pet->getField('exotic') ? 1 : 0))],
|
||||
'name' => $pet->getField('name', true),
|
||||
'id' => $id,
|
||||
'icon' => $pet->getField('iconString'),
|
||||
'expansion' => Util::$expansionString[$pet->getField('expansion')]
|
||||
),
|
||||
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
|
||||
);
|
||||
|
||||
// tameable & gallery
|
||||
$condition = array(
|
||||
['ct.type', 1], // Beast
|
||||
['ct.type_flags', 0x1, '&'], // tameable
|
||||
['ct.family', $id], // displayed petType
|
||||
[
|
||||
'OR', // at least neutral to at least one faction
|
||||
['ft.A', 1, '<'],
|
||||
['ft.H', 1, '<']
|
||||
]
|
||||
);
|
||||
$tng = new CreatureList($condition);
|
||||
|
||||
$pageData['tameable'] = array(
|
||||
'data' => $tng->getListviewData(NPCINFO_TAMEABLE),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_tameable',
|
||||
'tabs' => '$tabsRelated',
|
||||
'hiddenCols' => "$['type']",
|
||||
'visibleCols' => "$['skin']",
|
||||
'note' => '$sprintf(LANG.lvnote_filterresults, \'?npcs=1&filter=fa=38\')',
|
||||
'id' => 'tameable'
|
||||
]
|
||||
);
|
||||
|
||||
$pageData['gallery'] = array(
|
||||
'data' => $tng->getListviewData(NPCINFO_MODEL),
|
||||
'params' => [
|
||||
'tabs' => '$tabsRelated'
|
||||
]
|
||||
);
|
||||
|
||||
// diet
|
||||
$list = [];
|
||||
$mask = $pet->getField('foodMask');
|
||||
for ($i = 1; $i < 7; $i++)
|
||||
if ($mask & (1 << ($i - 1)))
|
||||
$list[] = $i;
|
||||
|
||||
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list]));
|
||||
$food->addGlobalsToJscript($pageData);
|
||||
|
||||
$pageData['diet'] = array(
|
||||
'data' => $food->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.diet',
|
||||
'tabs' => '$tabsRelated',
|
||||
'hiddenCols' => "$['source', 'slot', 'side']",
|
||||
'sort' => "$['level']",
|
||||
'id' => 'diet'
|
||||
]
|
||||
);
|
||||
|
||||
// spells
|
||||
$mask = 0x0;
|
||||
foreach (Util::$skillLineMask[-1] as $idx => $pair)
|
||||
{
|
||||
if ($pair[0] == $id)
|
||||
{
|
||||
$mask = 1 << $idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$conditions = [
|
||||
['s.typeCat', -3], // Pet-Ability
|
||||
[
|
||||
'OR',
|
||||
['skillLine1', $pet->getField('skillLineId')], // match: first skillLine
|
||||
[
|
||||
'AND', // match: second skillLine (if not mask)
|
||||
['skillLine1', 0, '>'],
|
||||
['skillLine2OrMask', $pet->getField('skillLineId')]
|
||||
],
|
||||
[
|
||||
'AND', // match: skillLineMask (if mask)
|
||||
['skillLine1', -1],
|
||||
['skillLine2OrMask', $mask, '&']
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
$spells = new SpellList($conditions);
|
||||
$spells->addGlobalsToJscript($pageData);
|
||||
|
||||
$pageData['abilities'] = array(
|
||||
'data' => $spells->getListviewData(),
|
||||
'params' => [
|
||||
'name' => '$LANG.tab_abilities',
|
||||
'tabs' => '$tabsRelated',
|
||||
'visibleCols' => "$['schools', 'level']",
|
||||
'id' => 'abilities'
|
||||
]
|
||||
);
|
||||
|
||||
// talents
|
||||
$conditions = [['s.typeCat', -7]];
|
||||
switch($pet->getField('type'))
|
||||
{
|
||||
case 0: $conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE0, '&']; break;
|
||||
case 1: $conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE1, '&']; break;
|
||||
case 2: $conditions[] = ['s.cuFlags', SPELL_CU_PET_TALENT_TYPE2, '&']; break;
|
||||
}
|
||||
|
||||
$talents = new SpellList($conditions);
|
||||
$talents->addGlobalsToJscript($pageData);
|
||||
|
||||
$pageData['talents'] = array(
|
||||
'data' => $talents->getListviewData(),
|
||||
'params' => [
|
||||
'tabs' => '$tabsRelated',
|
||||
'visibleCols' => "$['tier', 'level']",
|
||||
'name' => '$LANG.tab_talents',
|
||||
'id' => 'talents',
|
||||
'sort' => "$['tier', 'name']",
|
||||
'_petTalents' => 1
|
||||
]
|
||||
);
|
||||
|
||||
$smarty->saveCache($cacheKeyPage, $pageData);
|
||||
}
|
||||
|
||||
$smarty->updatePageVars(array(
|
||||
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['pet']),
|
||||
'path' => $pageData['path'],
|
||||
'tab' => 0, // for g_initHeader($tab)
|
||||
'type' => TYPE_PET, // 9:Pets
|
||||
'typeId' => $id,
|
||||
'reqJS' => array(
|
||||
array('path' => 'template/js/swfobject.js')
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
$smarty->assign('community', CommunityContent::getAll(TYPE_PET, $id)); // comments, screenshots, videos
|
||||
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game));
|
||||
$smarty->assign('lvData', $pageData);
|
||||
$smarty->assign('mysql', DB::Aowow()->getStatistics());
|
||||
$smarty->display('pet.tpl');
|
||||
|
||||
?>
|
||||
@@ -29,7 +29,7 @@ $validCats = array(
|
||||
-4 => true, // Racial Traits
|
||||
-5 => true, // Mounts
|
||||
-6 => true, // Companions
|
||||
-7 => [409, 410, 411], // PetTalents => TalenTtabId
|
||||
-7 => [409, 410, 411], // PetTalents => TalentTabId
|
||||
-8 => true, // NPC Abilities
|
||||
-9 => true, // GM Abilities
|
||||
-11 => [6, 8, 10], // Proficiencies [Weapon, Armor, Language]
|
||||
|
||||
BIN
setup/aowow_creature_pet.rar
Normal file
BIN
setup/aowow_creature_pet.rar
Normal file
Binary file not shown.
@@ -3,23 +3,83 @@
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
$ids = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, skillLine1 FROM dbc.creatureFamily WHERE petTalentType <> -1');
|
||||
|
||||
foreach ($ids as $family => $skillLine)
|
||||
class PetSetup extends PetList
|
||||
{
|
||||
$rows = DB::Aowow()->select('SELECT MAX(s.id) as Id, IF(t.id, 1, 0) AS isTalent FROM dbc.spell s JOIN dbc.skillLineAbility sla ON sla.spellId = s.id LEFT JOIN dbc.talent t ON t.rank1 = s.id WHERE (s.attributes0 & 0x40) = 0 AND sla.skillLineId = ?d GROUP BY s.nameEN', $skillLine);
|
||||
$i = 1;
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
if ($row['isTalent'])
|
||||
continue;
|
||||
private static $classicMods = array( // [Armor, Damage, Health] (see related "Tamed Pet Passive (DND)" spells per family. All values are set to +5% in wotlk)
|
||||
1 => [ 5, 0, 0], // Wolf
|
||||
2 => [ 0, 10, -2], // Cat
|
||||
3 => [ 0, 7, 0], // Spider
|
||||
4 => [ 5, -9, 8], // Bear
|
||||
5 => [ 9, -10, 4], // Boar
|
||||
6 => [ 10, 0, -5], // Crocolisk
|
||||
7 => [ 5, 0, 0], // Carrion bird
|
||||
8 => [ 13, -5, -4], // Crab
|
||||
9 => [ 0, 2, 4], // Gorilla
|
||||
11 => [ 3, 10, -5], // Raptor
|
||||
12 => [ 0, 0, 5], // Tallstrider
|
||||
20 => [ 10, -6, 0], // Scorpid
|
||||
21 => [ 13, -10, 0], // Turtle
|
||||
24 => [ 0, 7, 0], // Bat
|
||||
25 => [ 5, 0, 0], // Hyena
|
||||
26 => [ 0, 7, 0], // Bord of Prey (Owl)
|
||||
27 => [ 0, 7, 0], // Wind serpent
|
||||
30 => [ 0, 0, 0], // Dragonhawk
|
||||
31 => [ 5, 10, -7], // Ravager
|
||||
32 => [ 5, -6, 0], // Warp stalker
|
||||
33 => [ 0, 0, 0], // Sporebat
|
||||
34 => [-10, 3, 10], // Nether ray
|
||||
35 => [ 0, 0, 0] // Serpent
|
||||
);
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_pet SET spellId'.$i.' = ?d WHERE id = ?d', $row['Id'], $family);
|
||||
$i++;
|
||||
private static $addonInfo = array( // i could have sworn that was somewhere in dbc
|
||||
30 => [1, 0],
|
||||
31 => [1, 0],
|
||||
32 => [1, 0],
|
||||
33 => [1, 0],
|
||||
34 => [1, 0],
|
||||
37 => [2, 0],
|
||||
38 => [2, 1],
|
||||
39 => [2, 1],
|
||||
41 => [2, 1],
|
||||
42 => [2, 1],
|
||||
43 => [2, 1],
|
||||
44 => [2, 0],
|
||||
45 => [2, 1],
|
||||
46 => [2, 1]
|
||||
),
|
||||
|
||||
function setupPetSpells()
|
||||
{
|
||||
$ids = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, skillLine1 FROM dbc.creatureFamily WHERE petTalentType <> -1');
|
||||
|
||||
foreach ($ids as $family => $skillLine)
|
||||
{
|
||||
$rows = DB::Aowow()->select('SELECT MAX(s.id) as Id, IF(t.id, 1, 0) AS isTalent FROM dbc.spell s JOIN dbc.skillLineAbility sla ON sla.spellId = s.id LEFT JOIN dbc.talent t ON t.rank1 = s.id WHERE (s.attributes0 & 0x40) = 0 AND sla.skillLineId = ?d GROUP BY s.nameEN', $skillLine);
|
||||
$i = 1;
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
if ($row['isTalent'])
|
||||
continue;
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_pet SET spellId'.$i.' = ?d WHERE id = ?d', $row['Id'], $family);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
echo 'done';
|
||||
}
|
||||
|
||||
function setupClassicMods()
|
||||
{
|
||||
foreach (self::$classicMods as $pet => $mods)
|
||||
DB::Aowow()->query('UPDATE ?_pet SET armor = ?d, damage = ?d, health = ?d WHERE id = ?d', $mods[0], $mods[1], $mods[2], $pet);
|
||||
}
|
||||
|
||||
function setupAddonInfo()
|
||||
{
|
||||
foreach (self::$addonInfo as $pet => $info)
|
||||
DB::Aowow()->query('UPDATE ?_pet SET expansion = ?d, exotic = ?d WHERE id = ?d', $info[0], $info[1], $pet);
|
||||
}
|
||||
}
|
||||
|
||||
echo 'done';
|
||||
|
||||
?>
|
||||
|
||||
8
template/bricks/globals/creatures.tpl
Normal file
8
template/bricks/globals/creatures.tpl
Normal file
@@ -0,0 +1,8 @@
|
||||
var _ = g_npcs;
|
||||
{strip}
|
||||
{foreach from=$data key=id item=item}
|
||||
_[{$id}]={ldelim}
|
||||
name_{$user.language}:'{$item.name|escape:"javascript"}'
|
||||
{rdelim};
|
||||
{/foreach}
|
||||
{/strip}
|
||||
@@ -6,4 +6,4 @@ var _ = g_gatheredcurrencies;
|
||||
icon:'{$item.icon|escape:"javascript"}'
|
||||
{rdelim};
|
||||
{/foreach}
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
@@ -32,4 +32,4 @@
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
65
template/bricks/listviews/creature.tpl
Normal file
65
template/bricks/listviews/creature.tpl
Normal file
@@ -0,0 +1,65 @@
|
||||
{strip}
|
||||
new Listview({ldelim}
|
||||
template:'npc',
|
||||
{if !isset($params.id)}id:'spells',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_npcs,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{foreach name=params from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
{else if $v}
|
||||
{$k}:'{$v}',
|
||||
{/if}
|
||||
{/foreach}
|
||||
data:[
|
||||
{foreach name=i from=$data item=curr}
|
||||
{ldelim}
|
||||
name:'{$curr.name|escape:"quotes"}',
|
||||
{if $curr.tag}
|
||||
tag:'{$curr.tag|escape:"quotes"}',
|
||||
{/if}
|
||||
minlevel:{$curr.minlevel},
|
||||
maxlevel:{$curr.maxlevel},
|
||||
type:{$curr.type},
|
||||
classification:{$curr.rank},
|
||||
{if $curr.boss}
|
||||
boss: 1,
|
||||
{/if}
|
||||
react:{$curr.react},
|
||||
location:{$curr.location},
|
||||
{if $curr.skin}
|
||||
skin: '{$curr.skin}',
|
||||
{/if}
|
||||
{if isset($curr.percent)}
|
||||
percent:{$curr.percent},
|
||||
{/if}
|
||||
{if isset($curr.cost)}
|
||||
stock:{$curr.stock},
|
||||
{if isset($curr.stack)}
|
||||
stack:{$curr.stack},
|
||||
{/if}
|
||||
cost:[
|
||||
{if isset($curr.cost.money)}{$curr.cost.money}{/if}
|
||||
{if isset($curr.cost.honor) or isset($curr.cost.arena) or isset($curr.cost.items)}
|
||||
,{if isset($curr.cost.honor)}{$curr.cost.honor}{/if}
|
||||
{if isset($curr.cost.arena) or isset($curr.cost.items)}
|
||||
,{if isset($curr.cost.arena)}{$curr.cost.arena}{/if}
|
||||
{if isset($curr.cost.items)}
|
||||
,[
|
||||
{foreach from=$curr.cost.items item=curitem name=c}
|
||||
[{$curitem.item},{$curitem.count}]
|
||||
{if $smarty.foreach.c.last}{else},{/if}
|
||||
{/foreach}
|
||||
]
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
],
|
||||
{/if}
|
||||
id:{$curr.id}
|
||||
{rdelim}
|
||||
{if $smarty.foreach.i.last}{else},{/if}
|
||||
{/foreach}
|
||||
]{rdelim}
|
||||
);
|
||||
{/strip}
|
||||
@@ -17,10 +17,10 @@
|
||||
id:{$curr.id},
|
||||
category:{$curr.category},
|
||||
name:'{$curr.name|escape:"javascript"}',
|
||||
icon:'{$curr.icon}',
|
||||
icon:'{$curr.icon}'
|
||||
{rdelim}
|
||||
{if $smarty.foreach.i.last}{else},{/if}
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
29
template/bricks/listviews/model.tpl
Normal file
29
template/bricks/listviews/model.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
{strip}
|
||||
new Listview({ldelim}
|
||||
template:'model',
|
||||
{if !isset($params.id)}id:'gallery',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_gallery,{/if}
|
||||
{if !isset($params.parent)}parent:'listview-generic',{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
{else if $v}
|
||||
{$k}:'{$v}',
|
||||
{/if}
|
||||
{/foreach}
|
||||
data:[
|
||||
{foreach name=i from=$data item=curr}
|
||||
{ldelim}
|
||||
family:{$curr.family},
|
||||
modelId:{$curr.modelId},
|
||||
displayId:{$curr.displayId},
|
||||
skin:'{$curr.skin|escape:"javascript"}',
|
||||
count:{$curr.count},
|
||||
minLevel:{$curr.minlevel},
|
||||
maxLevel:{$curr.maxlevel}
|
||||
{rdelim}
|
||||
{if $smarty.foreach.i.last}{else},{/if}
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
@@ -54,4 +54,4 @@ var _ = function(family)
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
@@ -31,4 +31,4 @@
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
{/strip}
|
||||
|
||||
@@ -33,4 +33,3 @@
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
|
||||
|
||||
@@ -2058,7 +2058,8 @@ a.star-icon-right span
|
||||
|
||||
.screenshot-cell img
|
||||
{
|
||||
border: 3px solid #404040;
|
||||
border: 2px solid #404040;
|
||||
background-color: #080808;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,5 +39,6 @@
|
||||
{if isset($lvData.gRaces)} { include file='bricks/globals/races.tpl' data=$lvData.gRaces }{/if}
|
||||
{if isset($lvData.gSpells)} { include file='bricks/globals/spells.tpl' data=$lvData.gSpells }{/if}
|
||||
{if isset($lvData.gTitles)} { include file='bricks/globals/titles.tpl' data=$lvData.gTitles }{/if}
|
||||
{* TODO: Factions, Quests, NPCs, Objects, g_gatheredzones(?) *}
|
||||
{if isset($lvData.gCreatures)} { include file='bricks/globals/creatures.tpl' data=$lvData.gCreatures }{/if}
|
||||
{* TODO: Factions, Quests, Objects, g_gatheredzones(?) *}
|
||||
</script>{/strip}
|
||||
|
||||
@@ -2736,13 +2736,13 @@ function TalentCalc() {
|
||||
allowfullscreen: true,
|
||||
menu: false,
|
||||
bgcolor: '#181818',
|
||||
wmode: 'opaque'
|
||||
wmode: 'direct'
|
||||
};
|
||||
|
||||
var attributes = {};
|
||||
|
||||
swfobject.embedSWF(
|
||||
swfUrl + '/modelviewer/ModelView.swf',
|
||||
swfUrl + '/modelviewer/ZAMviewerfp11.swf',
|
||||
_swfModel.id,
|
||||
'100%',
|
||||
'100%',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -858,7 +858,7 @@ var mn_database = [
|
||||
];
|
||||
var mn_tools = [
|
||||
[0,"Talent Calculator","?talent",mn_talentCalc],
|
||||
[2,"Pet Calculator","?petcalc",mn_petCalc],
|
||||
[2,"Hunter Pet Calculator","?petcalc",mn_petCalc],
|
||||
[3,"Item Comparison","?compare"],
|
||||
[5,"Profiler","?profiler",[
|
||||
[0,"Characters","?profiles"],
|
||||
|
||||
59
template/pet.tpl
Normal file
59
template/pet.tpl
Normal file
@@ -0,0 +1,59 @@
|
||||
{include file='header.tpl'}
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
{if !empty($announcements)}
|
||||
{foreach from=$announcements item=item}
|
||||
{include file='bricks/announcement.tpl' an=$item}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
{include file='bricks/community.tpl'}
|
||||
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
|
||||
g_initPath({$page.path});
|
||||
//]]></script>
|
||||
|
||||
{include file='bricks/infobox.tpl'}
|
||||
|
||||
<div class="text">
|
||||
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: 9, typeId: {$lvData.page.id} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
|
||||
<a href="?petcalc#{$lvData.page.petCalc}" class="button-red"><em><b><i>{$lang.petCalc}</i></b><span>{$lang.petCalc}</span></em></a>
|
||||
<a href="http://old.wowhead.com/?{$query[0]}={$query[1]}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
|
||||
<div id="h1-icon-generic" class="h1-icon"></div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.icon}', 1));
|
||||
//]]></script>
|
||||
|
||||
<h1 class="h1-icon">{if isset($lvData.page.expansion)}<span class="{$lvData.page.expansion}-icon-right">{$lvData.page.name}</span>{else}{$lvData.page.name}{/if}</h1>
|
||||
|
||||
{include file='bricks/article.tpl'}
|
||||
|
||||
<h2 class="clear">{$lang.related}</h2>
|
||||
</div>
|
||||
|
||||
<div id="tabs-generic"></div>
|
||||
<div id="listview-generic" class="listview"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
|
||||
{if isset($lvData.gallery)} {include file='bricks/listviews/model.tpl' data=$lvData.gallery.data params=$lvData.gallery.params } {/if}
|
||||
{if isset($lvData.tameable)} {include file='bricks/listviews/creature.tpl' data=$lvData.tameable.data params=$lvData.tameable.params } {/if}
|
||||
{if isset($lvData.abilities)} {include file='bricks/listviews/spell.tpl' data=$lvData.abilities.data params=$lvData.abilities.params} {/if}
|
||||
{if isset($lvData.talents)} {include file='bricks/listviews/spell.tpl' data=$lvData.talents.data params=$lvData.talents.params } {/if}
|
||||
{if isset($lvData.diet)} {include file='bricks/listviews/item.tpl' data=$lvData.diet.data params=$lvData.diet.params } {/if}
|
||||
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
|
||||
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
|
||||
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
|
||||
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
|
||||
tabsRelated.flush();
|
||||
//]]></script>
|
||||
|
||||
{include file='bricks/contribute.tpl'}
|
||||
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
{include file='footer.tpl'}
|
||||
Reference in New Issue
Block a user