WIP: перед введенимем класса Fighter.php

This commit is contained in:
2024-01-06 00:14:35 +02:00
parent 07f905ef64
commit a2c658166d
67 changed files with 5555 additions and 7135 deletions
+208 -206
View File
@@ -7,49 +7,7 @@ use Core\{Config, Database, Db};
use User\ItemsModel;
use User\UserIp;
?>
<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;
}
pre {
border: 1px solid gray;
border-radius: 5px;
padding: 3px 6px;
background: #cecece;
color: black;
font-family: Arial, sans-serif;
font-size: 12px;
}
</style>
<link href="<?= Config::img() ?>/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
function var_info($vars, $d = false)
function var_info($vars, $d = false): void
{
echo "<pre>\n";
var_dump($vars);
@@ -72,7 +30,7 @@ $code = PassGen::intCode(); //для ссылок вида ?rnd=XXXXXX, врод
/** Восстанавливаем всем ботам, которые не в бою здоровье до максимума. */
Db::sql(
'update stats set hpNow = hpAll, mpNow = mpAll where id in (select id from users where bot = 2 and battle = 0)'
'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) {
@@ -99,12 +57,12 @@ if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
if (($u->info['online'] < time() - 60 || $u->info['afk'] != '')) {
$filter->setOnline(0, $u->info['id']);
Db::sql(
'update users set online = unix_timestamp(), timeMain = unix_timestamp(), afk = ? where id = ?',
'update users set online = unix_timestamp(), timemain = unix_timestamp(), afk = ? where id = ?',
['', $u->info['id']]
);
} elseif ($u->info['timeMain'] < time() - 60 || $u->info['afk'] != '') {
Db::sql(
'update users set online = unix_timestamp(), timeMain = unix_timestamp(), afk = ? where id = ?',
'update users set online = unix_timestamp(), timemain = unix_timestamp(), afk = ? where id = ?',
['', $u->info['id']]
);
}
@@ -129,10 +87,6 @@ if ($u->info['battle_text'] != '' && $u->info['last_b'] > 0) {
);
}
if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
echo '<!DOCTYPE html>
<div style="padding-top:0; margin-top:17px; /*height:100%;*/ background-color:#e2e0e1;">';
}
$act = -2;
$act2 = 0;
$u->stats = $u->getStats($u->info['id'], 0);
@@ -176,11 +130,11 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] !
]
);
$check = Db::getValue(
'select id from eff_users where id_eff = 478 and uid = ? and `delete` = 0 order by overType desc limit 1',
'select id from eff_users where id_eff = 478 and uid = ? and `delete` = 0 order by overtype desc limit 1',
[$u->info['id']]
);
$check2 = Db::getValue(
'select id from eff_users where id_eff = 479 and uid = ? and `delete` = 0 order by overType desc limit 1',
'select id from eff_users where id_eff = 479 and uid = ? and `delete` = 0 order by overtype desc limit 1',
[$ua['id']]
);
$check3 = Db::getValue(
@@ -234,7 +188,8 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] !
}
Db::sql(
'update stats set hpNow = ?, mpNow = ? where id = ?', [
'update stats set hpnow = ?, mpnow = ? where id = ?',
[
$usta['hpNow'],
$usta['mpNow'],
$usta['id'],
@@ -292,70 +247,6 @@ if ($u->info['battle'] == 0) {
'select id, battle from battle_users where uid = ? and finish = 0 limit 1', [$u->info['id']]
);
}
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;
@@ -372,90 +263,6 @@ if ($act != -2) {
}
}
/*-----------------------*/
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 (isset($_GET['moderation'])) {
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'])
) {
require_once('modules_data/_zv.php');
} elseif (isset($_GET['alh']) && !isset($u->tfer['id'])) {
require_once('modules_data/_alh.php');
} elseif (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) && !isset($u->tfer['id'])) {
require_once('modules_data/_alhp.php'); //Панель алхимиков
} elseif ($u->info['align'] > 0 && !isset($u->tfer['id']) && !empty($_GET['ap'])) {
require_once('modules_data/alignPanel.php'); //Панель склонностей, GET чтобы вызывать по ссылке.
} 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>document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));</script>";
if ($u->info['dnow'] > 0) {
$d = new Dungeon;
}
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'],
@@ -547,12 +354,209 @@ foreach ($sp as $pl) {
</a>
HTML;
}
} else {
echo '[!]';
}
unset($tk, $itmo);
}
$spl = Db::getValue('select exp from levels where nextlevel = ? order by exp limit 1', [$u->info['level'] + 1]);
?>
<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;
}
pre {
border: 1px solid gray;
border-radius: 5px;
padding: 3px 6px;
background: #cecece;
color: black;
font-family: Arial, sans-serif;
font-size: 12px;
}
</style>
<link href="<?= Config::img() ?>/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 (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
echo '<!DOCTYPE html>
<div style="padding-top:0; margin-top:17px; /*height:100%;*/ background-color:#e2e0e1;">';
}
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 (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 (isset($_GET['moderation'])) {
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'])
) {
require_once('modules_data/_zv.php');
} elseif (isset($_GET['alh']) && !isset($u->tfer['id'])) {
require_once('modules_data/_alh.php');
} elseif (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) && !isset($u->tfer['id'])) {
require_once('modules_data/_alhp.php'); //Панель алхимиков
} elseif ($u->info['align'] > 0 && !isset($u->tfer['id']) && !empty($_GET['ap'])) {
require_once('modules_data/alignPanel.php'); //Панель склонностей, GET чтобы вызывать по ссылке.
} 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>document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));</script>";
if ($u->info['dnow'] > 0) {
$d = new Dungeon;
}
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 ($iloc != '') {
if ($iloce != '') {
$iloc = '<div style="padding:10px; color: red;">' . $iloce . '</div>' . $iloc;
@@ -617,10 +621,8 @@ if ($iloc != '') {
}
unset($iloc, $iloce);
/*-----------------------*/
$spl = Db::getValue('select exp from levels where nextLevel = ? order by exp limit 1', [$u->info['level'] + 1]);
//Сломаное обучение. Как оно достало! Ins. 🤬
//$training_manager->render();
?>