if ($tmp['A'] == -1 && $tmp['H'] == 1) { $tmp['side'] = 'horde'; } elseif ($tmp['A'] == 1 && $tmp['H'] == -1) { $tmp['side'] = 'alliance'; } $quest['start'][] = array_merge($tmp, array('type' => 'npc')); } } unset($rows); // НПС-ивентовые $rows = event_find(array('quest_id' => $quest['entry'])); if ($rows) { foreach ($rows as $event) { foreach ($event['creatures_quests_id'] as $ids) { if ($ids['quest'] == $quest['entry']) { $tmp = creatureinfo($ids['creature']); if ($tmp['react'] == '-1,1') { $tmp['side'] = 'horde'; } elseif ($tmp['react'] == '1,-1') { $tmp['side'] = 'alliance'; } $tmp['type'] = 'npc'; $tmp['event'] = $event['entry']; $quest['start'][] = $tmp; } } } } unset($rows); // ГО $rows = $DB->select('
if ($tmp) { $quest['spellreward'] = array('name' => $tmp['spellname_loc' . $_SESSION['locale']], 'entry' => $tmp['spellID']); allspellsinfo2($tmp); } unset($tmp); } // Создания, необходимые для квеста //$quest['creaturereqs'] = array(); //$quest['objectreqs'] = array(); $quest['coreqs'] = array(); for ($i = 0; $i <= 4; ++$i) { //echo $quest['ReqCreatureOrGOCount'.$i].'<br />'; if ($quest['ReqCreatureOrGOId' . $i] != 0 && $quest['ReqCreatureOrGOCount' . $i] != 0) { if ($quest['ReqCreatureOrGOId' . $i] > 0) { // Необходимо какое-либо взамодействие с созданием $quest['coreqs'][$i] = array_merge(creatureinfo($quest['ReqCreatureOrGOId' . $i]), array('req_type' => 'npc')); } else { // необходимо какое-то взаимодействие с объектом $quest['coreqs'][$i] = array_merge(objectinfo(-$quest['ReqCreatureOrGOId' . $i]), array('req_type' => 'object')); } // Количество $quest['coreqs'][$i]['count'] = $quest['ReqCreatureOrGOCount' . $i]; // Спелл if ($quest['ReqSpellCast' . $i]) { $quest['coreqs'][$i]['spell'] = array('name' => $DB->selectCell('SELECT spellname_loc' . $_SESSION['locale'] . ' FROM ?_aowow_spell WHERE spellid=?d LIMIT 1', $quest['ReqSpellCast' . $i]), 'entry' => $quest['ReqSpellCast' . $i]); } } } if (!$quest['coreqs']) { unset($quest['coreqs']); }
<?php require_once 'includes/allevents.php'; require_once 'includes/allcomments.php'; require_once 'includes/allnpcs.php'; require_once 'includes/allobjects.php'; require_once 'includes/allquests.php'; $smarty->config_load($conf_file, 'event'); $id = intval($podrazdel); $event = event_description($id); if ($event) { if ($event['npcs_guid'] && ($ids = $DB->selectCol('SELECT id FROM creature WHERE guid IN (?a) GROUP BY id', $event['npcs_guid']))) { $event['npcs'] = array(); foreach ($ids as $crid) { $event['npcs'][] = creatureinfo($crid); } } if ($event['objects_guid'] && ($ids = $DB->selectCol('SELECT id FROM gameobject WHERE guid IN (?a) GROUP BY id', $event['objects_guid']))) { $event['objects'] = array(); foreach ($ids as $goid) { $event['objects'][] = objectinfo($goid); } } if ($event['creatures_quests_id']) { $event['quests'] = array(); foreach ($event['creatures_quests_id'] as $qid) { $event['quests'][] = GetDBQuestInfo($qid['quest'], 0xffffff); } } save_cache(EVENT_PAGE, $cache_key, $achievement); }
$toDiv = array('minhealth', 'maxmana', 'minmana', 'maxhealth', 'armor', 'mindmg', 'maxdmg'); // Раздел�ем на ты��чи (ххххххххх => ххх,ххх,ххх) foreach ($toDiv as $e) { $npc[$e] = number_format($npc[$e]); } $npc['rank'] = $smarty->get_config_vars('rank' . $npc['rank']); // faction_A = faction_H $npc['faction_num'] = $row['factionID']; $npc['faction'] = $row['faction-name']; // Деньги $money = ($row['mingold'] + $row['maxgold']) / 2; $npc = @array_merge($npc, money2coins($money)); // Героик/нормал копи� �ПС if ($npc['difficulty_entry_1']) { // �то нормал �ПС, ищем героика if ($tmp = creatureinfo($npc['difficulty_entry_1'])) { $npc['heroic'] = array('type' => 0, 'entry' => $tmp['entry'], 'name' => str_replace(LOCALE_HEROIC, '', $tmp['name'])); unset($tmp); } } else { // � может быть героик �ПС одним дл� не�кольких нормалов? // �читаем что нет $tmp = $DB->selectRow(' SELECT c.entry, c.name { , l.name_loc?d as `name_loc` } FROM creature_template c { LEFT JOIN (locales_creature l) ON l.entry = c.entry AND ?
$toDiv = array('minhealth', 'maxmana', 'minmana', 'maxhealth', 'armor', 'mindmg', 'maxdmg'); // Разделяем на тысячи (ххххххххх => ххх,ххх,ххх) foreach ($toDiv as $e) { $npc[$e] = number_format($npc[$e]); } $npc['rank'] = $smarty->get_config_vars('rank' . $npc['rank']); // faction_A = faction_H $npc['faction_num'] = $row['factionID']; $npc['faction'] = $row['faction-name']; // Деньги $money = ($row['mingold'] + $row['maxgold']) / 2; $npc = array_merge($npc, money2coins($money)); // Героик/нормал копия НПС if ($npc['heroic_entry']) { // это нормал НПС, ищем героика if ($tmp = creatureinfo($npc['heroic_entry'])) { $npc['heroic'] = array('type' => 0, 'entry' => $tmp['entry'], 'name' => str_replace(LOCALE_HEROIC, '', $tmp['name'])); unset($tmp); } } else { // А может быть героик НПС одним для нескольких нормалов? // считаем что нет $tmp = $DB->selectRow(' SELECT c.entry, c.name { , l.name_loc?d as `name_loc` } FROM creature_template c { LEFT JOIN (locales_creature l) ON l.entry = c.entry AND ?
require_once 'includes/allutil.php'; // Для Ajax отключаем debug $AoWoWconf['debug'] = false; // Для Ajax ненужен реалм $AoWoWconf['realmd'] = false; // Настройка БД require_once 'includes/db.php'; // Параметры передаваемые скрипту @(list($what, $id) = explode('=', $_SERVER['QUERY_STRING'])); $id = intval($id); $x = ''; switch ($what) { case 'npc': if (!($npc = load_cache(NPC_TOOLTIP, $id))) { require_once 'includes/allnpcs.php'; $npc = creatureinfo($id, 1); save_cache(NPC_TOOLTIP, $id, $npc); } $x .= '$WowheadPower.registerNpc(' . $id . ', ' . $_SESSION['locale'] . ',{'; if ($npc['name']) { $x .= 'name_' . $locales[$_SESSION['locale']] . ': \'' . ajax_str_normalize($npc['name']) . '\','; } if ($npc['info']) { $x .= 'tooltip_' . $locales[$_SESSION['locale']] . ': \'' . ajax_str_normalize($npc['info']) . '\''; } $x .= '});'; break; case 'object': if (!($object = load_cache(OBJECT_TOOLTIP, $id))) { require_once 'includes/allobjects.php'; $object = objectinfo($id, 1);
case 'achievement': if (!($achievement = load_cache(ACHIEVEMENT_TOOLTIP, $id))) { require_once 'includes/allachievements.php'; $achievement = allachievementsinfo($id, 1); save_cache(ACHIEVEMENT_TOOLTIP, $id, $achievement); } $x .= '$WowheadPower.registerAchievement(' . $id . ', ' . $_SESSION['locale'] . ',{'; $x .= 'name_' . $locales[$_SESSION['locale']] . ': \'' . ajax_str_normalize($achievement['name']) . '\','; $x .= 'icon:\'' . $achievement['icon'] . '\','; $x .= 'tooltip_' . $locales[$_SESSION['locale']] . ':\'' . ajax_str_normalize($achievement['tooltip']) . '\''; $x .= '});'; break; case 'npc': if (!($npc = load_cache(NPC_TOOLTIP, $id))) { require_once 'includes/allnpcs.php'; $npc = creatureinfo($id); save_cache(NPC_TOOLTIP, $id, $npc); } $x .= '$WowheadPower.registerNpc(' . $id . ', ' . $_SESSION['locale'] . ',{'; $x .= 'name_' . $locales[$_SESSION['locale']] . ': \'' . ajax_str_normalize($npc['name']) . '\','; $x .= 'tooltip_' . $locales[$_SESSION['locale']] . ':\'' . ajax_str_normalize($npc['tooltip']) . '\''; $x .= '});'; break; case 'object': if (!($object = load_cache(OBJECT_TOOLTIP, $id))) { require_once 'includes/allobjects.php'; $object = objectinfo($id, 1); save_cache(OBJECT_TOOLTIP, $id, $object); } $x .= '$WowheadPower.registerObject(' . $id . ', ' . $_SESSION['locale'] . ',{'; $x .= 'name_' . $locales[$_SESSION['locale']] . ': \'' . ajax_str_normalize($object['name']) . '\',';