Файл: msmenu/mscad_veshi.php
Строк: 216
<?php
///////////////////////////////////////////////////////////////////////////////
//////////////////////Выпадение вещей /////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
$msact = rand(1,8);
$msrand_col = rand(1,3);
$msf = mysql_query("SELECT * FROM `ms_things` WHERE `act` = '".num($msact)."' ORDER BY RAND() LIMIT $msrand_col");
while($msact_ms = mysql_fetch_array($msf))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ms_mythings` WHERE `clothed` = '".num(1)."' AND `user` = '".num($user['id'])."'"),0)<20)
{
if($user['level'] < 5)$msrand_act = 10;
else if($user['level'] < 10)$msrand_act = 25;
else if($user['level'] < 15)$msrand_act = 35;
else if($user['level'] < 20)$msrand_act = 45;
else if($user['level'] < 25)$msrand_act = 50;
else if($user['level'] < 30)$msrand_act = 55;
else if($user['level'] < 35)$msrand_act = 60;
else if($user['level'] < 40)$msrand_act = 65;
else if($user['level'] < 45)$msrand_act = 70;
else if($user['level'] < 50)$msrand_act = 80;
else if($user['level'] < 100)$msrand_act = 100;
else $msrand_act = 100;
if($msact_ms['act'] == 1) $ms_act_get = '<img src="/img/items/helm.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 2) $ms_act_get = '<img src="/img/items/shoulders.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 3) $ms_act_get = '<img src="/img/items/weapon.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 4) $ms_act_get = '<img src="/img/items/shield.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 5) $ms_act_get = '<img src="/img/items/armor.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 6) $ms_act_get = '<img src="/img/items/belt.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 7) $ms_act_get = '<img src="/img/items/legs.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
if($msact_ms['act'] == 8) $ms_act_get = '<img src="/img/items/boots.png" alt="" width="24" height="24" title="'.$msact_ms['name'].'"/>';
/////////////////////////////////////////////////
/////////////////////////////////////////////////
////////////////Выбираем тип вещи по цвету //////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
if($user['level'] < 5){
$ms_color_rand1 = rand(0,1);
$ms_color_rand2 = rand(0,1);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 0) $msmultiply = 1;
if($ms_color_rand2 == 1) $msmultiply = 2;
$mscolor_multiply = num($msmultiply);
}else{
$msmultiply = 5;
$mscolor_multiply = num(1);
}
$mssmsmm = 10;
}elseif($user['level'] < 10){
$ms_color_rand1 = rand(0,1);
$ms_color_rand2 = rand(0,2);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 0) $msmultiply = 1;
if($ms_color_rand2 == 1) $msmultiply = 2;
if($ms_color_rand2 == 2) $msmultiply = 3;
$mscolor_multiply = num($msmultiply);
}else{
$msmultiply = 1;
$mscolor_multiply = num(1);
}
$mssmsmm = 10;
}elseif($user['level'] < 15){
$ms_color_rand1 = rand(0,1);
$ms_color_rand2 = rand(0,2);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 0) $msmultiply = 1;
if($ms_color_rand2 == 1) $msmultiply = 3;
if($ms_color_rand2 == 2) $msmultiply = 4;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 1;
$msmultiply = 1;
$mscolor_multiply = num(2);
}
}elseif($user['level'] < 20){
$ms_color_rand1 = rand(0,1);
$ms_color_rand2 = rand(0,2);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 0) $msmultiply = 2;
if($ms_color_rand2 == 1) $msmultiply = 3;
if($ms_color_rand2 == 2) $msmultiply = 4;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 1;
$msmultiply = 1;
$mscolor_multiply = num(2);
}
$mssmsmm = 30;
}elseif($user['level'] < 25){
$ms_color_rand1 = rand(1,3);
$ms_color_rand2 = rand(1,3);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 1) $msmultiply = 2;
if($ms_color_rand2 == 2) $msmultiply = 4;
if($ms_color_rand2 == 3) $msmultiply = 5;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 1;
$msmultiply = 1;
$mscolor_multiply = num(3);
}
}elseif($user['level'] < 30){
$ms_color_rand1 = rand(1,4);
$ms_color_rand2 = rand(1,4);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 1) $msmultiply = 4;
if($ms_color_rand2 == 2) $msmultiply = 5;
if($ms_color_rand2 == 3) $msmultiply = 6;
if($ms_color_rand2 == 4) $msmultiply = 7;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 2;
$msmultiply = 2;
$mscolor_multiply = num(3);
}
}elseif($user['level'] < 40){
$ms_color_rand1 = rand(1,6);
$ms_color_rand2 = rand(1,4);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 1) $msmultiply = 6;
if($ms_color_rand2 == 2) $msmultiply = 7;
if($ms_color_rand2 == 3) $msmultiply = 8;
if($ms_color_rand2 == 4) $msmultiply = 9;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 1;
$msmultiply = 1;
$mscolor_multiply = num(4);
}
$mssmsmm = 60;
}elseif($user['level'] < 50){
$ms_color_rand1 = rand(1,4);
$ms_color_rand2 = rand(1,4);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 1) $msmultiply = 6;
if($ms_color_rand2 == 2) $msmultiply = 8;
if($ms_color_rand2 == 3) $msmultiply = 12;
if($ms_color_rand2 == 4) $msmultiply = 14;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 2;
$msmultiply = 2;
$mscolor_multiply = num(6);
}
}elseif($user['level'] < 70){
$ms_color_rand1 = rand(1,4);
$ms_color_rand2 = rand(1,4);
if($ms_color_rand1 == $ms_color_rand2){
$mscolor = $ms_color_rand2;
if($ms_color_rand2 == 1) $msmultiply = 12;
if($ms_color_rand2 == 2) $msmultiply = 14;
if($ms_color_rand2 == 3) $msmultiply = 18;
if($ms_color_rand2 == 4) $msmultiply = 24;
$mscolor_multiply = num($msmultiply);
}else{
$mscolor = 3;
$msmultiply = 3;
$mscolor_multiply = num(15);
}
}
/////////////////////////////////////////////////
/////////////////////////////////////////////////
////////////////Выбираем тип вещи по цвету //////
////////////////Конец кода //////////////////////
/////////////////////////////////////////////////
if($mscolor == 0) $msallow = 0; else
if($mscolor == 1) $msallow = 0; else
if($mscolor == 2) $msallow = 1; else
if($mscolor == 3) $msallow = 1; else
if($mscolor == 4) $msallow = 1;
/////////////////////////////////////////////////
$regeneration_act1 = rand(1,$user['level']);
$attack_act1 = rand(1,$msrand_act);
$mslifeact = $msrand_act+rand(10,100);
$life_act1 = rand($user['level'],$mslifeact);
$regeneration_act = $regeneration_act1*$mscolor_multiply;
$attack_act = $attack_act1*$mscolor_multiply;
$life_act = $life_act1*$mscolor_multiply;
if($mscolor == 0) $mscolors = '<span class="log_miss">'.$msact_ms['name'].'</span>';
if($mscolor == 1) $mscolors = '<span class="item-n">'.$msact_ms['name'].'</span>';
if($mscolor == 2) $mscolors = '<span class="item-e">'.$msact_ms['name'].'</span>';
if($mscolor == 3) $mscolors = '<span class="item-l">'.$msact_ms['name'].'</span>';
if($mscolor == 4) $mscolors = '<span class="item-r">'.$msact_ms['name'].'</span>';
$ms_act_msg = '<br />'.@$ms_act_get.' <a href="../msthings" class="item-n">'.$mscolors.'</a> <span class="small minor"><span>'.$user['level'].'</span> ур</span>';
$msrand_ms_user1 = rand(1,8);
$msrand_ms_user2 = rand(1,8);
if($msrand_ms_user1 == $msrand_ms_user2){
$msruby_act = num(1);
}else{
$msruby_act = num(0);
}
$protection_act = rand($user['level'],$msrand_act);
$protection = $protection_act*$mscolor_multiply;
mysql_query("INSERT INTO `ms_mythings` SET `allow` = '".$msallow."', `protection` = '".$protection."', `rubin` = '".$msruby_act."', `ms_level_color` = '".$mscolor."', `id_things` = '".$msact_ms['id']."', `user` = '".num($user['id'])."', `act` = '".num($msact_ms['act'])."', `name` = '".my_esc($msact_ms['name'])."', `life` = '".$life_act."', `level` = '".$user['level']."', `attack` = '".$attack_act."', `regeneration` = '".num($regeneration_act)."'");
$msidruby = mysql_insert_id();
if($msrand_ms_user1 == $msrand_ms_user2){
mysql_query("INSERT INTO `ms_rubin` SET `user` = '".$user['id']."', `act` = '".$msidruby."'");
}
}else{
$ms_act_msg = '<br />В рюкзаке не хватает места<br />
Освободите рюкзак чтобы получить вещь.';
}
}
///////////////////////////////////////////////////////////////////////////////
////////////////////////Конец /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
?>