Loading...
Вот
// Выпадение сундука
$ChanseSunduk = 15;
if(rand(1,100) <= $ChanseSunduk ){
$r= rand(1,100); if($r > 0 and $r <= 5 ){
$SundukQuatility = 5;
$SundukLvl = 20;
}else if ($r >= 5 and $r <= 10 ){
$SundukQuatility = 4;
$SundukLvl = 15;
}else if ($r >= 10 and $r <= 20 ){
$SundukQuatility = 3;
$SundukLvl = 10;
}else if ($r >= 20 and $r <= 30 ){

$SundukQuatility = 3;
$SundukLvl = 5; }else if ($r >= 30 and $r <= 55 ){
$SundukQuatility = 2;
$SundukLvl = 5;
}else if ($r >= 55 and $r <= 100 ){
$SundukQuatility = 1;
$SundukLvl = 1;
}

switch( $SundukQuatility){
case '1': $color = '<font color="green">Обычный';
break;
case '2': $color = '<font color="#1E90FF">Редкий';
break;
case '3': $color = '<font color="violet">Эпический';
break;
case '4': $color = '<font color="gold"> Уникальный';
break;
case '5': $color = '<font color="Darkorange">Легендарный ';
break;
}
mysql_query("INSERT INTO `sunduk_user` SET `id_user` = '".($user['id'])."' , `lvl` = '$SundukLvl', `quatility` = '$SundukQuatility', `status` = 'close'") or die(mysql_error());
$_SESSION['sunduk']= div('header')." Вы получили сундук $color </font><br><img src=' /images/other/chest.png' width='100px'> </div> ";
}

if(rand(1,100) <= '30' ){

$item = mysql_fetch_assoc(mysql_query("SELECT * FROM `item` WHERE `level` < 10 ORDER BY RAND() "));


mysql_query("INSERT INTO `inv` SET `id_user` = '".($user['id'])."', `name` = '$item[name]', `str` = '$item[str]', `def` = '$item[def]', `health` = '$item[health]', `tip` = '$item[tip]', `skill` = '$item[skill]', `level` = '$item[level]', `odeta` = 'net' , `item` = '$item[item]'")or die(mysql_error());
$log = 'получил '.$item[name].'';
mysql_query('INSERT INTO `duel_log` ( `user`, `text` , `login`) VALUES ("'.$user['id'].'", "'.$log.'" , "'.$user['login'].'")');

$_SESSION['item']= "<div style = 'text-align:center;'><font color=#bce4f4>$item[name]</font>$status<br><img src='/images/items/$item[tip]/$item[item].png'><br></div>";
}
Онлайн: 2
Время:
Gen. 0.0582
(c) Bym.Guru 2010-2026