Exemple #1
0
<?php

include_once "include/map_data.php";
$text = '';
$ajaxptr = '';
$map = @$_REQUEST['map'] == '' ? -1 : intval(@$_REQUEST['map']);
$area = intval(@$_REQUEST['area']);
$width = intval(@$_REQUEST['width']) ? intval(@$_REQUEST['width']) : 900;
if ($area) {
    $a = getRenderAreaData($area);
    $map = $a[0];
}
//*****************************************************************************
// Create points list
//*****************************************************************************
$pointsList = new mapPoints();
if ($npc_id = intval(@$_REQUEST['npc'])) {
    $ajaxptr .= "&npc={$npc_id}";
    $pointsList->addNpc($npc_id, $map);
    $text = '<center>' . getCreatureName($npc_id) . '</center>';
}
if ($obj_id = intval(@$_REQUEST['obj'])) {
    $ajaxptr .= "&obj={$obj_id}";
    $pointsList->addGo($obj_id, $map);
    $text = '<center>' . getGameobjectName($obj_id) . '</center>';
}
if ($point = @$_REQUEST['point']) {
    $ajaxptr .= '&point=' . $point;
    $p = split(':', $point);
    $pointsList->addPoint(@$p[0], @$p[1], @$p[2], @$p[3]);
    $text = '<br>';
 }
 $zentry = $area['zone_id'] ? $area['zone_id'] : $entry;
 $map = $area['map_id'];
 $zone = getArea($zentry);
 $area_data = @getRenderAreaData($gZoneToAreaImage[$zentry]);
 if ($area_data && !isset($_REQUEST['mark'])) {
     if ($ajaxmode == 0) {
         if ($lang['www_zone']) {
             echo "<a href=\"" . sprintf($lang['www_zone'], $entry) . "\" target=\"_blank\"\">" . sprintf($lang['www_zone'], $entry) . "</a><br>";
         }
         if ($zentry != $entry) {
             echo $area['name'] . '<br>';
         }
         echo "<div id=mapper>";
     }
     $pointsList = new mapPoints();
     if ($npc_id) {
         $pointsList->addNpc($npc_id, $map);
     }
     if ($obj_id) {
         $pointsList->addGo($obj_id, $map);
     }
     renderArea($gZoneToAreaImage[$zentry], $width, $pointsList->points);
     if ($ajaxmode == 0) {
         echo "</div>";
         echo "<script type=\"text/javascript\" src=\"js/mapper.js\"></script>";
         echo "<script type=\"text/javascript\">cacheMap('{$baseLink}')</script>";
     }
 } else {
     if ($map && !isset($_REQUEST['mark'])) {
         if ($ajaxmode == 0) {