Требование: PHP => 5.3, часть 2
[cswow.git] / module / maps / ajax_map.php
blobc0f32fbea2738d9ba4e46e21a59e55cd4befd588
1 <?php
2 include_once("include/map_data.php");
3 include_once("lang/game_text.".$config['lang'].".php");
4 include_once("include/functions.php");
6 $area = @$_REQUEST['area'];
7 $map = @$_REQUEST['map'];
8 if ($area)
10 $mob_id = @$_REQUEST['npc'];
11 $obj_id = @$_REQUEST['obj'];
12 $list = 0;
13 if ($mob_id)
14 $list = $dDB->select("SELECT * FROM `creature` WHERE `id` = ?d", $mob_id);
15 else if ($obj_id)
16 $list = $dDB->select("SELECT * FROM `gameobject` WHERE `id` = ?d", $obj_id);
17 if ($area == 0 && $list)
18 $area = getAreaIdFromPoint($list[0]['map'], $list[0]['position_x'], $list[0]['position_y'], $list[0]['position_z']);
19 renderArea($area, @$_REQUEST['width'], $list);
21 else if ($map)
23 $mob_id = @$_REQUEST['npc'];
24 $obj_id = @$_REQUEST['obj'];
25 $list = 0;
26 if ($mob_id)
27 $list = $dDB->select("SELECT * FROM `creature` WHERE `id` = ?d", $mob_id);
28 else if ($obj_id)
29 $list = $dDB->select("SELECT * FROM `gameobject` WHERE `id` = ?d", $obj_id);
30 renderMap($map, @$_REQUEST['width'], $list);