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"><Click derecho para leer></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; }
$npc['quotes_count'] = $DB->selectCell('SELECT COUNT(*) FROM creature_text WHERE entry=?d', $id); $npc['sscreen'] = $DB->selectCell('SELECT body FROM aowow_screenshots WHERE typeid=?d', $id); $repdata = $DB->selectRow(' SELECT * FROM creature_onkill_reputation WHERE creature_id=?d LIMIT 1 ', $id); for ($j = 1; $j <= 2; $j++) { if ($repdata['RewOnKillRepValue' . $j] != 0) { $id = $repdata['RewOnKillRepFaction' . $j]; $value = $repdata['RewOnKillRepValue' . $j]; if ($value) { $npc['onkillrep'] = factioninfo($id); } $npc['killrep'][] = @array_merge(factioninfo($repdata['RewOnKillRepFaction' . $j]), array('value' => $value)); } } // Деньги $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 { // А может быть героик НПС одним для нескольких нормалов? // считаем что нет
function GetQuestInfo(&$data, $dataflag = QUEST_DATAFLAG_MINIMUM) { global $DB, $quest_class, $quest_faction_reward; // Локализация if ($dataflag & QUEST_DATAFLAG_LOCALE && $_SESSION['locale'] > 0) { $loc = $_SESSION['locale']; $row = $DB->selectRow(' SELECT Title_loc?d AS Title_loc, Details_loc?d AS Details_loc, Objectives_loc?d AS Objectives_loc, OfferRewardText_loc?d AS OfferRewardText_loc, RequestItemsText_loc?d AS RequresItemsText_loc, EndText_loc?d AS EndText_loc, ObjectiveText1_loc?d AS ObjectiveText1_loc, ObjectiveText2_loc?d AS ObjectiveText2_loc, ObjectiveText3_loc?d AS ObjectiveText3_loc, ObjectiveText4_loc?d AS ObjectiveText4_loc FROM locales_quest WHERE Id = ?d LIMIT 1 ', $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $loc, $data['entry']); if ($row) { $data = @array_merge($data, $row); } } // Минимальные данные // ID квеста $data['Id'] = $data['Id']; // Имя квеста $data['Title'] = GetQuestTitle($data); // Описания if ($dataflag & QUEST_DATAFLAG_STRINGS) { GetQuestStrings($data); } // Свойства if ($dataflag & QUEST_DATAFLAG_PROPS) { // Уровень квеста $data['Level'] = $data['Level']; // Требуемый уровень квеста $data['MinLevel'] = $data['MinLevel']; // Доступен расам $data['side'] = races($data['RequiredRaces']); // Флаги $data['Flags'] = $data['Flags']; // Ежедневный квест? if ($data['Flags'] & QUEST_FLAGS_DAILY) { $data['Daily'] = true; } // Тип квеста $data['type'] = $data['Type']; global $quest_type; if (isset($quest_type[$data['type']])) { $data['typename'] = $quest_type[$data['type']]; } else { $data['typename'] = $data['type']; } // Путь к этому разделу (главная категория) foreach ($quest_class as $i => $class) { if (in_array($data['ZoneOrSort'], $class)) { $data['maincat'] = $i; break; } } // Категория 1 $data['category'] = $data['ZoneOrSort']; // Категория 2 ??? $data['category2'] = $data['Flags']; // Требуемое пати if ($data['SuggestedPlayers'] > 1) { $data['splayers'] = $data['SuggestedPlayers']; } // Лимит времени if ($data['LimitTime'] > 0) { $data['LimitTime'] = sec_to_time($data['LimitTime']); } else { unset($data['LimitTime']); } if ($data['Flags'] & QUEST_FLAGS_SHARABLE) { $data['Sharable'] = true; } if ($data['SpecialFlags'] & QUEST_SPECIALFLAGS_REPEATABLE) { $data['Repeatable'] = true; } if ($data['RewardTitleId'] > 0) { $data['titlereward'] = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_char_titles WHERE id=?d LIMIT 1', $data['RewardTitleId']); } } // Награды и задания if ($dataflag & QUEST_DATAFLAG_REWARDS) { // Опыт/деньги@70 $data['xp'] = GetQuestXpOrMoney($data); // Награды вещей for ($j = 0; $j <= 6; ++$j) { if ($data['RewardChoiceItemId' . $j] != 0 and $data['RewardChoiceItemCount' . $j] != 0) { $data['itemchoices'][] = @array_merge(allitemsinfo($data['RewardChoiceItemId' . $j], 0), array('count' => $data['RewardChoiceItemCount' . $j])); } } for ($j = 0; $j <= 4; ++$j) { if ($data['RewardItemId' . $j] != 0 and $data['RewardItemCount' . $j] != 0) { $data['itemrewards'][] = @array_merge(allitemsinfo($data['RewardItemId' . $j], 0), array('count' => $data['RewardItemCount' . $j])); } } // Вознаграждение репутацией for ($j = 1; $j <= 5; $j++) { if ($data['RewardFactionValueId' . $j] != 0) { $value = $data['RewardFactionValueId' . $j]; $id = $data['RewardFactionId' . $j]; if (!$value && isset($quest_faction_reward[$id])) { $value = $quest_faction_reward[$id]; } if ($value) { $data['reprewards'][] = @array_merge(factioninfo($data['RewardFactionValueId' . $j]), array('value' => $value)); } } } // Вознаграждение деньгами if ($data['RewardOrRequiredMoney'] > 0) { $data['money'] = money2coins($data['RewardOrRequiredMoney']); } elseif ($data['RewardOrRequiredMoney'] < 0) { $data['moneyreq'] = money2coins(-$data['RewardOrRequiredMoney']); } if ($data['RewardMoneyMaxLevel']) { $data['moneymaxlevel'] = money2coins($data['RewardMoneyMaxLevel']); } } // Последовательность квестов, требования, цепочки if ($dataflag & QUEST_DATAFLAG_SERIES) { // не используется для вычисления самих сериесов, исключительно для внесения соответствующих полей в массив информации } // Все ОК. Это не обязательный return, но в некоторых функциях нужен. return $data; }
/** * * @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"><Right Click To Read></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; }