Beispiel #1
0
function iteminfo2(&$Row, $level = 0)
{
    global $DB;
    global $allitems;
    global $spell_cols;
    global $object_cols;
    $item = array();
    // Номер вещи
    $item['entry'] = $Row['entry'];
    // Название вещи
    $item['name'] = localizedName($Row);
    // Тип вещи
    $item['type'] = $Row['InventoryType'];
    $item['displayid'] = $Row['displayid'];
    // Уровень вещи
    $item['level'] = $Row['ItemLevel'];
    // Качество вещи...
    $item['quality'] = $Row['quality'];
    $item['quality2'] = 7 - $Row['quality'];
    // Требуемый уровень вещи:
    $item['reqlevel'] = $Row['RequiredLevel'];
    // Класс и подкласс вещи
    // TODO: немного неверное определение
    $item['classs'] = $Row['class'];
    $item['subclass'] = $Row['subclass'];
    $item['rclass'] = $Row['AllowableClass'];
    // Иконка вещи
    $item['iconname'] = $Row['iconname'];
    // Кол-во вещей в пачке
    $item['stackable'] = $Row['stackable'];
    // Стоимость вещи для покупки
    // DPS
    $dps = 0;
    if ($Row['class'] == 2) {
        for ($i = 1; $i <= 2; $i++) {
            $d_type = $Row['dmg_type' . $i];
            $d_min = $Row['dmg_min' . $i];
            $d_max = $Row['dmg_max' . $i];
            if ($d_max > 0 and $Row['class'] != 6) {
                $delay = $Row['delay'] / 1000;
                if ($delay > 0) {
                    $dps = $dps + round(($d_max + $d_min) / (2 * $delay), 1);
                }
            }
        }
        $item['dps'] = $dps;
        $item['speed'] = $Row['delay'] / 1000;
        if (!$item['speed']) {
            $item['speed'] = -1;
        }
    }
    // Armor
    $item['armor'] = $Row['armor'];
    $item['slot'] = $Row['InventoryType'];
    // Bag
    if ($Row['class'] == 1) {
        $item['slots'] = $Row['ContainerSlots'];
    }
    // Добавляем в глобальный массив allitems
    allitemsinfo2($Row, 0);
    if ($level > 0) {
        $item['BuyPrice'] = $Row['BuyPrice'];
        //
        $item['BagFamily'] = $Row['BagFamily'];
        $item['ContainerSlots'] = $Row['ContainerSlots'];
        $item['DisenchantID'] = $Row['DisenchantID'];
        // Навык энчанта для разборки вещи
        if ($Row['RequiredDisenchantSkill'] != -1) {
            $item['disenchantskill'] = $Row['RequiredDisenchantSkill'];
        }
        // Цена на продажу
        $item['sellgold'] = floor($Row['SellPrice'] / 10000);
        $item['sellsilver'] = floor($Row['SellPrice'] % 10000 / 100);
        $item['sellcopper'] = floor($Row['SellPrice'] % 100);
        // Цена за покупку
        $item['buygold'] = floor($Row['BuyPrice'] / 10000);
        $item['buysilver'] = floor($Row['BuyPrice'] % 10000 / 100);
        $item['buycopper'] = floor($Row['BuyPrice'] % 100);
        // Начинает квест
        if ($Row['startquest']) {
            $item['starts'] = array(GetDBQuestInfo($Row['startquest'], 0xffffff));
        }
        // Информационное окно
        $item['info'] = render_item_tooltip($Row);
        // Обучает
        $teaches = array();
        for ($j = 1; $j <= 4; $j++) {
            if ($Row['spellid_' . $j] == 483) {
                $teaches[] = spellinfo($Row['spellid_' . ($j + 1)]);
            }
        }
        if ($teaches) {
            $item['teaches'] = $teaches;
            unset($teaches);
            unset($spellrow);
        }
        // Открывает:
        // Тип замков, для которых этот предмет является ключем:
        $locks_row = $DB->selectCol('
			SELECT lockID
			FROM ?_lock
			WHERE
				(type1=1 AND lockproperties1=?d) OR
				(type2=1 AND lockproperties2=?d) OR
				(type3=1 AND lockproperties3=?d) OR
				(type4=1 AND lockproperties4=?d) OR
				(type5=1 AND lockproperties5=?d)
			', $item['entry'], $item['entry'], $item['entry'], $item['entry'], $item['entry']);
        if ($locks_row) {
            // Игровые объекты с таким типом замка:
            $item['unlocks'] = $DB->select('
				SELECT ?#
				FROM gameobject_template
				WHERE
					(
						((type IN (?a)) AND (data0 IN (?a)))
					OR
						((type IN (?a)) AND (data0 IN (?a)))
					)
				', $object_cols[0], array(GAMEOBJECT_TYPE_QUESTGIVER, GAMEOBJECT_TYPE_CHEST, GAMEOBJECT_TYPE_TRAP, GAMEOBJECT_TYPE_GOOBER, GAMEOBJECT_TYPE_CAMERA, GAMEOBJECT_TYPE_FLAGSTAND, GAMEOBJECT_TYPE_FLAGDROP), $locks_row, array(GAMEOBJECT_TYPE_DOOR, GAMEOBJECT_TYPE_BUTTON), $locks_row);
            if (!$item['unlocks']) {
                unset($item['unlocks']);
            }
        }
        unset($locks_row);
    }
    return $item;
}
 *
 */
// Необходима функция questinfo
require_once 'includes/allquests.php';
require_once 'includes/allobjects.php';
require_once 'includes/allnpcs.php';
require_once 'includes/allcomments.php';
$smarty->config_load($conf_file, 'quest');
// Номер квеста
$id = $podrazdel;
if (!($quest = load_cache(10, intval($id)))) {
    unset($quest);
    // Подключаемся к ДБ:
    global $DB;
    // Основная инфа
    $quest = GetDBQuestInfo($id, 0xffffff);
    /*              ЦЕПОЧКА КВЕСТОВ              */
    // Добавляем сам квест в цепочку
    $quest['series'] = array(array('entry' => $quest['entry'], 'Title' => $quest['Title'], 'NextQuestInChain' => $quest['NextQuestInChain']));
    // Квесты в цепочке до этого квеста
    $tmp = $quest['series'][0];
    while ($tmp) {
        $tmp = $DB->selectRow('
			SELECT q.entry, q.Title
				{, l.Title_loc?d AS `Title_loc`}
			FROM ?_quest_template q
				{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?d}
			WHERE q.NextQuestInChain=?d
			LIMIT 1
			', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $quest['series'][0]['entry']);
        if ($tmp) {
Beispiel #3
0
        if ($rows_qs) {
            $npc['starts'] = array();
            foreach ($rows_qs as $numRow => $row) {
                $npc['starts'][] = GetQuestInfo($row, 0xffffff);
            }
        }
        unset($rows_qs);
        // �ачиниают event-only кве�ты...
        $rows_qse = event_find(array('quest_creature_id' => $id));
        if ($rows_qse) {
            if (!isset($npc['starts'])) {
                $npc['starts'] = array();
            }
            foreach ($rows_qse as $event) {
                foreach ($event['creatures_quests_id'] as $ids) {
                    $npc['starts'][] = GetDBQuestInfo($ids['quest'], 0xffffff);
                }
            }
        }
        unset($rows_qse);
        // Заканчивают кве�ты...
        $rows_qe = $DB->select('
			SELECT ?#
			FROM creature_queststarter c, v_quest_template q
			WHERE
				c.id=?
				AND q.entry=c.quest
			', $quest_cols[2], $id);
        if ($rows_qe) {
            $npc['ends'] = array();
            foreach ($rows_qe as $numRow => $row) {
Beispiel #4
0
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);
}
global $page;
$page = array('Mapper' => false, 'Book' => false, 'Title' => $event['name'] . ' - ' . $smarty->get_config_vars('Event'), 'tab' => 0, 'type' => 11, 'typeid' => $event['id'], 'path' => path(0, 11));
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
// Статистика выполнения mysql запросов
$smarty->assign('mysql', $DB->getStatistics());
$smarty->assign('event', $event);
// Загружаем страницу
$smarty->display('event.tpl');
Beispiel #5
0
        $x .= '$WowheadPower.registerSpell(' . $id . ', 0,{';
        if ($spell['name']) {
            $x .= 'name: \'' . str_normalize($spell['name']) . '\',';
        }
        if ($spell['icon']) {
            $x .= 'icon: \'' . str_normalize($spell['icon']) . '\',';
        }
        if ($spell['info']) {
            $x .= 'tooltip: \'' . str_normalize($spell['info']) . '\'';
        }
        $x .= '});';
        break;
    case 'quest':
        if (!($quest = load_cache(11, $id))) {
            require_once 'includes/allquests.php';
            $quest = GetDBQuestInfo($id, QUEST_DATAFLAG_AJAXTOOLTIP);
            $quest['tooltip'] = GetQuestTooltip($quest);
            save_cache(11, $id, $quest);
        }
        $x .= '$WowheadPower.registerQuest(' . $id . ', 0,{';
        if ($quest['name']) {
            $x .= 'name: \'' . str_normalize($quest['name']) . '\',';
        }
        if ($quest['tooltip']) {
            $x .= 'tooltip: \'' . str_normalize($quest['tooltip']) . '\'';
        }
        $x .= '});';
        break;
    default:
        break;
}