From 4470f8009851c20044fa63daf7ac8b322cdede8a Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Fri, 9 Feb 2024 21:41:54 +0200
Subject: [PATCH] WIP

---
 _incl_data/class/Battle.php    | 2305 ++++++++++++++++----------------
 _incl_data/class/Priems.php    |  242 ++--
 _incl_data/class/User.php      |  133 +-
 _incl_data/class/User/Item.php |    2 +-
 jx/battle/refresh.php          |    2 +-
 jx/battle/refresh1.php         |    2 +-
 jx/battle/refresh2.php         |    2 +-
 modules_data/_inv.php          |   11 +-
 modules_data/_umenie.php       |  294 ++--
 9 files changed, 1501 insertions(+), 1492 deletions(-)

diff --git a/_incl_data/class/Battle.php b/_incl_data/class/Battle.php
index 73ce95fc..a5d8d871 100644
--- a/_incl_data/class/Battle.php
+++ b/_incl_data/class/Battle.php
@@ -1,6 +1,5 @@
 <?php
 
-use Battle\Fighter;
 use Battle\Finish;
 use Battle\Helper;
 use Battle\Info;
@@ -46,31 +45,18 @@ class Battle
         'тьма' => 6,
         'серая' => 7,
     ];
-
-    /**
-     * Параметры приёмов, которые, наверное, надо бы занести в БД.
-     * @var array|BattlePriem[]
-     */
-    private array $prm;
-
     /**Кэширование данных (?!)*/
     public bool $cached = false;
-
     /**Отображаем главное окно (1 - можно бить, 2 - ожидаем ход противника, 3 - Проиграли. Ожидаем завершения поединка)*/
     public int $mainStatus = 1;
-
     /** Информация о поединке.*/
     public Info $i;
-
     /**Информация о пользователях в этом бою*/
     public array $users = [];
-
     /**Информация о статах пользователей в этом бою. Фактичесчки $user->stats для каждого участинка поединко.*/
     public array $stats = [];
-
     /**Массив объектов бойцов*/
     public array $fighters = [];
-
     /**Список пользователей и их id в stats или users.
      *
      * Все id пользователей записываются в этот массив по очереди, где id выступает ключом, а значение
@@ -79,43 +65,40 @@ class Battle
      * Например id пользователя = 555 , то $uids[555] выдаст его порядковый номер в массиве users \ stats
      */
     public array $uids = [];
-
     /**Список ударов в этом бою (действующих)*/
     public array $atacks = [];
-
     /**Список uid кто нанес удар и по кому  $ga[ {id кто ударил} ][ {id кого ударил} ]*/
     public array $ga = [];
-
+    public int $hodID = 0;
+    public array $bots = [];
+    /** Ошибка (текст) */
+    public string $e = '';
+    public array $rehodeff = [];
+    /** Для номерных приёмов */
+    public array $um_priem = [];    // ID ботов
+    public array $pr_not_use = [];   // i бота
+    public array $del_val = [];
+    /**
+     * Параметры приёмов, которые, наверное, надо бы занести в БД.
+     * @var array|BattlePriem[]
+     */
+    private array $prm; //Если игрок нанес удар
     /**Список uid кто нанес удар и по кому  $ga[ {id кого ударили} ][ {id кто ударил} ]*/
     private array $ag = [];
-    public int $hodID = 0;
+    //Очистка кэша для ...
     private int|array $stnZbVs = 0;
-    public array $bots = [];    // ID ботов
-    private array $iBots = [];   // i бота
+    private array $iBots = [];
     private array $stnZb = [];
-
     /** Выбранные зоны атаки и блока */
     private array $uAtc = [
         'id' => 0,
         'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0],
         'b' => 0,
-    ]; //Если игрок нанес удар
-
-    /** Ошибка (текст) */
-    public string $e = '';
-    //Очистка кэша для ...
+    ];
     private array $uclearc = [];
     private array $ucleari = [];
-    public array $rehodeff = [];
     private array $poglast = [];
-
-    /** Для номерных приёмов */
-    public array $um_priem = [];
-
     private int $importUser = 0;
-    public array $pr_not_use = [];
-    public array $del_val = [];
-
     private Finish $finish;
 
     public function __construct(private readonly Stat $statnames = new Stat())
@@ -124,142 +107,163 @@ class Battle
         $this->statnames->getBonus();
         $this->finish = new Finish($this);
 
-        $this->prm = [1 => new BattlePriem(act:1, typeOf:5),
-            2 => new BattlePriem(act:2, typeOf:3),
-            4 => new BattlePriem(act:2, typeOf:3),
-            7 => new BattlePriem(act:1, typeOf:4),
-            290 => new BattlePriem(act:1, typeOf:4),
-            294 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            295 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            296 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            297 => new BattlePriem(act:2, typeOf:0, moment:3),
-            298 => new BattlePriem(act:2, typeOf:3),
-            141 => new BattlePriem(act:2, typeOf:4),
-            147 => new BattlePriem(act:2, typeOf:4),
-            148 => new BattlePriem(act:2, typeOf:4),
-            149 => new BattlePriem(act:2, typeOf:4),
-            150 => new BattlePriem(act:2, typeOf:4),
-            142 => new BattlePriem(act:2, typeOf:4),
-            144 => new BattlePriem(act:2, typeOf:4),
-            146 => new BattlePriem(act:2, typeOf:4),
-            145 => new BattlePriem(act:2, typeOf:4),
-            8 => new BattlePriem(act:1, typeOf:1),
-            9 => new BattlePriem(act:2, typeOf:3),
-            10 => new BattlePriem(act:1, typeOf:1),
-            11 => new BattlePriem(act:2, typeOf:3),
-            45 => new BattlePriem(act:1, typeOf:4),
-            47 => new BattlePriem(act:2, typeOf:2),
-            48 => new BattlePriem(act:1, typeOf:1),
-            49 => new BattlePriem(act:1, typeOf:1),
-            138 => new BattlePriem(act:2, typeOf:3),
-            140 => new BattlePriem(act:1, typeOf:4),
-            193 => new BattlePriem(act:2, typeOf:3),
-            204 => new BattlePriem(act:2, typeOf:0, moment:3),
-            211 => new BattlePriem(act:1, typeOf:4),
-            213 => new BattlePriem(act:1, typeOf:4),
-            215 => new BattlePriem(act:1, typeOf:1),
-            216 => new BattlePriem(act:2, typeOf:2),
-            217 => new BattlePriem(act:2, typeOf:0, moment:3),
-            219 => new BattlePriem(act:2, typeOf:3),
-            220 => new BattlePriem(act:2, typeOf:0, moment:3),
-            222 => new BattlePriem(act:2, typeOf:3),
-            225 => new BattlePriem(act:1, typeOf:4),
-            226 => new BattlePriem(act:1, typeOf:4),
-            231 => new BattlePriem(act:2, typeOf:0, moment:3),
-            234 => new BattlePriem(act:2, typeOf:4),
-            235 => new BattlePriem(act:2, typeOf:3),
-            342 => new BattlePriem(act:0, typeOf:0),
-            343 => new BattlePriem(act:0, typeOf:0),
-            237 => new BattlePriem(act:2, typeOf:3),
-            239 => new BattlePriem(act:2, typeOf:3),
-            240 => new BattlePriem(act:2, typeOf:5),
-            21 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            73 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            74 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            75 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            76 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            77 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            78 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            79 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            22 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            80 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            81 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            82 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            83 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            84 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            36 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            85 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            86 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            87 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            88 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            89 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            90 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            23 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            70 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            71 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            72 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            269 => new BattlePriem(act:2, typeOf:9),
-            276 => new BattlePriem(act:2, typeOf:9),
-            277 => new BattlePriem(act:2, typeOf:9),
-            270 => new BattlePriem(act:2, typeOf:5, typeSec:5),
-            280 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            281 => new BattlePriem(act:2, typeOf:5),
-            282 => new BattlePriem(act:2, typeOf:5),
-            24 => new BattlePriem(act:2, typeOf:0, moment:3),
-            210 => new BattlePriem(act:2, typeOf:8),
-            209 => new BattlePriem(act:2, typeOf:8),
-            208 => new BattlePriem(act:2, typeOf:8),
-            207 => new BattlePriem(act:2, typeOf:8),
-            206 => new BattlePriem(act:2, typeOf:8),
-            284 => new BattlePriem(act:2, typeOf:8),
-            175 => new BattlePriem(act:2, typeOf:8),
-            176 => new BattlePriem(act:2, typeOf:8),
-            177 => new BattlePriem(act:2, typeOf:8),
-            178 => new BattlePriem(act:2, typeOf:8),
-            179 => new BattlePriem(act:2, typeOf:8),
-            42 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            121 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            122 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            123 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            124 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            125 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            249 => new BattlePriem(act:2, typeOf:4),
-            248 => new BattlePriem(act:2, typeOf:4),
-            251 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            252 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            273 => new BattlePriem(act:1, typeOf:4),
-            286 => new BattlePriem(act:1, typeOf:4),
-            287 => new BattlePriem(act:1, typeOf:4),
-            288 => new BattlePriem(act:1, typeOf:4),
-            255 => new BattlePriem(act:2, typeOf:8),
-            337 => new BattlePriem(act:2, typeOf:5),
-            33 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            56 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            57 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            58 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            59 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            60 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            245 => new BattlePriem(act:2, typeOf:9),
-            327 => new BattlePriem(act:2, typeOf:0, moment:3),
-            328 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            329 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            330 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            331 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            332 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            333 => new BattlePriem(act:2, typeOf:0, moment:3),
-            334 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            335 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            299 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            300 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            301 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            302 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            303 => new BattlePriem(act:2, typeOf:4),
-            304 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
-            305 => new BattlePriem(act:2, typeOf:0, moment:0, momentEnd:3),
+        $this->prm = [
+            1 => new BattlePriem(act: 1, typeOf: 5),
+            2 => new BattlePriem(act: 2, typeOf: 3),
+            4 => new BattlePriem(act: 2, typeOf: 3),
+            7 => new BattlePriem(act: 1, typeOf: 4),
+            8 => new BattlePriem(act: 1, typeOf: 1),
+            9 => new BattlePriem(act: 2, typeOf: 3),
+            10 => new BattlePriem(act: 1, typeOf: 1),
+            11 => new BattlePriem(act: 2, typeOf: 3),
+            21 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            22 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            23 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            24 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            33 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            36 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            42 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            45 => new BattlePriem(act: 1, typeOf: 4),
+            47 => new BattlePriem(act: 2, typeOf: 2),
+            48 => new BattlePriem(act: 1, typeOf: 1),
+            49 => new BattlePriem(act: 1, typeOf: 1),
+            56 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            57 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            58 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            59 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            60 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            70 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            71 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            72 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            73 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            74 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            75 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            76 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            77 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            78 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            79 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            80 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            81 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            82 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            83 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            84 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            85 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            86 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            87 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            88 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            89 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            90 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            121 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            122 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            123 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            124 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            125 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            138 => new BattlePriem(act: 2, typeOf: 3),
+            140 => new BattlePriem(act: 1, typeOf: 4),
+            141 => new BattlePriem(act: 2, typeOf: 4),
+            142 => new BattlePriem(act: 2, typeOf: 4),
+            144 => new BattlePriem(act: 2, typeOf: 4),
+            145 => new BattlePriem(act: 2, typeOf: 4),
+            146 => new BattlePriem(act: 2, typeOf: 4),
+            147 => new BattlePriem(act: 2, typeOf: 4),
+            148 => new BattlePriem(act: 2, typeOf: 4),
+            149 => new BattlePriem(act: 2, typeOf: 4),
+            150 => new BattlePriem(act: 2, typeOf: 4),
+            175 => new BattlePriem(act: 2, typeOf: 8),
+            176 => new BattlePriem(act: 2, typeOf: 8),
+            177 => new BattlePriem(act: 2, typeOf: 8),
+            178 => new BattlePriem(act: 2, typeOf: 8),
+            179 => new BattlePriem(act: 2, typeOf: 8),
+            193 => new BattlePriem(act: 2, typeOf: 3),
+            204 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            206 => new BattlePriem(act: 2, typeOf: 8),
+            207 => new BattlePriem(act: 2, typeOf: 8),
+            208 => new BattlePriem(act: 2, typeOf: 8),
+            209 => new BattlePriem(act: 2, typeOf: 8),
+            210 => new BattlePriem(act: 2, typeOf: 8),
+            211 => new BattlePriem(act: 1, typeOf: 4),
+            213 => new BattlePriem(act: 1, typeOf: 4),
+            215 => new BattlePriem(act: 1, typeOf: 1),
+            216 => new BattlePriem(act: 2, typeOf: 2),
+            217 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            219 => new BattlePriem(act: 2, typeOf: 3),
+            220 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            222 => new BattlePriem(act: 2, typeOf: 3),
+            225 => new BattlePriem(act: 1, typeOf: 4),
+            226 => new BattlePriem(act: 1, typeOf: 4),
+            231 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            234 => new BattlePriem(act: 2, typeOf: 4),
+            235 => new BattlePriem(act: 2, typeOf: 3),
+            237 => new BattlePriem(act: 2, typeOf: 3),
+            239 => new BattlePriem(act: 2, typeOf: 3),
+            240 => new BattlePriem(act: 2, typeOf: 5),
+            245 => new BattlePriem(act: 2, typeOf: 9),
+            248 => new BattlePriem(act: 2, typeOf: 4),
+            249 => new BattlePriem(act: 2, typeOf: 4),
+            251 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            252 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            255 => new BattlePriem(act: 2, typeOf: 8),
+            269 => new BattlePriem(act: 2, typeOf: 9),
+            270 => new BattlePriem(act: 2, typeOf: 5, typeSec: 5),
+            273 => new BattlePriem(act: 1, typeOf: 4),
+            276 => new BattlePriem(act: 2, typeOf: 9),
+            277 => new BattlePriem(act: 2, typeOf: 9),
+            280 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            281 => new BattlePriem(act: 2, typeOf: 5),
+            282 => new BattlePriem(act: 2, typeOf: 5),
+            284 => new BattlePriem(act: 2, typeOf: 8),
+            286 => new BattlePriem(act: 1, typeOf: 4),
+            287 => new BattlePriem(act: 1, typeOf: 4),
+            288 => new BattlePriem(act: 1, typeOf: 4),
+            290 => new BattlePriem(act: 1, typeOf: 4),
+            294 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            295 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            296 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            297 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            298 => new BattlePriem(act: 2, typeOf: 3),
+            299 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            300 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            301 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            302 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            303 => new BattlePriem(act: 2, typeOf: 4),
+            304 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            305 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            327 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            328 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            329 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            330 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            331 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            332 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            333 => new BattlePriem(act: 2, typeOf: 0, moment: 3),
+            334 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            335 => new BattlePriem(act: 2, typeOf: 0, moment: 0, momentEnd: 3),
+            337 => new BattlePriem(act: 2, typeOf: 5),
+            342 => new BattlePriem(act: 0, typeOf: 0),
+            343 => new BattlePriem(act: 0, typeOf: 0),
         ];
 
     }
 
