TheLuda 947f95fb20 Imported AoWoW.
This version of AoWoW is based on https://github.com/udw/udwbase and is
not yet usable.

An initial amount of testing has been finished, and you can import the
aowow.sql database into your world database, and create a local copy of
config.php.in as config.php to test this version.

FirePHP (http://firephp.org/) has been added for testing purposes.

Signed-off-by: TheLuda <theluda@getmangos.com>
2011-09-25 20:57:24 +02:00

74 lines
2.3 KiB
PHP
Raw 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', 'type', 'rank', 'A', 'H');
$npc_cols[1] = array('subname', 'minlevel', 'maxlevel', 'type', 'rank', 'minhealth', 'maxhealth', 'minmana', 'maxmana', 'mingold', 'maxgold', 'lootid', 'spell1', 'spell2', 'spell3', 'spell4', 'A', 'H', 'mindmg', 'maxdmg', 'attackpower', 'dmg_multiplier', '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['type'];
// Тег 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;
$row = $DB->selectRow('
SELECT ?#, c.entry
{
, l.name_loc' . $_SESSION['locale'] . ' as `name_loc`
, l.subname_loc' . $_SESSION['locale'] . ' as `subname_loc`
, ?
}
FROM ?_aowow_factiontemplate, ?_creature_template c
{
LEFT JOIN (?_locales_creature l)
ON l.entry=c.entry AND ?
}
WHERE
c.entry=?d
AND factiontemplateID=faction_A
LIMIT 1
', $npc_cols[0], ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, ($_SESSION['locale'] > 0) ? 1 : DBSIMPLE_SKIP, $id
);
return creatureinfo2($row);
}