コード例 #1
0
ファイル: allitems.php プロジェクト: wow4all/OpenRepack
function render_item_tooltip(&$Row)
{
    // БД
    global $DB;
    // Строковые константы
    global $resz, $resz_desc, $bag_typez, $bond, $slot, $armor_type, $weapon_type, $projectile_type;
    // Зеленый текст
    global $green;
    // Столбцы для извлечения
    global $itemset_col;
    $green = array();
    $x = '';
    // Начальный тег таблицы
    $x .= '<table><tr><td>';
    // Название и цвет названия
    $x .= '<b class="q' . $Row['quality'] . '">' . localizedName($Row) . '</b><br />';
    // Проверяем героическая ли вещь, и если да, то отображаем это в тултипе
    $ilvlarray = array("284", "277", "271", "258");
    if (in_array($Row['ItemLevel'], $ilvlarray, true) and $Row['entry'] != "49623") {
        $x .= '<font color="limegreen">' . LOCALE_ITEM_HEROIC . '</font><br>';
    }
    // Уровень вещи
    if ($Row['ItemLevel'] != 0) {
        $x .= '<font color="gold">' . LOCALE_ITEM_LEVEL . ' ' . $Row['ItemLevel'] . '</font>';
    }
    // Биндинг вещи
    $x .= $bond[$Row['bonding']];
    // Уникальность вещи
    if ($Row['maxcount'] == 1) {
        $x .= '<br />' . LOCALE_UNIQUE;
    }
    if ($Row['maxcount'] > 1) {
        $x .= ' (' . $Row['maxcount'] . ')';
    }
    if ($Row['startquest']) {
        $x .= '<br /><a class="q1" href="?quest=' . $Row['startquest'] . '">' . LOCALE_START_QUEST . '</a>';
    }
    // Локация, для которой предназначен этот предмет
    if ($Row['Map']) {
        $x .= '<br />' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_zones WHERE mapid=?d LIMIT 1', $Row['Map']);
    }
    // Теперь в зависимости от типа предмета
    if ($Row['ContainerSlots'] > 1) {
        $x .= '<br />' . $Row['ContainerSlots'] . LOCALE_SLOT . $bag_typez[$Row['BagFamily']];
    }
    if (in_array($Row['class'], array(4, 2, 6, 7))) {
        // Броня (4), Оружие(2), Патроны(6)
        // Начало таблицы св-в брони
        $x .= '<table width="100%">';
        $x .= '<tr>';
        // Слот
        $x .= '<td>' . $slot[$Row['InventoryType']] . '</td>';
        // Тип брони
        if ($Row['class'] == 4) {
            $x .= '<th>' . $armor_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 2) {
            $x .= '<th>' . $weapon_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 6) {
            $x .= '<th>' . $projectile_type[$Row['subclass']] . '</th>';
        }
        $x .= '</tr></table>';
    } else {
        $x .= '<br />';
    }
    // Урон
    $dps = 0;
    for ($j = 1; $j <= 2; $j++) {
        $d_type = $Row['dmg_type' . $j];
        $d_min = $Row['dmg_min' . $j];
        $d_max = $Row['dmg_max' . $j];
        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);
            }
            if ($j > 1) {
                $delay = 0;
            }
            $x .= inv_dmg($d_min, $d_max, $delay, $d_type);
        } elseif ($d_max > 0 and $Row['class'] == 6) {
            $x .= LOCALE_DPS_ADDS . ' ' . number_format(($d_max + $d_min) / 2, 1) . ' ' . LOCALE_DPS2 . '<br />';
        }
    }
    if ($dps > 0) {
        $x .= '(' . number_format($dps, 1) . ' ' . LOCALE_DPS . ')<br />';
    }
    // Кол-во брони
    if ($Row['armor']) {
        $x .= $Row['armor'] . ' ' . LOCALE_ARMOR . '<br />';
    }
    if ($Row['block']) {
        $x .= $Row['block'] . ' ' . LOCALE_BLOCK . '<br />';
    }
    if ($Row['GemProperties']) {
        $x .= $DB->selectCell('SELECT ?_itemenchantmet.text_loc' . $_SESSION['locale'] . ' FROM ?_itemenchantmet, ?_gemproperties WHERE (?_gemproperties.gempropertiesID=?d and ?_itemenchantmet.itemenchantmetID=?_gemproperties.itemenchantmetID)', $Row['GemProperties']) . '<br />';
    }
    // Различные бонусы
    for ($j = 1; $j <= 10; $j++) {
        if ($Row['stat_type' . $j] != 0 and $Row['stat_value' . $j] != 0) {
            $x .= b_type($Row['stat_type' . $j], $Row['stat_value' . $j], $Row['RequiredLevel']);
        }
    }
    // Бонусы к сопротивлениям магий
    foreach ($resz as $j => $RowName) {
        if ($Row[$RowName] != 0) {
            $x .= '+' . $Row[$RowName] . ' ' . $resz_desc[$j] . '<br />';
        }
    }
    // Случайные бонусы
    if ($Row['RandomProperty'] or $Row['RandomSuffix']) {
        $green[] = 'Random Bonuses';
    }
    // Сокеты
    for ($j = 1; $j <= 3; $j++) {
        if ($Row['socketColor_' . $j] != 0) {
            $x .= socket_type($Row['socketColor_' . $j]) . '<br />';
        }
    }
    if ($Row['socketBonus']) {
        $x .= '<span class="q0">' . LOCALE_SOCKET_BONUS . ': ' . socket_bonus($Row['socketBonus']) . '</span><br />';
    }
    // Состояние
    if ($Row['MaxDurability']) {
        $x .= LOCALE_DURABILITY . ' ' . $Row['MaxDurability'] . ' / ' . $Row['MaxDurability'] . '<br />';
    }
    // Требуемые классы
    if (classes($Row['AllowableClass'])) {
        // Распределяем вещи
        if ($Row['class'] == 4 and $Row['subclass'] == 1) {
            if ($Row['AllowableClass'] == 16) {
                $x .= LOCALE_CLASSES . ': ' . classes('16') . '<br />';
            } elseif ($Row['AllowableClass'] == 128) {
                $x .= LOCALE_CLASSES . ': ' . classes('128') . '<br />';
            } elseif ($Row['AllowableClass'] == 256) {
                $x .= LOCALE_CLASSES . ': ' . classes('256') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('400') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 2) {
            if ($Row['AllowableClass'] == 8) {
                $x .= LOCALE_CLASSES . ': ' . classes('8') . '<br />';
            } elseif ($Row['AllowableClass'] == 1024) {
                $x .= LOCALE_CLASSES . ': ' . classes('1024') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('1032') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 3) {
            if ($Row['AllowableClass'] == 4) {
                $x .= LOCALE_CLASSES . ': ' . classes('4') . '<br />';
            } elseif ($Row['AllowableClass'] == 64) {
                $x .= LOCALE_CLASSES . ': ' . classes('64') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('68') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 4) {
            if ($Row['AllowableClass'] == 1) {
                $x .= LOCALE_CLASSES . ': ' . classes('1') . '<br />';
            } elseif ($Row['AllowableClass'] == 2) {
                $x .= LOCALE_CLASSES . ': ' . classes('2') . '<br />';
            } elseif ($Row['AllowableClass'] == 32) {
                $x .= LOCALE_CLASSES . ': ' . classes('32') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('35') . '<br />';
            }
        } else {
            $x .= LOCALE_CLASSES . ': ' . classes($Row['AllowableClass']) . '<br />';
        }
    }
    // Требуемый уровень
    if ($Row['RequiredLevel'] > 1) {
        $x .= LOCALE_REQUIRES_LEVEL . ' ' . $Row['RequiredLevel'] . '<br />';
    }
    // Требуемый скилл (755 - Jewecrafting)
    if ($Row['RequiredSkill'] and $Row['RequiredSkill'] != 755) {
        $x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
        if ($Row['RequiredSkillRank']) {
            $x .= ' (' . $Row['RequiredSkillRank'] . ')';
        }
        $x .= '<br />';
    }
    // Требуемый спелл
    if ($Row['requiredspell']) {
        $x .= LOCALE_REQUIRES . ' ' . req_spell($Row['requiredspell']) . '<br />';
    }
    // Требуемая репутация
    if ($Row['RequiredReputationFaction']) {
        require_once 'includes/game.php';
        global $rep_levels;
        $row = factioninfo($Row['RequiredReputationFaction']);
        $x .= LOCALE_REQUIRES . ' ' . $row['name'] . ' - ' . $rep_levels[$Row['RequiredReputationRank']];
    }
    if ($Row['SellPrice'] > 0) {
        $sellgold = floor($Row['SellPrice'] / 10000);
        $sellsilver = floor($Row['SellPrice'] % 10000 / 100);
        $sellcopper = floor($Row['SellPrice'] % 100);
        $x .= LOCALE_SELLPRICE . ' ';
        if ($sellgold > 0) {
            $x .= '<span class="moneygold">' . $sellgold . '</span> ';
        }
        if ($sellsilver > 0) {
            $x .= '<span class="moneysilver">' . $sellsilver . '</span> ';
        }
        if ($sellcopper > 0) {
            $x .= '<span class="moneycopper">' . $sellcopper . '</span> <br />';
        }
    }
    $x .= '</td></tr></table>';
    // Спеллы
    for ($j = 1; $j <= 5; $j++) {
        if ($Row['spellid_' . $j]) {
            $green[] = spell_to_bonus($Row['spellid_' . $j], $Row['spelltrigger_' . $j], $Row['spellcharges_' . $j], $Row['spellppmRate_' . $j], $Row['spellcooldown_' . $j], $Row['spellcategorycooldown_' . $j]);
        }
    }
    // Перебираем все "зеленые" бонусы
    $x .= '<table><tr><td>';
    if ($green) {
        foreach ($green as $j => $bonus) {
            if ($bonus) {
                $x .= '<span class="q2">' . $bonus . '</span><br />';
            }
        }
    }
    if ($Row['description']) {
        if ($Row['spelltrigger_2'] == 6) {
            $x .= '<span class="q2">' . LOCALE_GBONUS_USE . ' <a href="?spell=' . $Row['spellid_2'] . '">' . localizedName($Row, 'description') . '</a></span>';
        } else {
            $x .= '<span class="q">"' . localizedName($Row, 'description') . '"</span>';
        }
    }
    if ($Row['PageText']) {
        $x .= '<br /><span class="q2">&lt;Click derecho para leer&gt;</span>';
    }
    // TODO: locale
    // Item Set
    // Временное хранилище всех вещей;
    $x_tmp = '';
    $row = $DB->selectRow('SELECT ?# FROM ?_itemset WHERE itemsetID=?d LIMIT 1', $itemset_col[1], $Row['itemset']);
    if (!$row) {
        $row = $DB->selectRow('SELECT ?# FROM ?_itemset WHERE (item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d) LIMIT 1', $itemset_col[1], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry']);
    }
    if ($row) {
        //$x .= '<br />';
        $num = 0;
        // Кол-во вещей в наборе
        for ($i = 1; $i <= 10; $i++) {
            if ($row['item' . $i] > 0) {
                $num++;
                $name = getitemname($row['item' . $i]);
                $x_tmp .= '<span><a href="?item=' . $row['item' . $i] . '">' . $name . '</a></span><br />';
            }
        }
        $x .= '<br /><span class="q"><a href="?itemset=' . $row['itemsetID'] . '" class="q">' . $row['name_loc' . $_SESSION['locale']] . '</a> (0/' . $num . ')</span>';
        // Если требуется скилл
        if ($row['skillID']) {
            $x .= '<br />';
            $name = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_skill WHERE skillID=?d LIMIT 1', $row['skillID']);
            $x .= LOCALE_REQUIRES . ' <a href="?spells=11.' . $row['skillID'] . '" class="q1">' . $name . '</a>';
            if ($row['skilllevel']) {
                $x .= ' (' . $row['skilllevel'] . ')';
            }
            $x .= '<br />';
        }
        // Перечисление всех составляющих набора
        $x .= '<div class="q0 indent">' . $x_tmp . '</div><br />';
        // Перечисление всех бонусов набора
        $x .= '<span class="q0">';
        $num = 0;
        for ($j = 1; $j <= 8; $j++) {
            if ($row['spell' . $j]) {
                $itemset['spells'][$num]['entry'] = $row['spell' . $j];
                $itemset['spells'][$num]['tooltip'] = spell_desc($row['spell' . $j]);
                $itemset['spells'][$num]['bonus'] = $row['bonus' . $j];
                $num++;
            }
        }
        // Сортировка бонусов
        $x .= '<span class="q0">';
        for ($i = 0; $i < $num; $i++) {
            for ($j = $i; $j <= $num - 1; $j++) {
                if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) {
                    unset($tmp);
                    $tmp = $itemset['spells'][$i];
                    $itemset['spells'][$i] = $itemset['spells'][$j];
                    $itemset['spells'][$j] = $tmp;
                }
            }
            $x .= '<span>(' . $itemset['spells'][$i]['bonus'] . ') Set: <a href="?spell=' . $itemset['spells'][$i]['entry'] . '">' . $itemset['spells'][$i]['tooltip'] . '</a></span><br />';
        }
        $x .= '</span></span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}
コード例 #2
0
/**
 *
 * @param type $Row
 * @return string 
 */
function render_item_tooltip(&$Row)
{
    // БД
    global $DB;
    // Строковые константы
    global $resz, $resz_desc, $bag_typez, $bond, $slot, $armor_type, $weapon_type, $projectile_type;
    // Зеленый текст
    global $green;
    // Столбцы для извлечения
    global $itemset_col;
    $green = array();
    $x = '';
    // Начальный тег таблицы
    $x .= '<table><tr><td>';
    // Название и цвет названия
    $x .= '<b class="q' . $Row['quality'] . '">' . (!empty($Row['name_loc']) ? $Row['name_loc'] : $Row['name']) . '</b>';
    // Биндинг вещи
    $x .= $bond[$Row['bonding']];
    // Уникальность вещи
    if ($Row['maxcount'] == 1) {
        $x .= '<br />' . LOCALE_UNIQUE;
    }
    if ($Row['maxcount'] > 1) {
        $x .= ' (' . $Row['maxcount'] . ')';
    }
    if ($Row['startquest']) {
        $x .= '<br /><a class="q1" href="?quest=' . $Row['startquest'] . '">' . LOCALE_START_QUEST . '</a>';
    }
    // Локация, для которой предназначен этот предмет
    if ($Row['Map']) {
        $x .= '<br />' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_zones WHERE mapid=?d LIMIT 1', $Row['Map']);
    }
    // Теперь в зависимости от типа предмета
    if ($Row['ContainerSlots'] > 1) {
        $x .= '<br />' . $Row['ContainerSlots'] . LOCALE_SLOT . $bag_typez[$Row['BagFamily']];
    }
    if ($Row['class'] == 4 or $Row['class'] == 2 or $Row['class'] == 6 or $Row['class'] == 7) {
        // Броня (4), Оружие(2), Патроны(6)
        // Начало таблицы св-в брони
        $x .= '<table width="100%">';
        $x .= '<tr>';
        // Слот
        $x .= '<td>' . $slot[$Row['InventoryType']] . '</td>';
        // Тип брони
        if ($Row['class'] == 4) {
            $x .= '<th>' . $armor_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 2) {
            $x .= '<th>' . $weapon_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 6) {
            $x .= '<th>' . $projectile_type[$Row['subclass']] . '</th>';
        }
        $x .= '</tr></table>';
    } else {
        $x .= '<br />';
    }
    // Урон
    $dps = 0;
    for ($j = 1; $j <= 5; $j++) {
        $d_type = $Row['dmg_type' . $j];
        $d_min = $Row['dmg_min' . $j];
        $d_max = $Row['dmg_max' . $j];
        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);
            }
            if ($j > 1) {
                $delay = 0;
            }
            $x .= inv_dmg($d_min, $d_max, $delay, $d_type);
        } elseif ($d_max > 0 and $Row['class'] == 6) {
            $x .= LOCALE_DPS_ADDS . ' ' . number_format(($d_max + $d_min) / 2, 1) . ' ' . LOCALE_DPS2 . '<br />';
        }
    }
    if ($dps > 0) {
        $x .= '(' . number_format($dps, 1) . ' ' . LOCALE_DPS . ')<br />';
    }
    // Кол-во брони
    if ($Row['armor']) {
        $x .= $Row['armor'] . ' ' . LOCALE_ARMOR . '<br />';
    }
    if ($Row['block']) {
        $x .= $Row['block'] . ' ' . LOCALE_BLOCK . '<br />';
    }
    // Различные бонусы
    for ($j = 1; $j <= 10; $j++) {
        if ($Row['stat_type' . $j] != 0 and $Row['stat_value' . $j] != 0) {
            $x .= b_type($Row['stat_type' . $j], $Row['stat_value' . $j]);
        }
    }
    // Бонусы к сопротивлениям магий
    foreach ($resz as $j => $RowName) {
        if ($Row[$RowName] != 0) {
            $x .= '+' . $Row[$RowName] . ' ' . $resz_desc[$j] . '<br />';
        }
    }
    // Случайные бонусы
    if ($Row['RandomProperty']) {
        $green[] = 'Random Bonuses';
    }
    // Состояние
    if ($Row['MaxDurability']) {
        $x .= LOCALE_DURABILITY . ' ' . $Row['MaxDurability'] . ' / ' . $Row['MaxDurability'] . '<br />';
    }
    // Требуемые классы
    if (classes($Row['AllowableClass'])) {
        $x .= LOCALE_CLASSES . ': ' . classes($Row['AllowableClass']) . '<br />';
    }
    // Требуемый уровень
    if ($Row['RequiredLevel'] > 1) {
        $x .= LOCALE_REQUIRES_LEVEL . ' ' . $Row['RequiredLevel'] . '<br />';
    }
    // Требуемый скилл (755 - Jewecrafting)
    if ($Row['RequiredSkill'] and $Row['RequiredSkill'] != 755) {
        $x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
        if ($Row['RequiredSkillRank']) {
            $x .= ' (' . $Row['RequiredSkillRank'] . ')';
        }
        $x .= '<br />';
    }
    // Требуемый спелл
    if ($Row['requiredspell']) {
        $x .= LOCALE_REQUIRES . ' ' . req_spell($Row['requiredspell']) . '<br />';
    }
    // Требуемая репутация
    if ($Row['RequiredReputationFaction']) {
        require_once 'includes/game.php';
        global $rep_levels;
        $row = factioninfo($Row['RequiredReputationFaction']);
        $x .= LOCALE_REQUIRES . ' ' . $row['name'] . ' - ' . $rep_levels[$Row['RequiredReputationRank']];
    }
    $x .= '</td></tr></table>';
    // Спеллы
    for ($j = 1; $j <= 5; $j++) {
        if ($Row['spellid_' . $j]) {
            $green[] = spell_to_bonus($Row['spellid_' . $j], $Row['spelltrigger_' . $j]);
        }
    }
    // Перебираем все "зеленые" бонусы
    $x .= '<table><tr><td>';
    if ($green) {
        foreach ($green as $j => $bonus) {
            if ($bonus) {
                $x .= '<span class="q2">' . $bonus . '</span><br />';
            }
        }
    }
    if ($Row['description']) {
        if ($Row['spelltrigger_2'] == 6) {
            $x .= '<span class="q2">' . LOCALE_GBONUS_USE . ' <a href="?spell=' . $Row['spellid_2'] . '">' . (!empty($Row['description_loc']) ? $Row['description_loc'] : $Row['description']) . '</a></span>';
        } else {
            $x .= '<span class="q">"' . (!empty($Row['description_loc']) ? $Row['description_loc'] : $Row['description']) . '"</span>';
        }
    }
    if ($Row['PageText']) {
        $x .= '<br /><span class="q2">&lt;Right Click To Read&gt;</span>';
    }
    // TODO: locale
    // Item Set
    // Временное хранилище всех вещей;
    $x_tmp = '';
    $row = $DB->selectRow('SELECT ?# FROM ?_aowow_itemset WHERE (item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d) LIMIT 1', $itemset_col[1], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry']);
    if ($row) {
        $num = 0;
        // Кол-во вещей в наборе
        for ($i = 1; $i <= 10; $i++) {
            if ($row['item' . $i] > 0) {
                $num++;
                $name = getitemname($row['item' . $i]);
                $x_tmp .= '<span><a href="?item=' . $row['item' . $i] . '">' . $name . '</a></span><br />';
            }
        }
        $x .= '<span class="q"><a href="?itemset=' . $row['itemsetID'] . '" class="q">' . $row['name_loc' . $_SESSION['locale']] . '</a> (0/' . $num . ')</span>';
        // Если требуется скилл
        if ($row['skillID']) {
            $name = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_skill WHERE skillID=?d LIMIT 1', $row['skillID']);
            $x .= LOCALE_REQUIRES . ' <a href="?spells=11.' . $row['skillID'] . '" class="q1">' . $name . '</a>';
            if ($row['skilllevel']) {
                $x .= ' (' . $row['skilllevel'] . ')';
            }
            $x .= '<br />';
        }
        // Перечисление всех составляющих набора
        $x .= '<div class="q0 indent">' . $x_tmp . '</div>';
        // Перечисление всех бонусов набора
        $x .= '<span class="q0">';
        $num = 0;
        for ($j = 1; $j <= 8; $j++) {
            if ($row['spell' . $j]) {
                $itemset['spells'][$num]['entry'] = $row['spell' . $j];
                $itemset['spells'][$num]['tooltip'] = spell_desc($row['spell' . $j]);
                $itemset['spells'][$num]['bonus'] = $row['bonus' . $j];
                $num++;
            }
        }
        // Сортировка бонусов
        $x .= '<span class="q0">';
        for ($i = 0; $i < $num; $i++) {
            for ($j = $i; $j <= $num - 1; $j++) {
                if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) {
                    unset($tmp);
                    $tmp = $itemset['spells'][$i];
                    $itemset['spells'][$i] = $itemset['spells'][$j];
                    $itemset['spells'][$j] = $tmp;
                }
            }
            $x .= '<span>(' . $itemset['spells'][$i]['bonus'] . ') Set: <a href="?spell=' . $itemset['spells'][$i]['entry'] . '">' . $itemset['spells'][$i]['tooltip'] . '</a></span><br />';
        }
        $x .= '</span></span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}