+    /**
+     * @param int|null $experience
+     * @param bool $hardcore поединок с гарантированной травмой
+     * @return array|int[]
+     */
+    public static function getType(?int $experience, bool $hardcore = false): array
+    {
+        return match (true) {
+            $experience >= 5000000 => [150, 150, 'Судный День', 'Судный День'],
+            $experience >= 2500000 => [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'],
+            $experience >= 1000000 => [75, 100, 'Историческая Битва', 'Кровавая Сеча'],
+            $experience >= 500000 => [50, 75, 'Величайшая Битва', 'Кровавая Резня'],
+            $experience >= 100000 => [25, 50, 'Великая Битва', 'Кровавая Битва'],
+            $hardcore => [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение'],
+            default => [0, 0, 'Поединок', 'Кровавый Поединок'],
+        };
+    }
+
+    //JS информация о игроке
+
     public function initRefresh(User $user): bool
     {
         $this->i = new Info($user->info['battle']);
@@ -273,8 +277,6 @@ class Battle
         return !empty($this->i->id);
     }
 
-    //JS информация о игроке
-
     public function maginfoattack($u1, $u2, $type): int
     {
         /*
@@ -297,78 +299,81 @@ class Battle
         return ' magelogin=' . $v_l . ' onMouseOver=top.hi(this,maginfo(' . $v_z . ',' . $v_p . ',' . $v_m . ',this),event,3,1,1,1,null); onMouseOut=top.hic(); onMouseDown=top.hic(); ';
     }
 
-    public function hphe($uid, $hp, $false_t7 = false): float
+
+    //Мини лог
+
+    public function hphe($uid, $hp, $false_t7 = false): int
     {
         if (!isset($this->stats[$this->uids[$uid]])) {
             echo 'WARNING! ОШИБКА! ПОТЕРЯНА ПЕРЕМЕННАЯ ЗДОРОВЬЯ ПЕРСОНАЖА!';
-        } else {
-            $hpnow = floor($this->stats[$this->uids[$uid]]['hpNow']);
-            $hpall = $this->stats[$this->uids[$uid]]['hpAll'];
-            if ($hp > 0) {
-                //Хиляем
-                if ($hpnow + $hp > $hpall) {
-                    $hpli = $hpnow + $hp - $hpall;
-                    $hp -= $hpli;
-                }
-                if (isset($this->stats[$this->uids[$uid]]['min_heal_proc']) && $this->stats[$this->uids[$uid]]['min_heal_proc'] < -99) {
-                    $hp = 0;
-                } else {
-                    $hp = $hp / 100 * (100 + $this->stats[$this->uids[$uid]]['min_heal_proc']);
-                }
-                //Отнимаем тактику
-                if (!$false_t7) {
-                    if ($this->users[$this->uids[$uid]]['tactic7'] <= 0) {
-                        $hp = 0;
-                        $this->users[$this->uids[$uid]]['tactic7'] = 0;
-                        $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7'];
-                    } else {
-                        $gdhh = round($hp / $this->stats[$this->uids[$uid]]['hpAll'] * 10, 2);
-                        if ($gdhh == 0) {
-                            $gdhh = 0.01;
-                        }
-
-                        $gdhd = round($this->users[$this->uids[$uid]]['tactic7'] / $gdhh * 100);
-
-                        $this->users[$this->uids[$uid]]['tactic7'] = round(
-                            ($this->users[$this->uids[$uid]]['tactic7'] - $gdhh),
-                            2
-                        );
-                        if ($this->users[$this->uids[$uid]]['tactic7'] < 0) {
-                            $this->users[$this->uids[$uid]]['tactic7'] = 0;
-                        }
-                        $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7'];
-                        if ($gdhd < 100) {
-                            $hp = floor($hp / 100 * $gdhd);
-                        }
-                    }
-                }
-            } elseif ($hp < 0) {
-                //Отнимаемф
-                if ($hpnow + $hp < 0) {
-                    $hpli = $hpnow + $hp;
-                    $hp += -($hpli);
-                }
-            }
-
-            if ($this->stats[$this->uids[$uid]]['hpNow'] < 1) {
-                $hp = 0;
-            }
-
-            $this->stats[$this->uids[$uid]]['last_hp'] = -$hp;
-            Db::sql(
-                'update stats set last_hp = ?, tactic7 = ? where id = ?', [
-                                                                            $this->users[$this->uids[$uid]]['last_hp'],
-                                                                            $this->users[$this->uids[$uid]]['tactic7'],
-                                                                            $uid,
-                                                                        ]
-            );
+            return (int)$hp;
         }
 
-        return (int)floor($hp);
+        $hpnow = floor($this->stats[$this->uids[$uid]]['hpNow']);
+        $hpall = $this->stats[$this->uids[$uid]]['hpAll'];
+        if ($hp > 0) {
+            //Хиляем
+            if ($hpnow + $hp > $hpall) {
+                $hpli = $hpnow + $hp - $hpall;
+                $hp -= $hpli;
+            }
+            if (isset($this->stats[$this->uids[$uid]]['min_heal_proc']) && $this->stats[$this->uids[$uid]]['min_heal_proc'] < -99) {
+                $hp = 0;
+            } else {
+                $hp = $hp / 100 * (100 + $this->stats[$this->uids[$uid]]['min_heal_proc']);
+            }
+            //Отнимаем тактику
+            if (!$false_t7) {
+                if ($this->users[$this->uids[$uid]]['tactic7'] <= 0) {
+                    $hp = 0;
+                    $this->users[$this->uids[$uid]]['tactic7'] = 0;
+                    $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7'];
+                } else {
+                    $gdhh = round($hp / $this->stats[$this->uids[$uid]]['hpAll'] * 10, 2);
+                    if ($gdhh == 0) {
+                        $gdhh = 0.01;
+                    }
+
+                    $gdhd = round($this->users[$this->uids[$uid]]['tactic7'] / $gdhh * 100);
+
+                    $this->users[$this->uids[$uid]]['tactic7'] = round(
+                        ($this->users[$this->uids[$uid]]['tactic7'] - $gdhh),
+                        2
+                    );
+                    if ($this->users[$this->uids[$uid]]['tactic7'] < 0) {
+                        $this->users[$this->uids[$uid]]['tactic7'] = 0;
+                    }
+                    $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7'];
+                    if ($gdhd < 100) {
+                        $hp = floor($hp / 100 * $gdhd);
+                    }
+                }
+            }
+        } elseif ($hp < 0) {
+            //Отнимаемф
+            if ($hpnow + $hp < 0) {
+                $hpli = $hpnow + $hp;
+                $hp += -($hpli);
+            }
+        }
+
+        if ($this->stats[$this->uids[$uid]]['hpNow'] < 1) {
+            $hp = 0;
+        }
+        $this->stats[$this->uids[$uid]]['last_hp'] = -$hp;
+
+        Db::sql(
+            'update stats set last_hp = ?, tactic7 = ? where id = ?', [
+                $this->users[$this->uids[$uid]]['last_hp'],
+                $this->users[$this->uids[$uid]]['tactic7'],
+                $uid,
+            ]
+        );
+
+        return (int)$hp;
     }
 
-
-    //Мини лог
+    //Проверяем завершение боя
 
     /**
      * Какая-то хуедрыга для номерных файлов-приёмов
@@ -379,14 +384,10 @@ class Battle
      */
     public function deleffm(int $pid, int $uid, int $id): void
     {
-        if ($id > 0) {
-            Db::sql('delete from eff_users where id = ? and v1 = ? and v2 != 0', [$id, 'priem']);
-        } else {
-            Db::sql('delete from eff_users where uid = ? and v1 = ? and v2 = ?', [$uid, 'priem', $pid]);
-        }
+        Db::sql("delete from eff_users where v1 = 'priem' and (id = ? and v2 != 0 or uid = ? and v2 = ?)", [$id, $uid, $pid]);
     }
 
-    //Проверяем завершение боя
+    //завершение поединка
 
     public function clear_cache_start(): void
     {
@@ -394,8 +395,6 @@ class Battle
         Db::sql('delete from battle_cache where uid in (?)', [$uids]);
     }
 
-    //завершение поединка
-
     /**
      * Проверка урон приемов над защитными.
      * Игрок 1 бьет по Игроку 2 при помощи приема на hp ед. здоровья.
@@ -438,6 +437,8 @@ class Battle
         Db::sql('update stats set battle_yron = battle_yron + ? where id = ?', [$hpDamageValue, $uid]);
     }
 
+    //Проводим удар
+
     public function myInfo($id, $t): string
     {
         global $u;
@@ -798,7 +799,7 @@ JS;
         return $info;
     }
 
-    //Проводим удар
+    //Запускаем магические предметы, если в них что-то встроено
 
     /**
      * Проверка на выживших.
@@ -824,8 +825,6 @@ JS;
         return $tl > 1;
     }
 
-    //Запускаем магические предметы, если в них что-то встроено
-
     public function testFinish(): void
     {
         global $u;
@@ -839,7 +838,7 @@ JS;
         }
 
         if ($tw !== -1) {
-            $this->finish->finishBattle(nl:10);
+            $this->finish->finishBattle(nl: 10);
             return;
         }
 
@@ -1032,8 +1031,7 @@ JS;
                 //конец излома
                 $this->finish->finishBattle($tml, $tmv);
                 mysql_query(
-                    'INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time(
-                    ) . '","' . $this->i->izlomroundsee . '","' . $this->i->izlomlvl . '","0","0","' . ($this->i->izlomobr - $this->i->izlomobrnow) . '","' . $this->i->id . '")'
+                    'INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $this->i->izlomroundsee . '","' . $this->i->izlomlvl . '","0","0","' . ($this->i->izlomobr - $this->i->izlomobrnow) . '","' . $this->i->id . '")'
                 );
             } else {
                 $this->i->setIzlomround($iz['round']);
@@ -1139,11 +1137,13 @@ JS;
         );
     }
 
+    //Поглощение урона
+
     /**
      * @param array $botLogins
-     * @param int   $counter
-     * @param int   $obr
-     * @param int   $unique для совместимости с непонятным вызовом User->addAction
+     * @param int $counter
+     * @param int $obr
+     * @param int $unique для совместимости с непонятным вызовом User->addAction
      *                      при вызове уникального монстра.
      * @return void
      */
@@ -1198,7 +1198,12 @@ JS;
         }
     }
 
-    //Поглощение урона
+
+    //Игрок1 наносит удар Игрок2
+    //Проверка ухода удара в игрока
+    //Расчет уворота игроков
+    //Расчет крита игроков
+    //Расчет блока щитом игроков
 
     /** Запись в лог боя с шансом реплики комментатора.
      * @param array $mass
@@ -1215,12 +1220,7 @@ JS;
         }
     }
 
-
-    //Игрок1 наносит удар Игрок2
-    //Проверка ухода удара в игрока
-    //Расчет уворота игроков
-    //Расчет крита игроков
-    //Расчет блока щитом игроков
+    //Расчет контрудара игроков
 
     public function priemAddLogFast($u1, $u2, $prm, $text, $hodID, $tm): void
     {
@@ -1245,19 +1245,19 @@ JS;
         $this->add_log($arr);
     }
 
-    //Расчет контрудара игроков
+    //Добавляем статистику
 
     /** Осторожно! Подключаются файлы!!!
      * Трогать очень осторожно. Этот шайтан как-то проверяет приёмы на враге
      * и рассчитывает урон учитывая и эти приёмы тоже.
-     * @param int  $uid1
-     * @param int  $uid2
-     * @param int  $priem
+     * @param int $uid1
+     * @param int $uid2
+     * @param int $priem
      * @param      $yron
-     * @param int  $profil
+     * @param int $profil
      * @param bool $stabil
      * @param bool $test
-     * @param int  $inlog
+     * @param int $inlog
      * @return float|int|mixed
      */
     public function testYronPriem(
@@ -1269,7 +1269,8 @@ JS;
         bool $stabil,
         bool $test = false,
         int  $inlog = 0
-    ): mixed {
+    ): mixed
+    {
 
         /**
          * profil = {
@@ -1358,8 +1359,6 @@ JS;
         return $yron;
     }
 
-    //Добавляем статистику
-
     public function priemYronSave($u1, $u2, $yron, $type = 0): void
     {
         //$type 0 - урон , 1 - хил
@@ -1435,6 +1434,8 @@ JS;
         );
     }
 
+    //Добавляем статистику ударов
+
     public function testUserInfoBattle($uid): void
     {
         global $u;
@@ -1462,7 +1463,7 @@ JS;
         //fixme много чего повторно берется
     }
 
-    //Добавляем статистику ударов
+    //Добавляем размены в лог
 
     /**
      * Расчет опыта
@@ -1496,7 +1497,7 @@ JS;
         return (int)round($addExp);
     }
 
-    //Добавляем размены в лог
+    //Добавляем в лог действия приема
 
     public function addNewStat($stat): void
     {
@@ -1546,7 +1547,7 @@ JS;
         }
     }
 
-    //Добавляем в лог действия приема
+    //Считаем контру
 
     public function lookLog(): string
     {
@@ -1627,7 +1628,8 @@ JS;
         return $js;
     }
 
-    //Считаем контру
+
+    //Расчитываем статы для конкретной зоны атаки
 
     public function lookmLog(): string
     {
@@ -1707,8 +1709,7 @@ JS;
         return $js;
     }
 
-
-    //Расчитываем статы для конкретной зоны атаки
+    //Считаем урон
 
     public function weaponAt22($item, $st): array
     {
@@ -1725,7 +1726,8 @@ JS;
         ];
     }
 
-    //Считаем урон
+
+    //Добавляем новую статистику игрока
 
     public function autoSmena(): void
     {
@@ -1788,8 +1790,7 @@ JS;
         }
     }
 
-
-    //Добавляем новую статистику игрока
+    //Проверяем приемы
 
     public function smena($uid, $auto = false, $lastdie = false): int|string
     {
@@ -1823,7 +1824,7 @@ JS;
         return 1;
     }
 
-    //Проверяем приемы
+    //Приемы которые используются моментально
 
     public function testActions(): void
     {
@@ -2039,7 +2040,7 @@ JS;
         }
     }
 
-    //Приемы которые используются моментально
+    //Приемы которые используются моментально (в конце хода)
 
     private function botAtack($uid, $pl, $tp): void
     {
@@ -2102,7 +2103,7 @@ JS;
         }
     }
 
-    //Приемы которые используются моментально (в конце хода)
+    //Используем приемы
 
     public function startAtack($id): void
     {
@@ -2293,40 +2294,22 @@ JS;
             $i++;
         }
         //Обновляем задержки предметов
-        mysql_query(
-            'UPDATE `items_users` SET `btl_zd` = `btl_zd` - 1 WHERE (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '") AND `btl_zd` > 0 AND `inOdet` > 0 LIMIT 100'
-        );
-        mysql_query(
-            'UPDATE `users` SET `notrhod` = "-1" WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" OR `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 2'
-        );
+        Db::sql('update items_users set btl_zd = btl_zd - 1 where (uid = ? or uid = ?) and btl_zd > 0 and inOdet > 0', [$this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']]);
+        Db::sql('update users set notrhod = -1 where id = ? or id = ?', [$this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']]);
 
-        //Обновляем задержки пирожков
-        mysql_query(
-            'UPDATE `pirogi` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->i->id . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'
-        );
-        mysql_query(
-            'UPDATE `tactic` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->i->id . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'
-        );
+        //Обновляем задержки заклинаний, пирогов, тактик
+        Db::sql('update pirogi set hod = hod - 1 where btl = ? and (uid = ? or uid = ?)', [$this->i->id, $this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']]);
+        Db::sql('update tactic set hod = hod - 1 where btl = ? and (uid = ? or uid = ?)', [$this->i->id, $this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']]);
+        Db::sql('update spells set hod = hod - 1 where btl = ? and (uid = ? or uid = ?)', [$this->i->id, $this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']]);
 
-        //Тактики
-        mysql_query('DELETE FROM `pirogi` WHERE `btl` = "' . $this->i->id . '" AND `hod` < 1');
-        mysql_query('DELETE FROM `tactic` WHERE `btl` = "' . $this->i->id . '" AND `hod` < 1');
-
-        //Обновляем задержки пирожков
-        mysql_query(
-            'UPDATE `spells` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->i->id . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'
-        );
-        mysql_query('DELETE FROM `spells` WHERE `btl` = "' . $this->i->id . '" AND `hod` < 1');
+        Db::sql('delete from pirogi where btl = ? and hod < 1', [$this->i->id]);
+        Db::sql('delete from tactic where btl = ? and hod < 1', [$this->i->id]);
+        Db::sql('delete from spells where btl = ? and hod < 1', [$this->i->id]);
 
         //Обновляем данные в battle_users
-        mysql_query(
-            'UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow'] . '"
-                WHERE `battle` = "' . $this->i->id . '" AND `uid` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'
-        );
-        mysql_query(
-            'UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow'] . '"
-                WHERE `battle` = "' . $this->i->id . '" AND `uid` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'
-        );
+        Db::sql('update battle_users set hp = ? where battle = ? and uid = ?', [$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow'], $this->i->id, $this->atacks[$id]['uid1']]);
+        Db::sql('update battle_users set hp = ? where battle = ? and uid = ?', [$this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow'], $this->i->id, $this->atacks[$id]['uid2']]);
+
         //Восстановление манны 25% от мудрости за ход
 
         if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) {
@@ -2466,10 +2449,10 @@ JS;
                                 $pvr['mpSee'] = '--';
                             }
 
-                            $btl->stats[$btl->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow'];
-                            $btl->users[$btl->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow'];
+                            $this->stats[$this->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow'];
+                            $this->users[$this->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow'];
                             mysql_query(
-                                'UPDATE `stats` SET `mpNow` = "' . $btl->stats[$btl->uids[$pvr['uid']]]['mpNow'] . '" WHERE `id` = "' . $pvr['uid'] . '" LIMIT 1'
+                                'UPDATE `stats` SET `mpNow` = "' . $this->stats[$this->uids[$pvr['uid']]]['mpNow'] . '" WHERE `id` = "' . $pvr['uid'] . '" LIMIT 1'
                             );
 
                             $pvr['text'] = $this->addlt(1, 21, $this->users[$this->uids[$pvr['uid']]]['sex']);
@@ -2572,44 +2555,9 @@ JS;
             }
             $j++;
         }
-        //Проверяем
-        if (Config::get('propsk_die') > 0 && $this->i->razdel == 0 && $this->i->dnId == 0 && $this->i->izlom == 0) {
-            $cn1 = mysql_fetch_array(
-                mysql_query(
-                    'SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->i->id . '" AND `uid1` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'
-                )
-            );
-            $cn2 = mysql_fetch_array(
-                mysql_query(
-                    'SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->i->id . '" AND `uid1` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'
-                )
-            );
-            if ($cn1[0] > 3) {
-                $pvr['text2'] = '{tm1} Персонаж {u1} был убит из-за большого количества пропусков хода.';
-                $this->priemAddLog(
-                    $id, 1, 2, $this->atacks[$id]['uid1'], 0, '',
-                    $pvr['text2'],
-                    $this->hodID
-                );
-                unset($pvr);
-                mysql_query(
-                    'UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'
-                );
-            }
-            if ($cn2[0] > Config::get('propsk_die')) {
-                $pvr['text2'] = '{tm1} Персонаж {u1} был убит из-за большого количества пропусков хода.';
-                $this->priemAddLog(
-                    $id, 1, 2, $this->atacks[$id]['uid2'], 0, '',
-                    $pvr['text2'],
-                    $this->hodID
-                );
-                unset($pvr);
-                mysql_query(
-                    'UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'
-                );
-            }
-        }
-        //
+
+        $this->deathByTimeout($id);
+
         //Обновляем текущего противника
         if ($u->info['id'] == $this->atacks[$id]['uid1']) {
             $u->info['enemy'] = $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'];
@@ -2629,14 +2577,12 @@ JS;
         mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $id . '" LIMIT 1');
     }
 
-    //Используем приемы
-
     /** Осторожно! Подключаются файлы!!!
      * @param           $pl
      * @param           $u1
-     * @param int       $t
+     * @param int $t
      * @param int|array $u2
-     * @param string    $rznm
+     * @param string $rznm
      * @return void
      */
     public function delPriem(
@@ -2645,7 +2591,8 @@ JS;
         int $t = 1,
         int|array $u2 = 0,
         string $rznm = 'Очиститься Кровью'
-    ): void {
+    ): void
+    {
         global $u, $priem;
         if (!isset($pl['priem']['id']) || isset($this->del_val['eff'][$pl['priem']['id']])) {
             return;
@@ -2704,6 +2651,12 @@ JS;
 
     //Повторная проверка приемов
 
+    /**
+     * Расчет количества блоков и противников?
+     * @param $uid
+     * @param $uid2
+     * @return void
+     */
     private function testZonb($uid, $uid2): void
     {
         $zba = [];
@@ -2778,8 +2731,8 @@ JS;
 
     //Проверка действия приема
 
-
     /**
+     * Магия предметов?
      * Осторожно! Подключаются файлы!!!
      * @param int $uid1
      * @param int $uid2 НЕ УДАЛЯТЬ!!!
@@ -2801,19 +2754,100 @@ JS;
                 continue;
             }
             if ($end > 0) {
-                if (file_exists('priems/' . $e['bm_a1'] . '.end.php')) {
-                    require_once 'priems/' . $e['bm_a1'] . '.end.php';
-                }
-            } else {
-                if (file_exists('priems/' . $e['bm_a1'] . '.php')) {
-                    require_once 'priems/' . $e['bm_a1'] . '.php';
-                }
+                $e['bm_a1'] .= '.end';
+            }
+            if (file_exists('priems/' . $e['bm_a1'] . '.php')) {
+                require_once 'priems/' . $e['bm_a1'] . '.php';
             }
         }
     }
 
     //Проверка урона приемов
 
+    private function newRazmen($id): array
+    {
+        $uid1 = $this->atacks[$id]['uid1'];
+        $uid2 = $this->atacks[$id]['uid2'];
+
+        if ($this->atacks[$id]['out1'] == 0) {
+            $at[1] = $this->usersTestAtack($id, $uid1, $uid2);
+        } else {
+            $at[1] = [0];
+        }
+        if ($this->atacks[$id]['out2'] == 0) {
+            $at[2] = $this->usersTestAtack($id, $uid2, $uid1);
+        } else {
+            $at[2] = [0];
+        }
+
+        return $at;
+    }
+
+    private function usersTestAtack($id, $uid1, $uid2): array
+    {
+        $r = [];
+        $block = [0, 0, 0, 0, 0, 0,];
+
+        //Проверка блоков
+        $i = 1;
+        if ($uid1 == $this->atacks[$id]['uid1']) {
+            $a = 2;
+            $j = $this->atacks[$id]['b2'];
+            $atack = [
+                0,
+                $this->atacks[$id]['a1'][0],
+                $this->atacks[$id]['a1'][1],
+                $this->atacks[$id]['a1'][2],
+                $this->atacks[$id]['a1'][3],
+                $this->atacks[$id]['a1'][4],
+            ];
+        } elseif ($uid2 == $this->atacks[$id]['uid1']) {
+            $a = 1;
+            $j = $this->atacks[$id]['b1'];
+            $atack = [
+                0,
+                $this->atacks[$id]['a2'][0],
+                $this->atacks[$id]['a2'][1],
+                $this->atacks[$id]['a2'][2],
+                $this->atacks[$id]['a2'][3],
+                $this->atacks[$id]['a2'][4],
+            ];
+        }
+
+        if (isset($a, $j) && $this->atacks[$id]['out' . $a] == 0) {
+            while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) {
+                $block[$j] = 1;
+                $j++;
+                if ($j > 5 || $j < 1) {
+                    $j = 1;
+                }
+                $i++;
+            }
+        }
+
+        //Проверка ударов
+        for ($i = 1; $i <= $this->stats[$this->uids[$uid1]]['zona']; $i++) {
+            if (!isset($atack[$i]) || $atack[$i] == 0) {
+                $atack[$i] = rand(1, 5);
+            }
+            if ($atack[$i] > 0) {
+                if ($block[$atack[$i]] == 1) {
+                    //удар был заблокирован
+                    // КУДА БИЛ , ТИП УДАРА
+                    $r['atack'][] = [$atack[$i], 3, 0];
+                } else {
+                    //Удар прошел
+                    // КУДА БИЛ , ТИП УДАРА
+                    $r['atack'][] = [$atack[$i], 1, 0];
+                }
+            }
+        }
+
+        return $r;
+    }
+
+    //Наносим удар между игроками
+
     public function priemsRazmen(array|int $id, array|string $at): void
     {
         if ($at == 'fast') {
@@ -2928,625 +2962,6 @@ JS;
         }
     }
 
-    //Наносим удар между игроками
-
-    private function newRazmen($id): array
-    {
-        $uid1 = $this->atacks[$id]['uid1'];
-        $uid2 = $this->atacks[$id]['uid2'];
-
-        if ($this->atacks[$id]['out1'] == 0) {
-            $at[1] = $this->usersTestAtack($id, $uid1, $uid2);
-        } else {
-            $at[1] = [0];
-        }
-        if ($this->atacks[$id]['out2'] == 0) {
-            $at[2] = $this->usersTestAtack($id, $uid2, $uid1);
-        } else {
-            $at[2] = [0];
-        }
-
-        return $at;
-    }
-
-    private function usersTestAtack($id, $uid1, $uid2): array
-    {
-        $r = [];
-        $block = [0, 0, 0, 0, 0, 0,];
-
-        //Проверка блоков
-        $i = 1;
-        if ($uid1 == $this->atacks[$id]['uid1']) {
-            $a = 2;
-            $j = $this->atacks[$id]['b2'];
-            $atack = [
-                0,
-                $this->atacks[$id]['a1'][0],
-                $this->atacks[$id]['a1'][1],
-                $this->atacks[$id]['a1'][2],
-                $this->atacks[$id]['a1'][3],
-                $this->atacks[$id]['a1'][4],
-            ];
-        } elseif ($uid2 == $this->atacks[$id]['uid1']) {
-            $a = 1;
-            $j = $this->atacks[$id]['b1'];
-            $atack = [
-                0,
-                $this->atacks[$id]['a2'][0],
-                $this->atacks[$id]['a2'][1],
-                $this->atacks[$id]['a2'][2],
-                $this->atacks[$id]['a2'][3],
-                $this->atacks[$id]['a2'][4],
-            ];
-        }
-
-        if (isset($a, $j) && $this->atacks[$id]['out' . $a] == 0) {
-            while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) {
-                $block[$j] = 1;
-                $j++;
-                if ($j > 5 || $j < 1) {
-                    $j = 1;
-                }
-                $i++;
-            }
-        }
-
-        //Проверка ударов
-        for ($i = 1; $i <= $this->stats[$this->uids[$uid1]]['zona']; $i++) {
-            if (!isset($atack[$i]) || $atack[$i] == 0) {
-                $atack[$i] = rand(1, 5);
-            }
-            if ($atack[$i] > 0) {
-                if ($block[$atack[$i]] == 1) {
-                    //удар был заблокирован
-                    // КУДА БИЛ , ТИП УДАРА
-                    $r['atack'][] = [$atack[$i], 3, 0];
-                } else {
-                    //Удар прошел
-                    // КУДА БИЛ , ТИП УДАРА
-                    $r['atack'][] = [$atack[$i], 1, 0];
-                }
-            }
-        }
-
-        return $r;
-    }
-
-    public function yhod_user($uid1, $uid2, $type)
-    {
-        // 1 - кто бьет .  2 - в кого бьют . тип
-        //Удал летит прямо в противника
-        if ($this->importUser == 0) {
-            $r = $uid1;
-            $rand_user = false;
-            if ($type == 2) {
-                //Случайный персонаж из своей команды (в том числе игрок)
-                $i = 0;
-                while ($i < count($this->users)) {
-                    if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team']) {
-                        $rand_user[] = $this->users[$i]['id'];
-                    }
-                    $i++;
-                }
-            } elseif ($type == 4) {
-                //Случайный персонаж, любой
-                $i = 0;
-                while ($i < count($this->users)) {
-                    $rand_user[] = $this->users[$i]['id'];
-                    $i++;
-                }
-            } elseif ($type == 5) {
-                //Случайный персонаж, любой (кроме игрока)
-                $i = 0;
-                while ($i < count($this->users)) {
-                    if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team'] && $uid2 != $this->users[$i]['id']) {
-                        $rand_user[] = $this->users[$i]['id'];
-                    }
-                    $i++;
-                }
-            } elseif ($type == 6) {
-                //Случайный персонаж из команды противника
-                $i = 0;
-                while ($i < count($this->users)) {
-                    if ($this->users[$i]['team'] != $this->users[$this->uids[$uid2]]['team']) {
-                        $rand_user[] = $this->users[$i]['id'];
-                    }
-                    $i++;
-                }
-            } elseif ($type > 100) {
-                //Удар идет в конкретного игрока
-                if (!isset($this->users[$this->uids[$type]]) || $this->users[$this->uids[$type]]['id'] != $type) {
-                    $r = $uid2;
-                } else {
-                    $r = $type;
-                }
-            }
-            if (!empty($rand_user)) {
-                $r = $rand_user[rand(0, (count($rand_user) - 1))];
-            }
-            $this->importUser = $r;
-        } else {
-            $r = $this->importUser;
-        }
-        return $r;
-    }
-
-
-    public function testRazmenblock1($id, $uid1, $uid2): bool
-    {
-        //перенести в Battle/Razmen.
-
-        $block = [];
-        $j = 0;
-
-        //Проверка блоков
-        $i = 1;
-
-        if ($uid1 == $this->atacks[$id]['uid1']) {
-            $j = $this->atacks[$id]['b2'];
-        } elseif ($uid2 == $this->atacks[$id]['uid1']) {
-            $j = $this->atacks[$id]['b1'];
-        }
-
-        if ($this->atacks[$id]['out2'] == 0) {
-            while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) {
-                $block[$j] = 1;
-                $j++;
-                if ($j > 5 || $j < 1) {
-                    $j = 1;
-                }
-                $i++;
-            }
-        }
-
-        return !empty($block);
-    }
-
-
-    //Расчет типа удара от оружия
-    //Расчет урона от оружия
-
-    public function yronGetrazmen($uid1, $uid2, $witm): array
-    {
-        // перенести в Battle/Razmen
-
-
-        /**
-         * Определяем тип урона
-         * Колющий
-         * Рубящий
-         * Режущий
-         * Дробящий
-         */
-
-        $witm_data = Conversion::dataStringToArray($witm['data']);
-        $witm_type = $this->weaponTx($witm_data);
-
-        if ($witm_type == 0 || $witm_type == 12) {
-            $witm_type2 = '';
-        } else {
-            $witm_type2 = $witm_type;
-        }
-        $r['t'] = $witm_type2;
-
-        //Увеличиваем параметры от текущего оружия которым бьем
-        $iii = 1;
-        while ($iii <= 7) {
-            if (isset($witm_data['sv_a' . $iii]) && $witm_data['sv_a' . $iii] != 0) {
-                $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_a' . $iii];
-            }
-            if (isset($witm_data['sv_mg' . $iii]) && $witm_data['sv_mg' . $iii] != 0) {
-                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mg' . $iii];
-            }
-            $iii++;
-        }
-        $iii = 1;
-        while ($iii <= 4) {
-            if (isset($witm_data['sv_aall']) && $witm_data['sv_aall'] != 0) {
-                $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_aall'];
-            }
-            $iii++;
-        }
-        $iii = 1;
-        while ($iii <= 4) {
-            if (isset($witm_data['sv_mall']) && $witm_data['sv_mall'] != 0) {
-                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mall'];
-            }
-            $iii++;
-        }
-        $iii = 1;
-        while ($iii <= 7) {
-            if (isset($witm_data['sv_m2all']) && $witm_data['sv_m2all'] != 0) {
-                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_m2all'];
-            }
-            $iii++;
-        }
-
-        if (isset($witm_data['sv_m3']) && $witm_data['sv_m3'] != 0) {
-            $this->stats[$this->uids[$uid1]]['m3'] += $witm_data['sv_m3'];
-        }
-
-        $iii = 1;
-        while ($iii <= 7) {
-            if (isset($witm_data['sv_pa' . $iii]) && $witm_data['sv_pa' . $iii] != 0) {
-                $this->stats[$this->uids[$uid1]]['pa' . $iii] += $witm_data['sv_pa' . $iii] + $witm_data['sv_m10'];
-            }
-            if (isset($witm_data['sv_pm' . $iii]) && $witm_data['sv_pm' . $iii] != 0) {
-                $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_pm' . $iii] + $witm_data['sv_m11a'];
-                if ($iii < 5) {
-                    $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_m11'];
-                }
-            }
-            $iii++;
-        }
-
-        //мощность + подавление мощности противником
-        $wAp = 0;
-
-        if ($witm_type == 12) {
-            //удар кулаком
-            $wAp += $this->stats[$this->uids[$uid1]]['m10'];
-        } elseif ($witm_type < 5) {
-            $wAp += $this->stats[$this->uids[$uid1]]['pa' . $witm_type];
-            $wAp -= $this->stats[$this->uids[$uid2]]['antpa' . $witm_type];
-        } else {
-            $wAp +=
-                $this->stats[$this->uids[$uid1]]['m10'] +
-                $this->stats[$this->uids[$uid1]]['pm' . ($witm_type - 4)] +
-                $this->stats[$this->uids[$uid1]]['m11a'] +
-                $witm_data['sv_pm' . ($witm_type - 4)];
-
-            $wAp -= $this->stats[$this->uids[$uid2]]['antpm' . ($witm_type - 4)];
-        }
-
-        //Пробой брони
-        $proboi = 0;
-        $witm_data['m9'] = $this->stats[$this->uids[$uid1]]['m9'];
-        if (rand(1, 100) < floor($witm_data['m9'] / 2)) {
-            $proboi = floor($witm_data['m9'] / 2);
-            $r['pb'] = 1;
-        }
-
-        $y = $this->yrn(
-            $this->stats[$this->uids[$uid1]],
-            $this->stats[$this->uids[$uid2]],
-            $this->users[$this->uids[$uid1]],
-            $this->users[$this->uids[$uid2]],
-            $witm_type,
-            $wAp, //мощность урона
-            $proboi, //пробой брони
-            ($witm_data['sv_yron_min'] + $this->stats[$this->uids[$uid1]]['yron_min']),
-            ($witm_data['sv_yron_max'] + $this->stats[$this->uids[$uid1]]['yron_max']),
-            $witm['type'],
-        );
-
-        $r['y'] = round(rand($y['min'] + $proboi, $y['max'] + round($proboi / 2)));
-        $r['k'] = round(rand($y['Kmin'] + round($proboi / 4), $y['Kmax'] + round($proboi / 8)));
-
-        $r['m_y'] = $y['max'];
-        $r['m_k'] = $y['Kmax'];
-
-        $r['bRND'] = $y['bRND'];
-
-        $r['w_type'] = $witm_type;
-
-        //тип от оружия
-        $tp = match ($witm['type']) {
-            18 => 1,
-            19 => 2,
-            20 => 3,
-            21 => 4,
-            default => 0
-        };
-
-        if ($tp != $witm_type) // ТУТ
-        {
-            (int)$r['y'] = round((int)$r['y'] / 3);
-            $r['k'] = round($r['k'] / 3);
-            $r['m_k'] = round($r['m_k'] / 3);
-            $r['m_y'] = round($r['m_y'] / 3);
-        }
-
-        if (isset($this->stats[$this->uids[$uid2]]['zaproc'])) {
-            $r['y'] = round($r['y'] - $r['y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
-            $r['k'] = round($r['k'] - $r['k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
-            $r['m_k'] = round($r['m_k'] - $r['m_k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
-            $r['m_y'] = round($r['m_y'] - $r['m_y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
-            if ($r['k'] < 1) {
-                $r['k'] = 2;
-            }
-        }
-
-        $r['y'] = max($r['y'], 1);
-        $r['k'] = max($r['k'], 1);
-        $r['m_y'] = max($r['m_y'], 1);
-        $r['m_k'] = max($r['m_k'], 1);
-
-        return $r;
-    }
-
-    //Расчет урона от оружия
-
-    public function weaponTx($itemdata)
-    {
-        $itm = is_array($itemdata) ? $itemdata : Conversion::dataStringToArray($itemdata);
-
-        $t[0]['z'] = 0;
-        $t[0]['t'] = 0;
-        //колящий урон
-        $t[1]['z'] = (int)$itm['tya1'];
-        $t[1]['t'] = 1;
-        //рубящий урон
-        $t[2]['z'] = (int)$itm['tya2'];
-        $t[2]['t'] = 2;
-        //дробящий урон
-        $t[3]['z'] = (int)$itm['tya3'];
-        $t[3]['t'] = 3;
-        //режущий урон
-        $t[4]['z'] = (int)$itm['tya4'];
-        $t[4]['t'] = 4;
-        //урон огня
-        $t[5]['z'] = (int)$itm['tym1'];
-        $t[5]['t'] = 5;
-        //урон воздуха
-        $t[6]['z'] = (int)$itm['tym2'];
-        $t[6]['t'] = 6;
-        //урон воды
-        $t[7]['z'] = (int)$itm['tym3'];
-        $t[7]['t'] = 7;
-        //урон земли
-        $t[8]['z'] = (int)$itm['tym4'];
-        $t[8]['t'] = 8;
-        //урон серой магией
-        $t[11]['z'] = (int)$itm['tym7'];
-        $t[11]['t'] = 11;
-
-        $tpt = $t[0]['z'];
-        $tpmin = $t[0];
-        $tpmax = $t[0];
-        $i = 1;
-        $ii = 0;
-
-        while ($i <= 11) {
-            if ($t[$i]['z'] > $tpt) {
-                $tpt = $t[$i]['z'];
-                $tpmax = $t[$i];
-                $ii = $i;
-            }
-            $i++;
-        }
-        $t[$ii]['z'] = 0;
-
-        $tpt = $t[0]['z'];
-        $i = 1;
-        while ($i <= 11) {
-            if ($t[$i]['z'] > $tpt) {
-                $tpt = $t[$i]['z'];
-                $tpmin = $t[$i];
-            }
-            $i++;
-        }
-
-        $setclass = rand(1, 100);
-
-        if ($setclass > $tpmax['z']) {
-            $tp = $tpmin['t'];
-        } else {
-            $tp = $tpmax['t'];
-        }
-
-        return $tp;
-    }
-
-
-    //Расчет защиты
-
-    public function yrn(
-        array $st1,
-        array $st2,
-        array $u1,
-        array $u2,
-        int   $type,
-        int   $power_yron = 0,
-        float $proboi = 0,
-        int   $weapom_min = 0,
-        int   $weapom_max = 0,
-        int   $wp_type = 0,
-    ): array {
-
-        $level = $st1['lvl'];
-        $power_krit = round($st1['m3']);
-
-        if (!isset($type) || $type == '') {
-            $type = 12;
-        }
-
-        //Параметры для возврвата
-        $r = ['type' => $type];
-        $p = [
-            'B' => [0 => 0, 1 => 0, 'rnd' => false],
-            'M' => $power_yron, //мощность урона
-            'K' => $power_krit, //мощность крита
-            'T' => 1,   //Кф. оружия
-        ];
-
-        //Расчет типа урона
-
-        if ($wp_type == 18) {
-            $r['type'] = 1;
-        } elseif ($wp_type == 19) {
-            $r['type'] = 2;
-        } elseif ($wp_type == 20) {
-            $r['type'] = 3;
-        } elseif ($wp_type == 21) {
-            $r['type'] = 4;
-        }
-
-        /**
-         * (S) - влияние наших статов на профильный урон
-         * 1 Колющий: S = Сила * 0,3 + Ловкость * 0,7
-         * 2 Рубящий: S = Сила * 0,5 + Ловкость * 0,25 + Интуиция * 0,25
-         * 3 Дробящий: S = Сила * 1
-         * 4 Режущий: S = Сила * 0,3 + Интуиция * 0,7
-         * else кулак/магия
-         */
-        if ($r['type'] == 1) {
-            $p['S'] = $st1['s1'] * 0.25 + $st1['s2'] * 0.75;
-            $p['U'] = $st1['a1'] * 1.00; //кинжалы
-        } elseif ($r['type'] == 2) {
-            $p['S'] = $st1['s1'] * 1.20;
-            $p['U'] = $st1['a2'] * 1.00; //топоры
-        } elseif ($r['type'] == 3) {
-            $p['S'] = $st1['s1'] * 0.5 + $st1['s4'] * 1.00;
-            $p['U'] = $st1['a3'] * 1.00; //дубины
-        } elseif ($r['type'] == 4) {
-            $p['S'] = $st1['s3'] * 1.00;
-            $p['U'] = $st1['a4'] * 1.00; //мечи
-        } else {
-            $p['S'] = 0;
-            $p['U'] = 0;
-        }
-
-        $r['bron']['rnd'] = rand($r['bron'][0], $r['bron'][1]);
-
-        //Остальные расчеты	 (коэфицент)
-        $p['B'][0] = 2 + $level + $st1['s1'] - round($st1['s1'] / 5);
-        $p['B'][1] = $p['B'][0] + 3;
-        $p['B']['rnd'] = rand($p['B'][0], $p['B'][1]);
-
-        //Обычный урон
-        if ($r['type'] == 12) {
-            $r['min'] = ($p['B'][0] + $weapom_min) * $p['T'] * (1 + $p['M'] / 100);
-            $r['max'] = ($p['B'][1] + $weapom_max) * $p['T'] * (1 + $p['M'] / 100);
-        } else {
-            $r['min'] = (($p['B'][0] + $p['S'] * 2 + $weapom_min * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
-            $r['max'] = (($p['B'][1] + $p['S'] * 2 + $weapom_max * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
-        }
-
-        $r['bRND'] = $p['B']['rnd'];
-        $r['Kmin'] = ceil((2 + ($p['K'] / 100)) * $r['min']);
-        $r['Kmax'] = ceil((2 + ($p['K'] / 100)) * $r['max']);
-
-        //Расчет брони
-        //для обычного
-        if ($r['type'] < 5 || $r['type'] == 12) {
-            $r['min_abron'] = round($r['min'] * 0.05);
-            $r['max_abron'] = round($r['max'] * 0.05);
-            if ($proboi != 0) {
-                $r['bron']['rndold'] = $r['bron']['rnd'];
-                $r['bron']['rnd'] = 0;
-            }
-            $r['Kmin'] -= $r['bron']['rnd'] * 2; //было умножить на 2
-            $r['Kmax'] -= $r['bron']['rnd'] * 2; //было умножить на 2
-            $r['min'] -= $r['bron']['rnd']; //не было деления ни на чо.
-            $r['max'] -= $r['bron']['rnd']; //не было деления ни на чо.
-        }
-
-        //Расчет защиты (не более 80%)
-        if ($r['type'] < 5 || $r['type'] == 12) {
-            $r['min'] = round($r['min'] / 100 * (100 - $this->zago($st2['za'])));
-            $r['max'] = round($r['max'] / 100 * (100 - $this->zago($st2['za'])));
-            $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zago($st2['za'])));
-            $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zago($st2['za'])));
-        } else {
-            $r['min'] = round($r['min'] / 100 * (100 - $this->zmgo($st2['zm'])));
-            $r['max'] = round($r['max'] / 100 * (100 - $this->zmgo($st2['zm'])));
-            $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zmgo($st2['zm'])));
-            $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zmgo($st2['zm'])));
-        }
-
-        $r['min'] = round($r['min']);
-        $r['max'] = round($r['max']);
-        $r['Kmin'] = round($r['Kmin']);
-        $r['Kmax'] = round($r['Kmax']);
-
-        $min_yrn = 0; //%
-
-        if ($u1['clone'] > 0) {
-            $min_yrn = 75;
-        }
-
-        $r['min'] -= floor($r['min'] / 100 * $min_yrn);
-        $r['max'] -= floor($r['max'] / 100 * $min_yrn);
-        $r['Kmin'] -= floor($r['Kmin'] / 100 * ($min_yrn));
-        $r['Kmax'] -= floor($r['Kmax'] / 100 * ($min_yrn));
-        $r['min_'] -= floor($r['min_'] / 100 * $min_yrn);
-        $r['max_'] -= floor($r['max_'] / 100 * $min_yrn);
-        $r['Kmin_'] -= floor($r['Kmin_'] / 100 * ($min_yrn));
-        $r['Kmax_'] -= floor($r['Kmax_'] / 100 * ($min_yrn));
-
-        $defd = mysql_fetch_array(
-            mysql_query(
-                'SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->i->id . '" AND `vars` = "use_defteam' . $u2['team'] . '" LIMIT 1'
-            )
-        );
-        if ($defd[0] > 100) {
-            $defd[0] = 100;
-        }
-        $defd = 0 + $defd[0];
-        $powd = mysql_fetch_array(
-            mysql_query(
-                'SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->i->id . '" AND `vars` = "use_powteam' . $u1['team'] . '" LIMIT 1'
-            )
-        );
-        if ($powd[0] > 100) {
-            $powd[0] = 100;
-        }
-        $powd = 0 + $powd[0];
-        $defd = $defd - $powd;
-
-        $r['min'] -= floor($defd);
-        $r['max'] -= floor($defd);
-        $r['Kmin'] -= floor($defd * 2);
-        $r['Kmax'] -= floor($defd * 2);
-        $r['min_'] -= floor($defd);
-        $r['max_'] -= floor($defd);
-        $r['Kmin_'] -= floor($defd * 2);
-        $r['Kmax_'] -= floor($defd * 2);
-        $r['min'] += $st1['maxAtack'];
-        $r['max'] += $st1['maxAtack'];
-        $r['Kmin'] += $st1['maxAtack'] * 2;
-        $r['Kmin'] += $st1['maxAtack'] * 2;
-
-        if ($r['min'] < 1) {
-            $r['min'] = 1;
-        }
-        if ($r['max'] < 1) {
-            $r['max'] = 1;
-        }
-        if ($r['Kmin'] < 2) {
-            $r['Kmin'] = 2;
-        }
-        if ($r['Kmax'] < 2) {
-            $r['Kmax'] = 2;
-        }
-        if ($r['Kmin_'] < 2) {
-            $r['Kmin_'] = 2;
-        }
-        if ($r['Kmin_'] < 2) {
-            $r['Kmax_'] = 2;
-        }
-
-        $r['m_k'] = $r['Kmax'];
-
-        return $r;
-    }
-
-    //Расчет защиты (магия)
-
-    private function zago($v): float
-    {
-        if ($v > 1700) {
-            $v = 1700;
-        }
-        return round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2);
-    }
-
-    public function zmgo($v): float|int
-    {
-        return (1 - (pow(0.5, ($v / 250)))) * 100;
-    }
-
     /** Осторожно! Подключаются файлы!!!
      * @param $id
      * @param $at
@@ -3705,6 +3120,10 @@ JS;
         return $at;
     }
 
+
+    //Расчет типа удара от оружия
+    //Расчет урона от оружия
+
     public function testPogB($uid, $yr, $pliid, $test = 0)
     {
         $yr2 = $yr;
@@ -3803,6 +3222,14 @@ JS;
         return $yr2;
     }
 
+    //Расчет урона от оружия
+
+    /**
+     * Обновляем НР и добавляем тактики?
+     * @param $id
+     * @param $at
+     * @return array
+     */
     private function updateHealth($id, $at): array
     {
 
@@ -3958,7 +3385,69 @@ JS;
         return $at;
     }
 
-    //Расчет МФ
+
+    //Расчет защиты
+
+    public function yhod_user($uid1, $uid2, $type)
+    {
+        // 1 - кто бьет .  2 - в кого бьют . тип
+        //Удал летит прямо в противника
+        if ($this->importUser == 0) {
+            $r = $uid1;
+            $rand_user = false;
+            if ($type == 2) {
+                //Случайный персонаж из своей команды (в том числе игрок)
+                $i = 0;
+                while ($i < count($this->users)) {
+                    if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team']) {
+                        $rand_user[] = $this->users[$i]['id'];
+                    }
+                    $i++;
+                }
+            } elseif ($type == 4) {
+                //Случайный персонаж, любой
+                $i = 0;
+                while ($i < count($this->users)) {
+                    $rand_user[] = $this->users[$i]['id'];
+                    $i++;
+                }
+            } elseif ($type == 5) {
+                //Случайный персонаж, любой (кроме игрока)
+                $i = 0;
+                while ($i < count($this->users)) {
+                    if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team'] && $uid2 != $this->users[$i]['id']) {
+                        $rand_user[] = $this->users[$i]['id'];
+                    }
+                    $i++;
+                }
+            } elseif ($type == 6) {
+                //Случайный персонаж из команды противника
+                $i = 0;
+                while ($i < count($this->users)) {
+                    if ($this->users[$i]['team'] != $this->users[$this->uids[$uid2]]['team']) {
+                        $rand_user[] = $this->users[$i]['id'];
+                    }
+                    $i++;
+                }
+            } elseif ($type > 100) {
+                //Удар идет в конкретного игрока
+                if (!isset($this->users[$this->uids[$type]]) || $this->users[$this->uids[$type]]['id'] != $type) {
+                    $r = $uid2;
+                } else {
+                    $r = $type;
+                }
+            }
+            if (!empty($rand_user)) {
+                $r = $rand_user[rand(0, (count($rand_user) - 1))];
+            }
+            $this->importUser = $r;
+        } else {
+            $r = $this->importUser;
+        }
+        return $r;
+    }
+
+    //Расчет защиты (магия)
 
     /**
      * Добавляем опыт \ нанесенный урон.
@@ -4245,8 +3734,7 @@ JS;
                         $mas['text'] .= '{u1} пропустил свой ход.';
                         //Проверка сброс туманок
                         mysql_query(
-                            'UPDATE `eff_users` SET `delete` = "' . time(
-                            ) . '" WHERE `uid` = "' . $u1 . '" AND `delete` = 0 AND `v1` = "priem" AND (`v2`=288 OR  `v2`=287 OR `v2`=286 OR `v2`=273) LIMIT 1'
+                            'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u1 . '" AND `delete` = 0 AND `v1` = "priem" AND (`v2`=288 OR  `v2`=287 OR `v2`=286 OR `v2`=273) LIMIT 1'
                         );
                     }
                 }
@@ -4536,7 +4024,6 @@ JS;
         }
     }
 
-
     public function addlt($a, int $id, int $s, $rnd = null): string
     {
         if ($rnd === null) {
@@ -4546,8 +4033,6 @@ JS;
         return '{' . $a . 'x' . $id . 'x' . $rnd . '}';
     }
 
-    //Действия бота (атака)
-
     public function spaCheck($u1): void
     {
         global $u;
@@ -4609,7 +4094,7 @@ JS;
             $mas['text'] = '{tm1} <strong>' . $this->stats[$this->uids[$u1]]['login'] . '</strong> убит...<strong>' . $this->stats[$this->uids[$u1]]['login'] . '</strong> был спасен. ';
 
             $this->priemAddLog(
-                $id, 1, 2, $u->info['id'], $u1,
+                324, 1, 2, $u->info['id'], $u1,
                 ' ',
                 $mas['text'],
                 $this->hodID
@@ -4620,7 +4105,7 @@ JS;
             $this->users[$this->uids[$u1]]['hpNow'] = 0;
             $mas['text'] = '{tm1} <strong>' . $this->stats[$this->uids[$u1]]['login'] . '</strong> погиб.';
             $this->priemAddLog(
-                $id, 1, 2, $u->info['id'], $u1,
+                324, 1, 2, $u->info['id'], $u1,
                 ' ',
                 $mas['text'],
                 ($this->hodID + 1)
@@ -4635,8 +4120,6 @@ JS;
         }
     }
 
-    //Проверяем удары, приемы, свитки, зверей
-
     public function priemAddLog(
         $id,
         $a,
@@ -4648,7 +4131,8 @@ JS;
         $hodID,
         $tm1 = 0,
         $tm2 = 0
-    ): void {
+    ): void
+    {
         $time = time();
         if ($tm1 == 0) {
             $tm1 = isset($this->atacks[$id]) ? $this->atacks[$id]['time'] : $time;
@@ -4682,8 +4166,14 @@ JS;
         $this->add_log($mas);
     }
 
-    //Действия бота
+    //Расчет МФ
 
+    /**
+     * Возращаем зоны блока?
+     * @param $uid1
+     * @param $uid2
+     * @return void
+     */
     private function restZonb($uid1, $uid2): void
     {
         if ($this->stnZbVs[$uid1] > 0) {
@@ -4694,15 +4184,11 @@ JS;
         }
     }
 
-    //получаем данные о поединке
-
     private function save_stats($uid): void
     {
         Stats::saveBattleStats($this->stats[$this->uids[$uid]], $uid);
     }
 
-    //наносим удар противнику
-
     /** Осторожно! Подключаются файлы!!!
      * @param $id
      * @param $at
@@ -4762,7 +4248,47 @@ JS;
         }
     }
 
-    //выделяем пользователей
+    public static function get(int $id): array
+    {
+        $result = Db::getRow('select * from battle where id = ?', [$id]);
+        return $result ?: [];
+    }
+
+    //Действия бота (атака)
+
+    /**
+     * Смерть от пропуска ходов. Включается в конфиге.
+     * @param int $id
+     * @return void
+     */
+    private function deathByTimeout(int $id): void
+    {
+        if (Config::get('propsk_die') <= 0 || $this->i->razdel != 0 || $this->i->dnId != 0 || $this->i->izlom != 0) {
+            return;
+        }
+
+        $cn1 = Db::getValue('select count(*) from battle_out where battle = ? and uid1 = ?', [$this->i->id, $this->atacks[$id]['uid1']]);
+        $cn2 = Db::getValue('select count(*) from battle_out where battle = ? and uid1 = ?', [$this->i->id, $this->atacks[$id]['uid2']]);
+
+        if ($cn1 > 3) {
+            $this->priemAddLog(
+                $id, 1, 2, $this->atacks[$id]['uid1'], 0, '',
+                '{tm1} Персонаж {u1} был убит из-за большого количества пропусков хода.',
+                $this->hodID
+            );
+            Db::sql('update stats set hpNow = 0 where id = ?', [$this->atacks[$id]['uid1']]);
+        }
+        if ($cn2 > Config::get('propsk_die')) {
+            $this->priemAddLog(
+                $id, 1, 2, $this->atacks[$id]['uid2'], 0, '',
+                '{tm1} Персонаж {u1} был убит из-за большого количества пропусков хода.',
+                $this->hodID
+            );
+            Db::sql('update stats set hpNow = 0 where id = ?', [$this->atacks[$id]['uid2']]);
+        }
+    }
+
+    //Проверяем удары, приемы, свитки, зверей
 
     private function addNewAtack(User $u): void
     {
@@ -4848,7 +4374,7 @@ JS;
 
     }
 
-    //Возращаем зоны блока по умолчанию
+    //Действия бота
 
     private function botAct($uid): bool
     {
@@ -4865,9 +4391,484 @@ JS;
         return $r;
     }
 
+    //получаем данные о поединке
+
+    public function testRazmenblock1($id, $uid1, $uid2): bool
+    {
+        //перенести в Battle/Razmen.
+
+        $block = [];
+        $j = 0;
+
+        //Проверка блоков
+        $i = 1;
+
+        if ($uid1 == $this->atacks[$id]['uid1']) {
+            $j = $this->atacks[$id]['b2'];
+        } elseif ($uid2 == $this->atacks[$id]['uid1']) {
+            $j = $this->atacks[$id]['b1'];
+        }
+
+        if ($this->atacks[$id]['out2'] == 0) {
+            while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) {
+                $block[$j] = 1;
+                $j++;
+                if ($j > 5 || $j < 1) {
+                    $j = 1;
+                }
+                $i++;
+            }
+        }
+
+        return !empty($block);
+    }
+
+    //наносим удар противнику
+
+    public function yronGetrazmen($uid1, $uid2, $witm): array
+    {
+        // перенести в Battle/Razmen
+
+
+        /**
+         * Определяем тип урона
+         * Колющий
+         * Рубящий
+         * Режущий
+         * Дробящий
+         */
+
+        $witm_data = Conversion::dataStringToArray($witm['data']);
+        $witm_type = $this->weaponTx($witm_data);
+
+        if ($witm_type == 0 || $witm_type == 12) {
+            $witm_type2 = '';
+        } else {
+            $witm_type2 = $witm_type;
+        }
+        $r['t'] = $witm_type2;
+
+        //Увеличиваем параметры от текущего оружия которым бьем
+        $iii = 1;
+        while ($iii <= 7) {
+            if (isset($witm_data['sv_a' . $iii]) && $witm_data['sv_a' . $iii] != 0) {
+                $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_a' . $iii];
+            }
+            if (isset($witm_data['sv_mg' . $iii]) && $witm_data['sv_mg' . $iii] != 0) {
+                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mg' . $iii];
+            }
+            $iii++;
+        }
+        $iii = 1;
+        while ($iii <= 4) {
+            if (isset($witm_data['sv_aall']) && $witm_data['sv_aall'] != 0) {
+                $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_aall'];
+            }
+            $iii++;
+        }
+        $iii = 1;
+        while ($iii <= 4) {
+            if (isset($witm_data['sv_mall']) && $witm_data['sv_mall'] != 0) {
+                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mall'];
+            }
+            $iii++;
+        }
+        $iii = 1;
+        while ($iii <= 7) {
+            if (isset($witm_data['sv_m2all']) && $witm_data['sv_m2all'] != 0) {
+                $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_m2all'];
+            }
+            $iii++;
+        }
+
+        if (isset($witm_data['sv_m3']) && $witm_data['sv_m3'] != 0) {
+            $this->stats[$this->uids[$uid1]]['m3'] += $witm_data['sv_m3'];
+        }
+
+        $iii = 1;
+        while ($iii <= 7) {
+            if (isset($witm_data['sv_pa' . $iii]) && $witm_data['sv_pa' . $iii] != 0) {
+                $this->stats[$this->uids[$uid1]]['pa' . $iii] += $witm_data['sv_pa' . $iii] + $witm_data['sv_m10'];
+            }
+            if (isset($witm_data['sv_pm' . $iii]) && $witm_data['sv_pm' . $iii] != 0) {
+                $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_pm' . $iii] + $witm_data['sv_m11a'];
+                if ($iii < 5) {
+                    $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_m11'];
+                }
+            }
+            $iii++;
+        }
+
+        //мощность + подавление мощности противником
+        $wAp = 0;
+
+        if ($witm_type == 12) {
+            //удар кулаком
+            $wAp += $this->stats[$this->uids[$uid1]]['m10'];
+        } elseif ($witm_type < 5) {
+            $wAp += $this->stats[$this->uids[$uid1]]['pa' . $witm_type];
+            $wAp -= $this->stats[$this->uids[$uid2]]['antpa' . $witm_type];
+        } else {
+            $wAp +=
+                $this->stats[$this->uids[$uid1]]['m10'] +
+                $this->stats[$this->uids[$uid1]]['pm' . ($witm_type - 4)] +
+                $this->stats[$this->uids[$uid1]]['m11a'] +
+                $witm_data['sv_pm' . ($witm_type - 4)];
+
+            $wAp -= $this->stats[$this->uids[$uid2]]['antpm' . ($witm_type - 4)];
+        }
+
+        //Пробой брони
+        $proboi = 0;
+        $witm_data['m9'] = $this->stats[$this->uids[$uid1]]['m9'];
+        if (rand(1, 100) < floor($witm_data['m9'] / 2)) {
+            $proboi = floor($witm_data['m9'] / 2);
+            $r['pb'] = 1;
+        }
+
+        $y = $this->yrn(
+            $this->stats[$this->uids[$uid1]],
+            $this->stats[$this->uids[$uid2]],
+            $this->users[$this->uids[$uid1]],
+            $this->users[$this->uids[$uid2]],
+            $witm_type,
+            $wAp, //мощность урона
+            $proboi, //пробой брони
+            ($witm_data['sv_yron_min'] + $this->stats[$this->uids[$uid1]]['yron_min']),
+            ($witm_data['sv_yron_max'] + $this->stats[$this->uids[$uid1]]['yron_max']),
+            $witm['type'],
+        );
+
+        $r['y'] = round(rand($y['min'] + $proboi, $y['max'] + round($proboi / 2)));
+        $r['k'] = round(rand($y['Kmin'] + round($proboi / 4), $y['Kmax'] + round($proboi / 8)));
+
+        $r['m_y'] = $y['max'];
+        $r['m_k'] = $y['Kmax'];
+
+        $r['bRND'] = $y['bRND'];
+
+        $r['w_type'] = $witm_type;
+
+        //тип от оружия
+        $tp = match ($witm['type']) {
+            18 => 1,
+            19 => 2,
+            20 => 3,
+            21 => 4,
+            default => 0
+        };
+
+        if ($tp != $witm_type) // ТУТ
+        {
+            (int)$r['y'] = round((int)$r['y'] / 3);
+            $r['k'] = round($r['k'] / 3);
+            $r['m_k'] = round($r['m_k'] / 3);
+            $r['m_y'] = round($r['m_y'] / 3);
+        }
+
+        if (isset($this->stats[$this->uids[$uid2]]['zaproc'])) {
+            $r['y'] = round($r['y'] - $r['y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
+            $r['k'] = round($r['k'] - $r['k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
+            $r['m_k'] = round($r['m_k'] - $r['m_k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
+            $r['m_y'] = round($r['m_y'] - $r['m_y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100);
+            if ($r['k'] < 1) {
+                $r['k'] = 2;
+            }
+        }
+
+        $r['y'] = max($r['y'], 1);
+        $r['k'] = max($r['k'], 1);
+        $r['m_y'] = max($r['m_y'], 1);
+        $r['m_k'] = max($r['m_k'], 1);
+
+        return $r;
+    }
+
+    //выделяем пользователей
+
+    public function weaponTx($itemdata)
+    {
+        $itm = is_array($itemdata) ? $itemdata : Conversion::dataStringToArray($itemdata);
+
+        $t[0]['z'] = 0;
+        $t[0]['t'] = 0;
+        //колящий урон
+        $t[1]['z'] = (int)$itm['tya1'];
+        $t[1]['t'] = 1;
+        //рубящий урон
+        $t[2]['z'] = (int)$itm['tya2'];
+        $t[2]['t'] = 2;
+        //дробящий урон
+        $t[3]['z'] = (int)$itm['tya3'];
+        $t[3]['t'] = 3;
+        //режущий урон
+        $t[4]['z'] = (int)$itm['tya4'];
+        $t[4]['t'] = 4;
+        //урон огня
+        $t[5]['z'] = (int)$itm['tym1'];
+        $t[5]['t'] = 5;
+        //урон воздуха
+        $t[6]['z'] = (int)$itm['tym2'];
+        $t[6]['t'] = 6;
+        //урон воды
+        $t[7]['z'] = (int)$itm['tym3'];
+        $t[7]['t'] = 7;
+        //урон земли
+        $t[8]['z'] = (int)$itm['tym4'];
+        $t[8]['t'] = 8;
+        //урон серой магией
+        $t[11]['z'] = (int)$itm['tym7'];
+        $t[11]['t'] = 11;
+
+        $tpt = $t[0]['z'];
+        $tpmin = $t[0];
+        $tpmax = $t[0];
+        $i = 1;
+        $ii = 0;
+
+        while ($i <= 11) {
+            if ($t[$i]['z'] > $tpt) {
+                $tpt = $t[$i]['z'];
+                $tpmax = $t[$i];
+                $ii = $i;
+            }
+            $i++;
+        }
+        $t[$ii]['z'] = 0;
+
+        $tpt = $t[0]['z'];
+        $i = 1;
+        while ($i <= 11) {
+            if ($t[$i]['z'] > $tpt) {
+                $tpt = $t[$i]['z'];
+                $tpmin = $t[$i];
+            }
+            $i++;
+        }
+
+        $setclass = rand(1, 100);
+
+        if ($setclass > $tpmax['z']) {
+            $tp = $tpmin['t'];
+        } else {
+            $tp = $tpmax['t'];
+        }
+
+        return $tp;
+    }
+
+    //Возращаем зоны блока по умолчанию
+
+    public function yrn(
+        array $st1,
+        array $st2,
+        array $u1,
+        array $u2,
+        int   $type,
+        int   $power_yron = 0,
+        float $proboi = 0,
+        int   $weapom_min = 0,
+        int   $weapom_max = 0,
+        int   $wp_type = 0,
+    ): array
+    {
+
+        $level = $st1['lvl'];
+        $power_krit = round($st1['m3']);
+
+        if (!isset($type) || $type == '') {
+            $type = 12;
+        }
+
+        //Параметры для возврвата
+        $r = ['type' => $type];
+        $p = [
+            'B' => [0 => 0, 1 => 0, 'rnd' => false],
+            'M' => $power_yron, //мощность урона
+            'K' => $power_krit, //мощность крита
+            'T' => 1,   //Кф. оружия
+        ];
+
+        //Расчет типа урона
+
+        if ($wp_type == 18) {
+            $r['type'] = 1;
+        } elseif ($wp_type == 19) {
+            $r['type'] = 2;
+        } elseif ($wp_type == 20) {
+            $r['type'] = 3;
+        } elseif ($wp_type == 21) {
+            $r['type'] = 4;
+        }
+
+        /**
+         * (S) - влияние наших статов на профильный урон
+         * 1 Колющий: S = Сила * 0,3 + Ловкость * 0,7
+         * 2 Рубящий: S = Сила * 0,5 + Ловкость * 0,25 + Интуиция * 0,25
+         * 3 Дробящий: S = Сила * 1
+         * 4 Режущий: S = Сила * 0,3 + Интуиция * 0,7
+         * else кулак/магия
+         */
+        if ($r['type'] == 1) {
+            $p['S'] = $st1['s1'] * 0.25 + $st1['s2'] * 0.75;
+            $p['U'] = $st1['a1'] * 1.00; //кинжалы
+        } elseif ($r['type'] == 2) {
+            $p['S'] = $st1['s1'] * 1.20;
+            $p['U'] = $st1['a2'] * 1.00; //топоры
+        } elseif ($r['type'] == 3) {
+            $p['S'] = $st1['s1'] * 0.5 + $st1['s4'] * 1.00;
+            $p['U'] = $st1['a3'] * 1.00; //дубины
+        } elseif ($r['type'] == 4) {
+            $p['S'] = $st1['s3'] * 1.00;
+            $p['U'] = $st1['a4'] * 1.00; //мечи
+        } else {
+            $p['S'] = 0;
+            $p['U'] = 0;
+        }
+
+        $r['bron']['rnd'] = rand($r['bron'][0], $r['bron'][1]);
+
+        //Остальные расчеты	 (коэфицент)
+        $p['B'][0] = 2 + $level + $st1['s1'] - round($st1['s1'] / 5);
+        $p['B'][1] = $p['B'][0] + 3;
+        $p['B']['rnd'] = rand($p['B'][0], $p['B'][1]);
+
+        //Обычный урон
+        if ($r['type'] == 12) {
+            $r['min'] = ($p['B'][0] + $weapom_min) * $p['T'] * (1 + $p['M'] / 100);
+            $r['max'] = ($p['B'][1] + $weapom_max) * $p['T'] * (1 + $p['M'] / 100);
+        } else {
+            $r['min'] = (($p['B'][0] + $p['S'] * 2 + $weapom_min * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
+            $r['max'] = (($p['B'][1] + $p['S'] * 2 + $weapom_max * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
+        }
+
+        $r['bRND'] = $p['B']['rnd'];
+        $r['Kmin'] = ceil((2 + ($p['K'] / 100)) * $r['min']);
+        $r['Kmax'] = ceil((2 + ($p['K'] / 100)) * $r['max']);
+
+        //Расчет брони
+        //для обычного
+        if ($r['type'] < 5 || $r['type'] == 12) {
+            $r['min_abron'] = round($r['min'] * 0.05);
+            $r['max_abron'] = round($r['max'] * 0.05);
+            if ($proboi != 0) {
+                $r['bron']['rndold'] = $r['bron']['rnd'];
+                $r['bron']['rnd'] = 0;
+            }
+            $r['Kmin'] -= $r['bron']['rnd'] * 2; //было умножить на 2
+            $r['Kmax'] -= $r['bron']['rnd'] * 2; //было умножить на 2
+            $r['min'] -= $r['bron']['rnd']; //не было деления ни на чо.
+            $r['max'] -= $r['bron']['rnd']; //не было деления ни на чо.
+        }
+
+        //Расчет защиты (не более 80%)
+        if ($r['type'] < 5 || $r['type'] == 12) {
+            $r['min'] = round($r['min'] / 100 * (100 - $this->zago($st2['za'])));
+            $r['max'] = round($r['max'] / 100 * (100 - $this->zago($st2['za'])));
+            $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zago($st2['za'])));
+            $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zago($st2['za'])));
+        } else {
+            $r['min'] = round($r['min'] / 100 * (100 - $this->zmgo($st2['zm'])));
+            $r['max'] = round($r['max'] / 100 * (100 - $this->zmgo($st2['zm'])));
+            $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zmgo($st2['zm'])));
+            $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zmgo($st2['zm'])));
+        }
+
+        $r['min'] = round($r['min']);
+        $r['max'] = round($r['max']);
+        $r['Kmin'] = round($r['Kmin']);
+        $r['Kmax'] = round($r['Kmax']);
+
+        $min_yrn = 0; //%
+
+        if ($u1['clone'] > 0) {
+            $min_yrn = 75;
+        }
+
+        $r['min'] -= floor($r['min'] / 100 * $min_yrn);
+        $r['max'] -= floor($r['max'] / 100 * $min_yrn);
+        $r['Kmin'] -= floor($r['Kmin'] / 100 * ($min_yrn));
+        $r['Kmax'] -= floor($r['Kmax'] / 100 * ($min_yrn));
+        $r['min_'] -= floor($r['min_'] / 100 * $min_yrn);
+        $r['max_'] -= floor($r['max_'] / 100 * $min_yrn);
+        $r['Kmin_'] -= floor($r['Kmin_'] / 100 * ($min_yrn));
+        $r['Kmax_'] -= floor($r['Kmax_'] / 100 * ($min_yrn));
+
+        $defd = mysql_fetch_array(
+            mysql_query(
+                'SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->i->id . '" AND `vars` = "use_defteam' . $u2['team'] . '" LIMIT 1'
+            )
+        );
+        if ($defd[0] > 100) {
+            $defd[0] = 100;
+        }
+        $defd = 0 + $defd[0];
+        $powd = mysql_fetch_array(
+            mysql_query(
+                'SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->i->id . '" AND `vars` = "use_powteam' . $u1['team'] . '" LIMIT 1'
+            )
+        );
+        if ($powd[0] > 100) {
+            $powd[0] = 100;
+        }
+        $powd = 0 + $powd[0];
+        $defd = $defd - $powd;
+
+        $r['min'] -= floor($defd);
+        $r['max'] -= floor($defd);
+        $r['Kmin'] -= floor($defd * 2);
+        $r['Kmax'] -= floor($defd * 2);
+        $r['min_'] -= floor($defd);
+        $r['max_'] -= floor($defd);
+        $r['Kmin_'] -= floor($defd * 2);
+        $r['Kmax_'] -= floor($defd * 2);
+        $r['min'] += $st1['maxAtack'];
+        $r['max'] += $st1['maxAtack'];
+        $r['Kmin'] += $st1['maxAtack'] * 2;
+        $r['Kmin'] += $st1['maxAtack'] * 2;
+
+        if ($r['min'] < 1) {
+            $r['min'] = 1;
+        }
+        if ($r['max'] < 1) {
+            $r['max'] = 1;
+        }
+        if ($r['Kmin'] < 2) {
+            $r['Kmin'] = 2;
+        }
+        if ($r['Kmax'] < 2) {
+            $r['Kmax'] = 2;
+        }
+        if ($r['Kmin_'] < 2) {
+            $r['Kmin_'] = 2;
+        }
+        if ($r['Kmin_'] < 2) {
+            $r['Kmax_'] = 2;
+        }
+
+        $r['m_k'] = $r['Kmax'];
+
+        return $r;
+    }
+
     //проверка блока (Визуальная)
     //проверка блока
 
+    private function zago($v): float
+    {
+        if ($v > 1700) {
+            $v = 1700;
+        }
+        return round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2);
+    }
+
+    //генерируем команды
+
+    public function zmgo($v): float|int
+    {
+        return (1 - (pow(0.5, ($v / 250)))) * 100;
+    }
+
     public function addAtack(): void
     {
         global $js;
@@ -4906,8 +4907,6 @@ JS;
         $js .= 'testClearZone();';
     }
 
-    //генерируем команды
-
     public function teamsTake(User $u): void
     {
         if ($this->i->id < 1) {
@@ -5050,154 +5049,8 @@ JS;
         $this->i->setStart1();
     }
 
-    private function addstatuser($uid): void
-    {
-        if ($uid <= 0) {
-            return;
-        }
-
-        $id = $this->uids[$uid];
-
-        if (empty($this->stats[$id]['hp'])) {
-            $this->stats[$id]['hp'] = $this->stats[$id]['hpNow'];
-        }
-        Db::sql(
-            'insert into battle_users (battle,uid,time_enter,login,level,align,clan,hpall,hp,hpstart,team) values (?,?,unix_timestamp(),?,?,?,?,?,?,?,?)',
-            [
-                $this->i->id,
-                $uid,
-                $this->users[$id]['login'],
-                $this->users[$id]['level'],
-                $this->users[$id]['align'],
-                $this->users[$id]['clan'],
-                $this->stats[$id]['hpAll'],
-                $this->stats[$id]['hp'],
-                $this->stats[$id]['hpNow'],
-                $this->users[$id]['team'],
-            ]
-        );
-    }
-
-    public function testZonbVis()
-    {
-        global $u;
-        if ($this->stnZbVs == 0) {
-            $zb = $this->stats[$this->uids[$u->info['id']]]['zonb'];
-            $this->stnZbVs = $zb;
-        } else {
-            $zb = $this->stnZb;
-        }
-        $eu = $this->users[$this->uids[$u->info['id']]]['enemy'];
-        if ($zb > 3) {
-            $zb = 3;
-        }
-        if (
-            $eu != 0 &&
-            (
-                $this->stats[$this->uids[$eu]]['weapon1'] == 1 ||
-                $this->stats[$this->uids[$eu]]['weapon2'] == 1
-            ) &&
-            $this->stats[$this->uids[$u->info['id']]]['weapon1'] != 1 &&
-            $this->stats[$this->uids[$u->info['id']]]['weapon2'] != 1
-        ) {
-            $zb -= 1;
-        }
-        if ($zb < 1) {
-            $zb = 1;
-        }
-        return $zb;
-    }
-
-    ///----Спасение функция
-
-    public function genTeams($you): string
-    {
-        $ret = '';
-        $teams = [];
-        //выделяем пользователей
-        $i = 0;
-        $j = 1;
-        $tms = [];
-        $teams[$this->users[$this->uids[$you]]['team']] = '';
-        $tms[0] = $this->users[$this->uids[$you]]['team'];
-        while ($i < count($this->uids)) {
-            if ($this->stats[$i]['hpNow'] > 0) {
-                if (!isset($teams[$this->users[$i]['team']])) {
-                    $tms[$j] = $this->users[$i]['team'];
-                    $j++;
-                }
-                if ($this->stats[$i]['hpNow'] < 0) {
-                    $this->stats[$i]['hpNow'] = 0;
-                }
-                if ($this->stats[$i]['hpAll'] < $this->stats[$i]['hpNow']) {
-                    $this->stats[$i]['hpNow'] = $this->stats[$i]['hpAll'];
-                }
-
-                // Цветная метка тем, кто вылетел за таймаут в 15 минут?
-                $a1ms = '';
-                $actcolor = '';
-                $actstyle = '';
-                $actid = 0;
-
-                if (!empty($this->ga[$this->users[$i]['id']][$you])) {
-                    $actid = $this->ga[$this->users[$i]['id']][$you];
-                    $actcolor = 'red';
-                    $actstyle = 'underline';
-                } elseif (!empty($this->ag[$this->users[$i]['id']][$you])) {
-                    $actid = $this->ag[$this->users[$i]['id']][$you];
-                    $actcolor = 'green';
-                    $actstyle = 'overline';
-                }
-
-                if (!empty($actid)) {
-                    $ac = Db::getRow('select id, time from battle_act where id = ?', [$actid]);
-                    if ($ac['id'] && $ac['time'] + $this->i->timeout - 15 < time()) {
-                        $a1ms = " color: $actcolor;";
-                    }
-                    $a1ms = "style='text-decoration: $actstyle';$a1ms";
-                }
-
-                if ($this->users[$i]['login2'] == '') {
-                    $this->users[$i]['login2'] = $this->users[$i]['login'];
-                }
-                if ($this->users[$i]['align'] == 9) {
-                    $this->stats[$i]['hpNow'] = $this->stats[$i]['hpNow'] / ($this->stats[$i]['hpAll'] / 100);
-                    $this->stats[$i]['hpAll'] = '100%';
-                }
-                $ldr = '';
-                if ($this->users[$i]['lider'] == $this->i->id) {
-                    $ldr = '<img title=Лидер&nbsp;группы src=//img.new-combats.tech/i/lead' . $this->users[$i]['team'] . '.gif>';
-                }
-                $teams[$this->users[$i]['team']] .= ', ' . $ldr . '<span ' . $a1ms . ' class=\"CSSteam' . $this->users[$i]['team'] . '\" onClick=\"chat.addto(\'' . $this->users[$i]['login2'] . '\',\'to\'); return false;\" oncontextmenu=\"top.infoMenu(\'' . $this->users[$i]['login2'] . '\',event,\'main\'); return false;\">' . $this->users[$i]['login2'] . '</span><small> [' . floor(
-                        $this->stats[$i]['hpNow']
-                    ) . '/' . $this->stats[$i]['hpAll'] . ']</small>';
-            }
-            $i++;
-        }
-
-        //генерируем команды
-        $i = 0;
-        while ($i < count($tms)) {
-            $teams[$tms[$i]] = ltrim($teams[$tms[$i]], ', ');
-            if ($teams[$tms[$i]] != '') {
-                $teams[$tms[$i]] = '<img src=\"//img.new-combats.tech/i/lock3.gif\" style=\"cursor:pointer\" onClick=\"chat.addto(\'team' . $tms[$i] . '\',\'private\'); return false;\"> ' . $teams[$tms[$i]];
-                $ret .= $teams[$tms[$i]];
-                if (count($tms) > $i + 1) {
-                    $ret .= ' <span class=\"CSSvs\">&nbsp; против &nbsp;</span> ';
-                }
-            }
-            $i++;
-        }
-        return 'genteam("' . $ret . '");';
-    }
-
-    public function setIBotsValue($key, $value): void
-    {
-        $this->iBots[$key] = $value;
-    }
-
     /**
-     * @param int  $i
+     * @param int $i
      * @return void
      */
     private function addAnimalBuff(int $i): void
@@ -5310,28 +5163,148 @@ JS;
         Log::addComment($this);
     }
 
-    /**
-     * @param int|null $experience
-     * @param bool     $hardcore поединок с гарантированной травмой
-     * @return array|int[]
-     */
-    public static function getType(?int $experience, bool $hardcore = false): array
+    private function addstatuser($uid): void
     {
-        return match (true) {
-            $experience >= 5000000 => [150, 150, 'Судный День', 'Судный День'],
-            $experience >= 2500000 => [100, 125, 'Эпохальная Битва', 'Кровавое Побоище'],
-            $experience >= 1000000 => [75, 100, 'Историческая Битва', 'Кровавая Сеча'],
-            $experience >= 500000 => [50, 75, 'Величайшая Битва', 'Кровавая Резня'],
-            $experience >= 100000 => [25, 50, 'Великая Битва', 'Кровавая Битва'],
-            $hardcore => [150, 150, 'Жесточайшее Сражение', 'Жесточайшее Сражение'],
-            default => [0, 0, 'Поединок', 'Кровавый Поединок'],
-        };
+        if ($uid <= 0) {
+            return;
+        }
+
+        $id = $this->uids[$uid];
+
+        if (empty($this->stats[$id]['hp'])) {
+            $this->stats[$id]['hp'] = $this->stats[$id]['hpNow'];
+        }
+        Db::sql(
+            'insert into battle_users (battle,uid,time_enter,login,level,align,clan,hpall,hp,hpstart,team) values (?,?,unix_timestamp(),?,?,?,?,?,?,?,?)',
+            [
+                $this->i->id,
+                $uid,
+                $this->users[$id]['login'],
+                $this->users[$id]['level'],
+                $this->users[$id]['align'],
+                $this->users[$id]['clan'],
+                $this->stats[$id]['hpAll'],
+                $this->stats[$id]['hp'],
+                $this->stats[$id]['hpNow'],
+                $this->users[$id]['team'],
+            ]
+        );
     }
 
-    public static function get(int $id): array
+    public function testZonbVis()
     {
-        $result = Db::getRow('select * from battle where id = ?', [$id]);
-        return $result ?: [];
+        global $u;
+        if ($this->stnZbVs == 0) {
+            $zb = $this->stats[$this->uids[$u->info['id']]]['zonb'];
+            $this->stnZbVs = $zb;
+        } else {
+            $zb = $this->stnZb;
+        }
+        $eu = $this->users[$this->uids[$u->info['id']]]['enemy'];
+        if ($zb > 3) {
+            $zb = 3;
+        }
+        if (
+            $eu != 0 &&
+            (
+                $this->stats[$this->uids[$eu]]['weapon1'] == 1 ||
+                $this->stats[$this->uids[$eu]]['weapon2'] == 1
+            ) &&
+            $this->stats[$this->uids[$u->info['id']]]['weapon1'] != 1 &&
+            $this->stats[$this->uids[$u->info['id']]]['weapon2'] != 1
+        ) {
+            $zb -= 1;
+        }
+        if ($zb < 1) {
+            $zb = 1;
+        }
+        return $zb;
+    }
+
+    public function genTeams($you): string
+    {
+        $ret = '';
+        $teams = [];
+        //выделяем пользователей
+        $i = 0;
+        $j = 1;
+        $tms = [];
+        $teams[$this->users[$this->uids[$you]]['team']] = '';
+        $tms[0] = $this->users[$this->uids[$you]]['team'];
+        while ($i < count($this->uids)) {
+            if ($this->stats[$i]['hpNow'] > 0) {
+                if (!isset($teams[$this->users[$i]['team']])) {
+                    $tms[$j] = $this->users[$i]['team'];
+                    $j++;
+                }
+                if ($this->stats[$i]['hpNow'] < 0) {
+                    $this->stats[$i]['hpNow'] = 0;
+                }
+                if ($this->stats[$i]['hpAll'] < $this->stats[$i]['hpNow']) {
+                    $this->stats[$i]['hpNow'] = $this->stats[$i]['hpAll'];
+                }
+
+                // Цветная метка тем, кто вылетел за таймаут в 15 минут?
+                $a1ms = '';
+                $actcolor = '';
+                $actstyle = '';
+                $actid = 0;
+
+                if (!empty($this->ga[$this->users[$i]['id']][$you])) {
+                    $actid = $this->ga[$this->users[$i]['id']][$you];
+                    $actcolor = 'red';
+                    $actstyle = 'underline';
+                } elseif (!empty($this->ag[$this->users[$i]['id']][$you])) {
+                    $actid = $this->ag[$this->users[$i]['id']][$you];
+                    $actcolor = 'green';
+                    $actstyle = 'overline';
+                }
+
+                if (!empty($actid)) {
+                    $ac = Db::getRow('select id, time from battle_act where id = ?', [$actid]);
+                    if ($ac['id'] && $ac['time'] + $this->i->timeout - 15 < time()) {
+                        $a1ms = " color: $actcolor;";
+                    }
+                    $a1ms = "style='text-decoration: $actstyle';$a1ms";
+                }
+
+                if ($this->users[$i]['login2'] == '') {
+                    $this->users[$i]['login2'] = $this->users[$i]['login'];
+                }
+                if ($this->users[$i]['align'] == 9) {
+                    $this->stats[$i]['hpNow'] = $this->stats[$i]['hpNow'] / ($this->stats[$i]['hpAll'] / 100);
+                    $this->stats[$i]['hpAll'] = '100%';
+                }
+                $ldr = '';
+                if ($this->users[$i]['lider'] == $this->i->id) {
+                    $ldr = '<img title=Лидер&nbsp;группы src=//img.new-combats.tech/i/lead' . $this->users[$i]['team'] . '.gif>';
+                }
+                $teams[$this->users[$i]['team']] .= ', ' . $ldr . '<span ' . $a1ms . ' class=\"CSSteam' . $this->users[$i]['team'] . '\" onClick=\"chat.addto(\'' . $this->users[$i]['login2'] . '\',\'to\'); return false;\" oncontextmenu=\"top.infoMenu(\'' . $this->users[$i]['login2'] . '\',event,\'main\'); return false;\">' . $this->users[$i]['login2'] . '</span><small> [' . floor(
+                        $this->stats[$i]['hpNow']
+                    ) . '/' . $this->stats[$i]['hpAll'] . ']</small>';
+            }
+            $i++;
+        }
+
+        //генерируем команды
+        $i = 0;
+        while ($i < count($tms)) {
+            $teams[$tms[$i]] = ltrim($teams[$tms[$i]], ', ');
+            if ($teams[$tms[$i]] != '') {
+                $teams[$tms[$i]] = '<img src=\"//img.new-combats.tech/i/lock3.gif\" style=\"cursor:pointer\" onClick=\"chat.addto(\'team' . $tms[$i] . '\',\'private\'); return false;\"> ' . $teams[$tms[$i]];
+                $ret .= $teams[$tms[$i]];
+                if (count($tms) > $i + 1) {
+                    $ret .= ' <span class=\"CSSvs\">&nbsp; против &nbsp;</span> ';
+                }
+            }
+            $i++;
+        }
+        return 'genteam("' . $ret . '");';
+    }
+
+    public function setIBotsValue($key, $value): void
+    {
+        $this->iBots[$key] = $value;
     }
 
 
diff --git a/_incl_data/class/Priems.php b/_incl_data/class/Priems.php
index 8a21afb5..bd604070 100644
--- a/_incl_data/class/Priems.php
+++ b/_incl_data/class/Priems.php
@@ -1376,9 +1376,9 @@ class Priems
         return $r;
     }
 
-    public function testpriem($pl, $t = 1, $o = 0)
+    private function testpriem($pl, $t = 1, $o = 0): int
     {
-        global $c, $u, $code, $btl;
+        global $btl;
         $tr = Conversion::dataStringToArray($pl['tr']);
         $d2 = Conversion::dataStringToArray($pl['date2']);
         $x = 1;
@@ -2100,118 +2100,79 @@ class Priems
 
     public function getTechniquesInfo(?int $id = null): array
     {
+        # SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . $id . '" LIMIT 1
+
         if (isset($id)) {
-            return Db::getRow(
-                'select * from techniques_categories left join  priems on techniques_categories.technique_id = priems.id 
-                                        where priems.level <= ? and priems.activ > 0 and priems.id = ? order by priems.img,priems.level', [User::start()->info['level'], $id]
-            );
+            return Db::getRow('select * from priems where level <= ? and activ > 0 and id = ? order by img,level', [$this->u->info['level'], $id]);
+//            return Db::getRow(
+//                'select * from techniques_categories left join  priems on techniques_categories.technique_id = priems.id
+//                                        where priems.level <= ? and priems.activ > 0 and priems.id = ? order by priems.img,priems.level', [User::start()->info['level'], $id]
+//            );
         }
 
-        return Db::getRows(
-            'select * from techniques_categories left join  priems on techniques_categories.technique_id = priems.id 
-                                    where priems.level <= ? and priems.activ > 0 order by priems.img,priems.level', [User::start()->info['level']]
-        );
+        return Db::getRows('select * from priems where level <= ? and activ > 0 order by img,level', [$this->u->info['level']]);
+//        return Db::getRows(
+//            'select * from techniques_categories left join  priems on techniques_categories.technique_id = priems.id
+//                                    where priems.level <= ? and priems.activ > 0 order by priems.img,priems.level', [User::start()->info['level']]
+//        );
     }
 
-    public function seeMy($t)
+
+    public function seeMyPriems(): void
     {
-        global $btl;
         $i = 0;
         $p = explode('|', $this->u->info['priems']);
-        $lvar = '';
         $pr = '';
+        $all = (int)$_GET['all'];
         while ($i < $this->u->info['priemslot']) {
             if ($p[$i] > 0) {
-                $pl = mysql_fetch_assoc(
-                    mysql_query(
-                        'SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . mysql_real_escape_string(
-                            $p[$i]
-                        ) . '" LIMIT 1'
-                    )
-                );
-                $lvar = $this->priemInfo($pl, $t, $i);
-                $pz = $lvar[1];
+                $pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]);
+                $lvar = $this->priemInfo($pl, $i);
                 $lvar = $lvar[0];
-                if ($t == 1) {
-                    if (isset($_GET['inv'])) {
-                        $cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"';
-                    } else {
-                        $cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&unuse_priem=' . $i . '&rz=4&p_raz=\' + p_raz"';
-                    }
-                } else {
-                    if ($pl['type'] == 1) {
-                        //моментально
-                        if ($pl['onUser'] == 1) {
-                            $oninuser = '';
-                            if ($pl['team'] == 1) {
-                                if ($this->u->info['login2'] != '') {
-                                    $oninuser = $this->u->info['login2'];
-                                } else {
-                                    $oninuser = $this->u->info['login'];
-                                }
-                            } else {
-                                if ($btl->users[$btl->uids[$this->u->info['enemy']]]['login2'] != '') {
-                                    $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login2'];
-                                } else {
-                                    $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login'];
-                                }
-                            }
-                            $cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl['name'] . '\',\'' . $oninuser . '\',\'' . $pl['img'] . '\');"';
-                            unset($oninuser);
-                        } else {
-                            $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
-                        }
-                    } elseif ($pl['type'] == 2) {
-                        //длительное
-                        $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
-                    } elseif ($pl['type'] == 3) {
-                        $cl = 'href="javascript:void(0);" onClick="alert(\'Возможно используем?\');"';
-                    }
-                }
-
-
-                $notr = $this->testpriem($pl, $t);
-
-
-                $cl2 = '';
-                $cli2 = '';
-                if ((($pz[$i] > 0 || $notr > 0) && $t == 2) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) {
-                    $cli2 = ' class="nopriemuse" ';
-                }
-
-                $pr .= '<a onMouseOver="top.hi(this,\'<b>' . $pl['name'] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" ' . $cl . '><img ' . $cli2 . ' style="margin-top:3px; ' . $cl2 . ' margin-left:4px;" src="//img.new-combats.tech/i/eff/' . $pl['img'] . '.gif" width="55" height="35" /></a>';
-            } else {
 
                 if (isset($_GET['inv'])) {
-                    $pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" width="55" height="35" /></a>';
+                    $cl = "location.href='/main.php?all=$all&skills=1&rz=4&p_raz=all'";
                 } else {
-                    $pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" width="55" height="35" />';
+                    $cl = "location.href='/main.php?all=$all&skills=1&unuse_priem=$i&rz=4&p_raz=' + p_raz";
                 }
+                $cl = 'onclick="' . $cl . '"';
 
+                $cli2 = '';
+                if ((isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || isset($this->u->stats['notuse_last_pr']) && $this->u->stats['notuse_last_pr'] == $pl['id']) {
+                    $cli2 = ' class="nopriemuse" ';
+                }
+                /// ТУТ!
+                $priemName = $pl['name'];
+                $priemImg = $pl['img'];
+                $pr .= <<<HTML
+                <a onmouseover="let a = `<b>$priemName</b><br>$lvar`; top.hi(this,a,event,3,0,1,1,'width: 240px;')" onmouseout="top.hic();" onmousedown="top.hic();" href="javascript:void(0)" $cl>
+                    <img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
+                </a>
+                HTML;
+
+            } elseif (isset($_GET['inv'])) {
+                $pr .= <<<HTML
+                    <a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href='/main.php?all=$all&skills=1&rz=4&p_raz=all'">
+                        <img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">
+                    </a>
+                HTML;
+
+            } else {
+                $pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">';
             }
             $i++;
         }
-        if ($this->u->info['animal'] > 0 && $t == 2) {
-            $use_lst = $this->u->testAction(
-                '`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
-                1
-            );
-            if (!isset($use_lst['id'])) {
-                $cl2 = '';
-                $pr .= '<a onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" href="javascript:void(0);" onClick="usepriem(100500,1,\'\');"><img style="margin-top:1px; ' . $cl2 . ' margin-left:3px;" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" /></a>';
-            } else {
-                $cl2 = '" class="nopriemuse';
-                $pr .= '<img onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:1px; margin-left:2px;' . $cl2 . '" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" />';
-            }
-        }
-        if ($t == 1) {
-            echo '<div>' . $pr . '</div>';
-        } elseif ($t == 2) {
-            return str_replace('"', '\\"', $pr);
-        }
+
+        echo '<div>' . $pr . '</div>';
     }
 
-    public function priemInfo($pl, $t, $id = false)
+    /**
+     * Летит в js, двойные кавычки не использовать.
+     * @param array $pl
+     * @param int $id
+     * @return array
+     */
+    private function priemInfo(array $pl, int $id = -1): array
     {
         global $btl;
         $pz = explode('|', $this->u->info['priems_z']);
@@ -2223,7 +2184,7 @@ class Priems
             $n = $this->statnames->sysRequirementNames[$x];
             if (isset($tr['tr_' . $n])) {
                 if ($tr['tr_' . $n] > $this->u->stats[$n]) {
-                    $trs .= '<span style="color: red">';
+                    $trs .= "<span style='color: red;'>";
                 }
                 $trs .= '<br>• ';
                 $trs .= $this->statnames->requirementNames[$n] . ': ' . $tr['tr_' . $n];
@@ -2239,10 +2200,7 @@ class Priems
         $nm = [1 => 'hit', 2 => 'krit', 3 => 'counter', 4 => 'block', 5 => 'parry', 6 => 'hp', 7 => 'spirit'];
         while ($j <= 6) {
             if ($pl['tt' . $j] > 0) {
-                $lvar .= '<img src=//img.new-combats.tech/i/micro/' . $nm[$j] . '.gif width=8 height=8 /> ' . round(
-                        $pl['tt' . $j],
-                        2
-                    ) . ' &nbsp; ';
+                $lvar .= '<img src=//img.new-combats.tech/i/micro/' . $nm[$j] . '.gif> ' . round($pl['tt' . $j], 2) . ' &nbsp; ';
             }
             $j++;
         }
@@ -2263,7 +2221,7 @@ class Priems
         if (isset($tr['tr_mpNow']) && $tr['tr_mpNow'] > 0) {
             $tr['tr_mpNow'] -= round($tr['tr_mpNow'] / 100 * $this->u->stats['min_use_mp']);
             if ($this->u->info['mpNow'] < $tr['tr_mpNow'] || (isset($btl->stats[$btl->uids[$this->u->info['id']]]) && $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] < $tr['tr_mpNow'])) {
-                $lvar .= '<font color=red>• Расход маны: ' . $tr['tr_mpNow'] . '</font><br>';
+                $lvar .= '<span style="color: red;">• Расход маны: ' . $tr['tr_mpNow'] . '</span><br>';
             } else {
                 $lvar .= '• Расход маны: ' . $tr['tr_mpNow'] . '<br>';
             }
@@ -2282,6 +2240,90 @@ class Priems
         return [0 => $lvar, 1 => $pz];
     }
 
+    public function seeMy(): string
+    {
+        global $btl;
+        $i = 0;
+        $p = explode('|', $this->u->info['priems']);
+        $pr = '';
+        $all = (int)$_GET['all'];
+        while ($i < $this->u->info['priemslot']) {
+            if ($p[$i] > 0) {
+                $pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]);
+                $cl = '';
+                $lvar = $this->priemInfo($pl, $i);
+                $pz = $lvar[1];
+                $lvar = $lvar[0];
+
+                if ($pl['type'] == 1) {
+                    //моментально
+                    if ($pl['onUser'] == 1) {
+                        if ($pl['team'] == 1) {
+                            if ($this->u->info['login2'] != '') {
+                                $oninuser = $this->u->info['login2'];
+                            } else {
+                                $oninuser = $this->u->info['login'];
+                            }
+                        } else {
+                            if ($btl->users[$btl->uids[$this->u->info['enemy']]]['login2'] != '') {
+                                $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login2'];
+                            } else {
+                                $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login'];
+                            }
+                        }
+                        $cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl['name'] . '\',\'' . $oninuser . '\',\'' . $pl['img'] . '\');"';
+                        unset($oninuser);
+                    } else {
+                        $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
+                    }
+                } elseif ($pl['type'] == 2) {
+                    //длительное
+                    $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"';
+                } elseif ($pl['type'] == 3) {
+                    $cl = 'href="javascript:void(0);" onClick="alert(\'Возможно используем?\');"';
+                }
+
+                $notr = $this->testpriem($pl, 2);
+
+                $cli2 = '';
+                if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) {
+                    $cli2 = ' class="nopriemuse" ';
+                }
+                /// ТУТ!
+                $priemName = $pl['name'];
+                $priemImg = $pl['img'];
+                $pr .= <<<HTML
+                <a onmouseover="let a = `<b>$priemName</b><br>$lvar`; top.hi(this,a,event,3,0,1,1,'width: 240px;')" onmouseout="top.hic();" onmousedown="top.hic();" $cl>
+                    <img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
+                </a>
+                HTML;
+
+            } else {
+
+                if (isset($_GET['inv'])) {
+                    $pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . $all . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt=""></a>';
+                } else {
+                    $pr .= '<img style="margin-top:4px; margin-left:4px;" src="//img.new-combats.tech/i/items/w/clearPriem.gif" alt="">';
+                }
+
+            }
+            $i++;
+        }
+        if ($this->u->info['animal'] > 0) {
+            $use_lst = $this->u->testAction(
+                '`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->i->id . '" LIMIT 1',
+                1
+            );
+            if (!isset($use_lst['id'])) {
+                $pr .= '<a onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" href="javascript:void(0);" onClick="usepriem(100500,1,\'\');"><img style="margin-top:1px; margin-left:3px;" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" /></a>';
+            } else {
+                $pr .= '<img onMouseOver="top.hi(this,\'<b>Выпустить зверя</b><Br>Ваш зверь вмешивается в поединок. Можно применять один раз за бой.\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:1px; margin-left:2px;" class="nopriemuse" src="//img.new-combats.tech/i/eff/pet_unleash.gif" width="40" height="25" />';
+            }
+        }
+
+        return str_replace('"', '\\"', $pr);
+    }
+
     //Мощность / подавление / сопротивление и т.д.
 
     public function getByCategory(?int $category_id = null)
@@ -2300,9 +2342,7 @@ class Priems
             echo
             <<< HTML
                     <a href="javascript:void(0)" onclick="location.href='main.php?skills=1&rz=4&use_priem=$priem[id]';">
-                        <img class="pwq$priem[category_id] pwqall" onMouseOver="top.popup(this, '(#$priem[id]) <b>$priem[name]</b><Br>{$this->priemInfo(
-                $priem, 1
-            )[0]}');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="display:none;margin-top:2px; $cl margin-left:1px;" src="//img.new-combats.tech/i/eff/$priem[img].gif" width="40" height="25" />
+                        <img class="pwq$priem[category_id] pwqall" onMouseOver="top.popup(this, '(#$priem[id]) <b>$priem[name]</b><Br>{$this->priemInfo($priem)[0]}');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="display:none;margin-top:2px; $cl margin-left:1px;" src="//img.new-combats.tech/i/eff/$priem[img].gif" width="40" height="25" />
                     </a>
                 HTML;
         }
diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php
index 37c9fc8c..3a541255 100644
--- a/_incl_data/class/User.php
+++ b/_incl_data/class/User.php
@@ -281,8 +281,8 @@ class User
                     );
                     $this->addAction(
                         time(), 'frg', '[ ' . $this->info['login'] . ' ] ' . date(
-                                  'd.m.Y H:i:s'
-                              ) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
+                            'd.m.Y H:i:s'
+                        ) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
                     );
                 } else {
                     mysql_query(
@@ -293,8 +293,8 @@ class User
                     if ($sb - 10 > $this->info['catch'] - $this->info['frg']) {
                         $this->addAction(
                             time(), 'frgfalse', '[ ' . $this->info['login'] . ' ] ' . date(
-                                      'd.m.Y H:i:s'
-                                  ) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
+                                'd.m.Y H:i:s'
+                            ) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
                         );
                     }
                 }
@@ -382,8 +382,7 @@ class User
                                 'UPDATE `items_users` SET `use_text` = "' . $itm['use_text'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
                             );
                             mysql_query(
-                                'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time(
-                                ) . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
+                                'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time() . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
                                     htmlspecialchars($txt, null)
                                 ) . '","' . $this->info['city'] . '","' . $sx . '")'
                             );
@@ -429,8 +428,7 @@ class User
                                 $this->error = 'Персонаж уже проводит сделку';
                             } else {
                                 $ins = mysql_query(
-                                    'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time(
-                                    ) . '","' . mysql_real_escape_string(
+                                    'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time() . '","' . mysql_real_escape_string(
                                         htmlspecialchars($_POST['textarea'], null)
                                     ) . '","' . time() . '")'
                                 );
