Example #1
0
function getPointData($area_id, &$data, $x, $y)
{
    global $gZoneToAreaImage, $lang;
    $area = getAreaIdFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    $area_data = getArea($area);
    if (!$area_data) {
        return 0;
    }
    $zone = @$area_data['zone_id'] ? $area_data['zone_id'] : $area;
    $areaname = $area_data['zone_id'] ? getAreaName($zone) . " (" . $area_data['name'] . ")" : $area_data['name'];
    $img = 'images/map_points/';
    $img .= $gZoneToAreaImage[$zone] == $area_id ? 'gps_icon.png' : 'gps_icon1.png';
    $imgX = 16;
    $imgY = 16;
    $name = '';
    if (@$data['type'] == 'n') {
        $text = getCreatureName($data['id'], 0) . "&nbsp;({$data['guid']})<br>{$areaname}<br>{$lang['respawn']}&nbsp;" . getTimeText($data['spawntimesecs']);
        if (getCreatureEvent($data['guid']) > 0) {
            $text = substr_replace("<br>{$lang['spawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(getCreatureEvent($data['guid'])), $text, 0, 0);
        }
        if (getCreatureEvent($data['guid']) < 0) {
            $text = substr_replace("<br>{$lang['despawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(abs(getCreatureEvent($data['guid']))), $text, 0, 0);
        }
        if (getCreaturePool($data['guid'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getCreaturePool($data['guid']) . ")", $text, 0, 0);
        }
        if (getCreaturePoolTemplate($data['id'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getCreaturePoolTemplate($data['id']) . ")", $text, 0, 0);
        }
    }
    if (@$data['type'] == 'o') {
        $text = getGameobjectName($data['id'], 0) . "&nbsp;({$data['guid']})<br>{$areaname}<br>{$lang['respawn']}&nbsp;" . getTimeText($data['spawntimesecs']);
        if (getGameobjectEvent($data['guid']) > 0) {
            $text = substr_replace("<br>{$lang['spawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(getGameobjectEvent($data['guid'])), $text, 0, 0);
        }
        if (getGameobjectEvent($data['guid']) < 0) {
            $text = substr_replace("<br>{$lang['despawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(abs(getGameobjectEvent($data['guid']))), $text, 0, 0);
        }
        if (getGameobjectPool($data['guid'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getGameobjectPool($data['guid']) . ")", $text, 0, 0);
        }
        if (getGameobjectPoolTemplate($data['id'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getGameobjectPoolTemplate($data['id']) . ")", $text, 0, 0);
        }
    }
    return array('id' => $data['id'], 'x' => $y, 'y' => $x, 'imgX' => $imgX, 'imgY' => $imgY, 'image' => $img, 'href' => "", 'tooltip' => $text);
}
Example #2
0
include_once "include/functions.php";
$area = @$_REQUEST['area'];
$map = @$_REQUEST['map'];
if ($area) {
    $mob_id = @$_REQUEST['npc'];
    $obj_id = @$_REQUEST['obj'];
    $list = 0;
    if ($mob_id) {
        $list = $dDB->select("SELECT * FROM `creature` WHERE `id` = ?d", $mob_id);
    } else {
        if ($obj_id) {
            $list = $dDB->select("SELECT * FROM `gameobject` WHERE `id` = ?d", $obj_id);
        }
    }
    if ($area == 0 && $list) {
        $area = getAreaIdFromPoint($list[0]['map'], $list[0]['position_x'], $list[0]['position_y'], $list[0]['position_z']);
    }
    renderArea($area, @$_REQUEST['width'], $list);
} else {
    if ($map) {
        $mob_id = @$_REQUEST['npc'];
        $obj_id = @$_REQUEST['obj'];
        $list = 0;
        if ($mob_id) {
            $list = $dDB->select("SELECT * FROM `creature` WHERE `id` = ?d", $mob_id);
        } else {
            if ($obj_id) {
                $list = $dDB->select("SELECT * FROM `gameobject` WHERE `id` = ?d", $obj_id);
            }
        }
        renderMap($map, @$_REQUEST['width'], $list);