0) { echo "Не в бою..."; } else { if ($user['intel'] >= 17) { $int = 80 + $user['intel'] - 17; if ($int > 100) { $int = 100; } } else { $int = 0; } if (rand(1, 100) <= $int or !$_SESSION['scroll']) { if (!$_SESSION['scroll']) { $_SESSION['scroll'] = $_POST['target']; ?> У вас нет такого свитка!"; } elseif (!$dress or $dress['type'] >= 12) { echo "У вас нет такого предмета!"; } else { $incmagic = mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '{$svitok['magic']}' LIMIT 1;")); if ((!$incmagic['img']) || in_array($svitok['magic'], $forbidden)) { echo "Этот свиток нельзя встраивать в предметы!"; } else { // встраиваем \Battles\Models\Inventory::destroyItem($svitok['id'], \Battles\User::getInstance()->getId()); echo "Свиток \"" . $svitok['name'] . "\" удачно встроен в \"" . $dress['name'] . "\""; mysql_query("UPDATE `inventory` SET " . ($dress['nintel'] < $svitok['nintel'] ? "`nintel`='" . $svitok['nintel'] . "'," : "") . " " . ($dress['nlevel'] < $svitok['nlevel'] ? "`nlevel`='" . $svitok['nlevel'] . "'," : "") . " " . ($dress['nmudra'] < $svitok['nmudra'] ? "`nmudra`='" . $svitok['nmudra'] . "'," : "") . " " . ($dress['ngray'] < $svitok['ngray'] ? "`ngray`='" . $svitok['ngray'] . "'," : "") . " " . ($dress['ndark'] < $svitok['ndark'] ? "`ndark`='" . $svitok['ndark'] . "'," : "") . " " . ($dress['nlight'] < $svitok['nlight'] ? "`nlevel`='" . $svitok['nlight'] . "'," : "") . " `massa`=`massa`+1,`cost`=`cost`+'" . $svitok['cost'] . "', `includemagic` = '" . $svitok['magic'] . "', `includemagicdex` = '" . $svitok['maxdur'] . "', `includemagicmax` = '" . $svitok['maxdur'] . "', `includemagicname` = '" . $svitok['name'] . "', `includemagicuses` = '100+" . $user['intel'] . "', `includemagiccost` = '" . ($svitok['cost'] / 2) . "' WHERE `id` = '{$dress['id']}' LIMIT 1;"); $bet = 1; } } } } else { echo "Cвиток рассыпался в ваших руках..."; $bet = 1; $_SESSION['scroll'] = null; } }