battles/magic/rom.php

35 lines
1.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$_SESSION['uid']}' and `type` = '51' LIMIT 1;"));
if ($effect['time']) {
echo "Персонаж уже пьян";
} else {
$zz = mt_rand(1, 3);
$s = 0;
$l = 0;
$i = 0;
switch ($zz) {
case 1:
$s = $user['level'];
break;
case 2:
$l = $user['level'];
break;
case 3:
$i = $user['level'];
break;
}
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`,`sila`,`lovk`,`inta`,`vinos`) values ('" . $_SESSION['uid'] . "','Опьянение'," . (time() + 3600) . ",51,'" . $s . "','" . $l . "','" . $i . "','0');");
mysql_query("UPDATE `users` SET `sila`=`sila`+'" . $s . "', `lovk`=`lovk`+'" . $l . "', `inta`=`inta`+'" . $i . "' WHERE `id` = '" . $_SESSION['uid'] . "' LIMIT 1;");
echo "<font color=red><b>РЎ Вами что СРѕ произошло...<b></font>";
$bet = 1;
}