@@ -754,6 +752,12 @@ class User
         return $result ?: [];
     }
 
+    public function getStats($uid, $i1 = null, $res = 0, $reimg = false, $btl_cache = false, $minimal = false): array
+    {
+        $result = new Stats($this);
+        return $result->getStats($uid, $i1, $reimg, $btl_cache);
+    }
+
     private function infoTasks()
     {
         if (empty($this->info)) {
@@ -813,12 +817,6 @@ class User
         }
     }
 
-    public function getStats($uid, $i1 = null, $res = 0, $reimg = false, $btl_cache = false, $minimal = false): array
-    {
-        $result = new Stats($this);
-        return $result->getStats($uid, $i1, $reimg, $btl_cache);
-    }
-
     public function getUserInfoById($id)
     {
         return Db::getRow('select * from users left join stats on users.id = stats.id where users.id = ?', [$id]);
@@ -3228,8 +3226,7 @@ class User
                     if ($po['sudba'] == '0') {
                         $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто наденет его. Никто другой не сможет его использовать." src="' . Config::img() . '/i/destiny0.gif">';
                     } elseif ($po['sudba'] == '1') {
-                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="' . Config::img(
-                            ) . '/i/destiny0.gif">';
+                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="' . Config::img() . '/i/destiny0.gif">';
                     } else {
                         $is2 .= ' <img title="Этот предмет связан общей судьбой с ' . $po['sudba'] . '. Никто другой не сможет его использовать." src="' . Config::img() . '/i/desteny.gif">';
                     }
