2017-01-15 15:23:01 +01:00

76 lines
2.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* UDWBase: WOWDB Web Interface
*
* © UDW 2009-2011
*
* Released under the terms and conditions of the
* GNU General Public License (http://gnu.org).
*
*/
// Для списка creatureinfo()
$npc_cols[0] = array('name', 'subname', 'minlevel', 'maxlevel', 'Creaturetype', 'rank', 'FactionAlliance', 'FactionHorde');
$npc_cols[1] = array('subname', 'minlevel', 'maxlevel', 'creaturetype', 'rank', 'MinLevelHealth', 'MaxLevelHealth', 'MinLevelMana', 'MaxLevelMana', 'MinLootGold', 'MaxLootGold', 'lootid', /*'spell1', 'spell2', 'spell3', 'spell4',*/ 'FactionAlliance', 'FactionHorde', 'MinMeleeDmg', 'MaxMeleeDmg', 'MeleeAttackPower', 'DamageMultiplier', 'armor');
// Функция информации о создании
/**
*
* @param type $Row
* @return type
*/
function creatureinfo2(&$Row) {
// Номер создания
$creature['entry'] = $Row['entry'];
// Имя создания
$creature['name'] = !empty($Row['name_loc']) ? $Row['name_loc'] : $Row['name'];
// Подимя создания
$creature['subname'] = !empty($Row['subname_loc']) ? $Row['subname_loc'] : $Row['subname'];
// Min/Max уровни
$creature['minlevel'] = $Row['minlevel'];
$creature['maxlevel'] = $Row['maxlevel'];
// TODO: Месторасположение
// $creature['location'] = location($creature['entry'],'creature');
// TODO: Реакция на фракции
$creature['react'] = ($Row['A']) . ',' . ($Row['H']);
// Тип NPC
$creature['type'] = $Row['Creaturetype'];
// Тег NPC
$creature['tag'] = str_normalize($Row['subname']);
// Ранг NPC
$creature['classification'] = $Row['rank'];
return $creature;
}
// Функция информации о создании
/**
*
* @param type $id
* @return type
*/
function creatureinfo($id) {
global $DB;
global $npc_cols;
global $UDWBaseconf;
$row = $DB->selectRow('
SELECT ?#, c.entry
{
, l.name_loc' . $_SESSION['locale'] . ' as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, ?
}
FROM '.$UDWBaseconf['aowow']['db'].'.?_aowow_factiontemplate, ?_creature_template c
{
LEFT JOIN (?_locales_creature l)
ON l.entry=c.entry AND ?
}
WHERE
c.entry=?d
AND factiontemplateID=FactionAlliance
LIMIT 1
', $npc_cols[0], ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, $id
);
return creatureinfo2($row);
}