forked from OregonCore/AoWoW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
npcs.php
73 lines (61 loc) · 1.69 KB
/
npcs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
// Необходима функция creatureinfo
require('includes/allnpcs.php');
$smarty->config_load($conf_file, 'npcs');
global $npc_cols;
// Разделяем из запроса класс и подкласс вещей
point_delim($podrazdel,$type,$family);
$cache_str = (empty($type)?'x':intval($type)).'_'.(empty($family)?'x':intval($family));
if(!$npcs = load_cache(2, $cache_str))
{
unset($npcs);
global $AoWoWconf;
global $DB;
$rows = $DB->select('
SELECT c.?#, c.entry
{
, l.name_loc?d as `name_loc`
, l.subname_loc'.$_SESSION['locale'].' as `subname_loc`
}
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? }
WHERE 1=1
{AND type=?}
{AND family=?}
AND factiontemplateID=faction
ORDER BY minlevel DESC, name
{LIMIT ?d}
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
($type!='')? $type: DBSIMPLE_SKIP,
(isset($family))? $family: DBSIMPLE_SKIP,
($AoWoWconf['limit']!=0)? $AoWoWconf['limit']: DBSIMPLE_SKIP
);
$npcs = array();
foreach ($rows as $numRow=>$row)
{
$npcs[$numRow] = array();
$npcs[$numRow] = creatureinfo2($row);
}
save_cache(5, $cache_str, $npcs);
}
global $page;
$page = array(
'Mapper' => false,
'Book' => false,
'Title' => $smarty->get_config_vars('NPCs'),
'tab' => 0,
'type' => 0,
'typeid' => 0,
'path' => '[0, 4,'.$type.','.$family.']'
);
$smarty->assign('page', $page);
if (count($npcs>=0))
$smarty->assign('npcs',$npcs);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
// Загружаем страницу
$smarty->display('npcs.tpl');
?>