/**
 *
 * @param type $id
 * @return type 
 */
function spellinfo($id)
{
    global $DB;
    $row = $DB->selectRow('
		SELECT s.*, i.iconname
		FROM ?_aowow_spell s, ?_aowow_spellicons i
		WHERE
			s.spellID=?
			AND i.id = s.spellicon
		LIMIT 1
		', $id);
    return spellinfo2($row);
}
Example #2
0
		FROM ?_itemset
		WHERE name LIKE ?
	', $nsearch);
foreach ($rows as $numRow => $row) {
    $found['itemset'][] = itemsetinfo2($row);
}
// Ищем спеллы
$rows = $DB->select('
		SELECT ?#, spellID
		FROM ?_spell s, ?_spellicons i
		WHERE
			s.spellname like ?
			AND i.id = s.spellicon
	', $spell_cols[2], $nsearch);
foreach ($rows as $numRow => $row) {
    $found['spell'][] = spellinfo2($row);
}
$keys = array_keys($found);
if (count($found) == 1 and count($found[$keys[0]]) == 1) {
    header("Location: ?" . $keys[0] . '=' . $found[$keys[0]][0]['entry']);
} else {
    $smarty->assign('found', $found);
    // Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору
    if (isset($allitems)) {
        $smarty->assign('allitems', $allitems);
    }
    if (isset($allspells)) {
        $smarty->assign('allspells', $allspells);
    }
    // Параметры страницы
    $page = array();
Example #3
0
        // Talents
        // todo
    } else {
        $spells['sort'] = "'name'";
        // просто спеллы
        $rows = $DB->select('
			SELECT
				?#, `s`.`spellID`
			FROM ?_spell s, ?_spellicons i
			WHERE
				i.id=s.spellicon
			{LIMIT ?d}
		', $spell_cols[2], $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP);
    }
    foreach ($rows as $i => $row) {
        $spells['data'][] = spellinfo2($row);
    }
    save_cache(15, $cache_str, $spells);
}
global $page;
$page = array('Mapper' => false, 'Book' => false, 'Title' => ($title ? $title . ' - ' : '') . $smarty->get_config_vars('Spells'), 'tab' => 0, 'type' => 6, 'typeid' => 0, 'path' => "[0, 1, " . intval($s1) . ", " . intval($s2) . ", " . intval($s3) . "]", 'sort' => isset($spells['sort']) ? $spells['sort'] : "'level','name'");
$smarty->assign('page', $page);
// Статистика выполнения mysql запросов
$smarty->assign('mysql', $DB->getStatistics());
// Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору
if (isset($allitems)) {
    $smarty->assign('allitems', $allitems);
}
if (count($allspells) >= 0) {
    $smarty->assign('allspells', $allspells);
}
    $teachspells = $DB->select('
		SELECT ?#, spellID
		FROM ?_npc_trainer, ?_aowow_spell, ?_aowow_spellicons
		WHERE
			entry=?d
			AND spellID=Spell
			AND id=spellicon
		', $spell_cols[2], $npc['entry']);
    if ($teachspells) {
        if (!isset($npc['teaches'])) {
            $npc['teaches'] = array();
        }
        foreach ($teachspells as $teachspell) {
            $num = count($npc['teaches']);
            $npc['teaches'][$num] = array();
            $npc['teaches'][$num] = spellinfo2($teachspell);
        }
    }
    unset($teachspells);
    // Продает:
    $rows_s = $DB->select('
		SELECT ?#, i.entry, i.maxcount, n.`maxcount` as `drop-maxcount`
			{, l.name_loc?d AS `name_loc`}
		FROM ?_npc_vendor n, ?_aowow_icons, ?_item_template i
			{LEFT JOIN (?_locales_item l) ON l.entry=i.entry AND ?d}
		WHERE
			n.entry=?
			AND i.entry=n.item
			AND id=i.displayid
		', $item_cols[2], $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, $id);
    if ($rows_s) {
Example #5
0
		FROM ?_udwbase_spell s, ?_udwbase_spellicons i
		WHERE
			((s.effect1itemtype=?d
			OR s.effect2itemtype=?d
			OR s.effect3itemtype=?)
			AND (i.id = s.spellicon))
		', $spell_cols[2], $item['entry'], $item['entry'], $item['entry']);
    if ($rows_cf) {
        $item['createdfrom'] = array();
        foreach ($rows_cf as $numRow => $row) {
            $skillrow = $DB->selectRow('
				SELECT skillID, min_value, max_value
				FROM ?_udwbase_skill_line_ability
				WHERE spellID=?d
				LIMIT 1', $row['spellID']);
            $item['createdfrom'][] = spellinfo2(array_merge($row, $skillrow));
        }
        unset($skillrow);
    }
    unset($rows_cf);
    // Ловится в ...
    $drops_fi = drop('?_fishing_loot_template', $item['entry']);
    if ($drops_fi) {
        $item['fishedin'] = array();
        foreach ($drops_fi as $lootid => $drop) {
            // Обычные локации
            $row = $DB->selectRow('
				SELECT name_loc' . $_SESSION['locale'] . ' AS name, areatableID as id
				FROM ?_udwbase_zones
				WHERE
					areatableID=?d
Example #6
0
			SELECT s.*, i.iconname
			FROM ?_spell s, ?_spellicons i
			WHERE
				s.spellname_loc' . $_SESSION['locale'] . ' = ?
				AND s.spellID <> ?d
				AND (
							(s.effect1id = ?d AND s.effect1id!=0)
							OR (s.effect2id = ?d AND s.effect2id!=0)
							OR (s.effect3id = ?d AND s.effect3id!=0)
						)
				AND i.id=s.spellicon
			', $spell['name'], $spell['entry'], $row['effect1id'], $row['effect2id'], $row['effect3id']);
        if ($seealso) {
            $spell['seealso'] = array();
            foreach ($seealso as $i => $row) {
                $spell['seealso'][] = spellinfo2($row);
            }
            unset($seealso);
        }
        // Кто обучает этому спеллу
        $spell['taughtbynpc'] = array();
        // Список тренеров, обучающих нужному спеллу
        $trainers = $DB->selectCol('SELECT entry FROM npc_trainer WHERE spell = ?d', $spell['entry']);
        if ($trainers) {
            $taughtbytrainers = $DB->select('
				SELECT ?#, c.entry
				{ , name_loc?d AS name_loc, subname_loc' . $_SESSION['locale'] . ' AS subname_loc }
				FROM ?_factiontemplate, creature_template c
				{ LEFT JOIN (locales_creature l) ON c.entry = l.entry AND ? }
				WHERE
					c.entry IN (?a)
Example #7
0
    }
    unset($rows_cf);
    // Добывается из спелла
    $drops_sp = drop('spell_loot_template', $item['entry']);
    if ($drops_sp) {
        $item['containedinspell'] = array();
        foreach ($drops_sp as $lootid => $drop) {
            $rows = $DB->select('
				SELECT s.?#, s.spellID
				FROM ?_spell s, ?_spellicons i
				WHERE
					s.spellID = ?d
					AND i.id = s.spellicon
				', $spell_cols[2], $lootid);
            foreach ($rows as $row) {
                $item['containedinspell'][] = array_merge(spellinfo2($row), $drop);
            }
            unset($rows);
        }
    }
    unset($drops_sp);
    // Цель критерии
    $rows = $DB->select('
			SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID
			FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a
			LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID
			WHERE
				a.icon = s.id
				AND a.id = c.refAchievement
				AND c.type IN (?a)
				AND c.value1 = ?d