error2)) { $re = '' . $u->error . ''; } if (isset($_GET['nightatack'])) { if ( $u->room['name'] == 'Центральная площадь' || $u->room['name'] == 'Страшилкина улица' || $u->room['name'] == 'Парковая улица' || $u->room['name'] == 'Большая парковая улица' ) { if ($u->room['noatack'] == 0) { $ua = User::getInfo($_GET['login']); $wasInThisBattle = !empty(Db::getValue('select id from battle_last where uid = ? and battle_id = ? limit 1', [$u->info['id'], $ua['battle']])); if (isset($ua['id']) && $ua['online'] > time() - 520) { $usta = $u->getStats($ua['id'], 0); $minHp = $usta['hpAll'] / 100 * 33; if ($ua['battle'] > 0 && empty(Db::getValue('select count(id) from battle where id = ? and team_win = -1', [$ua['battle']]))) { $ua['battle'] = 0; } if ($ua['level'] < 8) { $re = 'Новички находятся под защитой Мироздателя...'; } elseif ($ua['id'] == $u->info['id']) { $re = 'На себя нападать нельзя...'; } elseif ($u->info['level'] > $ua['level'] + 1) { $re = 'Вы слишком сильны'; } elseif ($ua['align'] === 9) { $re = 'Нельзя нападать на городского монста с помощью кнопки напасть!'; } elseif ($wasInThisBattle) { $re = 'Нельзя вмешаться, вы уже были в этом поединке.'; } elseif ($ua['admin'] == 1 && $u->info['admin'] == 0) { $re = 'На кого прыгаешь, щенок?'; } elseif ($ua['room'] == $u->info['room'] && ($minHp <= $usta['hpNow'] || $ua['battle'] > 0)) { $goodt = $magic->atackUser( $u->info['id'], $ua['id'], $ua['team'], $ua['battle'], $ua['bbexp'], $ua['type_pers'] ); if ($u->error == '') { if ($cruw == 2) { $rtxt = '[img[items/pal_button9.gif]] "' . $u->info['login'] . '" совершил' . $sx . ' кровавое нападение на персонажа "' . $ua['login'] . '".'; } else { $rtxt = '[img[items/pal_button8.gif]] "' . $u->info['login'] . '" совершил' . $sx . ' нападение на персонажа "' . $ua['login'] . '".'; } if ($goodt > 0) { $cmsg = new ChatMessage(); $cmsg->setCity($u->info['city']); $cmsg->setRoom($u->info['room']); $cmsg->setType(6); $cmsg->setTypeTime(1); $cmsg->setText($rtxt); (new Chat())->sendMsg($cmsg); } unset($goodt); header('location: main.php'); die(); } } else { if ($ua['room'] != $u->info['room']) { $u->error = 'Персонаж находится в другой комнате'; } else { $u->error = 'Персонаж имеет слишком малый уровень жизней.'; } } } else { //На персонажа нельзя напасть $u->error = 'Персонаж не в игре, либо на нем нет метки'; } } else { $re = 'Нападать возможно только на улице...'; } } else { $re = 'Нападения возможны только ночью...'; } } function thisInfRm($id, $tp = null, $json = false) { $rm = Db::getRow('select * from room where code = ? and city = ?', [$id, 'capitalcity']); $inf = 'Здание было разрушено'; $rown = 0; if (isset($rm['id'])) { $rown = Db::getValue('select count(*) from users where online > unix_timestamp() - 120 and city = ? and room = ?', ['capitalcity', $rm['id']]); if ($tp == null) { $inf = '' . $rm['name'] . '
Сейчас в комнате ' . $rown . ' чел.'; } else { $inf = $rm['name'] . "\nСейчас в комнате " . $rown . ' чел.'; } if ($json) { return [$rm['code'], $rm['name'], $rown]; } } if ($json) { return ['false', $inf, $rown]; } if ($tp == null) { echo 'onMouseOver="top.hi(this,\'
' . $inf . '
\',event,0,1,1,1,\'max-height:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" onClick="goLocal(\'main.php?loc=' . $rm['code'] . '\',\'' . $rm['name'] . '\');"'; } else { echo $inf; } return []; } if (isset($_GET['loc'])) { // $training_manager = \DarksLight2\Training\TrainingManager::getInstance(); $go = Db::getRow('select * from room where code = ?', [$_GET['loc']]); // if (in_array( // $go['file'], $training_manager->getRegistered()[$training_manager->getCurrentStepName()]->allowedToMove() // ) || $u->info['admin'] > 0) { $tr_pl = Db::getValue('select v1 from eff_users where id_eff = 4 and uid = ? order by v1 desc limit 1', [$u->info['id']]); //Проверяем костыли $hasKostyl = Db::getValue('select count(id) from items_users where inOdet in (3,14) and item_id in (630, 631) and uid = ?', [$u->info['id']]) > 0; $zadej = 0; if ($tr_pl) { if ($hasKostyl) { if ($tr_pl == 2) { $zadej = 20; } elseif ($tr_pl == 3 || $tr_pl == 4) { $zadej = 30; } } else { $zadej = -1; $re = 'Вы травмированы. Не возможно с такими увечиями передвигаться без костылей.'; } } if ($u->room['extdlg'] > 0) { header('location: main.php?talk=' . $u->room['extdlg']); } elseif ($zadej == -1) { if (!isset($re) || $re == '') { $re = 'У вас травма, нельзя перемещаться...'; } //Травма... } elseif ($u->info['inTurnir'] > 0) { $re = 'Вы не можете перемещаться, Вы приняли заявку на турнир ...'; } elseif ( !$hasKostyl && ( empty($zadej) && $u->aves['now'] >= $u->aves['max'] && $u->room['name'] != 'Общежитие' && $u->room['name'] != 'Общ. Этаж 1' && $u->room['name'] != 'Общ. Этаж 2' && $u->room['name'] != 'Общ. Этаж 3' )) { $re = 'Вы не можете перемещаться, рюкзак переполнен ...'; } elseif (isset($go['id'])) { $rmgo = []; $rg = explode(',', $u->room['roomGo']); $mlvl = explode('-', $go['level']); $i = 0; while ($i < count($rg)) { if ($rg[$i] >= 0) { $rmgo[$rg[$i]] = 1; } $i++; } $sleep = $u->testAction( '`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1 ); if (isset($sleep['id']) && $sleep['vars'] == 'sleep' && $go['name'] != 'Общ. Этаж 1' && $go['name'] != 'Общ. Этаж 2' && $go['name'] != 'Общ. Этаж 3') { $re = 'Вы можете перемещаться только когда бодрствуете.'; echo ' ' . $re; } elseif ($u->info['timeGo'] >= time()) { $re = 'Вы не можете перемещаться еще ' . ($u->info['timeGo'] - time()) . ' сек.'; } elseif ($rmgo[$go['id']] == 1) { $alg = explode('-', $go['align']); $ku = (bool)Db::getValue('select 1 from katok_zv where uid = ?', [$u->info['id']]); if ($ku) { $re = 'Вы подали заявку на турнир и не можете перемещаться...'; } elseif (($alg[0] > $u->info['align'] || $alg[1] < $u->info['align']) && $go['align'] != 0) { $re = 'Ты не ту склонность выбрал.. Дружок :)'; } elseif ($u->info['zv'] > 0) { $testZv = Db::getValue('select count(id) from zayvki where id = ? and cancel = 0 and start = 0 and time > unix_timestamp() - 60*60*2') > 0; if ($testZv) { $re = 'Подали заявку и убегаем?.. Не хорошо!'; } else { $re = 'Ваша заявка была удалена... Теперь вы можете перейти в другую локацию!'; Db::sql('update stats set zv = 0 where id = ?', [$u->info['id']]); } } elseif (($go['clan'] > 0 && $u->info['clan'] != $go['clan']) || ($go['clan'] == -1 && $u->info['clan'] == 0)) { $re = 'Вы не можете попасть в эту комнату'; } elseif ($go['sex'] > 0 && $go['sex'] - 1 != $u->info['sex'] && $u->info['invis'] != 1 && $u->info['invis'] < time()) { $re = 'Вы не можете попасть в эту комнату'; } elseif ($mlvl[0] > $u->info['level']) { $re = 'Вы не можете попасть в эту комнату, уровень маловат ;)'; } elseif ($mlvl[1] < $u->info['level']) { $re = 'Вы не можете попасть в эту комнату, уровень высоковат ;)'; } elseif ($go['close'] == 0) { //замедление перемешения при травмах $plus_timeGo = $zadej; // добавочное время при травме if ($plus_timeGo < 0) { $plus_timeGo = 0; } if ( empty($zadej) && $u->aves['now'] >= $u->aves['max'] && $u->room['name'] != 'Общежитие' && $u->room['name'] != 'Общ. Этаж 1' && $u->room['name'] != 'Общ. Этаж 2' && $u->room['name'] != 'Общ. Этаж 3' ) { $plus_timeGo += 2 * 60; if (!$hasKostyl) { $plus_timeGo += 1.5 * 60; } } //end freez time go if ($u->stats['silver'] >= 1) {//время перемещения -20% $go['timeGO'] = floor($go['timeGO'] / 100 * 80); $plus_timeGo = floor($plus_timeGo / 100 * 80); } $u->info['timeGo'] = time() + $go['timeGO'] + $plus_timeGo; $u->info['timeGoL'] = time(); Db::sql('update stats set timeGo = ?, timeGoL = ? where id = ?', [$u->info['timeGo'], $u->info['timeGoL'], $u->info['id']]); Db::sql('update users set room = ?, online = unix_timestamp() where id = ?', [$go['id'], $u->info['id']]); if ($u->room['file'] == 'bsenter' && $go['file'] != 'bsenter') { //Удаляем все ставки в БС Db::sql( 'update bs_turnirs set users = users - (select count(bsid) from bs_zv where inBot = 0 and finish = 0 and uid = ?) where id = (select bsid from bs_zv where inBot = 0 and finish = 0 and uid = ? limit 1)', [$u->info['id'], $u->info['id']] ); Db::sql('update bs_zv set finish = unix_timestamp() where uid = ? and inBot = 0 and finish = 0', [$u->info['id']]); } $smt = $u->testAction( '`uid` = "' . $u->info['id'] . '" AND `time`>=' . (time() - 600) . ' AND `vars` = "create_snowball_cp" LIMIT 1', 1 ); if (isset($smt['id'])) { ActionModel::deleteById($smt['id']); } Effects::removeByEffectId($u->info['id'], 24); $u->info['room'] = $go['id']; $u->room = $go; if (!isset($_GET['mAjax'])) { echo ''; } } elseif ($go['destroy'] == 1) { $re = 'Здание было разрушено, в данный момент оно реставрируется'; } else { $re = 'Временно закрыто'; } } else { $re = 'Проход не существует'; } } else { $re = 'Проход не существует'; } // } else { // $re = 'Вам запрещено передвигаться до окончания обучения!!!'; // } } if ($u->info['room'] == 209) { $zv = new FightRequest(); } if ($re != '') { $re = $re . ' '; } if (isset($_GET['mAjax'])) { $tmGo = $u->info['timeGo'] - time() + 1; //сколько секунд осталось $tmGol = $u->info['timeGo'] - $u->info['timeGoL'] + 1; //сколько секунд идти всего if ($tmGo < 0) { $tmGo = 0; } if ($tmGol < 1) { $tmGol = 1; } $playersOnline = Db::getValue( "select count(id) from users where online > unix_timestamp() - 520 and inUser = 0 and no_ip != 'trupojor' and pass != 'saintlucia' and login not like '%(%' and banned = 0 and bot_id = 0" ); $allPlayers = Db::getValue( "select count(id) from users where inUser = 0 and no_ip != 'trupojor' and pass != 'saintlucia' and login not like '%(%' and banned = 0 and bot_id = 0" ); $rowonmax = "Сейчас в клубе: $playersOnline чел."; $rowonmaxc = "Всего в Игре: $allPlayers чел."; if ($u->room['file'] != '') { exit(LocationResponse::init($tmGo, $tmGol, $u->room['file'], $u->room['name'])); } } if (isset($_GET['ajaxHostel'])) { // Для общежития, проверка на лимит положенных предметов в сундук. include_once 'modules_data/location/room_hostel.php'; } ?> room['id'], $rsnow)) { ?> room['id'])) { echo 'Location is lost.'; } else { $tmGo = $u->info['timeGo'] - time() + 1; //сколько секунд осталось $tmGol = $u->info['timeGo'] - $u->info['timeGoL'] + 1; //сколько секунд идти всего if ($tmGo < 0) { $tmGo = 0; } if ($tmGol < 1) { $tmGol = 1; } //онлайн в этой комнате $goLis = '
'; $goline = '
' . $goLis . '
'; $playersOnline = Db::getValue( "select count(id) from users where online > unix_timestamp() - 520 and inUser = 0 and no_ip != 'trupojor' and pass != 'saintlucia' and login not like '%(%' and banned = 0 and bot_id = 0" ); $allPlayers = Db::getValue( "select count(id) from users where inUser = 0 and no_ip != 'trupojor' and pass != 'saintlucia' and login not like '%(%' and banned = 0 and bot_id = 0" ); $rowonmax = '
Сейчас в клубе ' . $playersOnline . ' реальных чел.'; if ($allPlayers > $playersOnline) { $rowonmax .= '
(Общий онлайн: ' . $allPlayers . ' чел.)'; } if ($u->room['file'] != '') { include_once('modules_data/location/' . $u->room['file'] . '.php'); if ((date('m') == 11 || date('m') == 12 || date('m') == 1 || date('m') == 2) && in_array($u->room['id'], $rsnow)) { echo ''; } } }