<?php
////////////////////////////////////////////
//////////////////////////////////////////////
/////////РЕЕССУРСЫ////////////////////////////
$rr2=rand(1,300);
if($rr2==12){
$art_rand=rand(1,4);
$user = mysql_query("SELECT * FROM `art` WHERE `id_user`='".$_SESSION['id']."'");
$user_s=mysql_num_rows($user);
if($user_s>=25){
$msg='<strong><font color="#368c39">Вы не получили награду. В инвентаре больше 25 артефактов.</font></strong>';
}else{
if($art_rand==1){
$mysql=mysql_query("INSERT INTO `art` SET `id_user` = '".$_SESSION['id']."', `name`='Солнечный Медальон', `power_1`='speed',`power_2`='manevr',`plus_1`='30',`plus_2`='25',`owner`='0', `type`='medalon',`price`='4900'");
$type='medalon';
$name='Солнечный Медальон';
}
if($art_rand==2){
$mysql=mysql_query("INSERT INTO `art` SET `id_user` = '".$_SESSION['id']."', `name`='Пистолета Пирата', `power_1`='power',`power_2`='speed',`plus_1`='45',`plus_2`='35',`owner`='0', `type`='pistolet',`price`='8000'");
$type='pistolet';
$name='Пистолета Пирата';
}
if($art_rand==3){
$mysql=mysql_query("INSERT INTO `art` SET `id_user` = '".$_SESSION['id']."', `name`='Сабля Мертвеца', `power_1`='power',`power_2`='def',`plus_1`='75',`plus_2`='50',`owner`='0', `type`='sabla',`price`='12300'");
$type='sabla';
$name='Сабля Мертвеца';
}
if($art_rand==4){
$mysql=mysql_query("INSERT INTO `art` SET `id_user` = '".$_SESSION['id']."', `name`='Золотая Цепь', `power_1`='power',`power_2`='def',`plus_1`='120',`plus_2`='80',`owner`='0', `type`='cep',`price`='17500'");
$type='cep';
$name='Золотая Цепь';
}
}
if(!empty($type) and !empty($name)){
$msg='<strong><font color="#368c39">Вам выпало '.$name.'</font></strong>';
}
$d_sql=mysql_query("INSERT INTO `logs` SET `id_user`='".$row['id']."',`id_kill`='',`msg`='".$msg."'"); }
///////////////////////////
$rr=rand(1,25);
if($rr==6){
$msg='<strong><font color="#009bc2">Вы нашли 1<img class="ico" src="img/pics/pearl.png" alt=""></font></strong>';
$pearl=$row['pearl']+1;
$sql = mysql_query("UPDATE `users` SET `pearl` = '".$pearl."' WHERE `id` = '".$row['id']."'");
if ($sql){ $d_sql=mysql_query("INSERT INTO `logs` SET `id_user`='".$row['id']."',`id_kill`='',`msg`='".$msg."'"); }
}
$rr2=rand(1,20);
if($rr2==11){
$mor=rand(1,15);
if($mor==3) { $money2=rand(100,200); }
else { $money2=rand(4,70); }
$msg='<strong><font color="#009bc2">Вы нашли '.$money2.'<img class="ico" src="img/pics/money.png" alt=""></font></strong>';
$money3=$row['money']+$money2;
$sql = mysql_query("UPDATE `users` SET `money` = '".$money3."' WHERE `id` = '".$row['id']."'");
if ($sql){ $d_sql=mysql_query("INSERT INTO `logs` SET `id_user`='".$row['id']."',`id_kill`='',`msg`='".$msg."'"); }
}
////////////////////////////////////////////////
//////////////////////////////////////////////////
?>