2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
|
|
|
|
// магия "шаг назад"
|
|
|
|
|
if ($user['battle'] > 0) {
|
2020-10-29 23:30:05 +00:00
|
|
|
|
echo "Не в бою...";
|
|
|
|
|
} elseif (rand(1, 100) != 1) {
|
2021-03-11 18:58:38 +00:00
|
|
|
|
\Battles\DressedItems::undressAllItems($user['id']);
|
2020-10-29 23:30:05 +00:00
|
|
|
|
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
|
|
|
|
if (empty($_SESSION['uid'])) {
|
|
|
|
|
header("Location: index.php");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2020-09-30 12:30:00 +00:00
|
|
|
|
|
2020-10-29 23:30:05 +00:00
|
|
|
|
if ($user['sila'] > 3) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`sila` = `sila`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
if ($user['inta'] > 3) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`inta` = `inta`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
if ($user['lovk'] > 3) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`lovk` = `lovk`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
if ($user['vinos'] > 3) {
|
|
|
|
|
if ($user['hp'] <= ($user['maxhp'] - 6)) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
} else {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6', `hp`=`hp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($user['intel'] > 0) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`intel` = `intel`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
if ($user['mudra'] > 0) {
|
|
|
|
|
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`mudra` = `mudra`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
|
|
|
|
}
|
|
|
|
|
echo "<font color=red><b>Удачно использована магия \"Шаг назад\"<b></font>";
|
|
|
|
|
$bet = 1;
|
2018-01-28 16:40:49 +00:00
|
|
|
|
}
|