@@ -3400,8 +3397,7 @@ class User
                         $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
 
                         if (isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-                            $tr .= ' <a href="/main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=mib' . $i . '"><img src="' . Config::img(
-                                ) . '/i/up.gif" width="11" height="11"></a>';
+                            $tr .= ' <a href="/main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=mib' . $i . '"><img src="' . Config::img() . '/i/up.gif" width="11" height="11"></a>';
                         }
                     }
                     $i++;
@@ -3530,11 +3526,7 @@ class User
 
                 if (isset($po['free_stats']) && $po['free_stats'] > 0) {
                     $is2 .= '<br><strong>Распределение статов:</strong>';
-                    $is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="' . Config::img(
-                        ) . '/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="' . Config::img(
-                        ) . '/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="' . Config::img(
-                        ) . '/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="' . Config::img(
-                        ) . '/i/plus.gif"></a></small></div>';
+                    $is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="' . Config::img() . '/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="' . Config::img() . '/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="' . Config::img() . '/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="' . Config::img() . '/i/plus.gif"></a></small></div>';
                     $is2 .= '&bull; Осталось распределений: ' . $po['free_stats'] . '';
                 }
 
@@ -3586,28 +3578,17 @@ class User
                         } else {
                             $is2 .= '<div style="margin-left:20px;"><small>
 							Мастерство владения мечами: ' . (0 + $po['add_a1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=1"><img src="' . Config::img() . '/i/plus.gif"></a><br>
-							Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
-							Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="' . Config::img(
-                                ) . '/i/plus.gif"></a><br>
+							Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="' . Config::img() . '/i/plus.gif"></a><br>
+							Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="' . Config::img() . '/i/plus.gif"></a><br>
 							</small></div>';
                             $is2 .= 'Осталось распределений: ' . $mx1;
                         }
