101 && $zoneid < 200) $zoneid = 101;// Dungeon Instances (101 -> 255 maybe?) $name = zone_map2($zoneid); if ($name == "") { show_header($sitetext["zones"]); ko_error($sitetext["invalidzone"]); } $name = str_replace("\\","/",$name); $map = "images/".substr($name,0,strlen($name)-4).".png"; if (!$name || !file_exists($map)){ $height = 512; $map = <<< EOF
$sitetext[nomap]
EOF; } else{ list($width,$height)=getimagesize($map); $map = <<< EOF
EOF; } $zname = zone_name($zoneid); $sql = mysql_query("SELECT description, info, size FROM survey_zones WHERE ID = '$zoneid'"); if (mysql_numrows($sql)){ $zone = mysql_fetch_assoc($sql); // $description = $zone[description]; // $info = $zone[info]; $infotxt = file_get_contents("zoneinfo/$sitelang/zone$zoneid.txt"); $i = strpos($infotxt,"\n"); $description = substr($infotxt,0,$i); $info = str_replace("\n","
",item_replace(substr($infotxt,$i+1))); $size = $zone[size]; } /* if ($zname == ""){ show_header($sitetext["zones"]); ko_error($sitetext["invalidzone"]); }*/ show_header($zname); echo $ajaxtooltips; $sql = mysql_query("SELECT zone1 FROM zonelink, survey_zones WHERE zone2 = '$zoneid' and survey_zones.id = zone1"); while($zone = mysql_fetch_assoc($sql)) $teleport_from .= ''.zone_name($zone[zone1]).", "; if ($teleport_from) $teleport_from = substr($teleport_from, 0, -2); if ($zoneid >= 61 && $zoneid<=69) $teleport_from = $sitetext["lunarvalley"]; $sql = mysql_query("SELECT zone2 FROM zonelink, survey_zones WHERE Zone1 = '$zoneid' AND survey_zones.id = zone2"); while($zone = mysql_fetch_assoc($sql)) $teleport_to .= ''.zone_name($zone[zone2]).", "; if ($teleport_to) $teleport_to = substr($teleport_to, 0, -2); if ($zoneid == 11) $zoneid = 12;//for Eslant if ($sitelang == "us") { $mobres = mysql_query("SELECT sid, `mob` FROM monsterhelper WHERE `zone` = '$zoneid' AND kind = 1 ORDER BY LOWER(`mob`);"); $npcres = mysql_query("SELECT sid, `mob` FROM monsterhelper WHERE `zone` = '$zoneid' AND kind = 2 ORDER BY LOWER(`mob`);"); } else { $mobtbl = tablename($sitelang,"mob"); $npctbl = tablename($sitelang,"npc"); $mobres = mysql_query("SELECT sid, COALESCE(name,'???') AS mob FROM monsterhelper LEFT JOIN $mobtbl ON $mobtbl.id=monsterhelper.sid WHERE `zone` = '$zoneid' AND kind = 1 ORDER BY name;"); $npcres = mysql_query("SELECT sid, COALESCE(name,'???') AS mob FROM monsterhelper LEFT JOIN $npctbl ON $npctbl.id=monsterhelper.sid WHERE `zone` = '$zoneid' AND kind = 2 ORDER BY name;"); } $mobnum = mysql_num_rows($mobres); $npcnum = mysql_num_rows($npcres); echo ''; if ($mobnum > 0) echo ""; if ($npcnum > 0) echo ""; echo ''; if (!$description) $description = " "; echo ''; echo ""; if ($mobnum > 0) { echo ''; } if ($npcnum > 0) { echo ''; } echo '
'.$zname.'$sitetext[mobs]$sitetext[npcs]
$description

'.$map.'
'; if ($info || $teleport_to || $teleport_from){ echo '
'; if ($info) echo ''; if ($teleport_to) echo ''; if ($teleport_from) echo ''; echo "
'.$sitetext["info"].'
'.$info.'
'.$sitetext["tpto"].':'.$teleport_to.'
'.$sitetext["tpfrom"].':'.$teleport_from.'
"; } if ($zname) { $link = ko_comments(28, $zname, $zoneid); echo ""; } function GetMobPostion($sid, $zoneid, $kind, $zonesize){ $locs = mysql_query("SELECT x,y FROM monsterloc WHERE sid = $sid AND zone = $zoneid AND kind = $kind"); $locnum = mysql_numrows($locs); $divisor = $zonesize/512; if ($zoneid == 75) $divisor = 2; $positions = array(); for($i=0; $i<$locnum; $i++) { $posx = mysql_result($locs, $i, "x"); $posy = mysql_result($locs, $i, "y"); if ($zoneid == 75) $posy -= 10240; $posx = $posx/10/$divisor; $posy = $posy/10/$divisor; $posx -= 7;// remove half the arrow size echo "
$posx,$posy
"; array_push($positions, "$posx,$posy"); } return $positions; } ?>