578 lines
26 KiB
PHP
578 lines
26 KiB
PHP
<style>
|
||
/* Paste this css to your style sheet file or under head tag */
|
||
/* This only works with JavaScript,
|
||
if it's not present, don't show loader */
|
||
.no-js #loader {
|
||
display: none;
|
||
}
|
||
|
||
.js #loader {
|
||
display: block;
|
||
position: absolute;
|
||
left: 100px;
|
||
top: 0;
|
||
}
|
||
|
||
.se-pre-con {
|
||
position: fixed;
|
||
left: 0;
|
||
top: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
z-index: 9999;
|
||
background: url(default.gif) center no-repeat #e2e0e1;
|
||
}
|
||
|
||
</style>
|
||
<link href="/img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
|
||
<link rel="stylesheet" href="/css/training/modal.css">
|
||
<div class="se-pre-con" id="se-pre-con"></div>
|
||
|
||
<?php
|
||
|
||
|
||
if (!defined('GAME_VERSION')) {
|
||
require_once '_incl_data/autoload.php';
|
||
}
|
||
|
||
use Core\{Config, Database, Db};
|
||
use DarksLight2\Training\TrainingManager;
|
||
|
||
function var_info($vars, $d = false)
|
||
{
|
||
echo "<pre style='border: 1px solid gray;border-radius: 5px;padding: 3px 6px;background: #cecece;color: black;font-family: Arial;font-size: 12px;'>\n";
|
||
var_dump($vars);
|
||
echo "</pre>\n";
|
||
if ($d) {
|
||
exit();
|
||
}
|
||
}
|
||
|
||
Config::init();
|
||
Database::init();
|
||
define('IP', UserIp::get());
|
||
|
||
$magic = new Magic();
|
||
$u = User::start();
|
||
$filter = new Filter();
|
||
$q = new Quests;
|
||
|
||
$training_manager = TrainingManager::getInstance($u->info['id']);
|
||
|
||
/** Восстанавливаем всем ботам, которые не в бою здоровье до максимума. */
|
||
Db::exec(
|
||
'update stats set hpNow = hpAll, mpNow = mpAll
|
||
where id in (select id from users where bot = 2 and battle = 0)'
|
||
);
|
||
|
||
if ($u->info['banned'] > 0) {
|
||
header('location: /index.php');
|
||
die();
|
||
}
|
||
|
||
$tjs = '';
|
||
|
||
if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
|
||
unset($_GET, $_POST);
|
||
}
|
||
|
||
#--------для общаги, и позже для почты
|
||
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
|
||
if ($u->room['file'] != "room_hostel" && $u->room['file'] != "an/room_hostel" && $sleep['id'] > 0) {
|
||
mysql_query('UPDATE `actions` SET `vars` = "unsleep" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1');
|
||
}
|
||
if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
|
||
$trololo = 0;
|
||
} else {
|
||
$trololo = 1;
|
||
}
|
||
|
||
#--------для общаги, и позже для почты
|
||
if ($u->info['online'] < time() - 60 || $u->info['afk'] != '') {
|
||
$filter->setOnline($u->info['8'], $u->info['id']);
|
||
mysql_query(
|
||
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
|
||
) . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
|
||
);
|
||
} elseif ($u->info['timeMain'] < time() - 60 || $u->info['afk'] != '') {
|
||
mysql_query(
|
||
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
|
||
) . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
|
||
);
|
||
}
|
||
|
||
if (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']) || $u->info['banned'] > 0) {
|
||
die(Config::get('exit'));
|
||
}
|
||
|
||
//Показываем системку и заносим данные
|
||
if ($u->info['battle_text'] != '' && $u->info['last_b'] > 0) {
|
||
mysql_query(
|
||
'INSERT INTO `battle_last` (`battle_id`,`uid`,`time`,`act`,`level`,`align`,`clan`,`exp`) VALUES ("' . $u->info['last_b'] . '","' . $u->info['id'] . '","' . time(
|
||
) . '","' . $u->info['last_a'] . '","' . $u->info['level'] . '","' . $u->info['align'] . '","' . $u->info['clan'] . '","' . $u->info['exp'] . '")'
|
||
);
|
||
}
|
||
|
||
if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
|
||
echo '<!DOCTYPE html>
|
||
<div style="padding-top:0; margin-top:7px; height:100%; background-color:#e2e0e1;">';
|
||
}
|
||
$act = -2;
|
||
$act2 = 0;
|
||
$u->stats = $u->getStats($u->info['id'], 0);
|
||
$u->aves = $u->ves(null);
|
||
if (!isset($u->stats['act'])) {
|
||
$u->stats['act'] = 0;
|
||
}
|
||
if ($u->stats['act'] == 1) {
|
||
$act = 1;
|
||
}
|
||
$u->rgd = $u->regen($u->info['id'], 0, 0);
|
||
|
||
//Проверка уровня
|
||
$ul = $u->testLevel();
|
||
|
||
if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] != $u->info['id']) {
|
||
if ($u->room['noatack'] == 0) {
|
||
$ua = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`clan` FROM `users` WHERE`id` = "' . mysql_real_escape_string(
|
||
$_GET['atak_user']
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
$cruw = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`type` FROM `clan_wars` WHERE
|
||
((`clan1` = "' . $ua['clan'] . '" AND `clan2` = "' . $u->info['clan'] . '") OR (`clan2` = "' . $ua['clan'] . '" AND `clan1` = "' . $u->info['clan'] . '")) AND
|
||
`time_finish` > ' . time() . ' LIMIT 1'
|
||
)
|
||
);
|
||
unset($ua);
|
||
if (isset($cruw['id'])) {
|
||
$cruw = $cruw['type'];
|
||
} else {
|
||
$cruw = 0;
|
||
}
|
||
|
||
$ua = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `s`.*,`u`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `s`.`id` = `u`.`id` WHERE (`s`.`atack` > "' . time(
|
||
) . '" OR `s`.`atack` = 1 OR 1 = ' . $cruw . ' OR 2 = ' . $cruw . ') AND `s`.`id` = "' . mysql_real_escape_string(
|
||
$_GET['atak_user']
|
||
) . '" LIMIT 1'
|
||
)
|
||
);
|
||
$check = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'
|
||
)
|
||
);
|
||
$check2 = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `eff_users` WHERE `id_eff` = 479 AND `uid` = "' . $ua['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'
|
||
)
|
||
);
|
||
$test = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id` FROM `battle_last` WHERE `uid` = "' . $u->info['id'] . '" AND `battle_id` = "' . $ua['battle'] . '" LIMIT 1'
|
||
)
|
||
);
|
||
if ($ua['no_ip'] == 'trupojor' && $ua['level'] == 9 && $u->info['level'] > 9) {
|
||
$u->error = 'Нельзя нападать на монстра этого уровня!';
|
||
} elseif ($ua['no_ip'] == 'trupojor' && $ua['level'] == 10 && $u->info['level'] < 10) {
|
||
$u->error = 'Нельзя нападать на монстра этого уровня!';
|
||
} elseif ($ua['no_ip'] != 'trupojor' && $ua['level'] != $u->info['level']) {
|
||
$u->error = 'Нападать можно на персонажей только своего уровня!';
|
||
} elseif (isset($test['id'])) {
|
||
$u->error = 'Нельзя вмешаться, вы уже были в этом поединке.';
|
||
} elseif ($ua['no_ip'] == 'trupojor' && isset($check['id'])) {
|
||
$u->error = 'Нельзя нападать на монстра чаще одного раза в 3 часа!';
|
||
} elseif (isset($check2['id'])) {
|
||
$u->error = 'Персонаж имеет защиту от нападения!';
|
||
} elseif (isset($ua['id']) && $ua['online'] > time() - 520) {
|
||
$usta = $u->getStats($ua['id'], 0); // статы цели
|
||
$minHp = floor($usta['hpAll'] / 100 * 33); // минимальный запас здоровья цели при котором можно напасть
|
||
|
||
if ($ua['battle'] > 0) {
|
||
$uabt = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT * FROM `battle` WHERE `id` = "' . $ua['battle'] . '" AND `team_win` = "-1" LIMIT 1'
|
||
)
|
||
);
|
||
if (!isset($uabt['id'])) {
|
||
$ua['battle'] = 0;
|
||
}
|
||
}
|
||
|
||
if ($ua['battle'] == 0 && $minHp > $usta['hpNow']) {
|
||
$u->error = 'Нельзя напасть, у противника не восстановилось здоровье';
|
||
} elseif (isset($uabt['id']) && $uabt['type'] == 500 && $ua['team'] == 1) {
|
||
$u->error = 'Нельзя сражаться на стороне монстров!';
|
||
} elseif (isset($uabt['id']) && $uabt['invis'] > 0) {
|
||
$u->error = 'Нельзя вмешиваться в невидимый бой!';
|
||
} elseif ($magic->testTravma($ua['id'], 3)) {
|
||
$u->error = 'Противник тяжело травмирован, нельзя напасть!';
|
||
} elseif ($magic->testTravma($u->info['id'], 2)) {
|
||
$u->error = 'Вы травмированы, нельзя напасть!';
|
||
} elseif ($ua['room'] == $u->info['room'] && ($minHp <= $usta['hpNow'] || $ua['battle'] > 0)) {
|
||
if ($ua['type_pers'] == 0) {
|
||
if ($cruw == 2) {
|
||
$ua['type_pers'] = 99;
|
||
} else {
|
||
$ua['type_pers'] = 50;
|
||
}
|
||
}
|
||
if ($ua['no_ip'] == 'trupojor') {
|
||
$ua['type_pers'] = 500;
|
||
}
|
||
|
||
mysql_query(
|
||
'UPDATE `stats` SET `hpNow` = "' . $usta['hpNow'] . '",`mpNow` = "' . $usta['mpNow'] . '" WHERE `id` = "' . $usta['id'] . '" LIMIT 1'
|
||
);
|
||
|
||
$goodt = $magic->atackUser(
|
||
$u->info['id'], $ua['id'], $ua['team'], $ua['battle'], $ua['bbexp'], $ua['type_pers']
|
||
);
|
||
|
||
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) {
|
||
$chatDto = new ChatMessage();
|
||
$chatDto->setCity($u->info['city']);
|
||
$chatDto->setRoom($u->info['room']);
|
||
$chatDto->setText($rtxt);
|
||
$chatDto->setType(6);
|
||
$chatDto->setTypeTime(1);
|
||
(new Chat())->sendMsg($chatDto);
|
||
}
|
||
unset($goodt);
|
||
header('location: main.php');
|
||
die();
|
||
} else {
|
||
if ($ua['room'] != $u->info['room']) {
|
||
//Персонаж в другой комнате
|
||
$u->error = 'Персонаж находится в другой комнате';
|
||
} else {
|
||
$u->error = 'Персонаж имеет слишком малый уровень жизней.';
|
||
}
|
||
}
|
||
} else {
|
||
//На персонажа нельзя напасть
|
||
$u->error = 'Персонаж не в игре, либо на нем нет метки';
|
||
}
|
||
} else {
|
||
$u->error = 'Вам запрещается атаковать без разрешения...';
|
||
}
|
||
}
|
||
|
||
if ($ul == 1) {
|
||
$act = 1;
|
||
}
|
||
|
||
/*-----------------------*/
|
||
if ($u->info['battle'] == 0) {
|
||
$btl_last = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'
|
||
)
|
||
);
|
||
}
|
||
if (isset($btl_last['id']) && $u->info['battle'] == 0) {
|
||
require_once('modules_data/btl_.php');
|
||
|
||
$u->info['battle_lsto'] = true;
|
||
} elseif ($u->info['battle'] == 0) {
|
||
//Проверка/Снятие предметов
|
||
if (!isset($sleep['id'])) {
|
||
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
|
||
}
|
||
if ($act2 != -2 && $act == -2) {
|
||
$act = $act2;
|
||
}
|
||
|
||
if ($u->room['block_all'] != 0) {
|
||
unset($_GET['inv'], $_GET['skills'], $_GET['anketa']);
|
||
}
|
||
|
||
if (!isset($u->tfer['id']) && $u->room['block_all'] == 0) {
|
||
//Одеть/снять предмет
|
||
if (isset($_GET['rstv']) && isset($_GET['inv'])) {
|
||
$u->freeStatsMod($_GET['rstv'], $_GET['mf'], $u->info['id']);
|
||
} elseif (isset($_GET['ufs2']) && isset($_GET['inv'])) {
|
||
$u->freeStats2Item($_GET['itmid'], $_GET['ufs2'], $u->info['id'], 1);
|
||
} elseif (isset($_GET['ufs2mf']) && isset($_GET['inv'])) {
|
||
$u->freeStats2Item($_GET['itmid'], $_GET['ufs2mf'], $u->info['id'], 2);
|
||
} elseif (isset($_GET['ufsmst']) && isset($_GET['inv'])) {
|
||
$u->itemsSmSave($_GET['itmid'], $_GET['ufsmst'], $u->info['id']);
|
||
} elseif (isset($_GET['ufsms']) && isset($_GET['inv'])) {
|
||
$u->itemsSmSave($_GET['itmid'], $_GET['ufsms'] + 100, $u->info['id']);
|
||
} elseif (isset($_GET['ufs']) && isset($_GET['inv'])) {
|
||
$u->freeStatsItem($_GET['itmid'], $_GET['ufs'], $u->info['id']);
|
||
} elseif (isset($_GET['sid']) && isset($_GET['inv'])) {
|
||
$act = $u->snatItem($_GET['sid'], $u->info['id']);
|
||
} elseif (isset($_GET['oid']) && isset($_GET['inv'])) {
|
||
$act = $u->odetItem($_GET['oid'], $u->info['id']);
|
||
} elseif (isset($_GET['item_rune']) && isset($_GET['inv'])) {
|
||
$u->runeItem(null);
|
||
} elseif (isset($_GET['remitem'], $_GET['inv'])) {
|
||
$act = $u->snatItemAll($u->info['id']);
|
||
} elseif (isset($_GET['delete']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) {
|
||
if ($u->info['allLock'] < time()) {
|
||
$u->deleteItem(intval($_GET['delete']), $u->info['id']);
|
||
} else {
|
||
echo '<script>setTimeout(function(){alert("Вам запрещено удалять предметы до ' . date(
|
||
'd.m.y H:i', $u->info['allLock']
|
||
) . '")},250);</script>';
|
||
}
|
||
} elseif (isset($_GET['unstack']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) {
|
||
$u->unstack(intval($_GET['unstack']), intval($_GET['unstackCount']));
|
||
} elseif (isset($_GET['stack']) && isset($_GET['inv'])) {
|
||
$u->stack($_GET['stack']);
|
||
} elseif (isset($_GET['end_qst_now'])) {
|
||
$q->endq((int)$_GET['end_qst_now'], 'end');
|
||
}
|
||
//Использовать эффект
|
||
if (isset($_GET['use_pid'])) {
|
||
$magic->useItems((int)$_GET['use_pid']);
|
||
}
|
||
} else {
|
||
if ($u->room['block_all'] > 0) {
|
||
$u->error = 'В данной локации запрещено пользоваться чем-либо...';
|
||
}
|
||
}
|
||
}
|
||
|
||
if ($magic->youuse > 0) {
|
||
$act = 1;
|
||
}
|
||
//Получение статов
|
||
if ($act != -2) {
|
||
$u->stats = $u->getStats($u->info['id'], 0, 1);
|
||
$u->aves = $u->ves(null);
|
||
if (!isset($sleep['id'])) {
|
||
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
|
||
}
|
||
if ($act2 != -2 && $act == -2) {
|
||
$act = $act2;
|
||
}
|
||
}
|
||
|
||
/*-----------------------*/
|
||
if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('modules_data/_changepass.php');
|
||
} elseif (isset($_GET['friends']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_friends.php');
|
||
} elseif (($u->info['admin'] > 0 || $u->info['level'] > 7 || $u->info['align'] == 50) && isset($_GET['notepad']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/notepad.php');
|
||
} elseif ((($u->info['align'] > 1 && $u->info['align'] < 2) || $u->info['admin'] > 0) && isset($_GET['light']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_mod.php');
|
||
} elseif ((($u->info['align'] > 3 && $u->info['align'] < 4) || $u->info['admin'] > 0) && isset($_GET['dark']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_mod.php');
|
||
} elseif (isset($_GET['admin']) && $u->info['admin'] > 0) {
|
||
require_once('modules_data/_mod.php');
|
||
} elseif (isset($_GET['vip']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/vip.php');
|
||
} elseif ((isset($_GET['zayvka']) && $u->info['battle'] == 0) || (isset($_GET['zayvka']) && ($_GET['r'] == 6 || $_GET['r'] == 7 || !isset($_GET['r'])) && $u->info['battle'] > 0) && !isset($u->tfer['id'])) {
|
||
if ($u->room['zvsee'] == 1) {
|
||
require_once('modules_data/_zv2.php');
|
||
} else {
|
||
require_once('modules_data/_zv.php');
|
||
}
|
||
} elseif (isset($_GET['alh']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_alh.php');
|
||
} elseif ($u->info['clan'] > 0 && isset($_GET['clan']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_clan.php');
|
||
} elseif (isset($_GET['alhp']) && ($u->info['admin'] == 1 || $u->info['align'] == 50 || $u->info['align2'] == 50) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_alhp.php');
|
||
//Панель букмекера
|
||
} elseif (isset($_GET['bukmeker']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_bukmeker.php');
|
||
//Панель светлого
|
||
} elseif ($u->info['align'] >= 1 && $u->info['align'] < 2 && isset($_GET['1_panel']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/1_panel.php');
|
||
//Панель темного
|
||
} elseif ($u->info['align'] >= 3 && $u->info['align'] < 4 && isset($_GET['3_panel']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/3_panel.php');
|
||
//Панель темного
|
||
} elseif ($u->info['align'] >= 7 && $u->info['align'] < 8 && isset($_GET['7_panel']) && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/7_panel.php');
|
||
} elseif ($u->info['battle'] != 0) {
|
||
//поединок
|
||
if ((!isset($btl_last['id']) || $u->info['battle'] > 0) && !isset($u->info['battle_lsto'])) {
|
||
require_once('modules_data/btl_.php');
|
||
echo '<script type="text/javascript" src="js/onlineList.js"></script>';
|
||
}
|
||
|
||
} else {
|
||
if (isset($_GET['talk']) && !isset($u->tfer['id'])) {
|
||
echo "
|
||
<script language='JavaScript'>
|
||
var elem = document.getElementById('se-pre-con');
|
||
elem.parentNode.removeChild(elem);
|
||
</script>
|
||
";
|
||
if ($u->info['dnow'] > 0) {
|
||
$d = new Dungeon;
|
||
$d->start();
|
||
}
|
||
require_once('modules_data/_dialog.php');
|
||
} elseif (isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('modules_data/_inv.php');
|
||
} elseif (isset($_GET['add_eff']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('modules_data/add_eff.php');
|
||
} elseif (isset($_GET['referals']) && $trololo == 1 && !isset($u->tfer['id'])) {
|
||
require_once('modules_data/_ref.php');
|
||
} elseif (isset($_GET['obraz']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('modules_data/_obraz.php');
|
||
} elseif (isset($_GET['skills']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('modules_data/_umenie.php');
|
||
} elseif ((isset($_GET['transfer']) || isset($u->tfer['id'])) && $u->info['level'] >= Config::get(
|
||
'level_ransfer'
|
||
) && $trololo == 1 && $u->info['inTurnir'] == 0 && $u->info['inTurnirnew'] == 0) {
|
||
if ($u->info['allLock'] > time()) {
|
||
require_once('modules_data/_locations.php');
|
||
echo '<script>setTimeout(function(){alert("Вам запрещены передачи до ' . date(
|
||
'd.m.y H:i', $u->info['allLock']
|
||
) . '")},250);</script>';
|
||
} else {
|
||
require_once('modules_data/_transfers.php');
|
||
}
|
||
} elseif (isset($_GET['anketa']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||
require_once('settings.php');
|
||
} elseif (isset($_GET['newanimal']) && $trololo == 1) {
|
||
require_once('modules_data/_newanimal.php');
|
||
} elseif (isset($_GET['act_trf']) && $u->room['block_all'] == 0) {
|
||
require_once('modules_data/act_trf.php');
|
||
} elseif (isset($_GET['titul']) && $u->room['block_all'] == 0) {
|
||
require_once('modules_data/titul.php');
|
||
} elseif (!isset($u->tfer['id'])) {
|
||
require_once('modules_data/_locations.php');
|
||
}
|
||
}
|
||
|
||
//Проверяем квесты на готовность
|
||
if (in_array(
|
||
$u->room['file'],
|
||
['dungeon_enter', 'dungeon_enter_all', 'enterbezdna', 'entercat', 'enterdrago', 'entergrib', 'enternizin', 'enterptp', 'house_belaun', 'dungeon']
|
||
)) {
|
||
$q->testquest();
|
||
}
|
||
|
||
$iloc = '';
|
||
$iloce = '';
|
||
$sp = Db::getRows(
|
||
'select * from items_local where (room = ? or room = -1) and `delete` = 0 and user_take = 0 and tr_login = ?',
|
||
[$u->info['room'], $u->info['login']]
|
||
);
|
||
foreach ($sp as $pl) {
|
||
$itmo = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = ' . $pl['item_id']));
|
||
if (isset($itmo['id'])) {
|
||
$tk = 1;
|
||
$glid = 0;
|
||
//
|
||
if ($pl['room'] != -1 && $pl['room'] != $u->info['room']) {
|
||
if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
|
||
$iloce = 'Вы находитесь в другой комнате...';
|
||
}
|
||
$tk = 0;
|
||
} elseif ($pl['tr_login'] != '0' && $pl['tr_login'] != $u->info['login']) {
|
||
if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
|
||
$iloce = 'Данный предмет для другого персонажа...';
|
||
}
|
||
$tk = 0;
|
||
} elseif ($pl['tr_sex'] != -1 && $pl['tr_sex'] != $u->info['sex']) {
|
||
if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
|
||
$iloce = 'Данный предмет для противоположного пола...';
|
||
}
|
||
$tk = 0;
|
||
}
|
||
if ($pl['time'] + 86400 < time()) {
|
||
//Не успели поднять
|
||
$glid = 1;
|
||
mysql_query(
|
||
'UPDATE `items_local` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||
);
|
||
} elseif (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
|
||
//
|
||
if ($u->info['battle'] > 0 && $tk == 1) {
|
||
$iloce = 'Вы не можете поднять предмет, завершите поединок...';
|
||
} elseif ($tk == 1) {
|
||
$iloce = 'Вы успешно подняли предмет "' . $itmo['name'] . '" в локации "' . $u->room['name'] . '".';
|
||
mysql_query(
|
||
'UPDATE `items_local` SET `delete` = "' . time(
|
||
) . '" , `user_take` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||
);
|
||
//выдаем предмет
|
||
$glid = 1;
|
||
if ($pl['data'] == '0') {
|
||
$u->addItem(
|
||
$pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room']
|
||
);
|
||
} else {
|
||
$u->addItem(
|
||
$pl['item_id'], $u->info['id'],
|
||
'|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data']
|
||
);
|
||
}
|
||
}
|
||
}
|
||
if ($glid == 0) {
|
||
if ($tk == 1 && $pl['tr_login'] == '0') {
|
||
$tk = 2;
|
||
}
|
||
$iloc .= '<a class="tolobf' . $tk . '" href="main.php?take_loc_item=' . $pl['id'] . '" target="main"><div class="outer"><div class="middle"><div class="inner">' . '<img title="Забрать "' . $itmo['name'] . '"';
|
||
if ($pl['tr_login']) {
|
||
$iloc .= '\n' . 'Предмет для игрока "' . $pl['tr_login'] . '"';
|
||
} elseif ($pl['tr_sex'] == 0) {
|
||
$iloc .= '\n' . 'Предмет для мужчин';
|
||
} elseif ($pl['tr_sex'] == 1) {
|
||
$iloc .= '\n' . 'Предмет для женщин';
|
||
} else {
|
||
$iloc .= '\n' . 'Предмет может подобрать каждый';
|
||
}
|
||
$iloc .= '" src="https://img.new-combats.com/i/items/' . $itmo['img'] . '">' . '</div></div></div></a> ';
|
||
}
|
||
} else {
|
||
echo '[!]';
|
||
}
|
||
unset($tk, $itmo);
|
||
}
|
||
|
||
if ($iloc != '') {
|
||
if ($iloce != '') {
|
||
$iloc = '<div style="padding:10px;"><font color=red>' . $iloce . '</font></div>' . $iloc;
|
||
}
|
||
$iloc = '<style>' . '.tolobf0 { display:inline-block; width:80px; height:80px; background-color:#e5e5e5; text-align:center; }.tolobf0:hover { background-color:#d5d5d5; text-align:center; }.tolobf2 { display:inline-block; width:80px; height:80px; background-color:#FFD700; text-align:center; }.tolobf2:hover { background-color:#DAA520; text-align:center; }.tolobf1 { display:inline-block; width:80px; height:80px; background-color:#d5d5e5; text-align:center; }.tolobf1:hover { background-color:#d5d5d5; text-align:center; }.outer { display: table; position: absolute; height: 80px; width: 80px;}.middle { display: table-cell; vertical-align: middle;}.inner { margin-left: auto; margin-right: auto; width: 80px; }' . '</style>' . '<h3>В комнате разбросаны предметы</h3>' . $iloc;
|
||
$tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'' . $iloc . '\' );';
|
||
} else {
|
||
$tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'\' );';
|
||
}
|
||
|
||
unset($iloc, $iloce);
|
||
/*-----------------------*/
|
||
$spl = mysql_fetch_array(
|
||
mysql_query(
|
||
'SELECT `exp` FROM `levels` WHERE `nextLevel` = "' . ($u->info['level'] + 1) . '" ORDER BY `exp` ASC LIMIT 1'
|
||
)
|
||
);
|
||
$spl = $spl['exp'];
|
||
echo '<script>top.myexpLineTop27(' . $u->info['exp'] . ',' . $spl . ');' . $tjs . 'top.ctest("' . $u->info['city'] . '");top.sd4key="' . $u->info['nextAct'] . '"; var battle = ' . (0 + $u->info['battle']) . '; top.hic();</script></body>
|
||
</html>';
|
||
|
||
$training_manager->render();
|
||
?>
|
||
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js"></script>-->
|
||
<script>
|
||
//Loader
|
||
// Wait for window load
|
||
$(window).load(function () {
|
||
// Animate loader off screen
|
||
$(".se-pre-con").fadeOut(100);
|
||
});
|
||
</script>
|