@@ -3760,16 +3741,14 @@ class User
                         mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $po['toclan1'][0] . '" LIMIT 1')
                     );
                     if (isset($clpo['id'])) {
-                        $is2 .= '<div style="color:brown;">Предмет принадлежит клану <img style="vertical-align:bottom" src="' . Config::img(
-                            ) . '/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
+                        $is2 .= '<div style="color:brown;">Предмет принадлежит клану <img style="vertical-align:bottom" src="' . Config::img() . '/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
                         $plpo = mysql_fetch_array(
                             mysql_query(
                                 'SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . $po['toclan1'][1] . '" LIMIT 1'
                             )
                         );
                         if (isset($plpo['id'])) {
-                            $is2 .= ' <span style="color: grey;">(Дар игрока <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="' . Config::img(
-                                ) . '/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</span>';
+                            $is2 .= ' <span style="color: grey;">(Дар игрока <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="' . Config::img() . '/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</span>';
                             if ($plpo['login'] == $this->info['login']) {
                                 if (isset($_GET['backmyitm'])) {
                                     $pl['inOdet'] = 0;
@@ -3911,8 +3890,7 @@ class User
                                 ) . '" LIMIT 1'
                             )
                         );
-                        $is1 .= '<small>Предмет у игрока<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="' . Config::img(
-                            ) . '/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
+                        $is1 .= '<small>Предмет у игрока<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="' . Config::img() . '/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
                         if ($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) {
                             $is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm=' . $pl['id'] . '">Изъять предмет</a></small>';
                         }
@@ -4260,15 +4238,13 @@ class User
                             }
                             if ($pl['magic_inc'] && $pl['type'] == 30) {
                                 //используем эликсир
-                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
-                                    ) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
+                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                                 $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
                             } elseif ($pl['magic_inc'] && $pl['type'] == 29) { //используем заклятие
                                 if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { //на персонажа
                                     $useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'otdel=' . ((int)$_GET['otdel']) . '&use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
                                 } else { //просто использование (на себя, либо без указания предмета\логина)
-                                    $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
-                                        ) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
+                                    $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                                     $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\',' . (0 + $_GET['otdel']) . ');';
                                 }
                                 //на предмет
