<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;
}
$title = 'Нашивки';
include './system/h.php';
?>
<div class="content"><div class="block center header"><a href="/equip/"><u>Снаряжение</u></a>/ Установка нашивки</div>
<div class="dotted"></div><div class="block center blue">Нашивка позволит тебе сделать шмотку мощнее</div>
<div class="dotted"></div>
<?
$id = _string(_num($_GET['id']));
if($id && $inv['quality'] == $inv['smith']) {
$inv = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$user['id'].'" AND `id` = "'.$id.'" AND `equip` = "1" AND `smith` <20');
$inv = mysql_fetch_array($inv);
if(!$inv && $inv['quality'] == $inv['smith']) {
}
if($inv['quality'] == 1 && $inv['smith'] == 1 OR $inv['quality'] == 2 && $inv['smith'] == 2 OR $inv['quality'] == 3 && $inv['smith'] == 3 OR $inv['quality'] == 4 && $inv['smith'] == 4 OR $inv['quality'] == 5 && $inv['smith'] == 5 OR $inv['quality'] == 6 && $inv['smith'] == 6 OR $inv['quality'] == 7 && $inv['smith'] == 7 OR $inv['quality'] == 8 && $inv['smith'] == 8 OR $inv['quality'] == 9 && $inv['smith'] == 9 OR $inv['quality'] == 10 && $inv['smith'] == 10 OR $inv['quality'] == 11 && $inv['smith'] == 11 OR $inv['quality'] == 12 && $inv['smith'] == 12) {
}
$item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$inv['item'].'"');
$item = mysql_fetch_array($item);
switch($item['quality']) {
case 1:
$bonus = 0;
$quality = 'Простой';
$quality_color = "#986";
break;
case 2:
$bonus = 5;
$quality = 'Обычный';
$quality_color = "#6c3";
break;
case 3:
$bonus = 10;
$quality = 'Редкий';
$quality_color = "#69c";
break;
case 4:
$bonus = 15;
$quality = 'Эпический';
$quality_color = "#c6f";
break;
case 5:
$bonus = 20;
$quality = 'Легенарный';
$quality_color = "#f60";
break;
case 6:
$bonus = 50;
$quality = 'Божественный';
$quality_color = "#999";
break;
case 7:
$bonus = 65;
$quality = 'Сверх Божественный';
$quality_color = "#999";
break;
}
switch($inv['smith']) {
case 1:
$costy = 800;
$smith = 1000;
case 1:
$costy = 3300;
$smith = 5500;
break;
case 2:
$costy = 10800;
$smith = 7500;
break;
case 3:
$costy = 23000;
$smith = 12200;
break;
case 4:
$costy = 29600;
$smith = 6300;
break;
case 5:
$costy = 37400;
$smith = 7800;
break;
case 6:
$costy = 45600;
$smith = 8200;
break;
case 7:
$costy = 62000;
$smith = 16400;
break;
case 8:
$costy = 82000;
$smith = 24400;
break;
}
$gi = 15 + ($inv['smith'] * 200*3);
$si = 20000 + ($inv['smith'] * 20000);
$g = 15 + ($inv['smith'] * 200*3);
$s = 20000 + ($inv['smith'] * 20000);
if($dxp6['pos'] == 1){
$g = $g - (($g / 100)*$dxp6['x']);
$s = $s - (($s / 100)*$dxp6['x']);
}
if(isset($_GET['start'])) {
if($user['g'] < $g OR $user['s'] < $s) {
header('location: /smith/po/'.$inv['id'].'/');
exit;
}
if($inv['smith'] == 1 && $inv['quality'] < 1 OR $inv['smith'] == 2 && $inv['quality'] < 2 OR $inv['smith'] == 3 && $inv['quality'] < 3 OR $inv['smith'] == 4 && $inv['quality'] < 4 OR $inv['smith'] == 5 && $inv['quality'] < 5 OR $inv['smith'] == 6 && $inv['quality'] < 6 OR $inv['smith'] == 7 && $inv['quality'] < 7 OR $inv['smith'] == 8 && $inv['quality'] < 8 OR $inv['smith'] == 9 && $inv['quality'] < 9 ) {
}
mysql_query('UPDATE `users` SET `s` = `s` - '.$s.', `g` = `g` - '.$g.' WHERE `id` = "'.$user['id'].'"');
$texy="Улучшил (нашивка) шмотку $item[name] <img src=/images/icons/silver.png width=16 height=16 alt=> $s <img src=/images/icons/gold.png width=16 height=16 alt=> $g ";
mysql_query('INSERT INTO `golds` SET `user` = "'.$user['id'].'",`time` = "'.time().'",`text` = "'.$texy.'",`loc`="2"');
mysql_query('UPDATE `inv` SET `smith` = `smith` + 1,
`_str` = `_str` + '.$smith.', `_vit` = `_vit` + '.$smith.', `_def` = `_def` + '.$smith.' WHERE `id` = "'.$inv['id'].'"');
mysql_query('UPDATE `users` SET `str` = `str` + '.$smith.', `vit` = `vit` + '.$smith.', `def` = `def` + '.$smith.' WHERE `id` = "'.$user['id'].'"');
header('location: /smith/po/'.$inv['id'].'/?');
}
?>
<div class="block snow">
<img class="left mr8" src="/images/items/<?=$item['id']?>.jpg" width="50" height="50" alt="">
<img src="/images/icons/equip.png" width="16" height="16" alt=""> <span class="color-quality<?=$inv['quality']?>"><?=$item['name']?></span>
<span class="white">
<img src="/images/icons/level.png" width="16" height="16" alt=""> <?=$item['lvl']?> ур. </span>
<div>
<span class="green">
<img src="/images/icons/health.png" width="16" height="16" alt=""> <?=n_f($inv['vit_'])?></span>
<span class="green">
<img src="/images/icons/damage.png" width="16" height="16" alt=""> <?=n_f($inv['str_'])?></span>
<span class="green">
<img src="/images/icons/armor.png" width="16" height="16" alt=""> <?=n_f($inv['def_'])?></span>
<div class="clear"></div>
</div></div>
<?
$quality_col = array('1'=>'#F6FF73','2'=>'#FF9F20','3'=>'#FF7032','4'=>'#7BFF6C','5'=>'#6CABFF','6'=>'#FF2222','7'=>'#FF1B6E','8'=>'#D822FF');
$itemqualit=array('1'=>'Обычное качество','2'=>'Редкое качество','3'=>'Очень редкое качество','4'=>'Великолепное качество','5'=>'Легендарное качество','6'=>'Божественное качество','7'=>'Сверх-Божественное качество','8'=>'Эксклюзивное качество','9'=>'Эпическое качество' );
?>
<div class="dotted"></div>
<div class="block center">
<span class="blue s125">Всё нашивки установлены</span>
<span class="btn_start"><span class="btn_end"><a class="btn" href="/equip/"> Перейти в снаряжение</a></span> </span> </div>
<div class="dotted"></div>
<?
}
?>
<ul class="block small">
<li class="color2">Внимание! Нашивки не суммируются. Это значит что при переходе от одного качества к другому,
параметры старого качества заменяются параметрами нового</li>
</ul></div>
<?
include './system/f.php';
?>