battles/magic/sharp_d11.php

37 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if ($user['battle'] > 0) {
echo "РќРµ РІ Р±РѕСЋ...";
} else {
if ($user['intel'] >= 1) {
$int = 91 + $user['intel'] - 1;
if ($int > 100) {
$int = 100;
}
} else {
$int = 0;
}
if (rand(1, 100) < $int) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
if ($dress && $svitok) {
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ndubina` = `ndubina`+11, `nlovk` = `nlovk`+11 WHERE `id` = {$dress['id']} LIMIT 1;")) {
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
$bet = 1;
} else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
} else {
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
}
} else {
echo "<font color=red><b>Неудачно...<b></font>";
$bet = 1;
}
}