@@ -4315,8 +4291,7 @@ class User
                     if ($pl['group'] > 0) {
                         $is1 .= '<br>';
                         if ($this->itemsX($pl['id']) < $pl['group_max']) {
-                            $is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="Собрать"><img src="' . Config::img(
-                                ) . '/i/stack.gif" /></a>';
+                            $is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="Собрать"><img src="' . Config::img() . '/i/stack.gif" /></a>';
                         }
                         if ($this->itemsX($pl['id']) > 1) {
                             $tbl = '<table style="border: 0; width: 100%;" cellspacing="0" cellpadding="5"><tr><td style="text-align: center; width: 70px;" rowspan="2">
@@ -4343,8 +4318,7 @@ class User
 
                     if ($d[1] == 1) { //можно выкинуть
                         if (!isset($po['nodelete'])) {
-                            $is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'' . Config::img(
-                                ) . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval(
+                            $is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval(
                                     $_GET['otdel']
                                 ) . Config::img() . ' / i / clear . gif"></a>';
                         }
@@ -4630,8 +4604,7 @@ class User
                     $itm['data'] = Conversion::dataStringToArray($itm['data']);
                     unset($itm['data']['frompisher']);
                     $itm['data'] = Conversion::arrayToDataString($itm['data']);
-                    if ($pl['data'] == $itm['data'] && $pl['name'] == $itm['name'] && $itm['iznosMAX'] == $pl['iznosMAX'] && $pl['iznosNOW'] == 0 && ($pl['timeOver'] == 0 || $pl['timeOver'] > time(
-                            )) && $pl['gift'] == $itm['gift']) {
+                    if ($pl['data'] == $itm['data'] && $pl['name'] == $itm['name'] && $itm['iznosMAX'] == $pl['iznosMAX'] && $pl['iznosNOW'] == 0 && ($pl['timeOver'] == 0 || $pl['timeOver'] > time()) && $pl['gift'] == $itm['gift']) {
                         $upd = mysql_query(
                             'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `inGroup` = "' . $itm['inGroup'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
                         );
@@ -4730,12 +4703,12 @@ class User
                     $notr++;
                 }
             }
-            if (isset($itm['iznosNOW'], $itm['iznosMAX'], $itm['iznosMAXi']) &&
-                $itm['iznosNOW'] >= ceil($itm['iznosMAX']) &&
-                $itm['iznosMAXi'] != 999999999) {
+            if (isset($itm['iznosnow'], $itm['iznosmax'], $itm['iznosmaxi']) &&
+                $itm['iznosnow'] >= ceil($itm['iznosmax']) &&
+                $itm['iznosmaxi'] != 999999999) {
                 $notr++;
             }
-            if ($notr > 0 && $itm['inOdet'] != 0) {
+            if ($notr > 0 && $itm['inodet'] != 0) {
                 //снимаем предмет
                 $this->snatItem($itm['id'], $u['id']);
                 $snIt++;
@@ -4793,16 +4766,16 @@ class User
                 ItemsModel::itemDecay($itm['id'], $itm['overType'], $u['id'], (int)$po['musor2'], $itm['type'], $itm['name']);
                 $notr++;
             }
-            if ($itm['iznosNOW'] >= ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999) {
+            if ($itm['iznosnow'] >= ceil($itm['iznosmax']) && $itm['iznosmaxi'] != 999999999) {
                 $notr++;
             }
-            if ($notr > 0 && $itm['inOdet'] != 0) {
+            if ($notr > 0 && $itm['inodet'] != 0) {
                 //снимаем предмет
                 $this->snatItem($itm['id'], $u['id']);
                 $snIt++;
             }
             //проверяем срок годности
-            if ($itm['iznosNOW'] >= ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999 && isset($po['musor']) && $po['musor'] > 0) {
+            if ($itm['iznosnow'] >= ceil($itm['iznosmax']) && $itm['iznosmaxi'] != 999999999 && isset($po['musor']) && $po['musor'] > 0) {
                 //предмет сломался
                 $this->itemDestroy($itm['id'], $u['id'], (int)$po['musor']);
             }
@@ -5232,8 +5205,7 @@ class User
                             );
                             $this->error = 'Вам нехорошо...';
                         } elseif (mysql_query(
-                            'UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time(
-                            ) . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date(
+                            'UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date(
                                 'd.m.Y H:i:s', $itmin['time_create']
                             ) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1'
                         )) {
@@ -5264,8 +5236,7 @@ class User
                                     $pid = ItemsModel::addItem($s['id'], $this->info['id']);
                                     if ($pid > 0) {
                                         mysql_query(
-                                            'UPDATE `items_users` SET `lastUPD` = "' . time(
-                                            ) . '",`gift` = "' . $itm['gift'] . '" WHERE `id` = "' . $pid . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
+                                            'UPDATE `items_users` SET `lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '" WHERE `id` = "' . $pid . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
                                         );
                                     }
                                     $j++;
@@ -5580,16 +5551,14 @@ LIMIT 1'
                 );
                 $col = $col[0];
                 mysql_query(
-                    'UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time(
-                    ) . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr
+                    'UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr
                 );
                 $this->error = 'Предметы "' . $itm['name'] . ' (x' . ($col + 1) . ')" выброшены';
                 Delo::add(
                     1,
                     'System.inventory',
                     $uid,
-                    '&quot;<span style="color: maroon; ">System.inventory</span>&quot;: Предметы &quot;<strong>' . $itm['name'] . ' (x' . $col . ')</strong>&quot; [itm:' . $itm['id'] . '=' . time(
-                    ) . '] были <strong>выброшены</strong>.',
+                    '&quot;<span style="color: maroon; ">System.inventory</span>&quot;: Предметы &quot;<strong>' . $itm['name'] . ' (x' . $col . ')</strong>&quot; [itm:' . $itm['id'] . '=' . time() . '] были <strong>выброшены</strong>.',
                 );
             } else {
                 $this->error = 'Предмет "' . $itm['name'] . '" выброшен';
@@ -6061,8 +6030,7 @@ LIMIT 1'
                 $r = '<font color="#FF0000"><strong>Вы успешно изъяли предмет &quot;' . $itm_['name'] . '&quot;</strong></font><br />';
                 $col = $this->itemsX(((int)$id));
                 mysql_query(
-                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
-                    ) . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'
+                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'
                 );
                 mysql_query(
                     'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $res['id'] . '" ' . $o . ' WHERE `id` = "' . $id . '" LIMIT 1'
@@ -6093,8 +6061,7 @@ LIMIT 1'
             if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
                 $col = $this->itemsX(((int)$id));
                 mysql_query(
-                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
-                    ) . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")'
+                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")'
                 );
                 mysql_query(
                     'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1'
@@ -6136,8 +6103,7 @@ LIMIT 1'
                     'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '", `data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '"'
                 );
                 mysql_query(
-                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
-                    ) . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
+                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
                 );
             } elseif ($pl['uid'] == $user['id']) {
                 $col = $this->itemsX(((int)$pl['id']));
@@ -6148,8 +6114,7 @@ LIMIT 1'
                     'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $pl['id'] . '"'
                 );
                 mysql_query(
-                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
-                    ) . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
+                    'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
                 );
             }
         }
diff --git a/_incl_data/class/User/Item.php b/_incl_data/class/User/Item.php
index 2b40e47e..f0593434 100644
--- a/_incl_data/class/User/Item.php
+++ b/_incl_data/class/User/Item.php
@@ -87,7 +87,7 @@ class Item
             'iznosNOW' => $iNow,
             'iznosMAX' => $iMax,
         ] = $item;
-        $this->durability = $iMax - $iNow;
+        $this->durability = (int)$iMax - (int)$iNow;
         $stat = new Stat();
         $stat->getBonus();
         $dataArr = Conversion::dataStringToArray(strtolower($this->data));
diff --git a/jx/battle/refresh.php b/jx/battle/refresh.php
index 34281d40..995615d9 100644
--- a/jx/battle/refresh.php
+++ b/jx/battle/refresh.php
@@ -208,7 +208,7 @@ if (!$isBattle) {
         }
 
 
