This commit is contained in:
Ivor Barhansky 2023-11-02 15:57:39 +02:00
parent a14232a899
commit def933dca4
51 changed files with 8866 additions and 12429 deletions

224
AI.php
View File

@ -1,224 +0,0 @@
<?php
/*
Ядро для обработки данных.
Обработка поединков, обработка заявок, обработка ботов, обработка пещер, обработка турниров, обработка временных генераций
*/
use User\UserIp;
if (isset($_GET['m1'])) {
define('GAME', true);
include_once '_incl_data/__config.php';
include_once '_incl_data/class/__db_connect.php';
$sp = mysql_query('SELECT * FROM `users_recombats` WHERE `email` != "" ORDER BY `name` DESC LIMIT 7000');
while ($pl = mysql_fetch_array($sp)) {
echo "<br>" . $pl['email'];
}
} elseif (isset($_GET['bk1'])) {
define('GAME', true);
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
$u = User::start();
$ins = 'Вещи БК-1:<hr>';
$sp = mysql_query('SELECT * FROM `items_main` WHERE `geni` = 1');
while ($pl = mysql_fetch_array($sp)) {
$po = mysql_fetch_array(
mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $pl['id'] . '" LIMIT 1')
);
$po = ConversionHelper::dataStringToArray($po['data']);
if (!isset($po['add_minAtack']) && isset($po['sv_minAtack'])) {
$po['add_minAtack'] = $po['sv_minAtack'];
$po['add_maxAtack'] = $po['sv_maxAtack'];
}
$ins .= 'INSERT INTO `items_main` (
`id`, `name`, `img`, `art`, `type`, `inslot`, `use_magic`, `price`, `price2`, `iznosMAXi`, `massa`, `tr_level`, `tr_s1`, `tr_s2`, `tr_s3`, `tr_s4`, `tr_s5`, `tr_s6`, `add_s1`, `add_s2`, `add_s3`, `add_s4`, `add_s5`, `add_s6`, `add_hp`, `add_mp`, `add_m1`, `add_m2`, `add_m3`, `add_m4`, `add_b1`, `add_b2`, `add_b3`, `add_b4`, `add_attack_min`, `add_attack_max`
,`tr_a1`,`tr_a2`,`tr_a3`,`tr_a4`,`tr_mg1`,`tr_mg2`,`tr_mg3`,`tr_mg4`,`tr_mg5`,`tr_mg6`,`tr_mg7`
,`add_a1`,`add_a2`,`add_a3`,`add_a4`,`add_mg1`,`add_mg2`,`add_mg3`,`add_mg4`,`add_mg5`,`add_mg6`,`add_mg7`
) VALUES ';
$ins .= '(
NULL,
"' . $pl['name'] . '",
"' . $pl['img'] . '",
"' . (0 + round($po['art'])) . '",
"' . $pl['type'] . '",
"' . $pl['inslot'] . '",
"",
"' . $pl['price1'] . '",
"' . $pl['price2'] . '",
"' . $pl['iznosMAXi'] . '",
"' . $pl['massa'] . '",
"' . (0 + round($po['tr_lvl'])) . '",
"' . (0 + round($po['tr_s1'])) . '",
"' . (0 + round($po['tr_s2'])) . '",
"' . (0 + round($po['tr_s3'])) . '",
"' . (0 + round($po['tr_s4'])) . '",
"' . (0 + round($po['tr_s5'])) . '",
"' . (0 + round($po['tr_s6'])) . '",
"' . (0 + round($po['add_s1'])) . '",
"' . (0 + round($po['add_s2'])) . '",
"' . (0 + round($po['add_s3'])) . '",
"' . (0 + round($po['add_s4'])) . '",
"' . (0 + round($po['add_s5'])) . '",
"' . (0 + round($po['add_s6'])) . '",
"' . (0 + round($po['add_hpAll'])) . '",
"' . (0 + round($po['add_mpAll'])) . '",
"' . (0 + round($po['add_m1'])) . '",
"' . (0 + round($po['add_m2'])) . '",
"' . (0 + round($po['add_m3'])) . '",
"' . (0 + round($po['add_m4'])) . '",
"' . (0 + round($po['add_mib1'])) . '",
"' . (0 + round($po['add_mib2'])) . '",
"' . (0 + round($po['add_mib3'])) . '",
"' . (0 + round($po['add_mib4'])) . '",
"' . (0 + round($po['add_minAtack'])) . '",
"' . (0 + round($po['add_maxAtack'])) . '",
"' . (0 + round($po['tr_a1'])) . '",
"' . (0 + round($po['tr_a2'])) . '",
"' . (0 + round($po['tr_a3'])) . '",
"' . (0 + round($po['tr_a4'])) . '",
"' . (0 + round($po['tr_mg1'])) . '",
"' . (0 + round($po['tr_mg2'])) . '",
"' . (0 + round($po['tr_mg3'])) . '",
"' . (0 + round($po['tr_mg4'])) . '",
"' . (0 + round($po['tr_mg5'])) . '",
"' . (0 + round($po['tr_mg6'])) . '",
"' . (0 + round($po['tr_mg7'])) . '",
"' . (0 + round($po['add_a1'])) . '",
"' . (0 + round($po['add_a2'])) . '",
"' . (0 + round($po['add_a3'])) . '",
"' . (0 + round($po['add_a4'])) . '",
"' . (0 + round($po['add_mg1'])) . '",
"' . (0 + round($po['add_mg2'])) . '",
"' . (0 + round($po['add_mg3'])) . '",
"' . (0 + round($po['add_mg4'])) . '",
"' . (0 + round($po['add_mg5'])) . '",
"' . (0 + round($po['add_mg6'])) . '",
"' . (0 + round($po['add_mg7'])) . '"
);';
$ins .= "\n" . '<br>';
}
echo $ins;
die();
}
if (isset($_GET['test'])) {
$i = 3;
function yrn($sila)
{
return 2 + $_GET['test'] + $sila - round($sila / 5);
}
while ($i <= 100) {
echo '<div';
if ($i == 8 || $i == 13 || $i == 18 || $i == 23) {
echo ' style="background-color:green;color:#fff;"';
} elseif ($i == 7 || $i == 12 || $i == 17 || $i == 22) {
echo ' style="background-color:grey;color:#fff;"';
}
echo '>&nbsp;';
echo $i . ' = ' . yrn($i);
echo '</div>';
$i++;
}
die();
}
if (!isset($_GET['robot']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get(
) != '' && UserIp::get() != '31.131.116.166') {
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
}
const GAME = true;
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
$count = [0, 0, 0, 0, 0, 0];
function inuser_go_btl($id)
{
if (isset($id['id'])) {
file_get_contents(
'/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5(
$id['id'] . '_brfCOreW@!_' . $id['pass']
) . '&pass=' . $id['pass']
);
}
}
$sp = mysql_query(
'SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 200'
);
$btltest = [];
while ($pl = mysql_fetch_array($sp)) {
$i++;
if ($pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 10)) {
$btltest[$pl['battle']]++;
if ($pl['timereg'] == 0) {
mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
} else {
User::setOnline($pl['id']);
}
if ($pl['bot'] == 0) {
mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
}
User::setOnline($pl['id']);
BotLogic::start($pl['id']);
} else {
if ($pl['zv'] > 0) {
BotLogic::start($pl['id']);
}
if ($pl['timereg'] == 0) {
mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
} else {
User::setOnline($pl['id']);
}
if ($pl['bot'] == 0) {
mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
}
mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
User::setOnline($pl['id']);
echo '*';
}
echo '+';
echo '[' . $pl['login'] . '] -> Действие: ' . $pl['ipreg'] . ' , ожидаем: ' . ($pl['timeMain'] - time(
)) . ' сек., заявка: ' . $pl['zv'] . ', поединок: ' . $pl['battle'] . '';
echo '<hr>';
}

View File

@ -8,7 +8,7 @@ use User\ItemsModel;
class Achievements class Achievements
{ {
private User $user; private User $user;
private $info; private array $info;
private array $data = [ private array $data = [
'zb' => [ 'zb' => [
'questname' => 'Ежедн.Задания', 'questname' => 'Ежедн.Задания',
@ -99,7 +99,7 @@ class Achievements
public function __construct(User $user) public function __construct(User $user)
{ {
$this->user = $user; $this->user = $user;
$this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]); $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]) ?: [];
} }
//fixme: сюда иногда приходит (NULL, NULL). //fixme: сюда иногда приходит (NULL, NULL).
@ -165,7 +165,7 @@ class Achievements
return $string; return $string;
} }
private function calculateCurrent($check = null) private function calculateCurrent($check = null): void
{ {
$this->info['bs'] = $this->user->info['win_bs']; $this->info['bs'] = $this->user->info['win_bs'];
foreach ($this->info as $k => $v) { foreach ($this->info as $k => $v) {
@ -187,7 +187,9 @@ class Achievements
$this->info["klasP$k"] = Math::get100Percentage($this->data[$k]['check'][1], $this->info[$k]); $this->info["klasP$k"] = Math::get100Percentage($this->data[$k]['check'][1], $this->info[$k]);
for ($i = 1; $i <= 5; $i++) { for ($i = 1; $i <= 5; $i++) {
if ($this->info[$k] >= $this->data[$k]['check'][$i]) { if ($this->info[$k] < $this->data[$k]['check'][$i]) {
continue;
}
$this->info["klas$k"] = $i; $this->info["klas$k"] = $i;
if ($i === 5) { if ($i === 5) {
# На 5 ранге должно отдавать максимум. # На 5 ранге должно отдавать максимум.
@ -201,7 +203,6 @@ class Achievements
} }
} }
} }
}
private function prizeName(?int $int, ?string $string): string private function prizeName(?int $int, ?string $string): string
{ {
@ -225,7 +226,7 @@ class Achievements
public function getInfo(?int $uid = null) public function getInfo(?int $uid = null)
{ {
if (!is_null($uid)) { if (!is_null($uid)) {
$this->info = Db::getRow('select * from users_achiv where id = ?', [$uid]); $this->info = Db::getRow('select * from users_achiv where id = ?', [$uid]) ?: [];
} }
$this->calculateCurrent(); $this->calculateCurrent();
return $this->info; return $this->info;

View File

@ -0,0 +1,135 @@
<?php
namespace Admin;
use Core\Db;
readonly class Monster
{
public array $info;
public function __construct(int $monsterid)
{
$this->info = Db::getRow('select * from aaa_monsters where uid = ?', [$monsterid]);
if ($_SERVER['REQUEST_METHOD'] === OAUTH_HTTP_METHOD_POST) {
$this->save();
}
}
private function save(): void
{
$params['uid'] = $this->info['uid'];
$params['start_room'] = (int)$_POST['bot_sroom'];
$params['start_day'] = (int)$_POST['bot_sday'];
$params['start_dd'] = (int)$_POST['bot_sdd'];
$params['start_mm'] = (int)$_POST['bot_smm'];
$params['start_hh'] = (int)$_POST['bot_shh'];
$params['start_min'] = (int)$_POST['bot_smin'];
$params['back_day'] = (int)$_POST['bot_bday'];
$params['back_dd'] = (int)$_POST['bot_bdd'];
$params['back_mm'] = (int)$_POST['bot_bmm'];
$params['back_hh'] = (int)$_POST['bot_bhh'];
$params['back_min'] = (int)$_POST['bot_bmin'];
$params['start_text'] = $_POST['bot_stext'];
$params['back_text'] = $_POST['bot_btext'];
$params['win_text'] = $_POST['bot_wintext'];
$params['lose_text'] = $_POST['bot_losetext'];
$params['nich_text'] = $_POST['bot_nichtext'];
$params['win_back'] = $_POST['bot_winback'];
$params['time_restart'] = $_POST['bot_trs'];
$params['win_itm'] = $_POST['bot_winitm'];
$params['win_money1'] = $_POST['bot_winmoney1'];
$params['win_money2'] = $_POST['bot_winmoney2'];
$params['win_exp'] = $_POST['bot_winexp'];
$params['win_eff'] = $_POST['bot_wineff'];
$params['win_ico'] = $_POST['bot_winico'];
$params['lose_itm'] = $_POST['bot_loseitm'];
$params['lose_money'] = $_POST['bot_losemoney1'];
$params['lose_money2'] = $_POST['bot_losemoney2'];
$params['lose_exp'] = $_POST['bot_loseexp'];
$params['lose_eff'] = $_POST['bot_loseeff'];
$params['lose_ico'] = $_POST['bot_loseico'];
if (!isset(
$params['uid'],
$params['start_room'],
$params['start_day'],
$params['back_day'],
$params['start_dd'],
$params['start_mm'],
$params['start_hh'],
$params['start_min'],
$params['back_min'],
$params['back_dd'],
$params['back_mm'],
$params['back_hh'],
$params['start_text'],
$params['back_text'],
$params['win_text'],
$params['lose_text'],
$params['nich_text'],
$params['win_money1'],
$params['win_money2'],
$params['lose_money'],
$params['lose_money2'],
$params['win_exp'],
$params['lose_exp'],
$params['win_itm'],
$params['lose_itm'],
$params['win_eff'],
$params['lose_eff'],
$params['win_ico'],
$params['lose_ico'],
$params['win_back'],
$params['time_restart']
)) {
return;
}
Db::sql('replace into aaa_monsters
(uid, start_room, start_day, back_day, start_dd, start_mm, start_hh, start_min,
back_min, back_dd, back_mm, back_hh, start_text, back_text, win_text, lose_text,
nich_text, win_money1, win_money2, lose_money, lose_money2, win_exp, lose_exp,
win_itm, lose_itm, win_eff, lose_eff, win_ico, lose_ico, win_back, time_restart)
values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [
$params['uid'],
$params['start_room'],
$params['start_day'],
$params['back_day'],
$params['start_dd'],
$params['start_mm'],
$params['start_hh'],
$params['start_min'],
$params['back_min'],
$params['back_dd'],
$params['back_mm'],
$params['back_hh'],
$params['start_text'],
$params['back_text'],
$params['win_text'],
$params['lose_text'],
$params['nich_text'],
$params['win_money1'],
$params['win_money2'],
$params['lose_money'],
$params['lose_money2'],
$params['win_exp'],
$params['lose_exp'],
$params['win_itm'],
$params['lose_itm'],
$params['win_eff'],
$params['lose_eff'],
$params['win_ico'],
$params['lose_ico'],
$params['win_back'],
$params['time_restart'],
]);
echo '<b style="color: red">Новые данные были успешно сохранены!</b>';
}
}

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,12 @@ class ClanInfo
public static function getNameById(int $id): string public static function getNameById(int $id): string
{ {
Db::getValue('select name from clan where id = ?', [$id]); $clan = self::getById($id);
return !empty($clan['name']) ? $clan['name'] : '';
}
public static function getById(int $id): array
{
return Db::getRow('select * from clan where id = ? and status = 1', [$id]) ?: [];
} }
} }

View File

@ -1,77 +1,36 @@
<?php <?php
use Core\Db;
use Helper\Conversion;
class ComissionShop class ComissionShop
{ {
public function commisionShop($sid, $preview = "full") public function commisionShop($preview = 'full')
{ {
global $c, $code, $sid; global $code;
switch ((int)$_GET['otdel']) { $typeOtdel = match ((int)$_GET['otdel']) {
case 1: 2 => 19,
$typeOtdel = 18; 3 => 20,
break; 4 => 21,
case 2: 5 => 22,
$typeOtdel = 19; 6 => 15,
break; 7 => 12,
case 3: 8 => 4,
$typeOtdel = 20; 9 => 5,
break; 10 => 6,
case 4: 11 => 1,
$typeOtdel = 21; 12 => 3,
break; 13 => 8,
case 5: 14 => 14,
$typeOtdel = 22; 15 => 13,
break; 16 => 9,
case 6: 17 => 10,
$typeOtdel = 15; 18 => 11,
break; 19 => 29,
case 7: 20 => 30,
$typeOtdel = 12; 1050 => 1050,
break; default => 18,
case 8: };
$typeOtdel = 4;
break;
case 9:
$typeOtdel = 5;
break;
case 10:
$typeOtdel = 6;
break;
case 11:
$typeOtdel = 1;
break;
case 12:
$typeOtdel = 3;
break;
case 13:
$typeOtdel = 8;
break;
case 14:
$typeOtdel = 14;
break;
case 15:
$typeOtdel = 13;
break;
case 16:
$typeOtdel = 9;
break;
case 17:
$typeOtdel = 10;
break;
case 18:
$typeOtdel = 11;
break;
case 19:
$typeOtdel = 29;
break;
case 20:
$typeOtdel = 30;
break;
case 1050:
$typeOtdel = 1050;
break;
default :
$typeOtdel = 18;
}
if ($typeOtdel != 1050) { if ($typeOtdel != 1050) {
if ($preview == "full") { if ($preview == "full") {
$cl = mysql_query( $cl = mysql_query(
@ -572,4 +531,96 @@ ORDER BY `1price`ASC , inGroupCount DESC'
echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>'; echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>';
} }
} }
public function buyItem(int $iid, User $u): string
{
$irow = Db::getRow('select items_users.id, uid, 1price, inGroup, inShop, data, item_id, login, items_main.name, price1
from items_users
left join users on users.id = uid
left join items_main on items_main.id = item_id
where items_users.id = ? and inShop = 30', [$iid]);
$price = $irow['1price'];
if (!isset($irow['id']) || !isset($iid) || $irow['inShop'] != 30) {
$r = 'Предмет не найден на прилавке';
} else {
if ($price > $u->info['money']) {
$r = 'У вас недостаточно денег (не хватает ' . ($price - $u->info['money']) . ' кр.)';
} else {
$u->addKr(-$price);
$u->addKr($price, $irow['uid']);
$col = $u->itemsX($iid);
if ($col > 1) {
Db::sql('update items_users set uid = ?, inGroup = inGroup + 1000, 1price = ?, lastUPD = unix_timestamp(), inShop = 0
where inShop = 30 and inOdet = 0 and item_id = ? and uid = ? and inGroup = ? limit ?',
[$u->info['id'], $irow['price1'], $irow['item_id'], $irow['uid'], $irow['inGroup'], $col]);
$irow['name'] .= "(x$col)";
} else {
Db::sql('update items_users set uid = ?, 1price = ?, lastUPD = unix_timestamp(), inShop = 0
where id = ? and uid = ? and inOdet = 0',
[$iid, $irow['uid']]);
}
Delo::add(1, 'comShop', $u->info['id'], "Купил предмет «{$irow['name']}» у игрока {$irow['login']} за $price кр.", $price);
Delo::add(1, 'comShop', $irow['uid'], "Продал предмет «{$irow['name']}» игроку {$irow['login']} за $price кр.");
$r = "Вы купили предмет «{$irow['name']}» у игрока {$irow['login']} за $price кр.<br>Предмет успешно добавлен в инвентарь.";
}
}
return '<div>' . $r . '</div>';
}
public function rent($action, int $iid, int $price, User $u)
{
if ($action == "Сдать в магазин" && $price > 0) {
$ChImtem = mysql_fetch_array(
mysql_query(
'SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = ' . $iid . ' LIMIT 1'
)
);
$ChSudba = Conversion::dataStringToArray($ChImtem['data']);
if (!isset($ChSudba['sudba']) && $ChSudba['sudba'] == 0 && $ChSudba['sudba'] != 1 && !isset($ChSudba['toclan'])) {
if (isset($ChImtem['inGroup']) && $ChImtem['inGroup'] > 0) {
$col = $u->itemsX($ChImtem['id']);
if ($col > 1) {
mysql_query(
'UPDATE `items_users` SET `inShop` = 30, `1price` = ' . $price . ' WHERE `item_id`="' . $ChImtem['item_id'] . '" AND `uid`="' . $ChImtem['uid'] . '" AND `inGroup` = "' . $ChImtem['inGroup'] . '" LIMIT ' . $col . ''
);
} else {
mysql_query(
'UPDATE `items_users` SET `inShop` = 30, `1price` = ' . $price . ' WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" '
);
}
} else {
mysql_query(
'UPDATE `items_users` set `inShop` = 30, `1price` = ' . $price . ' where `uid` = "' . $u->info['id'] . '" AND `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" '
);
}
}
} elseif ($action == "Забрать") {
$i = mysql_fetch_array(
mysql_query(
'SELECT `im`.`price1`,
`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . $iid . '" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1'
)
);
if (isset($i['inGroup']) and $i['inGroup'] > 0) {
$col = $u->itemsX($i['id']);
if ($col > 1) {
mysql_query(
'UPDATE `items_users` SET `inShop` = 0, `1price` = ' . $i['price1'] . ' WHERE `item_id`="' . $i['item_id'] . '" AND `inShop` = "30" AND `uid`="' . $i['uid'] . '" AND `inGroup` = "' . $i['inGroup'] . '" LIMIT ' . $col . ''
);
} else {
mysql_query(
'UPDATE `items_users` SET `inShop` = 0, `1price` = ' . $i['price1'] . ' WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" '
);
}
} else {
mysql_query(
'UPDATE `items_users` SET `inShop` = 0, `1price` = "' . $i['price1'] . '" WHERE `id` = "' . $iid . '" and `inShop` = "30" LIMIT 1'
);
}
}
}
} }

View File

@ -7,20 +7,39 @@ class Delo
{ {
/** /**
* Запись в личное дело персонажа. * Запись в личное дело персонажа.
* @param int $uid * @param int $uid кому пишется
* @param string $dop * @param string $text текст
* @param string $text * @param string $from отправитель записи
* @param string $from * @param float $moneyOut количество денег снятых с игрока
* @param float $moneyOut * @param int $type цифровой тип лога (??)
* @param int $type
* @return void * @return void
*/ */
public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0, string $dop = '') public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0): void
{ {
$sql = 'insert into users_delo (uid, dop, time, city, text, login, `delete`, no_right, ip, moneyOut, type) values (?,?,unix_timestamp(),?,?,?,0,?,?,?,?)'; $sql = 'insert into users_delo (uid, time, text, login, `delete`, no_right, ip, moneyOut, type) values (?,unix_timestamp(),?,?,0,?,?,?,?)';
Db::sql($sql, [ Db::sql($sql, [
$uid, $dop, 'capitalcity', $text, $from, '', UserIp::get(), $moneyOut, $type, $uid, $text, $from, '', UserIp::get(), $moneyOut, $type,
]); ]);
} }
public static function printPublicModerationStatus(int $userid): void
{
$status = Db::getValue('select text from users_delo where uid = ? and hb != 0 order by id desc limit 1', [$userid]);
if (!$status) {
return;
}
echo <<<HTML
<div style="padding-left: 5px; margin: 5px 0;">
Сообщение от модераторов:<br>
<span style="color: red; background-color: bisque; font-weight: bold;">$status</span>
</div>
HTML;
}
public static function getAllByUserId(int $userid): array
{
return Db::getRows('select time, text from users_delo where uid = ? and type = 0 order by id desc', [$userid]);
}
} }

View File

@ -32,7 +32,7 @@ class Filter
if ($add > 0) { if ($add > 0) {
$on = mysql_fetch_array(mysql_query('SELECT * FROM `online` WHERE `uid` = "' . $uid . '" LIMIT 1')); $on = mysql_fetch_array(mysql_query('SELECT * FROM `online` WHERE `uid` = "' . $uid . '" LIMIT 1'));
if (isset($on['id'])) { if (isset($on['uid'])) {
$mt = 0; $mt = 0;
$lst = time(); $lst = time();
if (date('d', $on['lastUp']) != date('d', $lst)) { if (date('d', $on['lastUp']) != date('d', $lst)) {
@ -42,7 +42,7 @@ class Filter
} }
$add = $on['time_all'] + $add; $add = $on['time_all'] + $add;
mysql_query( mysql_query(
'UPDATE `online` SET `mainTime` = "' . $mt . '",`time_today` = "' . $on['time_today'] . '",`lastUp` = "' . $lst . '",`time_all` = "' . $add . '" WHERE `id` = "' . $on['id'] . '" LIMIT 1' 'UPDATE `online` SET `mainTime` = "' . $mt . '",`time_today` = "' . $on['time_today'] . '",`lastUp` = "' . $lst . '",`time_all` = "' . $add . '" WHERE `uid` = "' . $on['uid'] . '" LIMIT 1'
); );
} }
} }

View File

@ -1,6 +1,9 @@
<?php <?php
namespace Helper; namespace Helper;
use DateTime;
class Conversion class Conversion
{ {
/** Превращает строку data ('a=1|b=2|c=3') из БД в массив [a=>1, b=>2, c=>3]. /** Превращает строку data ('a=1|b=2|c=3') из БД в массив [a=>1, b=>2, c=>3].
@ -9,6 +12,8 @@ class Conversion
*/ */
public static function dataStringToArray(string $dataString): array public static function dataStringToArray(string $dataString): array
{ {
$dataString = str_replace('||', '|', $dataString); // любители забивать руками параметры и задваивать разделители.
if (mb_substr($dataString, -1) === '|') { if (mb_substr($dataString, -1) === '|') {
$dataString = rtrim($dataString, '|'); $dataString = rtrim($dataString, '|');
} }
@ -31,10 +36,10 @@ class Conversion
* @param int|string $seconds * @param int|string $seconds
* @return string * @return string
*/ */
public static function secondsToTimeout($seconds): string public static function secondsToTimeout(int|string $seconds): string
{ {
$seconds = (int)$seconds; $seconds = (int)$seconds;
$time = new \DateTime(); $time = new DateTime();
$time->setTimestamp($seconds); $time->setTimestamp($seconds);
$sec = intval($time->format('s')); $sec = intval($time->format('s'));
$min = intval($time->format('i')); $min = intval($time->format('i'));

View File

@ -0,0 +1,145 @@
<?php
namespace Inf;
use Core\Config;
use Core\Db;
class Awards
{
private const KNIGHT = [
1 => 'Рыцарь первого круга',
2 => 'Рыцарь второго круга',
3 => 'Рыцарь третьего круга',
];
private const SCHOLAR = [
1 => 'Посвящённый первого круга',
2 => 'Посвящённый второго круга',
3 => 'Посвящённый третьего круга',
];
private const IZLOM = [
1 => 'Аттестованный боец',
2 => 'Опытный боец',
3 => 'Ветеран',
4 => 'Генерал',
];
private const DUNGEON_NAME = [
'repdreamscity' => 'Водосток',
'repizlom' => 'Излом Хаоса',
'rep1' => 'Храм Знаний',
];
private array $awards = [];
public function __construct(int $userid)
{
$reputations = Db::getRow('select * from rep where id = ?', [$userid]) ?: [];
$customAwards = Db::getRows('select text, img from users_ico where uid = ? and (endTime = 0 or endTime > unix_timestamp())', [$userid]);
foreach ($customAwards as $award) {
$this->awards[] = ['', $award['text'], $award['img']];
}
if (!empty($reputations)) {
$this->addDungeonAwards($reputations);
}
}
private function addDungeonAwards(mixed $reputations): void
{
match (true) {
$reputations['repdreamscity'] > 9999 => $this->awards[] = [self::DUNGEON_NAME['repdreamscity'], self::KNIGHT[3], 'i/ico/ric_kanal3.gif'],
$reputations['repdreamscity'] > 4999 => $this->awards[] = [self::DUNGEON_NAME['repdreamscity'], self::KNIGHT[2], 'i/ico/ric_kanal2.gif'],
$reputations['repdreamscity'] > 999 => $this->awards[] = [self::DUNGEON_NAME['repdreamscity'], self::KNIGHT[1], 'i/ico/ric_kanal1.gif'],
default => '',
};
match (true) {
$reputations['rep1'] > 9999 => $this->awards[] = [self::DUNGEON_NAME['rep1'], self::SCHOLAR[3], 'znrune_3.gif'],
$reputations['rep1'] > 999 => $this->awards[] = [self::DUNGEON_NAME['rep1'], self::SCHOLAR[2], 'znrune_2.gif'],
$reputations['rep1'] > 99 => $this->awards[] = [self::DUNGEON_NAME['rep1'], self::SCHOLAR[1], 'znrune_1.gif'],
default => '',
};
match (true) {
$reputations['repizlom'] > 24999 => $this->awards[] = [self::DUNGEON_NAME['repizlom'], self::IZLOM[4], 'iz_zn_ver10_4.gif'],
$reputations['repizlom'] > 9999 => $this->awards[] = [self::DUNGEON_NAME['repizlom'], self::IZLOM[3], 'iz_zn_ver10_3.gif'],
$reputations['repizlom'] > 999 => $this->awards[] = [self::DUNGEON_NAME['repizlom'], self::IZLOM[2], 'iz_zn_ver10_2.gif'],
$reputations['repizlom'] > 99 => $this->awards[] = [self::DUNGEON_NAME['repizlom'], self::IZLOM[1], 'iz_zn_ver10_1.gif'],
default => '',
};
match (true) {
$reputations['repcapitalcity'] > 24999 => $this->awards[] = ['Capital city', self::KNIGHT[2], 'zn1_2.gif'],
$reputations['repcapitalcity'] > 9999 => $this->awards[] = ['Capital city', self::KNIGHT[1], 'zn1_1.gif'],
default => '',
};
match (true) {
$reputations['repangelscity'] > 24999 => $this->awards[] = ['Angels city', self::KNIGHT[2], 'zn2_2.gif'],
$reputations['repangelscity'] > 9999 => $this->awards[] = ['Angels city', self::KNIGHT[1], 'zn2_1.gif'],
default => '',
};
match (true) {
$reputations['repdemonscity'] > 24999 => $this->awards[] = ['Demons city', self::KNIGHT[2], 'zn3_2.gif'],
$reputations['repdemonscity'] > 9999 => $this->awards[] = ['Demons city', self::KNIGHT[1], 'zn3_1.gif'],
default => '',
};
match (true) {
$reputations['repdevilscity'] > 24999 => $this->awards[] = ['Devils city', self::KNIGHT[2], 'zn4_2.gif'],
$reputations['repdevilscity'] > 9999 => $this->awards[] = ['Devils city', self::KNIGHT[1], 'zn4_1.gif'],
default => '',
};
match (true) {
$reputations['repsuncity'] > 24999 => $this->awards[] = ['Sun city', self::KNIGHT[2], 'zn5_2.gif'],
$reputations['repsuncity'] > 9999 => $this->awards[] = ['Sun city', self::KNIGHT[1], 'zn5_1.gif'],
default => '',
};
match (true) {
$reputations['repsandcity'] > 24999 => $this->awards[] = ['Sand city', self::KNIGHT[2], 'zn7_2.gif'],
$reputations['repsandcity'] > 9999 => $this->awards[] = ['Sand city', self::KNIGHT[1], 'zn7_1.gif'],
default => '',
};
match (true) {
$reputations['repemeraldscity'] > 24999 => $this->awards[] = ['Emeralds city', self::KNIGHT[2], 'zn6_2.gif'],
$reputations['repemeraldscity'] > 9999 => $this->awards[] = ['Emeralds city', self::KNIGHT[1], 'zn6_1.gif'],
default => '',
};
match (true) {
$reputations['repmooncity'] > 24999 => $this->awards[] = ['Moon city', self::KNIGHT[2], 'zn9_2.gif'],
$reputations['repmooncity'] > 9999 => $this->awards[] = ['Moon city', self::KNIGHT[1], 'zn9_1.gif'],
default => '',
};
match (true) {
$reputations['repabandonedplain'] > 9999 => $this->awards[] = ['Гора Легиона', self::KNIGHT[2], '1_gora.gif'],
$reputations['repabandonedplain'] > 999 => $this->awards[] = ['Гора Легиона', self::KNIGHT[1], '2_gora.gif'],
default => '',
};
}
public function addCustom(string $name, string $description, string $image): void
{
$this->awards[] = [$name, $description, $image];
}
public function print(): void
{
foreach ($this->awards as $award) {
$img = Config::img() . DIRECTORY_SEPARATOR . $award[2];
if (!empty($award[0])) {
$award[1] = "<b>$award[0]</b><br>$award[1]";
}
echo <<<HTML
<img src="$img" alt="" onmouseover="top.hi(this,'$award[1]',event,0,0,1,0);" onmouseout="top.hic();" onmousedown="top.hic();" style="cursor: pointer;">
HTML;
}
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace Inf;
use Core\Db;
use DateTimeImmutable;
class LastNames
{
private array $lastnames = [];
/** История имён
* @param int $userid
*/
public function __construct(int $userid)
{
$names = Db::getRows('select * from lastnames where uid = ? order by time desc', [$userid]);
$dt = new DateTimeImmutable();
foreach ($names as $name) {
$dt->setTimestamp($name['time']);
$this->lastnames[] = "«{$name['login']}» до " . $dt->format('d.m.Y H:i');
}
}
public function print(): void
{
echo $this->get();
}
private function get(): string
{
if (empty($this->lastnames)) {
return '';
}
return 'История имен:<br>' . implode('<br>', $this->lastnames);
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace Inf;
use Core\Config;
use Helper\Conversion;
class Status
{
private array $statuses;
public function add(bool $condition, string $text, int|string|null $timeout = 0, ?string $img = ''): void
{
if (!$condition) {
return;
}
if (!empty($timeout)) {
$text .= ' ещё ' . Conversion::secondsToTimeout($timeout - time());
}
$text = "<span style='vertical-align:middle;'>$text</span>";
if (!empty($img)) {
$text = '<span><img src="' . Config::img() . DIRECTORY_SEPARATOR . $img . '" alt="' . $text . '" style="vertical-align:middle;"></span> ' . $text;
}
$this->statuses[] = "<div>$text</div>"; // обёртка для центрирования картинки с текстом
}
public function print(): void
{
if (empty($this->statuses)) {
return;
}
echo '<br><div style="font-size: smaller;">' . implode('<br>', $this->statuses) . '</div>';
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace Inf;
use Core\Db;
class Twinks
{
private array $twinks = [];
/** Мульты персонажа
* @param int $userid
* @param int $twinkid
*/
public function __construct(int $userid, int $twinkid)
{
$twinks = Db::getRows('select login, level, twink from users_twink where uid = ? and twink != 0', [$userid]);
foreach ($twinks as $twink) {
$str = $twink['login'] . ' [' . $twink['level'] . ']';
if ($twinkid === $twink['twink']) {
$str = '<b style="color:#ff9900;">' . $str . '</b>';
}
$this->twinks[] = $str;
}
}
public function print(): void
{
echo $this->get();
}
private function get(): string
{
if (empty($this->twinks)) {
return '';
}
return 'Другие образы: ' . implode(', ', $this->twinks) . '<br>';
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace Inf;
use Core\Config;
class Zodiac
{
private const ZODIAC = [
1 => 'Овен',
2 => 'Телец',
3 => 'Близнецы',
4 => 'Рак',
5 => 'Лев',
6 => 'Дева',
7 => 'Весы',
8 => 'Скорпион',
9 => 'Стрелец',
10 => 'Козерог',
11 => 'Водолей',
12 => 'Рыбы',
];
private int $day = 0;
private int $month = 0;
public function __construct(string $date)
{
[$d, $m, $y] = explode('.', $date);
if (!checkdate($d, $m, $y)) {
return;
}
$this->day = (int)$d;
$this->month = (int)$m;
}
public function getImageLink(): string
{
if (empty($this->getName())) {
return '#';
}
$id = array_flip(self::ZODIAC);
return Config::img() . '/i/zodiac/' . $id[$this->getName()] . '.gif';
}
public function getName(): string
{
if (empty($this->day) || empty($this->month)) {
return '';
}
$z = [
1 => self::ZODIAC[10],
self::ZODIAC[11],
self::ZODIAC[12],
self::ZODIAC[1],
self::ZODIAC[2],
self::ZODIAC[3],
self::ZODIAC[4],
self::ZODIAC[5],
self::ZODIAC[6],
self::ZODIAC[7],
self::ZODIAC[8],
self::ZODIAC[9],
self::ZODIAC[10],
];
$lastDay = [1 => 19, 18, 20, 20, 21, 21, 22, 22, 21, 22, 21, 20, 19];
return $this->day > $lastDay[$this->month] ? $z[$this->month + 1] : $z[$this->month];
}
}

View File

@ -1,10 +1,11 @@
<?php <?php
use Core\ConversionHelper;
use Helper\Conversion;
class Item class Item
{ {
private array $parameterName = [ public static array $parameterName = [
'sex' => 'Пол', 'sex' => 'Пол',
'align' => 'Склонность', 'align' => 'Склонность',
'lvl' => 'Уровень', 'lvl' => 'Уровень',
@ -77,7 +78,17 @@ class Item
'm15' => 'Мф. абс. увертывания (%)', 'm15' => 'Мф. абс. увертывания (%)',
'm18' => 'Мф. абс. блока щитом (%)', 'm18' => 'Мф. абс. блока щитом (%)',
// deprecated 'mib1' => 'Броня головы минимум',
'mab1' => 'Броня головы максимум',
'mib2' => 'Броня груди и живота минимум',
'mab2' => 'Броня груди и живота максимум',
'mib3' => 'Броня пояса минимум',
'mab3' => 'Броня пояса максимум',
'mib4' => 'Броня ног минимум',
'mab4' => 'Броня ног максимум',
];
public static array $parameterNameDeprecated = [
'acestar' => 'Следующий каст будет критическим', 'acestar' => 'Следующий каст будет критическим',
'more_awards' => 'Повышеная награда %', 'more_awards' => 'Повышеная награда %',
'align_bs' => 'Служитель закона', 'align_bs' => 'Служитель закона',
@ -175,17 +186,37 @@ class Item
'silvers' => 'Silver Premium Account', 'silvers' => 'Silver Premium Account',
]; ];
public static function test(string $data)
{
$t = self::parseDataString($data);
$r = [];
$b = [];
foreach ($t['tr'] as $k => $v) {
if (isset(self::$parameterName[explode('_', $k)[1]])) {
$k = "($k) " . self::$parameterName[explode('_', $k)[1]];
}
$r[$k] = $v;
}
foreach ($t['add'] as $k2 => $v2) {
if (isset(self::$parameterName[explode('_', $k2)[1]])) {
$k2 = "($k2) " . self::$parameterName[explode('_', $k2)[1]];
}
$b[$k2] = $v2;
}
return ['tr' => $r, 'add' => $b,];
}
public static function parseDataString(string $data) public static function parseDataString(string $data)
{ {
$a = ConversionHelper::dataStringToArray($data); $a = Conversion::dataStringToArray($data);
$sex = ['Мужской', 'Женский']; $sex = ['Мужской', 'Женский'];
$requirements = []; $requirements = [];
$bonuses = []; $bonuses = [];
foreach ($a as $k => $v) { foreach ($a as $k => $v) {
if (strpos($k, 'tr_')) { if (str_starts_with($k, 'tr_')) {
$requirements[$k] = $v; $requirements[$k] = $v;
} }
if (strpos($k, 'add_')) { if (str_starts_with($k, 'add_')) {
$bonuses[$k] = $v; $bonuses[$k] = $v;
} }
if (isset($requirements['tr_sex'])) { if (isset($requirements['tr_sex'])) {

View File

@ -4,7 +4,7 @@ namespace Item\Data;
class Bonuses class Bonuses
{ {
private static array $names = [ public static array $names = [
'hpAll' => 'Уровень жизни (HP)', 'hpAll' => 'Уровень жизни (HP)',
'mpAll' => 'Уровень маны', 'mpAll' => 'Уровень маны',
's1' => 'Сила', 's1' => 'Сила',
@ -110,7 +110,7 @@ class Bonuses
return $this->result; return $this->result;
} }
public function addZonb() public function addZonb(): void
{ {
if (isset($this->result[self::$names['zonb']])) { if (isset($this->result[self::$names['zonb']])) {
$this->result[self::$names['zonb']]++; $this->result[self::$names['zonb']]++;

View File

@ -4,7 +4,7 @@ namespace Item\Data;
class Properties class Properties
{ {
private static array $names = [ public static array $names = [
'damage' => 'Урон', 'damage' => 'Урон',
]; ];
private array $result = []; private array $result = [];

View File

@ -4,7 +4,7 @@ namespace Item\Data;
class Requirements class Requirements
{ {
private static array $names = [ public static array $names = [
'sex' => 'Пол', 'sex' => 'Пол',
'lvl' => 'Уровень', 'lvl' => 'Уровень',
's1' => 'Сила', 's1' => 'Сила',

View File

@ -1,43 +1,27 @@
<?php <?php
if(!defined('GAME')) if (!defined('GAME')) {
{
die(); die();
} }
if( $itm['magic_inci'] == 'addmoney' ) { if ($itm['magic_inci'] != 'addmoney') {
if( $u->info['align'] != 2 ) { return;
if( $itm['4price'] > 0 ) { }
$u->info['money4'] += $itm['4price']; if ($itm['2price'] > 0) {
mysql_query('UPDATE `users` SET `money4` = `money4` + "'.$itm['4price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->addEkr($itm['2price']);
}elseif( $itm['2price'] > 0 ) {
$u->info['money2'] += $itm['2price'];
mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$itm['2price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
} elseif ($itm['1price'] > 0) { } elseif ($itm['1price'] > 0) {
$u->info['money'] += $itm['1price']; $u->addKr($itm['1price']);
mysql_query('UPDATE `users` SET `money` = `money` + "'.$itm['1price'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}elseif( $itm['price4'] > 0 ) {
$u->info['money4'] += $itm['price4'];
mysql_query('UPDATE `users` SET `money4` = `money4` + "'.$itm['price4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
} elseif ($itm['price2'] > 0) { } elseif ($itm['price2'] > 0) {
$u->info['money2'] += $itm['price2']; $u->addEkr($itm['price2']);
mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$itm['price2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
} elseif ($itm['price1'] > 0) { } elseif ($itm['price1'] > 0) {
$u->info['money'] += $itm['price1']; $u->addKr($itm['price1']);
mysql_query('UPDATE `users` SET `money` = `money` + "'.$itm['price1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
} }
// //
if( $itm['4price'] > 0 ) { if ($itm['2price'] > 0) {
$u->error = 'Вы успешно обналичили чек на '.$u->zuby($itm['4price'],1).'';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}elseif( $itm['2price'] > 0 ) {
$u->error = 'Вы успешно обналичили чек на ' . $itm['2price'] . ' екр.'; $u->error = 'Вы успешно обналичили чек на ' . $itm['2price'] . ' екр.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
} elseif ($itm['1price'] > 0) { } elseif ($itm['1price'] > 0) {
$u->error = 'Вы успешно обналичили чек на ' . $itm['1price'] . ' кр.'; $u->error = 'Вы успешно обналичили чек на ' . $itm['1price'] . ' кр.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
}elseif( $itm['price4'] > 0 ) {
$u->error = 'Вы успешно обналичили чек на '.$u->zuby($itm['price4'],1).'';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
} elseif ($itm['price2'] > 0) { } elseif ($itm['price2'] > 0) {
$u->error = 'Вы успешно обналичили чек на ' . $itm['price2'] . ' екр.'; $u->error = 'Вы успешно обналичили чек на ' . $itm['price2'] . ' екр.';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
@ -47,8 +31,3 @@ if( $itm['magic_inci'] == 'addmoney' ) {
} else { } else {
$u->error = 'Баговый чек! Напишите Администрации!'; $u->error = 'Баговый чек! Напишите Администрации!';
} }
}else{
$u->error = 'Хаосники не могут обналичивать чек!';
}
}
?>

View File

@ -3,7 +3,6 @@ if (!defined('GAME')) {
die(); die();
} }
$add_zb = 0;
$add_nas = 0; $add_nas = 0;
$refer = mysql_fetch_array( $refer = mysql_fetch_array(
@ -19,7 +18,6 @@ function setMentorGiftStatus($id) {
if ($tr['var_id'] == 1) { if ($tr['var_id'] == 1) {
// Набор [0] // Набор [0]
$add_zb = 5;
$add_nas = 1; $add_nas = 1;
//Накидка //Накидка
@ -40,7 +38,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 2) { } elseif ($tr['var_id'] == 2) {
// Набор [1] // Набор [1]
$add_zb = 10;
$add_nas = 1; $add_nas = 1;
//Рубаха 3209 //Рубаха 3209
@ -65,7 +62,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 3) { } elseif ($tr['var_id'] == 3) {
// Набор [2] // Набор [2]
$add_zb = 20;
$add_nas = 1; $add_nas = 1;
//Перчатки 3211 //Перчатки 3211
@ -90,7 +86,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 4) { } elseif ($tr['var_id'] == 4) {
// Набор [3] // Набор [3]
$add_zb = 30;
$add_nas = 1; $add_nas = 1;
//Сапоги 3213 //Сапоги 3213
@ -119,7 +114,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 5) { } elseif ($tr['var_id'] == 5) {
// Набор [4] // Набор [4]
$add_zb = 40;
$add_nas = 1; $add_nas = 1;
//Серьги 3216 //Серьги 3216
@ -152,7 +146,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 6) { } elseif ($tr['var_id'] == 6) {
// Набор [5] // Набор [5]
$add_zb = 50;
$add_nas = 1; $add_nas = 1;
//Броня 4002 //Броня 4002
@ -188,7 +181,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 7) { } elseif ($tr['var_id'] == 7) {
// Набор [6] // Набор [6]
$add_zb = 60;
$add_nas = 2; $add_nas = 2;
//Учебник воспитанника 4004 //Учебник воспитанника 4004
@ -213,7 +205,6 @@ if ($tr['var_id'] == 1) {
} elseif ($tr['var_id'] == 8) { } elseif ($tr['var_id'] == 8) {
// Набор [7] // Набор [7]
$add_zb = 70;
$add_nas = 3; $add_nas = 3;
//Учебник воспитанника 4004 //Учебник воспитанника 4004
@ -251,21 +242,6 @@ if ($tr['var_id'] == 1) {
} }
if ($add_zb > 0 && $this->info['level'] < 8) {
$this->info['money4'] += $add_zb;
mysql_query(
'UPDATE `users` SET `money4` = "' . $this->info['money4'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
$cmsg = new ChatMessage();
$cmsg->setTo($this->info['login']);
$cmsg->setType(6);
$cmsg->setText(
"В &quot;Снабжение воспитанника&quot; Вы обнаружили зубы: <small>" . $this->zuby($add_zb, 1) . "</small>."
);
(new Chat())->sendMsg($cmsg);
}
if ($add_nas > 0 && $this->info['level'] < 8 && isset($refer['id'])) { if ($add_nas > 0 && $this->info['level'] < 8 && isset($refer['id'])) {
$ino = 0; $ino = 0;
while ($ino < $add_nas) { while ($ino < $add_nas) {
@ -282,4 +258,4 @@ if ($add_nas > 0 && $this->info['level'] < 8 && isset($refer['id'])) {
(new Chat())->sendMsg($cmsg); (new Chat())->sendMsg($cmsg);
} }
unset($i3, $add_zb, $refer, $add_nas); unset($i3, $refer, $add_nas);

View File

@ -14,6 +14,31 @@ class ActionModel
$this->uid = $uid; $this->uid = $uid;
} }
public static function new(array $user, string $vals, string $vars, int $time = 0)
{
if (!$time) {
$time = time();
}
Db::sql(
'insert into actions (uid, time, city, room, vars, ip, vals, val) values (?,?,?,?,?,?,?,?)',
[
$user['id'],
$time,
$user['city'],
$user['room'],
$vars,
UserIp::get(),
$vals,
'',
]
);
}
public static function getAll(string $filter = ''): array
{
return Db::getRows('select * from actions');
}
public function getByVals(string $vals) public function getByVals(string $vals)
{ {
return Db::getRow('select * from actions where uid = ? and vals = ?', [$this->uid, $vals]); return Db::getRow('select * from actions where uid = ? and vals = ?', [$this->uid, $vals]);
@ -40,30 +65,18 @@ class ActionModel
Db::sql('delete from actions where uid = ? and vals = ?', [$this->uid, $vals]); Db::sql('delete from actions where uid = ? and vals = ?', [$this->uid, $vals]);
} }
public static function new(array $user, string $vals, string $vars, int $time = 0)
/*protected function testAction($filter, $tp): array
{ {
if (!$time) { if ($tp == 1) {
$time = time(); $query = 'select * from actions where ' . $filter;
} } elseif ($tp == 2) {
Db::sql( $query = 'select count(*) from actions where ' . $filter;
'insert into actions (uid, time, city, room, vars, ip, vals, val) values (?,?,?,?,?,?,?,?)', } else {
[ return [];
$user['id'],
$time,
$user['city'],
$user['room'],
$vars,
UserIp::get(),
$vals,
'',
]
);
} }
$arr = mysql_fetch_array(mysql_query($query));
public static function getAll(string $filter = ''): array return !empty($arr) ? $arr : [];
{ }*/
return Db::getRows('select * from actions');
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ use Model\Effect;
class Effects class Effects
{ {
public static function addCustom(array $values) public static function addCustom(array $values): void
{ {
$sql = ' $sql = '
insert into eff_users insert into eff_users
@ -92,6 +92,7 @@ insert into eff_users
/** Дать игроку эффект. /** Дать игроку эффект.
* @param int $uid id игрока * @param int $uid id игрока
* @param int $id id эффекта * @param int $id id эффекта
* @param bool $ignoreLimits
* @return bool * @return bool
*/ */
public static function addById(int $uid, int $id, bool $ignoreLimits = false): bool public static function addById(int $uid, int $id, bool $ignoreLimits = false): bool
@ -129,7 +130,7 @@ insert into eff_users
public static function hasInjury(int $uid): bool public static function hasInjury(int $uid): bool
{ {
return Db::getValue('select count(*) from eff_users where id_eff in (4,5) and `delete` = 0 and uid = ?', [$uid]) > 0; return Db::getValue('select count(*) from eff_users where id_eff in (4,5,6) and `delete` = 0 and uid = ?', [$uid]) > 0;
} }
public static function hasAddiction(int $addictionId, int $uid): bool // пристрастие public static function hasAddiction(int $addictionId, int $uid): bool // пристрастие
@ -157,7 +158,7 @@ insert into eff_users
return Db::getValue('select count(*) from eff_users where id_eff in (479, 480, 481) and `delete` = 0 and uid = ?', [$targetId]) > 0; return Db::getValue('select count(*) from eff_users where id_eff in (479, 480, 481) and `delete` = 0 and uid = ?', [$targetId]) > 0;
} }
public static function giveAttackImmunity(int $userId) public static function giveAttackImmunity(int $userId): void
{ {
Db::sql("insert into eff_users (no_Ace, id_eff, overType, uid, name, data, timeUse) values (1,479,112,?,'Защита от нападения','zashitatk=1',unix_timestamp())", [$userId]); Db::sql("insert into eff_users (no_Ace, id_eff, overType, uid, name, data, timeUse) values (1,479,112,?,'Защита от нападения','zashitatk=1',unix_timestamp())", [$userId]);
} }
@ -175,4 +176,14 @@ insert into eff_users
values (22,?,'Спасение','add_spasenie=1',101,77,?,'priem',324,'preservation.gif','спасение',1)", [$id, $id]); values (22,?,'Спасение','add_spasenie=1',101,77,?,'priem',324,'preservation.gif','спасение',1)", [$id, $id]);
} }
public static function getActive(int $userId): array
{
return Db::getRows('select * from eff_users where uid = ?', [$userId]);
}
public static function getAllInjuries(int $uid): array
{
return Db::getRows('select * from eff_users where uid = ? and id_eff in (4,5,6) order by id_eff', [$uid]);
}
} }

View File

@ -0,0 +1,791 @@
<?php
namespace User;
use Core\Config;
use Core\Db;
use Helper\Conversion;
use User;
/**
* Рисует коробочку персонажа с логином сверху.
*/
class InfoBox
{
private User $user;
private array $info;
private array $is;
public function __construct(User $user)
{
$this->user = $user;
$this->info = $user->info;
$this->is = $user->is;
}
public function getInfoPers($uid, $i1, $sn = 0, $ivv = 0): array
{
global $code;
$st = false;
$rt = [];
$type_info = 1;
if ($uid != $this->info['id']) {
$u = User::getInfo($uid);
if ($sn == 0) {
$sn = $this->user->getStats($uid, $i1);
}
} else {
$u = $this->info;
if (isset($this->user->stats['hpAll'])) {
$sn = $this->user->stats;
} elseif ($sn == 0) {
$sn = $this->user->getStats($uid, $i1);
}
}
$tp_img = [
1 => 4,
2 => 5,
14 => 6,
3 => 7,
5 => 8,
7 => 9,
17 => 10,
16 => 11,
13 => 12,
10 => 13,
9 => 14,
8 => 15,
11 => 17, //кольцо 2
12 => 18, //кольцо 3
];
if (isset($u['id'], $u['stats'])) {
$rt = [0 => '', 1 => []];
$st = [];
$st['id'] = $u['id'];
$st['login'] = $u['login'];
$st['lvl'] = $u['level'];
//Характеристики от предметов и их изображение
$witm = [];
$witm[1] = '<img width="60" height="60" style="display:block;" title="Пустой слот шлем" src="' . Config::img() . '/i/items/w/w9.gif">';
$witm[2] = '<img width="60" height="40" style="display:block;" title="Пустой слот наручи" src="' . Config::img() . '/i/items/w/w13.gif">';
$witm[3] = '<img width="60" height="60" style="display:block;" title="Пустой слот оружие" src="' . Config::img() . '/i/items/w/w3.gif">';
$witm[4] = '<img width="60" height="80" style="display:block;" title="Пустой слот броня" src="' . Config::img() . '/i/items/w/w4.gif">';
$witm[7] = '<img width="60" height="40" style="display:block;" title="Пустой слот пояс" src="' . Config::img() . '/i/items/w/w5.gif">';
$witm[8] = '<img width="60" height="20" style="display:block;" title="Пустой слот серьги" src="' . Config::img() . '/i/items/w/w1.gif">';
$witm[9] = '<img width="60" height="20" style="display:block;" title="Пустой слот ожерелье" src="' . Config::img() . '/i/items/w/w2.gif">';
$witm[10] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="' . Config::img() . '/i/items/w/w6.gif">';
$witm[11] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="' . Config::img() . '/i/items/w/w6.gif">';
$witm[12] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="' . Config::img() . '/i/items/w/w6.gif">';
$witm[13] = '<img width="60" height="40" style="display:block;" title="Пустой слот перчатки" src="' . Config::img() . '/i/items/w/w11.gif">';
$witm[14] = '<img width="60" height="60" style="display:block;" title="Пустой слот щит" src="' . Config::img() . '/i/items/w/w10.gif">';
$witm[16] = '<img width="60" height="80" style="display:block;" title="Пустой слот поножи" src="' . Config::img() . '/i/items/w/w19.gif">';
$witm[17] = '<img width="60" height="40" style="display:block;" title="Пустой слот обувь" src="' . Config::img() . '/i/items/w/w12.gif">';
//40-52 слот под магию
$witm[53] = '<img width="40" height="20" style="display:block;" title="Пустой слот правый карман" src="' . Config::img() . '/i/items/w/w15.gif">';
$witm[54] = '<img width="40" height="20" style="display:block;" title="Пустой слот левый карман" src="' . Config::img() . '/i/items/w/w15.gif">';
$witm[55] = '<img width="40" height="20" style="display:block;" title="Пустой слот центральный карман" src="' . Config::img() . '/i/items/w/w15.gif">';
$witm[56] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="' . Config::img() . '/i/items/w/w20.gif">';
$witm[57] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="' . Config::img() . '/i/items/w/w20.gif">';
$witm[58] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="' . Config::img() . '/i/items/w/w20.gif">';
$wj = [1 => false, 2 => false, 4 => false, 5 => false, 6 => false];
$cl = Db::getRows('select items_users.id, name, img, type, inRazdel, info, level, magic_inci, class, item_id, uid, data, inOdet, magic_inc, overType
from items_users left join items_main on items_main.id = item_id where inOdet > 0 and uid = ?', [$u['id']]);
foreach ($cl as $pl) {
$td = Conversion::dataStringToArray($pl['data']);
if (isset($td['modif'])) {
$pl['name'] = $pl['name'] . ' (мф)';
}
if (isset($td['upatack_lvl'])) {
$pl['name'] = $pl['name'] . ' +' . $td['upatack_lvl'];
}
if (isset($td['mod_lvl'])) {
$pl['name'] = $pl['name'] . ' [' . $td['mod_lvl'] . ']';
}
if ($pl['inOdet'] == 1 || $pl['inOdet'] == 52 || ($pl['inOdet'] >= 4 && $pl['inOdet'] <= 6)) {
$wj[$pl['inOdet']] = $pl;
}
$pl['name'] = $this->nameItemMf($pl, $td);
$lvar = $this->getInfoItemInfo($pl, $td);
if (@isset($sn['items_img'][$tp_img[$pl['inOdet']]])) {
$uimg = 'rimg/r' . $sn['items_img'][$tp_img[$pl['inOdet']]];
} else {
$uimg = 'i/items/' . $pl['img'];
}
$witm[$pl['inOdet']] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center><strong>' . $pl['name'] . '</strong>' . $lvar . '</center>\',event,3,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();">';
if ($i1 == 1) {
$witm[$pl['inOdet']] = '<a href="/item/' . $pl['item_id'] . '" target="_blank">' . $witm[$pl['inOdet']] . '</a>';
} else {
if ($pl['inOdet'] >= 40 && $pl['inOdet'] <= 52 && !isset($_GET['inv'])) {
$useUrl = '';
if ($pl['magic_inc'] == '') {
$pl['magic_inc'] = $pl['magic_inci'];
}
if ($pl['magic_inc'] && $pl['type'] == 30) {
//используем эликсир
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
} elseif ($pl['magic_inc'] && $pl['type'] == 29) {
//используем заклятие
//на персонажа
if (isset($td['useOnLogin'])) {
$inv1 = '';
if (isset($_GET['inv'])) {
$inv1 = 'inv=1&otdel=' . ((int)$_GET['otdel']) . '&';
}
$useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
} else {
//просто использование (на селя, либо без указания предмета\логина)
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
}
}
$witm[$pl['inOdet']] = '<a href="javascript:void(0);" onClick="' . $useUrl . '">' . $witm[$pl['inOdet']] . '</a>';
} elseif ($pl['item_id'] == 998 && !isset($_GET['inv'])) {
//варежки
$witm[$pl['inOdet']] = '<a href="main.php?use_snowball=' . $code . '">' . $witm[$pl['inOdet']] . '</a>';
} else {
$witm[$pl['inOdet']] = '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&sid=' . $pl['id'] . '&rnd=' . $code . '">' . $witm[$pl['inOdet']] . '</a>';
}
}
}
//Шлем,Венок
$wj1i = '';
$br = '<div align=\\\'center\\\' style=\\\'margin:4px;\\\'><img src=\\\'' . Config::img() . '/1x1.gif\\\' height=\\\'1\\\' width=\\\'111\\\' style=\\\'background-color:black;\\\'></div>';
if ($wj[1]) {
if (!empty($wj[52])) {
$wj1i .= $br;
}
$td = Conversion::dataStringToArray($wj[1]['data']);
$wj[1]['name'] = $this->nameItemMf($wj[1], $td);
$wj1i .= '<strong>' . $wj[1]['name'] . '</strong>';
$wj1i .= $this->getInfoItemInfo($wj[1], $td);
}
if (!empty($wj[52])) {
$td = Conversion::dataStringToArray($wj[52]['data']);
$wj[52]['name'] = $this->nameItemMf($wj[52], $td);
$wj1i = '<strong>' . $wj[52]['name'] . '</strong>' . $wj1i;
$wj1i .= $this->getInfoItemInfo($wj[52], $td);
$wj[1]['img'] = $wj[52]['img'];
$wj[1]['id'] = $wj[52]['id'];
$wj[1]['inRazdel'] = $wj[52]['inRazdel'];
}
//Рубаха,Броня,Плащ
$wj4i = '';
if ($wj[6]) {
$td = Conversion::dataStringToArray($wj[6]['data']);
$wj[6]['name'] = $this->nameItemMf($wj[6], $td);
$wj4i .= '<strong>' . $wj[6]['name'] . '</strong>';
$wj4i .= $this->getInfoItemInfo($wj[6], $td);
if ($wj[5] || $wj[4]) {
$wj4i .= $br;
}
}
if ($wj[5]) {
$wj4idd = $wj[5]['item_id'];
$td = Conversion::dataStringToArray($wj[5]['data']);
$wj[5]['name'] = $this->nameItemMf($wj[5], $td);
$wj4i .= '<strong>' . $wj[5]['name'] . '</strong>';
$wj4i .= $this->getInfoItemInfo($wj[5], $td);
if ($wj[4]) {
$wj4i .= $br;
}
}
if ($wj[4]) {
$td = [];
$td = Conversion::dataStringToArray($wj[4]['data']);
$wj[4]['name'] = $this->nameItemMf($wj[4], $td);
$wj4i .= '<strong>' . $wj[4]['name'] . '</strong>';
$wj4i .= $this->getInfoItemInfo($wj[4], $td);
}
if ($this->info['noplaw'] == 1 && !isset($_GET['hide_plaw']) || ($this->info['noplaw'] == 0 && isset($_GET['hide_plaw']))) {
if ($wj[5]) {
$wj[4]['img'] = $wj[5]['img'];
$wj[4]['id'] = $wj[5]['id'];
$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
}
} else {
if ($wj[6]) {
$wj[4]['img'] = $wj[6]['img'];
$wj[4]['id'] = $wj[6]['id'];
$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
} elseif ($wj[5]) {
$wj[4]['img'] = $wj[5]['img'];
$wj[4]['id'] = $wj[5]['id'];
$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
}
}
if ($wj[1] || $wj[2]) {
if (isset($sn['items_img'][$tp_img[1]])) {
$uimg = 'rimg/r' . $sn['items_img'][$tp_img[1]];
} else {
$uimg = 'i/items/' . $wj[1]['img'];
}
$witm[1] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj1i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
if ($i1 == 1) {
$witm[1] = '<a href="/item/' . $wj[1]['item_id'] . '" target="_blank">' . $witm[1] . '</a>';
} else {
$witm[1] = '<a href="main.php?otdel=' . $wj[1]['inRazdel'] . '&inv=1&sid=' . $wj[1]['id'] . '&rnd=' . $code . '">' . $witm[1] . '</a>';
}
}
if ($wj[4] || $wj[5] || $wj[6]) {
if (isset($sn['items_img'][$tp_img[5]])) {
$uimg = 'rimg/r' . $sn['items_img'][$tp_img[5]];
} else {
$uimg = 'i/items/' . $wj[4]['img'];
}
$witm[4] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj4i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
if ($i1 == 1) {
if ($wj4idd > 0 && isset($wj[4]['item_id'])) {
$wj[4]['item_id'] = $wj4idd;
}
$witm[4] = '<a href="/item/' . $wj[4]['item_id'] . '" target="_blank">' . $witm[4] . '</a>';
} else {
$witm[4] = '<a href="main.php?otdel=' . $wj[4]['inRazdel'] . '&inv=1&sid=' . $wj[4]['id'] . '&rnd=' . $code . '">' . $witm[4] . '</a>';
}
}
/*------------ ГЕНЕРИРУЕМ ИНФ. О ПЕРСОНАЖЕ ---------------*/
$nmmsgl1 = 0;
if ($u['align'] >= 1 && $u['align'] < 2) {
$nmmsgl1 = 1;
} elseif ($u['align'] >= 3 && $u['align'] < 4) {
$nmmsgl1 = 3;
} elseif ($u['align'] >= 7 && $u['align'] < 8) {
$nmmsgl1 = 7;
} elseif ($u['align'] >= 50 || $u['admin'] > 0) {
$nmmsgl1 = 60;
}
$anan = [
1 => 'cat',
2 => 'owl',
3 => 'wisp',
4 => 'demon',
5 => 'dog',
6 => 'pig',
7 => 'dragon',
];
$anan2 = [
1 => 'Кот',
2 => 'Сова',
3 => 'Светляк',
4 => 'Чертяка',
5 => 'Пёс',
6 => 'Свин',
7 => 'Дракон',
];
$anml = '';
if ($u['animal'] > 0) {
$an = mysql_fetch_array(
mysql_query(
'SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "' . $u['animal'] . '" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'
)
);
if (isset($an['id'])) {
$petimg = mysql_fetch_array(
mysql_query(
'SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "' . $u['id'] . '" AND `use` = 1 LIMIT 1'
)
);
if (isset($petimg['id'])) {
$anml = '<img height="40" width="120" src="' . Config::img() . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
} else {
$anml = '<img height="40" width="120" src="' . Config::img() . '/pet/' . $anan[$an['type']] . '.png" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong><i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
}
}
}
if (isset($sn['items_img'][2])) {
$msl = '<img width="120" height="40" style="display:block" src="' . Config::img() . '/rimg/r' . $sn['items_img'][2] . '">';
} else {
if ($anml == '') {
$msl = '<img width="120" height="40" style="display:block" src="' . Config::img() . '/i/slot_bottom' . $nmmsgl1 . '.gif">';
} else {
$msl = $anml;
}
}
$oi = '';
if ($i1 != 1) {
$jf = 'main';
$oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' (Перейти в &quot;Инвентарь&quot;)\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"';
$msl = '<table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40" height="20">' . $witm[53] . '</td>
<td width="40" height="20">' . $witm[55] . '</td>
<td width="40" height="20">' . $witm[54] . '</td>
</tr>
<tr>
<td width="40" height="20">' . $witm[56] . '</td>
<td width="40" height="20">' . $witm[57] . '</td>
<td width="40" height="20">' . $witm[58] . '</td>
</tr>
</table>';
}
$hpmp = '';
$eff = '';
//-------- генерируем эффекты
$efs = Db::getRows('select id, uid, img, img2, timeUse, timeAce, info, name, data, type1, see, actionTime
from eff_users left join eff_main on id_eff = id2 where uid = ? and deactiveTime < unix_timestamp() order by deactiveTime desc, timeUse',
[$u['id']]);
foreach ($efs as $e) {
$esee = 1;
if ($e['see'] == 0 && $i1 == 1) {
$esee = 0;
}
if ($e['see'] == 2 && ($u['battle'] != $this->info['battle'] || $this->info['battle'] == 0)) {
$esee = 0;
}
if ($e['see'] == 3 && $i1 == 0) {
$esee = 0;
}
if ($e['img'] == '') {
$esee = 0;
}
if (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] >= time() || $e['timeUse'] == 77) && $esee == 1) {
$ei = '<strong><u>' . $e['name'] . '</u></strong>';
match (true) {
$e['type1'] > 0 && $e['type1'] < 7 => $ei .= ' (Эликсир)',
$e['type1'] > 6 && $e['type1'] < 11 || $e['type1'] == 16 => $ei .= ' (Заклятие)',
$e['type1'] == 14 => $ei .= ' (Прием)',
$e['type1'] == 15 => $ei .= ' (Изучение)',
$e['type1'] == 17 => $ei .= ' (Проклятие)',
$e['type1'] == 18 || $e['type1'] == 19 => $ei .= ' (Травма)',
$e['type1'] == 20 => $ei .= ' (Пристрастие)',
$e['type1'] == 22 => $ei .= ' (Ожидание)',
default => $ei .= ' (Эффект)',
};
$ei .= '<br>';
if ($e['type1'] != 13 && $e['timeUse'] != 77) {
$ei .= 'Осталось: ' . Conversion::secondsToTimeout($e['timeUse'] + $e['timeAce'] + $e['actionTime'] - time());
}
//Действие эффекта
$tr = '';
$t = $this->user->items['add'];
$x = 0;
$ed = Conversion::dataStringToArray($e['data']);
while ($x < count($t)) {
$n = $t[$x];
if (isset($ed['add_' . $n], $this->is[$n])) {
$z = '';
if ($ed['add_' . $n] > 0) {
$z = '+';
}
$tr .= '<br>' . $this->is[$n] . ': ' . $z . $ed['add_' . $n];
}
$x++;
}
if ($tr != '') {
$ei .= $tr;
}
if ($e['info'] != '') {
$ei .= '<br><i>Информация:</i><br>' . $e['info'];
}
if ($e['img2'] != '' && $e['img'] == 'icon_none.gif') {
$e['img'] = $e['img2'];
}
if ($e['type1'] == 18 || $e['type1'] == 19) {
$e['img'] = $e['img2'];
}
$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="' . Config::img() . '/i/eff/' . $e['img'] . '"onMouseOver="top.hi(this,\'' . $ei . '\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
} elseif ($e['timeUse'] + $e['timeAce'] + $e['actionTime'] < time() && $e['timeUse'] != 77) {
//удаляем эффект
$ed = Conversion::dataStringToArray($e['data']);
if (!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) {
$this->user->endEffect($e['id'], $u);
}
}
}
//здоровье
$hptop = 0;
$lh = [0 => 'hp_none', 1 => 1];
$lh[1] = floor((0 + $sn['hpNow']) / (0 + $sn['hpAll']) * 120);
if ($lh[1] > 0) {
$lh[0] = 'hp_1';
}
if ($lh[1] > 32) {
$lh[0] = 'hp_2';
}
if ($lh[1] > 65) {
$lh[0] = 'hp_3';
}
if ($sn['mpAll'] > 0) {
//мана
$lm = [0 => 'hp_none', 1 => 1];
$lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 120);
if ($lm[1] > 0) {
$lm[0] = 'hp_mp';
}
$hpmp .= '<div id="vmp' . $u['id'] . '" title="Уровень маны" align="center" class="seemp" style="position:absolute; top:10px; left:-5px; width:120px; height:10px; z-index:12;">' .
floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '</div>
<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="' . $lm[0] . ' senohp" style="height:9px; position:absolute; top:10px; width:' . $lm[1] . 'px; z-index:11;" id="lmp' . $u['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;"></div>';
} else {
$hptop = 5;
}
$hpmp = '<div id="vhp' . $u['id'] . '" title="Уровень жизни" align="center" class="seehp" style="position:absolute; top:' . $hptop . 'px; left:-5px; width:120px; height:10px; z-index:12;">' . floor(
$sn['hpNow']
) . '/' . (0 + $sn['hpAll']) . '</div>
<div title="Уровень жизни" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:120px; height:9px; z-index:13;"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
<div class="' . $lh[0] . ' senohp" style="height:9px; width:' . $lh[1] . 'px; position:absolute; top:' . $hptop . 'px; z-index:11;" id="lhp' . $u['id'] . '"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
<div title="Уровень жизни" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:120px; height:10px; z-index:10;"><img src="' . Config::img() . '/1x1.gif" height="10"></div>' . $hpmp;
//Собираем НР и МР
$hpmp = "<div style='position:relative;'>$hpmp</div>";
$pb = '';
if ($u['banned'] > 0) {
$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>Персонаж заблокирован</strong></font></div>';
}
if ($u['allLock'] > time()) {
$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>Временный запрет передач!</strong></font></div>';
}
$swm = 0; //свитки магии
$l = 40;
while ($l <= 52) {
if (isset($witm[$l])) {
$swm++;
} else {
$witm[$l] = '<img title="Пустой слот заклинания" src="' . Config::img() . '/i/items/w/w101.gif">';
}
$l++;
}
$ssm = 0; //слоты сумки
$l = 59;
while ($l <= 62) {
if (isset($witm[$l])) {
$ssm++;
} else {
$witm[$l] = '<img width="60" height="60" title="Пустой слот сумка" src="' . Config::img() . '/i/items/w/w83.gif">';
}
$l++;
}
$witmg = '';
if ($ssm > 0 && $i1 == 0) {
$witmg .= '<table style="padding-top:2px;padding-bottom:2px;" width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60" height="60">' . $witm[59] . '</td>
<td width="60">' . $witm[60] . '</td>
<td width="60">' . $witm[61] . '</td>
<td width="60">' . $witm[62] . '</td>
</tr>
</table>';
}
if ($swm > 0 && $i1 == 0) {
$witmg .= '<table width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40" height="25">' . $witm[40] . '</td>
<td width="40">' . $witm[41] . '</td>
<td width="40">' . $witm[42] . '</td>
<td width="40">' . $witm[43] . '</td>
<td width="40">' . $witm[44] . '</td>
<td width="40">' . $witm[50] . '</td>
</tr>
<tr>
<td height="25">' . $witm[45] . '</td>
<td>' . $witm[46] . '</td>
<td>' . $witm[47] . '</td>
<td>' . $witm[48] . '</td>
<td>' . $witm[49] . '</td>
<td>' . $witm[51] . '</td>
</tr>
</table>';
}
$zag = '';
if ($u['zag'] != '' && $i1 == 1) {
$rt[0] .= '<style> .inf2s { position:relative; filter: alpha(opacity=10); -moz-opacity: 0.10; -khtml-opacity: 0.10; opacity: 0.10; } .inf2s:hover { background-color:#e2e0e0;filter: alpha(opacity=70); -moz-opacity: 0.70; -khtml-opacity: 0.70; opacity: 0.70; } </style>';
$zag = '<img width="243" height="283" style="position:absolute;top:-1px;left:-1px;" src="' . Config::img() . '/i/zag/' . $u['zag'] . '">';
$j2 = 0;
while ($j2 <= 17) {
$witm[$j2] = '<div class="inf2s">' . $witm[$j2] . '</div>';
$j2++;
}
}
if ($pb != '') {
$pb = '<div align="center" style="width:246px;"><!-- blocked -->' . $pb . '</div>';
}
$rt[0] .= '<div id="lgnthm" style="width:246px; padding:0 3px 0 3px;" align="center">' . $this->user->microLogin2($u) . '</div>' . $pb . '
<div class="personag" style="width:240px; background-color:#CCC; padding:3px; margin-right:11px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
<table width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60" valign="top">
<table bgcolor="#e1e1e1" width="60" height="280" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="60"><div style="position:relative">' . $zag . $witm[1] . '</div></td>
</tr>
<tr>
<td height="40">' . $witm[2] . '</td>
</tr>
<tr>
<td height="60">' . $witm[3] . '</td>
</tr>
<tr>
<td height="80">' . $witm[4] . '</td>
</tr>
<tr>
<td height="40">' . $witm[7] . '</td>
</tr>
</table>
</td>
<td height="280" valign="top">
<table bgcolor="#e1e1e1" width="120" height="280" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" bgcolor="#CCC" valign="top">
<!-- HP and MP -->
' . $hpmp . '
<!-- -->
</td>
</tr>
<tr>
<td valign="top">';
if ($zag == '') {
if ($i1 == 0) {
if (!isset($_GET['inv'])) {
$invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак'];
} else {
$invg = [0 => 'main.php?skills=1', 1 => 'Умения'];
}
} else {
$o = mysql_fetch_array(
mysql_query(
'SELECT `id` FROM `obraz` WHERE `img` = "' . mysql_real_escape_string(
$this->info['obraz']
) . '" AND `sex` = "' . $this->info['sex'] . '" LIMIT 1'
)
);
$invg = [0 => '/shadow/' . $o['id'] . '" target="_blank', 1 => 'Галерея образов'];
}
$uobr = 'i/obraz/' . $u['sex'] . '/' . $u['obraz'];
if (isset($sn['items_img'][1])) {
$uobr = 'rimg/r' . $sn['items_img'][1];
}
$rt[0] .= '<div style="position:relative;height:220px;">
<!-- образ -->
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img() . '/' . $uobr . '" ' . $oi . '></a></div>
<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
</div>';
} else {
if ($i1 == 0) {
if (!isset($_GET['inv'])) {
$invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак'];
} else {
$invg = [0 => 'main.php?skills=1', 1 => 'Умения'];
}
} else {
$invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => 'Галерея образов'];
}
$rt[0] .= '<div class="inf2s" style="position:relative;height:220px;">
<!-- образ -->
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img() . '/1x1.gif" ' . $oi . '></a></div>
<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
</div>';
}
unset($invg);
$rt[0] .= '</td>
</tr>
<tr>
<td height="40"><div align="center">' . $msl . '</div></td>
</tr>
</table>
</td>
<td width="60" valign="top">
<table bgcolor="#e1e1e1" width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">' . $witm[8] . '</td>
</tr>
<tr>
<td height="20">' . $witm[9] . '</td>
</tr>
<tr>
<td height="20"><table width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20" height="20">' . $witm[10] . '</td>
<td width="20">' . $witm[11] . '</td>
<td width="20">' . $witm[12] . '</td>
</tr>
</table></td>
</tr>
<tr>
<td height="40">' . $witm[13] . '</td>
</tr>
<tr>
<td height="60">' . $witm[14] . '</td>
</tr>
<tr>
<td height="80">' . $witm[16] . '</td>
</tr>
<tr>
<td height="40">' . $witm[17] . '</td>
</tr>
</table>
</td>
</tr>
</table>' . $witmg . '</div>';
if ($i1 == 0 && $u['battle'] == 0) {
$rt[0] .= '<script>top.lafstReg[' . $u['id'] . '] = 0; top.startHpRegen("main",' . $u['id'] . ',' . (0 + $sn['hpNow']) . ',' . (0 + $sn['hpAll']) . ',' . (0 + $sn['mpNow']) . ',' . (0 + $sn['mpAll']) . ',' . (time() - $u['regHP']) . ',' . (time() - $u['regMP']) . ',' . (0 + $this->user->rgd[0]) . ',' . (0 + $this->user->rgd[1]) . ',1)</script>';
}
if ($ivv == 0 && $i1 == 0) {
$rt[0] .= $this->user->info_remont();
}
}
return $rt;
}
private function nameItemMf($pl, $po)
{
$r = $pl['name'];
if (isset($po['icos'])) {
$r = "<span class=icos_{$po['icos']}>{$pl['name']} <span style='font-size:8px;'>&nbsp;{$po['icos']}&nbsp;</span></span>";
}
if (!empty($po['rune']) && $po['rune'] > 0) {
$r .= "<br><span style='color: green;'>Руна: <strong>{$po['rune_name']}</strong></span>";
}
if (isset($po['spell'])) {
$rnc = match (explode(' ', $po['spell_name'])[2]) {
'[0]' => '#282828',
'[1]' => '#624542',
'[2]' => '#77090b',
default => '#d99800',
};
$r .= "<br><span style='color: $rnc;'>Руна: <strong>{$po['spell_name']}</strong></span>";
}
return $r;
}
private function getInfoItemInfo($pl, $po): string
{
$lvar = '';
if (isset($po['sv_yron_max']) && $po['sv_yron_max'] > 0) {
$lvar .= '<br>Урон: ' . $po['sv_yron_min'] . '-' . $po['sv_yron_max'];
}
$t = $this->user->items['add'];
$x = 0;
while ($x < count($t)) {
$n = $t[$x];
if (isset($po['add_' . $n], $this->is[$n])) {
$z = '+';
if ($po['add_' . $n] < 0) {
$z = '';
}
$lvar .= '<br>' . $this->is[$n] . ': ' . $z . $po['add_' . $n];
}
$x++;
}
//
$x = 0;
while ($x < count($t)) {
$n = $t[$x];
if (isset($po['sv_' . $n])) {
$z = '+';
if ($po['sv_' . $n] < 0) {
$z = '';
}
if ($n != 'yron_min' && $n != 'yron_max') {
$lvar .= '<br>' . $this->is[$n] . ': ' . $z . $po['sv_' . $n];
}
}
$x++;
}
if ($pl['2h'] == 1) {
$lvar .= '<br>• Двуручное оружие';
}
if (isset($po['zonb'])) {
$lvar .= '<br>Зоны блокирования: ';
if ($po['zonb'] > 0) {
$x = 1;
while ($x <= $po['zonb']) {
$lvar .= '+';
$x++;
}
} else {
$lvar .= '—';
}
}
//
if (isset($po['add_mib1'], $po['add_mab1']) && $po['add_mib1'] > 0 && $po['add_mib1'] <= $po['add_mab1']) {
$lvar .= '<br>Броня головы: ' . (int)$po['add_mib1'] . '-' . (int)$po['add_mab1'];
}
if (isset($po['add_mib2'], $po['add_mab2']) && $po['add_mib2'] > 0 && $po['add_mib2'] <= $po['add_mab2']) {
$lvar .= '<br>Броня корпуса: ' . (int)$po['add_mib2'] . '-' . (int)$po['add_mab2'];
}
if (isset($po['add_mib3'], $po['add_mab3']) && $po['add_mib3'] > 0 && $po['add_mib3'] <= $po['add_mab3']) {
$lvar .= '<br>Броня пояса: ' . (int)$po['add_mib2'] . '-' . (int)$po['add_mab2'];
}
if (isset($po['add_mib4'], $po['add_mab4']) && $po['add_mib4'] > 0 && $po['add_mib4'] <= $po['add_mab4']) {
$lvar .= '<br>Броня ног: ' . (int)$po['add_mib2'] . '-' . (int)$po['add_mab2'];
}
if ($pl['iznosMAX'] > 0) {
$lvar .= '<br>Долговечность: ' . floor($pl['iznosNOW']) . DIRECTORY_SEPARATOR . ceil($pl['iznosMAX']);
}
if (!empty($po['battleUseZd']) && $po['battleUseZd'] > 0) {
$lvar .= '<br>Задержка использования: ' . Conversion::secondsToTimeout($po['battleUseZd']);
}
if (isset($po['gravi'])) {
$lvar .= '<hr><strong>&quot;<i>' . $po['gravi'] . '</i>&quot;</strong>';
}
return $lvar;
}
}

View File

@ -55,10 +55,10 @@ class ItemsModel
* @param int $coldel количество предметов. * @param int $coldel количество предметов.
* @return void * @return void
*/ */
public static function deleteItemsById(int $id, int $coldel = 1) public static function deleteItemsById(int $id, int $coldel = 1): void
{ {
Db::sql( Db::sql(
'update items_users set `delete` = unix_timestamp() 'delete from items_users
where id in (select id from items_users where item_id = ? and uid = ? and (`delete` = 0 or `delete` = 1000) order by inGroup desc limit ?)', where id in (select id from items_users where item_id = ? and uid = ? and (`delete` = 0 or `delete` = 1000) order by inGroup desc limit ?)',
[$id, User::start()->info['id'], $coldel] [$id, User::start()->info['id'], $coldel]
); );
@ -78,6 +78,83 @@ class ItemsModel
]; ];
} }
/** Выбор предмета в инвентаре.
* @param int $itemId
* @param int $ownerId
* @return array
*/
public static function getOwnedItemById(int $itemId, int $ownerId): array
{
return Db::getRow('select * from items_users left join items_main on item_id = items_main.id
where uid = ? and items_users.id = ? and `delete` = 0 and inOdet = 0 and inShop = 0', [$ownerId, $itemId]);
}
public static function delete(int $id): void
{
Db::sql('delete from items_users where id = ?', [$id]);
}
public static function getDressedEkrTotalPrice($uid)
{
return Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
}
public static function getWearedItems(int $userId): array
{
return Db::getRows('select * from items_users where inOdet > 0 and uid = ?', [$userId]);
}
/** Порча предмета
* @param $it
* @param $tp
* @param $uid
* @param $id2
* @param $type
* @param $name
* @return void
*/
public static function itemDecay($it, $tp, $uid, $id2, $type, $name): void
{
if ($it == 0) {
return;
}
if ($id2 == 4708) {
$tp = 1;
}
$sql = 'delete from items_users where id = ?';
$sql2 = 'update items_users set inGroup = 0, timeOver = unix_timestamp() where inGroup = ?';
$args = [$it];
if ($uid != 0) {
$sql .= 'and uid = ?';
$sql2 .= 'and uid = ?';
$args[] = $uid;
}
Db::sql($sql, $args);
Db::sql($sql2, $args);
Delo::add(2, 'system.inventory', $uid, "Предмет <b>$name</b> [id:$it] был испорчен.");
if ($tp == 0) {
return;
}
//Добавляем испорченый предмет в инвентарь, в зависимости от типа
if ($id2 > 0) {
$moddata = '|noodet=1';
if ($id2 == 4708) {
$moddata = '|notransfer=1|nosale=1';
}
ItemsModel::addItem($id2, $uid, $moddata);
} elseif ($type == 30) {
//испорченный эликсир
$id2 = 4036;
$moddata = "|renameadd=$name|noodet=1";
ItemsModel::addItem($id2, $uid, $moddata);
}
}
public static function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) public static function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null)
{ {
$user = User::start(); $user = User::start();
@ -134,30 +211,4 @@ class ItemsModel
} }
return $rt; return $rt;
} }
/** Выбор предмета в инвентаре.
* @param int $itemId
* @param int $ownerId
* @return array
*/
public static function getOwnedItemById(int $itemId, int $ownerId): array
{
return Db::getRow('select * from items_users left join items_main on item_id = items_main.id
where uid = ? and items_users.id = ? and `delete` = 0 and inOdet = 0 and inShop = 0', [$ownerId, $itemId]);
}
public static function delete(int $id)
{
Db::sql('delete from items_users where id = ?', [$id]);
}
public static function getDressedEkrTotalPrice($uid)
{
return Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
}
public static function getWearedItems(int $userId): array
{
return Db::getRows('select * from items_users where inOdet > 0 and uid = ?', [$userId]);
}
} }

View File

@ -0,0 +1,97 @@
<?php
namespace User;
class Parameters
{
public static array $parameterName = [
'spasenie' => 'Спасение после смерти',
'puti' => 'Запрет перемещения',
'align' => 'Склонность',
'hpAll' => 'Уровень жизни (HP)',
'mpAll' => 'Уровень маны (МP)',
'sex' => 'Пол',
'lvl' => 'Уровень',
's1' => 'Сила',
's2' => 'Ловкость',
's3' => 'Интуиция',
's4' => 'Выносливость',
's5' => 'Интеллект',
's6' => 'Мудрость',
's7' => 'Духовность',
'm1' => 'Мф. критического удара (%)',
'm2' => 'Мф. против критического удара (%)',
'm3' => 'Мф. мощности крит. удара (%)',
'm4' => 'Мф. увертывания (%)',
'm5' => 'Мф. против увертывания (%)',
'm6' => 'Мф. контрудара (%)',
'm7' => 'Мф. парирования (%)',
'm8' => 'Мф. блока щитом (%)',
'm9' => 'Мф. удара сквозь броню (%)',
'm14' => 'Мф. абс. критического удара (%)',
'm15' => 'Мф. абс. увертывания (%)',
'm18' => 'Мф. абс. блока щитом (%)',
'm19' => 'Мф. абс. магический промах (%)',
'a1' => 'Мастерство владения ножами, кинжалами',
'a2' => 'Мастерство владения топорами, секирами',
'a3' => 'Мастерство владения дубинами, молотами',
'a4' => 'Мастерство владения мечами',
'a5' => 'Мастерство владения магическими посохами',
'aall' => 'Мастерство владения оружием',
'mall' => 'Мастерство владения магией стихий',
'mg1' => 'Мастерство владения магией огня',
'mg2' => 'Мастерство владения магией воздуха',
'mg3' => 'Мастерство владения магией воды',
'mg4' => 'Мастерство владения магией земли',
'mg7' => 'Мастерство владения серой магией',
'minAtack' => 'Минимальный урон бота в пещере',
'maxAtack' => 'Максимальный урон бота в пещере',
'm10' => 'Мф. мощности урона',
'm11' => 'Мф. мощности магии стихий',
'pa1' => 'Мф. мощности колющего урона',
'pa2' => 'Мф. мощности рубящего урона',
'pa3' => 'Мф. мощности дробящего урона',
'pa4' => 'Мф. мощности режущего урона',
'pm1' => 'Мф. мощности магии огня',
'pm2' => 'Мф. мощности магии воздуха',
'pm3' => 'Мф. мощности магии воды',
'pm4' => 'Мф. мощности магии земли',
'pm7' => 'Мф. мощности серой магии',
'za' => 'Защита от урона',
'zm' => 'Защита от магии стихий',
'magic_cast' => 'Дополнительный каст за ход',
'min_heal_proc' => 'Эффект лечения (%)',
'notravma' => 'Защита от травм',
'yron_min' => 'Минимальный урон',
'yron_max' => 'Максимальный урон',
'speedhp' => 'Регенерация здоровья (%)',
'speedmp' => 'Регенерация маны (%)',
'tya1' => 'Колющие атаки',
'tya2' => 'Рубящие атаки',
'tya3' => 'Дробящие атаки',
'tya4' => 'Режущие атаки',
'tym1' => 'Огненные атаки',
'mg2static_points' => 'Уровень заряда (Воздух)',
'tym2' => 'Электрические атаки',
'tym3' => 'Ледяные атаки',
'tym4' => 'Земляные атаки',
'tym7' => 'Серые атаки',
'min_use_mp' => 'Уменьшает расход маны',
'pog' => 'Поглощение урона (прием)',
'pog2' => 'Поглощение урона (прием)',
'pog2p' => 'Процент поглощение урона (прием)',
'pog2mp' => 'Цена поглощение урона (прием)',
'maxves' => 'Увеличивает рюкзак',
'antm3' => 'Мф. против мощности крита',
'repair_z' => 'Бесплатное извлечение заточек',
'repair_r' => 'Бесплатное извлечение рун',
'rep' => 'Репутация Рыцаря',
'repair_discount' => 'Скидка на ремонт вещей',
'hpVinos' => 'Бонус жизни',
'gold' => 'Благодать Ангела',
'speed_dungeon' => 'Скорость передвижения по подземельям',
'zona' => 'Дополнительная зона атаки',
];
public static array $parameterNameDeprecated = [];
}

View File

@ -64,43 +64,6 @@ class Register
'Милосердие', 'Справедливость', 'Искушение', 'Вознесение', 'Милосердие', 'Справедливость', 'Искушение', 'Вознесение',
]; ];
public function hasMixedLatCur(string $txt): bool
{
$en = preg_match("/^(([0-9A-z -])+)$/iu", $txt);
$ru = preg_match("/^([а-яёіїє\s\d]*)$/iu", $txt);
return ($ru && $en) || (!$ru && !$en);
}
public function hasGoodLogin(string $login): bool
{
$isRestricted = in_array($login, $this->restrictedLogins);
$isRegistered = Db::getValue('select count(*) from users where login = ?', [$login]);
//Бывшие в употреблении логины. Дичь, но ладно.
$wasRegistered = Db::getValue('select count(*) from lastnames where login = ?', [$login]);
$login = str_replace(' ', ' ', $login);
if (mb_strlen($login) > 20) {
$this->error = 'Логин должен содержать не более 20 символов.';
}
if (mb_strlen($login) < 4) {
$this->error = 'Логин должен содержать не менее 4 символов.';
}
if ($this->hasMixedLatCur($login)) {
$this->error = 'В логине разрешено использовать только буквы одного алфавита русского или английского. Нельзя смешивать.';
}
if (substr_count($login, ' ') + substr_count($login, '-') + substr_count($login, '_') > 2) {
$this->error = 'Не более двух разделителей одновременно (пробел, тире, нижнее подчеркивание).';
}
if (!empty($this->error)) {
$this->error .= '<br>Пример правильного никнейма: Петя Убиватор, Коля, xalop.<br>Пример неправильного никнейма: )))), kolя)=-/.';
}
if ($isRegistered || $wasRegistered || $isRestricted) {
$this->error = 'Логин ' . $login . ' уже занят, выберите другой.';
}
return !$this->error;
}
public function hasGoodEmail(string $email): bool public function hasGoodEmail(string $email): bool
{ {
$isRegistered = Db::getValue('select count(*) from users where mail = ?', [$email]); $isRegistered = Db::getValue('select count(*) from users where mail = ?', [$email]);
@ -167,7 +130,7 @@ class Register
] ]
); );
$uid = Db::lastInsertId(); $uid = Db::lastInsertId();
trigger_error('Db::lastInsertId= ' . $uid); //trigger_error('Db::lastInsertId= ' . $uid);
$_SESSION['uid'] = $uid; $_SESSION['uid'] = $uid;
$this->setCookies($login); $this->setCookies($login);
$this->setStatsItemsEffects($uid); $this->setStatsItemsEffects($uid);
@ -176,7 +139,43 @@ class Register
return $uid; return $uid;
} }
private function setCookies($login) public function hasGoodLogin(string $login): bool
{
$isRestricted = in_array($login, $this->restrictedLogins);
$isRegistered = Db::getValue('select count(*) from users where login = ?', [$login]);
//Бывшие в употреблении логины. Дичь, но ладно.
$wasRegistered = Db::getValue('select count(*) from lastnames where login = ?', [$login]);
$login = str_replace(' ', ' ', $login);
if (mb_strlen($login) > 20) {
$this->error = 'Логин должен содержать не более 20 символов.';
}
if (mb_strlen($login) < 4) {
$this->error = 'Логин должен содержать не менее 4 символов.';
}
if ($this->hasMixedLatCur($login)) {
$this->error = 'В логине разрешено использовать только буквы одного алфавита русского или английского. Нельзя смешивать.';
}
if (substr_count($login, ' ') + substr_count($login, '-') + substr_count($login, '_') > 2) {
$this->error = 'Не более двух разделителей одновременно (пробел, тире, нижнее подчеркивание).';
}
if (!empty($this->error)) {
$this->error .= '<br>Пример правильного никнейма: Петя Убиватор, Коля, xalop.<br>Пример неправильного никнейма: )))), kolя)=-/.';
}
if ($isRegistered || $wasRegistered || $isRestricted) {
$this->error = 'Логин ' . $login . ' уже занят, выберите другой.';
}
return !$this->error;
}
public function hasMixedLatCur(string $txt): bool
{
$en = preg_match("/^(([0-9A-z -])+)$/iu", $txt);
$ru = preg_match("/^([а-яёіїє\s\d]*)$/iu", $txt);
return ($ru && $en) || (!$ru && !$en);
}
private function setCookies($login): void
{ {
setcookie('login', 1, 1, '/', Config::get('host'), true); setcookie('login', 1, 1, '/', Config::get('host'), true);
setcookie('registrationModal', 1, 1, '/', Config::get('host'), true); setcookie('registrationModal', 1, 1, '/', Config::get('host'), true);
@ -184,7 +183,7 @@ class Register
setcookie('registrationModal', 'true', strtotime('+7 days'), '/', Config::get('host'), true); setcookie('registrationModal', 'true', strtotime('+7 days'), '/', Config::get('host'), true);
} }
private function setStatsItemsEffects($uid) private function setStatsItemsEffects($uid): void
{ {
if ($_SESSION['ref'] === 1) { if ($_SESSION['ref'] === 1) {
$this->classBonuses[$this->class]['items'][] = 4811; $this->classBonuses[$this->class]['items'][] = 4811;
@ -203,7 +202,7 @@ class Register
$itemId = ItemsModel::addItem($item, $uid); $itemId = ItemsModel::addItem($item, $uid);
Db::sql( Db::sql(
'update items_users 'update items_users
set `1price` = (select price_1 from items_main where items_main.item_id = ? and sid = 1) set `1price` = (select price1 from items_main where id = ?)
where id = ?', where id = ?',
[$item, $itemId] [$item, $itemId]
); );
@ -213,7 +212,7 @@ class Register
} }
private function addEffects(int $uid, int ...$eids) private function addEffects(int $uid, int ...$eids): void
{ {
$in = implode(',', $eids); $in = implode(',', $eids);
$q = $q =

View File

@ -7,23 +7,25 @@ use Core\Db;
class Reputation class Reputation
{ {
private array $r; private array $r;
private int $uid;
public function __construct(int $userid) public function __construct(int $userid)
{ {
$this->uid = $userid;
$this->r = Db::getRow( $this->r = Db::getRow(
'select *, 'select *,
(repcapitalcity+repdemonscity+repangelscity+repsuncity+repdreamscity+repabandonedplain+repsandcity+repemeraldscity+repdevilscity) as allrep, (repcapitalcity+repdemonscity+repangelscity+repsuncity+repdreamscity+repabandonedplain+repsandcity+repemeraldscity+repdevilscity) as allrep,
(nu_capitalcity+nu_demonscity+nu_angelscity+nu_suncity+nu_dreamscity+nu_abandonedplain+nu_sandcity+nu_emeraldscity+nu_devilscity) as allnurep (nu_capitalcity+nu_demonscity+nu_angelscity+nu_suncity+nu_dreamscity+nu_abandonedplain+nu_sandcity+nu_emeraldscity+nu_devilscity) as allnurep
from rep where id = ?', [$userid] from rep where id = ?', [$this->uid]
); );
if (empty($this->r)) { if (empty($this->r)) {
Db::sql('insert into rep (id) value (?)', [$userid]); Db::sql('insert into rep (id) value (?)', [$this->uid]);
$this->r = Db::getRow( $this->r = Db::getRow(
'select *, 'select *,
(repcapitalcity+repdemonscity+repangelscity+repsuncity+repdreamscity+repabandonedplain+repsandcity+repemeraldscity+repdevilscity) as allrep, (repcapitalcity+repdemonscity+repangelscity+repsuncity+repdreamscity+repabandonedplain+repsandcity+repemeraldscity+repdevilscity) as allrep,
(nu_capitalcity+nu_demonscity+nu_angelscity+nu_suncity+nu_dreamscity+nu_abandonedplain+nu_sandcity+nu_emeraldscity+nu_devilscity) as allnurep (nu_capitalcity+nu_demonscity+nu_angelscity+nu_suncity+nu_dreamscity+nu_abandonedplain+nu_sandcity+nu_emeraldscity+nu_devilscity) as allnurep
from rep where id = ?', [$userid] from rep where id = ?', [$this->uid]
); );
} }
} }
@ -32,4 +34,14 @@ class Reputation
{ {
return $this->r; return $this->r;
} }
public function addRep(string $dungeonName, int $value): int
{
if (!isset($this->r[$dungeonName]) || $value <= 0) {
return 0;
}
$this->r[$dungeonName] += $value;
Db::sql("update rep set $dungeonName = ? where id = ?", [$value, $this->uid]);
return $this->r[$dungeonName];
}
} }

View File

@ -2,10 +2,10 @@
namespace User; namespace User;
use Core\Config;
use Core\Db; use Core\Db;
use Helper\Conversion; use Helper\Conversion;
use Item\Data\Bonuses; use Item\Data\Bonuses;
use Item\Data\Bonuses as ItemBonuses;
use User; use User;
class Stats class Stats
@ -118,27 +118,26 @@ class Stats
/** /**
* Присваиваем только разрешенные значения. * Присваиваем только разрешенные значения.
*/ */
private static function a(&$array, string $key, $value): array private static function a(&$array, string $key, $value): void
{ {
if (!in_array($key, array_keys(Bonuses::getBonusSystemNames()))) { if (!in_array($key, array_keys(Bonuses::getBonusSystemNames()))) {
return []; return;
} }
$array[$key] = $value; $array[$key] = $value;
return $array;
} }
public function getStats($uid, $i1 = null, $res = 0, $reimg = false, $btl_cache = false, $minimal = false): array public function getStats(int|array|null $uid = null, $i1 = 0, $res = 0, $reimg = false, $btl_cache = false): array
{ {
if (empty($uid) || $uid == $this->u->info['id'] && $res != 1) {
if (is_array($uid)) { //$u = $this->u->info;
$u = $uid;
} elseif ($uid != $this->u->info['id'] || $res == 1) {
$u = User::getInfo($uid); $u = User::getInfo($uid);
} elseif (is_array($uid)) {
$u = $uid;
} else { } else {
$u = $this->u->info; $u = User::getInfo($uid);
} }
if (!isset($u['id'], $u['stats'])) { if (!isset($u['id'])) {
return []; return [];
} }
@ -182,7 +181,7 @@ class Stats
} else { } else {
$st['levels'] = 'undefined'; $st['levels'] = 'undefined';
} }
$st2 = [];
$st['id'] = $u['id']; $st['id'] = $u['id'];
$st['login'] = $u['login']; $st['login'] = $u['login'];
$st['lvl'] = $u['level']; $st['lvl'] = $u['level'];
@ -207,6 +206,8 @@ class Stats
} }
unset($stats); unset($stats);
$baseStats = $st;
//Шаблонные картинки //Шаблонные картинки
if ($this->u->info['id'] === $u['id'] || $reimg) { if ($this->u->info['id'] === $u['id'] || $reimg) {
$itemsImages = Db::getRows('select * from items_img where uid = ? and img_id != 0', [$u['id']]); $itemsImages = Db::getRows('select * from items_img where uid = ? and img_id != 0', [$u['id']]);
@ -228,7 +229,7 @@ class Stats
item_id, inslot, useInBattle, btl_zd, iznosNOW, iznosMAX, magic_inci, name, items_users.id, img, `2h` item_id, inslot, useInBattle, btl_zd, iznosNOW, iznosMAX, magic_inci, name, items_users.id, img, `2h`
from items_users left join items_main on items_main.id = item_id where inOdet != 0 and uid = ?', [$u['id']]); from items_users left join items_main on items_main.id = item_id where inOdet != 0 and uid = ?', [$u['id']]);
$ia = ItemBonuses::getBonusSystemNames(); $ia = Bonuses::getBonusSystemNames();
$h = 0; $h = 0;
$hnd1 = 0; $hnd1 = 0;
$hnd2 = 0; $hnd2 = 0;
@ -485,8 +486,8 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$i9 = 1; $i9 = 1;
$i39[0] = 1; $i39[0] = 1;
while ($i9 <= 7) { while ($i9 <= 7) {
$st['a' . $i9] = $st['a' . $i9] - $st2['a' . $i9] + $reitm[$i]['add_a' . $i9]; $st['a' . $i9] = $st['a' . $i9] - $baseStats['a' . $i9] + $reitm[$i]['add_a' . $i9];
$st['mg' . $i9] = $st['mg' . $i9] - $st2['mg' . $i9] + $reitm[$i]['add_mg' . $i9]; $st['mg' . $i9] = $st['mg' . $i9] - $baseStats['mg' . $i9] + $reitm[$i]['add_mg' . $i9];
$i9++; $i9++;
} }
} elseif (isset($reitm[$i]['sm_abil']) && $i39[1] == 0) { } elseif (isset($reitm[$i]['sm_abil']) && $i39[1] == 0) {
@ -494,7 +495,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$i9 = 1; $i9 = 1;
$i39[1] = 1; $i39[1] = 1;
while ($i9 <= 12) { while ($i9 <= 12) {
$st['s' . $i9] = $st['s' . $i9] - $st2['s' . $i9] + $reitm[$i]['add_s' . $i9]; $st['s' . $i9] = $st['s' . $i9] - $baseStats['s' . $i9] + $reitm[$i]['add_s' . $i9];
$i9++; $i9++;
} }
} elseif (isset($reitm[$i]['sm_skill2']) && $i39[2] == 0) { } elseif (isset($reitm[$i]['sm_skill2']) && $i39[2] == 0) {
@ -505,36 +506,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$i++; $i++;
} }
} }
$st = $this->addMedalsBonuses($u['id'], $st);
//Харки от иконок
$efs = mysql_query(
'SELECT * FROM `users_ico` WHERE `uid`="' . mysql_real_escape_string(
$u['id']
) . '" AND (`endTime` > "' . time() . '" OR `endTime` = 0)'
);
while ($e = mysql_fetch_array($efs)) {
$sts = Conversion::dataStringToArray($e['bonus']);
$i = 0;
while ($i < count($ia)) {
if (isset($ia[$i])) {
if (!isset($sti[$ia[$i]])) {
$sti[$ia[$i]] = 0;
}
if (!isset($sts['add_' . $ia[$i]])) {
$sts['add_' . $ia[$i]] = 0;
}
$sti[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
if (!isset($st[$ia[$i]])) {
$st[$ia[$i]] = 0;
}
//
$st[$ia[$i]] += intval($sts['add_' . $ia[$i]]);
}
$i++;
}
}
$noeffectbattle = false; $noeffectbattle = false;
if ($u['battle'] > 0) { if ($u['battle'] > 0) {
@ -866,7 +838,10 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$st['act'] = 1; $st['act'] = 1;
} }
} }
}//Характеристики от статов }
//Характеристики от статов
if (!isset($st['hpAll'])) { if (!isset($st['hpAll'])) {
$st['hpAll'] = 0; $st['hpAll'] = 0;
} }
@ -977,7 +952,8 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
} }
$i++; $i++;
} }
}//Бонусы статов }
//Замена свитков //Замена свитков
if ($u['autospell'] != 0 && $u['battle'] == 0) { if ($u['autospell'] != 0 && $u['battle'] == 0) {
//проверяем свитки //проверяем свитки
@ -1026,231 +1002,12 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
[$i, $spe2g[$i], $u['id']]); [$i, $spe2g[$i], $u['id']]);
} }
} }
}//Бонусы статов
//ТУТ
//сила
if ($st['s1'] > 24 && $st['s1'] < 50) {
$st['m2'] += 15;
} }
if ($st['s1'] > 49 && $st['s1'] < 75) {
$st['pa2'] += 2; //Бонусы статов
$st['m2'] += 35; $this->addStatBonuses($st);
}
if ($st['s1'] > 74 && $st['s1'] < 100) { //если второе оружие одето
$st['pa2'] += 5;
$st['m2'] += 50;
}
if ($st['s1'] > 99 && $st['s1'] < 125) {
$st['pa2'] += 8;
$st['m2'] += 80;
}
if ($st['s1'] > 124 && $st['s1'] < 150) {
$st['pa2'] += 12;
$st['m2'] += 105;
}
if ($st['s1'] > 149 && $st['s1'] < 175) {
$st['pa2'] += 17;
$st['m7'] += 2;
}
if ($st['s1'] > 174 && $st['s1'] < 200) {
$st['pa2'] += 23;
$st['m7'] += 5;
}
if ($st['s1'] > 199) {
$st['pa2'] += 30;
$st['m7'] += 7;
}
if ($st['s2'] > 24 && $st['s2'] < 50) {
$st['pa1'] += 2;
$st['m4'] += 35;
}
if ($st['s2'] > 49 && $st['s2'] < 75) {
$st['pa1'] += 5;
$st['m2'] += 40;
$st['m4'] += 75;
}
if ($st['s2'] > 74 && $st['s2'] < 100) {
$st['pa1'] += 8;
$st['m2'] += 65;
$st['m4'] += 90;
}
if ($st['s2'] > 99 && $st['s2'] < 125) {
$st['pa1'] += 12;
$st['m2'] += 75;
$st['m4'] += 105;
}
if ($st['s2'] > 124 && $st['s2'] < 150) {
$st['pa1'] += 17;
$st['m2'] += 85;
$st['m4'] += 105;
$st['m15'] += 1;
}
if ($st['s2'] > 149 && $st['s2'] < 175) {
$st['pa1'] += 20;
$st['m2'] += 110;
$st['m4'] += 115;
$st['m15'] += 2;
}
if ($st['s2'] > 174 && $st['s2'] < 200) {
$st['pa1'] += 23;
$st['m2'] += 145;
$st['m4'] += 145;
$st['m15'] += 3;
}
if ($st['s2'] > 199) {
$st['pa1'] += 30;
$st['m2'] += 165;
$st['m4'] += 165;
$st['m15'] += 5;
}//интуиция
if ($st['s3'] > 24 && $st['s3'] < 50) {
$st['pa4'] += 2;
$st['m3'] += 2;
$st['m1'] += 25;
}
if ($st['s3'] > 49 && $st['s3'] < 75) {
$st['pa4'] += 5;
$st['m3'] += 5;
$st['m1'] += 55;
}
if ($st['s3'] > 74 && $st['s3'] < 100) {
$st['pa4'] += 8;
$st['m3'] += 10;
$st['m1'] += 75;
$st['m5'] += 25;
}
if ($st['s3'] > 99 && $st['s3'] < 125) {
$st['pa4'] += 12;
$st['m3'] += 15;
$st['m1'] += 105;
$st['m5'] += 35;
}
if ($st['s3'] > 124 && $st['s3'] < 150) {
$st['pa4'] += 17;
$st['m3'] += 20;
$st['m1'] += 125;
$st['m5'] += 45;
$st['m14'] += 1;
}
if ($st['s3'] > 149 && $st['s3'] < 175) {
$st['pa4'] += 20;
$st['m3'] += 30;
$st['m1'] += 145;
$st['m5'] += 50;
$st['m14'] += 2;
}
if ($st['s3'] > 174 && $st['s3'] < 200) {
$st['pa4'] += 23;
$st['m3'] += 35;
$st['m1'] += 165;
$st['m5'] += 55;
$st['m14'] += 3;
}
if ($st['s3'] > 199) {
$st['pa4'] += 30;
$st['m3'] += 40;
$st['m1'] += 185;
$st['m5'] += 65;
$st['m14'] += 5;
}//выносливость
if ($st['s4'] > 0) {
$st['hpAll'] += 30;
}
if ($st['s4'] > 24 && $st['s4'] < 50) {
$st['hpAll'] += 50;
}
if ($st['s4'] > 49 && $st['s4'] < 75) {
$st['hpAll'] += 100;
}
if ($st['s4'] > 74 && $st['s4'] < 100) {
$st['hpAll'] += 175;
$st['m19'] += 2;
}
if ($st['s4'] > 99 && $st['s4'] < 125) {
$st['hpAll'] += 250;
$st['m19'] += 4;
}
if ($st['s4'] > 124 && $st['s4'] < 150) {
$st['hpAll'] += 400;
$st['za'] += 25;
$st['zm'] += 25;
}
if ($st['s4'] > 149 && $st['s4'] < 175) {
$st['hpAll'] += 450;
$st['za'] += 50;
$st['zm'] += 50;
}
if ($st['s4'] > 174 && $st['s4'] < 200) {
$st['hpAll'] += 600;
$st['za'] += 100;
$st['zm'] += 100;
}
if ($st['s4'] > 199) {
$st['hpAll'] += 850;
$st['za'] += 125;
$st['zm'] += 125;
}//интелект
if ($st['s5'] > 24 && $st['s5'] < 50) {
$st['m11'] += 10;
}
if ($st['s5'] > 49 && $st['s5'] < 75) {
$st['m11'] += 15;
}
if ($st['s5'] > 74 && $st['s5'] < 100) {
$st['m11'] += 20;
}
if ($st['s5'] > 99 && $st['s5'] < 125) {
$st['m11'] += 25;
}
if ($st['s5'] > 124 && $st['s5'] < 150) {
$st['m11'] += 35;
}
if ($st['s5'] > 149 && $st['s5'] < 175) {
$st['m11'] += 50;
}
if ($st['s5'] > 174) {
$st['m11'] += 65;
$st['pzm'] += 2;
}
if ($st['s5'] > 199) {
$st['pzm'] += 5;
}//мудрость
if ($st['s6'] > 24 && $st['s6'] < 50) {
$st['mpAll'] += 150;
$st['speedmp'] += 100;
}
if ($st['s6'] > 49 && $st['s6'] < 75) {
$st['mpAll'] += 200;
$st['speedmp'] += 200;
}
if ($st['s6'] > 74 && $st['s6'] < 100) {
$st['mpAll'] += 250;
$st['speedmp'] += 350;
}
if ($st['s6'] > 99 && $st['s6'] < 125) {
$st['mpAll'] += 350;
$st['speedmp'] += 500;
}
if ($st['s6'] > 124 && $st['s6'] < 150) {
$st['mpAll'] += 500;
$st['speedmp'] += 500;
$st['pzm'] += 2;
}
if ($st['s6'] > 149 && $st['s6'] < 175) {
$st['mpAll'] += 700;
$st['speedmp'] += 600;
$st['pzm'] += 3;
}
if ($st['s6'] > 174 && $st['s6'] < 200) {
$st['mpAll'] += 900;
$st['speedmp'] += 700;
$st['pzm'] += 5;
}
if ($st['s6'] > 199) {
$st['mpAll'] += 900;
$st['speedmp'] += 700;
$st['pzm'] += 7;
}//если второе оружие одето
if ($hnd2 == 1 && $hnd1 == 1) { if ($hnd2 == 1 && $hnd1 == 1) {
$st['zona']++; $st['zona']++;
} }
@ -1399,75 +1156,16 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$st['reting'] = 1 + ceil($st['reting']); $st['reting'] = 1 + ceil($st['reting']);
if ($st['vip'] > 0) { //$u
$st['antm3'] += 20;
$st['zaproc'] += 5;
$st['zmproc'] += 5;
$st['m10'] += 20;
$st['pzm'] += 5;
}
//Бонус от медалей $this->addDungeonsBonuses($u['id'], $st);
$rep1 = mysql_fetch_array(
mysql_query(
'SELECT
`add_slot`,`nu_sandcity`,`n_sandcity`,
`dl1`,`id`,`rep1`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
`repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`,
`n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`,`nu_emeraldscity`,
`nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`,
`rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`,
(`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`+`repemeraldscity`+`repdevilscity`) as allrep,
(`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`+`nu_devilscity`) as allnurep FROM `rep` WHERE `id` = "' . $u['id'] . '" LIMIT 1'
)
);
if ($u['referals'] >= 3000) {
$st['speedhp'] += 50; //Добавочный подьем для игроков
$st['speedmp'] += 50;
$st['antm3'] += 25;
$st['m10'] += 15;
$st['m11'] += 15;
$st['speed_dungeon'] += 25;
$st['hpAll'] += 250;
}//Водосток
if ($rep1['repdreamscity'] >= 24999) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//излом
if ($rep1['repizlom'] == 9999) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Бездна
if ($rep1['repangelscity'] == 25000) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Катакомбы
if ($rep1['repdemonscity'] == 25000) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Грибница
if ($rep1['repdemonscity'] == 25000) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Пещера тысячи проклятий
if ($rep1['repcapitalcity'] == 25000) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Санд
if ($rep1['repsandcity'] == 25000) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Гора легиона
if ($rep1['repabandonedplain'] == 24999) {
$st['m10'] += 10;
$st['pzm'] += 1;
}//Добавочный подьем для игроков
$st['maxves'] += 500; $st['maxves'] += 500;
if ($u['admin'] > 0) { // ускоренная регенерация и пробег по подземелью if ($u['admin'] > 0) { // ускоренная регенерация и пробег по подземелью
$st['speed_dungeon'] = 10000; $st['speed_dungeon'] = 1000;
$st['speedhp'] = 10000; $st['speedhp'] = 1000;
if ($u['battle']) { if ($u['battle']) {
Db::sql("update stats set Db::sql("update stats set
tactic1 = tactic2 = tactic3 = tactic4 = tactic5 = tactic6 = tactic7 = 25, tactic1 = tactic2 = tactic3 = tactic4 = tactic5 = tactic6 = tactic7 = 25,
@ -1501,28 +1199,323 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
$rt = []; $rt = [];
if ($i1 == 1) { if ($i1 == 1) {
$rt[0] = $st; $rt[0] = $st;
$rt[1] = $st2; //родные статы $rt[1] = $baseStats; //родные статы
} else { } else {
$rt = $st; $rt = $st;
} }
if ($u['hpAll'] != $st['hpAll'] || $u['mpAll'] != $st['mpAll']) { if ($u['hpAll'] != $st['hpAll'] || $u['mpAll'] != $st['mpAll']) {
mysql_query( Db::sql('update stats set hpAll = ?, mpAll = ? where id = ?', [$st['hpAll'], $st['mpAll'], $u['id']]);
'UPDATE `stats` SET `hpAll` = "' . $st['hpAll'] . '",`mpAll` = "' . $st['mpAll'] . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1'
);
} }
if ($btl_cache) { if ($btl_cache) {
$dataca = [ $dataca = [
'st' => $st, 'st' => $st,
'st2' => $st2, 'st2' => $baseStats,
]; ];
$dataca = json_encode($dataca); $dataca = json_encode($dataca);
mysql_query( Db::sql('insert into battle_cache (battle, uid, time, data) values (?,?,unix_timestamp(),?)', [$u['battle'], $u['id'], $dataca]);
'INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("' . $u['id'] . '","' . $u['battle'] . '","' . mysql_real_escape_string(
$dataca
) . '","' . time() . '")'
);
} }
return $rt; return $rt;
} }
private function addMedalsBonuses(int $uid, array &$st): array
{
//Харки от иконок
$efs = Db::getColumn('select bonus from users_ico where uid = ? and (endTime > unix_timestamp() or endTime = 0)', [$uid]);
foreach ($efs as $data) {
$sts = Conversion::dataStringToArray($data);
foreach ($sts as $paramName => $value) {
//todo убедиться, что не могут прилететь параметры, которых нет в словарей бонусов предметов
if (!str_contains(implode(',', Bonuses::getBonusSystemNames()), 'add_' . $paramName)) { // есть ли параметр в разрешенных?
continue;
}
if (empty($st['add_' . $paramName])) {
$st['add_' . $paramName] = 0;
}
$st['add_' . $paramName] += (int)$value;
}
}
return $st;
}
private function addStatBonuses(array &$st): void
{
$this->addStrengthBonuses($st);
$this->addDexterityBonuses($st);
$this->addIntuitionBonuses($st);
$this->addEnduranceBonuses($st);
$this->addIntelligenceBonuses($st);
$this->addWisdomBonuses($st);
}
private function addStrengthBonuses(array &$st): void
{
if ($st['s1'] > 24 && $st['s1'] < 50) {
$st['m2'] += 15;
}
if ($st['s1'] > 49 && $st['s1'] < 75) {
$st['pa2'] += 2;
$st['m2'] += 35;
}
if ($st['s1'] > 74 && $st['s1'] < 100) {
$st['pa2'] += 5;
$st['m2'] += 50;
}
if ($st['s1'] > 99 && $st['s1'] < 125) {
$st['pa2'] += 8;
$st['m2'] += 80;
}
if ($st['s1'] > 124 && $st['s1'] < 150) {
$st['pa2'] += 12;
$st['m2'] += 105;
}
if ($st['s1'] > 149 && $st['s1'] < 175) {
$st['pa2'] += 17;
$st['m7'] += 2;
}
if ($st['s1'] > 174 && $st['s1'] < 200) {
$st['pa2'] += 23;
$st['m7'] += 5;
}
if ($st['s1'] > 199) {
$st['pa2'] += 30;
$st['m7'] += 7;
}
}
private function addDexterityBonuses(array &$st): void
{
if ($st['s2'] > 24 && $st['s2'] < 50) {
$st['pa1'] += 2;
$st['m4'] += 35;
}
if ($st['s2'] > 49 && $st['s2'] < 75) {
$st['pa1'] += 5;
$st['m2'] += 40;
$st['m4'] += 75;
}
if ($st['s2'] > 74 && $st['s2'] < 100) {
$st['pa1'] += 8;
$st['m2'] += 65;
$st['m4'] += 90;
}
if ($st['s2'] > 99 && $st['s2'] < 125) {
$st['pa1'] += 12;
$st['m2'] += 75;
$st['m4'] += 105;
}
if ($st['s2'] > 124 && $st['s2'] < 150) {
$st['pa1'] += 17;
$st['m2'] += 85;
$st['m4'] += 105;
$st['m15'] += 1;
}
if ($st['s2'] > 149 && $st['s2'] < 175) {
$st['pa1'] += 20;
$st['m2'] += 110;
$st['m4'] += 115;
$st['m15'] += 2;
}
if ($st['s2'] > 174 && $st['s2'] < 200) {
$st['pa1'] += 23;
$st['m2'] += 145;
$st['m4'] += 145;
$st['m15'] += 3;
}
if ($st['s2'] > 199) {
$st['pa1'] += 30;
$st['m2'] += 165;
$st['m4'] += 165;
$st['m15'] += 5;
}
}
private function addIntuitionBonuses(array &$st): void
{
//интуиция
if ($st['s3'] > 24 && $st['s3'] < 50) {
$st['pa4'] += 2;
$st['m3'] += 2;
$st['m1'] += 25;
}
if ($st['s3'] > 49 && $st['s3'] < 75) {
$st['pa4'] += 5;
$st['m3'] += 5;
$st['m1'] += 55;
}
if ($st['s3'] > 74 && $st['s3'] < 100) {
$st['pa4'] += 8;
$st['m3'] += 10;
$st['m1'] += 75;
$st['m5'] += 25;
}
if ($st['s3'] > 99 && $st['s3'] < 125) {
$st['pa4'] += 12;
$st['m3'] += 15;
$st['m1'] += 105;
$st['m5'] += 35;
}
if ($st['s3'] > 124 && $st['s3'] < 150) {
$st['pa4'] += 17;
$st['m3'] += 20;
$st['m1'] += 125;
$st['m5'] += 45;
$st['m14'] += 1;
}
if ($st['s3'] > 149 && $st['s3'] < 175) {
$st['pa4'] += 20;
$st['m3'] += 30;
$st['m1'] += 145;
$st['m5'] += 50;
$st['m14'] += 2;
}
if ($st['s3'] > 174 && $st['s3'] < 200) {
$st['pa4'] += 23;
$st['m3'] += 35;
$st['m1'] += 165;
$st['m5'] += 55;
$st['m14'] += 3;
}
if ($st['s3'] > 199) {
$st['pa4'] += 30;
$st['m3'] += 40;
$st['m1'] += 185;
$st['m5'] += 65;
$st['m14'] += 5;
}
}
private function addEnduranceBonuses(array &$st): void
{
//выносливость
if ($st['s4'] > 0) {
$st['hpAll'] += 30;
}
if ($st['s4'] > 24 && $st['s4'] < 50) {
$st['hpAll'] += 50;
}
if ($st['s4'] > 49 && $st['s4'] < 75) {
$st['hpAll'] += 100;
}
if ($st['s4'] > 74 && $st['s4'] < 100) {
$st['hpAll'] += 175;
$st['m19'] += 2;
}
if ($st['s4'] > 99 && $st['s4'] < 125) {
$st['hpAll'] += 250;
$st['m19'] += 4;
}
if ($st['s4'] > 124 && $st['s4'] < 150) {
$st['hpAll'] += 400;
$st['za'] += 25;
$st['zm'] += 25;
}
if ($st['s4'] > 149 && $st['s4'] < 175) {
$st['hpAll'] += 450;
$st['za'] += 50;
$st['zm'] += 50;
}
if ($st['s4'] > 174 && $st['s4'] < 200) {
$st['hpAll'] += 600;
$st['za'] += 100;
$st['zm'] += 100;
}
if ($st['s4'] > 199) {
$st['hpAll'] += 850;
$st['za'] += 125;
$st['zm'] += 125;
}
}
private function addIntelligenceBonuses(array &$st): void
{
//интелект
if ($st['s5'] > 24 && $st['s5'] < 50) {
$st['m11'] += 10;
}
if ($st['s5'] > 49 && $st['s5'] < 75) {
$st['m11'] += 15;
}
if ($st['s5'] > 74 && $st['s5'] < 100) {
$st['m11'] += 20;
}
if ($st['s5'] > 99 && $st['s5'] < 125) {
$st['m11'] += 25;
}
if ($st['s5'] > 124 && $st['s5'] < 150) {
$st['m11'] += 35;
}
if ($st['s5'] > 149 && $st['s5'] < 175) {
$st['m11'] += 50;
}
if ($st['s5'] > 174) {
$st['m11'] += 65;
$st['pzm'] += 2;
}
if ($st['s5'] > 199) {
$st['pzm'] += 5;
}
}
private function addWisdomBonuses(array &$st): void
{
//мудрость
if ($st['s6'] > 24 && $st['s6'] < 50) {
$st['mpAll'] += 150;
$st['speedmp'] += 100;
}
if ($st['s6'] > 49 && $st['s6'] < 75) {
$st['mpAll'] += 200;
$st['speedmp'] += 200;
}
if ($st['s6'] > 74 && $st['s6'] < 100) {
$st['mpAll'] += 250;
$st['speedmp'] += 350;
}
if ($st['s6'] > 99 && $st['s6'] < 125) {
$st['mpAll'] += 350;
$st['speedmp'] += 500;
}
if ($st['s6'] > 124 && $st['s6'] < 150) {
$st['mpAll'] += 500;
$st['speedmp'] += 500;
$st['pzm'] += 2;
}
if ($st['s6'] > 149 && $st['s6'] < 175) {
$st['mpAll'] += 700;
$st['speedmp'] += 600;
$st['pzm'] += 3;
}
if ($st['s6'] > 174 && $st['s6'] < 200) {
$st['mpAll'] += 900;
$st['speedmp'] += 700;
$st['pzm'] += 5;
}
if ($st['s6'] > 199) {
$st['mpAll'] += 900;
$st['speedmp'] += 700;
$st['pzm'] += 7;
}
}
private function addDungeonsBonuses(int $id, array &$st): void
{
$finishedDungeons = Db::getValue('select
if(repcapitalcity > 24999, 1, 0) +
if(repdemonscity > 24999, 1, 0) +
if(repangelscity > 24999, 1, 0) +
if(repdevilscity > 24999, 1, 0) +
if(repmooncity > 24999, 1, 0) +
if(repsuncity > 24999, 1, 0) +
if(repsandcity > 24999, 1, 0) +
if(repemeraldscity > 24999, 1, 0) +
if(repizlom > 24999, 1, 0) +
0 as finished from rep where id = ?', [$id]);
//Бонус за количество полностью вырытых пещер.
$st['m10'] += 10 * $finishedDungeons;
$st['pzm'] += $finishedDungeons;
}
} }

View File

@ -24,22 +24,9 @@ function makeLogin(int $id, string $login, int $level): string
function testMonster(array $mon): bool // ЧТО ТЫ БЛЯТЬ ТАКОЕ? ЧТО ТЫ ПРОВЕРЯЕШЬ? КАК ТЫ РАБОТАЕШЬ? function testMonster(array $mon): bool // ЧТО ТЫ БЛЯТЬ ТАКОЕ? ЧТО ТЫ ПРОВЕРЯЕШЬ? КАК ТЫ РАБОТАЕШЬ?
{ {
return return
( ($mon['back_day'] === -1 || $mon['back_day'] === idate('w') || idate('w') === 7) &&
$mon['back_day'] === -1 || ($mon['back_dd'] === -1 || $mon['back_dd'] === idate('j')) &&
( ($mon['back_mm'] === -1 || $mon['back_mm'] === idate('n')) &&
$mon['back_day'] === 7 ||
$mon['back_day'] === idate('w')
) &&
$mon['back_day'] === 7
) &&
(
$mon['back_dd'] === -1 ||
$mon['back_dd'] === idate('j')
) &&
(
$mon['back_mm'] === -1 ||
$mon['back_mm'] === idate('n')
) &&
( (
$mon['back_hh'] === -1 || $mon['back_hh'] === -1 ||
$mon['back_hh'] === idate('H') && $mon['back_hh'] === idate('H') &&

View File

@ -155,7 +155,7 @@ while ($i < 100) {
<div id="ttl" class="ttl_css" style="display:none;z-index:1111;"/> <div id="ttl" class="ttl_css" style="display:none;z-index:1111;"/>
</div> </div>
<div id="gi" class="gifin" style="display:none;"></div> <div id="gi" class="gifin" style="display:none;"></div>
<H3>Создать тестовый бой (Записать icq персу и скрыть: 17768719)</H3> <H3>Создать тестовый бой</H3>
<br> <br>
<br> <br>
<center> <center>
@ -247,7 +247,7 @@ while ($i < 100) {
{ {
if (isset($id['id'])) { if (isset($id['id'])) {
file_get_contents( file_get_contents(
'/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5( '/jx/battle/refresh1.php?uid=' . $id['id'] . '&cron_core=' . md5(
$id['id'] . '_brfCOreW@!_' . $id['pass'] $id['id'] . '_brfCOreW@!_' . $id['pass']
) . '&pass=' . $id['pass'] ) . '&pass=' . $id['pass']
); );
@ -305,18 +305,13 @@ while ($i < 100) {
} }
// //
$ef = '<img onmouseover="hi(this,\'<b>' . $pl['mname'] . '</b>' . $ei . '\',event,3,1,1,1,\'\');" onMouseOut="hic();" onMouseDown="hic();" src="//img.new-combats.tech/i/eff/' . $pl['img'] . '" width="40" height="25">'; $ef = '<img onmouseover="hi(this,\'<b>' . $pl['mname'] . '</b>' . $ei . '\',event,3,1,1,1,\'\');" onMouseOut="hic();" onMouseDown="hic();" src="//img.new-combats.tech/i/eff/' . $pl['img'] . '" width="40" height="25">';
$ef1 .= '<input id="eu1_' . $pl['id2'] . '" name="eu1_' . $pl['id2'] . '" value="0" type="hidden"><span class="nprsl0" id="e1_' . $pl['id2'] . '" onclick="eff(1,' . $pl['id2'] . ');">' . $ef . '</span>'; $ef1 .= '<input id="eu1_' . $pl['id2'] . '" name="eu1_' . $pl['id2'] . '" value="0" type="hidden"><span class="nprsl0" id="e1_' . $pl['id2'] . '" onclick="eff(1,' . $pl['id2'] . ')">' . $ef . '</span>';
$ef2 .= '<input id="eu2_' . $pl['id2'] . '" name="eu2_' . $pl['id2'] . '" value="0" type="hidden"><span class="nprsl0" id="e2_' . $pl['id2'] . '" onclick="eff(2,' . $pl['id2'] . ');">' . $ef . '</span>'; $ef2 .= '<input id="eu2_' . $pl['id2'] . '" name="eu2_' . $pl['id2'] . '" value="0" type="hidden"><span class="nprsl0" id="e2_' . $pl['id2'] . '" onclick="eff(2,' . $pl['id2'] . ')">' . $ef . '</span>';
} }
// //
$dv = ''; $dv = '';
$da = ''; $da = '';
$dv .= '<select style="font-size:12px;" name="botadminatack2"><option value="0">------ Выберите клона из списка ------</option>'; $dv .= '<select style="font-size:12px;" name="botadminatack2"><option value="0">------ Выберите клона из списка ------</option>';
//$sp_m = mysql_query('SELECT * FROM `users` WHERE `icq` = "17768719" ORDER BY `id` ASC'); //icq deprecaded and removed
while ($pl_m = mysql_fetch_array($sp_m)) {
$dv .= '<option value="' . $pl_m['id'] . '">' . $pl_m['id'] . ' [ ' . $pl_m['align'] . ' ] - ' . $pl_m['login'] . ' [' . $pl_m['level'] . ']</option>';
$da .= '<option value="' . $pl_m['id'] . '">' . $pl_m['id'] . ' [ ' . $pl_m['align'] . ' ] - ' . $pl_m['login'] . ' [' . $pl_m['level'] . ']</option>';
}
$dv .= '</select>'; $dv .= '</select>';
$da = '<select style="font-size:12px;" name="botadminatack1"><option value="0">------ Выберите клона из списка ------</option>' . $da . '</select>'; $da = '<select style="font-size:12px;" name="botadminatack1"><option value="0">------ Выберите клона из списка ------</option>' . $da . '</select>';
?> ?>

View File

@ -82,7 +82,8 @@ if (!isset($_COOKIE['d1c'])) {
<?= $userclan->isRegistered() ? "const clanImage = '" . Images::getSrc($userclan->getLogo()) . "';" : 'let clanImage;' ?> <?= $userclan->isRegistered() ? "const clanImage = '" . Images::getSrc($userclan->getLogo()) . "';" : 'let clanImage;' ?>
const c = { // Нихуясебе! Это суперглобальный объект, который тянется во все файлы и все яваскриты. let\const не использовать!
var c = {
noEr: 0, noEr: 0,
noErTmr: 0, noErTmr: 0,
url: '<?= Config::get('host') ?>', url: '<?= Config::get('host') ?>',

2181
inf.php

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
top.goSit(1); top.goSit(1);
var zas = new Array(); var zas = [];
var priem_use = 0; var priem_use = 0;
var magic_use = 0; var magic_use = 0;
var use_on_pers = 'none'; var use_on_pers = 'none';
@ -12,7 +12,7 @@ var leader_type = 1;
zas[3] = 0; zas[3] = 0;
zas[4] = 0; zas[4] = 0;
zas[5] = 0; zas[5] = 0;
var zbs = new Array(); var zbs = [];
zbs[1] = 0; zbs[1] = 0;
var sel_atack = 1; var sel_atack = 1;
var nos = 0; var nos = 0;
@ -35,8 +35,15 @@ function testClearZone() {
async function usepriem(id, t, img) { async function usepriem(id, t, img) {
if (t == 1) { if (t == 1) {
irn++; irn++;
await $.post(`jx/battle/refresh${server_fight}.php?rnd=${ggcode}&irn=${irn}`,{idlog:top.id_log,usepriem:id,useon:use_on_pers},function(data){$("#ref").html(data);}); await $.post(`jx/battle/refresh${server_fight}.php?rnd=${ggcode}&irn=${irn}`, {
use_on_pers = 'none'; top.goSit(1); idlog: top.id_log,
usepriem: id,
useon: use_on_pers
}, function (data) {
$("#ref").html(data);
});
use_on_pers = 'none';
top.goSit(1);
return return
} }
return alert('Not found'); return alert('Not found');
@ -46,8 +53,16 @@ async function useitem(id, t, use_item_on) {
if (t == 1) { if (t == 1) {
irn++; irn++;
if (top.c.noEr == 0) { if (top.c.noEr == 0) {
top.c.noEr = 1; clearTimeout(top.c.noErTmr); top.c.noErTmr = setTimeout('top.c.noEr = 0;',1000); top.c.noEr = 1;
await $.post(`jx/battle/refresh${server_fight}.php?rnd=${ggcode}&irn=${irn}`,{idlog:top.id_log,useitem:id,useitemon:use_item_on},function(data){$("#ref").html(data);}); clearTimeout(top.c.noErTmr);
top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000);
await $.post(`jx/battle/refresh${server_fight}.php?rnd=${ggcode}&irn=${irn}`, {
idlog: top.id_log,
useitem: id,
useitemon: use_item_on
}, function (data) {
$("#ref").html(data);
});
} }
return top.goSit(1); return top.goSit(1);
} }
@ -62,7 +77,8 @@ function change_radioKeys(id,cper) {
var z = 0, t = 0, k = 0; var z = 0, t = 0, k = 0;
var i = 1, j = 1; var i = 1, j = 1;
while (i <= za) { while (i <= za) {
j = 1; jo = 0; j = 1;
jo = 0;
while (j <= 5) { while (j <= 5) {
var radio = document.getElementById(`atack_${i}_${j}`); var radio = document.getElementById(`atack_${i}_${j}`);
if (radio != undefined) { if (radio != undefined) {
@ -100,8 +116,7 @@ function change_radioKeys(id,cper) {
if (z > 0) { if (z > 0) {
if (id == 0) { if (id == 0) {
//автовыставление //автовыставление
} } else change_radio(z, id, t, 1)
else change_radio(z,id,t,1)
} }
} }
@ -196,6 +211,7 @@ function radio_off(id, zone, type) {
i++; i++;
} }
} }
function all_radio_off() { function all_radio_off() {
var i = 1; var i = 1;
while (i <= 5) { while (i <= 5) {
@ -210,6 +226,7 @@ function all_radio_off() {
} }
zbs[1] = 0; zbs[1] = 0;
} }
function genZoneBlock() { function genZoneBlock() {
var i = 1; var i = 1;
while (i <= 5) { while (i <= 5) {
@ -242,15 +259,6 @@ function genZoneAtack() {
} }
} }
// function nocon() {
// if (connect == 0) {
// if (noconnect < 0) {
// //document.getElementById('ref').innerHTML = '<font color=red><b><center>Подождите, идет инициализация...</center></b></font>';
// //g_iCount = 45;
// }
// }
// }
function genteam(team) { function genteam(team) {
document.getElementById('teams').innerHTML = team; document.getElementById('teams').innerHTML = team;
} }
@ -317,12 +325,24 @@ async function atack() {
top.c.noEr = 1; top.c.noEr = 1;
clearTimeout(top.c.noErTmr); clearTimeout(top.c.noErTmr);
top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000); top.c.noErTmr = setTimeout('top.c.noEr = 0;', 1000);
await $.post(`jx/battle/refresh${server_fight}.php?irn=${irn}&rnd=${ggcode}`,{atack:ago,block:bgo,idlog:top.id_log,idpr:priem_use,mgid:magic_use,useon:use_on_pers,smn:smena_login,ldrl:leader_login,ldrt:leader_type},function(data){$("#ref").html(data);}); await $.post(`jx/battle/refresh${server_fight}.php?irn=${irn}&rnd=${ggcode}`, {
atack: ago,
block: bgo,
idlog: top.id_log,
idpr: priem_use,
mgid: magic_use,
useon: use_on_pers,
smn: smena_login,
ldrl: leader_login,
ldrt: leader_type
}, function (data) {
$("#ref").html(data);
});
} }
} }
var g_iCount = new Number(); var g_iCount = Number();
var g_iCount = 45; var g_iCount = 45;
var tmr0057 = null; var tmr0057 = null;
@ -414,6 +434,7 @@ function mainstatus(id) {
} }
top.goSit(1); top.goSit(1);
} }
function rand_img() { function rand_img() {
if (level < 4) { if (level < 4) {
img_battle = `<img src='//img.new-combats.tech/i/battle/${(Math.floor(Math.random(2) * 2))}.gif'>`; img_battle = `<img src='//img.new-combats.tech/i/battle/${(Math.floor(Math.random(2) * 2))}.gif'>`;
@ -424,10 +445,11 @@ function rand_img() {
var fstlh = 0; var fstlh = 0;
var lsti = 0; var lsti = 0;
var lsthd = new Array(); var lsthd = [];
var id_log_ar = new Array(); var id_log_ar = [];
var id_log; var id_log;
var type_log = top.type_log; var type_log = top.type_log;
function add_log(id, foryou, text, hod_id, my, last_hod, vars) { function add_log(id, foryou, text, hod_id, my, last_hod, vars) {
if (top.des == 1) type_log = 0 if (top.des == 1) type_log = 0
else type_log = 1; else type_log = 1;
@ -481,6 +503,7 @@ function add_log(id, foryou, text, hod_id, my, last_hod, vars) {
top.rmve(`#battle_log_${hod_id - 7}`); top.rmve(`#battle_log_${hod_id - 7}`);
} }
} }
//-- Мой лог-------------------------------- //-- Мой лог--------------------------------
//------------------------------------------- //-------------------------------------------
function add_mlog(id, foryou, text, hod_id, my, last_hod, vars) { function add_mlog(id, foryou, text, hod_id, my, last_hod, vars) {
@ -503,6 +526,7 @@ function add_mlog(id, foryou, text, hod_id, my, last_hod, vars) {
top.rmve(`#battle_mlog_${hod_id - 14}`); top.rmve(`#battle_mlog_${hod_id - 14}`);
} }
} }
//------------------------------------------- //-------------------------------------------

View File

@ -74,7 +74,7 @@ function popup(element, content, width = 230) {
}); });
} }
function hi(el, txt, e, tp, st, sm, fm, css) { function hi(el, txt, e, tp, st, sm, fm, css = '') {
if (!e) e = window.event; if (!e) e = window.event;
top.xyfmn = [el, txt, e, tp, st, sm, fm, css]; top.xyfmn = [el, txt, e, tp, st, sm, fm, css];
var x = e.pageX, y = e.pageY; var x = e.pageX, y = e.pageY;

View File

@ -1,7 +1,7 @@
<?php <?php
$log_text = array(); $log_text = [];
$log_text[0] = array(); //для муж. $log_text[0] = []; //для муж.
//R1 //R1
$log_text[0][1][0] = 'вспомнил что-то важное'; $log_text[0][1][0] = 'вспомнил что-то важное';
$log_text[0][1][1] = 'высморкался'; $log_text[0][1][1] = 'высморкался';
@ -174,7 +174,7 @@ $log_text[0][14][2] = 'мертв!';
$log_text[0][14][3] = 'убит!'; $log_text[0][14][3] = 'убит!';
$log_text[0][14][4] = 'проиграл бой!'; $log_text[0][14][4] = 'проиграл бой!';
$log_text[1] = array(); //для жен. $log_text[1] = []; //для жен.
//R1 //R1
$log_text[1][1][0] = 'вспомнила что-то важное'; $log_text[1][1][0] = 'вспомнила что-то важное';
$log_text[1][1][1] = 'высморкалась'; $log_text[1][1][1] = 'высморкалась';
@ -356,11 +356,6 @@ $log_text[0][15][2] = 'потратил свой ход на прием';
$log_text[1][15][2] = 'потратила свой ход на прием'; $log_text[1][15][2] = 'потратила свой ход на прием';
//Приемы / приемы //Приемы / приемы
$log_text[0][16][0] = 'использовал'; $log_text[0][16][0] = 'использовал';
$log_text[1][16][0] = 'использовала'; $log_text[1][16][0] = 'использовала';
@ -441,4 +436,3 @@ $log_text[1][21][4] = '{u1} с испугу произнесла, первое
$log_text[1][21][5] = '{u1} впала в транс и начала бормотать заклятие &quot;{pr}&quot;'; $log_text[1][21][5] = '{u1} впала в транс и начала бормотать заклятие &quot;{pr}&quot;';
$log_text[1][21][6] = '{u1} очнулась от медитации, и призвала заклятье &quot;{pr}&quot;'; $log_text[1][21][6] = '{u1} очнулась от медитации, и призвала заклятье &quot;{pr}&quot;';
?>

View File

@ -1,53 +1,36 @@
<?php <?php
use Core\Config;
use Core\Db;
session_start(); session_start();
$tm = microtime(); $tm = microtime(true);
$tm = explode(' ', $tm);
$tm = $tm[0] + $tm[1];
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
require_once('../../_incl_data/__config.php'); require_once('../../_incl_data/__config.php');
} }
if (isset($_GET['cron_core'])) {
function getIPblock()
{
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
}
}
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
define('GAME', true); define('GAME', true);
require_once('../../_incl_data/class/__db_connect.php'); require_once('../../_incl_data/class/__db_connect.php');
} }
function e($t) function e($t): void
{ {
(new Chat())->debug($t, true); (new Chat())->debug($t, true);
} }
if (isset($_GET['cron_core'])) { if (isset($_GET['cron_core'])) { // что ты такое?
$id = [ $id = [
'id' => $_GET['uid'], 'id' => $_GET['uid'],
'pass' => $_GET['pass'], 'pass' => $_GET['pass'],
]; ];
if (md5($id['id'] . '_brfCOreW@!_' . $id['pass']) == $_GET['cron_core']) { if (md5($id['id'] . '_brfCOreW@!_' . $id['pass']) == $_GET['cron_core']) {
$uzr = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`pass` FROM `users` WHERE `id` = "' . mysql_real_escape_string(
$id['id']
) . '" AND `pass` = "' . mysql_real_escape_string($id['pass']) . '" LIMIT 1'
)
);
if (isset($uzr['id'])) {
$CRON_CORE = true; $CRON_CORE = true;
$_COOKIE['login'] = $uzr['login']; $_COOKIE['login'] = User::getLoginById($id['id']);
//$_COOKIE['pass'] = $uzr['pass'];
$_POST['id'] = 'reflesh'; $_POST['id'] = 'reflesh';
} }
unset($uzr);
}
} }
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
@ -58,7 +41,12 @@ if (!isset($CRON_CORE)) {
header('Pragma: no-cache'); header('Pragma: no-cache');
} }
if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE)) && (isset($_POST['atack'], $_POST['block']) || (isset($_POST['id']) && $_POST['id'] == 'reflesh') || isset($_POST['usepriem']) || isset($_POST['useitem']))) { if (
$_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' && !isset($CRON_CORE) ||
!isset($_POST['atack'], $_POST['block']) && (!isset($_POST['id']) || $_POST['id'] != 'reflesh') && !isset($_POST['usepriem']) && !isset($_POST['useitem'])
) {
return;
}
unset($tm); unset($tm);
$js = ''; $js = '';
@ -67,64 +55,44 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
$priem = new Priems(); $priem = new Priems();
if ($u->info['battle'] == 0) { if ($u->info['battle'] == 0) {
$btl_last = mysql_fetch_array( $btlLastId = Db::getValue('select id from battle_users where uid = ? and finish = 0 limit 1', [$u->info['id']]);
mysql_query( if ($btlLastId) {
'SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1' echo "<script>document.getElementById('teams').style.display='none'; var battleFinishData = '{$u->info['battle_text']}';</script>";
) $u->info['battle'] = $btlLastId;
);
if (isset($btl_last['id']) && $u->info['battle'] == 0) {
echo '<script>document.getElementById(\'teams\').style.display=\'none\';var battleFinishData = "' . $u->info['battle_text'] . '";</script>';
$u->info['battle'] = $btl_last['id'];
$u->info['battle_lsto'] = true; $u->info['battle_lsto'] = true;
mysql_query( Db::sql("update stats set battle_text = '', last_b = 0 where id = ?", [$u->info['id']]);
'UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' Db::sql('update battle_users set finish = 1 where uid = ?', [$u->info['id']]);
);
mysql_query('UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = "' . $u->info['id'] . '"');
echo '<script>alert("Поединок для вас завершился.");location.href="main.php?finish=1";</script>'; echo '<script>alert("Поединок для вас завершился.");location.href="main.php?finish=1";</script>';
} }
} }
if (!isset($CRON_CORE) && (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']))) { if (!isset($CRON_CORE) && (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']))) {
die($c['exit']); die(Config::get('exit'));
} }
function json_fix_cyr($json_str) $u->stats = $u->getStats($u->info['id']);
{
return $json_str;
}
$u->stats = $u->getStats($u->info['id'], 0);
if (!isset($CRON_CORE) && $u->info['online'] < time() - 30) { if (!isset($CRON_CORE) && $u->info['online'] < time() - 30) {
mysql_query( Db::sql('update users set online = unix_timestamp(), timeMain = unix_timestamp() where id = ?', [$u->info['id']]);
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
);
} }
$error = fn(string $str): string => '<div style="color: red; text-align: center; font-weight: bold;">' . $str . '</div>';
$btl = new Battle(); $btl = new Battle();
require_once('log_text.php'); require_once('log_text.php');
$btl->is = $u->is; $btl->is = $u->is;
$btl->items = $u->items; $btl->items = $u->items;
$btl->info = $btl->battleInfo($u->info['battle']); $btl->info = $btl->battleInfo($u->info['battle']);
if (!isset($btl->info['id'])) { if (!isset($btl->info['id'])) {
if ($u->info['battle'] == -1) { if ($u->info['battle'] == -1) {
//завершаем поединок //завершаем поединок
$upd = mysql_query( Db::sql('update users set battle = 0, online = unix_timestamp() where id = ?', [$u->info['id']]);
'UPDATE `users` SET `battle` = "0",`online` = "' . time( exit('<script>location="main.php";</script>');
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
if (!$upd) {
if (!isset($CRON_CORE)) {
die('Ошибка завершения поединка.');
}
} else { } else {
echo '<script>location="main.php";</script>'; Db::sql('update users set battle = 0 where battle = ?', [$u->info['battle']]);
}
} else {
mysql_query('UPDATE `users` SET `battle` = "0" WHERE `battle` = "' . $u->info['battle'] . '" LIMIT 100');
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
die('<script>location="main.php";</script>'); exit('<script>location="main.php";</script>');
} }
} }
} else { } else {
@ -134,7 +102,7 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
if (isset($_POST['useitem']) && $btl->testUsersLive()) { if (isset($_POST['useitem']) && $btl->testUsersLive()) {
$magic->useItems((int)$_POST['useitem']); $magic->useItems((int)$_POST['useitem']);
if ($u->error != '') { if ($u->error != '') {
echo '<div style="color: red; font-weight: bold; text-align: center">' . $u->error . '</div>'; echo $error($u->error);
} }
} }
@ -143,43 +111,44 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
if (isset($_POST['atack']) && isset($_POST['block'])) { if (isset($_POST['atack']) && isset($_POST['block'])) {
$btl->addAtack(); $btl->addAtack();
} }
//прием //прием
if (isset($_POST['usepriem']) && $btl->testUsersLive() && isset($btl->users[$btl->uids[$u->info['enemy']]])) { if (isset($_POST['usepriem']) && $btl->testUsersLive() && isset($btl->users[$btl->uids[$u->info['enemy']]])) {
$priem->pruse($_POST['usepriem']); $priem->pruse($_POST['usepriem']);
} }
//используем заклятие / пирожки //используем заклятие / пирожки
//не используем? О_о
//проводим действия (удары, использование приемов, если есть возможность нанести удар или использовать прием) //проводим действия (удары, использование приемов, если есть возможность нанести удар или использовать прием)
$btl->testActions(); $btl->testActions();
//авто-смена противника, либо просто смена противника //авто-смена противника, либо просто смена противника
if ($u->stats['hpNow'] >= 1) { if ($u->stats['hpNow'] < 1) {
$btl->mainStatus = 3;
} else {
//ручная смена //ручная смена
if (isset($_POST['smn']) && $_POST['smn'] != 'none') { if (isset($_POST['smn']) && $_POST['smn'] != 'none') {
/* ---------------- */ /* ---------------- */
$uidz = mysql_fetch_array( $uidz = Db::getValue('select if(inUser > 0, inUser, id) as id from users where login = ? and battle = ?', [$_POST['smn'], $u->info['battle']]);
mysql_query(
'SELECT `id`,`inUser` FROM `users` WHERE `login` = "' . mysql_real_escape_string( $rsm = $btl->smena($uidz);
$_POST['smn']
) . '" AND `battle` = "' . $u->info['battle'] . '" LIMIT 1'
)
);
if ($uidz['inUser'] > 0) {
$uidz['id'] = $uidz['inUser'];
}
$rsm = $btl->smena($uidz['id'], false);
if ($rsm != 1) { if ($rsm != 1) {
echo '<font color=red><center><b>' . $rsm . '</b></center></font>'; echo $error($rsm);
} }
unset($rsm); unset($rsm);
$js .= 'smena_login = \'none\';'; $js .= 'smena_login = \'none\';';
} }
//авто-смена //авто-смена
if ($u->info['enemy'] == 0 || $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] <= 0 || isset($btl->ga[$u->info['id']][$u->info['enemy']])) { if (
$u->info['enemy'] == 0 ||
$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] <= 0 ||
isset($btl->ga[$u->info['id']][$u->info['enemy']])
) {
$btl->autoSmena(); $btl->autoSmena();
} }
} else {
$btl->mainStatus = 3;
} }
//получаем данные о поединке //получаем данные о поединке
@ -190,6 +159,7 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
if (!isset($_POST['usepriem'])) { if (!isset($_POST['usepriem'])) {
$btl->testFinish(); $btl->testFinish();
} }
if ($btl->info['team_win'] == -1) { if ($btl->info['team_win'] == -1) {
$js .= $btl->genTeams($u->info['id']); $js .= $btl->genTeams($u->info['id']);
} else { } else {
@ -205,22 +175,29 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
$js .= $btl->myInfo($u->info['id'], 1); $js .= $btl->myInfo($u->info['id'], 1);
//выводим данные //выводим данные
if ($btl->e != '') { if ($btl->e != '') {
echo '<font color="red"><center><b>' . $btl->e . '</b></center></font>'; echo $error($btl->e);
} }
if (isset($btl->ga[$u->info['id']][$u->info['enemy']])) {
if ($u->info['hpNow'] >= 1) { if (
isset($btl->ga[$u->info['id']][$u->info['enemy']]) &&
$u->info['hpNow'] >= 1
) {
$btl->mainStatus = 2; $btl->mainStatus = 2;
} } elseif (
} else { $u->info['enemy'] != 0 &&
if ($u->info['enemy'] != 0 && $btl->info['team_win'] == -1 && $u->info['hpNow'] >= 1) { $btl->info['team_win'] == -1 &&
$u->info['hpNow'] >= 1
) {
$js .= $btl->myInfo($u->info['enemy'], 2); $js .= $btl->myInfo($u->info['enemy'], 2);
} }
}
if ($btl->info['izlom'] > 0) { if ($btl->info['izlom'] > 0) {
$js .= 'volna(' . (1 + $btl->info['izlomRoundSee']) . ');'; $js .= 'volna(' . (1 + $btl->info['izlomRoundSee']) . ');';
} }
$i = 1; $i = 1;
while ($i <= 7) { while ($i <= 7) {
if ($btl->users[$btl->uids[$u->info['id']]]['tactic' . $i] < 0) { if ($btl->users[$btl->uids[$u->info['id']]]['tactic' . $i] < 0) {
@ -231,60 +208,62 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
} }
$i++; $i++;
} }
$atk1 = 0;
$rsys = '';
if ($rsys != '') {
$js .= $rsys;
}
unset($rsys);
if (isset($btl->ga[$u->info['enemy']][$u->info['id']])) {
$atk1 = 1;
}
}
$rehtml = '';
if (!isset($CRON_CORE)) {
$js .= '$("#priems").html("' . $priem->seeMy(2) . '");'; $js .= '$("#priems").html("' . $priem->seeMy(2) . '");';
$jslog = $btl->lookmLog(); $jslog = $btl->lookmLog() . $btl->lookLog();
$jslog .= $btl->lookLog();
if ($jslog != '') { if ($jslog != '') {
$js = $jslog . $js; $js = $jslog . $js;
} }
unset($jslog); unset($jslog);
$atk1 = isset($btl->ga[$u->info['enemy']][$u->info['id']]) ? 1 : 0;
$nabito = floor($btl->users[$btl->uids[$u->info['id']]]['battle_yron']);
$expmaybe = floor($btl->users[$btl->uids[$u->info['id']]]['battle_exp']);
$tmr = round(($btl->info['timeout'] / 60), 2); $tmr = round(($btl->info['timeout'] / 60), 2);
$persMagic = $u->btlMagicList();
$za = (int)$btl->stats[$btl->uids[$u->info['id']]]['zona'];
$zb = (int)$btl->testZonbVis();
$tactic1 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic1'];
$tactic2 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic2'];
$tactic3 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic3'];
$tactic4 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic4'];
$tactic5 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic5'];
$tactic6 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic6'];
$tactic7 = (int)$btl->users[$btl->uids[$u->info['id']]]['tactic7'];
$smnpty = (int)$u->info['smena'];
$mainstatus = $btl->mainStatus;
$ggcode = PassGen::new();
echo <<<HTML
$dtxtn = ''; <script>
eatk = $atk1;
$rehtml .= '<script type="text/javascript">eatk=' . $atk1 . '; $('#nabito').html('$nabito');
$("#nabito").html("' . (floor($btl->users[$btl->uids[$u->info['id']]]['battle_yron'])) . $dtxtn . '"); $('#expmaybe').html('$expmaybe');
$("#expmaybe").html("' . (floor($btl->users[$btl->uids[$u->info['id']]]['battle_exp'])) . '"); $('#timer_out').html('$tmr');
$("#timer_out").html("' . $tmr . '"); $('#pers_magic').html('$persMagic');
$(\'#pers_magic\').html("' . $u->btlMagicList() . '");
g_iCount = 30; g_iCount = 30;
noconnect = 15; noconnect = 15;
connect = 1; connect = 1;
$("#go_btn").show(); $('#go_btn').show();
$("#reflesh_btn").show(); $('#reflesh_btn').show();
za = ' . (0 + $btl->stats[$btl->uids[$u->info['id']]]['zona']) . '; genZoneAtack(); za = '$za'; genZoneAtack();
zb = ' . (0 + $btl->testZonbVis()) . '; genZoneBlock(); zb = '$zb'; genZoneBlock();
refleshPoints(); refleshPoints();
tactic(1,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic1']) . '); tactic(1,'$tactic1');
tactic(2,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic2']) . '); tactic(2,'$tactic2');
tactic(3,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic3']) . '); tactic(3,'$tactic3');
tactic(4,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic4']) . '); tactic(4,'$tactic4');
tactic(5,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic5']) . '); tactic(5,'$tactic5');
tactic(6,' . (0 + floor($btl->users[$btl->uids[$u->info['id']]]['tactic6'])) . '); tactic(6,'$tactic6');
smnpty=' . (0 + $u->info['smena']) . '; smnpty='$smnpty';
mainstatus(' . $btl->mainStatus . '); mainstatus('$mainstatus')
tactic(7,"' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic7']) . '"); tactic(7,'$tactic7');
smena_alls = "0"; smena_alls = '0';
ggcode="' . $code . '"; ggcode='$ggcode';
' . $js . ' $js
</script>'; </script>
HTML;
echo($rehtml);
if ($btl->cached) { if ($btl->cached) {
$btl->clear_cache_start(); $btl->clear_cache_start();
@ -292,7 +271,6 @@ if (($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
unset($atk1); unset($atk1);
} }
echo '<script>ggcode="' . $code . '";if(t057!=null){clearTimeout(t057);}</script>'; echo '<script>ggcode="' . PassGen::new() . '";if(t057!=null){clearTimeout(t057);}</script>';
} }
}

View File

@ -8,8 +8,9 @@ function e($t)
$_POST['id'] = 'reflesh'; $_POST['id'] = 'reflesh';
// //
if (isset($_POST['atack'], $_POST['block']) || isset($_POST['usepriem']) || isset($_POST['useitem'])) { if (!isset($_POST['atack'], $_POST['block']) && !isset($_POST['usepriem']) && !isset($_POST['useitem'])) {
return;
}
session_start(); session_start();
$tm = microtime(); $tm = microtime();
$tm = explode(' ', $tm); $tm = explode(' ', $tm);
@ -51,8 +52,7 @@ if (isset($_POST['atack'], $_POST['block']) || isset($_POST['usepriem']) || isse
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
if ($u->info['online'] < time() - 30) { if ($u->info['online'] < time() - 30) {
mysql_query( mysql_query(
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time( "UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time() . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
); );
} }
} }
@ -65,8 +65,7 @@ if (isset($_POST['atack'], $_POST['block']) || isset($_POST['usepriem']) || isse
if ($u->info['battle'] == -1) { if ($u->info['battle'] == -1) {
//завершаем поединок //завершаем поединок
$upd = mysql_query( $upd = mysql_query(
'UPDATE `users` SET `battle` = "0",`online` = "' . time( 'UPDATE `users` SET `battle` = "0",`online` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
); );
if (!$upd) { if (!$upd) {
if (!isset($CRON_CORE)) { if (!isset($CRON_CORE)) {
@ -233,14 +232,14 @@ if (isset($_POST['atack'], $_POST['block']) || isset($_POST['usepriem']) || isse
za = ' . (0 + $btl->stats[$btl->uids[$u->info['id']]]['zona']) . '; genZoneAtack(); za = ' . (0 + $btl->stats[$btl->uids[$u->info['id']]]['zona']) . '; genZoneAtack();
zb = ' . (0 + $btl->testZonbVis()) . '; genZoneBlock(); zb = ' . (0 + $btl->testZonbVis()) . '; genZoneBlock();
refleshPoints(); refleshPoints();
tactic(1,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic1']) . '); tactic(1,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic1']) . ')
tactic(2,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic2']) . '); tactic(2,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic2']) . ')
tactic(3,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic3']) . '); tactic(3,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic3']) . ')
tactic(4,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic4']) . '); tactic(4,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic4']) . ')
tactic(5,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic5']) . '); tactic(5,' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic5']) . ')
tactic(6,' . (0 + floor($btl->users[$btl->uids[$u->info['id']]]['tactic6'])) . '); tactic(6,' . (0 + floor($btl->users[$btl->uids[$u->info['id']]]['tactic6'])) . ')
smnpty=' . (0 + $u->info['smena']) . '; smnpty=' . (0 + $u->info['smena']) . ';
mainstatus(' . $btl->mainStatus . '); mainstatus(' . $btl->mainStatus . ')
tactic(7,"' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic7']) . '"); tactic(7,"' . (0 + $btl->users[$btl->uids[$u->info['id']]]['tactic7']) . '");
smena_alls = "0"; smena_alls = "0";
ggcode="' . $code . '"; ggcode="' . $code . '";
@ -257,5 +256,3 @@ if (isset($_POST['atack'], $_POST['block']) || isset($_POST['usepriem']) || isse
} }
echo '<script>ggcode="' . $code . '";if(t057!=null){clearTimeout(t057);}</script>'; echo '<script>ggcode="' . $code . '";if(t057!=null){clearTimeout(t057);}</script>';
} }
}
?>

View File

@ -1,22 +1,16 @@
<?php <?php
use Core\Config;
use Core\Db;
/** @var User $u */
if (!defined('GAME')) { if (!defined('GAME')) {
die(); die();
} }
$old_battle = true;
if (isset($_COOKIE['newbattle'])) {
$old_battle = false;
include('btl_2.php');
die();
}
include('jx/battle/log_text.php'); include('jx/battle/log_text.php');
if (!$old_battle) {
return;
}
if (isset($btl_last['id']) && $u->info['battle'] == 0) { if (isset($btl_last['id']) && $u->info['battle'] == 0) {
$u->info['battle'] = $btl_last['battle']; $u->info['battle'] = $btl_last['battle'];
} }
@ -25,49 +19,73 @@ if ($u->info['battle'] == 0 || isset($_GET['bend'])) {
die('<script>top.frames[\'main\'].location = "main.php";</script>'); die('<script>top.frames[\'main\'].location = "main.php";</script>');
} }
$thisBattle = mysql_fetch_array( $thisBattle = Db::getRow('select * from battle where id = ?', [$u->info['battle']]);
mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $u->info['battle'] . '" LIMIT 1') $allprice = Db::getValue('select sum(price1) from battle_users where battle = ?', [$u->info['battle']]);
);
$allprice = mysql_fetch_array( function typeBattle($x): array
mysql_query(
'SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "' . $u->info['battle'] . '" GROUP BY `uid` LIMIT 1'
)
);
$allprice = $allprice[0];
function typeBattle($x)
{ {
$r = [0, 0, 'Поединок', 'Кровавый Поединок']; return match (true) {
if ($x >= 50000 && $x < 100000) { $x >= 5000000 => [150, 150, 'Судный День', 'Судный День'],
$r = [25, 50, 'Великая Битва', 'Кровавая Битва']; $x >= 2500000 => [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'],
} elseif ($x < 500000) { $x >= 1000000 => [75, 100, 'Историческая Битва', 'Кровавая Сеча'],
$r = [50, 75, 'Величайшая Битва', 'Кровавая Резня']; $x >= 500000 => [50, 75, 'Величайшая Битва', 'Кровавая Резня'],
} elseif ($x < 1000000) { $x >= 100000 => [25, 50, 'Великая Битва', 'Кровавая Битва'],
$r = [75, 100, 'Историческая Битва', 'Кровавая Сеча']; default => [0, 0, 'Поединок', 'Кровавый Поединок'],
} elseif ($x < 2500000) { };
$r = [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'];
} elseif ($x >= 5000000) {
$r = [150, 150, 'Судный День', 'Судный День'];
} }
return $r;
function finish(User $u): void
{
if (!isset($_GET['finish'])) {
return;
}
Db::sql("update stats set battle_text = '', last_b = 0 where id = ?, $u->info['id'");
Db::sql('update battle_users set finish = 1 where uid = ?', [$u->info['id']]);
header('location: main.php');
die();
}
function convert($from, $to, $var)
{
if (is_array($var)) {
$new = [];
foreach ($var as $key => $val) {
$new[convert($from, $to, $key)] = convert($from, $to, $val);
}
$var = $new;
} else {
if (is_string($var)) {
$var = iconv($from, $to, $var);
}
}
return $var;
}
function normJsonStr($str)
{
return preg_replace_callback(
'/\\\u([a-f0-9]{4})/i',
function ($m) {
return chr(hexdec($m[1]) - 1072 + 224);
},
$str
);
} }
$allprice = typeBattle($allprice); $allprice = typeBattle($allprice);
if ($thisBattle['smert'] == 1) { if ($thisBattle['smert'] == 1) {
$allprice = [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение']; $allprice = [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение'];
} }
echo '<script>var server_fight = "";</script>';
?> ?>
<script src="/js/jquery.js" type="text/javascript"></script>
<link href="/btl_1.css" rel="stylesheet" type="text/css"> <script src="/js/jquery.js"></script>
<link href="/btl_1.css" rel="stylesheet">
<script> <script>
var server_fight = "";
<!--
//-->
function maginfo(z, p, m, obj) { function maginfo(z, p, m, obj) {
var r = ''; let r = '';
r += '<b>' + $(obj).attr('magelogin') + '</b><br><br>'; r += '<b>' + $(obj).attr('magelogin') + '</b><br><br>';
r += 'Мощь: ' + m + ', '; r += 'Мощь: ' + m + ', ';
r += 'Защита: ' + z + ', '; r += 'Защита: ' + z + ', ';
@ -77,14 +95,7 @@ echo '<script>var server_fight = "";</script>';
<?php <?php
if (isset($btl_last['id']) && ($u->info['battle'] == 0 || $u->info['battle'] == $btl_last['battle'])) { if (isset($btl_last['id']) && ($u->info['battle'] == 0 || $u->info['battle'] == $btl_last['battle'])) {
echo 'var battleFinishData = "' . $u->info['battle_text'] . '";'; echo 'var battleFinishData = "' . $u->info['battle_text'] . '";';
if (isset($_GET['finish'])) { finish($u);
mysql_query(
'UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = "' . $u->info['id'] . '"');
header('location: main.php');
die();
}
} else { } else {
echo 'var battleFinishData = -1;'; echo 'var battleFinishData = -1;';
} }
@ -185,7 +196,7 @@ echo '<script>var server_fight = "";</script>';
} }
</script> </script>
<div style="background-color:#e8e8e8"> <div style="background-color:#e8e8e8">
<script type="text/javascript" src="js/btl_info.js"></script> <script src="/js/btl_info.js"></script>
<script> <script>
$.ajaxSetup({cache: false}); $.ajaxSetup({cache: false});
$(window).error(function () { $(window).error(function () {
@ -193,7 +204,7 @@ echo '<script>var server_fight = "";</script>';
}); });
</script> </script>
<script src="//img.new-combats.tech/js/jx/jquery.form.js" type="text/javascript"></script> <script src="//img.new-combats.tech/js/jx/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript" src="/js/jquery.cookie.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var login = '<?= $u->info['login']; ?>'; var login = '<?= $u->info['login']; ?>';
var za = <?= 0 + $u->stats['zona']; ?>; var za = <?= 0 + $u->stats['zona']; ?>;
@ -234,38 +245,6 @@ echo '<script>var server_fight = "";</script>';
return string.toString().split(delimiter.toString()); return string.toString().split(delimiter.toString());
} }
<?php
function convert($from, $to, $var)
{
if (is_array($var)) {
$new = [];
foreach ($var as $key => $val) {
$new[convert($from, $to, $key)] = convert($from, $to, $val);
}
$var = $new;
} else {
if (is_string($var)) {
$var = iconv($from, $to, $var);
}
}
return $var;
}
function normJsonStr($str)
{
return preg_replace_callback(
'/\\\u([a-f0-9]{4})/i',
function ($m) {return chr(hexdec($m[1]) - 1072 + 224);},
$str
);
//deprecaded
// return preg_replace_callback(
// '/\\\u([a-f0-9]{4})/i',
// create_function('$m', 'return chr(hexdec($m[1])-1072+224);'),
// $str
// );
}
?>
var log_text = <?= normJsonStr(json_encode($log_text)); ?>; var log_text = <?= normJsonStr(json_encode($log_text)); ?>;
var youlogin = "<?=$u->info['login']?>"; var youlogin = "<?=$u->info['login']?>";
@ -387,7 +366,7 @@ echo '<script>var server_fight = "";</script>';
} }
</script> </script>
<script type="text/javascript" src="js/btl_mini.js"></script> <script src="/js/btl_mini.js"></script>
<div id="hint4" class="ahint"></div> <div id="hint4" class="ahint"></div>
<style> <style>
html, body { html, body {
@ -932,23 +911,14 @@ echo '<script>var server_fight = "";</script>';
<td height="1"></td> <td height="1"></td>
<td height="1"></td> <td height="1"></td>
<td height="1"></td> <td height="1"></td>
<td height="1"><img style="display:block" <td height="1">
src="https://<?= $c['img']; ?>/1x1.gif" <img style="display:block" src="<?= Config::img() ?>/1x1.gif" width="200" height="1"/></td>
width="200" height="1"/></td>
<td height="1"></td> <td height="1"></td>
<td height="1"></td> <td height="1"></td>
<td height="1"></td> <td height="1"></td>
</tr> </tr>
</table> </table>
</div> </div>
<?php
if ($u->info['level'] == 0) { ?>
<hr/>
<center><font color="#333333"><small>Просто нажмите <b>Вперёд!!!</b>
чтобы сделать рандомный удар</small></font></center>
<hr/>
<?php
} ?>
</td> </td>
</tr> </tr>
</table> </table>
@ -1075,7 +1045,7 @@ echo '<script>var server_fight = "";</script>';
<td valign="top"> <td valign="top">
<hr/> <hr/>
<div align="center"> <div align="center">
<font color="green"><b>На данный момент вами нанесено урона: </b></font><b class="private">&nbsp;<span <b style="color: green;">На данный момент вами нанесено урона: </b><b class="private">&nbsp;<span
id="nabito"><?php id="nabito"><?php
echo floor($u->info['battle_yron']); ?></span> HP&nbsp;</b><b echo floor($u->info['battle_yron']); ?></span> HP&nbsp;</b><b
style="color:blue">.</b><br/> style="color:blue">.</b><br/>

View File

@ -1,632 +0,0 @@
<?php
if(!defined('GAME'))
{
die();
}
$old_battle = true;
if( isset($_COOKIE['newbattle']) ) {
$old_battle = false;
include('btl_2.php');
die();
}
include('jx/battle/log_text.php');
if(!$old_battle) {
return;
}
if(isset($btl_last['id']) && $u->info['battle'] == 0) {
$u->info['battle'] = $btl_last['battle'];
}
if($u->info['battle'] == 0 || isset($_GET['bend']))
{
die('<script>top.frames[\'main\'].location = "main.php";</script>');
}
$thisBattle = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$u->info['battle'].'" LIMIT 1'));
$allprice = mysql_fetch_array(mysql_query('SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "'.$u->info['battle'].'" GROUP BY `uid` LIMIT 1'));
$allprice = $allprice[0];
function typeBattle($x) {
$r = array(0,0,'Поединок','Кровавый Поединок');
if( $x < 50000 ) {
//Обычный бой
}elseif( $x >= 50000 && $x < 100000 ) {
$r = array(25,50,'Великая Битва','Кровавая Битва');
}elseif( $x < 150000 ) {
$r = array(50,75,'Величайшая Битва','Кровавая Резня');
}elseif( $x < 200000 ) {
$r = array(75,100,'Историческая Битва','Кровавая Сеча');
}elseif( $x < 250000 ) {
$r = array(100,125,'Эпохальная Битва','Кровавое Побоище');
}elseif( $x >= 250000 ) {
$r = array(150,150,'Судный День','Судный День');
}
return $r;
}
$allprice = typeBattle($allprice);
/*if( $u->info['admin'] > 0 ) {
echo '<script>var server_fight = "_vip";</script>';
}else{*/
echo '<script>var server_fight = "";</script>';
//}
?>
<script src="/js/jquery.js" type="text/javascript"></script>
<link href="/btl_1.css" rel="stylesheet" type="text/css">
<script>
function maginfo(z,p,m,obj) {
var r = '';
r += '<b>'+$(obj).attr('magelogin')+'</b><br><br>';
r += 'Мощь: '+m+', ';
r += 'Защита: '+z+', ';
r += 'Подавление: '+p+'';
return r;
}
<?php
if(isset($btl_last['id']) && ( $u->info['battle'] == 0 || $u->info['battle'] == $btl_last['battle']) ) {
echo 'var battleFinishData = "'.$u->info['battle_text'].'";';
//$u->info['battle_text'] = '';
if( isset($_GET['finish'])) {
mysql_query('UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = "'.$u->info['id'].'"');
header('location: main.php');
die();
//die('<script>top.frames[\'main\'].location = "main.php";</script>');
}
}else{
echo 'var battleFinishData = -1;';
}
?>
var noErTmr;
var smnpty = <?=(0+$u->info['smena'])?>;
setInterval('top.c.noEr = 0;',250);
function mbsum(event)
{
//Enter
if(event.keyCode==13 && top.c.noEr==0){
if( document.getElementById('go_btn').style.display != 'none' || document.getElementById('reflesh_btn').style.display == '')
{
if( document.getElementById('mainpanel').style.display == 'none' ) {
reflesh();
}else{
atack();
}
}
top.c.noEr = 1; clearTimeout(top.c.noErTmr); /*top.c.noErTmr = setTimeout('top.c.noEr = 0;',1000);*/
}
//space
if(event.keyCode==32 && top.c.noEr==0){ reflesh(); top.c.noEr = 1; clearTimeout(top.c.noErTmr); /*top.c.noErTmr = setTimeout('top.c.noEr = 0;',1000);*/ }
//numes
if(event.keyCode==49) {
change_radioKeys(1,false);
}
if(event.keyCode==50) {
change_radioKeys(2,false);
}
if(event.keyCode==51) {
change_radioKeys(3,false);
}
if(event.keyCode==52) {
change_radioKeys(4,false);
}
if(event.keyCode==53) {
change_radioKeys(5,false);
}
if(event.keyCode==48) {
change_radioKeys(0,false);
}
}
$(document.body).bind('keyup',function(event){ mbsum(event); });
function shpb() {
$(document).find('div.pimg').unbind('mouseover');
$(document).find('div.pimg').unbind('mouseout');
$(document).find('div.pimg').unbind('mousedown');
$(document).find('div.pimg').bind('mouseover',function(){ top.hi(this,$(this).attr('stt'),event,0,1,1,1,'stt'); });
$(document).find('div.pimg').bind('mouseout',function(){ top.hic(); });
$(document).find('div.pimg').bind('mousedown',function(){ top.hic(); });
var test = $(document).find('div.pimg');
var i = 0;
while(i != -1) {
if(test[i] != undefined) {
if($(test[i]).attr('pog') > 1 && $(test[i]).attr('stl') == 0) {
$(test[i]).attr('stl',1);
$(test[i]).html('<span class="sp1">'+$(test[i]).attr('pog')+'</span><span class="sp4">'+$(test[i]).attr('pog')+'</span><span class="sp3">'+$(test[i]).attr('pog')+'</span><span class="sp2">'+$(test[i]).attr('pog')+'</span><div>'+$(test[i]).attr('pog')+'</div>'+$(test[i]).html());
}else if($(test[i]).attr('col') > 1 && $(test[i]).attr('stl') == 0) {
$(test[i]).attr('stl',1);
$(test[i]).html('<span class="sp1">x'+$(test[i]).attr('col')+'</span><span class="sp4">x'+$(test[i]).attr('col')+'</span><span class="sp3">x'+$(test[i]).attr('col')+'</span><span class="sp2">x'+$(test[i]).attr('col')+'</span><div>x'+$(test[i]).attr('col')+'</div>'+$(test[i]).html());
}
}else{
i = -2;
}
i++;
}
}
</script>
<div style="background-color:#e8e8e8">
<script type="text/javascript" src="js/btl_info.js"></script>
<script>
$.ajaxSetup({cache: false});
$(window).error(function(){
return true;
});
</script>
<script src="//img.new-combats.tech/js/jx/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript">
var login = '<?= $u->info['login']; ?>';
var za = <?= 0+$u->stats['zona']; ?>;
var zb = <?= 0+$u->stats['zonb']; ?>;
var level = <?= $u->info['level']; ?>;
function replaceAll(find, replace, str) {
return str.replace(new RegExp(find, 'g'), replace);
}
function explode( delimiter, string ) {
var emptyArray = { 0: '' };
if ( arguments.length != 2
|| typeof arguments[0] == 'undefined'
|| typeof arguments[1] == 'undefined' )
{
return null;
}
if ( delimiter == ''
|| delimiter == false
|| delimiter == null )
{
return false;
}
if ( typeof delimiter == 'function'
|| typeof delimiter == 'object'
|| typeof string == 'function'
|| typeof string == 'object' )
{
return emptyArray;
}
if ( delimiter == true ) {
delimiter = '1';
}
return string.toString().split ( delimiter.toString() );
}
<?php
function convert($from, $to, $var)
{
if (is_array($var))
{
$new = array();
foreach ($var as $key => $val)
{
$new[convert($from, $to, $key)] = convert($from, $to, $val);
}
$var = $new;
}
else if (is_string($var))
{
$var = iconv($from, $to, $var);
}
return $var;
}
function normJsonStr($str){
return preg_replace_callback(
'/\\\u([a-f0-9]{4})/i',
function ($m) {return chr(hexdec($m[1]) - 1072 + 224);},
$str
);
}
?>
var log_text = <?= normJsonStr(json_encode($log_text)); ?>;
var youlogin = "<?=$u->info['login']?>";
function looklogrep(text,vars) {
var vars = explode('||',vars);
var forYou = '';
var data = { };
var i = 0;
var j = {};
while(i != -1 ) {
if( vars[i] != undefined ) {
j = explode('=',vars[i]);
data[j[0]] = j[1];
}else{
i = -2;
}
i++;
}
text = replaceAll('{tm1}','<span class="date '+forYou+'">'+ data['time1'] +'</span>',text);
text = replaceAll('{u1}','<span onClick="top.chat.addto(\'' + data['login1'] + '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' + data['login1'] + '\',event,\'chat\'); return false;" class="CSSteam'+data['t1']+'">' + data['login1'] + '</span>',text);
text = replaceAll('{u2}','<span onClick="top.chat.addto(\'' + data['login2'] + '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' + data['login2'] + '\',event,\'chat\'); return false;" class="CSSteam'+data['t2']+'">' + data['login2'] + '</span>',text);
text = replaceAll('^^^^','=',text);
text = replaceAll('{pr}','<b>' + data['prm'] + '</b>',text);
var test_zb1 = [ 0 , 0 , 0 , 0 , 0 , 0];
var test_zb2 = [ 0 , 0 , 0 , 0 , 0 , 0];
i = 1;
j = data['bl2'];
while( i <= data['zb2'] ) {
test_zb1[ j ] = 1;
j++;
if( j > 5 ) {
j = 1;
}
i++;
}
i = 1;
while( i <= 5 ) {
j = 1;
rej = '';
while( j <= 5 ) {
zab = '';
if( i == j ) {
zab += '1'; //a
}else{
zab += '0'; //a
}
if( test_zb1[ j ] == 1) {
zab += '1'; //b
}else{
zab += '0'; //b
}
rej += '<img src="//img.new-combats.tech/i/zones/'+data['t2']+'/'+data['t1']+''+zab+'.gif">';
j++;
}
text = replaceAll('{zn2_' + i + '}',rej,text);
i++;
}
i = 1;
while( i <= 21 ) {
//замена R - игрок 1
if( log_text[data['s1']] != undefined ) {
if( log_text[data['s1']][i] != undefined ) {
r = log_text[data['s1']][i];
k = 0;
while( k != -1 ) {
if( r[k] != undefined ) {
text = replaceAll('{1x' + i + 'x' + k + '}','' + r[k] + '',text);
}else{
k = -2;
}
k++;
}
}
}
//замена R - игрок 2
if( log_text[data['s2']] != undefined ) {
if( log_text[data['s2']][i] != undefined ) {
r = log_text[data['s2']][i];
k = 0;
while( k != -1 ) {
if( r[k] != undefined ) {
text = replaceAll('{2x' + i + 'x' + k + '}','' + r[k] + '',text);
}else{
k = -2;
}
k++;
}
}
}
i++;
}
//text = replaceAll('^^^^','=',text);
/*text = replaceAll('{tm1}','<span class="date '+forYou+'">00:01</span>',text);
text = replaceAll('{tm2}','<span class="date '+forYou+'">00:02</span>',text);
text = replaceAll('{tm3}','<span class="date '+forYou+'">01.01.2015 00:01</span>',text);
text = replaceAll('{tm4}','<span class="date '+forYou+'">02.02.2015 00:02</span>',text);*/
//Повторная замена
text = replaceAll('{u1}','<span onClick="top.chat.addto(\'' + data['login1'] + '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' + data['login1'] + '\',event,\'chat\'); return false;" class="CSSteam'+data['t1']+'">' + data['login1'] + '</span>',text);
text = replaceAll('{u2}','<span onClick="top.chat.addto(\'' + data['login2'] + '\',\'to\'); return false;" oncontextmenu="top.infoMenu(\'' + data['login2'] + '\',event,\'chat\'); return false;" class="CSSteam'+data['t2']+'">' + data['login2'] + '</span>',text);
if( data['prm'] != undefined ) {
data['prm'] = replaceAll("rvnO","=",data['prm']);
}
//data['prm'] = replaceAll('^^^^','=', data['prm'] );
text = replaceAll('{pr}','<b>' + data['prm'] + '</b>',text);
text = replaceAll('^^^^','=',text);
text = replaceAll('==','',text);
if( ( data['login1'] == youlogin || data['login2'] == youlogin ) && youlogin != '' ) {
text = replaceAll('{fru}',' date2 ',text);
}else{
text = replaceAll('{fru}','',text);
}
/*text = replaceAll('{tm1}','<span class="date '+forYou+'">00:01</span>',text);
text = replaceAll('{tm2}','<span class="date '+forYou+'">00:02</span>',text);
text = replaceAll('{tm3}','<span class="date '+forYou+'">01.01.2015 00:01</span>',text);
text = replaceAll('{tm4}','<span class="date '+forYou+'">02.02.2015 00:02</span>',text);*/
return text;
}
</script>
<script type="text/javascript" src="js/btl_mini.js"></script>
<div id="hint4" class="ahint"></div>
<style>
html, body {
background-color:#e8e8e8;
}
</style>
<div align="center" onMouseDown="top.hic();" onMouseOut="top.hic();">
<table width="100%" bgcolor="#e8e8e8" border="0" cellspacing="0" cellpadding="1">
<tr>
<td valign="top" width="260"><div id="player1">
</div>
<div align="right"></div></td>
<td valign="top"><div align="center">
<table width="100%" height="15" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top"><div id="player1_login" style="float:left;"></div></td>
<td align="center"><h5><?php
if( $thisBattle['type'] == 99 ) {
echo str_replace(' ','&nbsp;',$allprice[3]);
}else{
echo str_replace(' ','&nbsp;',$allprice[2]);
}
?></h5></td>
<td width="50%" valign="top"><div id="player2_login" style="float:right;"></div></td>
</tr>
</table>
<table border="0" align="center" style="margin-top:-15px;" cellpadding="0" cellspacing="3">
<tr>
<td height="20">
<div id="ref2" name="ref2"></div><div id="ref" name="ref"></div></td>
</tr>
<tr>
<div id="error" style="display:none;"></div>
<td><div id="pers_magic" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
<td><img title="Пустой слот заклятия" src="//img.new-combats.tech/i/items/w/w101.gif" /></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td align="center">
<div id="ndfksdw">
<table width="100%" id="mainpanel222" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#A7A7A7"><div align="center"><strong>Атака</strong></div></td>
<td width="20" bgcolor="#A7A7A7"><div align="center" style="color:#A7A7A7;">-</div></td>
<td bgcolor="#A7A7A7"><div align="center"><strong>Защита</strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="2" id="mainpanel">
<tr>
<td><div id="zatack1_1" class="crop"><a onclick="change_radio(1,1,'atack',0);return false;" href="#"><img style="display:block;" id="atack_1_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack2_1" class="crop"><a onclick="change_radio(2,1,'atack',0);return false;" href="#"><img style="display:block;" id="atack_2_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack3_1" class="crop"><a onclick="change_radio(3,1,'atack',0);return false;" href="#"><img style="display:block;" id="atack_3_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack4_1" class="crop"><a onclick="change_radio(4,1,'atack',0);return false;" href="#"><img style="display:block;" id="atack_4_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack5_1" class="crop"><a onclick="change_radio(5,1,'atack',0);return false;" href="#"><img style="display:block;" id="atack_5_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="select_atack(1,1);" style="cursor:default;" align="left">удар в голову</td>
<td width="3" style="cursor:default;" onclick="select_atack(1,1);">&nbsp;</td>
<td><div id="zblock1_1" class="crop"><a onclick="change_radio(1,1,'block',0);return false;" href="#"><img style="display:block;" id="block_1_1" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="change_radio(1,1,'block');" style="cursor:default;" align="left"><div id="txtb1_1">&nbsp;блок головы</div>
<div id="txtb1_2">&nbsp;блок головы и груди</div>
<div id="txtb1_3">&nbsp;блок головы, груди и живота</div></td>
</tr>
<tr>
<td><div id="zatack1_2" class="crop"><a onclick="change_radio(1,2,'atack',0);return false;" href="#"><img style="display:block;" id="atack_1_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack2_2" class="crop"><a onclick="change_radio(2,2,'atack',0);return false;" href="#"><img style="display:block;" id="atack_2_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack3_2" class="crop"><a onclick="change_radio(3,2,'atack',0);return false;" href="#"><img style="display:block;" id="atack_3_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack4_2" class="crop"><a onclick="change_radio(4,2,'atack',0);return false;" href="#"><img style="display:block;" id="atack_4_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack5_2" class="crop"><a onclick="change_radio(5,2,'atack',0);return false;" href="#"><img style="display:block;" id="atack_5_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="select_atack(2,1);" style="cursor:default;" align="left">удар в грудь</td>
<td onclick="select_atack(2,1);" style="cursor:default;">&nbsp;</td>
<td><div id="zblock1_2" class="crop"><a onclick="change_radio(1,2,'block',0);return false;" href="#"><img style="display:block;" id="block_1_2" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="change_radio(1,2,'block');" style="cursor:default;" align="left"><div id="txtb2_1">&nbsp;блок груди</div>
<div id="txtb2_2">&nbsp;блок груди и живота</div>
<div id="txtb2_3">&nbsp;блок груди, живота и пояса</div></td>
</tr>
<tr>
<td><div id="zatack1_3" class="crop"><a onclick="change_radio(1,3,'atack',0);return false;" href="#"><img style="display:block;" id="atack_1_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack2_3" class="crop"><a onclick="change_radio(2,3,'atack',0);return false;" href="#"><img style="display:block;" id="atack_2_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack3_3" class="crop"><a onclick="change_radio(3,3,'atack',0);return false;" href="#"><img style="display:block;" id="atack_3_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack4_3" class="crop"><a onclick="change_radio(4,3,'atack',0);return false;" href="#"><img id="atack_4_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack5_3" class="crop"><a onclick="change_radio(5,3,'atack',0);return false;" href="#"><img style="display:block;" id="atack_5_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="select_atack(3,1);" style="cursor:default;" align="left">удар в живот</td>
<td onclick="select_atack(3,1);" style="cursor:default;">&nbsp;</td>
<td><div id="zblock1_3" class="crop"><a onclick="change_radio(1,3,'block',0);return false;" href="#"><img style="display:block;" id="block_1_3" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="change_radio(1,3,'block');" style="cursor:default;" align="left"><div id="txtb3_1">&nbsp;блок живота</div>
<div id="txtb3_2">&nbsp;блок живота и пояса</div>
<div id="txtb3_3">&nbsp;блок живота, пояса и ног</div></td>
</tr>
<tr>
<td><div id="zatack1_4" class="crop"><a onclick="change_radio(1,4,'atack',0);return false;" href="#"><img style="display:block;" id="atack_1_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack2_4" class="crop"><a onclick="change_radio(2,4,'atack',0);return false;" href="#"><img style="display:block;" id="atack_2_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack3_4" class="crop"><a onclick="change_radio(3,4,'atack',0);return false;" href="#"><img style="display:block;" id="atack_3_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack4_4" class="crop"><a onclick="change_radio(4,4,'atack',0);return false;" href="#"><img style="display:block;" id="atack_4_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack5_4" class="crop"><a onclick="change_radio(5,4,'atack',0);return false;" href="#"><img style="display:block;" id="atack_5_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="select_atack(4,1);" style="cursor:default;" align="left">удар в пояс(пах)</td>
<td onclick="select_atack(4,1);" style="cursor:default;">&nbsp;</td>
<td><div id="zblock1_4" class="crop"><a onclick="change_radio(1,4,'block',0);return false;" href="#"><img style="display:block;" id="block_1_4" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="change_radio(1,4,'block');" style="cursor:default;" align="left"><div id="txtb4_1">&nbsp;блок пояса</div>
<div id="txtb4_2">&nbsp;блок пояса и ног</div>
<div id="txtb4_3">&nbsp;блок пояса, ног и головы</div></td>
</tr>
<tr>
<td><div id="zatack1_5" class="crop"><a onclick="change_radio(1,5,'atack',0);return false;" href="#"><img style="display:block;" id="atack_1_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack2_5" class="crop"><a onclick="change_radio(2,5,'atack',0);return false;" href="#"><img style="display:block;" id="atack_2_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack3_5" class="crop"><a onclick="change_radio(3,5,'atack',0);return false;" href="#"><img style="display:block;" id="atack_3_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack4_5" class="crop"><a onclick="change_radio(4,5,'atack',0);return false;" href="#"><img style="display:block;" id="atack_4_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td><div id="zatack5_5" class="crop"><a onclick="change_radio(5,5,'atack',0);return false;" href="#"><img style="display:block;" id="atack_5_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="select_atack(5,1);" style="cursor:default;" align="left">удар по ногам</td>
<td onclick="select_atack(5,1);" style="cursor:default;">&nbsp;</td>
<td><div id="zblock1_5" class="crop"><a onclick="change_radio(1,5,'block',0);return false;" href="#"><img style="display:block;" id="block_1_5" class="radio_off" src="//img.new-combats.tech/i/misc/radio.gif" width="36" height="18" /></a></div></td>
<td onclick="change_radio(1,5,'block');" style="cursor:default;" align="left"><div id="txtb5_1">&nbsp;блок ног</div>
<div id="txtb5_2">&nbsp;блок ног и головы</div>
<div id="txtb5_3">&nbsp;блок ног, головы и груди</div></td>
</tr>
</table>
</div>
<div id="ref_menu_down" align="center">
<table width="100%" border="0" style="background-color:#f2f0f0;" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="5">&nbsp;</td>
<td width="20" title="Случайный удар" onclick="top.cb_radio_click($('#cr_rach_rc3'),3);"><script>top.slcbrc[3] = 1; if( top.slcbrc[3] == 0 ) { document.write(top.create_check('rc3','','off')); }else{ document.write(top.create_check('rc3','','on')); }</script></td>
<td width="20" title="Не сбрасывать выбор зон атаки\блока" onclick="top.cb_radio_click($('#cr_rach_rc4'),4);"><script>if( top.slcbrc[4] == 0 ) { document.write(top.create_check('rc4','','off')); }else{ document.write(top.create_check('rc4','','on')); }</script></td>
<td width="20">&nbsp;</td>
<td align="center">
<input name="fast_battle" id="fast_battle" type="hidden"/>
<input name="auto_battle" id="auto_battle" type="hidden" />
<button name="go_btn" type="button" id="go_btn" style="cursor:pointer;" class="buttons inpBtl btnnew" title="Вперёд!!!" onclick="atack();">Вперёд!!!</button>
<button name="reflesh_btn" onClick="reflesh(true);" type="button" id="reflesh_btn" style="cursor:pointer;display:none;" class="buttons inpBtl btnnew" title="Обновить" >Обновить</button>
<button name="back_menu_down" onClick="top.frames['main'].location='main.php?finish=<?php
echo microtime(); ?>';" type="button" id="back_menu_down" style="cursor:pointer;display:none;" class="btn" title="Вернуться" >Вернуться</button>
<input name="save_zones" id="save_zones" type="hidden" />
</td>
<td width="20"><img <?php
if( $u->info['lider'] != $u->info['battle'] ) { ?>style="display:none;cursor:pointer;" <?php }else{ ?>style="cursor:pointer;"<?php } ?>onclick="top.leaderFight();" id="btn_down_img3" style="cursor:pointer;" title="Передать флаг" src="//img.new-combats.tech/i/ico_change_leader1.gif" width="16" height="19" /></td>
<td width="40"><div align="right"><img onclick="top.smena1();" id="btn_down_img2" style="cursor:pointer;" title="Смена противника (3)" src="//img.new-combats.tech/i/ico_change.gif" width="16" height="19" />&nbsp;<img src="//img.new-combats.tech/i/ico_refresh.gif" name="btn_down_img1" width="16" height="19" id="btn_down_img1" style="cursor:pointer;" title="Обновить" onclick="reflesh();" /></div></td>
</tr>
<tr>
<td height="1"></td>
<td height="1"></td>
<td height="1"></td>
<td height="1"></td>
<td height="1"><img style="display:block" src="https://<?=$c['img'];?>/1x1.gif" width="200" height="1" /></td>
<td height="1"></td>
<td height="1"></td>
<td height="1"></td>
</tr>
</table>
</div>
<?php
if($u->info['level'] == 0) { ?><hr />
<center><font color="#333333"><small>Просто нажмите <b>Вперёд!!!</b> чтобы сделать рандомный удар</small></font></center><hr />
<?php } ?>
</td>
</tr>
</table> </td>
</tr>
<tr>
<td id="mainpanel2" style="height:118px; display:none;" align="center"></td>
</tr>
<tr>
<td><div style="padding-top:0px;padding-bottom:10px;" align="center">
<table <?php
if($u->info['level'] < 2) { echo ' style="display:none;" '; } ?> border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span title="Нанесенный удар" style="margin-right:11px; font-size:9px;"><img onclick="startHintPriemsBattle()" width="8" height="8" src="//img.new-combats.tech/i/micro/hit.gif" /> <font id="tac1"><?php
echo 0+$u->info['tactic1']; ?></font></span></td>
<td><span title="Критический удар" style="margin-right:11px; font-size:9px;"><img width="8" height="8" src="//img.new-combats.tech/i/micro/krit.gif" /> <font id="tac2"><?php
echo 0+$u->info['tactic2']; ?></font></span></td>
<td><span title="Проведенный контрудар" style="margin-right:11px; font-size:9px;"><img width="8" height="8" src="//img.new-combats.tech/i/micro/counter.gif" /> <font id="tac3"><?php
echo 0+$u->info['tactic3']; ?></font></span></td>
<td><span title="Успешный блок" style="margin-right:11px; font-size:9px;"><img width="8" height="8" src="//img.new-combats.tech/i/micro/block.gif" /> <font id="tac4"><?php
echo 0+$u->info['tactic4']; ?></font></span></td>
<td><span title="Успешное парирование" style="margin-right:11px; font-size:9px;"><img width="8" height="8" src="//img.new-combats.tech/i/micro/parry.gif" /> <font id="tac5"><?php
echo 0+$u->info['tactic5']; ?></font></span></td>
<td><span title="Нанесенный урон" style="margin-right:11px; font-size:9px;"><img width="8" height="8" src="//img.new-combats.tech/i/micro/hp.gif" /> <font id="tac6"><?php
echo 0+floor($u->info['tactic6']); ?></font></span></td>
<td><span title="Уровень духа" style="margin-right:11px; font-size:9px;"><img width="7" height="8" src="//img.new-combats.tech/i/micro/spirit.gif" /> <font id="tac7"><?php
if($u->info['tactic7']<0){ $u->info['tactic7'] = 0; }
echo 0+$u->info['tactic7']; ?></font></span></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table border="0" align="center" style="margin-top:-10px;" cellpadding="0" cellspacing="1">
<tr align="center">
<td><div id="priems" style="width:440px;"></div></td>
</tr>
<tr>
<td><div style="display:none;" id="pers_priem" align="center"></div></td>
</tr>
</table>
<hr style="border-color:#333;" />
</div></td>
<td valign="top" width="260" align="right"><div id="player2">
<div align="left"></div>
</div></td>
</tr>
</table>
<div id="allTeams0" align="center"><font id="teams"></font></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="260" valign="top">&nbsp;</td>
<td valign="top">
<hr />
<div align="center">
<font color="green"><b>На данный момент вами нанесено урона: </b></font><b class="private">&nbsp;<span id="nabito"><?php
echo floor($u->info['battle_yron']); ?></span> HP&nbsp;</b><b style="color:blue">.</b><br />
<span style="display:">
<small style="display:none">(Опыт: +<b><span id="expmaybe"><?php
echo floor($u->info['battle_exp']); ?></span> ед.</b>, Без учета процентов)</small>
</span>
</div>
<hr /></td>
<td width="260" valign="top"><div align="right"><a href="/logs.php?log=<?php
echo $u->info['battle']; ?>" target="blank_">Лог боя »»</a><br />
(Бой идет с таймаутом <strong id="timer_out">NaN</strong> мин.)</div></td>
</tr>
</table>
<div class="st1222" id="volna"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="260">&nbsp;</td>
<td><div style="font-size:12px;" id="battle_logg" align="left"></div><div align="left">Полную версию лога боя смотрите <a href="/logs.php?log=<?php
echo $u->info['battle']; ?>" target="blank_">здесь »»</a></div><br /></td>
<td width="260">&nbsp;</td>
</tr>
</table>
</div>
<!-- <script type="text/javascript" src="js/chat-engine.js"></script> -->
<script>
startCountdown();
genZoneAtack();
genZoneBlock();
refleshPoints();
</script>
<?php
$priem = new Priems();
$btl = new Battle();
include('jx/battle/refresh1.php'); ?>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,8 @@ if (!defined('GAME')) {
die(); die();
} }
/** @var User $u */
$comshop = new ComissionShop(); $comshop = new ComissionShop();
if ($u->room['file'] == 'commision2') { if ($u->room['file'] == 'commision2') {
@ -26,21 +28,15 @@ if ($u->room['file'] == 'commision2') {
if (!isset($_GET['otdel'])) { if (!isset($_GET['otdel'])) {
$_GET['otdel'] = 1; $_GET['otdel'] = 1;
} }
$sid = 1;
$error = ''; $error = '';
# Выполнение функции покупки предмета # Выполнение функции покупки предмета
if (isset($_GET['buy'])) { if (isset($_GET['buy'])) {
if ($u->info['allLock'] > time()) { if ($u->info['allLock'] > time()) {
$re = '<div align="left">Вам запрещается пользоваться данным магазином до ' . date( $re = '<div>Вам запрещается пользоваться данным магазином до ' . date('d.m.y H:i', $u->info['allLock']) . '</div>';
'd.m.y H:i', $u->info['allLock'] } elseif ($u->newAct($_GET['sd4'])) {
) . '</div>'; $re = $comshop->buyItem((int)$_GET['buy'], $u);
} elseif ($u->info['align'] == 2 || $u->info['haos'] > time()) {
$re = '<div align="left">Хаосникам запрещается пользоваться данным магазином</div>';
/* }elseif($u->info['palpro'] < time()) { //Проверка
$re = '<div align="left">Для покупки в комиссионном нужно пройти проверку на чистоту</div>';*/
} elseif ($u->newAct($_GET['sd4']) == true) {
$re = $u->buyItemCommison($sid, (int)$_GET['itemid'], (int)$_GET['buy']);
} else { } else {
$re = 'Вы уверены что хотите купить этот предмет?'; $re = 'Вы уверены что хотите купить этот предмет?';
} }
@ -52,9 +48,7 @@ if ($u->room['file'] == 'commision2') {
*/ */
//ТУТ комок здача //ТУТ комок здача
if ($u->info['align'] == 2 || $u->info['haos'] > time()) { if (isset($_POST['PresTR'])) {
$re = '<div align="left">Хаосникам запрещается пользоваться данным магазином</div>';
} elseif (isset($_POST['PresTR'])) {
$itemid = mysql_fetch_array( $itemid = mysql_fetch_array(
mysql_query( mysql_query(
'SELECT `inGroup`, `item_id` , `uid` FROM `items_users` WHERE `id` = "' . $_POST['iid'] . '" LIMIT 1' 'SELECT `inGroup`, `item_id` , `uid` FROM `items_users` WHERE `id` = "' . $_POST['iid'] . '" LIMIT 1'
@ -75,12 +69,12 @@ if ($u->room['file'] == 'commision2') {
$itemkt['min'] = $itemkt['min'] * $itemcount['total']; $itemkt['min'] = $itemkt['min'] * $itemcount['total'];
$itemkt['max'] = $itemkt['max'] * $itemcount['total']; $itemkt['max'] = $itemkt['max'] * $itemcount['total'];
if ($_POST['summTR'] >= $itemkt['min'] && $_POST['summTR'] <= $itemkt['max']) { if ($_POST['summTR'] >= $itemkt['min'] && $_POST['summTR'] <= $itemkt['max']) {
$u->commisonRent(mysql_real_escape_string($_POST['PresTR']), (int)$_POST['iid'], (int)$_POST['summTR']); $comshop->rent(mysql_real_escape_string($_POST['PresTR']), (int)$_POST['iid'], (int)$_POST['summTR'], $u);
} else { } else {
$re = '<div align="left">Не удалось сдать предмет его цена может быть мин: ' . $itemkt['min'] . 'кр. макс: ' . $itemkt['max'] . 'кр. кол-во: ' . $itemcount['total'] . '</div>'; $re = '<div align="left">Не удалось сдать предмет его цена может быть мин: ' . $itemkt['min'] . 'кр. макс: ' . $itemkt['max'] . 'кр. кол-во: ' . $itemcount['total'] . '</div>';
} }
} else { } else {
$u->commisonRent(mysql_real_escape_string($_POST['PresTR']), (int)$_POST['iid'], (int)$_POST['summTR']); $comshop->rent(mysql_real_escape_string($_POST['PresTR']), (int)$_POST['iid'], (int)$_POST['summTR'], $u);
} }
} }
@ -195,7 +189,7 @@ if ($u->room['file'] == 'commision2') {
* Выводим все вещи продоваемые в комке * Выводим все вещи продоваемые в комке
* В режиме предварительного просмотра * В режиме предварительного просмотра
*/ */
$comshop->commisionShop($sid, "preview"); $comshop->commisionShop('preview');
} elseif ($_GET['toRent'] == 1) { } elseif ($_GET['toRent'] == 1) {
/* /*
@ -236,7 +230,7 @@ if ($u->room['file'] == 'commision2') {
* продоваемых в комке по определенному * продоваемых в комке по определенному
* выбранному айтему * выбранному айтему
*/ */
$comshop->commisionShop($sid); $comshop->commisionShop();
} }
?> ?>
</TABLE> </TABLE>

View File

@ -8,19 +8,6 @@ if($u->room['file']=='dungeon_enter') {
$dungeonGo = 1; // По умолчанию, мы идем в пещеру. $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
$dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') ); $dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') );
if( $dungeon['id'] == 104 && isset($_GET['freego'])) {
if( $u->info['level'] > 7 ) {
}elseif( $u->info['money4'] < $u->info['level'] * 5 ) {
echo '<div><b style="color:#F00">Недостаточно зубов, необходимо '.$u->zuby( ($u->info['level'] * 5) ,1).'</b></div>';
}else{
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "psh0" AND `time` >= '.(time()-60*60*2).' LIMIT 1');
$u->info['money4'] -= $u->info['level'] * 5;
mysql_query('UPDATE `users` SET `money4` = "'.$u->info['money4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
echo '<div><b style="color:#F00">Вы успешно сняли задержку на поход за '.$u->zuby( ($u->info['level'] * 5) ,1).'</b></div>';
}
}
if(isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание if(isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание
else $roomSection = 0; // Собираем группу для похода else $roomSection = 0; // Собираем группу для похода
//if( $u->info['admin'] > 0 ) var_info($dungeon); //if( $u->info['admin'] > 0 ) var_info($dungeon);
@ -951,9 +938,6 @@ onclick="if (confirm('Сдать все чеки (<?=$chk[0]?> шт.) наход
} }
}else{ }else{
echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']).'<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого &quot;копателя пещер&quot; в Торговом зале ;)</small>'; echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']).'<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого &quot;копателя пещер&quot; в Торговом зале ;)</small>';
if( $dungeon['id'] == 104 ) {
echo '<hr>Вы можете посетить подземелье без ожидания: <button onClick="if(confirm(\'Вы уверены что хотите заплатить '.($u->info['level'] * 5).' зубов?\')){ location.href = \'/main.php?freego=1\'; }" class="btnnew">Снять задержку за '.$u->zuby(($u->info['level'] * 5),1).'</button>';
}
} }
} }
} }

View File

@ -1,15 +1,15 @@
<?php <?php
if (!defined('GAME')) die(); if (!defined('GAME')) die();
if ($u->room['file'] == 'house_belaun') { if ($u->room['file'] == 'house_belaun') {
$notify = array('type' => '', 'text' => ''); // Ошибки или Уведомления здесь! $notify = ['type' => '', 'text' => '']; // Ошибки или Уведомления здесь!
$action = ''; $action = '';
$mode = ''; $mode = '';
$create_party = array( $create_party = [
'name' => $_POST['dungeon_name'], 'name' => $_POST['dungeon_name'],
'difficulty' => $_POST['dungeon_difficulty'], 'difficulty' => $_POST['dungeon_difficulty'],
'password' => $_POST['dungeon_password'], 'password' => $_POST['dungeon_password'],
'comment' => $_POST['dungeon_comment'] 'comment' => $_POST['dungeon_comment'],
); ];
if (isset($_GET['action'])) { if (isset($_GET['action'])) {
$action = $_GET['action']; $action = $_GET['action'];
@ -26,69 +26,88 @@ if( $u->room['file'] == 'house_belaun' ) {
.house_belaun { .house_belaun {
} }
.house_belaun .Menu { .house_belaun .Menu {
margin-bottom: -1px; margin-bottom: -1px;
height: 28px; height: 28px;
} }
.house_belaun .Menu .MenuList { .house_belaun .Menu .MenuList {
padding: 0px 30px; padding: 0px 30px;
} }
.house_belaun .Menu .MenuList .item { .house_belaun .Menu .MenuList .item {
height: 28px; height: 28px;
padding: 4px 14px 0px 14px; padding: 4px 14px 0px 14px;
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
} }
.house_belaun .Menu .MenuList .item.active { .house_belaun .Menu .MenuList .item.active {
border: 1px solid #a6a6a6; border: 1px solid #a6a6a6;
border-bottom: 1px solid #d3d3d3; border-bottom: 1px solid #d3d3d3;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
.house_belaun .Content { .house_belaun .Content {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
width: 100%; width: 100%;
min-height: 260px; min-height: 260px;
border: 1px solid #a6a6a6; border: 1px solid #a6a6a6;
} }
.notification { .notification {
height: 42px; height: 42px;
box-sizing: border-box; box-sizing: border-box;
padding: 12px 15px 0px 15px; padding: 12px 15px 0px 15px;
} }
.notification.alert { .notification.alert {
color: #ef3c39; color: #ef3c39;
border-left: 4px solid #ef3c39; border-left: 4px solid #ef3c39;
border-bottom: 1px solid #a6a6a6; border-bottom: 1px solid #a6a6a6;
} }
.notification.success { .notification.success {
color: #2e6717; color: #2e6717;
border-left: 4px solid #2e6717; border-left: 4px solid #2e6717;
border-bottom: 1px solid #a6a6a6; border-bottom: 1px solid #a6a6a6;
} }
.Content { .Content {
padding: 25px; padding: 25px;
} }
.box:after, .box:before { clear:both; content:"";display:table; } .box:after, .box:before {
clear: both;
content: "";
display: table;
}
.box { .box {
width: 330px; width: 330px;
border-left: 1px solid #595959; border-left: 1px solid #595959;
} }
.box .body { .box .body {
padding: 12px; padding: 12px;
border-top: 1px solid #595959; border-top: 1px solid #595959;
} }
.box .heading { .box .heading {
border-top: 1px solid #595959; border-top: 1px solid #595959;
padding: 12px 12px; padding: 12px 12px;
} }
.box .button { .box .button {
border: 1px solid #595959; border: 1px solid #595959;
border-left: 0px; border-left: 0px;
} }
.box input[type=submit] { .box input[type=submit] {
cursor: pointer; cursor: pointer;
} }
.box .button input { .box .button input {
background-color: transparent; background-color: transparent;
width: 100%; width: 100%;
@ -99,12 +118,14 @@ if( $u->room['file'] == 'house_belaun' ) {
margin: 0px; margin: 0px;
display: inline-block; display: inline-block;
} }
.select { .select {
margin-bottom: 12px; margin-bottom: 12px;
position: relative; position: relative;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.selected { .selected {
display: table; display: table;
border: 1px solid #a6a6a6; border: 1px solid #a6a6a6;
@ -112,9 +133,11 @@ if( $u->room['file'] == 'house_belaun' ) {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.select.in .options { .select.in .options {
display: table; display: table;
} }
.select.in .arrow { .select.in .arrow {
background-image: url('//img.new-combats.tech/i/select-arrow-up.png'); background-image: url('//img.new-combats.tech/i/select-arrow-up.png');
} }
@ -128,6 +151,7 @@ if( $u->room['file'] == 'house_belaun' ) {
vertical-align: middle; vertical-align: middle;
border-right: 1px solid #a6a6a6; border-right: 1px solid #a6a6a6;
} }
.selected div.opt2 { .selected div.opt2 {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
@ -139,9 +163,11 @@ if( $u->room['file'] == 'house_belaun' ) {
line-height: 14px; line-height: 14px;
width: 90%; width: 90%;
} }
.selected div.opt2i { .selected div.opt2i {
display: table-cell; display: table-cell;
} }
.selected div.opt2i > input { .selected div.opt2i > input {
display: block; display: block;
vertical-align: middle; vertical-align: middle;
@ -159,6 +185,7 @@ if( $u->room['file'] == 'house_belaun' ) {
line-height: 32px; line-height: 32px;
width: 100%; width: 100%;
} }
.selected .arrow { .selected .arrow {
border-left: 1px solid #a6a6a6; border-left: 1px solid #a6a6a6;
display: table-cell; display: table-cell;
@ -173,9 +200,11 @@ if( $u->room['file'] == 'house_belaun' ) {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
} }
.selected .key:hover { .selected .key:hover {
background-image: url('//img.new-combats.tech/i/key-hover.gif'); background-image: url('//img.new-combats.tech/i/key-hover.gif');
} }
.selected .key { .selected .key {
border-left: 1px solid #a6a6a6; border-left: 1px solid #a6a6a6;
display: table-cell; display: table-cell;
@ -203,21 +232,25 @@ if( $u->room['file'] == 'house_belaun' ) {
box-sizing: border-box; box-sizing: border-box;
top: 100%; top: 100%;
} }
.select .option + .option .opt1, .select .option + .option .opt1,
.select .option + .option .opt2 { .select .option + .option .opt2 {
border-top: 1px solid #a6a6a6; border-top: 1px solid #a6a6a6;
} }
.select .option { .select .option {
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
box-sizing: border-box; box-sizing: border-box;
display: table-row; display: table-row;
} }
.select .option .opt1 { .select .option .opt1 {
display: table-cell; display: table-cell;
text-align: center; text-align: center;
padding: 10px 2px; padding: 10px 2px;
} }
.select .option .opt2 { .select .option .opt2 {
display: table-cell; display: table-cell;
text-align: left; text-align: left;
@ -284,7 +317,8 @@ if( $u->room['file'] == 'house_belaun' ) {
} }
$pus = trim($pus, ', '); $pus = trim($pus, ', ');
$dungeonGroupList .= $pus; unset($pus); $dungeonGroupList .= $pus;
unset($pus);
if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>'; if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>';
@ -299,7 +333,7 @@ if( $u->room['file'] == 'house_belaun' ) {
$pl['dcom'] = $u->info['id']; $pl['dcom'] = $u->info['id'];
} }
} }
$pl['com'] = htmlspecialchars($pl['com'],NULL); $pl['com'] = htmlspecialchars($pl['com'], null);
if ($pl['dcom'] > 0) { if ($pl['dcom'] > 0) {
$dl = ' <font color="grey"><i>комментарий удален модератором</i></font>'; $dl = ' <font color="grey"><i>комментарий удален модератором</i></font>';
} }
@ -324,21 +358,58 @@ if( $u->room['file'] == 'house_belaun' ) {
<div class="body"> <div class="body">
<div class="select"><!-- КУДА НАПРАВЛЯЕМСЯ --> <div class="select"><!-- КУДА НАПРАВЛЯЕМСЯ -->
<input type="hidden" name="dungeon_name" value="capitalcity"/> <input type="hidden" name="dungeon_name" value="capitalcity"/>
<div class="selected"><div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/1.gif"></div><div class="opt2">Пещера Тысячи Проклятий</div><div class="arrow"></div></div> <div class="selected">
<div class="options"><div class="option" data-value="capitalcity"><div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/1.gif"></div><div class="opt2">Пещера Тысячи Проклятий</div></div><div class="option" data-value="angelscity"><div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/2.gif"></div><div class="opt2">Бездна</div></div><div class="option" data-value="demonscity"><div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/3.gif"></div><div class="opt2">Катакомбы</div></div></div> <div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/1.gif"></div>
<div class="opt2">Пещера Тысячи Проклятий</div>
<div class="arrow"></div>
</div>
<div class="options">
<div class="option" data-value="capitalcity">
<div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/1.gif"></div>
<div class="opt2">Пещера Тысячи Проклятий</div>
</div>
<div class="option" data-value="angelscity">
<div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/2.gif"></div>
<div class="opt2">Бездна</div>
</div>
<div class="option" data-value="demonscity">
<div class="opt1"><img src="//img.new-combats.tech/i/city_ico3/3.gif"></div>
<div class="opt2">Катакомбы</div>
</div>
</div>
</div> </div>
<div class="select"><!-- СЛОЖНОСТЬ НАПРАВЛЕНИЯ --> <div class="select"><!-- СЛОЖНОСТЬ НАПРАВЛЕНИЯ -->
<input type="hidden" name="dungeon_difficulty" value="normal"/> <input type="hidden" name="dungeon_difficulty" value="normal"/>
<div class="selected"><div class="opt1">Сложность:</div><div class="opt2">Нормальная</div><div class="arrow"></div></div> <div class="selected">
<div class="options"><div class="option" data-value="easy"><div class="opt2">Легкая</div></div><div class="option" data-value="normal"><div class="opt2">Нормальная</div></div><div class="option" data-value="hard"><div class="opt2">Сложная</div></div></div> <div class="opt1">Сложность:</div>
<div class="opt2">Нормальная</div>
<div class="arrow"></div>
</div>
<div class="options">
<div class="option" data-value="easy">
<div class="opt2">Легкая</div>
</div>
<div class="option" data-value="normal">
<div class="opt2">Нормальная</div>
</div>
<div class="option" data-value="hard">
<div class="opt2">Сложная</div>
</div>
</div>
</div> </div>
<div class="select"><!-- ПАРОЛЬ --> <div class="select"><!-- ПАРОЛЬ -->
<div class="selected"><div class="opt1">Пароль:</div><div class="opt2i"><input type="text" name="dungeon_password" maxlength="6" value=""/></div><div class="key"></div></div> <div class="selected">
<div class="opt1">Пароль:</div>
<div class="opt2i"><input type="text" name="dungeon_password" maxlength="6" value=""/></div>
<div class="key"></div>
</div>
</div> </div>
<div class="select"><!-- КОММЕНТАРИЙ --> <div class="select"><!-- КОММЕНТАРИЙ -->
<div class="selected"><div class="opt2i"><input type="text" name="dungeon_comment" maxlength="130" placeholder="Комментарий:" value=""/></div></div> <div class="selected">
<div class="opt2i"><input type="text" name="dungeon_comment" maxlength="130" placeholder="Комментарий:" value=""/></div>
</div>
</div> </div>
</div> </div>
<div class="button"><input type="submit" name="partyCreate" value="Создать группу"/></div> <div class="button"><input type="submit" name="partyCreate" value="Создать группу"/></div>
@ -349,7 +420,6 @@ if( $u->room['file'] == 'house_belaun' ) {
</div> </div>
<?php <?php
if ($u->room['file'] == 'house_belaun' && false) { if ($u->room['file'] == 'house_belaun' && false) {
@ -359,35 +429,24 @@ if($u->room['file']=='house_belaun' && false) {
$dungeonGo = 1; // По умолчанию, мы идем в пещеру. $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
$dungeon = mysql_fetch_assoc(mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1')); $dungeon = mysql_fetch_assoc(mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1'));
$dunname = array( $dunname = [
12 => array('capitalcity','Пещера Тысячи Проклятий'), 12 => ['capitalcity', 'Пещера Тысячи Проклятий'],
101 => array('angelscity','Бездна'), 101 => ['angelscity', 'Бездна'],
//3 => array('demonscity','Катакомбы'), //3 => array('demonscity','Катакомбы'),
//105 => array('sandcity','Пещеры Мглы'), //105 => array('sandcity','Пещеры Мглы'),
//108 => array('emeraldscity','Потерянный вход'), //108 => array('emeraldscity','Потерянный вход'),
//10 => array('suncity','Грибница'), //10 => array('suncity','Грибница'),
//106 => array('devilscity','Туманные Низины') //106 => array('devilscity','Туманные Низины')
); ];
if( $dungeon['id'] == 104 && isset($_GET['freego'])) {
if( $u->info['level'] > 7 ) {
}elseif( $u->info['money4'] < $u->info['level'] * 5 ) {
echo '<div><b style="color:#F00">Недостаточно зубов, необходимо '.$u->zuby( ($u->info['level'] * 5) ,1).'</b></div>';
}else{
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "psh0" AND `time` >= '.(time()-60*60*2).' LIMIT 1');
$u->info['money4'] -= $u->info['level'] * 5;
mysql_query('UPDATE `users` SET `money4` = "'.$u->info['money4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
echo '<div><b style="color:#F00">Вы успешно сняли задержку на поход за '.$u->zuby( ($u->info['level'] * 5) ,1).'</b></div>';
}
}
if (isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание if (isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание
else $roomSection = 0; // Собираем группу для похода else $roomSection = 0; // Собираем группу для похода
//if( $u->info['admin'] > 0 ) var_info($dungeon); //if( $u->info['admin'] > 0 ) var_info($dungeon);
$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
while( $t = mysql_fetch_array($all_dungeon) ) { $dungeon['list'][] = $t['city']; } while ($t = mysql_fetch_array($all_dungeon)) {
$dungeon['list'][] = $t['city'];
}
unset($all_dungeon); unset($all_dungeon);
if ($u->info['dn'] > 0) { if ($u->info['dn'] > 0) {
@ -424,10 +483,10 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
$su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/'); $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/');
$ids = ''; $ids = '';
$map_locs = array(); $map_locs = [];
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"'); $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"');
while ($plm2 = mysql_fetch_array($spm2)) { while ($plm2 = mysql_fetch_array($spm2)) {
$map_locs[] = array($plm2['x'],$plm2['y']); $map_locs[] = [$plm2['x'], $plm2['y']];
} }
unset($spm2, $plm2); unset($spm2, $plm2);
@ -461,9 +520,9 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
$actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY']; $actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY'];
$actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY']; $actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY'];
} }
$ml_arr = array(); $ml_arr = [];
foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов. foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
if( (isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) OR (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) ) { if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) {
if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml; if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml; elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
} else $ml_arr[] = $ml; } else $ml_arr[] = $ml;
@ -515,8 +574,7 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
//Добавляем обьекты //Добавляем обьекты
$vls = ''; $vls = '';
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $zv['dun'] . '"'); $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $zv['dun'] . '"');
while($pl = mysql_fetch_array($sp)) while ($pl = mysql_fetch_array($sp)) {
{
$vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
} }
//Добавление обьектов (день святого валентина) //Добавление обьектов (день святого валентина)
@ -524,7 +582,7 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
if (floor(date('m')) == 2 && floor(date('d')) >= 14) { if (floor(date('m')) == 2 && floor(date('d')) >= 14) {
//Появляются мобы которые принимают цветы //Появляются мобы которые принимают цветы
$vlsbts = ''; $vlsbts = '';
$ins1bts = NULL; $ins1bts = null;
if ($zv['dun'] == 1) { if ($zv['dun'] == 1) {
//4 уровня (КАНАЛИЗАЦИЯ) //4 уровня (КАНАЛИЗАЦИЯ)
$vlsbts .= '("' . $zid . '","410","1","","-5","3","8","0","0"),'; $vlsbts .= '("' . $zid . '","410","1","","-5","3","8","0","0"),';
@ -557,12 +615,12 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
unset($vlsbts, $ins1bts); unset($vlsbts, $ins1bts);
} }
//Раскидываем предметы по пещере (Блёклый подземник) //Раскидываем предметы по пещере (Блёклый подземник)
$dcords = array(); $dcords = [];
$c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"'); $c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"');
while ($c_pl = mysql_fetch_array($c_sp)) { while ($c_pl = mysql_fetch_array($c_sp)) {
$dcords[] = array($c_pl['x'],$c_pl['y']); $dcords[] = [$c_pl['x'], $c_pl['y']];
} }
$fcords = array(); $fcords = [];
$i = 1; $i = 1;
while ($i <= $pxd) { while ($i <= $pxd) {
$j = rand(1, 10); $j = rand(1, 10);
@ -579,19 +637,19 @@ if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 )
} }
//Раскидываем предметы по пещере (Черепичный подземник) //Раскидываем предметы по пещере (Черепичный подземник)
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $zv['dun'] . '"'); $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $zv['dun'] . '"');
$test = array(); $test = [];
$dcords2 = array(); $dcords2 = [];
$dcords3 = array(); $dcords3 = [];
while ($pl = mysql_fetch_array($sp)) { while ($pl = mysql_fetch_array($sp)) {
if (!isset($test[$pl['id_bot']])) { if (!isset($test[$pl['id_bot']])) {
$test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1')); $test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1'));
} }
if (isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2) { if (isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2) {
if ($test[$pl['id_bot']]['level'] > 6) { if ($test[$pl['id_bot']]['level'] > 6) {
$dcords2[] = array($pl['x'],$pl['y']); $dcords2[] = [$pl['x'], $pl['y']];
} }
if ($test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9) { if ($test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9) {
$dcords3[] = array($pl['x'],$pl['y']); $dcords3[] = [$pl['x'], $pl['y']];
} }
} else { } else {
$test[$pl['id_bot']] = 2; $test[$pl['id_bot']] = 2;
@ -820,7 +878,8 @@ while( $pl = mysql_fetch_array( $sp ) ){
} }
$pus = trim($pus, ', '); $pus = trim($pus, ', ');
$dungeonGroupList .= $pus; unset($pus); $dungeonGroupList .= $pus;
unset($pus);
if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>'; if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>';
@ -835,7 +894,7 @@ while( $pl = mysql_fetch_array( $sp ) ){
$pl['dcom'] = $u->info['id']; $pl['dcom'] = $u->info['id'];
} }
} }
$pl['com'] = htmlspecialchars($pl['com'],NULL); $pl['com'] = htmlspecialchars($pl['com'], null);
if ($pl['dcom'] > 0) { if ($pl['dcom'] > 0) {
$dl = ' <font color="grey"><i>комментарий удален модератором</i></font>'; $dl = ' <font color="grey"><i>комментарий удален модератором</i></font>';
} }
@ -855,15 +914,19 @@ while( $pl = mysql_fetch_array( $sp ) ){
body { body {
background-color: #E2E2E2; background-color: #E2E2E2;
background-image: url(//img.new-combats.tech/i/misc/showitems/dungeon.jpg); background-image: url(//img.new-combats.tech/i/misc/showitems/dungeon.jpg);
background-repeat:no-repeat;background-position:top right; background-repeat: no-repeat;
background-position: top right;
} }
</style> </style>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td><div style="padding-left:0px;" align="center"> <td>
<div style="padding-left:0px;" align="center">
<h3><?= $u->room['name']; ?></h3> <h3><?= $u->room['name']; ?></h3>
</div></td> </div>
<td width="200"><div align="right"> </td>
<td width="200">
<div align="right">
<table cellspacing="0" cellpadding="0"> <table cellspacing="0" cellpadding="0">
<tr> <tr>
<td width="100%">&nbsp;</td> <td width="100%">&nbsp;</td>
@ -876,10 +939,32 @@ body {
<!-- --> <!-- -->
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td nowrap="nowrap"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE"> <td nowrap="nowrap">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=<?php if($u->info['city']=='abandonedplain') { echo '3.180.0.267'; } elseif($u->info['city']=='fallenearth') { echo '6.180.0.102'; } elseif($u->info['room']==188) { echo '1.180.0.4'; } elseif($u->info['room']==393) { echo '1.180.0.2'; } elseif($u->info['room']==372) { echo '1.180.0.323'; }elseif($u->info['room']==395) { echo '2.180.0.231'; }elseif($u->info['room']==397) { echo '2.180.0.229'; } elseif($u->info['room']==242) { echo '2.180.0.236'; } elseif($u->info['room']==321) { echo '1.180.0.213'; } else { echo '1.180.0.321'; } ?>&rnd=<?= $code; ?>';" title="<?php <td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=<?php if ($u->info['city'] == 'abandonedplain') {
echo '3.180.0.267';
} elseif ($u->info['city'] == 'fallenearth') {
echo '6.180.0.102';
} elseif ($u->info['room'] == 188) {
echo '1.180.0.4';
} elseif ($u->info['room'] == 393) {
echo '1.180.0.2';
} elseif ($u->info['room'] == 372) {
echo '1.180.0.323';
} elseif ($u->info['room'] == 395) {
echo '2.180.0.231';
} elseif ($u->info['room'] == 397) {
echo '2.180.0.229';
} elseif ($u->info['room'] == 242) {
echo '2.180.0.236';
} elseif ($u->info['room'] == 321) {
echo '1.180.0.213';
} else {
echo '1.180.0.321';
} ?>&rnd=<?= $code; ?>';" title="<?php
if ($u->info['city'] == 'fallenearth') { if ($u->info['city'] == 'fallenearth') {
thisInfRm('6.180.0.102', 1); thisInfRm('6.180.0.102', 1);
} elseif ($u->info['city'] == 'abandonedplain') { } elseif ($u->info['city'] == 'abandonedplain') {
@ -927,24 +1012,29 @@ body {
</tr> </tr>
<?php if (isset($dungeon['shop']) && $dungeon['shop'] > 0) { <?php if (isset($dungeon['shop']) && $dungeon['shop'] > 0) {
$shop = mysql_fetch_array(mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1')); $shop = mysql_fetch_array(mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1'));
if( isset($shop['code']) ){?> if (isset($shop['code'])) {
?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=<?=$shop['code']?>&rnd=<?= $code; ?>';" title="<?php thisInfRm($shop['code'],1); ?>">Рыцарский магазин</a></td> <td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=<?= $shop['code'] ?>&rnd=<?= $code; ?>';"
title="<?php thisInfRm($shop['code'], 1); ?>">Рыцарский магазин</a></td>
</tr> </tr>
<?php } <?php }
} ?> } ?>
</table> </table>
</td> </td>
</tr> </tr>
</table></td> </table>
</td>
</tr> </tr>
</table> </table>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>
</table> </table>
</div></td> </div>
</td>
</tr> </tr>
</table> </table>
<?php if ($roomSection == 1) { ?> <?php if ($roomSection == 1) { ?>
@ -982,7 +1072,9 @@ if( $dungeonGroupList == '' ) {
$dungeonGroupList .= '<hr>'; $dungeonGroupList .= '<hr>';
} }
if( $roomSection == 0 ) { echo $dungeonGroupList; } if ($roomSection == 0) {
echo $dungeonGroupList;
}
if ($roomSection == 1) { if ($roomSection == 1) {
# endQuest завершаем задание по нажатию. # endQuest завершаем задание по нажатию.
if (isset($_GET['endQuest']) && $_GET['endQuest'] != '') { if (isset($_GET['endQuest']) && $_GET['endQuest'] != '') {
@ -1023,17 +1115,17 @@ if( $roomSection == 1 ) {
echo '<font color="red"><b>Нельзя получать задания чаще одного раза в сутки</b></font><br>'; echo '<font color="red"><b>Нельзя получать задания чаще одного раза в сутки</b></font><br>';
} else { } else {
$sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . ''); $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . '');
$dq_add = array(); $dq_add = [];
while ($pl = mysql_fetch_array($sp)) { while ($pl = mysql_fetch_array($sp)) {
if ($u->rep['rep' . $dungeon['city']] == 9999) { if ($u->rep['rep' . $dungeon['city']] == 9999) {
//квет, рыцарского задания //квет, рыцарского задания
if ($pl['kin'] == 1) { if ($pl['kin'] == 1) {
$dq_add = array( 0 => $pl ); $dq_add = [0 => $pl];
} }
} elseif ($u->rep['rep' . $dungeon['city']] == 24999) { } elseif ($u->rep['rep' . $dungeon['city']] == 24999) {
//квет, рыцарского задания //квет, рыцарского задания
if ($pl['kin'] == 2) { if ($pl['kin'] == 2) {
$dq_add = array( 0 => $pl ); $dq_add = [0 => $pl];
} }
} else { } else {
if ($pl['kin'] == 0) { if ($pl['kin'] == 0) {
@ -1097,7 +1189,7 @@ if( $roomSection == 1 ) {
if ($_GET['buy1'] == 1) { if ($_GET['buy1'] == 1) {
//покупаем статы //покупаем статы
$price = 2000 + ($u->rep['add_stats'] * 100); $price = 2000 + ($u->rep['add_stats'] * 100);
$cur_price = array('price'=>0); $cur_price = ['price' => 0];
if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики!
foreach ($dungeon['list'] as $key => $val) { foreach ($dungeon['list'] as $key => $val) {
if (!($cur_price['price'] >= $price)) { if (!($cur_price['price'] >= $price)) {
@ -1114,7 +1206,8 @@ if( $roomSection == 1 ) {
} }
} }
if ($rt == 1) { if ($rt == 1) {
$u->info['ability'] += 1; $u->rep['add_stats'] += 1; $u->info['ability'] += 1;
$u->rep['add_stats'] += 1;
mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
echo '<font color="red"><b>Вы успешно приобрели 1 способность за ' . $price . ' ед. награды</b></font><br>'; echo '<font color="red"><b>Вы успешно приобрели 1 способность за ' . $price . ' ед. награды</b></font><br>';
@ -1127,7 +1220,7 @@ if( $roomSection == 1 ) {
} }
} elseif ($_GET['buy1'] == 2) { // Умения! } elseif ($_GET['buy1'] == 2) { // Умения!
$price = 10000; $price = 10000;
$cur_price = array('price'=>0); $cur_price = ['price' => 0];
if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения!
foreach ($dungeon['list'] as $key => $val) { foreach ($dungeon['list'] as $key => $val) {
if (!($cur_price['price'] >= $price)) { if (!($cur_price['price'] >= $price)) {
@ -1144,7 +1237,8 @@ if( $roomSection == 1 ) {
} }
} }
if ($rt == 1) { if ($rt == 1) {
$u->info['skills'] += 1; $u->rep['add_skills'] += 1; $u->info['skills'] += 1;
$u->rep['add_skills'] += 1;
mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
echo '<font color="red"><b>Вы успешно приобрели 1 умение за ' . $price . ' ед. награды</b></font><br>'; echo '<font color="red"><b>Вы успешно приобрели 1 умение за ' . $price . ' ед. награды</b></font><br>';
@ -1157,7 +1251,7 @@ if( $roomSection == 1 ) {
} }
} elseif ($_GET['buy1'] == 3) { // Кредиты } elseif ($_GET['buy1'] == 3) { // Кредиты
$price = 100; $price = 100;
$cur_price = array('price'=>0); $cur_price = ['price' => 0];
if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
foreach ($dungeon['list'] as $key => $val) { foreach ($dungeon['list'] as $key => $val) {
if (!($cur_price['price'] >= $price)) { if (!($cur_price['price'] >= $price)) {
@ -1174,7 +1268,8 @@ if( $roomSection == 1 ) {
} }
} }
if ($rt == 1) { if ($rt == 1) {
$u->info['money'] += 10; $u->rep['add_money'] += 10; $u->info['money'] += 10;
$u->rep['add_money'] += 10;
mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
echo '<font color="red"><b>Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды</b></font><br>'; echo '<font color="red"><b>Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды</b></font><br>';
@ -1187,7 +1282,7 @@ if( $roomSection == 1 ) {
} }
} elseif ($_GET['buy1'] == 4) { // Особенности } elseif ($_GET['buy1'] == 4) { // Особенности
$price = 3000; $price = 3000;
$cur_price = array('price'=>0); $cur_price = ['price' => 0];
if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности
foreach ($dungeon['list'] as $key => $val) { foreach ($dungeon['list'] as $key => $val) {
if (!($cur_price['price'] >= $price)) { if (!($cur_price['price'] >= $price)) {
@ -1204,7 +1299,8 @@ if( $roomSection == 1 ) {
} }
} }
if ($rt == 1) { if ($rt == 1) {
$u->info['sskills'] += 1; $u->rep['add_skills2'] += 1; $u->info['sskills'] += 1;
$u->rep['add_skills2'] += 1;
mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
echo '<font color="red"><b>Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды</b></font><br>'; echo '<font color="red"><b>Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды</b></font><br>';
@ -1227,25 +1323,29 @@ if( $roomSection == 1 ) {
<td>Способность (еще <?= (25 - $u->rep['add_stats']) ?>)</td> <td>Способность (еще <?= (25 - $u->rep['add_stats']) ?>)</td>
<td style='padding-left: 10px'>за <?= 2000 + ($u->rep['add_stats'] * 100); ?> ед.</td> <td style='padding-left: 10px'>за <?= 2000 + ($u->rep['add_stats'] * 100); ?> ед.</td>
<td style='padding-left: 10px'><input type='button' value='Купить' <td style='padding-left: 10px'><input type='button' value='Купить'
onclick="if (confirm('Купить: Способность?\n\nКупив способность, Вы сможете увеличить характеристики персонажа.\nНапример, можно увеличить силу.')) {location='main.php?rz=1&buy1=1'}" /></td> onclick="if (confirm('Купить: Способность?\n\nКупив способность, Вы сможете увеличить характеристики персонажа.\nНапример, можно увеличить силу.')) {location='main.php?rz=1&buy1=1'}"/>
</td>
</tr> </tr>
<tr> <tr>
<td>Умение (еще <?= (10 - $u->rep['add_skills']) ?>)</td> <td>Умение (еще <?= (10 - $u->rep['add_skills']) ?>)</td>
<td style='padding-left: 10px'>за 10000 ед.</td> <td style='padding-left: 10px'>за 10000 ед.</td>
<td style='padding-left: 10px'><input type='button' value='Купить' <td style='padding-left: 10px'><input type='button' value='Купить'
onclick="if (confirm('Купить: Умение?\n\nУмение даёт возможность почуствовать себя мастером меча, топора, магии и т.п.')) {location='main.php?rz=1&buy1=2'}" /></td> onclick="if (confirm('Купить: Умение?\n\nУмение даёт возможность почуствовать себя мастером меча, топора, магии и т.п.')) {location='main.php?rz=1&buy1=2'}"/>
</td>
</tr> </tr>
<tr> <tr>
<td>Деньги (10 кр.)</td> <td>Деньги (10 кр.)</td>
<td style='padding-left: 10px'>за 100 ед.</td> <td style='padding-left: 10px'>за 100 ед.</td>
<td style='padding-left: 10px'><input type='button' value='Купить' <td style='padding-left: 10px'><input type='button' value='Купить'
onclick="if (confirm('Купить: Деньги (10 кр.)?\n\nНаграду можно получить полновесными кредитами.')) {location='main.php?rz=1&buy1=3'}" /></td> onclick="if (confirm('Купить: Деньги (10 кр.)?\n\nНаграду можно получить полновесными кредитами.')) {location='main.php?rz=1&buy1=3'}"/>
</td>
</tr> </tr>
<tr> <tr>
<td>Особенность (еще <?= (5 - $u->rep['add_skills2']) ?>)</td> <td>Особенность (еще <?= (5 - $u->rep['add_skills2']) ?>)</td>
<td style='padding-left: 10px'>за 3000 ед.</td> <td style='padding-left: 10px'>за 3000 ед.</td>
<td style='padding-left: 10px'><input type='button' value='Купить' <td style='padding-left: 10px'><input type='button' value='Купить'
onclick="if (confirm('Купить: Особенность?\n\nОсобенность - это дополнительные возможности персонажа, не дающие преимущества в боях.\nНапример, можно увеличить скорость восстановления HP')) {location='main.php?rz=1&buy1=4'}" /></td> onclick="if (confirm('Купить: Особенность?\n\nОсобенность - это дополнительные возможности персонажа, не дающие преимущества в боях.\nНапример, можно увеличить скорость восстановления HP')) {location='main.php?rz=1&buy1=4'}"/>
</td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
@ -1260,7 +1360,8 @@ if( $roomSection == 1 ) {
while ($chk_pl = mysql_fetch_array($chk_cl)) { while ($chk_pl = mysql_fetch_array($chk_cl)) {
if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ; if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ;
{ {
$x++; $prc += $chk_pl['price1']; $x++;
$prc += $chk_pl['price1'];
} }
} }
$u->info['money'] += $prc; $u->info['money'] += $prc;
@ -1303,7 +1404,8 @@ onclick="if (confirm('Сдать все чеки (<?=$chk[0]?> шт.) наход
<form id="from" autocomplete="0" name="from" action="main.php?pz1=<?= $code; ?>" method="post"> <form id="from" autocomplete="0" name="from" action="main.php?pz1=<?= $code; ?>" method="post">
<fieldset style='padding-left: 5; width=50%'> <fieldset style='padding-left: 5; width=50%'>
<legend><b> Группа </b></legend> <legend><b> Группа </b></legend>
Выберите пещеру:<hr /> Выберите пещеру:
<hr/>
<label> <label>
<input type="radio" name="rpmg1" id="rpmg1" checked="checked" value="1"/> <input type="radio" name="rpmg1" id="rpmg1" checked="checked" value="1"/>
<img style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/capitalcity.gif" <img style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/capitalcity.gif"
@ -1334,7 +1436,8 @@ onclick="if (confirm('Сдать все чеки (<?=$chk[0]?> шт.) наход
<img style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/devilscity.gif" <img style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/devilscity.gif"
width="34" height="19"/> <font color="#CCCCCC">Туманные Низины</font></label> width="34" height="19"/> <font color="#CCCCCC">Туманные Низины</font></label>
<br /><hr /> <br/>
<hr/>
Комментарий Комментарий
<input autocomplete="off" type="text" name="text" maxlength="40" size="40"/> <input autocomplete="off" type="text" name="text" maxlength="40" size="40"/>
<br/> <br/>
@ -1366,10 +1469,7 @@ onclick="if (confirm('Сдать все чеки (<?=$chk[0]?> шт.) наход
} }
} else { } else {
echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого &quot;копателя пещер&quot; в Торговом зале ;)</small>'; echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого &quot;копателя пещер&quot; в Торговом зале ;)</small>';
if( $dungeon['id'] == 104 ) {
echo '<hr>Вы можете посетить подземелье без ожидания: <button onClick="if(confirm(\'Вы уверены что хотите заплатить '.($u->info['level'] * 5).' зубов?\')){ location.href = \'/main.php?freego=1\'; }" class="btnnew">Снять задержку за '.$u->zuby(($u->info['level'] * 5),1).'</button>';
} }
} }
} }
}
?>

View File

@ -1,5 +1,7 @@
<?php <?php
if(!defined('GAME')){ die(); } if (!defined('GAME')) {
die();
}
if ($u->info['admin'] > 0) { if ($u->info['admin'] > 0) {
include 'room_hostel.php'; include 'room_hostel.php';
} else { } else {
@ -20,7 +22,12 @@ $sleep_mod=0;
$ar['base'] = 1; $ar['base'] = 1;
$ar['advanced'] = 2; $ar['advanced'] = 2;
$ar['advanced2'] = 3; $ar['advanced2'] = 3;
if($objaga){$test_arenda=1;$ar_lvl=$ar[$objaga['type']];}else{$test_arenda=0;} if ($objaga) {
$test_arenda = 1;
$ar_lvl = $ar[$objaga['type']];
} else {
$test_arenda = 0;
}
#---пара проверок ;) #---пара проверок ;)
if (isset($objaga['id'])) { if (isset($objaga['id'])) {
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1); $sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
@ -31,17 +38,33 @@ if(isset($objaga['id'])) {
} }
} }
} }
if($u->info['clan']=='0'){$u->info['clan']='';} if ($u->info['clan'] == '0') {
if(!$objaga){$level=1;$nazv="Общежитие";}else{$level=2;$nazv="Общежитие"; $u->info['clan'] = '';
}
if (!$objaga) {
$level = 1;
$nazv = "Общежитие";
} else {
$level = 2;
$nazv = "Общежитие";
if (isset($_GET['obj_add'])) { if (isset($_GET['obj_add'])) {
$u->obj_addItem($_GET['obj_add']); $u->obj_addItem($_GET['obj_add']);
} elseif (isset($_GET['obj_take'])) { } elseif (isset($_GET['obj_take'])) {
$u->obj_takeItem($_GET['obj_take']); $u->obj_takeItem($_GET['obj_take']);
} }
} }
if($u->info['room']=='217' /*&& $objaga['type']=='base'*/){$level=3;$nazv="Общ. Этаж 1";}//else{$err = '<FONT COLOR=red><B>Вы ничего не арендуете на этом этаже<BR></B></FONT><BR>';$nazv="Общ. Этаж 1";} if ($u->info['room'] == '217' /*&& $objaga['type']=='base'*/) {
if($u->info['room']=='218' /*&& $objaga['type']!='base'*/){$level=3;$nazv="Общ. Этаж 2";} $level = 3;
if($u->info['room']=='219' /*&& $objaga['type']!='base'*/){$level=3;$nazv="Общ. Этаж 3";} $nazv = "Общ. Этаж 1";
}//else{$err = '<FONT COLOR=red><B>Вы ничего не арендуете на этом этаже<BR></B></FONT><BR>';$nazv="Общ. Этаж 1";}
if ($u->info['room'] == '218' /*&& $objaga['type']!='base'*/) {
$level = 3;
$nazv = "Общ. Этаж 2";
}
if ($u->info['room'] == '219' /*&& $objaga['type']!='base'*/) {
$level = 3;
$nazv = "Общ. Этаж 3";
}
#---аренда помещений #---аренда помещений
if ($_GET['arenda'] == "base") { if ($_GET['arenda'] == "base") {
if ($u->info['money'] >= 1) { if ($u->info['money'] >= 1) {
@ -164,7 +187,7 @@ if($_POST['payarenda']) {
if ($u->info['money'] > 0 && (int)$_POST['payarenda'] > 0 && ((int)$_POST['payarenda'] <= $u->info['money'])) { if ($u->info['money'] > 0 && (int)$_POST['payarenda'] > 0 && ((int)$_POST['payarenda'] <= $u->info['money'])) {
$paytime = ($_POST['payarenda'] / $objaga['weekcost']) * 604800; $paytime = ($_POST['payarenda'] / $objaga['weekcost']) * 604800;
mysql_query("UPDATE `house`,`users` SET `house`.`endtime` = `house`.`endtime`+'" . $paytime . "', `house`.`balance` = `house`.`balance`+'" . mysql_real_escape_string($_POST['payarenda']) . "',`users`.`money`=`users`.`money`-'" . mysql_real_escape_string($_POST['payarenda']) . "' WHERE `house`.`owner` = `users`.`id` AND `house`.`owner` = '" . mysql_real_escape_string($u->info['id']) . "';"); mysql_query("UPDATE `house`,`users` SET `house`.`endtime` = `house`.`endtime`+'" . $paytime . "', `house`.`balance` = `house`.`balance`+'" . mysql_real_escape_string($_POST['payarenda']) . "',`users`.`money`=`users`.`money`-'" . mysql_real_escape_string($_POST['payarenda']) . "' WHERE `house`.`owner` = `users`.`id` AND `house`.`owner` = '" . mysql_real_escape_string($u->info['id']) . "';");
$err = '<FONT COLOR=red><B>Вы положили на счет '.htmlspecialchars($_POST['payarenda'],NULL).'.00 кр.<BR></B></FONT><BR>'; $err = '<FONT COLOR=red><B>Вы положили на счет ' . htmlspecialchars($_POST['payarenda'], null) . '.00 кр.<BR></B></FONT><BR>';
$u->info['money'] -= $_POST['payarenda']; $u->info['money'] -= $_POST['payarenda'];
$objaga['balance'] += $_POST['payarenda']; $objaga['balance'] += $_POST['payarenda'];
$objaga['endtime'] += $paytime; $objaga['endtime'] += $paytime;
@ -190,14 +213,31 @@ if($objaga['id']>0) {
} }
#---Переключатель комнат #---Переключатель комнат
if(isset($sleep['id'])) {$_GET['room']=4;$sleep_mod=1;}#---Если спим, то никуда не выбратся if (isset($sleep['id'])) {
if(!$_GET['room'] and $test_arenda==1) {$_GET['room'] = 1;} #---Комната (если ничего не выбрано) $_GET['room'] = 4;
if($_GET['room']==1 and $test_arenda==1) {$room = 1;} #---Комната $sleep_mod = 1;
if($_GET['room']==2 and $test_arenda==1) {$room = 2;} #---Сундук }#---Если спим, то никуда не выбратся
if($_GET['room']==6 and $test_arenda==1) {$room = 6;} #---Сувениры if (!$_GET['room'] and $test_arenda == 1) {
if($_GET['room']==3 and $test_arenda==1) {$room = 3;} #---Животные $_GET['room'] = 1;
if($_GET['room']==4 and $test_arenda==1) {$room = 4;} #---Сон } #---Комната (если ничего не выбрано)
if($_GET['room']==7 and $test_arenda==1) {$room = 7;} #---Персонажи if ($_GET['room'] == 1 and $test_arenda == 1) {
$room = 1;
} #---Комната
if ($_GET['room'] == 2 and $test_arenda == 1) {
$room = 2;
} #---Сундук
if ($_GET['room'] == 6 and $test_arenda == 1) {
$room = 6;
} #---Сувениры
if ($_GET['room'] == 3 and $test_arenda == 1) {
$room = 3;
} #---Животные
if ($_GET['room'] == 4 and $test_arenda == 1) {
$room = 4;
} #---Сон
if ($_GET['room'] == 7 and $test_arenda == 1) {
$room = 7;
} #---Персонажи
#---Записи #---Записи
if ($_POST['savenotes']) { if ($_POST['savenotes']) {
$_POST['notes'] = str_replace(" \\n", "\n", $_POST['notes']); $_POST['notes'] = str_replace(" \\n", "\n", $_POST['notes']);
@ -348,7 +388,12 @@ if( isset($_GET['changearenda']) ) {
?> ?>
<STYLE> <STYLE>
.pH3 { COLOR: #8f0000; FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; } .pH3 {
COLOR: #8f0000;
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
FONT-WEIGHT: bold;
}
</STYLE> </STYLE>
<SCRIPT> <SCRIPT>
var sd4 = "<?=$u->info['id'];?>"; var sd4 = "<?=$u->info['id'];?>";
@ -357,24 +402,38 @@ var sd4 = "<?=$u->info['id'];?>";
<SCRIPT LANGUAGE="JavaScript" SRC="//img.new-combats.tech/js/sl2.27.js"></SCRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="//img.new-combats.tech/js/sl2.27.js"></SCRIPT>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=e2e0e0> <body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=e2e0e0>
<div id=hint4 class=ahint></div> <div id=hint4 class=ahint></div>
<?php if($u->error!=''){ echo '<b style="color:red">'.$u->error.'</b><br>'; } ?> <?php if ($u->error != '') {
<TABLE width=100%><TD valign=top height=100%> echo '<b style="color:red">' . $u->error . '</b><br>';
} ?>
<TABLE width=100%>
<TD valign=top height=100%>
<TABLE width=100% cellspacing=0 cellpadding=4 bgcolor=d2d2d2> <TABLE width=100% cellspacing=0 cellpadding=4 bgcolor=d2d2d2>
<FORM METHOD=POST name=F1> <FORM METHOD=POST name=F1>
<tr><td class='pH3'>&nbsp;&nbsp;&nbsp;&nbsp;<?=$nazv;?></FONT></td><td align=right valign=top><SCRIPT>drwfl("<?=$u->info['login'];?>",<?=$u->info['id'];?>,"<?=$u->info['level'];?>",<?=$u->info['align'];?>,"<?=$u->info['clan'];?>")</SCRIPT> &nbsp;</td></tr></table> <tr>
<td class='pH3'>&nbsp;&nbsp;&nbsp;&nbsp;<?= $nazv; ?></FONT></td>
<td align=right valign=top>
<SCRIPT>drwfl("<?=$u->info['login'];?>", <?=$u->info['id'];?>, "<?=$u->info['level'];?>", <?=$u->info['align'];?>, "<?=$u->info['clan'];?>")</SCRIPT> &nbsp;
</td>
</tr>
</table>
<?= $err ?> <?= $err ?>
<? switch ($level){ <? switch ($level){
case 1:#-----Вход?> case 1:#-----Вход
?>
<TABLE cellpadding=0 cellspacing=0> <TABLE cellpadding=0 cellspacing=0>
<TR><TD>&nbsp;Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</TD> <TR>
<TR><TD align=right><i>Комендант</i></TD></TR></TABLE><BR> <TD>&nbsp;Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</TD>
<TR>
<TD align=right><i>Комендант</i></TD>
</TR>
</TABLE><BR>
Арендовать Койку в общежитии<BR> Арендовать Койку в общежитии<BR>
Цена: 1 кр. + 1 кр. в неделю.<BR> Цена: 1 кр. + 1 кр. в неделю.<BR>
&bull; Размер сундука: 25 вещей<BR> &bull; Размер сундука: 25 вещей<BR>
&bull; Сувениры: 50 шт.<BR> &bull; Сувениры: 50 шт.<BR>
&bull; Койка<BR> &bull; Койка<BR>
<A href="?arenda=base&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 1 кр.?')">Арендовать</A> <A href="?arenda=base&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 5 зубов?')">Арендовать за <?=$u->zuby(5,1)?></A> <A href="?arenda=base&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 1 кр.?')">Арендовать</A>
<HR> <HR>
Арендовать Койку с тумбочкой<BR> Арендовать Койку с тумбочкой<BR>
@ -384,7 +443,7 @@ var sd4 = "<?=$u->info['id'];?>";
&bull; Сувениры: 150 шт.<BR> &bull; Сувениры: 150 шт.<BR>
&bull; Койка<BR> &bull; Койка<BR>
<A href="?arenda=advanced&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 3 кр.?')">Арендовать</A> <A href="?arenda=base&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 15 зубов?')">Арендовать за <?=$u->zuby(15,1)?></A> <A href="?arenda=advanced&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 3 кр.?')">Арендовать</A>
<HR> <HR>
@ -396,23 +455,33 @@ var sd4 = "<?=$u->info['id'];?>";
&bull; Мест для животных: 2 <BR> &bull; Мест для животных: 2 <BR>
&bull; Койка<BR> &bull; Койка<BR>
<A href="?arenda=advanced2&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 10 кр.?')">Арендовать</A> <A href="?arenda=base&sd4=<?=$u->info['id'];?>" onClick="return confirm('Вы уверены, что хотите заплатить 50 зубов?')">Арендовать за <?=$u->zuby(50,1)?></A> <A href="?arenda=advanced2&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 10 кр.?')">Арендовать</A>
<HR> <HR>
<? ;break; <?
case 2:#-----Арендованная койка?> break;
case 2:#-----Арендованная койка
?>
<TABLE cellpadding=0 cellspacing=0> <TABLE cellpadding=0 cellspacing=0>
<TR><TD>Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</TD> <TR>
<TR><TD align=right><i>Комендант</i></TD></TR></TABLE><BR> <TD>Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</TD>
<TR>
<TD align=right><i>Комендант</i></TD>
</TR>
</TABLE><BR>
Вы арендовали <?= $name; ?><BR> Вы арендовали <?= $name; ?><BR>
Начало аренды: <?= date("d.m.y H:i", $objaga['starttime']); ?><BR> Начало аренды: <?= date("d.m.y H:i", $objaga['starttime']); ?><BR>
Оплачено до: <?=$showdate;?> <IMG src="//img.new-combats.tech/i/up.gif" width=11 height=11 title="Оплатить" onClick="usescript('Оплата аренды','main.php', 'payarenda', '<?=$objaga['weekcost']?>', 'Сумма оплаты:<BR>',0, '<INPUT type=hidden name=sd4 value='+sd4+'>')" style="cursor:hand"><BR> Оплачено до: <?= $showdate; ?> <IMG src="//img.new-combats.tech/i/up.gif" width=11 height=11 title="Оплатить"
onClick="usescript('Оплата аренды','main.php', 'payarenda', '<?= $objaga['weekcost'] ?>', 'Сумма оплаты:<BR>',0, '<INPUT type=hidden name=sd4 value='+sd4+'>')"
style="cursor:hand"><BR>
Цена в неделю: <?= $objaga['weekcost']; ?> кр.<BR> Цена в неделю: <?= $objaga['weekcost']; ?> кр.<BR>
&nbsp;&bull; Размер сундука: <?= $maxbox; ?> вещей<BR> &nbsp;&bull; Размер сундука: <?= $maxbox; ?> вещей<BR>
&nbsp;&bull; Сувениры: <?= $max_p_box; ?> шт.<BR> &nbsp;&bull; Сувениры: <?= $max_p_box; ?> шт.<BR>
<?if($objaga['type']=="advanced2") {echo'&nbsp;&bull; Мест для животных: 2 <BR>';}?> <? if ($objaga['type'] == "advanced2") {
echo '&nbsp;&bull; Мест для животных: 2 <BR>';
} ?>
&nbsp&bull; Койка<BR> &nbsp&bull; Койка<BR>
<BR> <BR>
@ -429,16 +498,19 @@ var sd4 = "<?=$u->info['id'];?>";
Смена аренды, оплаченной зубами на кредитную аренду запрещена.<BR> Смена аренды, оплаченной зубами на кредитную аренду запрещена.<BR>
Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR> Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR>
</SMALL> </SMALL>
<?;break; <?
break;
case 3:#-----Комната case 3:#-----Комната
switch ($room){ switch ($room){
case 1:#-----Заметки?> case 1:#-----Заметки
?>
Вы находитесь в своей комнате. Первое, что вы видите - записная книжка.<BR> Вы находитесь в своей комнате. Первое, что вы видите - записная книжка.<BR>
Вы можете оставить нужные вам записи общим объемом не более 10000 символов. Вы можете оставить нужные вам записи общим объемом не более 10000 символов.
<TEXTAREA rows=15 style='width: 90%;' name='notes'><?= $objaga['notes']; ?></TEXTAREA><BR> <TEXTAREA rows=15 style='width: 90%;' name='notes'><?= $objaga['notes']; ?></TEXTAREA><BR>
<INPUT type='hidden' name='room' value='1'> <INPUT type='hidden' name='room' value='1'>
<INPUT type='submit' name='savenotes' value='Сохранить текст'> <INPUT type='submit' name='savenotes' value='Сохранить текст'>
<? ;break; <?
break;
case 2:#-----Сундук case 2:#-----Сундук
@ -448,8 +520,45 @@ var sd4 = "<?=$u->info['id'];?>";
$invertory = $u->genInv(8, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `im`.`type` != "28" AND `im`.`type` != "38" AND `im`.`type` != "39" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" ORDER BY `lastUPD` DESC'); $invertory = $u->genInv(8, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `im`.`type` != "28" AND `im`.`type` != "38" AND `im`.`type` != "39" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" ORDER BY `lastUPD` DESC');
?> ?>
<script> <script>
function moveAnimate(element, newParent){element = $(element); newParent= $(newParent);var oldOffset = element.offset();element.appendTo(newParent);var newOffset = element.offset();var temp = element.clone().appendTo('body');temp.css('position', 'absolute').css('left', oldOffset.left).css('top', oldOffset.top).css('width', element.width()).css('zIndex', 250);element.hide();temp.animate( {'top': newOffset.top, 'left':newOffset.left}, 'slow', function(){element.show();temp.remove();}); var count_invertory = $('#invertory .item').length;var count_chest = $('#chest .item').length; if (parseInt(count_chest)==0) { $('#chest_null').show(); } else { $('#chest_null').hide(); }if (parseInt(count_invertory)==0) { $('#invertory_null').show(); } else { $('#invertory_null').hide(); }} function moveAnimate(element, newParent) {
function obj_recount(action){var count = parseInt($('#in_chest').text());var count22 = parseInt($('#in_chest22').text());if (action==1) {$('#in_chest').text(count+1);$('#in_chest22').text(count22-1);}if (action==2) {$('#in_chest').text(count-1);$('#in_chest22').text(count22-1);}} element = $(element);
newParent = $(newParent);
var oldOffset = element.offset();
element.appendTo(newParent);
var newOffset = element.offset();
var temp = element.clone().appendTo('body');
temp.css('position', 'absolute').css('left', oldOffset.left).css('top', oldOffset.top).css('width', element.width()).css('zIndex', 250);
element.hide();
temp.animate({'top': newOffset.top, 'left': newOffset.left}, 'slow', function () {
element.show();
temp.remove();
});
var count_invertory = $('#invertory .item').length;
var count_chest = $('#chest .item').length;
if (parseInt(count_chest) == 0) {
$('#chest_null').show();
} else {
$('#chest_null').hide();
}
if (parseInt(count_invertory) == 0) {
$('#invertory_null').show();
} else {
$('#invertory_null').hide();
}
}
function obj_recount(action) {
var count = parseInt($('#in_chest').text());
var count22 = parseInt($('#in_chest22').text());
if (action == 1) {
$('#in_chest').text(count + 1);
$('#in_chest22').text(count22 - 1);
}
if (action == 2) {
$('#in_chest').text(count - 1);
$('#in_chest22').text(count22 - 1);
}
}
function obj_add(id, room, rnd, t) { function obj_add(id, room, rnd, t) {
@ -457,7 +566,9 @@ var sd4 = "<?=$u->info['id'];?>";
$(t).text('В рюкзак'); $(t).text('В рюкзак');
t = $(t).parents('.item').first(); t = $(t).parents('.item').first();
if (rnd=='' || rnd ==undefined || rnd =='undefined') {var rnd = 1;} if (rnd == '' || rnd == undefined || rnd == 'undefined') {
var rnd = 1;
}
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "main.php?obj_add=" + id + "&room=" + room + "&rnd=" + rnd, cache: false, success: function () { url: "main.php?obj_add=" + id + "&room=" + room + "&rnd=" + rnd, cache: false, success: function () {
@ -470,10 +581,20 @@ var sd4 = "<?=$u->info['id'];?>";
} }
} }
function obj_take(id, room, rnd, t) { function obj_take(id, room, rnd, t) {
if (parseInt($('#in_chest22').text()) > 0) { if (parseInt($('#in_chest22').text()) > 0) {
$(t).text('В сундук'); $(t).text('В сундук');
t = $(t).parents('.item').first();if (rnd=='' || rnd ==undefined || rnd =='undefined') {var rnd = 1;}$.ajax({type: "GET",url: "main.php?obj_take="+id+"&room="+room+"&rnd="+rnd,cache: false,success: function () {obj_recount(2);moveAnimate(t, $('#invertory').children('tbody'));}}); t = $(t).parents('.item').first();
if (rnd == '' || rnd == undefined || rnd == 'undefined') {
var rnd = 1;
}
$.ajax({
type: "GET", url: "main.php?obj_take=" + id + "&room=" + room + "&rnd=" + rnd, cache: false, success: function () {
obj_recount(2);
moveAnimate(t, $('#invertory').children('tbody'));
}
});
} else { } else {
alert('Лимит передач на сегодня исчерпан.'); alert('Лимит передач на сегодня исчерпан.');
} }
@ -504,41 +625,51 @@ var sd4 = "<?=$u->info['id'];?>";
<td><b>&nbsp;В рюкзаке</b></td> <td><b>&nbsp;В рюкзаке</b></td>
</tr> </tr>
<tr> <tr>
<td width='50%' valign='top'><div <?php if($chest[0]!=0){ echo 'style="display:none;"'; }?> id="chest_null"> ПУСТО</div><table id="chest" width='100%' cellpadding='2' BGCOLOR='A5A5A5' cellspacing='1'><tbody><?php if($chest[0]!=0){ echo $chest[2]; } ?></tbody></table></td> <td width='50%' valign='top'>
<td width='50%' valign='top'><div <?php if($invertory[0]!=0){ echo 'style="display:none;"';}?> id="invertory_null"> ПУСТО</div><table id="invertory" width='100%' cellpadding='2' BGCOLOR='A5A5A5' cellspacing='1'><tbody><?php if($invertory[0]!=0){ echo $invertory[2]; } ?></tbody></table></td> <div <?php if ($chest[0] != 0) {
echo 'style="display:none;"';
} ?> id="chest_null"> ПУСТО
</div>
<table id="chest" width='100%' cellpadding='2' BGCOLOR='A5A5A5' cellspacing='1'>
<tbody><?php if ($chest[0] != 0) {
echo $chest[2];
} ?></tbody>
</table>
</td>
<td width='50%' valign='top'>
<div <?php if ($invertory[0] != 0) {
echo 'style="display:none;"';
} ?> id="invertory_null"> ПУСТО
</div>
<table id="invertory" width='100%' cellpadding='2' BGCOLOR='A5A5A5' cellspacing='1'>
<tbody><?php if ($invertory[0] != 0) {
echo $invertory[2];
} ?></tbody>
</table>
</td>
</tr> </tr>
</table> </table>
<?php <?php
break; break;
case 6:#-----Сувениры case 6:#-----Сувениры
$itmAll = ''; $itmAllSee = ''; $itmAll = '';
$itmAllSee = '';
$itmAll = $u->genInv(10, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" ORDER BY `lastUPD` DESC'); $itmAll = $u->genInv(10, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" ORDER BY `lastUPD` DESC');
?> ?>
Сувениры: <?= $itmAll['collich'] ?> / <?= $max_p_box ?>, передач: <?= $u->info['transfers'] ?><BR><BR> Сувениры: <?= $itmAll['collich'] ?> / <?= $max_p_box ?>, передач: <?= $u->info['transfers'] ?><BR><BR>
<TABLE width=100% cellpadding=0 cellspacing=0><TR bgcolor=#A0A0A0> <TABLE width=100% cellpadding=0 cellspacing=0>
<TD width=50%>&nbsp;На сохранении</TD><TD>В рюкзаке</TD> <TR bgcolor=#A0A0A0>
<TD width=50%>&nbsp;На сохранении</TD>
<TD>В рюкзаке</TD>
<TR> <TR>
<TD valign=top><!--Рюкзак--> <TD valign=top><!--Рюкзак-->
<TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BGCOLOR=A5A5A5> <TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BGCOLOR=A5A5A5>
<?php <?php
$itmAll = ''; $itmAllSee = ''; $itmAll = '';
$itmAllSee = '';
$itmAll = $u->genInv(10, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" ORDER BY `lastUPD` DESC'); $itmAll = $u->genInv(10, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" ORDER BY `lastUPD` DESC');
if($itmAll[0]==0) if ($itmAll[0] == 0) {
{
echo '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО</td></tr>';
}else{
echo $itmAll[2];
}
?>
</TABLE>
</TD><TD valign=top><!--Рюкзак-->
<TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BGCOLOR=A5A5A5>
<?php
$itmAll = ''; $itmAllSee = '';
$itmAll = $u->genInv(9,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" ORDER BY `lastUPD` DESC');
if($itmAll[0]==0)
{
echo '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО</td></tr>'; echo '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО</td></tr>';
} else { } else {
echo $itmAll[2]; echo $itmAll[2];
@ -546,9 +677,25 @@ if($itmAll[0]==0)
?> ?>
</TABLE> </TABLE>
</TD> </TD>
</TR></TABLE> <TD valign=top><!--Рюкзак-->
<TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BGCOLOR=A5A5A5>
<?php
$itmAll = '';
$itmAllSee = '';
$itmAll = $u->genInv(9, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "39") AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" ORDER BY `lastUPD` DESC');
if ($itmAll[0] == 0) {
echo '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО</td></tr>';
} else {
echo $itmAll[2];
}
?>
</TABLE>
</TD>
</TR>
</TABLE>
<? break; <? break;
case 7:#-----Персонажи?> case 7:#-----Персонажи
?>
<h3>Работа с персонажами</h3> <h3>Работа с персонажами</h3>
<?php <?php
@ -689,9 +836,12 @@ if( $user_new_pers == true ) {
echo $r; echo $r;
?> ?>
<? ;break; <?
case 3:#-----Животные?> break;
<TABLE width=100% cellpadding=0 cellspacing=0 valign=top><TR style='padding-top: 10'> case 3:#-----Животные
?>
<TABLE width=100% cellpadding=0 cellspacing=0 valign=top>
<TR style='padding-top: 10'>
<TD> <TD>
<TABLE cellpadding=0 cellspacing=0> <TABLE cellpadding=0 cellspacing=0>
@ -703,7 +853,8 @@ echo'<TD width=150 align=center><nobr><B>'.$cage1['name'].'</B> ['.$cage1['level
echo '<TD width=150 align=center><nobr><B>свободно</B></nobr><BR> echo '<TD width=150 align=center><nobr><B>свободно</B></nobr><BR>
<IMG src="//img.new-combats.tech/i/obraz/0/null.gif" width=120 height=220>'; <IMG src="//img.new-combats.tech/i/obraz/0/null.gif" width=120 height=220>';
} }
?></A></TD> ?></A>
</TD>
<? if ($cage2['pet_in_cage'] == 2) { <? if ($cage2['pet_in_cage'] == 2) {
echo '<TD width=150 align=center><nobr><B>' . $cage2['name'] . '</B> [' . $cage2['level'] . ']</nobr> echo '<TD width=150 align=center><nobr><B>' . $cage2['name'] . '</B> [' . $cage2['level'] . ']</nobr>
<A href="/main.php?pet_id=' . $cage2['id'] . '&sd4=' . $u->info['id'] . '&room=3&0.' . rand(0, 9999999999999999) . '" alt="Оставить"><IMG src="//img.new-combats.tech/i/obraz/' . $cage2['sex'] . '/' . $cage2['obraz'] . '.gif" width=120 height=220>'; <A href="/main.php?pet_id=' . $cage2['id'] . '&sd4=' . $u->info['id'] . '&room=3&0.' . rand(0, 9999999999999999) . '" alt="Оставить"><IMG src="//img.new-combats.tech/i/obraz/' . $cage2['sex'] . '/' . $cage2['obraz'] . '.gif" width=120 height=220>';
@ -711,7 +862,8 @@ echo'<TD width=150 align=center><nobr><B>'.$cage2['name'].'</B> ['.$cage2['level
echo '<TD width=150 align=center><nobr><B>свободно</B></nobr><BR> echo '<TD width=150 align=center><nobr><B>свободно</B></nobr><BR>
<IMG src="//img.new-combats.tech/i/obraz/0/null.gif" width=120 height=220>'; <IMG src="//img.new-combats.tech/i/obraz/0/null.gif" width=120 height=220>';
} }
?></A></TD> ?></A>
</TD>
</TABLE> </TABLE>
</TD> </TD>
<TD>&nbsp;</TD> <TD>&nbsp;</TD>
@ -725,9 +877,12 @@ echo'<nobr><B>'.$pet['name'].'</B> ['.$pet['level'].']</nobr>
<A href="/main.php?pet_id=-' . $pet['id'] . '&sd4=' . $u->info['id'] . '&room=3&0.' . rand(0, 9999999999999999) . '" alt="Оставить"><IMG src="//img.new-combats.tech/i/obraz/' . $pet['sex'] . '/' . $pet['obraz'] . '.gif" width=120 height=220>'; <A href="/main.php?pet_id=-' . $pet['id'] . '&sd4=' . $u->info['id'] . '&room=3&0.' . rand(0, 9999999999999999) . '" alt="Оставить"><IMG src="//img.new-combats.tech/i/obraz/' . $pet['sex'] . '/' . $pet['obraz'] . '.gif" width=120 height=220>';
} ?> } ?>
</A> </A>
</TD></TR></TABLE> </TD>
<? ;break; </TR></TABLE>
case 4:#-----Сон?> <?
break;
case 4:#-----Сон
?>
Вы можете заснуть, забыв о внешнем мире.<BR> Вы можете заснуть, забыв о внешнем мире.<BR>
Во время сна все временные эффекты на вас приостанавливаются. Это касается как, например, эликсиров, так и травм.<BR> Во время сна все временные эффекты на вас приостанавливаются. Это касается как, например, эликсиров, так и травм.<BR>
Сон не влияет на состояние предметов с ограниченным сроком существования<BR><BR> Сон не влияет на состояние предметов с ограниченным сроком существования<BR><BR>
@ -741,9 +896,11 @@ echo '<font color=red><b>Во время сна нельзя перемещат
<A href="?to_<?= $link; ?>=1&sd4=<?= $u->info['id']; ?>&room=4&0.<?= rand(0, 9999999999999999); ?>"><?= $button; ?></A><BR> <A href="?to_<?= $link; ?>=1&sd4=<?= $u->info['id']; ?>&room=4&0.<?= rand(0, 9999999999999999); ?>"><?= $button; ?></A><BR>
<?= $div1 ?> <?= $div1 ?>
</SMALL> </SMALL>
<?}#--Конец свича $room <?
;break; }#--Конец свича $room
case 4:#-----------------------------------------------смена аренды----------------------------------------?> break;
case 4:#-----------------------------------------------смена аренды----------------------------------------
?>
Вы можете сменить арендуемое помещение:<BR><BR> Вы можете сменить арендуемое помещение:<BR><BR>
<SMALL> <SMALL>
Для смены аренды на вашем балансе должна быть необходимая сумма.<BR> Для смены аренды на вашем балансе должна быть необходимая сумма.<BR>
@ -751,7 +908,8 @@ echo '<font color=red><b>Во время сна нельзя перемещат
Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR> Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR>
</SMALL> </SMALL>
<?php <?php
if($objaga['type']!="base"){?> if ($objaga['type'] != "base"){
?>
<HR> <HR>
Арендовать Койку в общежитии<BR> Арендовать Койку в общежитии<BR>
Цена: 1 кр. + 1 кр. в неделю.<BR> Цена: 1 кр. + 1 кр. в неделю.<BR>
@ -761,8 +919,10 @@ if($objaga['type']!="base"){?>
&bull; Койка<BR> &bull; Койка<BR>
<A href="?changearenda=base&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 1 кр. за смену помещения?')">Сменить помещение</A> <A href="?changearenda=base&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 1 кр. за смену помещения?')">Сменить помещение</A>
<?} <?
if($objaga['type']!="advanced"){?> }
if ($objaga['type'] != "advanced"){
?>
<HR> <HR>
Арендовать Койку с тумбочкой<BR> Арендовать Койку с тумбочкой<BR>
Цена: 3 кр. + 3 кр. в неделю.<BR> Цена: 3 кр. + 3 кр. в неделю.<BR>
@ -773,8 +933,10 @@ if($objaga['type']!="advanced"){?>
<A href="?changearenda=advanced&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 3 кр. за смену помещения?')">Сменить помещение</A> <A href="?changearenda=advanced&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 3 кр. за смену помещения?')">Сменить помещение</A>
<?} <?
if($objaga['type']!="advanced2"){?> }
if ($objaga['type'] != "advanced2"){
?>
<HR> <HR>
Арендовать Койку со шкафом<BR> Арендовать Койку со шкафом<BR>
Цена: 10 кр. + 10 кр. в неделю.<BR> Цена: 10 кр. + 10 кр. в неделю.<BR>
@ -786,14 +948,17 @@ if($objaga['type']!="advanced2"){?>
<A href="?changearenda=advanced2&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 10 кр. за смену помещения?')">Сменить помещение</A> <A href="?changearenda=advanced2&sd4=<?= $u->info['id']; ?>" onClick="return confirm('Вы уверены, что хотите заплатить 10 кр. за смену помещения?')">Сменить помещение</A>
<?} <?
}
echo '<HR>'; echo '<HR>';
} }
?> ?>
</TD> </TD>
<td width="280" valign="top"> <td width="280" valign="top">
<TABLE cellspacing="0" cellpadding="0"><TD width="100%">&nbsp;</TD><TD> <TABLE cellspacing="0" cellpadding="0">
<TD width="100%">&nbsp;</TD>
<TD>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top"> <tr align="right" valign="top">
<td> <td>
@ -809,32 +974,40 @@ echo'<HR>';
<?php if ($u->info['room'] == 214 && $sleep_mod == 0) { ?> <?php if ($u->info['room'] == 214 && $sleep_mod == 0) { ?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.11&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.11',1); ?>">Страшилкина Улица</a></td> <td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.11&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.11', 1); ?>">Страшилкина Улица</a></td>
</tr> </tr>
<?php <?php
if($ar_lvl>=1){?> if ($ar_lvl >= 1) {
<tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.217&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.217',1); ?>">Общ. Этаж 1</a></td>
</tr>
<?php } } ?>
<?php if($u->info['room']=='217' and $ar_lvl>=1 and $sleep_mod==0) { ?>
<tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.214&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.214',1); ?>">Общежитие</a></td>
</tr>
<?php
}if($u->info['room']=='217' and $ar_lvl>=2 and $sleep_mod==0){
?> ?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.218&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.218',1); ?>">Общ. Этаж 2</a></td> <td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.217&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.217', 1); ?>">Общ. Этаж 1</a></td>
</tr>
<?php }
} ?>
<?php if ($u->info['room'] == '217' and $ar_lvl >= 1 and $sleep_mod == 0) { ?>
<tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.214&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.214', 1); ?>">Общежитие</a></td>
</tr>
<?php
}
if ($u->info['room'] == '217' and $ar_lvl >= 2 and $sleep_mod == 0) {
?>
<tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.218&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.218', 1); ?>">Общ. Этаж 2</a></td>
</tr> </tr>
<? } ?> <? } ?>
<? if ($u->info['room'] == '218' and $ar_lvl >= 2 and $sleep_mod == 0) { ?> <? if ($u->info['room'] == '218' and $ar_lvl >= 2 and $sleep_mod == 0) { ?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.217&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.217',1); ?>">Общ. Этаж 1</a></td> <td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.217&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.217', 1); ?>">Общ. Этаж 1</a></td>
</tr> </tr>
<?php <?php
} }
@ -842,14 +1015,16 @@ if($u->info['room']=='218' and $ar_lvl>=3 and $sleep_mod==0){
?> ?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.219&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.219',1); ?>">Общ. Этаж 3</a></td> <td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.219&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.219', 1); ?>">Общ. Этаж 3</a></td>
</tr> </tr>
<?php } <?php }
if ($u->info['room'] == '219' and $ar_lvl >= 3 and !isset($sleep['id'])) { if ($u->info['room'] == '219' and $ar_lvl >= 3 and !isset($sleep['id'])) {
?> ?>
<tr> <tr>
<td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td> <td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.218&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.218',1); ?>">Общ. Этаж 2</a></td> <td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onClick="location='main.php?loc=1.180.0.218&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.218', 1); ?>">Общ. Этаж 2</a></td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
@ -860,10 +1035,13 @@ if($u->info['room']=='219' and $ar_lvl>=3 and !isset($sleep['id'])){
</td> </td>
</tr> </tr>
</table> </table>
<div id="mmoves" style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap; z-index:200"></div> <div id="mmoves"
style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap; z-index:200"></div>
</HTML> </HTML>
</TD></TR> </TD>
<TR><TD colspan=2> </TR>
<TR>
<TD colspan=2>
<NOBR> <NOBR>
Деньги: <?= $u->info['money']; ?> кр.<BR><BR> Деньги: <?= $u->info['money']; ?> кр.<BR><BR>
<?php if ($u->info['room'] == "214") { ?> <?php if ($u->info['room'] == "214") { ?>
@ -871,15 +1049,39 @@ if($u->info['room']=='219' and $ar_lvl>=3 and !isset($sleep['id'])){
<?php } else { <?php } else {
//Коридор //Коридор
//$room_array = array (1=>'Комната',2=>'Сундук',3=>'Сувениры',4=>'Животные',5=>'Сон'); //$room_array = array (1=>'Комната',2=>'Сундук',3=>'Сувениры',4=>'Животные',5=>'Сон');
if($_GET['room']!=1){echo"<a href='?room=1&0.".$code."'><B>Комната</B></a>";}else{echo"<B>Комната</B>";}?><BR> if ($_GET['room'] != 1) {
<?php if($_GET['room']!=2){echo"<A href='?room=2&0.".$code."'>Сундук</A>";}else{echo"<B>Сундук</B>";}?><BR> echo "<a href='?room=1&0." . $code . "'><B>Комната</B></a>";
<?php if($_GET['room']!=6){echo"<A href='?room=6&0.".$code."'>Сувениры</A>";}else{echo"<B>Сувениры</B>";}?><BR> } else {
<?php if($_GET['room']!=7){echo"<A href='?room=7&0.".$code."'>Персонажи</A>";}else{echo"<B>Персонажи</B>";}?><BR> echo "<B>Комната</B>";
} ?><BR>
<?php if ($_GET['room'] != 2) {
echo "<A href='?room=2&0." . $code . "'>Сундук</A>";
} else {
echo "<B>Сундук</B>";
} ?><BR>
<?php if ($_GET['room'] != 6) {
echo "<A href='?room=6&0." . $code . "'>Сувениры</A>";
} else {
echo "<B>Сувениры</B>";
} ?><BR>
<?php if ($_GET['room'] != 7) {
echo "<A href='?room=7&0." . $code . "'>Персонажи</A>";
} else {
echo "<B>Персонажи</B>";
} ?><BR>
<?php <?php
if ($objaga['type'] == "advanced2") { if ($objaga['type'] == "advanced2") {
if($_GET['room']!=3){echo"<A href='?room=3&0.".$code."'>Животные</A><BR>";}else{echo"<B>Животные</B><BR>";} if ($_GET['room'] != 3) {
echo "<A href='?room=3&0." . $code . "'>Животные</A><BR>";
} else {
echo "<B>Животные</B><BR>";
}
} ?>
<?php if ($_GET['room'] != 4) {
echo "<A href='?room=4&0." . $code . "'>Сон</A>";
} else {
echo "<B>Сон</B>";
} ?> } ?>
<?php if($_GET['room']!=4){echo"<A href='?room=4&0.".$code."'>Сон</A>";}else{echo"<B>Сон</B>";}?>
<?php } ?> <?php } ?>
<?php <?php
} #end hostel } #end hostel

View File

@ -599,87 +599,6 @@ if (isset($_GET['upgrade']) && true == false) {
} else { } else {
$re2 = 'Предмет подходящий для ремонта не найден в инвентаре'; $re2 = 'Предмет подходящий для ремонта не найден в инвентаре';
} }
} elseif (isset($_GET['remonz'])) {
$t = 1;
if ($_GET['t'] == 2) {
$t = 2;
} elseif ($_GET['t'] == 3) {
$t = 3;
}
$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['remonz']) . '" LIMIT 1'));
$rem_price = round($ir['price1'] * 0.1 / 100, 2);//цена ремонта за 1ед поломки
$rem_all = round($ir['price1'] * $ir['iznosNOW'] * 0.1 / 100, 2);//цена ремонта full
if ($rem_price < 0.01) {
$rem_price = 0.01;
} //кэп поможет
if (isset($ir['id'])) {
$po = Conversion::dataStringToArray($ir['data']);
if (isset($po['noremont'])) {
$re2 = 'Предмет не подлежит ремонту в этой мастерской.';
} else {
if ($ir['1price'] > 0) {
$po['zazuby'] = $ir['1price'];
} else {
$po['zazuby'] = $ir['price1'];
}
$po['nosale'] = 1;
if ($t == 1) {
$rem_cell = $rem_price;
$t = 0;
$rm = 1;
$re2 .= ' 1 ед.';
} elseif ($t == 2) {
$t = 0;
$rm = 10;
$rem_cell = $rem_price * 10;
$re2 .= ' 10 ед.';
} elseif ($t == 3) {
$rem_cell = $rem_all;
$t = 0;
$rm = $ir['iznosNOW'];
$re2 .= $rm . ' ед.';
}
if ($rem_cell > $u->info['money4']) {
$re2 = 'У вас недостаточно зубов для ремонта.';
} else {
if ($rm > $ir['iznosNOW']) {
$rm = $ir['iznosNOW'];
}
$ir['iznosNOW'] -= $rm;
if ($ir['iznosNOW'] < 0) {
$ir['iznosNOW'] = 0;
}
$u->info['money4'] -= $rem_cell;
$upd = mysql_query('UPDATE `users` SET `money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
if ($upd) {
$il = $ir['iznosMAX'];
if (rand(0, 100) <= 25) {
$ir['iznosMAX'] -= 1;
}
if ($ir['iznosMAX'] < 1) {
$ir['iznosMAX'] = 1;
}
$po = Conversion::arrayToDataString($po);
mysql_query('UPDATE `items_users` SET `data` = "' . $po . '",`iznosNOW` = "' . $ir['iznosNOW'] . '",`iznosMAX` = "' . $ir['iznosMAX'] . '" WHERE `id` = "' . $ir['id'] . '" LIMIT 1');
$re2 = 'Удачно произведен ремонт ' . $re2 . ' предмета &quot;' . $ir['name'] . '&quot; за ' . $u->zuby($rem_cell, 1) . '.';
$dop = 0;
if (ceil($il) > ceil($ir['iznosMAX'])) {
$re2 .= '<br>К сожалению, максимальная долговечность предмета из-за ремонта уменьшилась.';
$dop = 1;
}
$u->addDelo(2, $u->info['id'], '&quot;<font color="grey">System.remont</font>&quot;: Предмет &quot;' . $ir['name'] . '&quot; [itm:' . $ir['id'] . '] был <b>отремонтирован</b>, максимальная долговечность уменьшилась: ' . $dop . ' (' . $rm . ' ед. за ' . $t . ' зубов.).', time(), $u->info['city'], 'System.remont', 0, 0);
} else {
$re2 = 'Что-то здесь не так...';
}
}
}
} else {
$re2 = 'Предмет подходящий для ремонта не найден в инвентаре';
}
} elseif (isset($_GET['upgradelvl'])) { } elseif (isset($_GET['upgradelvl'])) {
$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['upgradelvl']) . '" LIMIT 1')); $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['upgradelvl']) . '" LIMIT 1'));
if (isset($ir['id'])) { if (isset($ir['id'])) {

View File

@ -1,22 +1,27 @@
<?php <?php
if(!defined('GAME')){ die(); }
use Core\Db;
if (!defined('GAME')) {
die();
}
session_start(); session_start();
$sleep_mod = 0; $sleep_mod = 0;
$_SESSION['objaga'] = 'load '; $_SESSION['objaga'] = 'load ';
$hostel_option = array( $hostel_option = [
'changelist' => array( 'changelist' => [
'type' => 999, 'type' => 999,
'room' => 214 'room' => 214,
), ],
'none' => array( 'none' => [
'type' => 0, 'type' => 0,
'room' => 214, 'room' => 214,
'name' => 'Общежитие', 'name' => 'Общежитие',
'stage' => 'холл', 'stage' => 'холл',
'price' => 0, 'price' => 0,
'partition' => '' 'partition' => '',
), ],
'base' => array( 'base' => [
'type' => 1, 'type' => 1,
't_name' => 'Койка в общежитии', 't_name' => 'Койка в общежитии',
't_names' => 'Койку в общежитии', 't_names' => 'Койку в общежитии',
@ -24,10 +29,10 @@ $hostel_option = array(
'name' => 'Общ. Этаж 1', 'name' => 'Общ. Этаж 1',
'stage' => 'на 1 этаже', 'stage' => 'на 1 этаже',
'price' => 1, 'price' => 1,
'tariff' => array('items'=>25, 'souvenirs'=>50, 'animal'=>0), 'tariff' => ['items' => 25, 'souvenirs' => 50, 'animal' => 0],
'partition' => array(1=>'Комната',2=>'Хранилище',4=>'Сон') 'partition' => [1 => 'Комната', 2 => 'Хранилище', 4 => 'Сон'],
), ],
'advanced' => array( 'advanced' => [
'type' => 2, 'type' => 2,
't_name' => 'Койка с тумбочкой', 't_name' => 'Койка с тумбочкой',
't_names' => 'Койку с тумбочкой', 't_names' => 'Койку с тумбочкой',
@ -35,10 +40,10 @@ $hostel_option = array(
'name' => 'Общ. Этаж 2', 'name' => 'Общ. Этаж 2',
'stage' => 'на 2 этаже', 'stage' => 'на 2 этаже',
'price' => 3, 'price' => 3,
'tariff' => array('items'=>50, 'souvenirs'=>150, 'animal'=>0), 'tariff' => ['items' => 50, 'souvenirs' => 150, 'animal' => 0],
'partition' => array(1=>'Комната',2=>'Хранилище',4=>'Сон') 'partition' => [1 => 'Комната', 2 => 'Хранилище', 4 => 'Сон'],
), ],
'advanced2' => array( 'advanced2' => [
'type' => 3, 'type' => 3,
't_name' => 'Койка со шкафом', 't_name' => 'Койка со шкафом',
't_names' => 'Койку со шкафом', 't_names' => 'Койку со шкафом',
@ -46,13 +51,13 @@ $hostel_option = array(
'name' => 'Общ. Этаж 3', 'name' => 'Общ. Этаж 3',
'stage' => 'на 3 этаже', 'stage' => 'на 3 этаже',
'price' => 10, 'price' => 10,
'tariff' => array('items'=>70, 'souvenirs'=>200, 'animal'=>2), 'tariff' => ['items' => 70, 'souvenirs' => 200, 'animal' => 2],
'partition' => array(1=>'Комната',2=>'Хранилище',4=>'Сон') 'partition' => [1 => 'Комната', 2 => 'Хранилище', 4 => 'Сон'],
) ],
); ];
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1); $sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
if( isset($sleep) AND $sleep[0]==0 AND ( isset($_GET['ajaxHostel']) AND $_GET['ajaxHostel'] == 1 OR isset($_GET['ajax']) AND $_GET['ajax'] == 1) ){ if (isset($sleep) and $sleep[0] == 0 and (isset($_GET['ajaxHostel']) and $_GET['ajaxHostel'] == 1 or isset($_GET['ajax']) and $_GET['ajax'] == 1)) {
$hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';")); $hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"));
if ($hostel['partition'] == 2) { if ($hostel['partition'] == 2) {
@ -74,9 +79,9 @@ if( isset($sleep) AND $sleep[0]==0 AND ( isset($_GET['ajaxHostel']) AND $_GET['a
} }
} }
die('ajaxHostel'); die('ajaxHostel');
} elseif( isset($sleep) AND $sleep[0]==0 AND isset($_GET['room']) AND $_GET['room'] !='' AND (int)$_GET['room']>0 AND (int)$_GET['room']<10 AND !isset($_GET['to_sleep']) AND !isset($_GET['to_awake']) ){ } elseif (isset($sleep) and $sleep[0] == 0 and isset($_GET['room']) and $_GET['room'] != '' and (int)$_GET['room'] > 0 and (int)$_GET['room'] < 10 and !isset($_GET['to_sleep']) and !isset($_GET['to_awake'])) {
mysql_query('UPDATE `house` SET `partition` = "' . mysql_real_escape_string((int)$_GET['room']) . '" WHERE `owner` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1'); mysql_query('UPDATE `house` SET `partition` = "' . mysql_real_escape_string((int)$_GET['room']) . '" WHERE `owner` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1');
} elseif( isset($sleep) AND $sleep[0]==0 AND isset($_GET['category']) AND $_GET['category'] !='' AND (int)$_GET['category']>0 AND (int)$_GET['category']<10 ){ } elseif (isset($sleep) and $sleep[0] == 0 and isset($_GET['category']) and $_GET['category'] != '' and (int)$_GET['category'] > 0 and (int)$_GET['category'] < 10) {
mysql_query('UPDATE `house` SET `category` = "' . mysql_real_escape_string((int)$_GET['category']) . '" WHERE `owner` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1'); mysql_query('UPDATE `house` SET `category` = "' . mysql_real_escape_string((int)$_GET['category']) . '" WHERE `owner` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1');
} elseif (isset($_GET['to_sleep']) && $_GET['to_sleep'] == '1' && $sleep['vars'] != 'sleep') { } elseif (isset($_GET['to_sleep']) && $_GET['to_sleep'] == '1' && $sleep['vars'] != 'sleep') {
changeSleep(1); changeSleep(1);
@ -89,17 +94,18 @@ if( isset($sleep_mod) and !isset($sleep['id'])){
$sleep_mod = 1; $sleep_mod = 1;
} }
$hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';")); $hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"));
if( $sleep['vars'] == 'sleep' AND isset($hostel) && $hostel_option[$hostel['type']]['room'] != $u->room['id'] && $u->room['id'] != 214 ) changeSleep(2); // Если человек спит в неположенном месте, просыпаемся!!! if ($sleep['vars'] == 'sleep' and isset($hostel) && $hostel_option[$hostel['type']]['room'] != $u->room['id'] && $u->room['id'] != 214) changeSleep(2); // Если человек спит в неположенном месте, просыпаемся!!!
if( isset($_POST['savenotes']) AND $hostel['partition'] == '1' ) { if (isset($_POST['savenotes']) and $hostel['partition'] == '1') {
saveNote(); saveNote();
} }
if (isset($hostel)) { #---обновляем баланс if (isset($hostel)) { #---обновляем баланс
$hostel['balance'] = round(($hostel['weekcost'] * (floor(($hostel['endtime'] - time()) / 24 / 3600))) / 7, 2); $hostel['balance'] = round(($hostel['weekcost'] * (floor(($hostel['endtime'] - time()) / 24 / 3600))) / 7, 2);
mysql_query("UPDATE `house` SET `balance` = '" . $hostel['balance'] . "' WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"); mysql_query("UPDATE `house` SET `balance` = '" . $hostel['balance'] . "' WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';");
} }
$result = array('filter'=>'', 'content'=>'', 'additional'=>''); $result = ['filter' => '', 'content' => '', 'additional' => ''];
function updateHostel(){ function updateHostel()
{
global $hostel, $hostel_option, $u, $err; global $hostel, $hostel_option, $u, $err;
if ($hostel['action'] == 'changearenda') { if ($hostel['action'] == 'changearenda') {
if ($hostel['balance'] >= ($hostel_option[$_GET['changearenda']]['price'] * 2)) { if ($hostel['balance'] >= ($hostel_option[$_GET['changearenda']]['price'] * 2)) {
@ -119,24 +125,17 @@ function updateHostel(){
$err = '<FONT COLOR=red><B>У вас недостаточно зубов<BR></B></FONT><BR>'; $err = '<FONT COLOR=red><B>У вас недостаточно зубов<BR></B></FONT><BR>';
} elseif ($u->info['money'] >= $hostel_option[$_GET['arenda']]['price'] || isset($_GET['azb'])) { } elseif ($u->info['money'] >= $hostel_option[$_GET['arenda']]['price'] || isset($_GET['azb'])) {
mysql_query("INSERT INTO `house`(`owner`,`type`,`starttime`,`endtime`,`balance`,`weekcost`) VALUES ('" . mysql_real_escape_string($u->info['id']) . "','" . mysql_real_escape_string($_GET['arenda']) . "','" . time() . "','" . (time() + 604800) . "','" . $hostel_option[$_GET['arenda']]['price'] . "','" . $hostel_option[$_GET['arenda']]['price'] . "')"); mysql_query("INSERT INTO `house`(`owner`,`type`,`starttime`,`endtime`,`balance`,`weekcost`) VALUES ('" . mysql_real_escape_string($u->info['id']) . "','" . mysql_real_escape_string($_GET['arenda']) . "','" . time() . "','" . (time() + 604800) . "','" . $hostel_option[$_GET['arenda']]['price'] . "','" . $hostel_option[$_GET['arenda']]['price'] . "')");
if(isset($_GET['azb'])) {
mysql_query("UPDATE `users` SET `money4` = `money4`-".($hostel_option[$_GET['arenda']]['price']*5)." WHERE `id` = '".mysql_real_escape_string($u->info['id'])."';");
$err = "<FONT COLOR=red><B>Вы арендовали '".$hostel_option[$_GET['arenda']]['t_names']."' за ".$u->zuby($hostel_option[$_GET['arenda']]['price']*5,1).".<BR></B></FONT><BR>";
}else{
mysql_query("UPDATE `users` SET `money` = `money`-" . $hostel_option[$_GET['arenda']]['price'] . " WHERE `id` = '" . mysql_real_escape_string($u->info['id']) . "';"); mysql_query("UPDATE `users` SET `money` = `money`-" . $hostel_option[$_GET['arenda']]['price'] . " WHERE `id` = '" . mysql_real_escape_string($u->info['id']) . "';");
$err = "<FONT COLOR=red><B>Вы арендовали '" . $hostel_option[$_GET['arenda']]['t_names'] . "' за " . $hostel_option[$_GET['arenda']]['price'] . " кр.<BR></B></FONT><BR>"; $err = "<FONT COLOR=red><B>Вы арендовали '" . $hostel_option[$_GET['arenda']]['t_names'] . "' за " . $hostel_option[$_GET['arenda']]['price'] . " кр.<BR></B></FONT><BR>";
}
}else{
if(isset($_GET['azb'])) {
$err = '<FONT COLOR=red><B>У вас недостаточно зубов<BR></B></FONT><BR>';
} else { } else {
$err = '<FONT COLOR=red><B>У вас недостаточно денег<BR></B></FONT><BR>'; $err = '<FONT COLOR=red><B>У вас недостаточно денег<BR></B></FONT><BR>';
} }
}
$hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';")); $hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"));
} }
} }
function changeSleep($sleep_action){
function changeSleep($sleep_action)
{
global $hostel, $hostel_option, $u, $sleep, $sleep_mod; global $hostel, $hostel_option, $u, $sleep, $sleep_mod;
if ($sleep_action == 1) { if ($sleep_action == 1) {
// //
@ -174,7 +173,8 @@ function changeSleep($sleep_action){
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1); $sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
} }
function changePets(){ function changePets()
{
global $hostel, $hostel_option, $u, $cage1, $cage2, $pet; global $hostel, $hostel_option, $u, $cage1, $cage2, $pet;
$pet = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz` FROM `users_animal` WHERE `pet_in_cage` = '0' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;")); $pet = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz` FROM `users_animal` WHERE `pet_in_cage` = '0' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;"));
if ($pet['id'] != $u->info['animal']) { if ($pet['id'] != $u->info['animal']) {
@ -226,10 +226,11 @@ function changePets(){
} }
$cage1 = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz`,`pet_in_cage` FROM `users_animal` WHERE `pet_in_cage` = '1' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;")); $cage1 = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz`,`pet_in_cage` FROM `users_animal` WHERE `pet_in_cage` = '1' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;"));
$cage2 = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz`,`pet_in_cage` FROM `users_animal` WHERE `pet_in_cage` = '2' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;")); $cage2 = mysql_fetch_array(mysql_query("SELECT `id`, `sex`, `name`, `level`, `obraz`,`pet_in_cage` FROM `users_animal` WHERE `pet_in_cage` = '2' AND `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `delete` = 0 LIMIT 1;"));
return array('pet' => $pet, 'cage1' => $cage1, 'cage2' => $cage2); return ['pet' => $pet, 'cage1' => $cage1, 'cage2' => $cage2];
} }
function saveNote() { function saveNote()
{
global $hostel, $hostel_option, $u; global $hostel, $hostel_option, $u;
$_POST['notes'] = str_replace(" \\n", "\n", $_POST['notes']); $_POST['notes'] = str_replace(" \\n", "\n", $_POST['notes']);
$simbolcount = strlen($_POST['notes']); $simbolcount = strlen($_POST['notes']);
@ -243,7 +244,8 @@ function saveNote() {
$hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';")); $hostel = mysql_fetch_array(mysql_query("SELECT * FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"));
} }
function hostel($id){ function hostel($id)
{
global $hostel, $hostel_option, $u, $err; global $hostel, $hostel_option, $u, $err;
$filter = '<table cellpadding="0" cellspacing="0" style="padding:0px 16px 0px 8px;"> $filter = '<table cellpadding="0" cellspacing="0" style="padding:0px 16px 0px 8px;">
<tbody><tr><td>&nbsp;Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</td> <tbody><tr><td>&nbsp;Правила: Нет нападениям. Нет телепортации. Нет передаче предметов. Нет использованию магии и распитию эликсиров.</td>
@ -259,25 +261,22 @@ function hostel($id){
$content = "Вы арендовали «" . $hostel_option[$hostel['type']]['t_name'] . "» " . $hostel_option[$hostel['type']]['stage'] . "<BR>Начало аренды: " . date('d.m.y H:i', $hostel['starttime']) . "<BR>Оплачено до: " . date("d.m.y H:i", $hostel['endtime']) . ' (баланс ' . $hostel['balance'] . ' кр.)' . " $content = "Вы арендовали «" . $hostel_option[$hostel['type']]['t_name'] . "» " . $hostel_option[$hostel['type']]['stage'] . "<BR>Начало аренды: " . date('d.m.y H:i', $hostel['starttime']) . "<BR>Оплачено до: " . date("d.m.y H:i", $hostel['endtime']) . ' (баланс ' . $hostel['balance'] . ' кр.)' . "
<IMG src=\"//img.new-combats.tech/i/up.gif\" width=11 height=11 title=\"Оплатить\" onClick=\"usescript('Оплата аренды','main.php', 'payarenda', '" . $hostel['weekcost'] . "', 'Сумма оплаты:<BR>',0, '<INPUT type=hidden name=sd4 value='+sd4+'>')\" style=\"cursor:pointer\">"; <IMG src=\"//img.new-combats.tech/i/up.gif\" width=11 height=11 title=\"Оплатить\" onClick=\"usescript('Оплата аренды','main.php', 'payarenda', '" . $hostel['weekcost'] . "', 'Сумма оплаты:<BR>',0, '<INPUT type=hidden name=sd4 value='+sd4+'>')\" style=\"cursor:pointer\">";
if( $u->info['level'] < 8 ) {
$content .= " &nbsp; <small>Оплатить за зубы (Цена в неделю: ".$u->zuby($hostel['weekcost']*5,1)."): </small><IMG src=\"//img.new-combats.tech/i/up.gif\" width=11 height=11 title=\"Оплатить за зубы\" onClick=\"usescript('Оплата аренды за зубы','main.php?zby=1', 'payarenda', '".$hostel['weekcost']."', 'Сумма оплаты:<BR>',0, '<INPUT type=hidden name=sd4 value='+sd4+'>')\" style=\"cursor:pointer\">";
}
$content .= "<BR>Цена в неделю: " . $hostel['weekcost'] . " кр.<BR>&nbsp;&bull; Размер сундука: " . $hostel_option[$hostel['type']]['tariff']['items'] . " вещей<BR>&nbsp;&bull; Сувениры: " . $hostel_option[$hostel['type']]['tariff']['souvenirs'] . " шт.<BR>" . ($hostel_option[$hostel['type']]['tariff']['animal'] > 0 ? '&nbsp;&bull; Мест для животных: ' . $hostel_option[$hostel['type']]['tariff']['animal'] . '<BR>' : '') . " &nbsp&bull; Койка <br/><p><A href=\"?closearenda=1&sd4=" . $u->info['id'] . "\" onClick=\"return confirm('Вы уверены, что хотите прекратить аренду?')\">Прекратить аренду</A><BR><SMALL>При отмене аренды, все вещи из сундука переносятся в ваш инвентарь.<BR>Ваши животные передаются вам. Если у вас уже есть другое животное, то выпускаются на волю.<BR>Остаток средств не возвращается.<BR>Если вы должны оплатить аренду, то ваш долг удваивается и вы не сможете воспользоваться арендой, пока не оплатите долг.<BR></SMALL></p><p><A href=\"?changelist=1&sd4=" . $u->info['id'] . "\">Сменить аренду"; $content .= "<BR>Цена в неделю: " . $hostel['weekcost'] . " кр.<BR>&nbsp;&bull; Размер сундука: " . $hostel_option[$hostel['type']]['tariff']['items'] . " вещей<BR>&nbsp;&bull; Сувениры: " . $hostel_option[$hostel['type']]['tariff']['souvenirs'] . " шт.<BR>" . ($hostel_option[$hostel['type']]['tariff']['animal'] > 0 ? '&nbsp;&bull; Мест для животных: ' . $hostel_option[$hostel['type']]['tariff']['animal'] . '<BR>' : '') . " &nbsp&bull; Койка <br/><p><A href=\"?closearenda=1&sd4=" . $u->info['id'] . "\" onClick=\"return confirm('Вы уверены, что хотите прекратить аренду?')\">Прекратить аренду</A><BR><SMALL>При отмене аренды, все вещи из сундука переносятся в ваш инвентарь.<BR>Ваши животные передаются вам. Если у вас уже есть другое животное, то выпускаются на волю.<BR>Остаток средств не возвращается.<BR>Если вы должны оплатить аренду, то ваш долг удваивается и вы не сможете воспользоваться арендой, пока не оплатите долг.<BR></SMALL></p><p><A href=\"?changelist=1&sd4=" . $u->info['id'] . "\">Сменить аренду";
if ($u->info['level'] < 8) { if ($u->info['level'] < 8) {
$content .= ' (Только за кр.)'; $content .= ' (Только за кр.)';
} }
$content .= "</A><BR><SMALL>Для смены аренды на вашем балансе должна быть необходимая сумма.<BR>Смена аренды, оплаченной зубами на кредитную аренду запрещена.<BR>Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR></SMALL></p>"; $content .= "</A><BR><SMALL>Для смены аренды на вашем балансе должна быть необходимая сумма.<BR>Смена аренды, оплаченной зубами на кредитную аренду запрещена.<BR>Количество вещей, сувениров и животных на вашем складе не должно превышать допустимое значение для выбранного арендуемого помещения.<BR></SMALL></p>";
} }
return array('filter'=>$filter, 'content'=>$content, 'additional'=>$additional); return ['filter' => $filter, 'content' => $content, 'additional' => $additional];
} }
function partition($pid){ function partition($pid)
{
global $hostel, $hostel_option, $u, $sleep, $category, $user_new_pers; global $hostel, $hostel_option, $u, $sleep, $category, $user_new_pers;
$filter = ''; $filter = '';
$content = ''; $content = '';
$additional = ''; $additional = '';
if( $hostel['partition'] == 0 OR $hostel['partition'] =='') $hostel['partition'] = 4; if ($hostel['partition'] == 0 or $hostel['partition'] == '') $hostel['partition'] = 4;
# $hostel_option[$pid]['type'] - инфа о тарифе # $hostel_option[$pid]['type'] - инфа о тарифе
if ($hostel['partition'] == 1) { # Комната if ($hostel['partition'] == 1) { # Комната
$content = '<form method="post" name="F1" style="padding:2px 0px 2px 5px;">Вы находитесь в своей комнате. Первое, что вы видите - записная книжка.<BR> $content = '<form method="post" name="F1" style="padding:2px 0px 2px 5px;">Вы находитесь в своей комнате. Первое, что вы видите - записная книжка.<BR>
@ -286,11 +285,12 @@ function partition($pid){
<INPUT type="hidden" name="room" value="1"> <INPUT type="hidden" name="room" value="1">
<INPUT type="submit" name="savenotes" value="Сохранить текст"></form>'; <INPUT type="submit" name="savenotes" value="Сохранить текст"></form>';
//ТУТ проснуться в комноте 1 //ТУТ проснуться в комноте 1
if ($sleep['vars'] == 'sleep') if ($sleep['vars'] == 'sleep') {
{$filter = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr> $filter = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr>
<td align="left">' . ($sleep['vars'] == 'sleep' ? "<DIV style='color: #FA0000'>" : '') . 'Состояние: <B>Вы ' . ($sleep['vars'] == 'sleep' ? 'спите' : 'бодрствуете') . '</B>' . ($sleep['vars'] == 'sleep' ? "</DIV>" : '') . '</td> <td align="left">' . ($sleep['vars'] == 'sleep' ? "<DIV style='color: #FA0000'>" : '') . 'Состояние: <B>Вы ' . ($sleep['vars'] == 'sleep' ? 'спите' : 'бодрствуете') . '</B>' . ($sleep['vars'] == 'sleep' ? "</DIV>" : '') . '</td>
<td align="right"><a style="padding: 2px 15px;" href="?to_' . ($sleep['vars'] == 'sleep' ? 'awake' : 'sleep') . '=1&sd4=' . $u->info['id'] . '&room=4&0.' . (rand(0, 9999999999999999)) . '" >' . ($sleep['vars'] == 'sleep' ? 'Проснуться' : 'Уснуть') . '</a></td> <td align="right"><a style="padding: 2px 15px;" href="?to_' . ($sleep['vars'] == 'sleep' ? 'awake' : 'sleep') . '=1&sd4=' . $u->info['id'] . '&room=4&0.' . (rand(0, 9999999999999999)) . '" >' . ($sleep['vars'] == 'sleep' ? 'Проснуться' : 'Уснуть') . '</a></td>
</tr></table>';} </tr></table>';
}
} elseif ($hostel['partition'] == 2) { # Хранилище } elseif ($hostel['partition'] == 2) { # Хранилище
@ -311,11 +311,12 @@ function partition($pid){
<td class="add-btn' . ($hostel['category'] == 2 ? ' active' : '') . '" align="center" valign="center"><a href="?' . ($hostel['category'] != 2 ? 'category=2&' : '') . 'rnd=' . rand(0, 999999999999) . '" title="Полка для сувениров"> Сувениры ' . ($hostel['category'] == 2 ? '<span id="giftCount">[<span id="in_chest" style="padding: 0px 1px;">' . $count . '</span>/<span style="padding: 0px 1px;">' . $hostel_option[$hostel['type']]['tariff']['souvenirs'] . '</span>]</span>' : '') . '</a></td> <td class="add-btn' . ($hostel['category'] == 2 ? ' active' : '') . '" align="center" valign="center"><a href="?' . ($hostel['category'] != 2 ? 'category=2&' : '') . 'rnd=' . rand(0, 999999999999) . '" title="Полка для сувениров"> Сувениры ' . ($hostel['category'] == 2 ? '<span id="giftCount">[<span id="in_chest" style="padding: 0px 1px;">' . $count . '</span>/<span style="padding: 0px 1px;">' . $hostel_option[$hostel['type']]['tariff']['souvenirs'] . '</span>]</span>' : '') . '</a></td>
</tr></table>'; </tr></table>';
if ($sleep['vars'] == 'sleep') if ($sleep['vars'] == 'sleep') {
{$filter = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr> $filter = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr>
<td align="left">' . ($sleep['vars'] == 'sleep' ? "<DIV style='color: #FA0000'>" : '') . 'Состояние: <B>Вы ' . ($sleep['vars'] == 'sleep' ? 'спите' : 'бодрствуете') . '</B>' . ($sleep['vars'] == 'sleep' ? "</DIV>" : '') . '</td> <td align="left">' . ($sleep['vars'] == 'sleep' ? "<DIV style='color: #FA0000'>" : '') . 'Состояние: <B>Вы ' . ($sleep['vars'] == 'sleep' ? 'спите' : 'бодрствуете') . '</B>' . ($sleep['vars'] == 'sleep' ? "</DIV>" : '') . '</td>
<td align="right"><a style="padding: 2px 15px;" href="?to_' . ($sleep['vars'] == 'sleep' ? 'awake' : 'sleep') . '=1&sd4=' . $u->info['id'] . '&room=4&0.' . (rand(0, 9999999999999999)) . '" >' . ($sleep['vars'] == 'sleep' ? 'Проснуться' : 'Уснуть') . '</a></td> <td align="right"><a style="padding: 2px 15px;" href="?to_' . ($sleep['vars'] == 'sleep' ? 'awake' : 'sleep') . '=1&sd4=' . $u->info['id'] . '&room=4&0.' . (rand(0, 9999999999999999)) . '" >' . ($sleep['vars'] == 'sleep' ? 'Проснуться' : 'Уснуть') . '</a></td>
</tr></table>';} </tr></table>';
}
$filter .= '<table width="100%" cellpadding=0 cellspacing=0 valign=center><tr> $filter .= '<table width="100%" cellpadding=0 cellspacing=0 valign=center><tr>
<td width="50%" valign="center" style="border-left: 1px solid #a5a5a5; padding: 2px 5px; border-right: 1px solid #a5a5a5;"> <td width="50%" valign="center" style="border-left: 1px solid #a5a5a5; padding: 2px 5px; border-right: 1px solid #a5a5a5;">
<table width="100%" cellpadding=0 cellspacing=0 valign=center> <table width="100%" cellpadding=0 cellspacing=0 valign=center>
@ -406,17 +407,17 @@ function partition($pid){
</tr></table>'; </tr></table>';
} }
return array('filter'=>$filter, 'content'=>$content, 'additional'=>$additional); return ['filter' => $filter, 'content' => $content, 'additional' => $additional];
} }
if ($_GET['changelist'] == 1 && $hostel['id'] > 0) { if ($_GET['changelist'] == 1 && $hostel['id'] > 0) {
$hostel['action'] = 'changelist'; $hostel['action'] = 'changelist';
} elseif( isset($_GET['changearenda']) && ($_GET['changearenda'] == 'advanced2' OR $_GET['changearenda'] == 'advanced' OR $_GET['changearenda'] == 'base') && $hostel['id']>0 ){ } elseif (isset($_GET['changearenda']) && ($_GET['changearenda'] == 'advanced2' or $_GET['changearenda'] == 'advanced' or $_GET['changearenda'] == 'base') && $hostel['id'] > 0) {
$hostel['action'] = 'changearenda'; $hostel['action'] = 'changearenda';
} elseif (isset($_GET['arenda']) && isset($hostel_option[$_GET['arenda']]) && $hostel_option[$_GET['arenda']]['type'] > 0) { } elseif (isset($_GET['arenda']) && isset($hostel_option[$_GET['arenda']]) && $hostel_option[$_GET['arenda']]['type'] > 0) {
$hostel['action'] = 'newarenda'; $hostel['action'] = 'newarenda';
} }
if( isset($hostel['action']) AND $hostel['action'] != '' ){ if (isset($hostel['action']) and $hostel['action'] != '') {
updateHostel(); updateHostel();
} }
@ -427,7 +428,6 @@ if( isset($hostel['action']) AND $hostel['action'] != '' ){
//} //}
if ($hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep') { if ($hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep') {
$result['filter'] = '<font color="red">Аренда прекращена. Оплатите задолженность.</font><BR>'; $result['filter'] = '<font color="red">Аренда прекращена. Оплатите задолженность.</font><BR>';
} elseif (!isset($hostel) && $u->room['id'] != 214) { } elseif (!isset($hostel) && $u->room['id'] != 214) {
@ -441,7 +441,8 @@ if( $hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep
if (isset($_GET['closearenda']) && (int)$_GET['closearenda'] == 1) { #---Прекращаем аренду if (isset($_GET['closearenda']) && (int)$_GET['closearenda'] == 1) { #---Прекращаем аренду
mysql_query("UPDATE `items_users` SET `inShop` = '0' WHERE `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `inShop` = '1';"); mysql_query("UPDATE `items_users` SET `inShop` = '0' WHERE `uid` = '" . mysql_real_escape_string($u->info['id']) . "' AND `inShop` = '1';");
mysql_query("DELETE FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';"); mysql_query("DELETE FROM `house` WHERE `owner` = '" . mysql_real_escape_string($u->info['id']) . "';");
$err = '<FONT COLOR=red><B>Вы отказались арендовать "'.$hostel_option[$hostel['type']]['t_name'].'"</B></FONT>';unset($hostel); $err = '<FONT COLOR=red><B>Вы отказались арендовать "' . $hostel_option[$hostel['type']]['t_name'] . '"</B></FONT>';
unset($hostel);
} }
if (isset($hostel) && $hostel_option[$hostel['type']]['type'] > 0) { if (isset($hostel) && $hostel_option[$hostel['type']]['type'] > 0) {
if (isset($_POST['payarenda']) && !isset($_GET['zby'])) { #---Продлить аренду if (isset($_POST['payarenda']) && !isset($_GET['zby'])) { #---Продлить аренду
@ -449,7 +450,7 @@ if( $hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep
if ($u->info['money'] > 0 && (int)$_POST['payarenda'] > 0 && ((int)$_POST['payarenda'] <= $u->info['money'])) { if ($u->info['money'] > 0 && (int)$_POST['payarenda'] > 0 && ((int)$_POST['payarenda'] <= $u->info['money'])) {
$paytime = ($_POST['payarenda'] / $hostel['weekcost']) * 604800; $paytime = ($_POST['payarenda'] / $hostel['weekcost']) * 604800;
mysql_query("UPDATE `house`,`users` SET `house`.`endtime` = `house`.`endtime`+'" . $paytime . "', `house`.`balance` = `house`.`balance`+'" . mysql_real_escape_string($_POST['payarenda']) . "' WHERE `house`.`owner` = `users`.`id` AND `house`.`owner` = '" . mysql_real_escape_string($u->info['id']) . "';"); mysql_query("UPDATE `house`,`users` SET `house`.`endtime` = `house`.`endtime`+'" . $paytime . "', `house`.`balance` = `house`.`balance`+'" . mysql_real_escape_string($_POST['payarenda']) . "' WHERE `house`.`owner` = `users`.`id` AND `house`.`owner` = '" . mysql_real_escape_string($u->info['id']) . "';");
$err = '<FONT COLOR=red><B>Вы положили на счет '.htmlspecialchars($_POST['payarenda'],NULL).'.00 кр.</B></FONT> '; $err = '<FONT COLOR=red><B>Вы положили на счет ' . htmlspecialchars($_POST['payarenda'], null) . '.00 кр.</B></FONT> ';
$u->info['money'] -= round((int)$_POST['payarenda']); $u->info['money'] -= round((int)$_POST['payarenda']);
mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money']) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money']) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
$hostel['balance'] += $_POST['payarenda']; $hostel['balance'] += $_POST['payarenda'];
@ -460,22 +461,6 @@ if( $hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep
} else { } else {
$err = '<FONT COLOR=red><B>Минимальная сумма: 1кр.<BR></B></FONT><BR>'; $err = '<FONT COLOR=red><B>Минимальная сумма: 1кр.<BR></B></FONT><BR>';
} }
}elseif(isset($_POST['payarenda']) && isset($_GET['zby'])) { #---Продлить аренду (за зубы)
if($_POST['payarenda']>=5) {
if($u->info['level'] < 8 && $u->info['money4']>0 && (int)$_POST['payarenda']>0 && ((int)$_POST['payarenda']<=$u->info['money4'])) {
$paytime = (round($_POST['payarenda']/5,2)/$hostel['weekcost'])*604800;
mysql_query("UPDATE `house`,`users` SET `house`.`endtime` = `house`.`endtime`+'".$paytime."', `house`.`balance` = `house`.`balance`+'".mysql_real_escape_string($_POST['payarenda'])."' WHERE `house`.`owner` = `users`.`id` AND `house`.`owner` = '".mysql_real_escape_string($u->info['id'])."';");
$err = '<FONT COLOR=red><B>Вы положили на счет '.$u->zuby(round((int)$_POST['payarenda']),1).'</B></FONT> ';
$u->info['money4'] -= round((int)$_POST['payarenda']);
mysql_query('UPDATE `users` SET `money4` = "'.mysql_real_escape_string($u->info['money4']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$hostel['balance'] += round($_POST['payarenda']/5,2);
$hostel['endtime'] += $paytime;
} else {
$err = '<FONT COLOR=red><B>У вас недостаточно зубов<BR></B></FONT><BR>';
}
} else {
$err = '<FONT COLOR=red><B>Минимальная сумма: '.$u->zuby(5,1).'.<BR></B></FONT><BR>';
}
} }
$result = hostel($hostel_option[$hostel['type']]['type']); $result = hostel($hostel_option[$hostel['type']]['type']);
} else { } else {
@ -484,20 +469,111 @@ if( $hostel['balance'] <= 0 && $u->room['id'] != 214 && $sleep['vars'] != 'sleep
} }
?> ?>
<style> <style>
#chest_null , #inventory_null {text-align:center;} #chest_null, #inventory_null {
text-align: center;
}
.scrollStyle .item table { border-bottom: 1px solid #A5A5A5; } .scrollStyle .item table {
.menuList {text-align: right;display:block;margin:6px 8px 20px 16px;position:relative;padding:3px 0px;border-right: 2px solid #a5a5a5;} border-bottom: 1px solid #A5A5A5;
.menuList:after { clear:both;content:'';position:absolute;z-index:-1;border-radius:5px;right:-5px;width:9px;height:9px;bottom:-8px;background: #a5a5a5;} }
.menuList:before { clear:both;content:'';position:absolute;z-index:-1;border-radius:5px;right:-5px;width:9px;height:9px;top:-8px;background: #a5a5a5;}
.menuItem {display:block;padding-right: 9px;margin-top:2px;} .menuList {
.menuActive {position:relative;overflow: hidden;margin-top:2px;display: block;padding-right: 14px;} text-align: right;
.menuActive:before {content:'';position:absolute;z-index:-1;transform: rotate(45deg);right:-5px;width:10px;height:10px;top:3px;background: #a5a5a5;} display: block;
.pH3 { COLOR: #8f0000; FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; } margin: 6px 8px 20px 16px;
.ahint { margin: 0px auto; left: 0px; right: 0px; top: 23%; } position: relative;
.add-btn {font-size: 12px;background: #C8C8C8;height:30px;box-sizing:border-box;border-bottom:1px solid #a5a5a5;vertical-align: middle;font-family: Arial, Tahoma, sans-serif;} padding: 3px 0px;
.add-btn.active {background: #e2e0e1;border-left:1px solid #a5a5a5;border-right:1px solid #a5a5a5;border-bottom:0px;} border-right: 2px solid #a5a5a5;
.add-btn > a > span { color: #222; font-size:10px; font-weight: 400;} }
.menuList:after {
clear: both;
content: '';
position: absolute;
z-index: -1;
border-radius: 5px;
right: -5px;
width: 9px;
height: 9px;
bottom: -8px;
background: #a5a5a5;
}
.menuList:before {
clear: both;
content: '';
position: absolute;
z-index: -1;
border-radius: 5px;
right: -5px;
width: 9px;
height: 9px;
top: -8px;
background: #a5a5a5;
}
.menuItem {
display: block;
padding-right: 9px;
margin-top: 2px;
}
.menuActive {
position: relative;
overflow: hidden;
margin-top: 2px;
display: block;
padding-right: 14px;
}
.menuActive:before {
content: '';
position: absolute;
z-index: -1;
transform: rotate(45deg);
right: -5px;
width: 10px;
height: 10px;
top: 3px;
background: #a5a5a5;
}
.pH3 {
COLOR: #8f0000;
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
FONT-WEIGHT: bold;
}
.ahint {
margin: 0px auto;
left: 0px;
right: 0px;
top: 23%;
}
.add-btn {
font-size: 12px;
background: #C8C8C8;
height: 30px;
box-sizing: border-box;
border-bottom: 1px solid #a5a5a5;
vertical-align: middle;
font-family: Arial, Tahoma, sans-serif;
}
.add-btn.active {
background: #e2e0e1;
border-left: 1px solid #a5a5a5;
border-right: 1px solid #a5a5a5;
border-bottom: 0px;
}
.add-btn > a > span {
color: #222;
font-size: 10px;
font-weight: 400;
}
</style> </style>
<script type="text/javascript" src="js/jquery.1.11.js"></script> <script type="text/javascript" src="js/jquery.1.11.js"></script>
<?php if ($hostel['partition'] == 2) { ?> <?php if ($hostel['partition'] == 2) { ?>
@ -556,7 +632,9 @@ $(document).ready(function () {
function obj_add(id, room, rnd, t) { function obj_add(id, room, rnd, t) {
if (parseInt($('#in_chest22').text()) > 0) { if (parseInt($('#in_chest22').text()) > 0) {
if (rnd=='' || rnd ==undefined || rnd =='undefined') {var rnd = 1;} if (rnd == '' || rnd == undefined || rnd == 'undefined') {
var rnd = 1;
}
var dataString = "ajaxHostel=1&obj_add=" + id + "&room=" + room + "&rnd=" + rnd; var dataString = "ajaxHostel=1&obj_add=" + id + "&room=" + room + "&rnd=" + rnd;
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -592,11 +670,16 @@ $(document).ready(function () {
} else echo "куда-то закинуть";?>'); } else echo "куда-то закинуть";?>');
t = $(t).parents('.item').first(); t = $(t).parents('.item').first();
if (rnd=='' || rnd ==undefined || rnd =='undefined') {var rnd = 1;}$.ajax({type: "GET",url: "main.php?ajax=1&obj_take="+id+"&room="+room+"&rnd="+rnd,cache: false,success: function () { if (rnd == '' || rnd == undefined || rnd == 'undefined') {
var rnd = 1;
}
$.ajax({
type: "GET", url: "main.php?ajax=1&obj_take=" + id + "&room=" + room + "&rnd=" + rnd, cache: false, success: function () {
obj_recount(2); obj_recount(2);
moveAnimate(t, $('#inventory').children('tbody')); moveAnimate(t, $('#inventory').children('tbody'));
setTimeout(UpdateItemList(), 200); setTimeout(UpdateItemList(), 200);
}}); }
});
} else { } else {
alert('Лимит передач на сегодня исчерпан.'); alert('Лимит передач на сегодня исчерпан.');
} }
@ -607,9 +690,13 @@ $(document).ready(function () {
var inv_names2 = []; // inventory var inv_names2 = []; // inventory
var items1 = $('#chest').find('a.inv_name'); var items1 = $('#chest').find('a.inv_name');
var items2 = $('#inventory').find('a.inv_name'); var items2 = $('#inventory').find('a.inv_name');
$(items1).each(function(){ if($.inArray($(this).text(), inv_names1)<0) inv_names1.push($(this).text()); }); $(items1).each(function () {
if ($.inArray($(this).text(), inv_names1) < 0) inv_names1.push($(this).text());
});
$('#inp1FilterName').autocomplete({lookup: inv_names1, onSelect: invFilterByName1}); $('#inp1FilterName').autocomplete({lookup: inv_names1, onSelect: invFilterByName1});
$(items2).each(function(){ if($.inArray($(this).text(), inv_names2)<0) inv_names2.push($(this).text()); }); $(items2).each(function () {
if ($.inArray($(this).text(), inv_names2) < 0) inv_names2.push($(this).text());
});
$('#inp2FilterName').autocomplete({lookup: inv_names2, onSelect: invFilterByName2}); $('#inp2FilterName').autocomplete({lookup: inv_names2, onSelect: invFilterByName2});
} }
@ -640,20 +727,42 @@ $(document).ready(function () {
invFilterByName2Timer = null; invFilterByName2Timer = null;
// просматриваем результат // просматриваем результат
$('#line_filter1').submit(function (){ $('#inp1FilterName_submit').trigger('click'); }); $('#line_filter1').submit(function () {
$('#line_filter2').submit(function (){ $('#inp2FilterName_submit').trigger('click'); }); $('#inp1FilterName_submit').trigger('click');
});
$('#line_filter2').submit(function () {
$('#inp2FilterName_submit').trigger('click');
});
// Если в выпадающем списке предметов листаем при помощи клавиш Up и Down, автоматически просматриваем результат. // Если в выпадающем списке предметов листаем при помощи клавиш Up и Down, автоматически просматриваем результат.
$('#inp1FilterName').keyup(function (e){ $('#inp1FilterName_submit').trigger('click'); }); $('#inp1FilterName').keyup(function (e) {
$('#inp2FilterName').keyup(function (e){ $('#inp2FilterName_submit').trigger('click'); }); $('#inp1FilterName_submit').trigger('click');
});
$('#inp2FilterName').keyup(function (e) {
$('#inp2FilterName_submit').trigger('click');
});
// Запоминаем прошлый поиск предмета и активируем его при открытии инвентаря\сундука // Запоминаем прошлый поиск предмета и активируем его при открытии инвентаря\сундука
if ($.cookie('invFilterByName1')) { $('#inp1FilterName').val($.cookie('invFilterByName1')); invFilterByName1(); } if ($.cookie('invFilterByName1')) {
if ($.cookie('invFilterByName2')) { $('#inp2FilterName').val($.cookie('invFilterByName2')); invFilterByName2(); } $('#inp1FilterName').val($.cookie('invFilterByName1'));
invFilterByName1();
}
if ($.cookie('invFilterByName2')) {
$('#inp2FilterName').val($.cookie('invFilterByName2'));
invFilterByName2();
}
// Автообновление в реальном времени при написании текста. // Автообновление в реальном времени при написании текста.
$('#line_filter1').click(function (){ window.clearInterval(invFilterByName1Timer); if($('#inp1FilterName').val()=='')invFilterByName1(); else invFilterByName1Timer=setTimeout(invFilterByName1, 200); return false;} ); $('#line_filter1').click(function () {
$('#line_filter2').click(function (){ window.clearInterval(invFilterByName2Timer); if($('#inp2FilterName').val()=='')invFilterByName2(); else invFilterByName2Timer=setTimeout(invFilterByName2, 200); return false;} ); window.clearInterval(invFilterByName1Timer);
if ($('#inp1FilterName').val() == '') invFilterByName1(); else invFilterByName1Timer = setTimeout(invFilterByName1, 200);
return false;
});
$('#line_filter2').click(function () {
window.clearInterval(invFilterByName2Timer);
if ($('#inp2FilterName').val() == '') invFilterByName2(); else invFilterByName2Timer = setTimeout(invFilterByName2, 200);
return false;
});
//$(document).keyup(function (e) {if (e.which == 13)invFilterByName1(); if (e.which == 27) { $('#textSearch').click(); } }); //$(document).keyup(function (e) {if (e.which == 13)invFilterByName1(); if (e.which == 27) { $('#textSearch').click(); } });
@ -678,7 +787,9 @@ $(document).ready(function () {
height = height - 175; // 462 height = height - 175; // 462
var heMax = $(".scrollStyle").children('table').height(); var heMax = $(".scrollStyle").children('table').height();
if (heMax > height) { if (heMax > height) {
if (heW <100) { heW = 100; } if (heW < 100) {
heW = 100;
}
if (heW > height) { if (heW > height) {
$(".scrollStyle").height(heW); $(".scrollStyle").height(heW);
} else { } else {
@ -689,6 +800,7 @@ $(document).ready(function () {
} }
// console.log(heW+':heW, '+height+':height, '+heMax+':heMax'); // console.log(heW+':heW, '+height+':height, '+heMax+':heMax');
} }
$(window).ready(function () { $(window).ready(function () {
inventoryHeight(); inventoryHeight();
}); });
@ -696,12 +808,15 @@ $(document).ready(function () {
inventoryHeight(); inventoryHeight();
}); });
}); });
jQuery.expr[":"].contains = function (elem, i, match, array){ return (elem.textContent || elem.innerText || jQuery.text(elem) || "").toLowerCase().indexOf(match[3].toLowerCase()) >= 0; } jQuery.expr[":"].contains = function (elem, i, match, array) {
return (elem.textContent || elem.innerText || jQuery.text(elem) || "").toLowerCase().indexOf(match[3].toLowerCase()) >= 0;
}
<?php } ?> <?php } ?>
var sd4 = "<?=$u->info['id'];?>"; var sd4 = "<?=$u->info['id'];?>";
</script> </script>
<script type="text/javascript" language="javascript" src='//img.new-combats.tech/js/commoninf.js'></script> <script type="text/javascript" language="javascript" src='//img.new-combats.tech/js/commoninf.js'></script>
<script language="JavaScript" src="//img.new-combats.tech/js/sl2.27.js"></script><div id=hint4 class=ahint></div> <script language="JavaScript" src="//img.new-combats.tech/js/sl2.27.js"></script>
<div id=hint4 class=ahint></div>
<table width="100%" cellspacing="0" cellpadding="0" border="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td align="left" valign="top"> <td align="left" valign="top">
@ -711,15 +826,22 @@ var sd4 = "<?=$u->info['id'];?>";
<td> <td>
<table bgcolor="#c8c8c8" width="100%" cellspacing="0" cellpadding="0" border="0"> <table bgcolor="#c8c8c8" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td width="52%" style="border-left:1px solid #a5a5a5; border-bottom:1px solid #a5a5a5; padding:2px 0px 2px 5px;" align='left'><?=$u->microLogin($u->info['id'],1)?></td> <td width="52%" style="border-left:1px solid #a5a5a5; border-bottom:1px solid #a5a5a5; padding:2px 0px 2px 5px;"
<td style="<?=($result['additional'] == '' ? 'border-bottom:1px solid #a5a5a5;' : '')?>" align='center'><?=($result['additional'] !='' ? $result['additional'] : '')?></td> align='left'><?= $u->microLogin($u->info['id'], 1) ?></td>
<td style="border-right:1px solid #a5a5a5; border-bottom:1px solid #a5a5a5; padding: 2px 15px 2px 0px;" align='right'><h4 style="margin:0px;"><?= $u->room['name'];?></h4></td> <td style="<?= ($result['additional'] == '' ? 'border-bottom:1px solid #a5a5a5;' : '') ?>"
align='center'><?= ($result['additional'] != '' ? $result['additional'] : '') ?></td>
<td style="border-right:1px solid #a5a5a5; border-bottom:1px solid #a5a5a5; padding: 2px 15px 2px 0px;" align='right'><h4
style="margin:0px;"><?= $u->room['name']; ?></h4></td>
</tr>
<tr>
<td colspan="3" style="border:1px solid #a5a5a5; border-top:0px; padding:0px;" bgcolor="#e2e0e0"><?= $result['filter'] ?></td>
</tr> </tr>
<tr><td colspan="3" style="border:1px solid #a5a5a5; border-top:0px; padding:0px;" bgcolor="#e2e0e0"><?=$result['filter']?></td></tr>
</table> </table>
</td> </td>
</tr> </tr>
<tr><td style="border:1px solid #a5a5a5; border-top:0px; overflow:hidden; position:relative;" id="contentBox" bgcolor="#e2e0e0"><?=$result['content']?></td></tr> <tr>
<td style="border:1px solid #a5a5a5; border-top:0px; overflow:hidden; position:relative;" id="contentBox" bgcolor="#e2e0e0"><?= $result['content'] ?></td>
</tr>
</table> </table>
</td> </td>
<td width="280" align="right" valign="top"> <td width="280" align="right" valign="top">
@ -729,8 +851,9 @@ var sd4 = "<?=$u->info['id'];?>";
if ($sleep['vars'] != 'sleep' || $u->info['room'] == '214') //ТУТ if ($sleep['vars'] != 'sleep' || $u->info['room'] == '214') //ТУТ
{ {
$roomGo = explode(',', $u->room['roomGo']); $roomGo = explode(',', $u->room['roomGo']);
$roomInfo = fn(int $roomId) => Db::getRow('select id, name, code from room where id = ?', [$roomId]);
foreach ($roomGo as $val) { foreach ($roomGo as $val) {
$temp = $u->roomInfo($val, true); $temp = $roomInfo($val);
if (isset($temp['id'])) { // Перемещение по комнатам. if (isset($temp['id'])) { // Перемещение по комнатам.
echo '<tr><td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" /></td><td bgcolor="#D3D3D3" style="min-width:84px;" nowrap>' . '<a href="#" title="' . $temp['name'] . '" id="greyText" class="menutop" onClick="'; echo '<tr><td bgcolor="#D3D3D3"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" /></td><td bgcolor="#D3D3D3" style="min-width:84px;" nowrap>' . '<a href="#" title="' . $temp['name'] . '" id="greyText" class="menutop" onClick="';
echo "location='main.php?loc=" . $temp['code'] . "&rnd=" . $code . ";'"; echo "location='main.php?loc=" . $temp['code'] . "&rnd=" . $code . ";'";

View File

@ -90,7 +90,6 @@ if ($actionSale) {
$sellprice = $item['1price'] - $item['1price'] * 0.1; $sellprice = $item['1price'] - $item['1price'] * 0.1;
ItemsModel::delete($item['id']); ItemsModel::delete($item['id']);
$u->addKr($sellprice); $u->addKr($sellprice);
$u->info['money'] += $sellprice;
$status = "Вы успешно продали предмет «{$item['name']}» за $sellprice кр."; $status = "Вы успешно продали предмет «{$item['name']}» за $sellprice кр.";
Delo::add(2, 'shopid:' . $shopId, $u->info['id'], "Предмет «{$item['name']}» [id:{$item['id']}] продан за $sellprice кр.", -$sellprice); Delo::add(2, 'shopid:' . $shopId, $u->info['id'], "Предмет «{$item['name']}» [id:{$item['id']}] продан за $sellprice кр.", -$sellprice);
} }

View File

@ -1,65 +1,31 @@
<?php <?php
if(!defined('GAME'))
{ use Core\Db;
if (!defined('GAME')) {
die(); die();
} }
$cgo = $_POST['city']; /** @var User $u */
if(!isset($u->city_name[$cgo]))
{
$uer = 'Город "'.$cgo.'" не найден.';
}else{
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['logingo']).'" LIMIT 1'));
if(isset($uu['id']))
{
if($uu['id']!=$u->info['id'] && $u->info['admin']==0)
{
$uer = 'Вы можете телепортировать только себя';
}elseif($uu['battle']>0)
{
$uer = 'Персонаж находится в бою';
}elseif($uu['admin']>0 && $u->info['admin']==0)
{
$uer = 'Вы не можете телепортировать Ангелов в другой город';
}elseif($uu['city']!=$u->info['city'] && $u->info['admin']==0){
$uer = 'Персонаж находится в другом городе';
}elseif(floor($uu['align'])==$a && $uu['align']>$u->info['align'] && $u->info['admin']==0)
{
$uer = 'Вы не можете телепортировать старших по званию';
}else{
$rid = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `name` = "Вокзал" AND `city` = "'.mysql_real_escape_string($cgo).'" LIMIT 1'));
if(!isset($rid['id']))
{
$uer = 'Телепортация в "'.$u->city_name[$cgo].'" запрещена!';
}else{
$upd = mysql_query('UPDATE `users` SET `city` = "'.mysql_real_escape_string($cgo).'",`room` = "'.$rid['id'].'" WHERE `id` = "'.$uu['id'].'" LIMIT 1');
if($upd)
{
$sx = '';
if($u->info['sex']==1)
{
$sx = 'а';
}
$rtxt = '[img[items/teleport.gif]] '.$rang.' &quot;'.$u->info['cast_login'].'&quot; телепортировал'.$sx.' персонажа &quot;'.$uu['login'].'&quot; в [img[city_ico/'.$cgo.'.gif]] '.$u->city_name[$cgo].'.';
$cmsg = new ChatMessage(); $caster = $u;
$cmsg->setCity($u->info['city']); $targetUser = $_POST['logingo'];
$cmsg->setRoom($u->info['room']); $targetRoom = null; // Заглушка
$cmsg->setText($rtxt);
$cmsg->setType(6); echo 'Не работает. Проверь исполняемый файл.';
$cmsg->setTypeTime(1);
(new Chat())->sendMsg($cmsg); $target = $targetUser === $caster->info['login'] ? $caster->info : User::getInfo($targetUser);
$rtxt = $rang.' &quot;'.$u->info['login'].'&quot; телепортировал'.$sx.' в &quot;<b>'.$u->city_name[$cgo].'</b>&quot;.';
mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',5)"); if (empty($target) || $target['admin'] > 0 && !$caster->isAdmin()) {
$uer = 'Вы успешно телепортировали персонажа "'.$uu['login'].'" в <b>'.$u->city_name[$cgo].'</b>.'; $uer = 'Цель не найдена!';
} elseif ($caster->info['id'] != $target['id'] && !$caster->isAdmin()) {
$uer = 'Нельзя телепортировать других!';
} elseif (!empty($target['battle']) || !empty($caster->info['battle'])) {
$uer = 'Не работает в поединке!';
} else { } else {
$uer = 'Не удалось использовать данное заклятие'; Db::sql('update users set room = ? where login = ?', [$targetRoom, $target['id']]);
} Delo::add(5, 'teleport', $target['login'], "{$caster->info['login']} телепортировал игрока в $targetRoom.");
} $uer = 'Успешная телепортация!';
}
}else{
$uer = 'Персонаж не найден в этом городе';
}
} }
?> unset($caster, $target, $targetUser, $targetRoom);

View File

@ -203,9 +203,7 @@ if ($u->stats['pbe'] > 0) {
} }
echo '<br>'; echo '<br>';
} }
if ($u->info['level'] < 8 && $c['zuby'] == true) {
echo 'Зубы:&nbsp;' . $u->zuby($u->info['money4']) . '<br>';
}
if ($u->info['ability'] > 0 || ($u->info['skills'] > 0 && $u->info['level'] > 0)) { if ($u->info['ability'] > 0 || ($u->info['skills'] > 0 && $u->info['level'] > 0)) {
echo '&nbsp;<a href="main.php?skills=1&side=1">+ Способности</a><br>'; echo '&nbsp;<a href="main.php?skills=1&side=1">+ Способности</a><br>';
} }

View File

@ -695,6 +695,8 @@ foreach ($chat->getMessages((int)$_POST['mid'], $u->info['login']) as $pl) {
unset($qix); unset($qix);
} }
$see = 1; //временно.
if ($see == 1) { if ($see == 1) {
if ($pl['time'] < 0) { if ($pl['time'] < 0) {
if ($pl['to'] == '') { if ($pl['to'] == '') {