game/modules_data/_locations.php

576 lines
25 KiB
PHP
Raw Normal View History

2023-01-06 16:24:52 +00:00
<?php
2023-06-23 14:44:24 +00:00
2023-11-05 02:46:07 +00:00
use Core\Config;
2023-06-23 14:44:24 +00:00
use Core\Db;
2023-11-05 02:46:07 +00:00
use Model\ActionModel;
use User\Effects;
2023-06-23 14:44:24 +00:00
2023-01-06 16:24:52 +00:00
if (!defined('GAME')) {
die();
2022-06-06 21:30:34 +00:00
}
2023-11-05 02:46:07 +00:00
/** @var Magic $magic */
2022-06-06 21:30:34 +00:00
$re = '';
2023-08-15 22:48:29 +00:00
$rowonmaxc = '';
2023-01-06 16:24:52 +00:00
if (isset($u->error2)) {
$re = '<b style="color: red;">' . $u->error . '</b>';
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if (isset($_GET['nightatack'])) {
if (
2023-01-10 16:29:32 +00:00
$u->room['name'] == 'Центральная площадь' ||
$u->room['name'] == 'Страшилкина улица' ||
$u->room['name'] == 'Парковая улица' ||
$u->room['name'] == 'Большая парковая улица'
2023-01-06 16:24:52 +00:00
) {
2022-06-06 21:30:34 +00:00
2023-01-06 16:24:52 +00:00
if ($u->room['noatack'] == 0) {
2023-11-05 02:46:07 +00:00
$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']]));
2022-06-06 21:30:34 +00:00
2023-01-06 16:24:52 +00:00
if (isset($ua['id']) && $ua['online'] > time() - 520) {
$usta = $u->getStats($ua['id'], 0);
$minHp = $usta['hpAll'] / 100 * 33;
2022-06-06 21:30:34 +00:00
2023-11-05 02:46:07 +00:00
if ($ua['battle'] > 0 && empty(Db::getValue('select count(id) from battle where id = ? and team_win = -1', [$ua['battle']]))) {
$ua['battle'] = 0;
2023-01-06 16:24:52 +00:00
}
2022-06-06 21:30:34 +00:00
2023-01-06 16:24:52 +00:00
if ($ua['level'] < 8) {
2023-01-10 16:29:32 +00:00
$re = 'Новички находятся под защитой Мироздателя...';
2023-01-06 16:24:52 +00:00
} elseif ($ua['id'] == $u->info['id']) {
2023-01-10 16:29:32 +00:00
$re = 'На себя нападать нельзя...';
2023-01-06 16:24:52 +00:00
} elseif ($u->info['level'] > $ua['level'] + 1) {
2023-01-10 16:29:32 +00:00
$re = 'Вы слишком сильны';
2023-11-05 02:46:07 +00:00
} elseif ($ua['align'] === 9) {
2023-01-10 16:29:32 +00:00
$re = 'Нельзя нападать на городского монста с помощью кнопки напасть!';
2023-11-05 02:46:07 +00:00
} elseif ($wasInThisBattle) {
2023-01-10 16:29:32 +00:00
$re = 'Нельзя вмешаться, вы уже были в этом поединке.';
2023-01-06 16:24:52 +00:00
} elseif ($ua['admin'] == 1 && $u->info['admin'] == 0) {
2023-01-10 16:29:32 +00:00
$re = 'На кого прыгаешь, щенок?';
2023-01-06 16:24:52 +00:00
} 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']
);
2022-06-06 21:30:34 +00:00
2023-01-06 16:24:52 +00:00
if ($u->error == '') {
if ($cruw == 2) {
2023-01-10 16:29:32 +00:00
$rtxt = '[img[items/pal_button9.gif]] &quot;' . $u->info['login'] . '&quot; совершил' . $sx . ' кровавое нападение на персонажа &quot;' . $ua['login'] . '&quot;.';
2023-01-06 16:24:52 +00:00
} else {
2023-01-10 16:29:32 +00:00
$rtxt = '[img[items/pal_button8.gif]] &quot;' . $u->info['login'] . '&quot; совершил' . $sx . ' нападение на персонажа &quot;' . $ua['login'] . '&quot;.';
2023-01-06 16:24:52 +00:00
}
if ($goodt > 0) {
2023-01-28 02:24:37 +00:00
$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);
2023-01-06 16:24:52 +00:00
}
unset($goodt);
header('location: main.php');
die();
}
} else {
if ($ua['room'] != $u->info['room']) {
2023-01-10 16:29:32 +00:00
$u->error = 'Персонаж находится в другой комнате';
2023-01-06 16:24:52 +00:00
} else {
2023-01-10 16:29:32 +00:00
$u->error = 'Персонаж имеет слишком малый уровень жизней.';
2023-01-06 16:24:52 +00:00
}
}
} else {
2023-01-10 16:29:32 +00:00
//На персонажа нельзя напасть
$u->error = 'Персонаж не в игре, либо на нем нет метки';
2023-01-06 16:24:52 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$re = 'Нападать возможно только на улице...';
2023-01-06 16:24:52 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$re = 'Нападения возможны только ночью...';
2023-01-06 16:24:52 +00:00
}
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
function thisInfRm($id, $tp = null, $json = false)
2022-06-06 21:30:34 +00:00
{
$rm = Db::getRow('select * from room where code = ? and city = ?', [$id, 'capitalcity']);
2023-01-10 16:29:32 +00:00
$inf = 'Здание было разрушено';
2023-11-05 02:46:07 +00:00
$rown = 0;
2023-01-06 16:24:52 +00:00
if (isset($rm['id'])) {
$rown = Db::getValue('select count(*) from users where online > unix_timestamp() - 120 and city = ? and room = ?', ['capitalcity', $rm['id']]);
2023-01-06 16:24:52 +00:00
if ($tp == null) {
2023-11-05 02:46:07 +00:00
$inf = '<b>' . $rm['name'] . '</b><br>Сейчас в комнате ' . $rown . ' чел.';
2023-01-06 16:24:52 +00:00
} else {
2023-11-05 02:46:07 +00:00
$inf = $rm['name'] . "\nСейчас в комнате " . $rown . ' чел.';
2023-01-06 16:24:52 +00:00
}
if ($json) {
2023-11-05 02:46:07 +00:00
return [$rm['code'], $rm['name'], $rown];
2023-01-06 16:24:52 +00:00
}
}
if ($json) {
2023-11-05 02:46:07 +00:00
return ['false', $inf, $rown];
2023-01-06 16:24:52 +00:00
}
if ($tp == null) {
echo 'onMouseOver="top.hi(this,\'<div align=right>' . $inf . '</div>\',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;
}
2023-11-05 02:46:07 +00:00
return [];
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if (isset($_GET['loc'])) {
2023-11-05 02:46:07 +00:00
// $training_manager = \DarksLight2\Training\TrainingManager::getInstance();
$go = Db::getRow('select * from room where code = ?', [$_GET['loc']]);
2023-01-06 16:24:52 +00:00
2023-11-05 02:46:07 +00:00
// if (in_array(
// $go['file'], $training_manager->getRegistered()[$training_manager->getCurrentStepName()]->allowedToMove()
// ) || $u->info['admin'] > 0) {
2023-01-06 16:24:52 +00:00
2023-11-05 02:46:07 +00:00
$tr_pl = Db::getValue('select v1 from eff_users where id_eff = 4 and uid = ? order by v1 desc limit 1', [$u->info['id']]);
//Проверяем костыли
2023-11-05 02:46:07 +00:00
$hasKostyl = Db::getValue('select count(id) from items_users where inOdet in (3,14) and item_id in (630, 631) and uid = ?') > 0;
$zadej = 0;
if (isset($tr_pl)) {
if ($hasKostyl) {
if ($tr_pl == 2) {
$zadej = 20;
2023-11-05 02:46:07 +00:00
} elseif ($tr_pl == 3 || $tr_pl == 4) {
$zadej = 30;
}
2023-11-05 02:46:07 +00:00
} else {
$zadej = -1;
$re = 'Вы травмированы. Не возможно с такими увечиями передвигаться без костылей.';
}
}
2023-11-05 02:46:07 +00:00
if ($u->room['extdlg'] > 0) {
header('location: main.php?talk=' . $u->room['extdlg'] . '');
} elseif (isset($zadej) && $zadej == -1) {
if (!isset($re) || $re == '') {
$re = 'У вас травма, нельзя перемещаться...';
}
//Травма...
} elseif ($u->info['align'] == 2 && $go['nochaos'] == 1) {
$re = 'Проход для хаосников закрыт!';
} elseif ($u->info['inTurnir'] > 0) {
$re = 'Вы не можете перемещаться, Вы приняли заявку на турнир ...';
} elseif (
2023-11-05 02:46:07 +00:00
!$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 = '<b style="color: red;">Вы можете перемещаться только когда бодрствуете.</b>';
echo '&nbsp;' . $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) {
2023-11-05 02:46:07 +00:00
$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 = 'Ваша заявка была удалена... Теперь вы можете перейти в другую локацию!';
2023-11-05 02:46:07 +00:00
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) {
2023-01-06 16:24:52 +00:00
//замедление перемешения при травмах
2023-11-05 02:46:07 +00:00
$plus_timeGo = $zadej; // добавочное время при травме
if ($plus_timeGo < 0) {
$plus_timeGo = 0;
}
2023-01-06 16:24:52 +00:00
if (
2023-11-05 02:46:07 +00:00
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;
2023-11-05 02:46:07 +00:00
if (!$hasKostyl) {
$plus_timeGo += 1.5 * 60;
}
}
2023-01-06 16:24:52 +00:00
//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();
2023-11-05 02:46:07 +00:00
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']]
2023-01-06 16:24:52 +00:00
);
2023-11-05 02:46:07 +00:00
Db::sql('update bs_zv set finish = unix_timestamp() where uid = ? and inBot = 0 and finish = 0', [$u->info['id']]);
}
2023-01-06 16:24:52 +00:00
2023-11-05 02:46:07 +00:00
$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 '<script>top.chat.reflesh();</script>';
2023-01-06 16:24:52 +00:00
}
2023-11-05 02:46:07 +00:00
} elseif ($go['destroy'] == 1) {
$re = 'Здание было разрушено, в данный момент оно реставрируется';
2023-01-06 16:24:52 +00:00
} else {
$re = 'Временно закрыто';
2023-01-06 16:24:52 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$re = 'Проход не существует';
2023-01-06 16:24:52 +00:00
}
} else {
$re = 'Проход не существует';
}
2023-11-05 02:46:07 +00:00
// } else {
// $re = 'Вам запрещено передвигаться до окончания обучения!!!';
// }
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if ($u->info['room'] == 209) {
$zv = new FightRequest();
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if ($re != '') {
$re = $re . '&nbsp;';
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if (isset($_GET['mAjax'])) {
2023-01-10 16:29:32 +00:00
$tmGo = $u->info['timeGo'] - time() + 1; //сколько секунд осталось
$tmGol = $u->info['timeGo'] - $u->info['timeGoL'] + 1; //сколько секунд идти всего
2023-01-06 16:24:52 +00:00
if ($tmGo < 0) {
$tmGo = 0;
}
if ($tmGol < 1) {
$tmGol = 1;
}
2023-11-05 02:46:07 +00:00
$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"
2023-01-06 16:24:52 +00:00
);
2023-11-05 02:46:07 +00:00
$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"
2023-01-06 16:24:52 +00:00
);
2023-11-05 02:46:07 +00:00
$rowonmax = "Сейчас в клубе: <b>$playersOnline</b> чел.";
$rowonmaxc = "Всего в Игре: $allPlayers чел.";
2022-06-06 21:30:34 +00:00
2023-01-06 16:24:52 +00:00
if ($u->room['file'] != '') {
2023-11-05 02:46:07 +00:00
exit(LocationResponse::init($tmGo, $tmGol, $u->room['file'], $u->room['name']));
2023-01-06 16:24:52 +00:00
}
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
if (isset($_GET['ajaxHostel'])) { // Для общежития, проверка на лимит положенных предметов в сундук.
2023-11-05 02:46:07 +00:00
include_once 'modules_data/location/room_hostel.php';
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
?>
<svg height="0" xmlns="https://www.w3.org/2000/svg">
<filter id="drop-shadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
<feOffset dx="0" dy="0" result="offsetblur"/>
<feFlood flood-color="rgba(255,255,255,1)"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</svg>
<style>
.MoveLine {
2023-11-05 02:46:07 +00:00
background: url(//img.new-combats.tech/i/move/wait2.gif) 0 0 repeat-y;
2023-01-06 16:24:52 +00:00
height: 6px;
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
.aFilter:hover {
-webkit-filter: drop-shadow(0px 0px 4px rgba(255, 255, 255, 1));
filter: url(#drop-shadow);
}
</style>
2023-11-05 02:46:07 +00:00
<script type="text/javascript" src="/js/jquery.js"></script>
2023-01-06 16:24:52 +00:00
<script>
var speedLoc = 0;
var sLoc1 = 0;
var sLoc2 = 0;
var tgo = 0;
var tgol = 0;
var rgo_url = 0;
var rgo_nm = '';
function locGoLine() {
var line = document.getElementById('MoveLine');
if (line !== undefined) {
prc = 100 - Math.floor(tgo / tgol * 100);
sLoc1 = 64 / 100 * prc;
if (sLoc1 < 0) {
sLoc1 = 0;
}
if (sLoc1 > 64) {
sLoc1 = 64;
}
line.style.width = sLoc1 + 'px';
if (tgo > 0) {
tgo -= 1;
setTimeout('locGoLine()', 100);
} else {
if (rgo_url !== 0) {
location = rgo_url;
}
}
//if( nm != undefined ) {
if ($('#moveto') != null && $('#moveto') != undefined) {
if (rgo_nm != '') {
if ($('#moveto').html() == '') {
$('#moveto').css({'display': '', 'height': 'auto'});
2023-01-10 16:29:32 +00:00
$('#moveto').html('<div onclick="gotoLocationCancel();" style="cursor:pointer;padding:5px;">Вы перейдете в: <b>' + rgo_nm + '</b> (<a onclick="gotoLocationCancel();" href="javascript:void(0)">отмена</a>)</div>');
2023-01-06 16:24:52 +00:00
}
} else {
$('#moveto').css({'display': 'none', 'height': '1px'});
$('#moveto').html('');
}
}
//}
}
}
function goLocal(id, nm) {
rgo_url = id;
rgo_nm = nm;
if ($('#moveto') != null && $('#moveto') != undefined && nm != undefined) {
if (rgo_nm != '') {
$('#moveto').css({'display': '', 'height': 'auto'});
2023-01-10 16:29:32 +00:00
$('#moveto').html('<div onclick="gotoLocationCancel(); return false;" style="cursor:pointer;padding:5px;">Вы перейдете в: <b>' + nm + '</b> (<a onclick="gotoLocationCancel();" href="javascript:void(0)">отмена</a>)</div>');
2023-01-06 16:24:52 +00:00
if (sLoc1 == 64) {
location = rgo_url;
}
} else {
$('#moveto').css({'display': 'none', 'height': '1px'});
$('#moveto').html('');
}
}
}
function gotoLocationCancel() {
rgo_url = 0;
rgo_nm = '';
$('#moveto').css({'display': 'none', 'height': '1px'});
$('#moveto').html('');
}
</script>
<?php
if (date('m') == 11 || date('m') == 12 || date('m') == 1 || date('m') == 2) {
2023-11-05 02:46:07 +00:00
$rsnow = [9, 11, 213, 234, 236, 252, 267, 286, 323,];
if (in_array($u->room['id'], $rsnow)) {
2023-01-06 16:24:52 +00:00
?>
<script>
var no = 50; // snow number
var speed = 17; // smaller number moves the snow faster
var sp_rel = 1.4; //speed relevation
var snowflake1 = "/i/itimeges/snow1.gif";
var snowflake2 = "/i/itimeges/snow2.gif";
var i, doc_width, doc_height;
2022-06-06 21:30:34 +00:00
dx = [];
xp = [];
yp = [];
am = [];
stx = [];
sty = [];
2023-01-06 16:24:52 +00:00
Array.prototype.exists = function (el) {
for (var i = 0; i < this.length; i++)
if (this[i] == el)
return true;
return false;
}
var rooms = ['1.100', '1.107', '1.111', '1.120'];
function SetVariable(c) {
dx[c] = 0; // set coordinate variables
am[c] = Math.random() * 15; // set amplitude variables
xp[c] = Math.random() * (doc_width - 35) + 0 + am[c]; // set position variables
yp[c] = 0;
stx[c] = 0.02 + Math.random() / 10; // set step variables
sty[c] = 0.7 + Math.random(); // set step variables
}
function DrawWeather(room) {
doc_width = document.getElementById('ione').width;
doc_height = document.getElementById('ione').height;
doc_width = 580;
doc_height = 312;
var div = '';
for (i = 0; i < no; ++i) {
SetVariable(i);
2023-01-10 16:29:32 +00:00
div += "<div id=\"dot" + i + "\" style=\"POSITION: absolute; Z-INDEX: 30" + i + "; VISIBILITY: visible; TOP: " + 0 + "px; LEFT: " + 0 + "px;\"><img id=\"im" + i + "\" src=\"" + (sty[i] < sp_rel ? snowflake2 : snowflake1) + "\" border=\"0\" alt=\"Снежинка\"></div>";
2023-01-06 16:24:52 +00:00
}
document.getElementById('snow').innerHTML = div;
return 1;
}
function WeatherBegin() { // IE main animation function
for (i = 0; i < no; ++i) { // iterate for every dot
yp[i] += sty[i] < sp_rel ? sty[i] / 2 : sty[i];
if (yp[i] > doc_height - 40) {
SetVariable(i);
var im = document.getElementById('im' + i);
im.src = (sty[i] < sp_rel) ? snowflake2 : snowflake1;
}
dx[i] += stx[i];
document.getElementById('dot' + i).style.top = yp[i] + 'px';
document.getElementById('dot' + i).style.left = xp[i] + am[i] * Math.sin(dx[i]) + 'px';
}
setTimeout('WeatherBegin()', speed);
}
</script>
<?php
}
2022-06-06 21:30:34 +00:00
}
2023-01-06 16:24:52 +00:00
if (isset($u->room['id'])) {
2023-01-10 16:29:32 +00:00
$tmGo = $u->info['timeGo'] - time() + 1; //сколько секунд осталось
$tmGol = $u->info['timeGo'] - $u->info['timeGoL'] + 1; //сколько секунд идти всего
2023-01-06 16:24:52 +00:00
if ($tmGo < 0) {
$tmGo = 0;
}
if ($tmGol < 1) {
$tmGol = 1;
}
2023-01-10 16:29:32 +00:00
//онлайн в этой комнате
2023-01-06 16:24:52 +00:00
$goLis = '<table height="15" border="0" cellspacing="0" cellpadding="0">
2022-06-06 21:30:34 +00:00
<tr>
<td id="locobobr" rowspan="3" valign="bottom"><a href="main.php?rnd=' . $code . '"><img style="display:block;" src="//img.new-combats.tech/i/move/rel_1.gif" width="15" height="16" title="Обновить" border="0" /></a></td>
<td colspan="3"><img style="display:block;" src="//img.new-combats.tech/i/move/navigatin_462s.gif" width="80" height="4" /></td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
<td><img style="display:block;" src="//img.new-combats.tech/i/move/navigatin_481.gif" width="9" height="8" /></td>
<td width="64" bgcolor="black"><img src="//img.new-combats.tech/1x1.gif" style="display:block;" id="MoveLine" height="8" class="MoveLine" style="width:33px;" /></td>
<td><img style="display:block;" src="//img.new-combats.tech/i/move/navigatin_50.gif" width="7" height="8" /></td>
2022-06-06 21:30:34 +00:00
</tr>
<tr>
<td colspan="3"><img style="display:block;" src="//img.new-combats.tech/i/move/navigatin_tt1_532.gif" width="80" height="4" /></td>
2022-06-06 21:30:34 +00:00
</tr>
</table>
2023-01-06 16:24:52 +00:00
<div id="test"></div><script>var tgo = ' . ($tmGo * 10) . '; var tgol = ' . ($tmGol * 10) . ';locGoLine();</script>';
2023-11-05 02:46:07 +00:00
$goline = '<div style="position:absolute; top:0; z-index:101; right:12px; width:80px;">' . $goLis . '</div>';
$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"
2023-01-06 16:24:52 +00:00
);
2023-11-05 02:46:07 +00:00
$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"
2023-01-06 16:24:52 +00:00
);
2023-11-05 02:46:07 +00:00
$rowonmax = '<br><span style="font-size:14px;">Сейчас в клубе<b> ' . $playersOnline . '</b> реальных чел.</span>';
if ($allPlayers > $playersOnline) {
$rowonmax .= '<br><small>(Общий онлайн: ' . $allPlayers . ' чел.)</small>';
2023-01-06 16:24:52 +00:00
}
2023-11-05 02:46:07 +00:00
2023-01-06 16:24:52 +00:00
if ($u->room['file'] != '') {
include_once('modules_data/location/' . $u->room['file'] . '.php');
2023-11-05 02:46:07 +00:00
if ((date('m') == 11 || date('m') == 12 || date('m') == 1 || date('m') == 2) && in_array($u->room['id'], $rsnow)) {
2023-01-06 16:24:52 +00:00
echo '<script>DrawWeather(31);WeatherBegin();</script>';
}
}
} else {
echo 'Location is lost.';
2022-06-06 21:30:34 +00:00
}