2023-03-31 18:42:06 +00:00
< ? php
2023-08-30 14:58:56 +00:00
2023-09-30 01:31:32 +00:00
use Core\Config ;
2023-08-30 14:58:56 +00:00
use Core\Db ;
2023-10-13 15:02:45 +00:00
echo " <script>
document . getElementById ( 'se-pre-con' ) . parentNode . removeChild ( document . getElementById ( 'se-pre-con' ));
</ script > " ;
2022-08-25 11:23:36 +00:00
if ( ! defined ( 'GAME' )) {
die ();
2022-06-06 21:30:34 +00:00
}
2023-08-30 14:58:56 +00:00
if ( $u -> room [ 'file' ] != 'dungeon' ) {
return ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
if ( isset ( $_GET [ 'back' ])) {
2023-09-30 01:31:32 +00:00
$dp = Db :: getValue ( 'select file from dungeon_map where id_dng = (select id2 from dungeon_now where id = ?) and x = ? and y = ?' , [ $u -> info [ 'dnow' ], $u -> info [ 'x' ], $u -> info [ 'y' ]]);
if ( $dp != '0' ) {
2023-08-30 14:58:56 +00:00
$file = explode ( '=' , $dp [ 'file' ]);
if ( isset ( $file [ 1 ])) {
if ( $file [ 3 ] < 1 || $file [ 3 ] > 4 ) {
$file [ 3 ] = 1 ;
2022-08-25 11:23:36 +00:00
}
2023-09-30 01:31:32 +00:00
Db :: sql ( 'update stats set x = ?, y = ?, s = ? where id = ?' , [ $file [ 1 ], $file [ 2 ], $file [ 3 ], $u -> info [ 'id' ]]);
2023-08-30 14:58:56 +00:00
$u -> info [ 'x' ] = $file [ 1 ];
$u -> info [ 'y' ] = $file [ 2 ];
$u -> info [ 's' ] = $file [ 3 ];
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
unset ( $dp );
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
$d = new Dungeon ;
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
if ( ! isset ( $d -> info [ 'id' ])) {
$_GET [ 'exitd' ] = true ;
}
2022-06-06 21:30:34 +00:00
2023-09-30 01:31:32 +00:00
$dies = Db :: getValue ( 'select count(id) from dungeon_actions where uid = ? and dn = ? and vars = ?' , [ $u -> info [ 'id' ], $u -> info [ 'dnow' ], 'die' ]);
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
if ( $dies >= 3 ) {
$_GET [ 'exitd' ] = true ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
$d -> initPoint ( $u -> info [ 'x' ], $u -> info [ 'y' ]);
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
if ( ! isset ( $d -> point [ 'id' ])) {
$d -> point [ 'css' ] = 'css' ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( isset ( $_GET [ 'new_leader' ])) {
2023-09-30 01:31:32 +00:00
$d -> n_lead ( $_GET [ 'new_leader' ], $u -> info [ 'id' ]);
2023-08-30 14:58:56 +00:00
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
if ( isset ( $_GET [ 'go_from_psh' ])) {
2023-09-30 01:31:32 +00:00
$d -> go_to_hell ( $_GET [ 'go_from_psh' ], $u -> info [ 'id' ]);
2023-08-30 14:58:56 +00:00
}
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( $u -> info [ 'dnow' ] == 0 ) {
//выкидываем из пещеры
die ( 'Ошибки инициализации' );
} else {
if ( $d -> info [ 'bsid' ] == 0 && $d -> info [ 'id2' ] != 106 && isset ( $_GET [ 'exitd' ])) {
//Удаляем обьекты и т.д. из старых пещер
$rb = 321 ; // Магический портал
2023-11-06 00:40:12 +00:00
$dungeonIds = Db :: getColumn ( 'select id from dungeon_now where time_finish = 0' );
$dnowIds = Db :: getColumn ( 'select id from stats where dnow in (?)' , [ implode ( ',' , $dungeonIds )]);
$diff = implode ( ',' , array_diff ( $dungeonIds , $dnowIds ));
Db :: sql ( 'delete from dungeon_bots where dn in (?) and for_dn = 0' , [ $diff ]);
Db :: sql ( 'delete from dungeon_obj where dn in (?) and for_dn = 0' , [ $diff ]);
Db :: sql ( 'delete from dungeon_items where dn in (?) and for_dn = 0' , [ $diff ]);
Db :: sql ( 'delete from dungeon_actions where dn in (?)' , [ $diff ]);
Db :: sql ( 'update dungeon_now set time_finish = unix_timestamp() where id in (?)' , [ $diff ]);
unset ( $dungeonIds , $dnowIds , $diff );
$cn1 = Db :: getValue ( 'select id from stats where dnow = ? and id != ? order by exp desc limit 1' , [ $d -> info [ 'id' ], $u -> info [ 'id' ]]);
if ( $cn1 ) {
2023-08-30 14:58:56 +00:00
if ( $d -> info [ 'uid' ] == $u -> info [ 'id' ]) {
2023-11-06 00:40:12 +00:00
$cn = Db :: getRow ( 'select id, login, sex from users where id = ?' , [ $cn1 ]);
Db :: sql ( 'update dungeon_now set uid = ? where id = ?' , [ $cn [ 'id' ], $d -> info [ 'id' ]]);
2023-08-30 14:58:56 +00:00
if ( $cn [ 'sex' ] == 0 ) {
if ( $u -> info [ 'sex' ] == 0 ) {
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинул подземелье, новым лидером группы стал <b>' . $cn [ 'login' ] . '</b>' );
2022-08-25 11:23:36 +00:00
} else {
2023-08-30 14:58:56 +00:00
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинула подземелье, новым лидером группы стал <b>' . $cn [ 'login' ] . '</b>' );
2022-08-25 11:23:36 +00:00
}
} else {
if ( $u -> info [ 'sex' ] == 0 ) {
2023-08-30 14:58:56 +00:00
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинул подземелье, новым лидером группы стала <b>' . $cn [ 'login' ] . '</b>' );
2022-08-25 11:23:36 +00:00
} else {
2023-08-30 14:58:56 +00:00
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинула подземелье, новым лидером группы стала <b>' . $cn [ 'login' ] . '</b>' );
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
} else {
if ( $u -> info [ 'sex' ] == 0 ) {
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинул подземелье!' );
} else {
$d -> sys_chat ( '<b>' . $u -> info [ 'login' ] . '</b> покинула подземелье!' );
}
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2023-11-06 00:40:12 +00:00
unset ( $cn , $cn1 );
2022-08-25 11:23:36 +00:00
2023-11-06 00:40:12 +00:00
Db :: sql ( 'update users left join stats on users.id = stats.id set dnow = 0, room = ? where users.id = ?' , [ $rb , $u -> info [ 'id' ]]);
2023-08-30 14:58:56 +00:00
//удаляем все предметы которые пропадают после выхода из пещеры
2023-11-06 00:40:12 +00:00
Db :: sql ( 'delete from items_users where uid = ? and (dn_delete = 1 or item_id in (1174,1189,4447))' , [ $u -> info [ 'id' ]]);
2022-06-06 21:30:34 +00:00
2023-11-06 00:40:12 +00:00
exit ( '<script>window.location.replace("/main.php")</script>' );
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-06-06 21:30:34 +00:00
2023-11-06 00:40:12 +00:00
if ( ! empty ( $d -> point [ 'file' ]) && $d -> point [ 'fileadd' ] == 1 ) {
2023-08-30 14:58:56 +00:00
$file = explode ( '=' , $d -> point [ 'file' ]);
if ( file_exists ( 'modules_data/location/' . $file [ 0 ])) {
$information = '' ;
include_once ( 'modules_data/location/' . $file [ 0 ]);
#header('Location: /main.php');
} else {
if ( $file [ 3 ] < 1 || $file [ 3 ] > 4 ) {
$file [ 3 ] = 1 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
echo '<br><br><center>Локация "' . str_replace ( '.php' , '' , $file [ 0 ]) . '" не определена, вернуться <a href="main.php?rnd=' . $code . '">назад</a></center>' ;
mysql_query ( 'UPDATE `stats` SET `x` = "' . $file [ 1 ] . '",`y` = "' . $file [ 2 ] . '",`s` = "' . $file [ 3 ] . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-11-06 00:40:12 +00:00
if ( ! empty ( $d -> point [ 'file' ]) && $d -> point [ 'fileadd' ] == 0 ) {
2023-08-30 14:58:56 +00:00
$file = explode ( '=' , $d -> point [ 'file' ]);
if ( file_exists ( 'modules_data/location/' . $file [ 0 ])) {
require_once ( 'modules_data/location/' . $file [ 0 ]);
2022-08-25 11:23:36 +00:00
} else {
2023-08-30 14:58:56 +00:00
if ( $file [ 3 ] < 1 || $file [ 3 ] > 4 ) {
$file [ 3 ] = 1 ;
}
echo '<br><br><center>Локация "' . str_replace ( '.php' , '' , $file [ 0 ]) . '" не определена, вернуться <a href="main.php?rnd=' . $code . '">назад</a></center>' ;
mysql_query ( 'UPDATE `stats` SET `x` = "' . $file [ 1 ] . '",`y` = "' . $file [ 2 ] . '",`s` = "' . $file [ 3 ] . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
}
} else {
?>
2023-10-13 15:02:45 +00:00
< script src = " /js/jquery.js " ></ script >
2023-08-30 14:58:56 +00:00
< script >
2023-10-13 15:02:45 +00:00
let stor , bott , itemtake ;
2023-08-30 14:58:56 +00:00
< ? php if ( ! isset ( $_GET [ 'ajax' ])) { ?> //Т У Т передвижение
// тут проверить
setInterval ( 'top.c.noEr = 0;' , 1000 );
$ ( 'body' ) . keydown ( function ( event ) {
if (( event . which == 38 || event . which == 87 ) && top . c . noEr == 0 ) {
goToLoca ( 1 , 'вперед' );
top . c . noEr = 1 ;
clearTimeout ( top . c . noErTmr );
top . c . noErTmr = setTimeout ( 'top.c.noEr = 0;' , 1000 );
} else if (( event . which == 37 || event . which == 65 ) && top . c . noEr == 0 ) {
goToLoca ( 4 , 'налево' );
top . c . noEr = 1 ;
clearTimeout ( top . c . noErTmr );
top . c . noErTmr = setTimeout ( 'top.c.noEr = 0;' , 1000 );
} else if (( event . which == 39 || event . which == 68 ) && top . c . noEr == 0 ) {
goToLoca ( 3 , 'направо' );
top . c . noEr = 1 ;
clearTimeout ( top . c . noErTmr );
top . c . noErTmr = setTimeout ( 'top.c.noEr = 0;' , 1000 );
} else if (( event . which == 40 || event . which == 83 ) && top . c . noEr == 0 ) {
goToLoca ( 2 , 'вниз' );
top . c . noEr = 1 ;
clearTimeout ( top . c . noErTmr );
top . c . noErTmr = setTimeout ( 'top.c.noEr = 0;' , 1000 );
} else if ( event . which == 70 || event . which == 13 ) {
2023-10-13 15:02:45 +00:00
//Т У Т $u->info['x'] $u->info['y'] $u->info['dnow']
//$u->info['s'] = 1(вперед)
//$u->info['s'] = 2(влево)
//$u->info['s'] = 3(назад)
//$u->info['s'] = 4(право)
2023-08-30 14:58:56 +00:00
stor = < ? = $u -> info [ 's' ]; ?> ;
if ( stor == 1 ) {
< ? php
2023-10-13 15:02:45 +00:00
$args = [ $u -> info [ 'dnow' ], $u -> info [ 'x' ], $u -> info [ 'y' ] + 1 ];
2023-08-30 14:58:56 +00:00
?>
} else if ( stor == 2 ) {
< ? php
2023-10-13 15:02:45 +00:00
$args = [ $u -> info [ 'dnow' ], $u -> info [ 'x' ] - 1 , $u -> info [ 'y' ]];
2023-08-30 14:58:56 +00:00
?>
} else if ( stor == 3 ) {
< ? php
2023-10-13 15:02:45 +00:00
$args = [ $u -> info [ 'dnow' ], $u -> info [ 'x' ], $u -> info [ 'y' ] - 1 ];
2023-08-30 14:58:56 +00:00
?>
} else if ( stor == 4 ) {
< ? php
2023-10-13 15:02:45 +00:00
$args = [ $u -> info [ 'dnow' ], $u -> info [ 'x' ] + 1 , $u -> info [ 'y' ]];
2023-08-30 14:58:56 +00:00
?>
}
2022-06-06 21:30:34 +00:00
2023-10-13 15:02:45 +00:00
< ? php
$bottem = Db :: getValue ( 'select id2 from dungeon_bots where dn = ? and x = ? and y = ?' , $args );
unset ( $args );
if ( empty ( $bottem )) {
$bottem = 0 ;
}
?>
bott = < ? = $bottem ?> ;
2023-08-30 14:58:56 +00:00
if ( bott != 0 ) {
window . location . href = " /main.php?atack= " + bott + " &rnd=<?= $code ; ?> " ;
}
} else if ( event . which == 32 || event . which == 90 ) {
itemtake = 0 ;
2023-09-30 01:31:32 +00:00
< ? php $sp = mysql_fetch_assoc (
mysql_query (
'SELECT `ish`.* FROM `dungeon_items` AS `ish` WHERE `ish`.`dn` = "' . $u -> info [ 'dnow' ] . '" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND ( `ish`.`onlyfor` = "0" OR `ish`.`onlyfor` = "' . $u -> info [ 'id' ] . '" ) AND `ish`.`x` = "' . $u -> info [ 'x' ] . '" AND `ish`.`y` = "' . $u -> info [ 'y' ] . '" LIMIT 1'
)
);
2023-08-30 14:58:56 +00:00
if ( isset ( $sp [ 'id' ]))
{ ?>
itemtake = < ? = $sp [ 'id' ]; ?> ;
< ? php } ?>
if ( itemtake != 0 ) {
takeItem ( itemtake );
2022-08-25 11:23:36 +00:00
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
}
if ( event . which == 81 ) {
Fast ( 1 );
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
} else if ( event . which == 69 ) {
Fast ( 2 );
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
}
});
< ? php } ?>
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function dialogMenu ( id , atk , talk , look , take , e , tmkt ) {
var d = document . getElementById ( 'deMenu' );
if ( d != undefined ) {
if ( e == undefined ) {
e = window . e ;
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
}
d . innerHTML = '' ;
var t = '' ;
if ( talk > 0 ) {
t += '<a href="main.php?talk=' + talk + '&rnd=<?= $code; ?>">Диалог</a><br>' ;
}
if ( atk == 1 ) {
if ( tmkt == 0 ) {
t += '<a href="main.php?atack=' + id + '&rnd=<?= $code; ?>">Напасть</a><br>' ;
2022-08-25 11:23:36 +00:00
} else {
2023-08-30 14:58:56 +00:00
if ( tmkt == 1 ) {
//кенты
< ? php if ( isset ( $sb [ 'id' ])) { ?>
t += '<a href="main.php?addpuck=' + id + '&rnd=<?= $code; ?>">Передача шайбы</a><br>' ;
< ? php } else { ?>
t += '<i>Нет действий</i>' ;
< ? php } ?>
} else {
//фраера
t += '<a href="main.php?atack=' + id + '&rnd=<?= $code; ?>">Напасть</a><br>' ;
}
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
if ( look == 1 ) {
t += 'Просмотр<br>' ;
}
if ( take == 1 ) {
t += 'Поднять<br>' ;
}
d . innerHTML = t + '<small style="float:right;"><button style="border: solid 1pt #B0B0B0; font-family: MS Sans Serif; font-size: 10px; color: #191970; MARGIN-BOTTOM: 2px; MARGIN-TOP: 1px;" type="button" onClick="exitDem();">x</button></center>' ;
d . style . display = '' ;
if ( e . x == undefined ) {
e . x = e . clientX ;
e . y = e . clientY ;
}
d . style . top = e . y + 'px' ;
if ( e . x > 320 ) {
d . style . right = ( document . body . offsetWidth - e . x ) + 'px' ;
} else {
d . style . right = ( - e . x + 540 ) + 'px' ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function exitDem () {
var d = document . getElementById ( 'deMenu' );
if ( d != undefined ) {
d . innerHTML = '' ;
d . style . display = 'none' ;
d . style . top = '0px' ;
d . style . right = '0px' ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
var objects = {};
//i:{id,login,mapPoint,sex,obraz,type,users_p},
2023-09-30 01:31:32 +00:00
const users = { < ? = $d -> genUsers (); ?> };
2023-08-30 14:58:56 +00:00
var objs = { < ? = $d -> genObjects (); ?> };
var items = {};
var actions = {};
var dsee = < ? = 0 + $d -> gs ; ?> ;
var mapp = {
2023-09-30 01:31:32 +00:00
1 : '0_0f' , 2 : '0_0f' , 3 : '0_0f' , 4 : '1_1f' ,
5 : '1_1f' , 6 : '1_1f' , 7 : '2_1f' , 8 : '2_1f' ,
9 : '2_1f' , 11 : '3_1l' , 12 : '3_1f' , 13 : '3_1r'
2023-08-30 14:58:56 +00:00
}
var zmap = { 5 : 894 , 8 : 0 , 12 : 0 }
var zfloor0 = { 1 : '' , 2 : '' , 3 : '' , 4 : '' , 5 : '' };
function genMap () {
2023-09-30 01:31:32 +00:00
let i = 0 , m = false , mz = false ;
2023-08-30 14:58:56 +00:00
while ( i < users [ 'count' ]) {
if ( users [ i ] != undefined ) {
mz = mapp [ users [ i ][ 2 ]];
if ( document . getElementById ( mz ) != undefined ) {
m = document . getElementById ( mz );
m . innerHTML = addUser ( users [ i ], mz ) + m . innerHTML ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
i ++ ;
}
2023-09-30 01:31:32 +00:00
i = 0 ;
m = false ;
mz = false ;
2023-08-30 14:58:56 +00:00
while ( i < objs [ 'count' ]) {
if ( objs [ i ] != undefined ) {
mz = mapp [ objs [ i ][ 2 ]];
if ( objs [ i ][ 5 ] == dsee && ( objs [ i ][ 2 ] == 5 || objs [ i ][ 2 ] == 2 || objs [ i ][ 2 ] == 8 || objs [ i ][ 2 ] == 12 || objs [ i ][ 2 ] == 15 )) {
mz = mapp [ objs [ i ][ 2 ] - 3 ];
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( document . getElementById ( mz ) != undefined ) {
m = document . getElementById ( mz );
m . innerHTML = addObj ( objs [ i ], mz ) + m . innerHTML ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
i ++ ;
}
2023-09-30 01:31:32 +00:00
i = 5 ;
2023-08-30 14:58:56 +00:00
while ( i >= 1 ) {
if ( zfloor0 [ i ] != '' ) {
document . getElementById ( 'Floor0' ) . innerHTML += zfloor0 [ i ];
}
i -- ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
var dConfig = {
2 : {
1 : { 'top' : 54 , 'left' : 140 , 'w' : 80 , 'h' : 147 },
2 : { 'top' : 56 , 'left' : 92 , 'w' : 75 , 'h' : 137 },
3 : { 'top' : 51 , 'left' : 186 , 'w' : 75 , 'h' : 137 },
4 : { 'top' : 49 , 'left' : 165 , 'w' : 80 , 'h' : 147 },
5 : { 'top' : 49 , 'left' : 105 , 'w' : 80 , 'h' : 147 },
6 : { 'top' : 53 , 'left' : 140 , 'w' : 80 , 'h' : 147 },
7 : { 'top' : 53 , 'left' : 87 , 'w' : 80 , 'h' : 147 },
8 : { 'top' : 53 , 'left' : 190 , 'w' : 80 , 'h' : 147 }
},
3 : {
1 : { 'top' : 60 , 'left' : 152 , 'w' : 53 , 'h' : 97 },
2 : { 'top' : 58 , 'left' : 110 , 'w' : 53 , 'h' : 97 },
3 : { 'top' : 58 , 'left' : 188 , 'w' : 53 , 'h' : 97 },
4 : { 'top' : 61 , 'left' : 168 , 'w' : 53 , 'h' : 97 },
5 : { 'top' : 61 , 'left' : 128 , 'w' : 53 , 'h' : 97 },
6 : { 'top' : 62 , 'left' : 153 , 'w' : 53 , 'h' : 97 },
7 : { 'top' : 62 , 'left' : 113 , 'w' : 53 , 'h' : 97 },
8 : { 'top' : 62 , 'left' : 193 , 'w' : 53 , 'h' : 97 }
},
4 : {
1 : { 'top' : 70 , 'left' : 158 , 'w' : 35 , 'h' : 64 },
2 : { 'top' : 68 , 'left' : 125 , 'w' : 35 , 'h' : 64 },
3 : { 'top' : 68 , 'left' : 193 , 'w' : 35 , 'h' : 64 },
4 : { 'top' : 71 , 'left' : 173 , 'w' : 35 , 'h' : 64 },
5 : { 'top' : 71 , 'left' : 137 , 'w' : 35 , 'h' : 64 },
6 : { 'top' : 73 , 'left' : 158 , 'w' : 35 , 'h' : 64 },
7 : { 'top' : 73 , 'left' : 129 , 'w' : 35 , 'h' : 64 },
8 : { 'top' : 73 , 'left' : 193 , 'w' : 35 , 'h' : 64 }
}
}
var dConfigObj = {
1 : {
0 : {
'top' : 65 ,
'left' : 110 ,
'w' : 1 ,
'h' : 1
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
, 2 : {
0 : {
'top' : 65 ,
'left' : 110 ,
'w' : 0.65 ,
'h' : 0.65
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
},
3 : {
0 : {
'top' : 65 ,
'left' : 110 ,
'w' : 0.48 ,
'h' : 0.48
}
},
4 : {
0 : {
'top' : 65 ,
'left' : 110 ,
'w' : 0.35 ,
'h' : 0.35
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
}
var prob = { 0 : { 1 : 1 , 2 : 0.25 , 3 : - 0.10 , 4 : - 0.38 }, 1 : { 1 : 0.90 , 2 : 0.50 , 3 : 0.23 , 4 : 0.05 }};
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function addObj ( v , mz ) {
var r = '' , rz = 0 ;
if ( v [ 2 ] >= 1 && v [ 2 ] <= 3 ) {
rz = 1 ;
}
if ( v [ 2 ] >= 4 && v [ 2 ] <= 6 ) {
rz = 2 ;
}
if ( v [ 2 ] >= 7 && v [ 2 ] <= 9 ) {
rz = 3 ;
}
if ( v [ 2 ] >= 10 && v [ 2 ] <= 14 ) {
rz = 4 ;
}
if ( v [ 2 ] >= 15 && v [ 2 ] <= 19 ) {
rz = 5 ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( v [ 5 ] == dsee ) {
rz -= 1 ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( dConfigObj [ rz ] != undefined && dConfigObj [ rz ][ v [ 6 ]] != undefined ) {
new_w = v [ 7 ] * dConfigObj [ rz ][ v [ 6 ]][ 'w' ];
new_h = v [ 8 ] * dConfigObj [ rz ][ v [ 6 ]][ 'h' ];
new_left = dConfigObj [ rz ][ v [ 6 ]][ 'left' ] - Math . round (( v [ 7 ] * prob [ 0 ][ rz ]) / 4 );
new_top = dConfigObj [ rz ][ v [ 6 ]][ 'top' ] - Math . round (( v [ 8 ] * prob [ 1 ][ rz ]) / 4 );
if ( v [ 2 ] == 6 ) {
new_left += 195 ;
new_top -= 5 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 4 ) {
new_left -= 195 ;
new_top -= 5 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 9 ) {
new_left -= 140 ;
new_top -= 2 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 7 ) {
new_left += 140 ;
new_top -= 2 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 13 ) {
new_left += 100 ;
new_top -= 1 ;
}
if ( v [ 2 ] == 11 ) {
new_left -= 100 ;
new_top -= 0 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 9 ] != 0 ) {
new_left += Math . round ( new_left / ( 100 + ( rz - 1 ) * 10 ) * v [ 9 ] + rz * 0.25 );
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 10 ] != 0 ) {
new_top += Math . round ( new_h / 2 + new_top / ( 100 + ( rz - 1 ) * 50 ) * v [ 10 ] - rz * 3.3 );
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( rz == 4 ) {
new_top += 3 ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( v [ 11 ] != 0 ) {
if ( v [ 11 ][ 't' + rz ] != undefined ) {
new_top += v [ 11 ][ 't' + rz ];
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 11 ][ 'l' + rz ] != undefined ) {
new_left += v [ 11 ][ 'l' + rz ];
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 11 ][ 'w' + rz ] != undefined ) {
new_w += v [ 11 ][ 'w' + rz ];
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( v [ 11 ][ 'h' + rz ] != undefined ) {
new_h += v [ 11 ][ 'h' + rz ];
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( v [ 11 ][ 'rt' + rz ] != undefined ) {
new_top = v [ 11 ][ 'rt' + rz ];
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( v [ 11 ][ 'rl' + rz ] != undefined ) {
new_left = v [ 11 ][ 'rl' + rz ];
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( rz >= 1 && rz <= 2 ) {
actionNow = '' ;
if ( v [ 11 ][ 'use' ] != undefined ) {
if ( v [ 11 ][ 'use' ] == 'exit' ) {
actionNow = 'alert(\'Выход из подземелья\');' ;
} else if ( v [ 11 ][ 'use' ] == 'takeit' ) {
actionNow = 'takeObj(' + v [ 0 ] + ')' ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
2023-11-06 00:40:12 +00:00
zfloor0 [ rz ] = '<img title="' + v [ 1 ] + '" onclick="' + actionNow + ' " src= " < ? = Config :: img (
) ?> /1x1.gif" style="cursor: pointer; position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
2023-08-30 14:58:56 +00:00
} else {
2023-11-06 00:40:12 +00:00
zfloor0 [ rz ] = '<img title="' + v [ 1 ] + ' " src= " < ? = Config :: img (
) ?> /1x1.gif" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
2022-08-25 11:23:36 +00:00
}
2023-11-06 00:40:12 +00:00
r = ' < img title = " obj " src = " <?= Config::img(
) ?> /i/sprites/' + v[4] + '" class="dObj" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />';
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
return r ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function addUser ( v , mz ) {
var r = '' ;
var rz = 0 ; //растояние до пользователя
if ( v [ 2 ] >= 1 && v [ 2 ] <= 3 ) {
rz = 1 ;
}
if ( v [ 2 ] >= 4 && v [ 2 ] <= 6 ) {
rz = 2 ;
}
if ( v [ 2 ] >= 7 && v [ 2 ] <= 9 ) {
rz = 3 ;
}
if ( v [ 2 ] >= 10 && v [ 2 ] <= 14 ) {
rz = 4 ;
}
if ( v [ 2 ] >= 15 && v [ 2 ] <= 19 ) {
rz = 5 ;
}
if ( dConfig [ rz ] != undefined && dConfig [ rz ][ v [ 6 ]] != undefined ) {
new_w = dConfig [ rz ][ v [ 6 ]][ 'w' ];
new_h = dConfig [ rz ][ v [ 6 ]][ 'h' ];
new_left = dConfig [ rz ][ v [ 6 ]][ 'left' ];
new_top = dConfig [ rz ][ v [ 6 ]][ 'top' ];
if ( v [ 2 ] == 6 ) {
new_left += 215 ;
new_top -= 5 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 4 ) {
new_left -= 215 ;
new_top -= 5 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 9 ) {
new_left -= 155 ;
new_top -= 2 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 7 ) {
new_left += 155 ;
new_top -= 2 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 13 ) {
new_left += 115 ;
new_top -= 1 ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( v [ 2 ] == 11 ) {
new_left -= 115 ;
new_top -= 1 ;
}
if ( v [ 2 ] >= 11 && v [ 2 ] <= 13 ) {
new_top += 5 ;
}
if ( rz >= 1 && rz <= 2 ) {
action = '' ;
if ( v [ 5 ] == 'bot' || < ? = $d -> info [ 'bsid' ]; ?> > 0) {
action = 'dialogMenu(' + v [ 0 ] + ',' + v [ 8 ] + ',' + v [ 7 ] + ',0,0,event,' + v [ 9 ] + ');' ;
2022-08-25 11:23:36 +00:00
}
2023-11-06 00:40:12 +00:00
zfloor0 [ rz ] += '<img title="' + v [ 1 ] + '" onClick="' + action + ' " src= " < ? = Config :: img (
) ?> /1x1.gif" style="cursor:pointer;position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
2023-08-30 14:58:56 +00:00
} else {
2023-11-06 00:40:12 +00:00
zfloor0 [ rz ] += '<img title="' + v [ 1 ] + ' " src= " < ? = Config :: img (
) ?> /1x1.gif" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
2022-08-25 11:23:36 +00:00
}
2023-11-06 00:40:12 +00:00
r = ' < img title = " user " src = " <?= Config::img(
) ?> /chars/' + v[3] + '/' + v[4] + '.gif" class="dUser" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
return r ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
var speedLoc = 0 , sLoc1 = 0 , sLoc2 = 0 , tgo = 0 , tgol = 0 , gotoup777 = 0 , gotext777 = '' ;
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function cancelgoto () {
document . getElementById ( 'gotext777' ) . innerHTML = '' ;
gotoup777 = 0 ;
gotext777 = '' ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
function goToLoca ( id , ttl ) {
if ( tgo < 1 ) {
location . href = `/main.php?go=${id}&rnd=<?=$code;?>` ;
} else {
// здесь тогда, когда нажал повторно на кнопку вперед/назад во время загрузки
gotoup777 = id ;
gotext777 = ttl ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
function takeObj ( objId ) {
location . href = " /main.php?take_obj= " + objId + " &rnd=<?= $code ;?> " ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
function takeItem ( itemId ) {
location . href = " /main.php?take= " + itemId + " &rnd=<?= $code ;?> " ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
function Fast ( look ) {
location . href = " /main.php?look= " + look + " &rnd=<?= $code ;?> " ;
}
2022-06-06 21:30:34 +00:00
2023-08-30 14:58:56 +00:00
function locGoLineDng () {
var line = document . getElementById ( 'pline1' );
if ( line != undefined ) {
prc = 100 - Math . floor ( tgo / tgol * 100 );
sLoc1 = 108 / 100 * prc ;
if ( sLoc1 < 1 ) {
sLoc1 = 1 ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( sLoc1 > 108 ) {
sLoc1 = 108 ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
line . style . width = `${sLoc1}px` ;
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( tgo > 0 ) {
tgo -= 1 ;
setTimeout ( 'locGoLineDng()' , 100 );
} else {
if ( gotoup777 > 0 ) {
// нажал на кнопку, идёт загрузка, нажал ещё раз и начнется другая
// именно в момент перехода на второй круг появляется этот код
location . href = `/main.php?go=${gotoup777}&rnd=<?=$code;?>` ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
var $DomGotext777 = document . getElementById ( 'gotext777' )
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( gotoup777 > 0 && gotext777 != '' && $DomGotext777 . innerHTML != `Вы перейдете <b>${gotext777}</b> (<a href="javascript:void(0)" onclick="cancelgoto()">отмена</a>)` ) {
$DomGotext777 . innerHTML = `Вы перейдете <b>${gotext777}</b> (<a href="javascript:void(0)" onclick="cancelgoto()">отмена</a>)` ;
} else if ( $DomGotext777 . innerHTML != '' && gotoup777 == 0 && gotext777 == '' ) {
$DomGotext777 . innerHTML = '' ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
}
< ? php
$tmGo = $u -> info [ 'timeGo' ] - time (); //сколько секунд осталось
$tmGol = $u -> info [ 'timeGo' ] - $u -> info [ 'timeGoL' ]; //сколько секунд идти всего
echo 'var tgo = ' . ( $tmGo * 10 ) . '; var tgol = ' . ( $tmGol * 10 ) . ';' ; ?>
</ script >
2023-09-30 01:31:32 +00:00
< link rel = " stylesheet " href = " <?= Config::img() ?>/css/dungeon.css " >
< link rel = " stylesheet " href = " <?= Config::img() ?>/css/dungeon_<?= $d->point ['css']; ?>.css " >
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
< div id = " deMenu " class = " hintDm " style = " display:none;z-index:5000; " ></ div >
< div style = " margin-right:1px; " >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td >
2023-09-30 01:31:32 +00:00
< p style = " float:left; color: red; " >& nbsp ; < ? php if ( isset ( $d -> error )) {
echo $d -> error . '<br>' ;
2023-08-30 14:58:56 +00:00
} ?> </p>
< ? php if ( $d -> info [ 'bsid' ] == 0 && $d -> info [ 'id2' ] != 106 ) { ?> <p style="float:right;"><a
onClick = " if(confirm('Выйти из пещеры?')) { location.href = '/main.php?exitd=<?= $code ; ?>'; } "
href = " javascript:void(0) " > Выйти </ a ></ p >< ? php } ?>
</ td >
</ tr >
< tr >
< td >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td valign = " top " >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td valign = " top " >
< div align = " left " >
< div id = " users " >< ? php if ( $d -> info [ 'bsid' ] == 0 ) {
echo $d -> usersDng ();
if ( $dies > 0 ) {
echo '<H4>Кол-во смертей: ' . $dies . '</H4>' ;
}
} else {
if ( $d -> info [ 'id2' ] != 15 ) {
//Живые участники и архивариусы
echo '<H4>Живые участники:</H4>' ;
2022-08-25 11:23:36 +00:00
echo $d -> usersDng ();
2023-08-30 14:58:56 +00:00
} else {
echo '<H4>Игровой счет. Красные: <font color=red>' . ( 0 + $tm1win ) . '</font> - Синие: <font color=blue>' . ( 0 + $tm2win ) . '</font></H4>' ;
2022-08-25 11:23:36 +00:00
if ( $dies > 0 ) {
2023-01-10 16:29:32 +00:00
echo '<H4>Кол-во смертей: ' . $dies . '</H4>' ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
if ( isset ( $sb [ 'id' ])) {
echo '<H4><font color=blue>Шайба у вас, забейте её в ворота противника!</font></h4>' ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
}
//Генерируем список текущих квестов
$qsee = '' ;
$dungeon_enter = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "' . $u -> info [ 'room' ] . '" LIMIT 1' ));
$sp = mysql_query ( 'SELECT * FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 1000' );
while ( $pl = mysql_fetch_array ( $sp )) {
2023-09-30 01:31:32 +00:00
$pq = mysql_fetch_array (
mysql_query (
'SELECT * FROM `quests` WHERE `id` = "' . str_replace (
'start_quest' , '' , $pl [ 'vars' ]
) . '" AND (`tr_date` LIKE "%tr_dn:=:' . $d -> info [ 'id2' ] . '" OR `tr_date` LIKE "%tr_dn:=:' . $d -> info [ 'id2' ] . '|%" OR `tr_date` NOT LIKE "%tr_dn:=:%") LIMIT 1'
)
);
2023-08-30 14:58:56 +00:00
if ( isset ( $pq [ 'id' ])) {
$qsee .= '<small>Задание: ' . $pq [ 'name' ] . ' ' . $q -> infoDng ( $pq ) . '</small><br>' ;
$qx ++ ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
}
$sp = mysql_query ( 'SELECT * FROM `dialog_act` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `val` = 0 AND `info` != ""' );
while ( $pl = mysql_fetch_array ( $sp )) {
$xrz = $pl [ 'now' ];
$r = $pl [ 'max' ];
if ( $xrz > $r ) {
$xrz = $r ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
$r = ' < table style = " display:inline-block; " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " height = " 10 " >< tr >< td valign = " middle " width = " 120 " style = " padding-top:12px " >
< div style = " position:relative; " >< div id = " vhp-1234600000' . $pl['id'] . ' " title = " Выполнение задания " align = " left " class = " seehp " style = " position:absolute; top:-10px; width:120px; height:10px; z-index:12; " > ' . $xrz . ' / ' . $r . ' </ div >
2023-10-13 15:02:45 +00:00
< div title = " Выполнение задания " class = " hpborder " style = " position:absolute; top:-10px; width:120px; height:9px; z-index:13; " >< img src = " ' . Config::img() . '/1x1.gif " height = " 9 " width = " 1 " ></ div >
< div class = " hp_3 senohp " style = " height:9px; width:120px; position:absolute; top:-10px; z-index:11; " id = " lhp-1234600000' . $pl['id'] . ' " >< img src = " ' . Config::img() . '/1x1.gif " height = " 9 " width = " 1 " ></ div >
< div title = " Выполнение задания " class = " hp_none " style = " position:absolute; top:-10px; width:120px; height:10px; z-index:10; " >< img src = " ' . Config::img() . '/1x1.gif " height = " 10 " ></ div >
2023-08-30 14:58:56 +00:00
</ div ></ td ></ tr ></ table >< br >< script > top . startHpRegen ( " main " , - 1234600000 ' . $pl[' id '] . ' , ' . $xrz . ' , ' . $r . ' , 0 , 0 , 0 , 0 , 0 , 0 , 1 ) </ script > ' ;
$qsee .= '<small>Задание: ' . $pl [ 'info' ] . ' ' . $r . '</small><br>' ;
}
if ( $qsee != '' ) {
echo '<br><br>' . $qsee ;
}
?> </div>
< div id = " items " >< ? = $d -> itemsMap (); ?> </div>
< div id = " information " >< ? php if ( isset ( $d -> information )) {
echo $d -> information ;
} ?> </div>
</ div >
</ td >
< td width = " 530 " height = " 260 " valign = " top "
2023-09-30 14:53:26 +00:00
style = " background-image:url(<?= Config::img() ?>/maze_layer.jpg); background-repeat:no-repeat; " >
2023-08-30 14:58:56 +00:00
< div style = " position:relative; " >
< div style = " position:absolute;z-index:1;left:397px;top:0px; " >
2023-09-30 01:31:32 +00:00
< div id = " pline1 " ></ div >
2022-08-25 11:23:36 +00:00
</ div >
2023-08-30 14:58:56 +00:00
< div style = " position:absolute; z-index:50; left: 374px; top: 110px; " >
2023-09-30 14:53:26 +00:00
< img src = " <?= Config::img() ?>/podzem-map.png " />
2023-08-30 14:58:56 +00:00
</ div >
< div id = " minimap "
style = " position:absolute; left: 374px; top: 110px; " >
< table border = " 0 " align = " center " cellpadding = " 0 " cellspacing = " 0 "
style = " border:1px solid #333333 " >
< ? php
$i = 1 ;
$htmlv = '' ;
while ( $i <= 8 ) {
$htmlv .= '<tr>' ;
$j = 1 ;
$htmlv2 = '' ;
while ( $j <= 9 ) {
$htmlv2 = '<td width="15" height="15" align="center" valign="middle" align="center" style="margin:1px;" id="min_' . ( $u -> info [ 'x' ] + ( 4 - $j )) . '_' . ( $u -> info [ 'y' ] + ( 4 - $i )) . '"></td>' . $htmlv2 ;
$j ++ ;
}
$htmlv .= $htmlv2 . '</tr>' ;
$i ++ ;
}
echo $htmlv ;
unset ( $htmlv , $htmlv2 );
?>
< style >
. u_rot1 {
- webkit - transform : rotate ( - 180 deg );
- moz - transform : rotate ( - 180 deg );
filter : progid : DXImageTransform . Microsoft . BasicImage ( rotation = 6 );
- o - transform : rotate ( 60 deg );
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
. u_rot4 {
- webkit - transform : rotate ( - 90 deg );
- moz - transform : rotate ( - 90 deg );
filter : progid : DXImageTransform . Microsoft . BasicImage ( rotation = 3 );
- o - transform : rotate ( 30 deg );
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
. u_rot3 {
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
. u_rot2 {
- webkit - transform : rotate ( - 270 deg );
- moz - transform : rotate ( - 270 deg );
filter : progid : DXImageTransform . Microsoft . BasicImage ( rotation = 9 );
- o - transform : rotate ( 90 deg );
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
. dBot {
display : inline - block ;
height : 18 px ;
width : 10 px ;
z - index : 99 ;
position : absolute ;
top : - 8 px ;
left : - 6 px ;
2023-11-06 00:40:12 +00:00
/ / background - image : url ( " <?= Config::img() ?> /drgn/bg/r.gif " );
2023-08-30 14:58:56 +00:00
}
</ style >
</ table >
< script >
< ? php
//выводим мини-карту
$i = 0 ;
$uxy = [];
if ( $u -> room [ 'name' ] != 'Башня Смерти' ) {
2023-09-30 01:31:32 +00:00
$sp = mysql_query (
'SELECT `u`.`login`,`u`.`id`,`s`.`x`,`s`.`y`,`s`.`s` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $u -> info [ 'dnow' ] . '" AND `u`.`id` != "' . $u -> info [ 'id' ] . '" LIMIT 10'
);
2023-08-30 14:58:56 +00:00
while ( $pl = mysql_fetch_array ( $sp )) {
$uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]] = $pl ;
}
}
if ( $u -> info [ 'admin' ] > 0 || $d -> id_dng == 106 ) {
$bxy = [];
2023-01-10 16:29:32 +00:00
if ( $u -> room [ 'name' ] != 'Башня Смерти' ) {
2023-09-30 01:31:32 +00:00
$sp = mysql_query (
' SELECT `db` .* , `tb` . `login` , `tb` . `obraz` , `tb` . `sex` FROM `dungeon_bots` as `db` LEFT JOIN `test_bot` as `tb` ON `tb` . `id` = `db` . `id_bot`
2023-08-30 14:58:56 +00:00
WHERE `db` . `dn` = " ' . $u->info ['dnow'] . ' " AND `db` . `delete` = 0 AND
( `db` . `x` >= ' . ($u->info[' x '] - 5) . ' AND `db` . `x` <= ' . ($u->info[' x '] + 5) . ' ) AND
( `db` . `y` >= ' . ($u->info[' y '] - 5) . ' AND `db` . `y` <= ' . ($u->info[' y '] + 5) . ' )
2023-09-30 01:31:32 +00:00
LIMIT 100 '
);
2022-08-25 11:23:36 +00:00
while ( $pl = mysql_fetch_array ( $sp )) {
2023-08-30 14:58:56 +00:00
$bxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]] = $pl ;
2022-08-25 11:23:36 +00:00
}
}
2023-08-30 14:58:56 +00:00
}
2022-08-25 11:23:36 +00:00
2023-09-30 01:31:32 +00:00
$sp = mysql_query (
'SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d -> id_dng . '" AND (`x` >= ' . ( $u -> info [ 'x' ] - 5 ) . ' AND `x` <= ' . ( $u -> info [ 'x' ] + 5 ) . ') AND (`y` >= ' . ( $u -> info [ 'y' ] - 5 ) . ' AND `y` <= ' . ( $u -> info [ 'y' ] + 5 ) . ') ORDER BY `y` ASC , `x` ASC LIMIT 100'
);
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
$rzn = [ 0 => 'top' , 3 => 'right' , 2 => 'bottom' , 1 => 'left' ];
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
$sb1 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_obj` WHERE `name` LIKE "%Шайба%" AND `dn` = "' . $d -> info [ 'id' ] . '" LIMIT 1' ));
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
$sb1 = Db :: getRow ( 'select x, y from dungeon_obj where name like ? and dn = ? limit 1' , [ '%Шайба%' , $d -> info [ 'id' ]]);
while ( $pl = mysql_fetch_array ( $sp )) {
2023-10-13 15:02:45 +00:00
$css = '"background-image":"url(' . Config :: img () . '/fon555.png)",' ;
2023-08-30 14:58:56 +00:00
$j = 0 ;
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
while ( $j < 4 ) {
if ( $pl [ 'st' ][ $j ] == 1 ) {
$css .= '"border-' . $rzn [ $j ] . '":"1px solid #303030",' ;
} else {
$css .= '"margin-' . $rzn [ $j ] . '":"1px",' ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
$j ++ ;
}
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
if ( ! empty ( $sb1 ) && $sb1 [ 'x' ] == $pl [ 'x' ] && $sb1 [ 'y' ] == $pl [ 'y' ] ) {
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $pl [ 'x' ] . '_' . $pl [ 'y' ] . '").html("<img class=\"u_rot' . $u -> info [ 's' ] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/shb.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2023-08-30 14:58:56 +00:00
} elseif ( $u -> info [ 'x' ] == $pl [ 'x' ] && $u -> info [ 'y' ] == $pl [ 'y' ]) {
if ( $d -> info [ 'id2' ] == 15 ) {
2022-08-25 11:23:36 +00:00
$tmbth = 4 ;
2023-08-30 14:58:56 +00:00
$tm = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `katok_now` WHERE `clone` = "' . $u -> info [ 'id' ] . '" LIMIT 1' ));
2022-08-25 11:23:36 +00:00
if ( $tm [ 'team' ] == 1 ) {
$tmbth = 1 ;
} elseif ( $tm [ 'team' ] == 2 ) {
$tmbth = 2 ;
}
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $pl [ 'x' ] . '_' . $pl [ 'y' ] . '").html("<img class=\"u_rot' . $u -> info [ 's' ] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/p' . $tmbth . '/d0.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2022-08-25 11:23:36 +00:00
} else {
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $pl [ 'x' ] . '_' . $pl [ 'y' ] . '").html("<img class=\"u_rot' . $u -> info [ 's' ] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/p1/d0.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
} elseif ( $d -> info [ 'id2' ] == 15 ) {
$tmbth = 4 ;
$tm = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `katok_now` WHERE `clone` = "' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'id' ] . '" LIMIT 1' ));
if ( $tm [ 'team' ] == 1 ) {
$tmbth = 1 ;
} elseif ( $tm [ 'team' ] == 2 ) {
$tmbth = 2 ;
2022-08-25 11:23:36 +00:00
}
2023-09-30 01:31:32 +00:00
$tbshin = mysql_fetch_array (
mysql_query (
'SELECT `id` FROM `items_users` WHERE `uid` = "' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'id' ] . '" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'
)
);
2023-08-30 14:58:56 +00:00
if ( isset ( $tbshin [ 'id' ])) {
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $pl [ 'x' ] . '_' . $pl [ 'y' ] . '").html("<img class=\"u_rot' . $u -> info [ 's' ] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/shb.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2023-08-30 14:58:56 +00:00
} else {
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'x' ] . '_' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'y' ] . '").html("<img class=\"u_rot' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 's' ] . '\" title=\"' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'login' ] . '\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/p' . $tmbth . '/d0.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2022-08-25 11:23:36 +00:00
}
2023-08-30 14:58:56 +00:00
} elseif ( isset ( $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]])) {
2023-11-06 00:40:12 +00:00
echo '$("#min_' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'x' ] . '_' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'y' ] . '").html("<img class=\"u_rot' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 's' ] . '\" title=\"' . $uxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'login' ] . '\" style=\"margin:2px 3px 3px 2px;background-image:url(' . Config :: img (
) . '/i/move/p4/d0.gif)\" src=\"' . Config :: img () . '/1x1.gif\" width=\"7\" height=\"7\">");' ;
2023-08-30 14:58:56 +00:00
} elseif ( isset ( $bxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]]) ) {
$bobrz = $bxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'obraz' ];
if ( file_exists ( 'img.new-combats.com/chars/' . $bxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'sex' ] . '/' . $bxy [ $pl [ 'x' ] . '_' . $pl [ 'y' ]][ 'obraz' ] . '' )) {
$bobrz = str_replace ( '.png' , '.gif' , $bobrz );
} else {
$bobrz = str_replace ( '.gif' , '.png' , $bobrz );
}
?>
2023-11-06 00:40:12 +00:00
$ ( " #min_<?= $bxy[$pl['x'] . '_' . $pl['y'] ]['x']?>_<?= $bxy[$pl['x'] . '_' . $pl['y'] ]['y']?> " ) . html ( " <div style='position:relative; display:inline-block; width:1px; height:1px;'><img class='dBot' title='<?= $bxy[$pl['x'] . '_' . $pl['y'] ]['login']?>' src='<?= Config::img(
) ?> /chars/<?=$bxy[$pl['x'] . '_' . $pl['y']]['sex']?>/<?=$bobrz?>'></div>");
2023-08-30 14:58:56 +00:00
< ? php
}
$css = rtrim ( $css , ',' );
echo '$("#min_' . $pl [ 'x' ] . '_' . $pl [ 'y' ] . '").css({' . $css . '});' ;
$i ++ ;
}
?>
</ script >
</ div >
< div style = " position:absolute; z-index:50; left: 374px; top: 110px; " >
2023-09-30 14:53:26 +00:00
< img src = " <?= Config::img() ?>/podzem-map2.png " alt = " " />
2023-08-30 14:58:56 +00:00
</ div >
2023-10-13 15:02:45 +00:00
< img src = " <?= Config::img() ?>/g1.jpg " title = " Обновить, X:<?= $u->info ['x'] ?> ,Y:<?= $u->info ['y'] ?> " width = " 31 " height = " 18 " id = " g1 "
style = " position: absolute; cursor:pointer; left: 435px; top: 53px; " alt = " " />
2023-08-30 14:58:56 +00:00
< ? php if ( $d -> testGone ( 3 ) > 0 ) { ?>
2023-10-13 15:02:45 +00:00
< img src = " <?= Config::img() ?>/g2.jpg " onclick = " goToLoca(3,'направо'); " width = " 27 " height = " 48 " id = " g2 "
style = " position:absolute;cursor:pointer; left: 492px; top: 40px; " alt = " " />
2023-08-30 14:58:56 +00:00
< ? php }
if ( $d -> testGone ( 4 ) > 0 ) { ?>
2023-10-13 15:02:45 +00:00
< img src = " <?= Config::img() ?>/g3.jpg " onclick = " goToLoca(4,'налево'); " width = " 28 " height = " 46 " id = " g3 "
style = " position:absolute;cursor:pointer; left: 382px; top: 40px; " alt = " " />
2023-08-30 14:58:56 +00:00
< ? php }
if ( $d -> testGone ( 2 ) > 0 ) { ?>
2023-10-13 15:02:45 +00:00
< img src = " <?= Config::img() ?>/g4.jpg " onclick = " goToLoca(2,'назад'); " width = " 45 " height = " 25 " id = " g4 "
style = " position:absolute;cursor:pointer; left: 428px; top: 72px; " alt = " " />
2023-08-30 14:58:56 +00:00
< ? php }
if ( $d -> testGone ( 1 ) > 0 ) { ?>
2023-10-13 15:02:45 +00:00
< img src = " <?= Config::img() ?>/g5.jpg " onclick = " goToLoca(1,'вперед'); " width = " 46 " height = " 26 " id = " g5 "
style = " position:absolute;cursor:pointer; left: 428px; top: 26px; " alt = " " />
2023-08-30 14:58:56 +00:00
< ? php } ?>
2023-09-30 14:53:26 +00:00
< img src = " <?= Config::img() ?>/g6.jpg " width = " 30 " height = " 19 " id = " g6 " style = " position:absolute;cursor:pointer; left: 399px; top: 28px; " alt = " " />
< img src = " <?= Config::img() ?>/g7.jpg " width = " 24 " height = " 19 " id = " g7 " style = " position:absolute;cursor:pointer; left: 476px; top: 28px; " alt = " " />
2023-09-30 01:31:32 +00:00
< div id = " Dungeon " class = " Dungeon " style = " width:352px;height:240px;padding:0;margin:10px;text-align:center; " >
2023-08-30 14:58:56 +00:00
<!-- / MAP \ -->
2023-09-30 01:31:32 +00:00
< ? php
$mapIDs = [ // к этой х е р е б о р е вяжется javascript
3 => '4_0r' ,
4 => '4_0l' ,
5 => '3_2l' ,
6 => '3_2r' ,
9 => '3_1f' ,
10 => '3_1l' ,
11 => '3_1r' ,
13 => '3_0l' ,
14 => '2_1l' ,
15 => '2_1r' ,
16 => '2_1f' ,
18 => '2_0l' ,
19 => '1_1l' ,
20 => '1_1r' ,
21 => '1_1f' ,
23 => '1_0l' ,
24 => '0_1l' ,
25 => '0_1r' ,
26 => '0_0f' ,
28 => '0_0l' ,
];
$map = [
1 => 'LeftSide4_1' ,
2 => 'RightSide4_1' ,
3 => 'RightSide4_0' ,
4 => 'LeftSide4_0' ,
5 => 'LeftFront3_2' ,
6 => 'RightFront3_2' ,
7 => 'LeftFront3_1' ,
8 => 'RightFront3_1' ,
9 => 'LeftFront3_0' ,
10 => 'LeftFront3_1' ,
11 => 'RightFront3_1' ,
12 => 'LeftSide3_0' ,
13 => 'RightSide3_0' ,
14 => 'LeftFront2_1' ,
15 => 'RightFront2_1' ,
16 => 'LeftFront2_0' ,
17 => 'LeftSide2_0' ,
18 => 'RightSide2_0' ,
19 => 'LeftFront1_1' ,
20 => 'RightFront1_1' ,
21 => 'LeftFront1_0' ,
22 => 'LeftSide1_0' ,
23 => 'RightSide1_0' ,
24 => 'LeftFront0_1' ,
25 => 'RightFront0_1' ,
26 => 'LeftFront0_0' ,
27 => 'LeftSide0_0' ,
28 => 'RightSide0_0' ,
];
foreach ( $map as $k => $v ) {
2023-09-30 14:53:26 +00:00
if ( isset ( $d -> walls [ $k ]) && $d -> walls [ $k ] === 1 ) {
2023-09-30 01:31:32 +00:00
continue ;
}
$map [ $k ] = '' ;
}
?>
2023-08-30 14:58:56 +00:00
< div id = " Floor0 " class = " Floor0 " >
< div class = " Floor1 " >
2023-09-30 01:31:32 +00:00
< ? php
foreach ( $map as $key => $layer ) {
if ( ! $layer ) {
continue ;
}
$id = ! empty ( $mapIDs [ $key ]) ? " id=' " . $mapIDs [ $key ] . " ' " : '' ;
echo " <div class=' $layer ' $id ></div> " ;
}
?>
2022-06-06 21:30:34 +00:00
</ div >
2023-08-30 14:58:56 +00:00
</ div >
<!-- / MAP \ -->
2023-09-30 01:31:32 +00:00
< span class = " <?= $map[28] ?> " >
2023-08-30 14:58:56 +00:00
</ span ></ div >
</ div >
</ td >
</ tr >
</ table >
< div id = " gotext777 " style = " padding-top:5px;float:right; " >& nbsp ; </ div >
</ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ div >
< script >
genMap ();
locGoLineDng ();
$ ( " document " ) . ready ( function () {
$ ( '#g1' ) . click ( function () {
location . href = " /main.php " ;
});
2022-08-25 11:23:36 +00:00
2023-08-30 14:58:56 +00:00
$ ( '#g6' ) . click ( function () {
2023-09-30 01:31:32 +00:00
location . href = " /main.php?look=1&rnd=<?= $code ?> " ;
2022-08-25 11:23:36 +00:00
});
2023-08-30 14:58:56 +00:00
$ ( '#g7' ) . click ( function () {
2023-09-30 01:31:32 +00:00
location . href = " /main.php?look=2&rnd=<?= $code ?> " ;
2023-08-30 14:58:56 +00:00
});
});
</ script >
< br />< br />
< ? php
2023-09-30 01:31:32 +00:00
if ( $u -> isAdmin ()) {
echo 'S:' . $u -> info [ 's' ];
2023-08-30 14:58:56 +00:00
}
}