";
$i = 7;
$centerwall = 8;
- while($i > 0) {
- if($map[3][$i]) {
- $centerwall = $i;
- }
- $i -= 2;
+ while ($i > 0) {
+ if ($map[3][$i]) {
+ $centerwall = $i;
+ }
+ $i -= 2;
}
$i = 4;
- function drawbot($cell, $x, $y) {
- global $botnames, $imgdata, $bots, $dialogs, $user, $floor;
- $data = explode("/", $cell);
- $i = 1;
- $bc = (count($data)-1)/2;
- while($data[$i]) {
+ function drawbot($cell, $x, $y)
+ {
+ global $botnames, $imgdata, $bots, $dialogs, $user, $floor;
+ $data = explode("/", $cell);
+ $i = 1;
+ $bc = (count($data) - 1) / 2;
+ while ($data[$i]) {
+ $bot = $data[$i];
+ $botname = $botnames[$bot];
+ $cnt = $data[$i + 1];
+ if ($i == 1) {
+ if ($bc == 1) {
+ $bn = 1;
+ } else {
+ $bn = 0;
+ }
+ } elseif ($i == 3) {
+ if ($bc == 2) {
+ $bn = 2;
+ } else {
+ $bn = 1;
+ }
+ } else {
+ $bn = 2;
+ }
+
+ $aMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `caves` WHERE `leader` = '$user[caveleader]' AND `floor` = '$floor'"), 0, 0));
+
+ if (!$GLOBALS['dir']) {
+ $xx = ($GLOBALS['x'] * 2) - ($y * 2);
+ $yy = ($GLOBALS['y'] * 2) - ($x - 3);
+ } elseif ($GLOBALS['dir'] == 1) {
+ $xx = ($GLOBALS['x'] * 2) + ($x - 3);
+ $yy = ($GLOBALS['y'] * 2) - ($y * 2);
+ } elseif ($GLOBALS['dir'] == 2) {
+ $xx = ($GLOBALS['x'] * 2) + ($y * 2);
+ $yy = ($GLOBALS['y'] * 2) + ($x - 3);
+ } else {
+ $xx = ($GLOBALS['x'] * 2) - ($x - 3);
+ $yy = ($GLOBALS['y'] * 2) + ($y * 2);
+ }
+
+ if (strpos($aMap[$yy][$xx], 'o/') !== false || strpos($aMap[$yy][$xx], 'p/') !== false) {
+ $ret .= drawobject2($aMap[$yy][$xx], $x, $y);
+ }
+
+ $rrm = $user['room'];
+
+ if (isset($dialogs[$bots[$data[1]]]) && ($bots[$data[1]] == 11147 && $user['room'] == 74)) {
+ $ret .= "
1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
+ } else {
+ $ret .= "
1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
+ }#onclick=\"attackmenu(event);\"
+ $i += 2;
+ }
+ return $ret;
+ }
+
+ function drawdialog($cell, $x, $y)
+ {
+ global $dialogs, $imgdata;
+ $data = explode("/", $cell);
+ $i = 1;
+ $d = $data[2];
$bot = $data[$i];
$botname = $botnames[$bot];
- $cnt = $data[$i+1];
- if($i == 1) {
- if($bc == 1) {
- $bn = 1;
- } else {
- $bn = 0;
- }
- } elseif($i == 3) {
- if($bc == 2) {
- $bn = 2;
- } else {
- $bn = 1;
- }
+ $cnt = $data[$i + 1];
+ $ret = "
";
+ return $ret;
+ }
+
+ function drawuser($cell, $x, $y)
+ {
+ global $botnames, $imgdata, $party;
+ $data = explode("/", $cell);
+ $i = 1;
+ $bc = (count($data) - 1);
+ while ($data[$i]) {
+ $u = $data[$i];
+ if ($i == 1) {
+ if ($bc == 1) {
+ $bn = 1;
+ } else {
+ $bn = 0;
+ }
+ } elseif ($i == 3) {
+ if ($bc == 2) {
+ $bn = 2;
+ } else {
+ $bn = 1;
+ }
+ } else {
+ $bn = 2;
+ }
+ foreach ($party as $k => $v) {
+ if ($v['user'] == $u) {
+ $udata = $v;
+ break;
+ }
+ }
+ $ret .= "
";
+ $i++;
+ }
+ return $ret;
+ }
+
+ function drawobject($cell, $x, $y)
+ {
+ global $objects, $imgdata, $user, $objdata, $objsizes, $imgmap;
+ $tmp = explode("/", $cell);
+ $obj = $tmp[1];
+ $ht = round($imgdata[$x][$y]["ht"] / 2);
+
+ if ($objsizes[$obj]) {
+ $coef = $objdata[$x][$y]["coef"];
+ $wd = $objsizes[$obj][0] * $coef;
+ $ht = $objsizes[$obj][1] * $coef;
+ $left = round($objdata[$x][$y]["x"] - ($wd / 2));
+ $top = $objdata[$x][$y]["y"] - $ht;
+ } elseif ($obj == 510) {
+ $wd = round($imgdata[$x][$y]["wd"] * 2.5);
+ $ht = $imgdata[$x][$y]["ht"];
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"];
+ } elseif ($obj > 600 && $obj < 700) {
+ $wd = round($imgdata[$x][$y]["wd"] * 1.26);
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"] + $ht;
+ } elseif ($obj >= 700 && $obj < 800) {
+ $wd = round($imgdata[$x][$y]["wd"] * 1.24);
+ $ht = $imgdata[$x][$y]["ht"];
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"];
} else {
- $bn = 2;
+ $wd = $imgdata[$x][$y]["wd"];
+ $left = $imgdata[$x][$y]["x"][1];
+ $top = $imgdata[$x][$y]["y"] + $ht;
}
-
- $aMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `caves` WHERE `leader` = '$user[caveleader]' AND `floor` = '$floor'"), 0, 0));
-
- if(!$GLOBALS['dir']) {
- $xx = ($GLOBALS['x']*2) - ($y*2);
- $yy = ($GLOBALS['y']*2) - ($x - 3);
- } elseif($GLOBALS['dir'] == 1) {
- $xx = ($GLOBALS['x']*2) + ($x - 3);
- $yy = ($GLOBALS['y']*2) - ($y*2);
- } elseif($GLOBALS['dir'] == 2) {
- $xx = ($GLOBALS['x']*2) + ($y * 2);
- $yy = ($GLOBALS['y']*2) + ($x - 3);
- } else {
- $xx = ($GLOBALS['x']*2) - ($x - 3);
- $yy = ($GLOBALS['y']*2) + ($y * 2);
- }
-
- if(strpos($aMap[$yy][$xx], 'o/') !== false || strpos($aMap[$yy][$xx], 'p/') !== false) {
- $ret .= drawobject2($aMap[$yy][$xx], $x, $y);
- }
-
$rrm = $user['room'];
+ if (!isset($imgmap[$obj])) {
- if(isset($dialogs[$bots[$data[1]]]) && ($bots[$data[1]] == 11147 && $user['room'] == 74)) {
- $ret .= "
1?" ($cnt)":"")."\" ".($y == 1 && $x == 3?"onclick=\"speakattackmenu(event);\"":"")." width=\"".$imgdata[$x][$y]["wd"]."\" height=\"".$imgdata[$x][$y]["ht"]."\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: ".$imgdata[$x][$y]["x"][$bn]."px; top: ".$imgdata[$x][$y]["y"]."px;".($x == 3 && $y == 1?"cursor: pointer;":"").($x == 3?"z-index: ".(99-($y*5)).";":"")."\" />";
+ $ret .= "
+ " . ($y == 1 && $x == 3 ? "
" : "") . "
+
+ " . ($y == 1 && $x == 3 ? "" : "");
} else {
- $ret .= "
1?" ($cnt)":"")."\" ".($y == 1 && $x == 3?" onclick=\"document.location.href='cave.php?attack=1';\"":"")." width=\"".$imgdata[$x][$y]["wd"]."\" height=\"".$imgdata[$x][$y]["ht"]."\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: ".$imgdata[$x][$y]["x"][$bn]."px; top: ".$imgdata[$x][$y]["y"]."px;".($x == 3 && $y == 1?"cursor: pointer;":"").($x == 3?"z-index: ".(99-($y*5)).";":"")."\" />";
- }#onclick=\"attackmenu(event);\"
- $i += 2;
- }
- return $ret;
+ $ret .= "
";
+ $ret .= $imgmap[$obj]['code'];
+ }
+ return $ret;
}
- function drawdialog($cell, $x, $y) {
- global $dialogs, $imgdata;
- $data = explode("/", $cell);
- $i = 1;
- $d = $data[2];
- $bot = $data[$i];
- $botname = $botnames[$bot];
- $cnt = $data[$i+1];
- $ret = "
";
- return $ret;
- }
-
- function drawuser($cell, $x, $y) {
- global $botnames, $imgdata, $party;
- $data = explode("/", $cell);
- $i = 1;
- $bc = (count($data)-1);
- while($data[$i]) {
- $u = $data[$i];
- if($i == 1) {
- if($bc == 1) {
- $bn = 1;
- } else {
- $bn = 0;
- }
- } elseif($i == 3) {
- if($bc == 2) {
- $bn = 2;
- } else {
- $bn = 1;
- }
+ function drawobject2($cell, $x, $y)
+ {
+ global $objects, $imgdata, $user, $objdata, $objsizes, $imgmap;
+ $tmp = explode("/", $cell);
+ $obj = $tmp[1];
+ $ht = round($imgdata[$x][$y]["ht"] / 2);
+ if ($objsizes[$obj]) {
+ $coef = $objdata[$x][$y]["coef"];
+ $wd = $objsizes[$obj][0] * $coef;
+ $ht = $objsizes[$obj][1] * $coef;
+ $left = round($objdata[$x][$y]["x"] - ($wd / 2));
+ $top = $objdata[$x][$y]["y"] - $ht;
+ } elseif ($obj == 510) {
+ $wd = round($imgdata[$x][$y]["wd"] * 2.5);
+ $ht = $imgdata[$x][$y]["ht"];
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"];
+ } elseif ($obj > 600 && $obj < 700) {
+ $wd = round($imgdata[$x][$y]["wd"] * 1.26);
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"] + $ht;
+ } elseif ($obj >= 700 && $obj < 800) {
+ $wd = round($imgdata[$x][$y]["wd"] * 1.24);
+ $ht = $imgdata[$x][$y]["ht"];
+ $left = $imgdata[$x][$y]["x"][1] - round(($wd - $imgdata[$x][$y]["wd"]) / 2);
+ $top = $imgdata[$x][$y]["y"];
} else {
- $bn = 2;
+ $wd = $imgdata[$x][$y]["wd"];
+ $left = $imgdata[$x][$y]["x"][1];
+ $top = $imgdata[$x][$y]["y"] + $ht;
}
- foreach($party as $k => $v) {
- if($v['user'] == $u) {
- $udata = $v;
- break;
- }
+ $rrm = $user['room'];
+ if (!isset($imgmap[$obj])) {
+ $ret .= "
+ " . ($y == 1 && $x == 3 ? "
" : "") . "
+
+ " . ($y == 1 && $x == 3 ? "" : "");
+ } else {
+ $ret .= "
";
+ $ret .= $imgmap[$obj]['code'];
}
- $ret .= "
";
- $i++;
- }
- return $ret;
+ return $ret;
}
- function drawobject($cell, $x, $y) {
- global $objects, $imgdata, $user, $objdata, $objsizes, $imgmap;
- $tmp = explode("/", $cell);
- $obj = $tmp[1];
- $ht = round($imgdata[$x][$y]["ht"]/2);
-
- if($objsizes[$obj]) {
- $coef=$objdata[$x][$y]["coef"];
- $wd=$objsizes[$obj][0]*$coef;
- $ht=$objsizes[$obj][1]*$coef;
- $left=round($objdata[$x][$y]["x"]-($wd/2));
- $top=$objdata[$x][$y]["y"]-$ht;
- } elseif($obj == 510) {
- $wd=round($imgdata[$x][$y]["wd"]*2.5);
- $ht=$imgdata[$x][$y]["ht"];
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"];
- } elseif ($obj > 600 && $obj < 700) {
- $wd=round($imgdata[$x][$y]["wd"]*1.26);
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"]+$ht;
- } elseif($obj >= 700 && $obj < 800) {
- $wd=round($imgdata[$x][$y]["wd"]*1.24);
- $ht=$imgdata[$x][$y]["ht"];
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"];
- } else {
- $wd=$imgdata[$x][$y]["wd"];
- $left=$imgdata[$x][$y]["x"][1];
- $top=$imgdata[$x][$y]["y"]+$ht;
- }
- $rrm = $user['room'];
- if (!isset($imgmap[$obj])) {
-
- $ret .= "
- ".($y == 1 && $x == 3?"
":"")."
-
- ".($y == 1 && $x == 3?"":"");
- } else {
- $ret .= "
";
- $ret .= $imgmap[$obj]['code'];
- }
- return $ret;
- }
-
- function drawobject2($cell, $x, $y) {
- global $objects, $imgdata, $user, $objdata, $objsizes, $imgmap;
- $tmp=explode("/", $cell);
- $obj=$tmp[1];
- $ht=round($imgdata[$x][$y]["ht"]/2);
- if($objsizes[$obj]) {
- $coef=$objdata[$x][$y]["coef"];
- $wd=$objsizes[$obj][0]*$coef;
- $ht=$objsizes[$obj][1]*$coef;
- $left=round($objdata[$x][$y]["x"]-($wd/2));
- $top=$objdata[$x][$y]["y"]-$ht;
- } elseif($obj==510) {
- $wd=round($imgdata[$x][$y]["wd"]*2.5);
- $ht=$imgdata[$x][$y]["ht"];
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"];
- } elseif($obj>600 && $obj<700) {
- $wd=round($imgdata[$x][$y]["wd"]*1.26);
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"]+$ht;
- } elseif($obj>=700 && $obj<800) {
- $wd=round($imgdata[$x][$y]["wd"]*1.24);
- $ht=$imgdata[$x][$y]["ht"];
- $left=$imgdata[$x][$y]["x"][1]-round(($wd-$imgdata[$x][$y]["wd"])/2);
- $top=$imgdata[$x][$y]["y"];
- } else {
- $wd=$imgdata[$x][$y]["wd"];
- $left=$imgdata[$x][$y]["x"][1];
- $top=$imgdata[$x][$y]["y"]+$ht;
- }
- $rrm = $user['room'];
- if(!isset($imgmap[$obj])) {
- $ret.="
- ".($y == 1 && $x == 3?"
":"")."
-
- ".($y == 1 && $x == 3?"":"");
- } else {
- $ret .= "
";
- $ret .= $imgmap[$obj]['code'];
- }
- return $ret;
+ function drawevent($cell, $x, $y)
+ {
+ global $events, $eventdata;
+ $tmp = explode("/", $cell);
+ $obj = $tmp[1];
+ if ($obj == 1) {
+ return "";
+ }
+ $wd = round($eventdata[$x][$y]["q"] * $events[$obj]["w"]);
+ $ht = round($eventdata[$x][$y]["q"] * $events[$obj]["h"]);
+ $left = round(-$events[$obj]["h"] / 2 + $eventdata[$x][$y]["x"]);
+ $top = round($eventdata[$x][$y]["y"] - $events[$obj]["h"]);
+ $ret .= "
";
+ return $ret;
}
- function drawevent($cell, $x, $y) {
- global $events, $eventdata;
- $tmp = explode("/", $cell);
- $obj = $tmp[1];
- if($obj == 1) { return ""; }
- $wd = round($eventdata[$x][$y]["q"]*$events[$obj]["w"]);
- $ht = round($eventdata[$x][$y]["q"]*$events[$obj]["h"]);
- $left = round(-$events[$obj]["h"]/2+$eventdata[$x][$y]["x"]);
- $top = round($eventdata[$x][$y]["y"]-$events[$obj]["h"]);
- $ret .= "
";
- return $ret;
+ while ($i >= 0) {
+ if ($i == 4) {
+ if ($map[0][7]) {
+ $ret .= "
";
+ }
+ if ($map[0][6]) {
+ $ret .= "
";
+ }
+ if ($map[-1][6]) {
+ $ret .= "
";
+ }
+ }
+
+ $wall = $i * 2 - 1;
+ $sidewall = $i * 2;
+
+ if ($map[1][$sidewall] && $i > 0) {
+ $obj = substr($map[1][$sidewall], 0, 1);
+ if ($obj == "b") {
+ $ret .= drawbot($map[1][$sidewall], 1, $i);
+ } elseif ($obj == "u") {
+ $ret .= drawuser($map[1][$sidewall], 1, $i, $players);
+ } elseif ($obj == "o" || $obj == "p") {
+ $ret .= drawobject($map[1][$sidewall], 1, $i);
+ } elseif ($obj == "e") {
+ $ret .= drawevent($map[1][$sidewall], 1, $i);
+ } elseif ($obj == "d") {
+ $ret .= drawdialog($map[1][$sidewall], 1, $i);
+ } elseif ($obj != "s") {
+ $o = $map[1][$sidewall] - 10000;
+ if ($o == 4) {
+ if ($i == 1) {
+ $ret .= "
";
+ }
+ if ($i == 2) {
+ $ret .= "
";
+ }
+ if ($i == 3) {
+ $ret .= "
";
+ }
+ } else {
+ if ($i == 1) {
+ $ret .= "
";
+ }
+ if ($i == 2) {
+ $ret .= "
";
+ }
+ if ($i == 3) {
+ $ret .= "
";
+ }
+ }
+ }
+ }
+
+ if ($map[5][$sidewall] && $i > 0) {
+ $obj = substr($map[5][$sidewall], 0, 1);
+ if ($obj == "b") {
+ $ret .= drawbot($map[5][$sidewall], 5, $i);
+ } elseif ($obj == "u") {
+ $ret .= drawuser($map[5][$sidewall], 5, $i, $players);
+ } elseif ($obj == "o" || $obj == "p") {
+ $ret .= drawobject($map[5][$sidewall], 5, $i);
+ } elseif ($obj == "e") {
+ $ret .= drawevent($map[5][$sidewall], 5, $i);
+ } elseif ($obj == "d") {
+ $ret .= drawdialog($map[5][$sidewall], 5, $i);
+ } elseif ($obj != "s") {
+ $o = $map[5][$sidewall] - 10000;
+ if ($o == 4) {
+ if ($i == 1) $ret .= "
";
+ if ($i == 2) $ret .= "
";
+ if ($i == 3) $ret .= "
";
+ } else {
+ if ($i == 1) $ret .= "
";
+ if ($i == 2) $ret .= "
";
+ if ($i == 3) $ret .= "
";
+ }
+ }
+ }
+ if ($i > 0 && $map[1][$wall]) $ret .= "
";
+
+ $objInWall = explode('/', $map[4][$sidewall]);
+ if ($objInWall[1] == 'o') {
+ if (!passablewall($map[4][$sidewall])) $ret .= "
";
+ } else {
+ if (!passablewall($map[4][$sidewall])) $ret .= "
";
+ }
+ $objInWall = explode('/', $map[2][$sidewall]);
+ if ($objInWall[1] == 'o') {
+ if (!passablewall($map[2][$sidewall])) $ret .= "
";
+ } else {
+ if (!passablewall($map[2][$sidewall])) $ret .= "
";
+ }
+
+ if ($i > 0 && $map[5][$wall]) $ret .= "
";
+
+ if ($map[3][$sidewall] && $i > 0 && $sidewall < $centerwall) {
+ $obj = substr($map[3][$sidewall], 0, 1);
+ if ($obj == "b") {
+ $ret .= drawbot($map[3][$sidewall], 3, $i);
+ } elseif ($obj == "u") {
+ $ret .= drawuser($map[3][$sidewall], 3, $i, $players);
+ } elseif ($obj == "o" || $obj == "p") {
+ $ret .= drawobject($map[3][$sidewall], 3, $i);
+ } elseif ($obj == "e") {
+ $ret .= drawevent($map[3][$sidewall], 3, $i);
+ } elseif ($obj == "d") {
+ $ret .= drawdialog($map[3][$sidewall], 3, $i);
+ } elseif ($obj != "s") {
+ $o = $map[3][$sidewall] - 10000;
+ if ($o == 4) {
+ if ($i == 1) $ret .= "
";
+ if ($i == 2) $ret .= "
";
+ if ($i == 3) $ret .= "
";
+ } else {
+ if ($i == 1) $ret .= "
";
+ if ($i == 2) $ret .= "
";
+ if ($i == 3) $ret .= "
";
+ }
+ }
+ }
+ if ($map[3][$wall]) {
+ if ($i > 0) $ret .= "
2 ? "style=\"background-image:url('$base/cw$i" . cavewall($map[3][$wall]) . ".gif')\"" : "") . ">
";
+ if ($i == 1 && $map[3][$wall] > 2) {
+ if ($map[3][$wall] > 1000) {
+ $ret .= "
";
+ } elseif ($map[3][$wall] > 100) {
+ $ret .= "
";
+ } else $ret .= "
";
+ }
+ $objInWall = explode('/', $map[3][$wall]);
+ if ($objInWall[1] == "o") {
+ if ($user['room'] == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
+ $ret .= drawobject('//' . $objInWall[2], 3, $i);
+ }
+ }
+ $nocenter = 1;
+ }
+ if ($i == 4) {
+ if ($map[7][6]) $ret .= "
";
+ }
+ $i--;
}
- while($i >= 0) {
- if($i == 4) {
- if($map[0][7]) {
- $ret .= "
";
- }
- if($map[0][6]) {
- $ret .= "
";
- }
- if($map[-1][6]) {
- $ret .= "
";
- }
- }
-
- $wall = $i*2-1;
- $sidewall = $i*2;
-
- if($map[1][$sidewall] && $i > 0) {
- $obj = substr($map[1][$sidewall], 0, 1);
- if($obj == "b") {
- $ret .= drawbot($map[1][$sidewall], 1, $i);
- } elseif ($obj == "u") {
- $ret .= drawuser($map[1][$sidewall], 1, $i, $players);
- } elseif ($obj == "o" || $obj=="p") {
- $ret .= drawobject($map[1][$sidewall], 1, $i);
- } elseif ($obj == "e") {
- $ret .= drawevent($map[1][$sidewall], 1, $i);
- } elseif ($obj == "d") {
- $ret .= drawdialog($map[1][$sidewall], 1, $i);
- } elseif ($obj != "s") {
- $o = $map[1][$sidewall]-10000;
- if($o == 4) {
- if($i == 1) {
- $ret .= "
";
- }
- if($i == 2) {
- $ret .= "
";
- }
- if($i == 3) {
- $ret .= "
";
- }
- } else {
- if($i== 1) {
- $ret .= "
";
- }
- if($i== 2) {
- $ret .= "
";
- }
- if($i== 3) {
- $ret .= "
";
- }
- }
- }
- }
-
- if ($map[5][$sidewall] && $i>0) {
- $obj=substr($map[5][$sidewall],0,1);
- if ($obj=="b") {
- $ret.=drawbot($map[5][$sidewall], 5, $i);
- } elseif ($obj=="u") {
- $ret.=drawuser($map[5][$sidewall], 5, $i, $players);
- } elseif ($obj=="o" || $obj=="p") {
- $ret.=drawobject($map[5][$sidewall], 5, $i);
- } elseif ($obj=="e") {
- $ret.=drawevent($map[5][$sidewall], 5, $i);
- } elseif ($obj=="d") {
- $ret.=drawdialog($map[5][$sidewall], 5, $i);
- } elseif ($obj!="s") {
- $o=$map[5][$sidewall]-10000;
- if ($o==4) {
- if ($i==1) $ret.="
";
- if ($i==2) $ret.="
";
- if ($i==3) $ret.="
";
- } else {
- if ($i==1) $ret.="
";
- if ($i==2) $ret.="
";
- if ($i==3) $ret.="
";
- }
- }
- }
- if ($i>0 && $map[1][$wall]) $ret.="
";
-
- $objInWall = explode('/', $map[4][$sidewall]);
- if ($objInWall[1] == 'o') {
- if(!passablewall($map[4][$sidewall])) $ret.="
";
- } else {
- if(!passablewall($map[4][$sidewall])) $ret.="
";
- }
- $objInWall = explode('/', $map[2][$sidewall]);
- if ($objInWall[1] == 'o') {
- if(!passablewall($map[2][$sidewall])) $ret.="
";
- } else {
- if(!passablewall($map[2][$sidewall])) $ret.="
";
- }
-
- if ($i>0 && $map[5][$wall]) $ret.="
";
-
- if ($map[3][$sidewall] && $i>0 && $sidewall<$centerwall) {
- $obj=substr($map[3][$sidewall],0,1);
- if ($obj=="b") {
- $ret.=drawbot($map[3][$sidewall], 3, $i);
- } elseif ($obj=="u") {
- $ret.=drawuser($map[3][$sidewall], 3, $i, $players);
- } elseif ($obj=="o" || $obj=="p") {
- $ret.=drawobject($map[3][$sidewall], 3, $i);
- } elseif ($obj=="e") {
- $ret.=drawevent($map[3][$sidewall], 3, $i);
- } elseif ($obj=="d") {
- $ret.=drawdialog($map[3][$sidewall], 3, $i);
- } elseif ($obj!="s") {
- $o=$map[3][$sidewall]-10000;
- if ($o==4) {
- if ($i==1) $ret.="
";
- if ($i==2) $ret.="
";
- if ($i==3) $ret.="
";
- } else {
- if ($i==1) $ret.="
";
- if ($i==2) $ret.="
";
- if ($i==3) $ret.="
";
- }
- }
- }
- if ($map[3][$wall]) {
- if ($i>0) $ret.="
2?"style=\"background-image:url('$base/cw$i".cavewall($map[3][$wall]).".gif')\"":"").">
";
- if ($i==1 && $map[3][$wall]>2) {
- if ($map[3][$wall]>1000) {
- $ret.="
";
- } elseif ($map[3][$wall]>100) {
- $ret.="
";
- } else $ret.="
";
- }
- $objInWall = explode('/', $map[3][$wall]);
- if ($objInWall[1] == "o") {
- if ($user['room'] == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
- $ret.=drawobject('//' . $objInWall[2], 3, $i);
- }
- }
- $nocenter=1;
- }
- if ($i==4) {
- if ($map[7][6]) $ret.="
";
- }
- $i--;
- }
-
- $ret.="
+ $ret .= "