// Добавляем ссылку и иконку предмета // Добавляем ссылку и иконку предмета case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: $item = allitemsinfo($row['value1']); $tmp['link'] = array('href' => '?item=' . $row['value1'], 'text' => $row['name'], 'quality' => $item['quality']); $tmp['icon'] = $iconId; $achievement['icons'][] = array('itr' => $iconId++, 'type' => 'g_items', 'id' => $row['value1'], 'count' => $row['value2']); break; // Добавляем ссылку на фракцию и требуемую репутацию // Добавляем ссылку на фракцию и требуемую репутацию case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: $tmp['link'] = array('href' => '?faction=' . $row['value1'], 'text' => $row['name']); $tmp['extra_text'] = ' (' . reputations($row['value2']) . ')'; break; // Добавляем иконку золотой монетки // Добавляем иконку золотой монетки case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD: case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY: $tmp['standard'] = true; $tmp['extra_text'] = '<span class="moneygold">' . number_format($row['value2'] / 10000) . '</span>'; break; // Добавляем ссылку на ГО // Добавляем ссылку на ГО case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: $tmp['link'] = array('href' => '?object=' . $row['value1'], 'text' => $row['name']); break; default:
if (!$quest['coreqs']) { unset($quest['coreqs']); } // Вещи, необходимые для квеста $quest['itemreqs'] = array(); for ($i = 0; $i <= 4; ++$i) { if ($quest['ReqItemId' . $i] != 0 && $quest['ReqItemCount' . $i] != 0) { $quest['itemreqs'][] = array_merge(iteminfo($quest['ReqItemId' . $i]), array('count' => $quest['ReqItemCount' . $i])); } } if (!$quest['itemreqs']) { unset($quest['itemreqs']); } // Фракции необходимые для квеста if ($quest['RepObjectiveFaction'] > 0) { $quest['factionreq'] = array('name' => $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_factions WHERE factionID=?d LIMIT 1', $quest['RepObjectiveFaction']), 'entry' => $quest['RepObjectiveFaction'], 'value' => reputations($quest['RepObjectiveValue'])); } /* КВЕСТГИВЕРЫ И КВЕСТТЕЙКЕРЫ */ // КВЕСТГИВЕРЫ // НПС $rows = $DB->select(' SELECT c.entry, c.name, A, H {, l.name_loc?d AS name_loc} FROM creature_questrelation q, ?_factiontemplate, creature_template c {LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ?} WHERE q.quest=?d AND c.entry=q.id AND factiontemplateID=c.faction_A ', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $quest['entry']); if ($rows) {
function GetQuestTooltip($row) { $x = ''; // Название квеста $x .= '<table><tr><td><b class="q">' . $row['Title'] . '</b></td></tr></table>'; $x .= '<table>'; if ($row['Objectives']) { $x .= '<tr><td><br>'; $x .= $row['Objectives']; $x .= '</td></tr>'; } // $x .= '<br>'; if ($row['ReqCreatureOrGOId1'] and $row['ReqCreatureOrGOCount1'] or $row['ReqCreatureOrGOId2'] and $row['ReqCreatureOrGOCount2'] or $row['ReqCreatureOrGOId3'] and $row['ReqCreatureOrGOCount3'] or $row['ReqCreatureOrGOId4'] and $row['ReqCreatureOrGOCount4'] or $row['ReqItemId1'] and $row['ReqItemCount1'] or $row['ReqItemId2'] and $row['ReqItemCount2'] or $row['ReqItemId3'] and $row['ReqItemCount3'] or $row['ReqItemId4'] and $row['ReqItemCount4']) { $x .= '<tr><td><br>'; $x .= '<div class="q">' . LOCALE_REQUIREMENTS . ':<br></div>'; if ($row['RequiredMinRepFaction'] && $row['RequiredMinRepValue']) { $x .= '<div class="q0">- ' . LOCALE_REPUTATION_WITH . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_factions WHERE factionID=?d LIMIT 1', $row['RequiredMinRepFaction']) . ' >= ' . reputations($row['RequiredMinRepValue']) . '</div>'; } if ($row['RequiredMaxRepFaction'] && $row['RequiredMaxRepValue']) { $x .= '<div class="q0">- ' . LOCALE_REPUTATION_WITH . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_factions WHERE factionID=?d LIMIT 1', $row['RequiredMaxRepFaction']) . ' <= ' . reputations($row['RequiredMaxRepValue']) . '</div>'; } for ($j = 1; $j <= 4; $j++) { if ($row['ReqCreatureOrGOId' . $j] and $row['ReqCreatureOrGOCount' . $j]) { $x .= '- ' . (!empty($row['ObjectiveText'][$j]) ? $row['ObjectiveText'][$j] : GetQuestReq($row['ReqCreatureOrGOId' . $j], $row['ReqCreatureOrGOCount' . $j], 1)) . '<br>'; } } for ($j = 1; $j <= 4; $j++) { if ($row['ReqItemId' . $j] and $row['ReqItemCount' . $j]) { $x .= '- ' . GetQuestReq($row['ReqItemId' . $j], $row['ReqItemCount' . $j], 2) . '<br>'; } } $x .= '</td></tr>'; } $x .= '</table>'; return $x; }