Вывод иконки нпц ремонтника в поиске по зоне...
[cswow.git] / module / show / show_zone.php
blob43811ef8b29945b88c5be178038c6d3c0d6219e5
1 <?php
2 ##########
3 /*
4 Скрипт показывает Зону по $entry
5 Показывает:
6 - Карту зоны (или карту той зоны в частью которой является)
7 - В состав какой зоны входит (если есть)
8 - Какие зоны входят в состав
9 - Какие существа находятся в зоне
10 - Какие ГО находятся в зоне
11 - Лут с рыбалки в зоне
14 include_once("include/map_data.php");
15 include_once("include/report_generator.php");
16 include_once("include/info_table_generator.php");
18 $entry = intval(@$_REQUEST['zone']);
19 $npc_id = intval(@$_REQUEST['npc']);
20 $obj_id = intval(@$_REQUEST['obj']);
21 $width = intval(@$_REQUEST['width']) ? intval(@$_REQUEST['width']) : 900;
23 $page = intval(@$_REQUEST['page']);
24 $mark = @$_REQUEST['mark'];
26 $area = getArea($entry);
27 if (!$area)
29 RenderError($lang['area_not_found']);
31 else
33 $baseLink='?zone='.$entry;
34 if (@$_REQUEST['npc']) $baseLink.="&npc=$npc_id";
35 if (@$_REQUEST['obj']) $baseLink.="&obj=$obj_id";
36 if (@$_REQUEST['width']) $baseLink.="&width=$width";
38 $zentry = $area['zone_id'] ? $area['zone_id'] : $entry;
39 $map = $area['map_id'];
40 $zone = getArea($zentry);
42 $area_data = @getRenderAreaData($gZoneToAreaImage[$zentry]);
44 if ($area_data && !isset($_REQUEST['mark']))
46 if ($ajaxmode==0)
48 if ($lang['www_zone'])
49 echo "<a href=\"".sprintf($lang['www_zone'], $entry)."\" target=\"_blank\"\">".sprintf($lang['www_zone'], $entry)."</a><br>";
50 if ($zentry!=$entry)
51 echo $area['name'].'<br>';
52 echo "<div id=mapper>";
54 $pointsList = new mapPoints();
55 if ($npc_id)$pointsList->addNpc($npc_id, $map);
56 if ($obj_id)$pointsList->addGo($obj_id, $map);
57 renderArea($gZoneToAreaImage[$zentry], $width, $pointsList->points);
58 if ($ajaxmode==0)
60 echo "</div>";
61 echo "<script type=\"text/javascript\" src=\"js/mapper.js\"></script>";
62 echo "<script type=\"text/javascript\">cacheMap('$baseLink')</script>";
65 elseif ($map && !isset($_REQUEST['mark']))
67 if ($ajaxmode==0)
68 echo "<div id=mapper>";
69 renderMap($map, $width, createPointsList($npc_id, $obj_id));
70 if ($ajaxmode==0)
72 echo "</div>";
73 echo "<script type=\"text/javascript\" src=\"js/mapper.js\"></script>";
74 echo "<script type=\"text/javascript\">cacheMap('$baseLink')</script>";
77 createReportTab();
78 function r_npcDungeon($data){global $lang; echo '<a href="?zone='.@$_REQUEST['zone'].'&npc='.$data['entry'].'" onClick="return uploadFromHref(this, \'mapper\');">'.$lang['map'].'</a>';}
79 function r_objDungeon($data){global $lang; echo '<a href="?zone='.@$_REQUEST['zone'].'&obj='.$data['entry'].'" onClick="return uploadFromHref(this, \'mapper\');">'.$lang['map'].'</a>';}
80 //********************************************************************************
81 // Parent zones
82 //********************************************************************************
83 if ($zentry!=$entry)
85 $parent =& new ZoneReportGenerator();
86 $fields = array('ZONE_REPORT_ID', 'ZONE_REPORT_NAME');
87 if ($parent->Init($fields, $baseLink, 'zoneLIST', $config['fade_limit'], 'name'))
89 $parent->parentZone($zentry);
90 $parent->createReport($lang['zone_parent']);
93 //********************************************************************************
94 // Sub zones
95 //********************************************************************************
96 $sub =& new ZoneReportGenerator();
97 $fields = array('ZONE_REPORT_ID', 'ZONE_REPORT_NAME');
98 if ($sub->Init($fields, $baseLink, 'subzoneLIST', $config['fade_limit'], 'name'))
100 $sub->subZones($entry);
101 $sub->createReport($lang['zone_subzones']);
103 //********************************************************************************
104 // Существа в зоне
105 //********************************************************************************
106 $npc =& new CreatureReportGenerator('position');
107 $fields = array('NPC_REPORT_LEVEL', 'NPC_REPORT_RNAME', 'NPC_REPORT_ROLE', 'NPC_REPORT_DUNGEON');
108 if ($npc->Init($fields, $baseLink, 'npcLIST', $config['fade_limit'], 'name'))
110 $npc->addColumnConfig('NPC_REPORT_DUNGEON', array('class'=>'small','sort'=>'','text'=>$lang['map'],'draw'=>'r_npcDungeon','sort_str'=>'','fields'=>''));
111 if (!$area_data)
112 $npc->onMap($map);
113 else
114 $npc->onArea($area_data);
115 $npc->createReport($lang['zone_npc_in']);
117 //********************************************************************************
118 // GO в зоне
119 //********************************************************************************
120 $go =& new GameobjectReportGenerator('position');
121 $fields = array('GO_REPORT_NAME', 'GO_REPORT_TYPE', 'GO_REPORT_DUNGEON');
122 if ($go->Init($fields, $baseLink, 'goLIST', $config['fade_limit'], 'name'))
124 $go->addColumnConfig('GO_REPORT_DUNGEON', array('class'=>'small','sort'=>'','text'=>$lang['map'],'draw'=>'r_objDungeon','sort_str'=>'','fields'=>''));
125 if (!$area_data)
126 $go->onMap($map);
127 else
128 $go->onArea($area_data);
129 $go->createReport($lang['zone_go_in']);
131 //********************************************************************************
132 // Fishing in area
133 //********************************************************************************
134 if ($ajaxmode==0)
136 $page_seek = init_pagePerMark($mark, "fishing_lootLIST", $page);
137 $rows = getLootList($entry, "fishing_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
138 renderLootTableList($rows, $lang['contain_fishing_loot'], $page_seek, $totalRecords, $baseLink, "fishing_lootLIST");