forked from abelcaballero210890/rigaaowow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
object.php
131 lines (113 loc) · 3.29 KB
/
object.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
require_once('includes/allobjects.php');
require_once('includes/allitems.php');
require_once('includes/allcomments.php');
require_once('includes/allquests.php');
require_once('includes/allachievements.php');
require_once('includes/allevents.php');
$smarty->config_load($conf_file, 'object');
// номер объекта;
$id = intval($podrazdel);
$cache_key = cache_key($id);
if(!$object = load_cache(OBJECT_PAGE, $cache_key))
{
unset($object);
// Данные об объекте:
$object = array();
$object = objectinfo($id, 1);
// Начиниают квесты...
$rows_qs = $DB->select('
SELECT o.?#
FROM gameobject_questrelation q, quest_template o
WHERE
q.id = ?d
AND o.entry = q.quest
',
$quest_cols[2],
$id
);
if($rows_qs)
{
$object['starts'] = array();
foreach($rows_qs as $numRow=>$row)
$object['starts'][] = GetQuestInfo($row, 0xFFFFFF);
}
unset($rows_qs);
// Заканчивают квесты...
$rows_qe = $DB->select('
SELECT ?#
FROM gameobject_involvedrelation i, quest_template q
WHERE
i.id = ?d
AND q.entry = i.quest
',
$quest_cols[2],
$id
);
if($rows_qe)
{
$object['ends'] = array();
foreach($rows_qe as $numRow=>$row)
$object['ends'][] = GetQuestInfo($row, 0xFFFFFF);
}
unset($rows_qe);
// Цель критерии
$rows = $DB->select('
SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID
FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a
LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID
WHERE
a.icon = s.id
AND a.id = c.refAchievement
AND c.type IN (?a)
AND c.value1 = ?d
GROUP BY a.id
ORDER BY a.name_loc?d
',
$_SESSION['locale'],
$_SESSION['locale'],
array(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT),
$object['entry'],
$_SESSION['locale']
);
if($rows)
{
$object['criteria_of'] = array();
foreach($rows as $row)
{
allachievementsinfo2($row['id']);
$object['criteria_of'][] = achievementinfo2($row);
}
}
// Положения объектофф:
$object['position'] = position($object['entry'], 'gameobject');
// Исправить type, чтобы подсвечивались event-овые объекты
if ($object['position'])
foreach ($object['position'] as $z => $zone)
foreach ($zone['points'] as $p => $pos)
if ($pos['type'] == 0 && ($events = event_find(array('object_guid' => $pos['guid']))))
{
$names = array_select_key(event_name($events), 'name');
$object['position'][$z]['points'][$p]['type'] = 4;
$object['position'][$z]['points'][$p]['events'] = implode(", ", $names);
}
save_cache(OBJECT_PAGE, $cache_key, $object);
}
global $page;
$page = array(
'Mapper' => true,
'Book' => $object['pagetext'] ? true : false,
'Title' => $object['name'].' - '.$smarty->get_config_vars('Objects'),
'tab' => 0,
'type' => 2,
'typeid' => $object['entry'],
'path' => path(0, 5, $object['type'])
);
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
$smarty->assign('object', $object);
$smarty->display('object.tpl');
?>