-        $js .= '$("#priems").html("' . $priem->seeMy(2) . '");';
+        $js .= '$("#priems").html("' . $priem->seeMy() . '");';
         $jslog = $btl->lookmLog() . $btl->lookLog();
         if ($jslog != '') {
             $js = $jslog . $js;
diff --git a/jx/battle/refresh1.php b/jx/battle/refresh1.php
index 7fd9144f..368e1c2c 100644
--- a/jx/battle/refresh1.php
+++ b/jx/battle/refresh1.php
@@ -190,7 +190,7 @@ if (!$isBattle) {
 
     $rehtml = '';
     if (!isset($CRON_CORE)) {
-        $js .= '$("#priems").html("' . $priem->seeMy(2) . '");';
+        $js .= '$("#priems").html("' . $priem->seeMy() . '");';
         $jslog = $btl->lookmLog();
         $jslog .= $btl->lookLog();
         if ($jslog != '') {
diff --git a/jx/battle/refresh2.php b/jx/battle/refresh2.php
index 22e873d3..4152a5e6 100644
--- a/jx/battle/refresh2.php
+++ b/jx/battle/refresh2.php
@@ -193,7 +193,7 @@ if (isset($_POST['atack'], $_POST['block']) || (isset($_POST['id']) && $_POST['i
 
         $rehtml = '';
         if (!isset($CRON_CORE)) {
-            $js .= '$("#priems").html("' . $priem->seeMy(2) . '");';
+            $js .= '$("#priems").html("' . $priem->seeMy() . '");';
             //if(!isset($_POST['usepriem'])) {
             $jslog = $btl->lookLog();
             if ($jslog != '') {
diff --git a/modules_data/_inv.php b/modules_data/_inv.php
index 215dc6c8..08fe47c0 100644
--- a/modules_data/_inv.php
+++ b/modules_data/_inv.php
@@ -94,8 +94,7 @@ if (isset($_POST['compname'])) {
         if (!isset($tcm['id'])) {
             //добавляем новый комплект
             $ins = mysql_query(
-                'INSERT INTO `save_com` (`uid`,`time`,`name`,`val`,`type`) VALUES ("' . $u->info['id'] . '","' . time(
-                ) . '","' . mysql_real_escape_string($_POST['compname']) . '","' . $ptst . '","0")'
+                'INSERT INTO `save_com` (`uid`,`time`,`name`,`val`,`type`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . mysql_real_escape_string($_POST['compname']) . '","' . $ptst . '","0")'
             );
             if ($ins) {
                 $u->error = 'Комплект &quot;' . $_POST['compname'] . '&quot; был успешно сохранен';
@@ -117,8 +116,7 @@ if (isset($_POST['compname'])) {
     }
 } elseif (isset($_GET['delc1'])) {
     $cmpl = mysql_query(
-        'UPDATE `save_com` SET `delete` = "' . time(
-        ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id` = "' . mysql_real_escape_string(
+        'UPDATE `save_com` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id` = "' . mysql_real_escape_string(
             $_GET['delc1']
         ) . '" LIMIT 1'
     );
@@ -433,13 +431,10 @@ if (isset($_GET['mAjax'])) {
                 echo $usee ? $usee[0] : 'information is lost.';
                 $priem = new Priems();
                 echo '<br>';
-                $priem->seeMy(1);
+                $priem->seeMyPriems();
                 echo '<br>' . $u->info_remont();
                 ?>
             </div>
-            <div style="text-align: center">
-                <?= $c['counters']; ?>
-            </div>
         </td>
         <td width="287" style="padding-right:7px;" valign="top" align="left">
             <?php include('stats_inv.php'); ?>
diff --git a/modules_data/_umenie.php b/modules_data/_umenie.php
index 91cdefe7..fe40522c 100644
--- a/modules_data/_umenie.php
+++ b/modules_data/_umenie.php
@@ -9,6 +9,7 @@ use Core\Config;
 use DarksLight2\Battle\Techniques\TechniqueCategoryEntity;
 use DarksLight2\Training\TrainingManager;
 use Helper\Conversion;
+use Model\Constant\Stat;
 
 if (!defined('GAME')) {
     die();
@@ -161,7 +162,7 @@ $tma = '';
 <body>
 
 <SCRIPT>
-    var clevel = '';
+    let clevel = '';
     var currentID = <?= time(); ?>;
     var newrz = <?= $rzsee; ?>;
 
@@ -170,10 +171,10 @@ $tma = '';
     }
 
     function highl(nm, i) {
-        if (clevel == nm) {
+        if (clevel === nm) {
             document.getElementById(nm).className = 'tzSet'
         } else {
-            if (i == 1) {
+            if (i === 1) {
                 document.getElementById(nm).className = 'tzOver'
             } else {
                 document.getElementById(nm).className = 'tz'
@@ -182,12 +183,13 @@ $tma = '';
     }
 
     function setlevel(nm) {
-
-        if (clevel != '') {
+        if (clevel) {
             document.getElementById(clevel).className = 'tz';
             document.getElementById('d' + clevel).style.display = 'none';
         }
+
         clevel = nm || 'L1';
+
         document.getElementById(clevel).className = 'tzSet';
         document.getElementById('d' + clevel).style.display = 'inline';
         newrz = nm.split('L');
@@ -202,123 +204,118 @@ $tma = '';
             <?php
             echo User::getLogin($u->info['id']);
             $st = Conversion::dataStringToArray($u->info['stats']);
-            if (
-                $_GET['dec_transfer'] ||
-                $_GET['dec_travma'] ||
-                $_GET['fast_homeworld'] ||
-                $_GET['inc_expr'] ||
-                $_GET['inc_friends'] ||
-                $_GET['inc_hobby'] ||
-                $_GET['max_inventory'] ||
-                $_GET['num_transfer'] ||
-                $_GET['speed_HP'] ||
-                $_GET['speed_MP'] ||
-                $_GET['speed_debuff']
-            ) {
-                $summs = floor(
-                    $_GET['dec_transfer'] +
-                    $_GET['dec_travma'] +
-                    $_GET['fast_homeworld'] +
-                    $_GET['inc_expr'] +
-                    $_GET['inc_friends'] +
-                    $_GET['inc_hobby'] +
-                    $_GET['max_inventory'] +
-                    $_GET['num_transfer'] +
-                    $_GET['speed_HP'] +
-                    $_GET['speed_MP'] +
-                    $_GET['speed_debuff']
-                );
-                if (!is_numeric($summs)) {
-                    $summs = 0;
-                }
+            $os1 = $_GET['dec_transfer'] ??= 0;
+            $os2 = $_GET['dec_travma'] ??= 0;
+            $os3 = $_GET['fast_homeworld'] ??= 0;
+            $os4 = $_GET['inc_expr'] ??= 0;
+            $os5 = $_GET['inc_friends'] ??= 0;
+            $os6 = $_GET['inc_hobby'] ??= 0;
+            $os7 = $_GET['max_inventory'] ??= 0;
+            $os8 = $_GET['num_transfer'] ??= 0;
+            $os9 = $_GET['speed_HP'] ??= 0;
+            $os10 = $_GET['speed_MP'] ??= 0;
+            $os11 = $_GET['speed_debuff'] ??= 0;
 
-                if ($summs > 1) {
-                    $summs = 0;
-                    echo '&nbsp; &nbsp;<span style="color: red; ">Что-то здесь не так...</span><br>';
-                } elseif ($summs < 0) {
-                    $summs = 0;
-                    echo '&nbsp; &nbsp;<span style="color: red; ">При вскрытие сейфа выяснилось, что он был вскрыт до Вас ;)</span><br>';
-                } elseif (($st['os1'] + $_GET['dec_transfer'] <= 5 && $_GET['dec_transfer'] > 0) ||
-                    ($st['os2'] + $_GET['dec_travma'] <= 5 && $_GET['dec_travma'] > 0) ||
-                    ($st['os3'] + $_GET['fast_homeworld'] <= 5 && $_GET['fast_homeworld'] > 0) ||
-                    ($st['os4'] + $_GET['inc_expr'] <= 5 && $_GET['inc_expr'] > 0) ||
-                    ($st['os5'] + $_GET['inc_friends'] <= 5 && $_GET['inc_friends'] > 0) ||
-                    ($st['os6'] + $_GET['inc_hobby'] <= 5 && $_GET['inc_hobby'] > 0) ||
-                    ($st['os7'] + $_GET['max_inventory'] <= 5 && $_GET['max_inventory'] > 0) ||
-                    ($st['os8'] + $_GET['num_transfer'] <= 5 && $_GET['num_transfer'] > 0) ||
-                    ($st['os9'] + $_GET['speed_HP'] <= 5 && $_GET['speed_HP'] > 0) ||
-                    ($st['os10'] + $_GET['speed_MP'] <= 5 && $_GET['speed_MP'] > 0) ||
-                    ($st['os11'] + $_GET['speed_debuff'] <= 5 && $_GET['speed_debuff'] > 0) && $u->info['id'] == $_GET['s4i']
-                ) {
-                    $st['os1'] += (int)$_GET['dec_transfer'];
-                    $st['os2'] += (int)$_GET['dec_travma'];
-                    $st['os3'] += (int)$_GET['fast_homeworld'];
-                    $st['os4'] += (int)$_GET['inc_expr'];
-                    $st['os5'] += (int)$_GET['inc_friends'];
-                    $st['os6'] += (int)$_GET['inc_hobby'];
-                    $st['os7'] += (int)$_GET['max_inventory'];
-                    $st['os8'] += (int)$_GET['num_transfer'];
-                    $st['os9'] += (int)$_GET['speed_HP'];
-                    $st['os10'] += (int)$_GET['speed_MP'];
-                    $st['os11'] += (int)$_GET['speed_debuff'];
-                    $u->info['stats'] = Conversion::arrayToDataString($st);
-                }
-                if ($u->info['sskills'] - (int)$summs < 0) {
-                    echo '&nbsp; &nbsp;<span style="color: red; ">У вас нет свободных особенностей</span><br>';
-                } elseif (mysql_query(
-                    "UPDATE 
+            $summs = $os1 + $os2 + $os3 + $os4 + $os5 + $os6 + $os7 + $os8 + $os9 + $os10 + $os11;
+
+            $st['os1'] ??= 0;
+            $st['os2'] ??= 0;
+            $st['os3'] ??= 0;
+            $st['os4'] ??= 0;
+            $st['os5'] ??= 0;
+            $st['os6'] ??= 0;
+            $st['os7'] ??= 0;
+            $st['os8'] ??= 0;
+            $st['os9'] ??= 0;
+            $st['os10'] ??= 0;
+            $st['os11'] ??= 0;
+
+            if ($summs > 1) {
+                $summs = 0;
+                echo '&nbsp; &nbsp;<span style="color: red; ">Что-то здесь не так...</span><br>';
+            } elseif ($summs < 0) {
+                $summs = 0;
+                echo '&nbsp; &nbsp;<span style="color: red; ">При вскрытие сейфа выяснилось, что он был вскрыт до Вас ;)</span><br>';
+            } elseif (($st['os1'] + $os1 <= 5 && $os1 > 0) ||
+                ($st['os2'] + $os2 <= 5 && $os2 > 0) ||
+                ($st['os3'] + $os3 <= 5 && $os3 > 0) ||
+                ($st['os4'] + $os4 <= 5 && $os4 > 0) ||
+                ($st['os5'] + $os5 <= 5 && $os5 > 0) ||
+                ($st['os6'] + $os6 <= 5 && $os6 > 0) ||
+                ($st['os7'] + $os7 <= 5 && $os7 > 0) ||
+                ($st['os8'] + $os8 <= 5 && $os8 > 0) ||
+                ($st['os9'] + $os9 <= 5 && $os9 > 0) ||
+                ($st['os10'] + $os10 <= 5 && $os10 > 0) ||
+                ($st['os11'] + $os11 <= 5 && $os11 > 0) && $u->info['id'] == $_GET['s4i']
+            ) {
+                $st['os1'] += $os1;
+                $st['os2'] += $os2;
+                $st['os3'] += $os3;
+                $st['os4'] += $os4;
+                $st['os5'] += $os5;
+                $st['os6'] += $os6;
+                $st['os7'] += $os7;
+                $st['os8'] += $os8;
+                $st['os9'] += $os9;
+                $st['os10'] += $os10;
+                $st['os11'] += $os11;
+                $u->info['stats'] = Conversion::arrayToDataString($st);
+            }
+            if ($u->info['sskills'] - (int)$summs < 0) {
+                echo '&nbsp; &nbsp;<span style="color: red; ">У вас нет свободных особенностей</span><br>';
+            } elseif (mysql_query(
+                "UPDATE 
 							`stats` 
 						SET 
 							`stats`= '" . mysql_real_escape_string($u->info['stats']) . "',
 							`sskills` = `sskills` - '" . (int)$summs . "'
 						WHERE 
 							`id` = '" . (int)$u->info['id'] . "';"
-                )) {
-                    function getstatusumenie(string $name, int $level): string
-                    {
-                        $str = $level > 1 ? " [$level]" : '';
-                        $name .= $str;
-                        return "&nbsp; &nbsp;<span style='color: red;'>\"$name\"</span><br>";
-                    }
-
-                    if ($_GET['dec_transfer'] == 1) {
-
-                        echo getstatusumenie('Изворотливый', $st['os1']);
-                    }
-                    if ($_GET['dec_travma'] == 1) {
-                        echo getstatusumenie('Стойкий', $st['os2']);
-                    }
-                    if ($_GET['fast_homeworld'] == 1) {
-                        echo getstatusumenie('Быстрый', $st['os3']);
-                    }
-                    if ($_GET['inc_expr'] == 1) {
-                        echo getstatusumenie('Сообразительный', $st['os4']);
-                    }
-                    if ($_GET['inc_friends'] == 1) {
-                        echo getstatusumenie('Дружелюбный', $st['os5']);
-                    }
-                    if ($_GET['inc_hobby'] == 1) {
-                        echo getstatusumenie('Общительный', $st['os6']);
-                    }
-                    if ($_GET['max_inventory'] == 1) {
-                        echo getstatusumenie('Запасливый', $st['os7']);
-                    }
-                    if ($_GET['num_transfer'] == 1) {
-                        echo getstatusumenie('Коммуникабельный', $st['os8']);
-                    }
-                    if ($_GET['speed_HP'] == 1) {
-                        echo getstatusumenie('Двужильный', $st['os9']);
-                    }
-                    if ($_GET['speed_MP'] == 1) {
-                        echo getstatusumenie('Здравомыслящий', $st['os10']);
-                    }
-                    if ($_GET['speed_debuff'] == 1) {
-                        echo getstatusumenie('Здоровый сон', $st['os11']);
-                    }
-                    $u->info['sskills'] -= $summs;
+            )) {
+                function getstatusumenie(string $name, int $level): string
+                {
+                    $str = $level > 1 ? " [$level]" : '';
+                    $name .= $str;
+                    return "&nbsp; &nbsp;<span style='color: red;'>\"$name\"</span><br>";
                 }
+
+                if ($os1 == 1) {
+                    echo getstatusumenie('Изворотливый', $st['os1']);
+                }
+                if ($os2 == 1) {
+                    echo getstatusumenie('Стойкий', $st['os2']);
+                }
+                if ($os3 == 1) {
+                    echo getstatusumenie('Быстрый', $st['os3']);
+                }
+                if ($os4 == 1) {
+                    echo getstatusumenie('Сообразительный', $st['os4']);
+                }
+                if ($os5 == 1) {
+                    echo getstatusumenie('Дружелюбный', $st['os5']);
+                }
+                if ($os6 == 1) {
+                    echo getstatusumenie('Общительный', $st['os6']);
+                }
+                if ($os7 == 1) {
+                    echo getstatusumenie('Запасливый', $st['os7']);
+                }
+                if ($os8 == 1) {
+                    echo getstatusumenie('Коммуникабельный', $st['os8']);
+                }
+                if ($os9 == 1) {
+                    echo getstatusumenie('Двужильный', $st['os9']);
+                }
+                if ($os10 == 1) {
+                    echo getstatusumenie('Здравомыслящий', $st['os10']);
+                }
+                if ($os11 == 1) {
+                    echo getstatusumenie('Здоровый сон', $st['os11']);
+                }
+                $u->info['sskills'] -= $summs;
             }
-            if ($_GET['upr']) {
+
+            if (isset($_GET['upr'])) {
                 /*-----Проверяем сумму статов и умений-----*/
                 if (!isset($_GET['energy']) || $_GET['energy'] < 0) {
                     $_GET['energy'] = 0;
@@ -767,10 +764,40 @@ $tma = '';
                 "bonus4" => "0,4 кр.",
                 "bonus5" => "0,5 кр.",
             ];
-            $os["os3"] = ["name" => "Быстрый", "opt" => "fast_homeworld", "descr" => "Кнопка \"Возврат\" появляется раньше на ", "nlevel" => 4, "bonus1" => "5 минут", "bonus2" => "10 минут", "bonus3" => "15 минут", "bonus4" => "20 минут", "bonus5" => "25 минут"];
-            $os["os4"] = ["name" => "Сообразительный", "opt" => "inc_expr", "descr" => "Получаемый опыт больше на ", "nlevel" => 4, "bonus1" => "1 %", "bonus2" => "2 %", "bonus3" => "3 %", "bonus4" => "4 %", "bonus5" => "5 %"];
-            $os["os5"] = ["name" => "Дружелюбный", "opt" => "inc_friends", "descr" => "Cписок друзей больше на ", "bonus1" => 5, "bonus2" => 10, "bonus3" => 15, "bonus4" => 20, "bonus5" => 25];
-            $os["os6"] = ["name" => "Общительный", "opt" => "inc_hobby", "descr" => "Увеличение максимального размера раздела \"Увлечения / хобби\" на ", "bonus1" => "200 символов", "bonus2" => "400 символов", "bonus3" => "600 символов", "bonus4" => "800 символов", "bonus5" => "1000 символов"];
+            $os["os3"] = ["name" => "Быстрый",
+                "opt" => "fast_homeworld",
+                "descr" => "Кнопка \"Возврат\" появляется раньше на ",
+                "nlevel" => 4,
+                "bonus1" => "5 минут",
+                "bonus2" => "10 минут",
+                "bonus3" => "15 минут",
+                "bonus4" => "20 минут",
+                "bonus5" => "25 минут"];
+            $os["os4"] = ["name" => "Сообразительный",
+                "opt" => "inc_expr",
+                "descr" => "Получаемый опыт больше на ",
+                "nlevel" => 4,
+                "bonus1" => "1 %",
+                "bonus2" => "2 %",
+                "bonus3" => "3 %",
+                "bonus4" => "4 %",
+                "bonus5" => "5 %"];
+            $os["os5"] = ["name" => "Дружелюбный",
+                "opt" => "inc_friends",
+                "descr" => "Cписок друзей больше на ",
+                "bonus1" => 5,
+                "bonus2" => 10,
+                "bonus3" => 15,
+                "bonus4" => 20,
+                "bonus5" => 25];
+            $os["os6"] = ["name" => "Общительный",
+                "opt" => "inc_hobby",
+                "descr" => "Увеличение максимального размера раздела \"Увлечения / хобби\" на ",
+                "bonus1" => "200 символов",
+                "bonus2" => "400 символов",
+                "bonus3" => "600 символов",
+                "bonus4" => "800 символов",
+                "bonus5" => "1000 символов"];
             $os["os7"] = ["name" => "Запасливый", "opt" => "max_inventory", "descr" => "Больше места в рюкзаке на ", "nlevel" => 4, "bonus1" => "10 единиц", "bonus2" => "20 единиц", "bonus3" => "30 единиц", "bonus4" => "40 единиц", "bonus5" => "50 единиц"];
             $os["os9"] = ["name" => "Двужильный", "opt" => "speed_HP", "descr" => "Здоровье восстанавливается быстрее на ", "npower" => 10, "bonus1" => "+5%", "bonus2" => "+10%", "bonus3" => "+15%", "bonus4" => "+20%", "bonus5" => "+30%"];
             $os["os10"] = ["name" => "Здравомыслящий", "opt" => "speed_MP", "descr" => "Мана восстанавливается быстрее на ", "nwis" => 20, "bonus1" => "+5%", "bonus2" => "+10%", "bonus3" => "+15%", "bonus4" => "+20%", "bonus5" => "+25%"];
@@ -1041,7 +1068,7 @@ $tma = '';
             </TABLE>
             <TABLE border=0 cellspacing=1 cellpadding=0 width=100%>
                 <tr>
-                    <TD width=100% style='padding-left: 7'>
+                    <TD width=100% style='padding-left: 7px;'>
                         <div class='dtz' ID='dL1'>
                             <table>
                                 <tr>
@@ -1302,13 +1329,16 @@ $tma = '';
                             /*---Особенности---*/
                             foreach ($os as $k => $v) {
                                 $good = 1;
-                                if ($v["nlevel"] && $v["nlevel"] + $st[$k] > $u->info["level"]) {
+                                if (empty($st[$k])) {
+                                    $st[$k] = 0;
+                                }
+                                if (isset($v["nlevel"]) && $v["nlevel"] + $st[$k] > $u->info["level"]) {
                                     $good = 0;
                                 }
-                                if ($v["npower"] && $v["npower"] + ($st[$k] * 5) > $st['s4']) {
+                                if (isset($v["npower"], $st['s4']) && $v["npower"] + ($st[$k] * 5) > $st['s4']) {
                                     $good = 0;
                                 }
-                                if ($v["nwis"] && $v["nwis"] + ($st[$k] * 5) > $st['s6']) {
+                                if (isset($v["nwis"], $st['s6']) && $v["nwis"] + ($st[$k] * 5) > $st['s6']) {
                                     $good = 0;
                                 }
                                 if ($good && $st[$k] < 5) {
@@ -1317,9 +1347,13 @@ $tma = '';
                                 }
                             }
                             echo "<br>";
-                            echo "<b>Выбранные особенности:</b><br>";
+                            $first = true;
                             foreach ($os as $k => $v) {
-                                if ($st[$k]) {
+                                if (!empty($st[$k])) {
+                                    if ($first) {
+                                        echo "<b>Выбранные особенности:</b><br>";
+                                        $first = false;
+                                    }
                                     echo "&bull; " . $v['name'] . " " . ($st[$k] > 1 ? " - " . $st[$k] : "") . "<br>";
                                 }
                             }
@@ -1327,7 +1361,7 @@ $tma = '';
                             ?>
                         </div>
                         <div class="dtz" ID='dL4'>
-                            <script type="text/javascript" src="js/jquery.js"></script>
+                            <script src="/js/jquery.js"></script>
                             <SCRIPT>
                                 var p_name;
 
@@ -1397,18 +1431,18 @@ $tma = '';
                                                 <input type="button" class="btn" value="Очистить слоты"
                                                        onclick="window.location.href = '/main.php?skills=1&rz=4&all=<?= $_GET['all'] ?>&clear_abil=1'; return false;">
 
-                                                <?php $priem->seeMy(1); ?>
+                                                <?php $priem->seeMyPriems(); ?>
                                             </fieldset>
                                         </div>
 
                                         <div style="display: flex; width: 100%">
                                             <fieldset style="width: 50%">
                                                 <legend><b>Категории</b></legend>
-                                                <div
-                                                        style="display: flex; flex-wrap: wrap; flex-direction: column; justify-content: center;">
+                                                <div style="display: flex; flex-wrap: wrap; flex-direction: column; justify-content: center;">
                                                     <?php
                                                     // недописанный огрызок неизвестно чего
                                                     $categories = TechniqueCategoryEntity::getInstance()->findAll();
+                                                    var_dump($categories);
                                                     foreach ($categories as $category) {
                                                         ?>
                                                         <div style='margin-right: 10px;height: 20px'>
@@ -1432,11 +1466,13 @@ $tma = '';
                                     </td>
                                 </tr>
                             </table>
+
                         </div>
+
                         <div class="dtz" ID='dL5'>
                             <div style="margin:5px;">
                                 <?php
-                                $statnames = new \Model\Constant\Stat();
+                                $statnames = new Stat();
                                 $statnames->getBonus();
 
                                 //D5D5D5 , C7C7C7
@@ -2037,7 +2073,7 @@ $tma = '';
                             skillsArr["m_magic7"] = <?=$st['mg7']?>;
 
                             function SetAllSkills(isOn) {
-                                var arrSkills = ["str", "dex", "inst", "power", "intel", "wis", "spirit", "will", "freedom", "god"];
+                                var arrSkills = ["str", "dex", "inst", "power", "intel", "wis", "spirit"];
                                 for (var i in arrSkills) {
                                     var clname = (isOn) ? "skill" : "nonactive";
                                     if (oNode = document.getElementById("plus_" + arrSkills[i])) oNode.className = clname;