예제 #1
0
파일: allnpcs.php 프로젝트: Brueggus/aowow
function creatureinfo2(&$Row)
{
    global $smarty;
    // Номер создания
    $creature['entry'] = $Row['entry'];
    // Имя создания
    $creature['name'] = localizedName($Row);
    // Заменяем " (1)" на " (героич.)"
    $creature['name'] = str_replace(' (1)', LOCALE_HEROIC, $creature['name']);
    // Подимя создания
    $creature['subname'] = localizedName($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;
}
예제 #2
0
function creatureinfo2($Row)
{
    $creature = array('entry' => $Row['entry'], 'name' => str_replace(' (1)', LOCALE_HEROIC, localizedName($Row)), 'subname' => localizedName($Row, 'subname'), 'minlevel' => $Row['minlevel'], 'maxlevel' => $Row['maxlevel'], 'react' => $Row['A'] . ',' . $Row['H'], 'type' => $Row['type'], 'classification' => $Row['rank']);
    $x .= "</td></tr></table>";
    $creature['tooltip'] = $x;
    return $creature;
}
예제 #3
0
function render_npc_tooltip(&$Row)
{
    global $type;
    global $rank;
    $x = '<table>';
    $x .= '<tr><td><b class="q">' . localizedName($Row) . '</b></td></tr>';
    $x .= '<tr><td>' . localizedName($Row, 'subname') . '</td></tr>';
    $x .= '<tr><td>Level ';
    if ($Row['rank'] == 3) {
        $x .= '??';
    } else {
        $x .= $Row['minlevel'];
        if ($Row['minlevel'] != $Row['maxlevel']) {
            $x .= ' - ' . $Row['maxlevel'];
        }
    }
    $x .= ' ' . $type[$Row['type']] . ' (' . $rank[$Row['rank']] . ')</td></tr>';
    $x .= '</table>';
    return $x;
}
예제 #4
0
function render_spell_tooltip(&$row)
{
    // БД
    global $DB;
    // Время каста
    if ($row['spellcasttimesID'] > 1) {
        $casttime = $DB->selectCell('SELECT base FROM ?_spellcasttimes WHERE id=? LIMIT 1', $row['spellcasttimesID']) / 1000;
    }
    // Дальность действия
    $range = $DB->selectCell('SELECT rangeMax FROM ?_spellrange WHERE rangeID=? LIMIT 1', $row['rangeID']);
    // Реагенты
    $reagents = array();
    $i = 0;
    for ($j = 1; $j <= 8; $j++) {
        if ($row['reagent' . $j] > 0) {
            $reagents[$i] = array();
            // Имя реагента
            $names = $DB->selectRow('
				SELECT name{, l.name_loc?d as `name_loc`}
				FROM item_template i
				{ LEFT JOIN (locales_item l) ON l.entry = i.entry AND ? }
				WHERE i.entry = ?d', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $row['reagent' . $j]);
            $reagents[$i]['name'] = localizedName($names);
            // Количество реагентов
            // В количестве может быть значение -1, что с ним делать?
            $reagents[$i]['count'] = abs($row['reagentcount' . $j]);
            $i++;
        }
    }
    // Инструменты
    $tools = array();
    $i = 0;
    for ($j = 1; $j <= 2; $j++) {
        if ($row['tool' . $j]) {
            $tools[$i] = array();
            // Имя инструмента
            $names = $DB->selectRow('
				SELECT name{, l.name_loc?d as `name_loc`}
				FROM item_template i
				{ LEFT JOIN (locales_item l) ON l.entry = i.entry AND ? }
				WHERE i.entry = ?d', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $row['tool' . $j]);
            $tools[$i]['name'] = localizedName($names);
            $i++;
        }
    }
    // До подсказка о спелле
    $desc = spell_desc2($row);
    $x = '';
    $x .= '<table><tr><td>';
    if ($row['rank_loc' . $_SESSION['locale']]) {
        $x .= '<table width="100%"><tr><td>';
    }
    $x .= '<b>' . $row['spellname_loc' . $_SESSION['locale']] . '</b><br />';
    if ($row['rank_loc' . $_SESSION['locale']]) {
        $x .= '</td><th><b class="q0">' . $row['rank_loc' . $_SESSION['locale']] . '</b></th></tr></table>';
    }
    if ($range && ($row['manacost'] > 0 || $row['manacostpercent'] > 0)) {
        $x .= '<table width="100%"><tr><td>';
    }
    if ($row['manacost'] > 0) {
        $x .= $row['manacost'] . ' mana<br />';
    }
    if ($row['manacostpercent'] > 0) {
        $x .= $row['manacostpercent'] . "% of base mana<br />";
    }
    if ($range && ($row['manacost'] > 0 || $row['manacostpercent'] > 0)) {
        $x .= '</td><th>';
    }
    if ($range) {
        $x .= $range . ' yd range<br />';
    }
    if ($range && ($row['manacost'] > 0 || $row['manacostpercent'] > 0)) {
        $x .= '</th></tr></table>';
    }
    if (($row['ChannelInterruptFlags'] || isset($casttime) || $row['spellcasttimesID'] == 1) && $row['cooldown']) {
        $x .= '<table width="100%"><tr><td>';
    }
    if ($row['ChannelInterruptFlags']) {
        $x .= 'Channeled';
    } elseif (isset($casttime)) {
        $x .= $casttime . ' sec cast';
    } elseif ($row['spellcasttimesID'] == 1) {
        $x .= 'Instant';
    }
    if ($row['procChance'] < 100.0) {
        $x .= ' <span title="spell proc chance" class="q0">' . $row['procChance'] . '%</span>';
    }
    if (($row['ChannelInterruptFlags'] || isset($casttime) || $row['spellcasttimesID'] == 1) && $row['cooldown']) {
        $x .= '</td><th>';
    }
    if ($row['cooldown']) {
        $x .= $row['cooldown'] / 1000 . ' sec cooldown';
    }
    if (($row['ChannelInterruptFlags'] || isset($casttime) || $row['spellcasttimesID'] == 1) && $row['cooldown']) {
        $x .= '</th></tr></table>';
    }
    $x .= '</td></tr></table>';
    if ($reagents) {
        $x .= '<table><tr><td>';
        $x .= LOCALE_REAGENTS;
        foreach ($reagents as $i => $reagent) {
            $x .= $reagent['name'];
            if ($reagent['count'] > 1) {
                $x .= ' (' . $reagents[$i]['count'] . ')';
            }
            if (!($i >= count($reagents) - 1)) {
                $x .= ', ';
            } else {
                $x .= '<br>';
            }
        }
        $x .= '</td></tr></table>';
    }
    if ($tools) {
        $x .= '<table><tr><td>';
        $x .= LOCALE_TOOLS;
        foreach ($tools as $i => $tool) {
            $x .= $tool['name'];
            if (!($i >= count($tools) - 1)) {
                $x .= ', ';
            } else {
                $x .= '<br>';
            }
        }
        $x .= '</td></tr></table>';
    }
    if ($desc && $desc != '_empty_') {
        $x .= '<table><tr><td><span class="q">' . $desc . '</span></td></tr></table>';
    }
    return $x;
}
예제 #5
0
파일: quest.php 프로젝트: Kheros/tc_aowow
        }
    }
    unset($rows);
    // ГО
    $rows = $DB->select('
		SELECT g.entry, g.name
			{, l.name_loc?d AS name_loc}
		FROM gameobject_involvedrelation q, gameobject_template g
			{LEFT JOIN (locales_gameobject l) ON l.entry = g.entry AND ?}
		WHERE
			q.quest=?d
			AND g.entry=q.id
		', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $quest['entry']);
    if ($rows) {
        foreach ($rows as $tmp) {
            $tmp['name'] = localizedName($tmp);
            $quest['end'][] = array_merge($tmp, array('type' => 'object'));
        }
    }
    unset($rows);
    // Цель критерии
    $rows = $DB->select('
			SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID
			FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a
			LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID
			WHERE
				a.icon = s.id
				AND a.id = c.refAchievement
				AND c.type IN (?a)
				AND c.value1 = ?d
			GROUP BY a.id
예제 #6
0
파일: objects.php 프로젝트: saqar/tc_aowow
$smarty->config_load($conf_file, 'object');
@(list($type) = extract_values($podrazdel));
$cache_key = cache_key($type);
if (!($data = load_cache(OBJECT_LISTING, $cache_key))) {
    unset($data);
    // Получаем данные по этому типу объектов
    $rows = $DB->select("\n\t\t\tSELECT g.* {, a.requiredskill1 as ?#} {, a.requiredskill2 as ?#}\n\t\t\t\t{, l.name_loc?d AS `name_loc`}\n\t\t\tFROM {gameobject_queststarter ?# LEFT JOIN gameobject_questender qe ON qs.id = qe.id, } {?_lock ?#, } gameobject_template g\n\t\t\t\t{LEFT JOIN (locales_gameobject l) ON l.entry=g.entry AND ?d}\n\t\t\tWHERE \n\t\t\t\tg.name <> ''\n\t\t\t\t{ AND g.type = ? } \n\t\t\t\t{ AND g.data0=a.lockID AND g.type=3 AND a.type1=2 AND 1=?} \n\t\t\t\t{ AND g.data0=a.lockID AND g.type=3 AND a.type2=2 AND 1=?} \n\t\t\t\t{ AND a.lockproperties1=2 AND 1=?}\n\t\t\t\t{ AND a.lockproperties1=3 AND 1=?}\n\t\t\t\t{ AND a.lockproperties2=1 AND 1=?}\n\t\t\t\t{ AND g.entry = qs.?#}\n\t\t\tORDER by name\n\t\t\t{LIMIT ?d}\n\t\t", in_array($type, array(-3, -4)) ? 'skill' : DBSIMPLE_SKIP, $type == -5 ? 'skill' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $type == -2 ? 'qs' : DBSIMPLE_SKIP, in_array($type, array(-3, -4, -5)) ? 'a' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $type > 0 ? $type : DBSIMPLE_SKIP, in_array($type, array(-3, -4)) ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -3 ? 1 : DBSIMPLE_SKIP, $type == -4 ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -2 ? 'id' : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP);
    $i = 0;
    $data = array();
    foreach ($rows as $row) {
        $data[$i] = array();
        $data[$i]['entry'] = $row['entry'];
        if (isset($row['skill'])) {
            $data[$i]['skill'] = $row['skill'];
        }
        $data[$i]['name'] = preg_replace('/[\\r\\n]+/', " ", localizedName($row));
        // TODO: Расположение
        $data[$i]['location'] = "[-1]";
        // Тип объекта
        $data[$i]['type'] = isset($type) ? $type : $row['type'];
        $t_name = trim($data[$i]['name']);
        $i++;
    }
    save_cache(OBJECT_LISTING, $cache_key, $data);
}
if (!($object_tot = load_cache(OBJECT_TOT, 'object_tot'))) {
    unset($object_tot);
    // Получаем данные по этому типу объектов
    $object_tot = $DB->select('
			SELECT COUNT(g.entry) as num_objects
			FROM gameobject_template g
예제 #7
0
function GetQuestReq($id, $count, $type)
{
    global $DB;
    switch ($type) {
        case 1:
            $row = $DB->selectRow('
					SELECT name
						{, l.name_loc?d AS name_loc}
					FROM creature_template c
						{ LEFT JOIN (locales_creature l) ON l.entry=c.entry AND ? }
					WHERE
						c.entry = ?d
					LIMIT 1
				', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $id);
            $name = localizedName($row);
            return $name . ($count > 1 ? ' x' . $count : '');
            break;
        case 2:
            $row = $DB->selectRow('
					SELECT name
						{, l.name_loc?d AS name_loc}
					FROM item_template c
						{ LEFT JOIN (locales_item l) ON l.entry=c.entry AND ? }
					WHERE
						c.entry = ?d
					LIMIT 1
				', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $id);
            $name = localizedName($row);
            return $name . ($count > 1 ? ' x' . $count : '');
            break;
    }
}
예제 #8
0
function render_object_tooltip(&$Row, $object_type)
{
    global $type;
    $x = '<table>';
    $x .= '<tr><td><b class="q">' . localizedName($Row) . '</b></td></tr>';
    $x .= '<tr><td>' . $type[$object_type] . '</td></tr>';
    $x .= '</table>';
    return $x;
}
예제 #9
0
파일: npc.php 프로젝트: saqar/tc_aowow
            $tmp = $DB->selectRow('
					SELECT c.entry, c.name
					{
						, l.name_loc?d as `name_loc`
					}
					FROM creature_template c
					{
						LEFT JOIN (locales_creature l)
						ON l.entry = c.entry AND ?
					}
					WHERE
						c.difficulty_entry_1 = ?d
					LIMIT 1
				', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $npc['entry']);
            if ($tmp) {
                $npc['heroic'] = array('type' => 1, 'entry' => $tmp['entry'], 'name' => localizedName($tmp));
                $npc['name'] = str_replace(' (1)', '', $npc['name']);
                $normal_entry = $tmp['entry'];
                unset($tmp);
            }
        }
        // Дроп
        $lootid = $row['lootid'];
        $skinid = $row['skinloot'];
        $pickpocketid = $row['pickpocketloot'];
        // И�пользуемые �пеллы
        $npc['ablities'] = array();
        $tmp = array();
        for ($j = 0; $j <= 4; ++$j) {
            if ($row['spell' . $j] && !in_array($row['spell' . $j], $tmp)) {
                $tmp[] = $row['spell' . $j];
예제 #10
0
파일: npc.php 프로젝트: ryancheung/aowow-1
			f.name_loc' . $_SESSION['locale'] . ' as `faction-name`, ft.factionID as `factionID`
		FROM ?_factiontemplate ft, ?_factions f, creature_template c
		{
			LEFT JOIN (locales_creature l)
			ON l.entry = c.entry AND ?
		}
		WHERE
			c.entry = ?
			AND ft.factiontemplateID = c.faction_A
			AND f.factionID = ft.factionID
		LIMIT 1
			', $npc_cols[1], $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $id);
    if ($row) {
        $npc = $row;
        $npc['name'] = localizedName($row);
        $npc['subname'] = localizedName($row, 'subname');
        if ($npc['rank'] == 3) {
            $npc['minlevel'] = '??';
            $npc['maxlevel'] = '??';
        }
        $npc['mindmg'] = round(($row['mindmg'] + $row['attackpower']) * $row['dmg_multiplier']);
        $npc['maxdmg'] = round(($row['maxdmg'] + $row['attackpower']) * $row['dmg_multiplier']);
        $toDiv = array('minhealth', 'maxmana', 'minmana', 'maxhealth', 'armor', 'mindmg', 'maxdmg');
        // Разделяем на тысячи (ххххххххх => ххх,ххх,ххх)
        foreach ($toDiv as $e) {
            $npc[$e] = number_format($npc[$e]);
        }
        $npc['rank'] = $smarty->get_config_vars('rank' . $npc['rank']);
        // faction_A = faction_H
        $npc['faction_num'] = $row['factionID'];
        $npc['faction'] = $row['faction-name'];
예제 #11
0
파일: data.php 프로젝트: Brueggus/aowow
            $glyphs = array();
            $glyphs = $DB->select('
					SELECT it.entry, it.name, it.subclass, it.spellid_1 AS spellid, i.iconname, gp.typeflags
					{, l.name_loc?d AS name_loc }
					FROM ?_glyphproperties gp, ?_spell s, ?_icons i, item_template it
					{ LEFT JOIN locales_item l ON (l.entry = it.entry AND ?) }
					WHERE
						it.class = 16
						AND it.displayid = i.id
						AND it.spellid_1 = s.spellid
						AND s.effect1id = ?d
						AND gp.id = s.effect1MiscValue
				', $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, 74);
            $g_glyphs = array();
            foreach ($glyphs as $glyph) {
                $name = localizedName($glyph);
                if ($_SESSION['locale'] == 0) {
                    $name = str_replace(LOCALE_GLYPH_OF, '', $name);
                }
                $g_glyphs[$glyph['entry']] = array('name' => (string) $name, 'description' => (string) spell_desc($glyph['spellid']), 'icon' => (string) $glyph['iconname'], 'type' => (int) ($glyph['typeflags'] & 1 ? 2 : 1), 'classs' => (int) $glyph['subclass'], 'skill' => (int) 2);
            }
            save_cache(25, 'x', $g_glyphs);
        }
        echo 'var g_glyphs=' . php2js($g_glyphs);
        break;
    case 'talent-icon':
        $iconname = strtolower($_GET['icon']);
        if (!$DB->selectCell('SELECT 1 FROM ?_spellicons WHERE iconname = ?', $iconname)) {
            exit;
        }
        if ($name = load_cache(21, $iconname)) {
예제 #12
0
파일: faction.php 프로젝트: saqar/tc_aowow
			LEFT JOIN (?_factions f2) ON f1.team <> 0
			WHERE
				f1.factionID = ?d
				AND f1.team = f2.factionID
			LIMIT 1
		', $_SESSION['locale'], $_SESSION['locale'], $_SESSION['locale'], $_SESSION['locale'], $id);
    if ($row) {
        $faction = array();
        // Номер фракции
        $faction['entry'] = $row['factionID'];
        // Название фракции
        $faction['name'] = localizedName($row, 'name');
        // Описание фракции, из клиента:
        $faction['description1'] = localizedName($row, 'description1');
        // Описание фракции, c wowwiki.com, находится в таблице factions.sql:
        $faction['description2'] = localizedName($row, 'description2');
        // Команда/Группа фракции
        if ($row['category2'] != 0) {
            $faction['group'] = $row['group'];
            $faction['category'] = $DB->selectCell('SELECT team FROM ?_factions WHERE factionID = ?d LIMIT 1', $row['category2']);
            $faction['category2'] = $row['category2'];
        }
        // Альянс(1)/Орда(2)
        if ($row['side'] != 0) {
            $faction['side'] = $row['side'];
        }
        // Итемы с requiredreputationfaction
        $item_rows = $DB->select('
			SELECT ?#, entry
			FROM item_template i, ?_icons a
			WHERE
예제 #13
0
파일: objects.php 프로젝트: Brueggus/aowow
				{ AND a.lockproperties1=2 AND 1=?}
				{ AND a.lockproperties1=3 AND 1=?}
				{ AND a.lockproperties2=1 AND 1=?}
				{ AND g.entry = q.?#}
			ORDER by name
			{LIMIT ?d}
		', in_array($type, array(-3, -4)) ? 'skill' : DBSIMPLE_SKIP, $type == -5 ? 'skill' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $type == -2 ? 'q' : DBSIMPLE_SKIP, in_array($type, array(-3, -4, -5)) ? 'a' : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $type > 0 ? $type : DBSIMPLE_SKIP, in_array($type, array(-3, -4)) ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -3 ? 1 : DBSIMPLE_SKIP, $type == -4 ? 1 : DBSIMPLE_SKIP, $type == -5 ? 1 : DBSIMPLE_SKIP, $type == -2 ? 'id' : DBSIMPLE_SKIP, $AoWoWconf['limit'] != 0 ? $AoWoWconf['limit'] : DBSIMPLE_SKIP);
    $i = 0;
    $data = array();
    foreach ($rows as $row) {
        $data[$i] = array();
        $data[$i]['entry'] = $row['entry'];
        if (isset($row['skill'])) {
            $data[$i]['skill'] = $row['skill'];
        }
        $data[$i]['name'] = localizedName($row);
        // TODO: Расположение
        $data[$i]['location'] = "[-1]";
        // Тип объекта
        $data[$i]['type'] = isset($type) ? $type : $row['type'];
        $i++;
    }
    save_cache(4, $cache_key, $data);
}
global $page;
$page = array('Mapper' => false, 'Book' => false, 'Title' => $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 0, 'typeid' => 0, 'path' => path(0, 5, $type));
$smarty->assign('page', $page);
// Передаем массив данных шаблонизатору
$smarty->assign('data', $data);
// Статистика выполнения mysql запросов
$smarty->assign('mysql', $DB->getStatistics());
예제 #14
0
function creatureinfo2($Row)
{
    $name_sub_locale = localizedName($Row, 'subname');
    $creature = array('entry' => $Row['entry'], 'name' => str_replace(' (1)', LOCALE_HEROIC, localizedName($Row)), 'subname' => $name_sub_locale, 'minlevel' => $Row['minlevel'], 'maxlevel' => $Row['maxlevel'], 'react' => $Row['A'] . ',' . $Row['H'], 'type' => $Row['type'], 'classification' => $Row['rank']);
    $x = '';
    $x = '';
    $x .= '';
    $x .= "<table><tr><td><b class=\"q\">" . htmlspecialchars(str_replace(' (1)', LOCALE_HEROIC, localizedName($Row))) . "</b></td></tr></table><table><tr><td>";
    if (!empty($name_sub_locale)) {
        $x .= $name_sub_locale . "<br>";
    }
    $level = $Row['rank'] == 3 ? '??' : ($Row['minlevel'] == $Row['maxlevel'] ? $Row['minlevel'] : "{$Row['minlevel']} - {$Row['maxlevel']}");
    switch ($Row['rank']) {
        case 1:
            $rank = ' ' . LOCALE_NPCRANK_ELITE . '';
            break;
        case 2:
            $rank = ' ' . LOCALE_NPCRANK_RAREELITE . '';
            break;
        case 3:
            $rank = ' ' . LOCALE_NPCRANK_BOSS . '';
            break;
        case 4:
            $rank = ' ' . LOCALE_NPCRANK_RARE . '';
            break;
        default:
            $rank = '';
            break;
    }
    switch ($Row['type']) {
        case 1:
            $type = LOCALE_NPCTYPE_BEAST;
            break;
        case 2:
            $type = LOCALE_NPCTYPE_DRANGONKIN;
            break;
        case 3:
            $type = LOCALE_NPCTYPE_DEMON;
            break;
        case 4:
            $type = LOCALE_NPCTYPE_ELEMENTAL;
            break;
        case 5:
            $type = LOCALE_NPCTYPE_GIANT;
            break;
        case 6:
            $type = LOCALE_NPCTYPE_UNDEAD;
            break;
        case 7:
            $type = LOCALE_NPCTYPE_HUMANOID;
            break;
        case 8:
            $type = LOCALE_NPCTYPE_CRITTER;
            break;
        case 9:
            $type = LOCALE_NPCTYPE_MECHANIC;
            break;
        case 10:
            $type = LOCALE_NPCTYPE_UNCATEGORIZED;
            break;
        default:
            $type = '';
            break;
    }
    $x .= "" . LOCALE_LVL . " {$level} {$type}{$rank}";
    $x .= "</td></tr></table>";
    $creature['tooltip'] = $x;
    return $creature;
}
예제 #15
0
function objectinfo2(&$Row, $level = 0)
{
    global $DB;
    // Номер объекта
    $object['entry'] = $Row['entry'];
    // Название объекта
    $object['name'] = localizedName($Row);
    // Тип объекта
    $object['type'] = $Row['type'];
    if ($level > 0) {
        // В зависимости от типа объекта, заполняем поля:
        switch ($object['type']) {
            case GAMEOBJECT_TYPE_DOOR:
                /*
                 * data0: startOpen (Boolean flag)
                 * data1: open (LockId from Lock.dbc)
                 * data2: autoClose (long unknown flag)
                 * data3: noDamageImmune (Boolean flag)
                 * data4: openTextID (Unknown Text ID)
                 * data5: closeTextID (Unknown Text ID)
                 */
                $object['lockid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_BUTTON:
                /*
                 * data0: startOpen (State)
                 * data1: open (LockId from Lock.dbc)
                 * data2: autoClose (long unknown flag)
                 * data3: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data4: noDamageImmune (Boolean flag)
                 * data5: large? (Boolean flag)
                 * data6: openTextID (Unknown Text ID)
                 * data7: closeTextID (Unknown Text ID)
                 * data8: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data1'];
            case GAMEOBJECT_TYPE_QUESTGIVER:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: questList (unknown ID)
                 * data2: pageMaterial (PageTextMaterial.dbc)
                 * data3: gossipID (unknown ID)
                 * data4: customAnim (unknown value from 1 to 4)
                 * data5: noDamageImmune (Boolean flag)
                 * data6: openTextID (Unknown Text ID)
                 * data7: losOK (Boolean flag)
                 * data8: allowMounted (Boolean flag)
                 * data9: large? (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_CHEST:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: chestLoot (gameobject_loot_template.entry) *This field is obtained from WDB data and is not to be changed*
                 * data2: chestRestockTime (time in seconds)
                 * data3: consumable (State: Boolean flag)
                 * data4: minRestock (Min successful loot attempts for Mining, Herbalism etc)
                 * data5: maxRestock (Max successful loot attempts for Mining, Herbalism etc)
                 * data6: lootedEvent (unknown ID)
                 * data7: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data8: questID (v_quest_template.entry of completed quest)
                 * data9: level (minimal level required to open this gameobject)
                 * data10: losOK (Boolean flag)
                 * data11: leaveLoot (Boolean flag)
                 * data12: notInCombat (Boolean flag)
                 * data13: log loot (Boolean flag)
                 * data14: openTextID (Unknown ID)
                 * data15: use group loot rules (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                $object['lootid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_BINDER:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_GENERIC:
                /*
                 * data0: floatingTooltip (Boolean flag)
                 * data1: highlight (Boolean flag)
                 * data2: serverOnly? (Always 0)
                 * data3: large? (Boolean flag)
                 * data4: floatOnWater (Boolean flag)
                 * data5: questID (Required active v_quest_template.entry to work)
                 */
                break;
            case GAMEOBJECT_TYPE_TRAP:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: level (npc equivalent level for casted spell)
                 * data2: radius (Distance)
                 * data3: spell (Spell Id from spell.dbc)
                 * data4: charges (0 or 1)
                 * data5: cooldown (time in seconds)
                 * data6:  ? (unknown flag)
                 * data7: startDelay? (time in seconds)
                 * data8: serverOnly? (always 0)
                 * data9: stealthed (Boolean flag)
                 * data10: large? (Boolean flag)
                 * data11: stealthAffected (Boolean flag)
                 * data12: openTextID (Unknown ID)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_CHAIR:
                /*
                 * data0: chairslots (number of players that can sit down on it)
                 * data1: chairorientation? (number of usable side?)
                 */
                break;
            case GAMEOBJECT_TYPE_SPELL_FOCUS:
                /*
                 * data0: spellFocusType (from SpellFocusObject.dbc)
                 * data1: radius (Distance)
                 * data2: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 */
                break;
            case GAMEOBJECT_TYPE_TEXT:
                /*
                 * data0: pageID (page_text.entry)
                 * data1: language (from Languages.dbc)
                 * data2: pageMaterial (PageTextMaterial.dbc)
                 */
                $object['pageid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_GOOBER:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: questID (Required active v_quest_template.entry to work)
                 * data2: eventID (Unknown Event ID)
                 * data3:  ? (unknown flag)
                 * data4: customAnim (unknown)
                 * data5: consumable (Boolean flag controling if gameobject will despawn or not)
                 * data6: cooldown (time is seconds)
                 * data7: pageID (page_text.entry)
                 * data8: language (from Languages.dbc)
                 * data9: pageMaterial (PageTextMaterial.dbc)
                 * data10: spell (Spell Id from spell.dbc)
                 * data11: noDamageImmune (Boolean flag)
                 * data12: linkedTrap (gameobject_template.entry (Spawned GO type 6))
                 * data13: large? (Boolean flag)
                 * data14: openTextID (Unknown ID)
                 * data15: closeTextID (Unknown ID)
                 * data16: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                $object['pageid'] = $Row['data7'];
                break;
            case GAMEOBJECT_TYPE_TRANSPORT:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_AREADAMAGE:
                /* Object type not used */
                break;
            case GAMEOBJECT_TYPE_CAMERA:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: camera (Cinematic entry from CinematicCamera.dbc)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_MAP_OBJECT:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_MO_TRANSPORT:
                /*
                 * data0: taxiPathID (Id from TaxiPath.dbc)
                 * data1: moveSpeed
                 * data2: accelRate
                 */
                break;
            case GAMEOBJECT_TYPE_DUEL_ARBITER:
                /*	Only one Gameobject with this type (21680) and no data data */
                break;
            case GAMEOBJECT_TYPE_FISHINGNODE:
                /*	Only one Gameobject with this type (35591) and no data data */
                break;
            case GAMEOBJECT_TYPE_RITUAL:
                /*
                 * data0: casters?
                 * data1: spell (Spell Id from spell.dbc)
                 * data2: animSpell (Spell Id from spell.dbc)
                 * data3: ritualPersistent (Boolean flag)
                 * data4: casterTargetSpell (Spell Id from spell.dbc)
                 * data5: casterTargetSpellTargets (Boolean flag)
                 * data6: castersGrouped (Boolean flag)
                 */
                break;
            case GAMEOBJECT_TYPE_MAILBOX:
                /* No data data used, all are always 0 */
                break;
            case GAMEOBJECT_TYPE_AUCTIONHOUSE:
                /* data0: actionHouseID (From AuctionHouse.dbc ?) */
                break;
            case GAMEOBJECT_TYPE_GUARDPOST:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_SPELLCASTER:
                /*
                 * data0: spell (Spell Id from spell.dbc)
                 * data1: charges
                 * data2: partyOnly (Boolean flag, need to be in group to use it)
                 */
                break;
            case GAMEOBJECT_TYPE_MEETINGSTONE:
                /*
                 * data0: minLevel
                 * data1: maxLevel
                 * data2: areaID (From AreaTable.dbc)
                 */
                break;
            case GAMEOBJECT_TYPE_FLAGSTAND:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: pickupSpell (Spell Id from spell.dbc)
                 * data2: radius (distance)
                 * data3: returnAura (Spell Id from spell.dbc)
                 * data4: returnSpell (Spell Id from spell.dbc)
                 * data5: noDamageImmune (Boolean flag)
                 * data6:  ?
                 * data7: losOK (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_FISHINGHOLE:
                /*
                 * data0: radius (distance)
                 * data1: chestLoot (gameobject_loot_template.entry)
                 * data2: minRestock
                 * data3: maxRestock
                 */
                $object['lootid'] = $Row['data1'];
                break;
            case GAMEOBJECT_TYPE_FLAGDROP:
                /*
                 * data0: open (LockId from Lock.dbc)
                 * data1: eventID (Unknown Event ID)
                 * data2: pickupSpell (Spell Id from spell.dbc)
                 * data3: noDamageImmune (Boolean flag)
                 */
                $object['lockid'] = $Row['data0'];
                break;
            case GAMEOBJECT_TYPE_MINI_GAME:
                /*	Object type not used
                				Reused in core for CUSTOM_TELEPORT
                					* data0: areatrigger_teleport.id
                			*/
                break;
            case GAMEOBJECT_TYPE_LOTTERY_KIOSK:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_CAPTURE_POINT:
                /*
                 * data0: radius (Distance)
                 * data1: spell (Unknown ID, not a spell id in dbc file, maybe server only side spell)
                 * data2: worldState1
                 * data3: worldstate2
                 * data4: winEventID1 (Unknown Event ID)
                 * data5: winEventID2 (Unknown Event ID)
                 * data6: contestedEventID1 (Unknown Event ID)
                 * data7: contestedEventID2 (Unknown Event ID)
                 * data8: progressEventID1 (Unknown Event ID)
                 * data9: progressEventID2 (Unknown Event ID)
                 * data10: neutralEventID1 (Unknown Event ID)
                 * data11: neutralEventID2 (Unknown Event ID)
                 * data12: neutralPercent
                 * data13: worldstate3
                 * data14: minSuperiority
                 * data15: maxSuperiority
                 * data16: minTime (in seconds)
                 * data17: maxTime (in seconds)
                 * data18: large? (Boolean flag)
                 */
                break;
            case GAMEOBJECT_TYPE_AURA_GENERATOR:
                /*
                 * data0: startOpen (Boolean flag)
                 * data1: radius (Distance)
                 * data2: auraID1 (Spell Id from spell.dbc)
                 * data3: conditionID1 (Unknown ID)
                 */
                break;
            case GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY:
                /*
                 * data0: mapID (From Maps.dbc)
                 * data1: difficulty (0 or 1)
                 */
                break;
            case GAMEOBJECT_TYPE_UNK:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
                /*	Object type not used */
                break;
            case GAMEOBJECT_TYPE_GUILD_BANK:
                /*	No data data used, all are always 0 */
                break;
        }
        // Тип объекта и требуемый уровень скилла, и какого скилла
        if ($object['lockid']) {
            $lock_row = $DB->selectRow('
				SELECT *
				FROM ?_lock
				WHERE lockID=?d
				LIMIT 1
				', $object['lockid']);
            if ($lock_row) {
                for ($j = 1; $j <= 5; $j++) {
                    switch ($lock_row['type' . $j]) {
                        case 0:
                            // Не замок
                            break;
                        case 1:
                            // Ключ
                            $object['key'] = array();
                            $object['key'] = $DB->selectRow('SELECT entry as id, name, quality FROM item_template WHERE entry=?d LIMIT 1', $lock_row['lockproperties' . $j]);
                            break;
                        case 2:
                            // Скилл
                            switch ($lock_row['lockproperties' . $j]) {
                                case LOCK_PROPERTIES_FOOTLOCK:
                                    // Сундук
                                    $object['type'] = -5;
                                    $object['lockpicking'] = $lock_row['requiredskill' . $j];
                                    break;
                                case LOCK_PROPERTIES_HERBALISM:
                                    // Трава
                                    $object['type'] = -3;
                                    $object['herbalism'] = $lock_row['requiredskill' . $j];
                                    break;
                                case LOCK_PROPERTIES_MINING:
                                    // Руда
                                    $object['type'] = -4;
                                    $object['mining'] = $lock_row['requiredskill' . $j];
                                    break;
                                default:
                                    break;
                            }
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        // Текст страниц
        if ($object['pageid']) {
            while ($object['pageid'] > 0) {
                $row = $DB->selectRow('
						SELECT text, next_page
							{, text_loc?d}
						FROM page_text p
							{LEFT JOIN (locales_page_text l) ON l.entry = p.entry AND ?}
						WHERE
							p.entry = ?d
						LIMIT 1
					', $_SESSION['locale'] ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] ? 1 : DBSIMPLE_SKIP, $object['pageid']);
                /*
                if($_SESSION['locale']>0)
                	$text = QuestReplaceStr($DB->selectCell('SELECT Text_loc?d FROM locales_page_text WHERE entry = ?d LIMIT 1', $_SESSION['locale'], $object['pageid']));
                if($text)
                	$next_page = $DB->selectCell('SELECT next_page FROM page_text WHERE entry = ?d LIMIT 1', $object['pageid']);
                else
                	list($text, $next_page) = $DB->selectRow('SELECT text AS \'0\', next_page AS \'1\' FROM page_text WHERE entry = ?d LIMIT 1', $object['pageid']);
                */
                $row['text'] = QuestReplaceStr(localizedName($row, 'text'));
                if (empty($row['text'])) {
                    break;
                }
                $object['pagetext'][] = $row['text'];
                $object['pageid'] = $row['next_page'];
            }
        }
        // Лут...
        if (isset($object['lootid'])) {
            $object['drop'] = array();
            if (!($object['drop'] = loot('gameobject_loot_template', $object['lootid']))) {
                unset($object['drop']);
            }
        }
    }
    switch ($object['type']) {
        case 9:
            $type = "Buch";
            break;
        case 3:
            $type = "Behälter";
            break;
        case 5:
            $type = "Schließkiste";
            break;
        case 3:
            $type = "Kräuter";
            break;
        case 4:
            $type = "Erzvorkommen";
            break;
        case 2:
            $type = "Quest";
            break;
        default:
            $type = '';
            break;
    }
    $x = '';
    $x .= "<table><tr><td><b class=\"q\">{$object['name']}</b></td></tr></table><table><tr><td>";
    $x .= "{$type}";
    $x .= "</td></tr></table>";
    $object['tooltip'] = $x;
    return $object;
}
예제 #16
0
파일: allnpcs.php 프로젝트: saqar/tc_aowow
function creatureinfo2($Row)
{
    $name_sub_locale = localizedName($Row, 'subname');
    $creature = array('entry' => $Row['entry'], 'name' => str_replace(' (1)', LOCALE_HEROIC, localizedName($Row)), 'subname' => $name_sub_locale, 'minlevel' => $Row['minlevel'], 'maxlevel' => $Row['maxlevel'], 'react' => $Row['A'] . ',' . $Row['H'], 'type' => $Row['type'], 'classification' => $Row['rank']);
    $x = '';
    $x = '';
    $x .= '';
    $x .= "<table><tr><td><b class=\"q\">" . htmlspecialchars(str_replace(' (1)', LOCALE_HEROIC, localizedName($Row))) . "</b></td></tr></table><table><tr><td>";
    if (!empty($name_sub_locale)) {
        $x .= $name_sub_locale . "<br>";
    }
    $level = $Row['rank'] == 3 ? '??' : ($Row['minlevel'] == $Row['maxlevel'] ? $Row['minlevel'] : "{$Row['minlevel']} - {$Row['maxlevel']}");
    switch ($Row['rank']) {
        case 1:
            $rank = ' (Elite)';
            break;
        case 2:
            $rank = ' (Rar Elite)';
            break;
        case 3:
            $rank = ' (Boss)';
            break;
        case 4:
            $rank = ' (Rar)';
            break;
        default:
            $rank = '';
            break;
    }
    switch ($Row['type']) {
        case 1:
            $type = 'Wildtier';
            break;
        case 2:
            $type = 'Drachkin';
            break;
        case 3:
            $type = 'Dämon';
            break;
        case 4:
            $type = 'Elementar';
            break;
        case 5:
            $type = 'Riese';
            break;
        case 6:
            $type = 'Untoter';
            break;
        case 7:
            $type = 'Humanoid';
            break;
        case 8:
            $type = 'Tier';
            break;
        case 9:
            $type = 'Mechanisch';
            break;
        case 10:
            $type = 'Nicht kategorisiert';
            break;
        default:
            $type = '';
            break;
    }
    $x .= "Level {$level} {$type}{$rank}";
    $x .= "</td></tr></table>";
    $creature['tooltip'] = $x;
    return $creature;
}
예제 #17
0
function iteminfo2(&$Row, $level = 0)
{
    global $DB;
    global $allitems;
    global $spell_cols;
    global $object_cols;
    $item = array();
    // Номер вещи
    $item['entry'] = $Row['entry'];
    // Название вещи
    $item['name'] = localizedName($Row);
    // Тип вещи
    $item['type'] = $Row['InventoryType'];
    $item['displayid'] = $Row['displayid'];
    // Уровень вещи
    $item['level'] = $Row['ItemLevel'];
    // Качество вещи...
    $item['quality'] = $Row['quality'];
    $item['quality2'] = 7 - $Row['quality'];
    // Требуемый уровень вещи:
    $item['reqlevel'] = $Row['RequiredLevel'];
    // Класс и подкласс вещи
    // TODO: немного неверное определение
    $item['classs'] = $Row['class'];
    $item['subclass'] = $Row['subclass'];
    $item['rclass'] = $Row['AllowableClass'];
    // Иконка вещи
    $item['iconname'] = $Row['iconname'];
    // Кол-во вещей в пачке
    $item['stackable'] = $Row['stackable'];
    // Стоимость вещи для покупки
    // DPS
    $dps = 0;
    if ($Row['class'] == 2) {
        for ($i = 1; $i <= 2; $i++) {
            $d_type = $Row['dmg_type' . $i];
            $d_min = $Row['dmg_min' . $i];
            $d_max = $Row['dmg_max' . $i];
            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);
                }
            }
        }
        $item['dps'] = $dps;
        $item['speed'] = $Row['delay'] / 1000;
        if (!$item['speed']) {
            $item['speed'] = -1;
        }
    }
    // Armor
    $item['armor'] = $Row['armor'];
    $item['slot'] = $Row['InventoryType'];
    // Bag
    if ($Row['class'] == 1) {
        $item['slots'] = $Row['ContainerSlots'];
    }
    // Добавляем в глобальный массив allitems
    allitemsinfo2($Row, 0);
    if ($level > 0) {
        $item['BuyPrice'] = $Row['BuyPrice'];
        //
        $item['BagFamily'] = $Row['BagFamily'];
        $item['ContainerSlots'] = $Row['ContainerSlots'];
        $item['DisenchantID'] = $Row['DisenchantID'];
        // Навык энчанта для разборки вещи
        if ($Row['RequiredDisenchantSkill'] != -1) {
            $item['disenchantskill'] = $Row['RequiredDisenchantSkill'];
        }
        // Цена на продажу
        $item['sellgold'] = floor($Row['SellPrice'] / 10000);
        $item['sellsilver'] = floor($Row['SellPrice'] % 10000 / 100);
        $item['sellcopper'] = floor($Row['SellPrice'] % 100);
        // Цена за покупку
        $item['buygold'] = floor($Row['BuyPrice'] / 10000);
        $item['buysilver'] = floor($Row['BuyPrice'] % 10000 / 100);
        $item['buycopper'] = floor($Row['BuyPrice'] % 100);
        // Начинает квест
        if ($Row['startquest']) {
            $item['starts'] = array(GetDBQuestInfo($Row['startquest'], 0xffffff));
        }
        // Информационное окно
        $item['info'] = render_item_tooltip($Row);
        // Обучает
        $teaches = array();
        for ($j = 1; $j <= 4; $j++) {
            if ($Row['spellid_' . $j] == 483) {
                $teaches[] = spellinfo($Row['spellid_' . ($j + 1)]);
            }
        }
        if ($teaches) {
            $item['teaches'] = $teaches;
            unset($teaches);
            unset($spellrow);
        }
        // Открывает:
        // Тип замков, для которых этот предмет является ключем:
        $locks_row = $DB->selectCol('
			SELECT lockID
			FROM ?_lock
			WHERE
				(type1=1 AND lockproperties1=?d) OR
				(type2=1 AND lockproperties2=?d) OR
				(type3=1 AND lockproperties3=?d) OR
				(type4=1 AND lockproperties4=?d) OR
				(type5=1 AND lockproperties5=?d)
			', $item['entry'], $item['entry'], $item['entry'], $item['entry'], $item['entry']);
        if ($locks_row) {
            // Игровые объекты с таким типом замка:
            $item['unlocks'] = $DB->select('
				SELECT ?#
				FROM gameobject_template
				WHERE
					(
						((type IN (?a)) AND (data0 IN (?a)))
					OR
						((type IN (?a)) AND (data0 IN (?a)))
					)
				', $object_cols[0], array(GAMEOBJECT_TYPE_QUESTGIVER, GAMEOBJECT_TYPE_CHEST, GAMEOBJECT_TYPE_TRAP, GAMEOBJECT_TYPE_GOOBER, GAMEOBJECT_TYPE_CAMERA, GAMEOBJECT_TYPE_FLAGSTAND, GAMEOBJECT_TYPE_FLAGDROP), $locks_row, array(GAMEOBJECT_TYPE_DOOR, GAMEOBJECT_TYPE_BUTTON), $locks_row);
            if (!$item['unlocks']) {
                unset($item['unlocks']);
            }
        }
        unset($locks_row);
    }
    return $item;
}
예제 #18
0
파일: zone.php 프로젝트: Kheros/tc_aowow
			WHERE c.id = ct.entry
			  AND ct.npcflag & 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' => 'Flight Masters', 'atid' => $id, 'points' => array());
            $inns = array('population' => 0, 'name' => 'Innkeepers', 'atid' => $id, 'points' => array());
            $repairers = array('population' => 0, 'name' => 'Repairers', 'atid' => $id, 'points' => array());
            $spirithealers = array('population' => 0, 'name' => 'Spirit Healers', 'atid' => $id, 'points' => array());
            foreach ($rows as $row) {
                $name = localizedName($row);
                $subname = localizedName($row, "subname");
                if ($subname) {
                    $name = $name . " <" . $subname . ">";
                }
                $point = array('name' => $name, 'type' => 0, '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['npcflag'] & 8192) {
                    $taxies['population']++;
                    $taxies['points'][] = $point;
                }
                if ($row['npcflag'] & 65536) {
                    $inns['population']++;
                    $inns['points'][] = $point;
                }
                if ($row['npcflag'] & 4096) {
                    $repairers['population']++;
                    $repairers['points'][] = $point;