| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | require_once ('includes/allobjects.php');
|
|---|
| 4 | require_once ('includes/allitems.php');
|
|---|
| 5 | require_once ('includes/allcomments.php');
|
|---|
| 6 | require_once ('includes/allquests.php');
|
|---|
| 7 |
|
|---|
| 8 | $smarty->config_load($conf_file, 'object');
|
|---|
| 9 |
|
|---|
| 10 | // номер объекта;
|
|---|
| 11 | $id = $podrazdel;
|
|---|
| 12 |
|
|---|
| 13 | if(!$object = load_cache(3, intval($id)))
|
|---|
| 14 | {
|
|---|
| 15 | unset($object);
|
|---|
| 16 |
|
|---|
| 17 | // БД
|
|---|
| 18 | global $DB;
|
|---|
| 19 |
|
|---|
| 20 | // Данные об объекте:
|
|---|
| 21 | $object = array();
|
|---|
| 22 | $object = objectinfo($id, 1);
|
|---|
| 23 |
|
|---|
| 24 | // Начиниают квесты...
|
|---|
| 25 | $rows_qs = $DB->select('
|
|---|
| 26 | SELECT o.?#
|
|---|
| 27 | FROM gameobject_questrelation q, quest_template o
|
|---|
| 28 | WHERE
|
|---|
| 29 | q.id = ?d
|
|---|
| 30 | AND o.entry = q.quest
|
|---|
| 31 | ',
|
|---|
| 32 | $quest_cols[2],
|
|---|
| 33 | $id
|
|---|
| 34 | );
|
|---|
| 35 | if ($rows_qs)
|
|---|
| 36 | {
|
|---|
| 37 | $object['starts'] = array();
|
|---|
| 38 | foreach ($rows_qs as $numRow=>$row)
|
|---|
| 39 | $object['starts'][] = GetQuestInfo($row, 0xFFFFFF);
|
|---|
| 40 | }
|
|---|
| 41 | unset ($rows_qs);
|
|---|
| 42 |
|
|---|
| 43 | // Заканчивают квесты...
|
|---|
| 44 | $rows_qe = $DB->select('
|
|---|
| 45 | SELECT ?#
|
|---|
| 46 | FROM gameobject_involvedrelation i, quest_template q
|
|---|
| 47 | WHERE
|
|---|
| 48 | i.id = ?d
|
|---|
| 49 | AND q.entry = i.quest
|
|---|
| 50 | ',
|
|---|
| 51 | $quest_cols[2],
|
|---|
| 52 | $id
|
|---|
| 53 | );
|
|---|
| 54 | if ($rows_qe)
|
|---|
| 55 | {
|
|---|
| 56 | $object['ends'] = array();
|
|---|
| 57 | foreach ($rows_qe as $numRow=>$row)
|
|---|
| 58 | $object['ends'][] = GetQuestInfo($row, 0xFFFFFF);
|
|---|
| 59 | }
|
|---|
| 60 | unset ($rows_qe);
|
|---|
| 61 |
|
|---|
| 62 | // Положения объектофф:
|
|---|
| 63 | $data = $DB->select('SELECT position_y as y, position_x as x, map as m, spawntimesecs FROM gameobject WHERE id = ?d', $id);
|
|---|
| 64 | position($data);
|
|---|
| 65 |
|
|---|
| 66 | save_cache(3, $object['entry'], $object);
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | global $page;
|
|---|
| 70 | $page = array(
|
|---|
| 71 | 'Mapper' => false,
|
|---|
| 72 | 'Book' => false,
|
|---|
| 73 | 'Title' => $object['name'].' - '.$smarty->get_config_vars('Objects'),
|
|---|
| 74 | 'tab' => 0,
|
|---|
| 75 | 'type' => 2,
|
|---|
| 76 | 'typeid' => $object['entry'],
|
|---|
| 77 | 'path' => '[0,5,'.$object['type'].']'
|
|---|
| 78 | );
|
|---|
| 79 | if($object['pagetext'])
|
|---|
| 80 | $page['Book'] = true;
|
|---|
| 81 | $page['Mapper'] = true;
|
|---|
| 82 |
|
|---|
| 83 | $smarty->assign('page', $page);
|
|---|
| 84 |
|
|---|
| 85 | // Комментарии
|
|---|
| 86 | $smarty->assign('comments', getcomments($page['type'], $page['typeid']));
|
|---|
| 87 |
|
|---|
| 88 | if (isset($allitems))
|
|---|
| 89 | $smarty->assign('allitems', $allitems);
|
|---|
| 90 | if (isset($object))
|
|---|
| 91 | $smarty->assign('object', $object);
|
|---|
| 92 | // Количество MySQL запросов
|
|---|
| 93 | $smarty->assign('mysql', $DB->getStatistics());
|
|---|
| 94 | $smarty->display('object.tpl');
|
|---|
| 95 |
|
|---|
| 96 | ?>
|
|---|