diff --git a/classes/Battles/DressedItems.php b/classes/Battles/DressedItems.php
index f1acfa0..c1053d7 100644
--- a/classes/Battles/DressedItems.php
+++ b/classes/Battles/DressedItems.php
@@ -5,6 +5,9 @@
* Time: 22:41
*/
namespace Battles;
+use db;
+use Krugozor\Database\Mysql\Exception;
+
class DressedItems
{
private $DB;
@@ -25,15 +28,20 @@ class DressedItems
private function getDressedItems()
{
try {
- $this->DB = \db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
+ $this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
} catch (\Exception $e) {
echo '
Не прогрузилась таблица inventory (*) для класса DressedItems.
';
}
}
- private function getDressedItemById($item_id)
+ private static function getDressedItemById($item_id)
{
- return \db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
+ return db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
+ }
+
+ public static function getDressedItemBySlot($itemSlot, $ownerId)
+ {
+ return db::c()->query('SELECT * FROM battles.inventory WHERE owner_id = ?i AND dressed_slot = ?i', $ownerId, $itemSlot)->fetch_assoc();
}
private function getBonusesFromDressedItems()
@@ -53,7 +61,7 @@ SELECT SUM(add_strength) as sum_strength,
SUM(add_max_physical_damage) as sum_max_phys_damage
FROM inventory WHERE owner_id = ?i AND dressed_slot > 0
SQL;
- $this->DBSUM = \db::c()->query($query, $this->USERID)->fetch_assoc();
+ $this->DBSUM = db::c()->query($query, $this->USERID)->fetch_assoc();
} catch (\Exception $e) {
echo 'Не прогрузилась таблица inventory (SUM) для класса DressedItems:' . $e . '
';
}
@@ -127,14 +135,14 @@ SQL;
* Снимает с предмета статус одетого на персонажа в определённом слоте персонажа.
* @param $slot_id - номер слота.
*
- * @throws \Krugozor\Database\Mysql\Exception
+ * @throws Exception
*/
public function undressItem($slot_id)
{
self::getItemsInSlots();
// Проверяем, что используется один из 12 слотов и наличие предмета в слоте.
if (in_array($slot_id, Item::ITEM_TYPES_ALLOWED_IN_SLOTS) && $this->dressedItem[$slot_id]) {
- \db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
+ db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
}
}
diff --git a/classes/Battles/Item.php b/classes/Battles/Item.php
index a7c3f17..630940e 100644
--- a/classes/Battles/Item.php
+++ b/classes/Battles/Item.php
@@ -29,15 +29,15 @@ abstract class Item
public const ITEM_TYPES_ALLOWED_IN_SLOTS = [1,2,3,4,5,6,7,8,9,10,11,12];
public const ITEM_TYPE_HELMET = 1;
public const ITEM_TYPE_ARMOR = 2;
- const ITEM_TYPE_LEGS = 3;
- const ITEM_TYPE_BOOTS = 4;
- const ITEM_TYPE_GLOVES = 5;
- const ITEM_TYPE_WEAPON = 6;
- const ITEM_TYPE_SHIELD = 7;
- const ITEM_TYPE_BELT = 8;
+ public const ITEM_TYPE_LEGS = 3;
+ public const ITEM_TYPE_BOOTS = 4;
+ public const ITEM_TYPE_GLOVES = 5;
+ public const ITEM_TYPE_WEAPON = 6;
+ public const ITEM_TYPE_SHIELD = 7;
+ public const ITEM_TYPE_BELT = 8;
public const ITEM_TYPE_RING = 9;
- const ITEM_TYPE_AMULET = 10;
- const ITEM_TYPE_CONSUMABLE = 20;
+ public const ITEM_TYPE_AMULET = 10;
+ public const ITEM_TYPE_CONSUMABLE = 20;
const ITEM_TYPE_OTHER = 50;
const ITEM_TYPE_TRASH = 100;
diff --git a/classes/Battles/Magic/CureInjury.php b/classes/Battles/Magic/CureInjury.php
index b31f34d..0655c2f 100644
--- a/classes/Battles/Magic/CureInjury.php
+++ b/classes/Battles/Magic/CureInjury.php
@@ -4,8 +4,10 @@
namespace Battles\Magic;
use Battles\UserEffects;
use Battles\User;
+use db;
+use Krugozor\Database\Mysql\Exception;
-class CureInjury extends magic
+class CureInjury extends Magic
{
private $target;
use UserEffects;
@@ -14,16 +16,16 @@ class CureInjury extends magic
* Магия лечения травм. Если у персонажа несколько травм, лечится самая тяжёлая.
* @param $target - кого лечим.
* @param $injuryType - тип травмы, которую лечим. 11 лёгкая, 12 средняя, 13 тяжёлая, 14 неизлечимая.
- * @throws \Krugozor\Database\Mysql\Exception
+ * @throws Exception
*/
public function __construct($target, $injuryType)
{
$this->target = $target;
if ($target && $this->isUsable()) {
- $injury = \db::c()->query('SELECT effect_id, type, name FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i ORDER BY type DESC LIMIT 1', $target)->fetch_object();
+ $injury = db::c()->query('SELECT effect_id, type, name FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i ORDER BY type DESC LIMIT 1', $target)->fetch_object();
$targetName = $this->target->login;
if (in_array($injury->effect_id, [11, 12, 13, 14]) && $injuryType >= $injury->type) {
- \db::c()->query('DELETE FROM users_effects WHERE effect_id = ?i', $injury->effect_id);
+ db::c()->query('DELETE FROM users_effects WHERE effect_id = ?i', $injury->effect_id);
if (empty($injury->name) || $injury->name == 'Неизвестный эффект') {
$injuryName = self::$effectName[$injury->type];
} else {
@@ -31,7 +33,7 @@ class CureInjury extends magic
}
return "Вы вылечили повреждение ${injuryName} персонажу ${targetName}.";
} elseif ($injury->effect_id && $injuryType == 15) {
- \db::c()->query('DELETE FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i', $target);
+ db::c()->query('DELETE FROM users_effects WHERE type IN (11,12,13,14) AND owner_id = ?i', $target);
return "Вы вылечили все повреждения персонажу ${targetName}.";
} else {
return false;
diff --git a/classes/Battles/Magic/Magic.php b/classes/Battles/Magic/Magic.php
index c7477de..e311613 100644
--- a/classes/Battles/Magic/Magic.php
+++ b/classes/Battles/Magic/Magic.php
@@ -5,7 +5,7 @@ class Magic
{
protected $status;
- protected function isVisible($caster, $target)
+ protected function isVisible($caster, $target):bool
{
if ($caster->battle != $target->battle || $caster->room != $target->room) {
$this->status = 'Вы не видите цель!';
@@ -15,7 +15,7 @@ class Magic
}
}
- protected function isNotDead($caster)
+ protected function isNotDead($caster):bool
{
if ($caster->health < 1) {
$this->status = 'Вы мертвы!';
@@ -25,7 +25,7 @@ class Magic
}
}
- protected function enoughMana($caster)
+ protected function enoughMana($caster):bool
{
if ($caster->mana < 1) {
$this->status = 'Недостаточно пыли!';
@@ -35,7 +35,7 @@ class Magic
}
}
- protected function isNotInBattle($caster)
+ protected function isNotInBattle($caster):bool
{
if ($caster->battle) {
$this->status = 'Невозможно применить в поединке!';
@@ -44,4 +44,20 @@ class Magic
return true;
}
}
+
+ /**
+ * Проверка на успех заклинания. Чем выше интеллект, тем выше шанс успеха.
+ * @param $caster - заклинатель (массив значений из базы).
+ * @param int $difficulty - сложность произнесения заклинания. Чем выше значение, тем сложнее проверка. 40 - самая сложная проверка.
+ *
+ * @return bool
+ */
+ protected function skillCheck($caster, int $difficulty = 40):bool
+ {
+ # 40 - потолок стата.
+ if ($difficulty > 40) {
+ $difficulty = 40;
+ }
+ return mt_rand(1,$difficulty) < $caster->intelligence;
+ }
}
\ No newline at end of file
diff --git a/classes/Battles/Magic/Sharpen.php b/classes/Battles/Magic/Sharpen.php
new file mode 100644
index 0000000..af35e86
--- /dev/null
+++ b/classes/Battles/Magic/Sharpen.php
@@ -0,0 +1,49 @@
+magicDifficulty = $magicDifficulty;
+ if ($this->isUsable()) {
+ $item = DressedItems::getDressedItemBySlot(Item::ITEM_TYPE_WEAPON, $_SESSION['uid']);
+ // Проверяем, что в названии предмета нет цифр и плюсов.
+ if (preg_match('/[\W\S]+\+\[?[\d]]?/', $item['name'])) {
+ return 'Этот предмет точить нельзя!';
+ }
+ $newMinPhysicalDamage = $item['add_min_physical_damage'] + $sharpenStrength;
+ $newMaxPhysicalDamage = $item['add_max_physical_damage'] + $sharpenStrength;
+ $newItemName = $item['name'] . " [+$sharpenStrength]";
+
+ db::c()->query('UPDATE battles.inventory WHERE item_id = ?i SET name = "?s", add_min_physical_damage = "?s", add_max_physical_damage = "?s"', $item['item_id'], $newItemName, $newMinPhysicalDamage, $newMaxPhysicalDamage);
+ return "У вас получилось изготовить предмет $newItemName!";
+ } else {
+ return $this->status;
+ }
+ }
+ private function isUsable():bool
+ {
+ $caster = new User($_SESSION['uid']);
+ return $this->isNotInBattle($caster) && $this->skillCheck($caster, $this->magicDifficulty);
+ }
+}
\ No newline at end of file
diff --git a/magic/Healing.php b/magic/Healing.php
index 0364e9a..2a58df8 100644
--- a/magic/Healing.php
+++ b/magic/Healing.php
@@ -1,7 +1,8 @@
target = new User($this->target);
}
- return ($this->isVisible($caster, $this->target) && $this->isNotDead($caster) && $this->enoughMana($caster));
+ return $this->isVisible($caster, $this->target) && $this->isNotDead($caster) && $this->enoughMana($caster) && $this->skillCheck($caster);
}
}
diff --git a/magic/sharp_d1.php b/magic/sharp_d1.php
deleted file mode 100644
index 2c57c46..0000000
--- a/magic/sharp_d1.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 51 + $user['intel'] - 4;
- 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` = 'Заточка на дубины +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ndubina` = `ndubina`+1, `nlovk` = `nlovk`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +1. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_d11.php b/magic/sharp_d11.php
deleted file mode 100644
index a179b8f..0000000
--- a/magic/sharp_d11.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 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 "Предмет \"{$_POST['target']}\" удачно заточен +11. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_d2.php b/magic/sharp_d2.php
deleted file mode 100644
index d2d8d4e..0000000
--- a/magic/sharp_d2.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 61 + $user['intel'] - 4;
- 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` = 'Заточка на дубины +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ndubina` = `ndubina`+2, `nlovk` = `nlovk`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +2. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_d3.php b/magic/sharp_d3.php
deleted file mode 100644
index d54809d..0000000
--- a/magic/sharp_d3.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 71 + $user['intel'] - 4;
- 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` = 'Заточка на дубины +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ndubina` = `ndubina`+3, `nlovk` = `nlovk`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +3. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_d4.php b/magic/sharp_d4.php
deleted file mode 100644
index 219ef3a..0000000
--- a/magic/sharp_d4.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 81 + $user['intel'] - 4;
- 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` = 'Заточка на дубины +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ndubina` = `ndubina`+4, `nlovk` = `nlovk`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +4. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_d5.php b/magic/sharp_d5.php
deleted file mode 100644
index c19b521..0000000
--- a/magic/sharp_d5.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 91 + $user['intel'] - 4;
- 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` = 'Заточка на дубины +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ndubina` = `ndubina`+5, `nlovk` = `nlovk`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +5. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_m1.php b/magic/sharp_m1.php
deleted file mode 100644
index d575db2..0000000
--- a/magic/sharp_m1.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else
- if ($user['intel'] >= 4) {
- $int = 51 + $user['intel'] - 4;
- 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 '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `nmech` = `nmech`+1, `cost` = `cost`+6, `nvinos` = `nvinos`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +1. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_m11.php b/magic/sharp_m11.php
deleted file mode 100644
index 0120856..0000000
--- a/magic/sharp_m11.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 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 '%Жало%') 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, `nmech` = `nmech`+11, `cost` = `cost`+72, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +11. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_m2.php b/magic/sharp_m2.php
deleted file mode 100644
index bbc3643..0000000
--- a/magic/sharp_m2.php
+++ /dev/null
@@ -1,39 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else
- if ($user['intel'] >= 4) {
- $int = 61 + $user['intel'] - 4;
- 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 '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `minu` = `minu`+2, `maxu`=`maxu`+2, `nmech` = `nmech`+2, `cost` = `cost`+12, `nvinos` = `nvinos`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +2. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_m3.php b/magic/sharp_m3.php
deleted file mode 100644
index f93930d..0000000
--- a/magic/sharp_m3.php
+++ /dev/null
@@ -1,38 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else
- if ($user['intel'] >= 4) {
- $int = 71 + $user['intel'] - 4;
- 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 '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `cost` = `cost`+18,`name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `nmech` = `nmech`+3, `nvinos` = `nvinos`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +3. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_m4.php b/magic/sharp_m4.php
deleted file mode 100644
index 927b2f6..0000000
--- a/magic/sharp_m4.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else
- if ($user['intel'] >= 4) {
- $int = 81 + $user['intel'] - 4;
- 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` (`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` = 'Заточка на мечи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nmech` = `nmech`+4, `nvinos` = `nvinos`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +4. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_m5.php b/magic/sharp_m5.php
deleted file mode 100644
index b0d30d5..0000000
--- a/magic/sharp_m5.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else
- if ($user['intel'] >= 4) {
- $int = 91 + $user['intel'] - 4;
- 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 '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `nmech` = `nmech`+5, `cost` = `cost`+30, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +5. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
-} else {
- echo "Неудачно...";
- $bet = 1;
-}
diff --git a/magic/sharp_n1.php b/magic/sharp_n1.php
deleted file mode 100644
index 26c08ae..0000000
--- a/magic/sharp_n1.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 51 + $user['intel'] - 4;
- 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 '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `nnoj` = `nnoj`+1, `ninta` = `ninta`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +1. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_n11.php b/magic/sharp_n11.php
deleted file mode 100644
index f8343c3..0000000
--- a/magic/sharp_n11.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 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 '%кинжал%') 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, `nnoj` = `nnoj`+1, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +11. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_n2.php b/magic/sharp_n2.php
deleted file mode 100644
index 6b8f300..0000000
--- a/magic/sharp_n2.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 61 + $user['intel'] - 4;
- 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 '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `nnoj` = `nnoj`+2, `ninta` = `ninta`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +2. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_n3.php b/magic/sharp_n3.php
deleted file mode 100644
index 7d83325..0000000
--- a/magic/sharp_n3.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 71 + $user['intel'] - 4;
- 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 '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `nnoj` = `nnoj`+3, `ninta` = `ninta`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +3. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_n4.php b/magic/sharp_n4.php
deleted file mode 100644
index ffa444c..0000000
--- a/magic/sharp_n4.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 81 + $user['intel'] - 4;
- 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 '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nnoj` = `nnoj`+4, `ninta` = `ninta`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +4. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_n5.php b/magic/sharp_n5.php
deleted file mode 100644
index 3012557..0000000
--- a/magic/sharp_n5.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 91 + $user['intel'] - 4;
- 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 '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `nnoj` = `nnoj`+5, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +5. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t1.php b/magic/sharp_t1.php
deleted file mode 100644
index da590af..0000000
--- a/magic/sharp_t1.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 51 + $user['intel'] - 4;
- 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 '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ntopor` = `ntopor`+1, `nsila` = `nsila`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +1. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t11.php b/magic/sharp_t11.php
deleted file mode 100644
index ed1ef07..0000000
--- a/magic/sharp_t11.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 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 '%Секира%') 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, `ntopor` = `ntopor`+1, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +11. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t2.php b/magic/sharp_t2.php
deleted file mode 100644
index 8dd4f04..0000000
--- a/magic/sharp_t2.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 61 + $user['intel'] - 4;
- 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 '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ntopor` = `ntopor`+2, `nsila` = `nsila`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +2. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t3.php b/magic/sharp_t3.php
deleted file mode 100644
index 35f98fb..0000000
--- a/magic/sharp_t3.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 71 + $user['intel'] - 4;
- 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 '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ntopor` = `ntopor`+3, `nsila` = `nsila`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +3. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t4.php b/magic/sharp_t4.php
deleted file mode 100644
index c25baaf..0000000
--- a/magic/sharp_t4.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 81 + $user['intel'] - 4;
- 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 '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ntopor` = `ntopor`+4, `nsila` = `nsila`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +4. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}
diff --git a/magic/sharp_t5.php b/magic/sharp_t5.php
deleted file mode 100644
index 322c339..0000000
--- a/magic/sharp_t5.php
+++ /dev/null
@@ -1,40 +0,0 @@
- 0) {
- echo "Не в бою...";
-} else {
- if ($user['intel'] >= 4) {
- $int = 91 + $user['intel'] - 4;
- 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 '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
- $svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
-
-
- if ($dress && $svitok) {
- if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ntopor` = `ntopor`+5, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
- echo "Предмет \"{$_POST['target']}\" удачно заточен +5. ";
- $bet = 1;
- } else {
- echo "Произошла ошибка!";
- }
- } else {
- echo "Неправильное имя предмета или неправильный свиток";
- }
- } else {
- echo "Неудачно...";
- $bet = 1;
- }
-}