diff --git a/ajax.php b/ajax.php index 83cf365..448d9db 100644 --- a/ajax.php +++ b/ajax.php @@ -81,10 +81,18 @@ switch ($what) { save_cache(11, $id, $quest); } $x .= '$WowheadPower.registerQuest(' . $id . ', 0,{'; - if ($quest['name']) - $x .= 'name: \'' . str_normalize($quest['name']) . '\','; + if (isset($quest['Title'])) + { + $x .= 'name: \'' . str_normalize($quest['Title']) . '\','; + } + else + { + $x .= 'name: \'' . 'error' . '\','; + } if ($quest['tooltip']) + { $x .= 'tooltip: \'' . str_normalize($quest['tooltip']) . '\''; + } $x .= '});'; break; default: diff --git a/includes/allitems.php b/includes/allitems.php index 01c7e42..0c3f58c 100644 --- a/includes/allitems.php +++ b/includes/allitems.php @@ -10,11 +10,11 @@ * */ -require_once 'includes/game.php'; -require_once 'includes/allspells.php'; -require_once 'includes/allitemsets.php'; -require_once 'includes/allobjects.php'; -require_once 'includes/allquests.php'; +require_once('includes/game.php'); +require_once('includes/allspells.php'); +require_once('includes/allitemsets.php'); +require_once('includes/allobjects.php'); +require_once('includes/allquests.php'); // Массивы с названиями столбцов, необходимых для различных уровней вызова функций // для allitems($level=0) - соответствия номер-иконка diff --git a/includes/allquests.php b/includes/allquests.php index c0822f7..e48fb1e 100644 --- a/includes/allquests.php +++ b/includes/allquests.php @@ -167,8 +167,10 @@ function GetQuestStrings(&$data) { $data['OfferRewardText'] = QuestReplaceStr(htmlspecialchars(!empty($data['OfferRewardText_loc']) ? $data['OfferRewardText_loc'] : $data['OfferRewardText'] )); $data['EndText'] = QuestReplaceStr(htmlspecialchars(!empty($data['EndText_loc']) ? $data['EndText_loc'] : $data['EndText'] )); - for ($j = 0; $j <= 3; ++$j) + for ($j = 1; $j <= 4; ++$j) + { $data['ObjectiveText'][$j] = QuestReplaceStr(htmlspecialchars(!empty($data['ObjectiveText' . $j . '_loc']) ? $data['ObjectiveText' . $j . '_loc'] : $data['ObjectiveText' . $j])); + } } /** diff --git a/includes/game.php b/includes/game.php index b1b50de..c2855d7 100644 --- a/includes/game.php +++ b/includes/game.php @@ -315,9 +315,15 @@ function mass_coord(&$data) { foreach ($data as $ndata) { // Если помимо координат есть ещё данные о респауне, преобразуем их к удобочитаемому виду: if (isset($ndata['spawntimesecs'])) - $tmp = array_merge(coord_db2wow($ndata['m'], $ndata['x'], $ndata['y'], false), array('r' => sec_to_time($ndata['spawntimesecs']))); + { + $coord_db2wow = coord_db2wow($ndata['m'], $ndata['x'], $ndata['y'], false) ?: array(); + $tmp = array_merge($coord_db2wow, array('r' => sec_to_time($ndata['spawntimesecs']))); + } else + { $tmp = coord_db2wow($ndata['m'], $ndata['x'], $ndata['y'], false); + } + $tmp['t'] = $ndata['type']; $xdata[] = $tmp; } diff --git a/npc.php b/npc.php index 5bd271a..117937f 100644 --- a/npc.php +++ b/npc.php @@ -234,10 +234,10 @@ if (!$npc = load_cache(1, intval($id))) { // Начиниают квесты... $rows_qs = $DB->select(' - SELECT ?# - FROM ?_creature_questrelation c, ?_quest_template q + SELECT c.?# + FROM ?_quest_relations c, ?_quest_template q WHERE - c.id=? + c.entry=? AND q.entry=c.quest ', $quest_cols[2], $id ); @@ -251,10 +251,10 @@ if (!$npc = load_cache(1, intval($id))) { // Заканчивают квесты... $rows_qe = $DB->select(' - SELECT ?# - FROM ?_creature_involvedrelation c, ?_quest_template q + SELECT c.?# + FROM ?_quest_relations c, ?_quest_template q WHERE - c.id=? + c.entry=? AND q.entry=c.quest ', $quest_cols[2], $id );