first big cleanup

This commit is contained in:
Ulf Gebhardt 2017-01-14 04:56:47 +01:00
parent 550df13ff3
commit 6c1c360c23
35 changed files with 192148 additions and 161 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -19,12 +19,13 @@ require_once('includes/game.php');
* @return int
*/
function getcomments($type, $typeid) {
global $DB;
/*global $DB;
global $rDB;
global $UDWBaseconf;
//TODO $UDWBaseconf['aowow']['db']
$rows = $DB->select('
SELECT id, userid, post_date, commentbody, replyto
FROM '.'host_mojotrollz_aowow'.'.?_aowow_comments
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_comments
WHERE type=? AND typeid=?
ORDER BY replyto, post_date
', $type, $typeid
@ -52,5 +53,5 @@ function getcomments($type, $typeid) {
$comments[$i]['deleted'] = 0;
}
return $comments;
return $comments;*/
}

View File

@ -18,13 +18,13 @@ require_once('includes/allquests.php');
// Массивы с названиями столбцов, необходимых для различных уровней вызова функций
// для allitems($level=0) - соответствия номер-иконка
$item_cols[0] = array('entry', 'iconname', 'quality', 'name');
$item_cols[0] = array('entry', 'iconname', 'quality', 'name', 'AllowableClass');
// для allitems($level=1) - ajax, тултип
$item_cols[1] = array('entry', 'name', 'quality', 'iconname', 'maxcount', 'bonding', 'startquest', 'Map', 'ContainerSlots', 'class', 'InventoryType', 'subclass', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'armor', 'block', 'stat_type1', 'stat_type2', 'stat_type3', 'stat_type4', 'stat_type5', 'stat_type6', 'stat_type7', 'stat_type8', 'stat_type9', 'stat_type10', 'stat_value1', 'stat_value2', 'stat_value3', 'stat_value4', 'stat_value5', 'stat_value6', 'stat_value7', 'stat_value8', 'stat_value9', 'stat_value10', 'holy_res', 'fire_res', 'nature_res', 'frost_res', 'shadow_res', 'arcane_res', 'RandomProperty', 'MaxDurability', 'AllowableClass', 'RequiredLevel', 'RequiredSkill', 'requiredspell', 'RequiredReputationFaction', 'RequiredReputationRank', 'spellid_1', 'spellid_2', 'spellid_3', 'spellid_4', 'spellid_5', 'spelltrigger_1', 'spelltrigger_2', 'spelltrigger_3', 'spelltrigger_4', 'spelltrigger_5', 'description', 'PageText', 'BagFamily', 'RequiredSkillRank');
$item_cols[1] = array('entry', 'name', 'quality', 'iconname', 'maxcount', 'bonding', 'startquest', 'Map', 'ContainerSlots', 'class', 'InventoryType', 'subclass', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'armor', 'block', 'stat_type1', 'stat_type2', 'stat_type3', 'stat_type4', 'stat_type5', 'stat_type6', 'stat_type7', 'stat_type8', 'stat_type9', 'stat_type10', 'stat_value1', 'stat_value2', 'stat_value3', 'stat_value4', 'stat_value5', 'stat_value6', 'stat_value7', 'stat_value8', 'stat_value9', 'stat_value10', 'holy_res', 'fire_res', 'nature_res', 'frost_res', 'shadow_res', 'arcane_res', 'RandomProperty', 'MaxDurability', 'AllowableClass', 'RequiredLevel', 'RequiredSkill', 'requiredspell', 'RequiredReputationFaction', 'RequiredReputationRank', 'spellid_1', 'spellid_2', 'spellid_3', 'spellid_4', 'spellid_5', 'spelltrigger_1', 'spelltrigger_2', 'spelltrigger_3', 'spelltrigger_4', 'spelltrigger_5', 'description', 'PageText', 'BagFamily', 'RequiredSkillRank', 'socketColor_1','socketColor_2','socketColor_3','socketBonus', 'BuyPrice', 'SellPrice');
// для iteminfo($level=0) - строчки списка
$item_cols[2] = array('name', 'quality', 'iconname', 'InventoryType', 'ItemLevel', 'RequiredLevel', 'class', 'subclass', 'stackable', 'BuyPrice', 'armor', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'ContainerSlots');
$item_cols[2] = array('name', 'quality', 'iconname', 'InventoryType', 'ItemLevel', 'RequiredLevel', 'class', 'subclass', 'stackable', 'BuyPrice', 'armor', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'ContainerSlots', 'socketColor_1','socketColor_2','socketColor_3','socketBonus', 'BuyPrice', 'SellPrice', 'AllowableClass');
// для iteminfo($level=1)
$item_cols[3] = array('entry', 'name', 'quality', 'iconname', 'maxcount', 'bonding', 'startquest', 'Map', 'ContainerSlots', 'class', 'InventoryType', 'subclass', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'armor', 'block', 'stat_type1', 'stat_type2', 'stat_type3', 'stat_type4', 'stat_type5', 'stat_type6', 'stat_type7', 'stat_type8', 'stat_type9', 'stat_type10', 'stat_value1', 'stat_value2', 'stat_value3', 'stat_value4', 'stat_value5', 'stat_value6', 'stat_value7', 'stat_value8', 'stat_value9', 'stat_value10', 'holy_res', 'fire_res', 'nature_res', 'frost_res', 'shadow_res', 'arcane_res', 'RandomProperty', 'MaxDurability', 'AllowableClass', 'RequiredLevel', 'RequiredSkill', 'requiredspell', 'RequiredReputationFaction', 'RequiredReputationRank', 'spellid_1', 'spellid_2', 'spellid_3', 'spellid_4', 'spellid_5', 'spelltrigger_1', 'spelltrigger_2', 'spelltrigger_3', 'spelltrigger_4', 'spelltrigger_5', 'description', 'PageText', 'BagFamily', 'RequiredSkillRank', 'ItemLevel', 'stackable', 'BuyPrice', 'DisenchantID', 'SellPrice'/* , [NOTE] not used in 1.12 'RequiredDisenchantSkill' */);
$item_cols[3] = array('entry', 'name', 'quality', 'iconname', 'maxcount', 'bonding', 'startquest', 'Map', 'ContainerSlots', 'class', 'InventoryType', 'subclass', 'dmg_type1', 'dmg_min1', 'dmg_max1', 'delay', 'dmg_type2', 'dmg_min2', 'dmg_max2', 'dmg_type3', 'dmg_min3', 'dmg_max3', 'dmg_type4', 'dmg_min4', 'dmg_max4', 'dmg_type5', 'dmg_min5', 'dmg_max5', 'armor', 'block', 'stat_type1', 'stat_type2', 'stat_type3', 'stat_type4', 'stat_type5', 'stat_type6', 'stat_type7', 'stat_type8', 'stat_type9', 'stat_type10', 'stat_value1', 'stat_value2', 'stat_value3', 'stat_value4', 'stat_value5', 'stat_value6', 'stat_value7', 'stat_value8', 'stat_value9', 'stat_value10', 'holy_res', 'fire_res', 'nature_res', 'frost_res', 'shadow_res', 'arcane_res', 'RandomProperty', 'MaxDurability', 'AllowableClass', 'RequiredLevel', 'RequiredSkill', 'requiredspell', 'RequiredReputationFaction', 'RequiredReputationRank', 'spellid_1', 'spellid_2', 'spellid_3', 'spellid_4', 'spellid_5', 'spelltrigger_1', 'spelltrigger_2', 'spelltrigger_3', 'spelltrigger_4', 'spelltrigger_5', 'description', 'PageText', 'BagFamily', 'RequiredSkillRank', 'ItemLevel', 'stackable', 'BuyPrice', 'DisenchantID', 'SellPrice', 'socketColor_1','socketColor_2','socketColor_3','socketBonus');
$resz = array('holy_res', 'fire_res', 'nature_res', 'frost_res', 'shadow_res', 'arcane_res');
$resz_desc = array(LOCALE_HOLY_RESISTANCE, LOCALE_FIRE_RESISTANCE, LOCALE_NATURE_RESISTANCE, LOCALE_FROST_RESISTANCE, LOCALE_SHADOW_RESISTANCE, LOCALE_ARCANE_RESISTANCE);
@ -132,8 +132,8 @@ function b_type($type, $value) {
*/
function req_spell($spell_id) {
global $DB;
//TODO $UDWBaseconf['aowow']['db']
return $DB->selectCell('SELECT spellname' . ' FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=?d LIMIT 1', $spell_id);
global $UDWBaseconf;
return $DB->selectCell('SELECT spellname' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=?d LIMIT 1', $spell_id);
}
/**
@ -238,6 +238,7 @@ function allitemsinfo($id, $level=0) {
global $DB;
global $allitems;
global $item_cols;
global $UDWBaseconf;
if (isset($allitems[$id])) {
return $allitems[$id];
@ -246,11 +247,11 @@ function allitemsinfo($id, $level=0) {
$row = $DB->selectRow('
SELECT i.?#
{
, l.name_loc' . $_SESSION['locale'] . ' as `name_loc`
, l.description_loc' . $_SESSION['locale'] . ' as `description_loc`
, l.name' . ' as `name`
, l.description' . ' as `description`
, ?
}
FROM '.'host_mojotrollz_aowow'.'.?_aowow_icons, ?_item_template i
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons, ?_item_template i
{
LEFT JOIN (?_locales_item l)
ON l.entry=i.entry AND ?
@ -279,6 +280,8 @@ function render_item_tooltip(&$Row) {
global $green;
// Столбцы для извлечения
global $itemset_col;
global $UDWBaseconf;
$green = array();
@ -303,7 +306,7 @@ function render_item_tooltip(&$Row) {
// Локация, для которой предназначен этот предмет
if ($Row['Map'])
//TODO $UDWBaseconf['aowow']['db']
$x .= '<br />' . $DB->selectCell('SELECT name' . ' FROM '.'host_mojotrollz_aowow'.'.?_aowow_zones WHERE mapid=?d LIMIT 1', $Row['Map']);;
$x .= '<br />' . $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE mapid=?d LIMIT 1', $Row['Map']);;
// Теперь в зависимости от типа предмета
if ($Row['ContainerSlots'] > 1)
@ -369,6 +372,15 @@ function render_item_tooltip(&$Row) {
// Случайные бонусы
if ($Row['RandomProperty'])
$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">Socket Bonus: '.socket_bonus($Row['socketBonus']).'</span><br />';}
// Состояние
if ($Row['MaxDurability'])
@ -383,8 +395,7 @@ function render_item_tooltip(&$Row) {
// Требуемый скилл (755 - Jewecrafting)
if (($Row['RequiredSkill']) and ($Row['RequiredSkill'] != 755)) {
//TODO $UDWBaseconf['aowow']['db']
$x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name' . ' FROM '.'host_mojotrollz_aowow'.'.?_aowow_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
$x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
if ($Row['RequiredSkillRank'])
$x .= ' (' . $Row['RequiredSkillRank'] . ')';
$x .= '<br />';
@ -431,8 +442,7 @@ function render_item_tooltip(&$Row) {
// Item Set
// Временное хранилище всех вещей;
$x_tmp = '';
//TODO $UDWBaseconf['aowow']['db']
$row = $DB->selectRow('SELECT ?# FROM '.'host_mojotrollz_aowow'.'.?_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']);
$row = $DB->selectRow('SELECT ?# FROM '.$UDWBaseconf['aowow']['db'].'.?_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++) {
@ -442,16 +452,8 @@ function render_item_tooltip(&$Row) {
$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']) {
//TODO $UDWBaseconf['aowow']['db']
$name = $DB->selectCell('SELECT name' . ' FROM '.'host_mojotrollz_aowow'.'.?_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 .= '<span class="q"><a href="?itemset=' . $row['itemsetID'] . '" class="q">' . $row['name'] . '</a> (0/' . $num . ')</span>';
// Перечисление всех составляющих набора
$x .= '<div class="q0 indent">' . $x_tmp . '</div>';
// Перечисление всех бонусов набора
@ -477,8 +479,31 @@ function render_item_tooltip(&$Row) {
$x .= '<span>(' . $itemset['spells'][$i]['bonus'] . ') Set: <a href="?spell=' . $itemset['spells'][$i]['entry'] . '">' . $itemset['spells'][$i]['tooltip'] . '</a></span><br />';
}
$x .= '</span></span>';
// Если требуется скилл
if ($row['skillID']) {
$name = $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_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 .= '</td></tr></table>';
$x .= '</td></tr>';
//SellPrice
$sellgold = floor($Row['SellPrice'] / 10000);
$sellsilver = floor($Row['SellPrice'] % 10000 / 100);
$sellcopper = floor($Row['SellPrice'] % 100);
if($sellgold || $sellsilver || $sellcopper){
$x .= '<tr><td> Sell Price: ';
if($sellgold){
$x .= '<span class="moneygold">'.$sellgold.'</span>';}
if($sellsilver){
$x .= '<span class="moneysilver">'.$sellsilver.'</span>';}
if($sellcopper){
$x .= '<span class="moneycopper">'.$sellcopper.'</span>';}
$x .= '</td></tr>';
}
$x .= '</table>';
return $x;
}
@ -494,6 +519,7 @@ function iteminfo2(&$Row, $level=0) {
global $allitems;
global $spell_cols;
global $object_cols;
global $UDWBaseconf;
if (!isset($Row['entry']))
return array();
@ -502,7 +528,7 @@ function iteminfo2(&$Row, $level=0) {
// Номер вещи
$item['entry'] = $Row['entry'];
// Название вещи
$item['name'] = !empty($Row['name_loc']) ? $Row['name_loc'] : $Row['name'];
$item['name'] = $Row['name'];
// Тип вещи
$item['type'] = $Row['InventoryType'];
$item['icon'] = trim($Row['iconname'], "\r");
@ -543,6 +569,8 @@ function iteminfo2(&$Row, $level=0) {
if (!$item['speed'])
$item['speed'] = -1;
}
//Classes
$item['classes'] = classes_array($Row['AllowableClass']);
// Armor
$item['armor'] = $Row['armor'];
$item['slot'] = $Row['InventoryType'];
@ -588,7 +616,7 @@ function iteminfo2(&$Row, $level=0) {
//TODO $UDWBaseconf['aowow']['db']
$locks_row = $DB->selectCol('
SELECT lockID
FROM '.'host_mojotrollz_aowow'.'.?_aowow_lock
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_lock
WHERE
(type1=1 AND lockproperties1=?d) OR
(type2=1 AND lockproperties2=?d) OR
@ -628,15 +656,16 @@ function iteminfo2(&$Row, $level=0) {
function iteminfo($id, $level=0) {
global $item_cols;
global $DB;
global $UDWBaseconf;
//TODO $UDWBaseconf['aowow']['db']
$row = $DB->selectRow('
SELECT i.?#, i.entry, maxcount
{
, l.name_loc' . $_SESSION['locale'] . ' as `name_loc`
, l.description_loc' . $_SESSION['locale'] . ' as `description_loc`
, l.name' . ' as `name`
, l.description' . ' as `description`
, ?
}
FROM '.'host_mojotrollz_aowow'.'.?_aowow_icons, ?_item_template i
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons, ?_item_template i
{ LEFT JOIN (?_locales_item l) ON l.entry=i.entry AND ? }
WHERE
(i.entry=?d and id=displayid)
@ -644,4 +673,28 @@ function iteminfo($id, $level=0) {
', $item_cols[2 + $level], ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, $id
);
return iteminfo2($row, $level);
}
function socket_type($type)
{
switch($type)
{
case 1:
return '<span class="socket-meta q0">'.LOCALE_SOCKET_META.'</span>';
case 2:
return '<span class="socket-red q0">'.LOCALE_SOCKET_RED.'</span>';
case 4:
return '<span class="socket-yellow q0">'.LOCALE_SOCKET_META.'</span>';
case 8:
return '<span class="socket-blue q0">'.LOCALE_SOCKET_BLUE.'</span>';
default:
return '<a class="q0">Unknown Socket('.$type.')</a>';
}
}
function socket_bonus($bonus)
{
global $DB;
global $UDWBaseconf;
return $DB->selectCell('SELECT `text` FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_itemenchantmet WHERE itemenchantmetID=?d LIMIT 1',$bonus);
}

View File

@ -27,6 +27,7 @@ function itemsetinfo2(&$row) {
$itemset['minlevel'] = 255;
$itemset['maxlevel'] = 0;
$itemset['pieces'] = array();
$itemset['classes'] = array();
for ($j = 1; $j <= 10; $j++)
if ($row['item' . $j]) {
$itemset['pieces'][] = $row['item' . $j];
@ -36,6 +37,8 @@ function itemsetinfo2(&$row) {
$itemset['minlevel'] = $item['level'];
if ($item['level'] > $itemset['maxlevel'])
$itemset['maxlevel'] = $item['level'];
$itemset['classes'] = $item['classes'];
}
if (isset($item)) {
$itemset['quality2'] = 6 - $item['quality'];
@ -45,6 +48,8 @@ function itemsetinfo2(&$row) {
$itemset['quality2'] = 6;
}
// TODO: classes
$itemset['classes'][] = 0;
//$itemset['classes'][] = 0;
//if (classes($Row['AllowableClass']))
// $x .= LOCALE_CLASSES . ': ' . classes($Row['AllowableClass']) . '<br />';
return $itemset;
}

View File

@ -97,7 +97,7 @@ switch ($_SESSION['locale']) {
d('LOCALE_EQUIP_UNK0', '');
d('LOCALE_EQUIP_TABARD', 'Tabard');
d('LOCALE_EQUIP_MAINHAND', 'Main Hand');
d('LOCALE_EQUIP_CHEST2', 'Chest');
d('LOCALE_EQUIP_CHEST2', 'Robe');
d('LOCALE_EQUIP_OFFHAND2', 'Off Hand');
d('LOCALE_EQUIP_HELDINOFFHAND', 'Held In Off-Hand');
d('LOCALE_EQUIP_PROJECTILE', 'Projectile');
@ -181,6 +181,16 @@ switch ($_SESSION['locale']) {
d('LOCALE_GBONUS_CHANCEONHIT', 'Chance on hit: ');
d('LOCALE_GBONUS_EQUIP', 'Equip: ');
d('LOCALE_GBONUS_USE', 'Use: ');
// sockets
d('LOCALE_SOCKET_META','Meta Socket');
d('LOCALE_SOCKET_RED','Red Socket');
d('LOCALE_SOCKET_YELLOW','Yellow Socket');
d('LOCALE_SOCKET_BLUE','Blue Socket');
//Zones
d('LOCALE_ZONE_FLIGHT_MASTERS','Flight masters');
d('LOCALE_ZONE_INNKEEPERS','Innkeepers');
d('LOCALE_ZONE_REPAIRERS','Repairers');
d('LOCALE_ZONE_SPIRIT_HEALERS','Spirit healers');
// misc
d('LOCALE_SPEED', 'Speed');

View File

@ -52,6 +52,7 @@ function creatureinfo2(&$Row) {
function creatureinfo($id) {
global $DB;
global $npc_cols;
global $UDWBaseconf;
$row = $DB->selectRow('
SELECT ?#, c.entry
{
@ -59,7 +60,7 @@ function creatureinfo($id) {
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, ?
}
FROM '.'host_mojotrollz_aowow'.'.?_aowow_factiontemplate, ?_creature_template c
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{
LEFT JOIN (?_locales_creature l)
ON l.entry=c.entry AND ?

View File

@ -84,6 +84,7 @@ function objectinfo($id, $level=0) {
*/
function objectinfo2(&$Row, $level=0) {
global $DB;
global $UDWBaseconf;
// Номер объекта
$object['entry'] = $Row['entry'];
// Название объекта
@ -368,7 +369,7 @@ function objectinfo2(&$Row, $level=0) {
if ($object['lockid']) {
$lock_row = $DB->selectRow('
SELECT *
FROM '.'host_mojotrollz_aowow'.'.?_aowow_lock
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_lock
WHERE lockID=?d
LIMIT 1
', $object['lockid']

View File

@ -337,6 +337,7 @@ function GetDBQuestInfo($id, $dataflag = QUEST_DATAFLAG_MINIMUM) {
*/
function GetQuestInfo(&$data, $dataflag = QUEST_DATAFLAG_MINIMUM) {
global $DB, $quest_class;
global $UDWBaseconf;
/* else
{
$data = $DB->selectRow('

View File

@ -312,9 +312,10 @@ function spell_duration($base) {
function spell_desc($spellid, $type='tooltip') {
global $DB;
global $spell_cols;
global $UDWBaseconf;
$spellRow = $DB->selectRow('
SELECT ?#
FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell, '.'host_mojotrollz_aowow'.'.?_aowow_spellicons
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons
WHERE
spellID=?
AND id=spellicon
@ -332,13 +333,14 @@ function spell_desc($spellid, $type='tooltip') {
*/
function spell_desc2($spellRow, $type='tooltip') {
global $DB;
global $UDWBaseconf;
// $spellRow = $DB->selectRow('SELECT s.*, i.iconname FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell s, '.'host_mojotrollz_aowow'.'.?_aowow_spellicons i WHERE s.spellID=? AND i.id=s.spellicon LIMIT 1', $spellID);
// $spellRow = $DB->selectRow('SELECT s.*, i.iconname FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell s, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons i WHERE s.spellID=? AND i.id=s.spellicon LIMIT 1', $spellID);
allspellsinfo2($spellRow);
if (!IsSet($spellRow['duration_base']))
$lastduration = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $spellRow['durationID']);
$lastduration = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $spellRow['durationID']);
$signs = array('+', '-', '/', '*', '%', '^');
@ -380,7 +382,7 @@ function spell_desc2($spellRow, $type='tooltip') {
switch ($exprType) {
case 'r':
if (!IsSet($spellRow['rangeMax']))
$spellRow = array_merge($spellRow, $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellrange WHERE rangeID=? LIMIT 1', $spellRow['rangeID']));
$spellRow = array_merge($spellRow, $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellrange WHERE rangeID=? LIMIT 1', $spellRow['rangeID']));
$base = $spellRow['rangeMax'];
@ -395,7 +397,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'c':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -411,7 +413,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 's':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -429,8 +431,8 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'o':
if ($lookup > 0) {
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$lastduration = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $spell['durationID']);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$lastduration = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $spell['durationID']);
}
else
$spell = $spellRow;
@ -446,7 +448,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 't':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -468,7 +470,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'm':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -487,7 +489,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'x':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -502,7 +504,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'q':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -519,12 +521,12 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'a':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
$exprData[0] = 1; // TODO
$radius = $DB->selectCell('SELECT radiusBase FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellradius WHERE radiusID=? LIMIT 1', $spell['effect' . $exprData[0] . 'radius']);
$radius = $DB->selectCell('SELECT radiusBase FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellradius WHERE radiusID=? LIMIT 1', $spell['effect' . $exprData[0] . 'radius']);
$base = $radius;
if (in_array($op, $signs) && is_numeric($oparg) && is_numeric($base)) {
@ -535,7 +537,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'h':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -549,7 +551,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'f':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -563,7 +565,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'n':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -577,7 +579,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'd':
if ($lookup > 0) {
$spell = $DB->selectRow('SELECT durationBase FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell a, '.'host_mojotrollz_aowow'.'.?_aowow_spellduration b WHERE a.durationID = b.durationID AND a.spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT durationBase FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell a, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellduration b WHERE a.durationID = b.durationID AND a.spellID=? LIMIT 1', $lookup);
@$base = ($spell['durationBase'] > 0 ? $spell['durationBase'] + 1 : 0);
}
else
@ -600,7 +602,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'e':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -625,7 +627,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'u':
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=?d LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=?d LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -642,7 +644,7 @@ function spell_desc2($spellRow, $type='tooltip') {
break;
case 'b': // only used at one spell (14179) should be 20, column 110/111/112?)
if ($lookup > 0)
$spell = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
$spell = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellID=? LIMIT 1', $lookup);
else
$spell = $spellRow;
@ -683,12 +685,13 @@ function spell_desc2($spellRow, $type='tooltip') {
function render_spell_tooltip(&$row) {
// БД
global $DB;
global $UDWBaseconf;
// Время каста
if ($row['spellcasttimesID'] > 1)
$casttime = ($DB->selectCell('SELECT base FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellcasttimes WHERE id=? LIMIT 1', $row['spellcasttimesID'])) / 1000;
$casttime = ($DB->selectCell('SELECT base FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellcasttimes WHERE id=? LIMIT 1', $row['spellcasttimesID'])) / 1000;
// Дальность действия
$range = $DB->selectCell('SELECT rangeMax FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellrange WHERE rangeID=? LIMIT 1', $row['rangeID']);
$range = $DB->selectCell('SELECT rangeMax FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellrange WHERE rangeID=? LIMIT 1', $row['rangeID']);
// Реагенты
$reagents = array();
@ -812,6 +815,7 @@ function render_spell_tooltip(&$row) {
function allspellsinfo2(&$row, $level=0) {
global $DB;
global $UDWBaseconf;
if (!($row['spellID']))
return;
@ -828,7 +832,7 @@ function allspellsinfo2(&$row, $level=0) {
if (IsSet($allitems[$row['effect1itemtype']]['icon']))
$allspells[$num]['icon'] = trim($allitems[$row['effect1itemtype']]['icon'], "\r");
else
$allspells[$num]['icon'] = trim($DB->selectCell('SELECT iconname FROM '.'host_mojotrollz_aowow'.'.?_aowow_icons WHERE id=(SELECT displayid FROM ?_item_template WHERE entry=?d LIMIT 1) LIMIT 1', $row['effect1itemtype']) , "\r");
$allspells[$num]['icon'] = trim($DB->selectCell('SELECT iconname FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons WHERE id=(SELECT displayid FROM ?_item_template WHERE entry=?d LIMIT 1) LIMIT 1', $row['effect1itemtype']) , "\r");
} else {
$allspells[$num]['icon'] = trim($row['iconname'], "\r");
}
@ -855,6 +859,7 @@ function allspellsinfo2(&$row, $level=0) {
*/
function spell_buff_render($row) {
global $DB;
global $UDWBaseconf;
$x = '<table><tr>';
@ -863,7 +868,7 @@ function spell_buff_render($row) {
// Тип диспела
if ($row['dispeltypeID']) {
$dispel = $DB->selectCell('SELECT name' . ' FROM '.'host_mojotrollz_aowow'.'.?_aowow_spelldispeltype WHERE id=? LIMIT 1', $row['dispeltypeID']);
$dispel = $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spelldispeltype WHERE id=? LIMIT 1', $row['dispeltypeID']);
$x .= '<th><b class="q">' . $dispel . '</b></th>';
}
@ -875,7 +880,7 @@ function spell_buff_render($row) {
$x .= spell_desc2($row, 'buff') . '<br>';
// Длительность баффа
$duration = $DB->selectCell('SELECT durationBase FROM '.'host_mojotrollz_aowow'.'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $row['durationID']);
$duration = $DB->selectCell('SELECT durationBase FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellduration WHERE durationID=? LIMIT 1', $row['durationID']);
if ($duration > 0)
$x .= '<span class="q">' . ($duration / 1000) . ' seconds remaining</span>';
@ -894,12 +899,13 @@ function allspellsinfo($id, $level=0) {
global $DB;
global $allspells;
global $spell_cols;
global $UDWBaseconf;
if (isset($allitems[$id]))
return $allitems[$id];
//TODO $UDWBaseconf['aowow']['db'];
$row = $DB->selectRow('
SELECT ?#
FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell s, '.'host_mojotrollz_aowow'.'.?_aowow_spellicons i
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell s, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons i
WHERE
s.spellID=?
AND i.id = s.spellicon
@ -921,10 +927,10 @@ function allspellsinfo($id, $level=0) {
*/
function spellinfo($id) {
global $DB;
//TODO $UDWBaseconf['aowow']['db']
global $UDWBaseconf;
$row = $DB->selectRow('
SELECT s.*, i.iconname
FROM '.'host_mojotrollz_aowow'.'.?_aowow_spell s, '.'host_mojotrollz_aowow'.'.?_aowow_spellicons i
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell s, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons i
WHERE
s.spellID=?
AND i.id = s.spellicon
@ -999,7 +1005,7 @@ function spellinfo2(&$row) {
//TODO $UDWBaseconf['aowow']['db']
$createrow = $DB->selectRow('
SELECT ?#
FROM ?_item_template, '.'host_mojotrollz_aowow'.'.?_aowow_icons
FROM ?_item_template, '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons
WHERE
entry=?d
AND id=displayid

View File

@ -157,6 +157,31 @@ function classes($class) {
return $tmp;
}
function classes_array($class) {
$tmp = array();
if($class == 1503 || $class == -1 || $class == 32767 || $class == 1535){ //ALL
return NULL;}
if ($class & CLASS_WARRIOR)
$tmp[] = 1;
if ($class & CLASS_PALADIN)
$tmp[] = 2;
if ($class & CLASS_HUNTER)
$tmp[] = 3;
if ($class & CLASS_ROGUE)
$tmp[] = 4;
if ($class & CLASS_PRIEST)
$tmp[] = 5;
if ($class & CLASS_SHAMAN)
$tmp[] = 7;
if ($class & CLASS_MAGE)
$tmp[] = 8;
if ($class & CLASS_WARLOCK)
$tmp[] = 9;
if ($class & CLASS_DRUID)
$tmp[] = 11;
return $tmp;
}
/**
* Determine race
*
@ -243,8 +268,10 @@ function coord_db2wow($mapid, $x, $y, $global) {
global $map_images;
// Подключение к базе
global $DB;
global $UDWBaseconf;
$rows = $DB->select('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_zones WHERE (mapID=? and x_min<? and x_max>? and y_min<? and y_max>?)', $mapid, $x, $x, $y, $y);
$rows = $DB->select('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE (mapID=? and x_min<? and x_max>? and y_min<? and y_max>?)', $mapid, $x, $x, $y, $y);
foreach ($rows as $numRow => $row) {
// Сохраяняем имя карты и координаты
@ -279,7 +306,7 @@ function coord_db2wow($mapid, $x, $y, $global) {
if (count($rows) == 0) {
// Ничего не найдено. Мб инста??
$row = $DB->selectRow('SELECT * FROM '.'host_mojotrollz_aowow'.'.?_aowow_zones WHERE (mapID=? and x_min=0 and x_max=0 and y_min=0 and y_max=0)', $mapid);
$row = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE (mapID=? and x_min=0 and x_max=0 and y_min=0 and y_max=0)', $mapid);
if ($row) {
$wow['zone'] = $row['areatableID'];
$wow['name'] = $row['name'];
@ -345,7 +372,8 @@ function mass_coord(&$data) {
*/
function factioninfo($id) {
global $DB;
$faction['name'] = $DB->selectCell('SELECT name' . ' FROM '.'host_mojotrollz_aowow'.'.?_aowow_factions WHERE factionID = ?d LIMIT 1', $id);
global $UDWBaseconf;
$faction['name'] = $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID = ?d LIMIT 1', $id);
$faction['entry'] = $id;
return $faction;
}

View File

@ -142,6 +142,9 @@ switch ($razdel) {
case 'spells':
include 'spells.php';
break;
case 'zone':
include 'zone.php';
break;
default:
include 'main.php';
break;

View File

@ -78,8 +78,8 @@ if (!$item = load_cache(5, $id)) {
$rows = $DB->select('
SELECT c.?#, c.entry
{
, l.name_loc?d as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, l.name?d as `name`
, l.subname' . ' as `subname`
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{ LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ? }
@ -144,8 +144,8 @@ if (!$item = load_cache(5, $id)) {
$rows_soldby = $DB->select('
SELECT ?#, c.entry, v.maxcount AS stock
{
, l.name_loc?d as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, l.name?d as `name`
, l.subname' . ' as `subname`
}
FROM ?_npc_vendor v, '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{ LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ? }
@ -237,7 +237,7 @@ if (!$item = load_cache(5, $id)) {
foreach ($drops_cii as $lootid => $drop) {
$rows = $DB->select('
SELECT c.?#, c.entry, maxcount
{ , l.name_loc?d AS `name_loc`}
{ , l.name?d AS `name`}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons, ?_item_template c
{ LEFT JOIN (?_locales_item l) ON l.entry=c.entry AND ? }
WHERE
@ -266,8 +266,8 @@ if (!$item = load_cache(5, $id)) {
$rows = $DB->select('
SELECT c.?#, c.entry
{
, l.name_loc?d as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, l.name?d as `name`
, l.subname' . $_SESSION['locale'] . ' as `subname`
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{ LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ? }
@ -293,8 +293,8 @@ if (!$item = load_cache(5, $id)) {
$rows = $DB->select('
SELECT c.?#, c.entry
{
, l.name_loc?d as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, l.name?d as `name`
, l.subname' . ' as `subname`
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{ LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ? }
@ -324,7 +324,7 @@ if (!$item = load_cache(5, $id)) {
$rows = $DB->select('
SELECT c.?#, c.entry, maxcount
{
, l.name_loc?d as `name_loc`
, l.name?d as `name`
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons, ?_item_template c
{ LEFT JOIN (?_locales_item l) ON l.entry=c.entry AND ? }
@ -350,7 +350,7 @@ if (!$item = load_cache(5, $id)) {
$rows_cpi = $DB->select('
SELECT c.?#, c.entry, maxcount
{
, l.name_loc?d as `name_loc`
, l.name?d as `name`
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons, ?_item_template c
{ LEFT JOIN (?_locales_item l) ON l.entry=c.entry AND ? }
@ -390,7 +390,7 @@ if (!$item = load_cache(5, $id)) {
foreach ($rows_r as $numRow => $row) {
$item['reagentfor'][$numRow] = array();
$item['reagentfor'][$numRow]['entry'] = $row['spellID'];
$item['reagentfor'][$numRow]['name'] = $row['spellname_loc' . $_SESSION['locale']];
$item['reagentfor'][$numRow]['name'] = $row['spellname'];
$item['reagentfor'][$numRow]['school'] = $row['resistancesID'];
$item['reagentfor'][$numRow]['level'] = $row['levelspell'];
$item['reagentfor'][$numRow]['quality'] = '@';
@ -448,7 +448,7 @@ if (!$item = load_cache(5, $id)) {
foreach ($drops_fi as $lootid => $drop) {
// Обычные локации
$row = $DB->selectRow('
SELECT name_loc' . $_SESSION['locale'] . ' AS name, areatableID as id
SELECT name' . ' AS name, areatableID as id
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones
WHERE
areatableID=?d
@ -461,7 +461,7 @@ if (!$item = load_cache(5, $id)) {
} else {
// Инсты
$row = $DB->selectRow('
SELECT name_loc' . $_SESSION['locale'] . ' AS name, mapID as id
SELECT name' . ' AS name, areatableID as id
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones
WHERE
areatableID=?d

189221
other/Aowow_Full.sql Normal file

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@ if (!$quest = load_cache(10, intval($id))) {
while ($tmp) {
$tmp = $DB->selectRow('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?d}
WHERE q.NextQuestInChain=?d
@ -53,8 +53,8 @@ if (!$quest = load_cache(10, intval($id))) {
', ($_SESSION['locale'] > 0) ? $_SESSION['locale'] : DBSIMPLE_SKIP, ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, $quest['series'][0]['entry']
);
if ($tmp) {
if (!empty($tmp['Title_loc']))
$tmp['Title'] = $tmp['Title_loc'];
if (!empty($tmp['Title']))
$tmp['Title'] = $tmp['Title'];
array_unshift($quest['series'], $tmp);
}
}
@ -63,7 +63,7 @@ if (!$quest = load_cache(10, intval($id))) {
while ($tmp) {
$tmp = $DB->selectRow('
SELECT q.entry, q.Title, q.NextQuestInChain
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE q.entry=?d
@ -71,8 +71,8 @@ if (!$quest = load_cache(10, intval($id))) {
', ($_SESSION['locale'] > 0) ? $_SESSION['locale'] : DBSIMPLE_SKIP, ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, $quest['series'][count($quest['series']) - 1]['NextQuestInChain']
);
if ($tmp) {
if (!empty($tmp['Title_loc']))
$tmp['Title'] = $tmp['Title_loc'];
if (!empty($tmp['Title']))
$tmp['Title'] = $tmp['Title'];
array_push($quest['series'], $tmp);
}
}
@ -86,7 +86,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Квесты, которые необходимо выполнить, что бы получить этот квест
if (!$quest['req'] = $DB->select('
SELECT q.entry, q.Title, q.NextQuestInChain
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE
@ -102,7 +102,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Квесты, которые становятся доступными, только после того как выполнен этот квест (необязательно только он)
if (!$quest['open'] = $DB->select('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE
@ -119,7 +119,7 @@ if (!$quest = load_cache(10, intval($id))) {
if ($quest['ExclusiveGroup'] > 0)
if (!$quest['closes'] = $DB->select('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE
@ -135,7 +135,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Требует выполнения одного из квестов, на выбор:
if (!$quest['reqone'] = $DB->select('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE
@ -151,7 +151,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Квесты, которые доступны, только во время выполнения этого квеста
if (!$quest['enables'] = $DB->select('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE q.PrevQuestID=?d
@ -167,7 +167,7 @@ if (!$quest = load_cache(10, intval($id))) {
if ($quest['PrevQuestID'] < 0)
if (!$quest['enabledby'] = $DB->select('
SELECT q.entry, q.Title
{, l.Title_loc?d AS `Title_loc`}
{, l.Title?d AS `Title`}
FROM ?_quest_template q
{LEFT JOIN (?_locales_quest l) ON l.entry=q.entry AND ?}
WHERE q.entry=?d
@ -183,8 +183,8 @@ if (!$quest = load_cache(10, intval($id))) {
if ($questItems)
foreach ($questItems as $item)
foreach ($quest[$item] as $i => $x)
if (!empty($quest[$item][$i]['Title_loc']))
$quest[$item][$i]['Title'] = $quest[$item][$i]['Title_loc'];
if (!empty($quest[$item][$i]['Title']))
$quest[$item][$i]['Title'] = $quest[$item][$i]['Title'];
@ -208,7 +208,7 @@ if (!$quest = load_cache(10, intval($id))) {
// TODO: skill localization
$quest['reqskill'] = array(
'name' => $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_skill WHERE skillID=?d LIMIT 1', $quest['SkillOrClass']),
'name' => $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_skill WHERE skillID=?d LIMIT 1', $quest['SkillOrClass']),
'value' => $quest['RequiredSkillValue']
);
} elseif ($quest['SkillOrClass'] < 0)
@ -218,13 +218,13 @@ if (!$quest = load_cache(10, intval($id))) {
// Требуемые отношения с фракциями, что бы начать квест
if ($quest['RequiredMinRepFaction'] && $quest['RequiredMinRepValue'])
$quest['RequiredMinRep'] = array(
'name' => $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RequiredMinRepFaction']),
'name' => $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RequiredMinRepFaction']),
'entry' => $quest['RequiredMinRepFaction'],
'value' => $reputations[$quest['RequiredMinRepValue']]
);
if ($quest['RequiredMaxRepFaction'] && $quest['RequiredMaxRepValue'])
$quest['RequiredMaxRep'] = array(
'name' => $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RequiredMaxRepFaction']),
'name' => $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RequiredMaxRepFaction']),
'entry' => $quest['RequiredMaxRepFaction'],
'value' => $reputations[$quest['RequiredMaxRepValue']]
);
@ -234,7 +234,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Спелл, кастуемый на игрока в начале квеста
if ($quest['SrcSpell']) {
$tmp = $DB->selectRow('
SELECT ?#, s.spellname_loc' . $_SESSION['locale'] . '
SELECT ?#, s.spellname' . '
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell s, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons si
WHERE
s.spellID=?d
@ -243,7 +243,7 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($tmp) {
$quest['SrcSpell'] = array(
'name' => $tmp['spellname_loc' . $_SESSION['locale']],
'name' => $tmp['spellname'],
'entry' => $tmp['spellID']);
allspellsinfo2($tmp);
}
@ -253,7 +253,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Спелл, кастуемый на игрока в награду за выполнение
if ($quest['RewSpellCast'] > 0 || $quest['RewSpell'] > 0) {
$tmp = $DB->SelectRow('
SELECT ?#, s.spellname_loc' . $_SESSION['locale'] . '
SELECT ?#, s.spellname' . '
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell s, '.$UDWBaseconf['aowow']['db'].'.?_aowow_spellicons si
WHERE
s.spellID=?d
@ -262,7 +262,7 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($tmp) {
$quest['spellreward'] = array(
'name' => $tmp['spellname_loc' . $_SESSION['locale']],
'name' => $tmp['spellname'],
'entry' => $tmp['spellID']);
allspellsinfo2($tmp);
}
@ -292,7 +292,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Спелл
if ($quest['ReqSpellCast' . $i])
$quest['coreqs'][$i]['spell'] = array(
'name' => $DB->selectCell('SELECT spellname_loc' . $_SESSION['locale'] . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellid=?d LIMIT 1', $quest['ReqSpellCast' . $i]),
'name' => $DB->selectCell('SELECT spellname' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_spell WHERE spellid=?d LIMIT 1', $quest['ReqSpellCast' . $i]),
'entry' => $quest['ReqSpellCast' . $i]
);
}
@ -312,7 +312,7 @@ if (!$quest = load_cache(10, intval($id))) {
// Фракции необходимые для квеста
if ($quest['RepObjectiveFaction'] > 0 && $quest['RepObjectiveValue'] > 0) {
$quest['factionreq'] = array(
'name' => $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RepObjectiveFaction']),
'name' => $DB->selectCell('SELECT name' . ' FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factions WHERE factionID=?d LIMIT 1', $quest['RepObjectiveFaction']),
'entry' => $quest['RepObjectiveFaction'],
'value' => $reputations[$quest['RepObjectiveValue']]
);
@ -324,7 +324,7 @@ if (!$quest = load_cache(10, intval($id))) {
// НПС
$rows = $DB->select('
SELECT c.entry, c.name, A, H
{, l.name_loc?d as `name_loc`}
{, l.name?d as `name`}
FROM ?_creature_questrelation q, '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ?}
WHERE
@ -335,8 +335,8 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($rows) {
foreach ($rows as $tmp) {
if (!empty($tmp['name_loc']))
$tmp['name'] = $tmp['name_loc'];
if (!empty($tmp['name']))
$tmp['name'] = $tmp['name'];
if ($tmp['A'] == -1 && $tmp['H'] == 1)
$tmp['side'] = 'horde';
elseif ($tmp['A'] == 1 && $tmp['H'] == -1)
@ -349,7 +349,7 @@ if (!$quest = load_cache(10, intval($id))) {
// ГО
$rows = $DB->select('
SELECT g.entry, g.name
{, l.name_loc?d as `name_loc`}
{, l.name?d as `name`}
FROM ?_gameobject_questrelation q, ?_gameobject_template g
{LEFT JOIN (?_locales_gameobject l) ON l.entry = g.entry AND ?}
WHERE
@ -359,8 +359,8 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($rows) {
foreach ($rows as $tmp) {
if (!empty($tmp['name_loc']))
$tmp['name'] = $tmp['name_loc'];
if (!empty($tmp['name']))
$tmp['name'] = $tmp['name'];
$quest['start'][] = array_merge($tmp, array('type' => 'object'));
}
}
@ -369,7 +369,7 @@ if (!$quest = load_cache(10, intval($id))) {
// итем
$rows = $DB->select('
SELECT i.name, i.entry, i.quality, LOWER(a.iconname) AS iconname
{, l.name_loc?d as `name_loc`}
{, l.name?d as `name`}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_icons a, ?_item_template i
{LEFT JOIN (?_locales_item l) ON l.entry=i.entry AND ?}
WHERE
@ -379,8 +379,8 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($rows) {
foreach ($rows as $tmp) {
if (!empty($tmp['name_loc']))
$tmp['name'] = $tmp['name_loc'];
if (!empty($tmp['name']))
$tmp['name'] = $tmp['name'];
$quest['start'][] = array_merge($tmp, array('type' => 'item'));
}
}
@ -390,7 +390,7 @@ if (!$quest = load_cache(10, intval($id))) {
// НПС
$rows = $DB->select('
SELECT c.entry, c.name, A, H
{, l.name_loc?d as `name_loc`}
{, l.name?d as `name`}
FROM ?_creature_questrelation q, '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{LEFT JOIN (?_locales_creature l) ON l.entry=c.entry AND ?}
WHERE
@ -401,8 +401,8 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($rows) {
foreach ($rows as $tmp) {
if (!empty($tmp['name_loc']))
$tmp['name'] = $tmp['name_loc'];
if (!empty($tmp['name']))
$tmp['name'] = $tmp['name'];
if ($tmp['A'] == -1 && $tmp['H'] == 1)
$tmp['side'] = 'horde';
elseif ($tmp['A'] == 1 && $tmp['H'] == -1)
@ -415,7 +415,7 @@ if (!$quest = load_cache(10, intval($id))) {
// ГО
$rows = $DB->select('
SELECT g.entry, g.name
{, l.name_loc?d as `name_loc`}
{, l.name?d as `name`}
FROM ?_gameobject_questrelation q, ?_gameobject_template g
{LEFT JOIN (?_locales_gameobject l) ON l.entry = g.entry AND ?}
WHERE
@ -425,8 +425,8 @@ if (!$quest = load_cache(10, intval($id))) {
);
if ($rows) {
foreach ($rows as $tmp) {
if (!empty($tmp['name_loc']))
$tmp['name'] = $tmp['name_loc'];
if (!empty($tmp['name']))
$tmp['name'] = $tmp['name'];
$quest['end'][] = array_merge($tmp, array('type' => 'object'));
}
}

2308
sql/aowow_zones_wotlk.sql Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
{if $data[i].maxlevel}maxlevel: {$data[i].maxlevel},{/if}
{if $data[i].pieces}pieces:[{section name=j loop=$data[i].pieces}{$data[i].pieces[j]}{if $smarty.section.j.last}{else},{/if}{/section}],{/if}
{if isset($data[i].type)}type: {$data[i].type},{/if}
{if isset($data[i].classes)}classes:[{section name=j loop=$data[i].classes}{$data[i].classes[j]}{if $smarty.section.j.last}{else},{/if}{/section}],{/if}
id: {$data[i].entry}
{rdelim}
{if $smarty.section.i.last}{else},{/if}

View File

@ -1419,6 +1419,8 @@ a.moneyitem:hover,a.moneysocketmeta:hover,a.moneysocketred:hover,a.moneysocketye
height:68px;
background:6px 6px no-repeat;
position:relative;
padding-top: 4px;
padding-left: 3px;
}
.iconlarge .tile

View File

@ -39,7 +39,7 @@ var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
{if isset($faction.items)}{include file='bricks/item_table.tpl' id='items' name='items' tabsid='tabsRelated' data=$faction.items}{/if}
{if isset($faction.npcs)}{include file='bricks/creature_table.tpl' id='npcs' name='members' tabsid='tabsRelated' data=$faction.npcs}{/if}
{if isset($faction.quests)}{include file='bricks/quest_table.tpl' id='quests' name='quests' tabsid='tabsRelated' data=$faction.quests}{/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -43,7 +43,7 @@
<div class="text">
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$item.name}</h1>
<div id="icon{$item.entry}-generic" style="float: left"></div>
@ -89,7 +89,7 @@ var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
{if isset($item.createdfrom)}{include file='bricks/spell_table.tpl' id='created-by' tabsid='tabsRelated' data=$item.createdfrom name='createdby' }{/if}
{if isset($item.disenchanting)}{include file='bricks/item_table.tpl' id='disenchanting' tabsid='tabsRelated' data=$item.disenchanting name='disenchanting' }{/if}
{if isset($item.disenchantedfrom)}{include file='bricks/item_table.tpl' id='disenchanting' tabsid='tabsRelated' data=$item.disenchantedfrom name='disenchantedfrom' }{/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -33,7 +33,7 @@
<script type="text/javascript">ss_appendSticky()</script>
<div class="text">
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$itemset.name}</h1>
{$itemset.article}
This {$itemset.count}-piece set includes the following items:
@ -58,7 +58,7 @@
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">
var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -4189,13 +4189,13 @@ Listview.templates = {
{
id: "classes",
name: LANG.classes,
compute: function (C, D) {
if (C.classes != null) {
for (var B = 0, A = C.classes.length; B < A; ++B) {
if (B > 0) {
ae(D, ct(LANG.comma))
compute: function (A, B) {
if (A.classes != null) {
for (var D = 0, E = A.classes.length; D < E; ++D) {
if (D > 0) {
ae(B, ct(LANG.comma))
}
ae(D, ct(g_chr_classes[C.classes[B]]))
ae(B, ct(g_chr_classes[A.classes[D]]))
}
}
},

View File

@ -20,7 +20,7 @@ var g_chr_classes = {
4: "Rogue",
7: "Shaman",
9: "Warlock",
1: "Warrior"
1: "Warrior",
};
var g_chr_races = {
10: "Blood Elf",
@ -54,6 +54,7 @@ var g_item_slots = {
17: "Two-Hand",
18: "Bag",
19: "Tabard",
20: "Chest",
21: "Main Hand",
22: "Off Hand",
23: "Held In Off-hand",

View File

@ -14,24 +14,24 @@
<div id="lv-comments" class="listview"></div>
<script type="text/javascript">
{strip}
new Listview({ldelim}template: 'commentpreview', id: 'comments', data: [
{foreach name=foo from=$comments key=number item=comment}
{ldelim}
id:{$comment.id},
type:{$comment.type},
typeId:{$comment.typeID},
subject:'{$comment.subject|escape:"javascript"}',
preview:'{$comment.preview|escape:"javascript"}',
user:'{$comment.user|escape:"javascript"}',
rating: {$comment.rating},
date:'{$comment.date|date_format:"%Y/%m/%d %H:%M:%S"}',
elapsed:{$comment.elapsed},
purged: {$comment.purged},
deleted:0
{rdelim}
{if $smarty.foreach.foo.last}{else},{/if}
{/foreach}
]{rdelim});
//new Listview({ldelim}template: 'commentpreview', id: 'comments', data: [
//{foreach name=foo from=$comments key=number item=comment}
// {ldelim}
// id:{$comment.id},
// type:{$comment.type},
// typeId:{$comment.typeID},
// subject:'{$comment.subject|escape:"javascript"}',
// preview:'{$comment.preview|escape:"javascript"}',
// user:'{$comment.user|escape:"javascript"}',
// rating: {$comment.rating},
// date:'{$comment.date|date_format:"%Y/%m/%d %H:%M:%S"}',
// elapsed:{$comment.elapsed},
// purged: {$comment.purged},
// deleted:0
// {rdelim}
// {if $smarty.foreach.foo.last}{else},{/if}
//{/foreach}
//]{rdelim});
{/strip}
</script>
<div class="clear"></div>

View File

@ -46,7 +46,7 @@
</table>
<div class="text">
<a href="http://www.wowhead.com/?{$query}" target="_blank" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" target="_blank" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$npc.name}{if $npc.subname} &lt;{$npc.subname}&gt;{/if}</h1>
{if $zonedata}
@ -119,7 +119,7 @@ var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
{if isset($npc.abilities)}{include file='bricks/spell_table.tpl' id='abilities' name='abilities' tabsid='tabsRelated' data=$npc.abilities}{/if}
{if isset($npc.objectiveof)}{include file='bricks/quest_table.tpl' id='objective-of' name='objectiveof' tabsid='tabsRelated' data=$npc.objectiveof}{/if}
{if isset($npc.teaches)}{include file='bricks/spell_table.tpl' id='teaches-ability' name='teaches' tabsid='tabsRelated' data=$npc.teaches}{/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -29,7 +29,7 @@
<div class="text">
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$object.name}</h1>
{if $zonedata}
@ -65,6 +65,7 @@
{/foreach}
</span>
{/strip}
<br/>
<div id="mapper-generic"></div>
<div class="clear"></div>
{literal}
@ -104,7 +105,7 @@ var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
{if isset($object.drop)}{include file='bricks/item_table.tpl' id='contains' name='contains' tabsid='tabsRelated' data=$object.drop}{/if}
{if isset($object.starts)}{include file='bricks/quest_table.tpl' id='starts' name='starts' tabsid='tabsRelated' data=$object.starts}{/if}
{if isset($object.ends)}{include file='bricks/quest_table.tpl' id='ends' name='ends' tabsid='tabsRelated' data=$object.ends}{/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -189,7 +189,7 @@
<script type="text/javascript">ss_appendSticky()</script>
<div class="text">
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$quest.Title}</h1>
{if isset($quest.RequiredMinRep) or isset($quest.RequiredMaxRep)}
@ -431,7 +431,7 @@
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">
var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
//new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
tabsRelated.flush();
</script>

View File

@ -4,7 +4,7 @@
<div class="main-contents" id="main-contents">
{if $found}
<div class="text">
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{#Search_results_for#} <i>{$search|escape:"html"}</i></h1>
</div>
<div id="tabs-generic"></div>
@ -24,7 +24,7 @@ myTabs.flush();
<div class="clear"></div>
{else}
<div class=text>
<a href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{#Search_results_for#} <i>{$search|escape:"html"}</i></h1>
</div>
{/if}

View File

@ -27,7 +27,7 @@
<script type="text/javascript">ss_appendSticky()</script>
<div class="text">
<a href="http://www.wowhead.com/?{$query}" target="_blank" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<a target="blank" href="http://www.wowhead.com/?{$query}" target="_blank" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$spell.name}</h1>
<div id="icon{$spell.entry}-generic" style="float: left"></div>

117
templates/wowhead/zone.tpl Normal file
View File

@ -0,0 +1,117 @@
{include file='header.tpl'}
<div id="main">
<div id="main-precontents"></div>
<div id="main-contents" class="main-contents">
<script type="text/javascript">
{include file='bricks/allcomments.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeid}, name: '{$zone.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
</script>
{if isset($zone.floors)}
<table class="infobox">
<tr><th>{#Dungeon_Floor#}</th></tr>
<tr><td>
<div class="infobox-spacer"></div>
{foreach from=$zone.floors item=zf key=k}
<li><div><a href="?zone={$zone.areatableID}_{$k}">{#Level#} {$k}</a></br>
{foreach from=$zf item=fl name=fl}<ul>{$fl.name}</ul>{/foreach}
</div></li>
{/foreach}
</td></tr>
</table>
{/if}
{if $zone.explevel}
<table class="infobox">
<tr><th>{#Quick_Facts#}</th></tr>
<tr><td><div class="infobox-spacer"></div>
<ul>
<li><div>{#Level#}: {$zone.explevel|escape:"quotes"}</div></li>
</ul>
</td></tr>
</table>
{/if}
<div class="text">
<a target="blank" href="http://www.wowhead.com/?{$query}" class="button-red"><div><blockquote><i>Wowhead</i></blockquote><span>Wowhead</span></div></a>
<h1>{$zone.name}</h1>
{if $zone.position}
<div>
{strip}
<span id="locations">
{foreach from=$zone.position item=zoneitem name=zoneitem}
<a href="javascript:;" onclick="
myMapper.update(
{ldelim}
{if $zoneitem.atid}
zone:{$zoneitem.atid}
{if isset($zoneitem.points)}
,
{/if}
{else}
show:false
{/if}
{if isset($zoneitem.points)}
coords:[
{foreach from=$zoneitem.points item=point name=point}
[{$point.x},{$point.y},
{ldelim}
label:'{if isset($point.name)}{$point.name|escape:"html"|escape:"html"}{else}${/if}<br>
{if isset($point.r) or isset($point.events)}
<div class=q0>
<small>
{#Respawn#}: {$point.r}
{if isset($point.events)}<br>{$point.events|escape:"quotes"}{/if}
</small>
</div>
{/if}',
{if isset($point.url)}url:'{$point.url|escape:"quotes"}',{/if}
type:'{$point.type}'
{rdelim}]
{if !$smarty.foreach.point.last},{/if}
{/foreach}
]
{/if}
{rdelim});
g_setSelectedLink(this, 'mapper'); return false" onmousedown="return false">
{$zoneitem.name}</a>{if $zoneitem.population > 1}&nbsp;({$zoneitem.population}){/if}{if $smarty.foreach.zoneitem.last}{else}, {/if}
{/foreach}
</span></div>
{/strip}
<div id="mapper-generic"></div>
<div class="clear"></div>
<script type="text/javascript">
var myMapper = new Mapper({ldelim}parent: 'mapper-generic', zone: '{$zone.position[0].atid}'{rdelim});
gE(ge('locations'), 'a')[0].onclick();
</script>
{/if}
{if isset($zone.parentname) and isset($zone.parent)}
<div class="pad"></div>
<div>{#This_zone_is_part_of#} <a href="?zone={$zone.parent}">{$zone.parentname}</a>.</div>
{/if}
<h2></h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">
var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
{if isset($zone.fishing)}{include file='bricks/item_table.tpl' id='fishing' name='fishing' tabsid='tabsRelated' data=$zone.fishing}{/if}
{if isset($zone.subzones)}{include file='bricks/zone_table.tpl' id='zones' name='zones' tabsid='tabsRelated' data=$zone.subzones}{/if}
{if $page.comment}new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});{/if}
tabsRelated.flush();
</script>
{if $page.comment}{include file='bricks/contribute.tpl'}{/if}
</div>
</div>
{include file='footer.tpl'}

227
zone.php Normal file
View File

@ -0,0 +1,227 @@
<?php
//require_once('includes/allutil.php');
require_once('includes/allitems.php');
/*if(!$AoWoWconf['disable_comments'])
require_once('includes/allcomments.php');*/
$smarty->config_load($conf_file, 'zone');
// номер объекта;
$id = intval($podrazdel);
$file = dirname(__FILE__).'/images/maps/enus/normal/'.$id;
if (!file_exists($file.'.jpg') && file_exists($file.'_1.jpg'))
$level = 1;
$pos = strpos($podrazdel, "_");
if ($pos)
$level = substr($podrazdel, $pos+1);
//$cache_key = cache_key($id);
$id = $podrazdel;
if(!$zone = load_cache(ZONE_PAGE, $id))
{
unset($zone);
// Данные об объекте:
$zone = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE areatableID = ?d', $id);
//$zone['name'] = localizedName($zone);
if(!($zone['fishing'] = loot('fishing_loot_template', $id)))
unset($zone['fishing']);
if($zone['parent'])
{
$row = $DB->selectRow('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE areatableID = ?d', $zone['parent']);
if ($row)
$parentname = localizedName($row);
unset($row);
if (!empty($parentname))
$zone['parentname'] = $parentname;
}
$rows = $DB->select('SELECT * FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_zones WHERE mapID = ?d', $id);
if ($rows)
{
$zone['subzones'] = array();
foreach($rows as $row)
{
$zone['subzones'][] = array(
'id' => $row['areatableID'],
'name' => $row['name'],
'explevel' => $row['explevel']
);
}
}
unset($rows);
/*$rows = $DB->select('SELECT * FROM ?_dungeon_floor WHERE MapID = ?d', $zone['mapID']);
if ($rows)
{
$zone['floors'] = array();
foreach($rows as $row)
{
$zone['floors'][$row['DungeonFloor']][] = array(
'name' => localizedName($row),
'floor' => $row['DungeonFloor']
);
}
}
unset($rows);*/
$zone['position'] = array();
// Optimized version of position() + transform_coords() without map mask check
if ($zone['x_min'] && $zone['y_min'] && $zone['x_max'] && $zone['y_max'])
{
// Flight masters
$rows = $DB->select('
SELECT ct.entry, ct.name, ct.SubName, lc.name_loc?d, lc.subname_loc?d, ct.NpcFlags, position_x, position_y
FROM creature c, creature_template ct
LEFT JOIN locales_creature lc ON ct.entry = lc.entry
WHERE c.id = ct.entry
AND ct.NpcFlags & 126976
AND c.map = ?d
AND c.position_x > ?f
AND c.position_x < ?f
AND c.position_y > ?f
AND c.position_y < ?f
',
$_SESSION['locale'] > 0 ? $_SESSION['locale'] : 1,
$_SESSION['locale'] > 0 ? $_SESSION['locale'] : 1,
$zone['mapID'],
$zone['x_min'],
$zone['x_max'],
$zone['y_min'],
$zone['y_max']);
if ($rows)
{
$taxies = array(
'population' => 0,
'name' => LOCALE_ZONE_FLIGHT_MASTERS,
'atid' => $id.($level ? "_".$level : ""),
'points' => array()
);
$inns = array(
'population' => 0,
'name' => LOCALE_ZONE_INNKEEPERS,
'atid' => $id.($level ? "_".$level : ""),
'points' => array()
);
$repairers = array(
'population' => 0,
'name' => LOCALE_ZONE_REPAIRERS,
'atid' => $id.($level ? "_".$level : ""),
'points' => array()
);
$spirithealers = array(
'population' => 0,
'name' => LOCALE_ZONE_SPIRIT_HEALERS,
'atid' => $id.($level ? "_".$level : ""),
'points' => array()
);
foreach($rows as $row)
{
$name = $row['name'];
$subname = $row["subname"];
if ($subname)
$name = $name . " <" . $subname . ">";
$point = array(
'name' => $name,
'type' => 0, // affects pin color (style=pin-$type)
'url' => '?npc='.$row['entry'],
'x' => round(100 - ($row['position_y']-$zone['y_min']) / (($zone['y_max']-$zone['y_min']) / 100), 2),
'y' => round(100 - ($row['position_x']-$zone['x_min']) / (($zone['x_max']-$zone['x_min']) / 100), 2)
);
if ($row['NpcFlags']&8192)
{
$taxies['population']++;
$taxies['points'][] = $point;
}
if ($row['NpcFlags']&65536)
{
$inns['population']++;
$inns['points'][] = $point;
}
if ($row['NpcFlags']&4096)
{
$repairers['population']++;
$repairers['points'][] = $point;
}
if ($row['NpcFlags']&16384 || $row['NpcFlags']&32768)
{
$spirithealers['population']++;
$spirithealers['points'][] = $point;
}
}
if ($taxies['population'])
$zone['position'][] = $taxies;
if ($inns['population'])
$zone['position'][] = $inns;
if ($repairers['population'])
$zone['position'][] = $repairers;
if ($spirithealers['population'])
$zone['position'][] = $spirithealers;
}
}
if (!$zone['position'])
{
$zone['position'] = array(
array(
'population' => 0,
'name' => ""/*$zone['name']*/,
'atid' => $id.($level ? "_".$level : ""),
'points' => array()
)
);
}
/* // Положения объектофф:
$zone['position'] = position($object['entry'], 'gameobject');
// Исправить type, чтобы подсвечивались event-овые объекты
if ($object['position'])
foreach ($object['position'] as $z => $zone)
foreach ($zone['points'] as $p => $pos)
if ($pos['type'] == 0 && ($events = event_find(array('object_guid' => $pos['guid']))))
{
$names = array_select_key(event_name($events), 'name');
$object['position'][$z]['points'][$p]['type'] = 4;
$object['position'][$z]['points'][$p]['events'] = implode(", ", $names);
}
*/
save_cache(ZONE_PAGE, $cache_key, $zone);
}
global $page;
$page = array(
'Mapper' => true,
'Book' => false,
'Title' => $zone['name'].' - '.$smarty->get_config_vars('Zone'),
'tab' => 1,
'type' => 0,
'typeid' => 0,
'path' => null,//path(1, 1), //path(0, 6, $zone['map'])
'comment' => true
);
// Комментарии
//if($AoWoWconf['disable_comments'])
$page['comment'] = false;
//else
// $smarty->assign('comments', getcomments($page['type'], $page['typeid']));
$smarty->assign('page', $page);
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
$smarty->assign('zone', $zone);
$smarty->display('zone.tpl');
?>