diff --git a/_incl_data/class/Dungeon.php b/_incl_data/class/Dungeon.php
index a9f3ec82..b874dfc3 100644
--- a/_incl_data/class/Dungeon.php
+++ b/_incl_data/class/Dungeon.php
@@ -815,7 +815,7 @@ class Dungeon
         if (isset($obj['id'])) {
             $tbot = mysql_fetch_assoc(
                 mysql_query(
-                    'SELECT * FROM `dungeon_bots` WHERE `x` = "' . $obj['x'] . '" AND `y` = "' . $obj['y'] . '" AND `dn` = "' . $this->info['id'] . '" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1'
+                    'SELECT id2 FROM `dungeon_bots` WHERE `x` = "' . $obj['x'] . '" AND `y` = "' . $obj['y'] . '" AND `dn` = "' . $this->info['id'] . '" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1'
                 )
             );
 
@@ -888,9 +888,9 @@ class Dungeon
                         //Проверяем кого нужно убить и убили-ли
                         $j = 1;
                         $jn = 0;
-                        $tuz = mysql_fetch_assoc(
+                        mysql_fetch_assoc(
                             mysql_query(
-                                'SELECT `x`,`y`,`id`,`hpNow` FROM `stats` WHERE `dnow` = "' . $this->info['id'] . '" AND ( (`x` = ' . ($pl['x'] + 1) . ' AND `y` = ' . ($pl['y']) . ') OR (`x` = ' . ($pl['x'] - 1) . ' AND `y` = ' . ($pl['y']) . ') OR (`x` = ' . ($pl['x']) . ' AND `y` = ' . ($pl['y'] + 1) . ') OR (`x` = ' . ($pl['x']) . ' AND `y` = ' . ($pl['y'] - 1) . ') ) LIMIT 1'
+                                'SELECT `x`,`y`,`id`,`hpNow` FROM `stats` WHERE `dnow` = "' . $this->info['id'] . '" AND ( (`x` = ' . ($obj['x'] + 1) . ' AND `y` = ' . ($obj['y']) . ') OR (`x` = ' . ($obj['x'] - 1) . ' AND `y` = ' . ($obj['y']) . ') OR (`x` = ' . ($obj['x']) . ' AND `y` = ' . ($obj['y'] + 1) . ') OR (`x` = ' . ($obj['x']) . ' AND `y` = ' . ($obj['y'] - 1) . ') ) LIMIT 1'
                             )
                         );
                         while ($j < count($t)) {
@@ -931,7 +931,8 @@ class Dungeon
                                 mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itm[0] . '" LIMIT 1')
                             );
                             mysql_query(
-                                'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `item_id` = "' . $itm[0] . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 0 OR `delete` = 100) AND `inShop` = 0 AND `inTransfer` = 0 AND `inOdet` = 0 LIMIT ' . $itm[1]
+                                'UPDATE `items_users` SET `delete` = "' . time(
+                                ) . '" WHERE `item_id` = "' . $itm[0] . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 0 OR `delete` = 100) AND `inShop` = 0 AND `inTransfer` = 0 AND `inOdet` = 0 LIMIT ' . $itm[1]
                             );
                             $r .= 'Предмет &quot;<b>' . $uitm['name'] . '</b>&quot; (x' . $itm[1] . ') был утрачен...<br>';
                             $j++;
@@ -1272,125 +1273,68 @@ class Dungeon
         }
     }
 
-    public function botAtack($bot, $uid, $bs)
+    public function botAtack($bot, $uid, $bs): void
     {
-        global $u, $c, $code;
-        $user = mysql_fetch_assoc(
-            mysql_query('SELECT `id`,`battle` FROM `users` WHERE `id` = "' . $uid['id'] . '" LIMIT 1')
-        );
+        ### FIXME ВОЗМОЖНО тут потерялись [dungeon_bots.bot_group], ячейка отвечающая за группу разных ботов. Не вижу где это ипользуется. Тут только однотипные боты.
+        global $u;
 
-        if ($user['battle'] > 0) {
-            $btli = mysql_fetch_assoc(
-                mysql_query(
-                    'SELECT `id` FROM `battle` WHERE `id` = "' . $user['battle'] . '" AND `team_win` = "-1" LIMIT 1'
-                )
-            );
-        }
+        $battleId = Db::getValue('select users.battle from users left join battle on users.battle = battle.id where users.id = ? and team_win = -1', [$uid['id']]);
 
-        if (!isset($btli['id'])) { //Создаем поединок
-            $btl_id = 0;
-            $expB = 0;
-            $btl = ['players' => '', 'timeout' => 120, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0];
+        if (empty($battleId)) { //Создаем поединок
+            Db::sql('insert into battle (dungeon, dn_id, x, y, time_start, type) values (?,?,?,?,unix_timestamp(), 0)', [$this->info['id2'], $this->info['id'], $bot['x'], $bot['y']]);
+            $battleId = Db::lastInsertId();
 
-            mysql_query(
-                'INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES ("' . $this->info['id2'] . '", "' . $this->info['id'] . '", "' . $bot['x'] . '", "' . $bot['y'] . '", "' . $u->info['city'] . '", "' . time() . '", "' . $btl['players'] . '", "' . $btl['timeout'] . '", "' . $btl['type'] . '", "' . $btl['invis'] . '", "' . $btl['noinc'] . '", "' . $btl['travmChance'] . '", "' . $btl['typeBattle'] . '", "' . $btl['addExp'] . '", "' . $btl['money'] . '")'
-            );
-
-            $btl_id = mysql_insert_id();
-
-            if ($btl_id > 0) { //Добавляем ботов
-                $sp = mysql_query(
-                    'SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `delete` = "0" AND `dn` = "' . $this->info['id'] . '" AND `id2` = "' . $bot['id2'] . '" LIMIT 1'
-                ); // Только тот, который напал и жив ли он?
-                $j = 0;
-                $logins_bot = [];
-                while ($pl = mysql_fetch_assoc($sp)) {
-                    mysql_query(
-                        'UPDATE `dungeon_bots` SET `inBattle` = "' . $btl_id . '" WHERE `id2` = "' . $bot['id2'] . '" LIMIT 1'
-                    );
-                    $jui = 1;
-                    while ($jui <= $pl['colvo']) {
-                        $k = $u->addNewbot($pl['id_bot'], null, null, $logins_bot);
-                        $logins_bot = $k['logins_bot'];
-                        if ($k) {
-                            $upd = mysql_query(
-                                'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $k['id'] . '" LIMIT 1'
-                            );
-                            if ($upd) {
-                                $upd = mysql_query(
-                                    'UPDATE `stats` SET `team` = "2" WHERE `id` = "' . $k['id'] . '" LIMIT 1'
-                                );
-                                if ($upd) {
-                                    $j++;
-                                }
-                            }
-                        }
-                        $jui++;
+            if ($battleId > 0) { //Добавляем ботов
+                $addBotQuantity = 0;
+                $dungeonBots = Db::getRow('select id_bot, colvo from dungeon_bots where for_dn = 0 and dn = ? and id2 = ?', [$this->info['id'], $bot['id2']]); //Только тот, который напал и жив ли он?
+                Db::sql('update dungeon_bots set inBattle = ? where id2 = ?', [$battleId, $bot['id2']]);
+                for ($i = 1; $i <= $dungeonBots['colvo']; $i++) {
+                    $k = $u->addNewbot($dungeonBots['id_bot'], null, null);
+                    if (!$k) {
+                        continue;
                     }
+
+                    Db::sql('update users left join stats on users.id = stats.id set battle = ?, team = 2 where users.id = ?', [$battleId, $k['id']]);
+                    $addBotQuantity++;
                 }
-                unset($logins_bot);
-                if ($j > 0) {
-                    mysql_query(
-                        'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'
-                    );
-                    mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
+
+                if ($addBotQuantity > 0) {
+                    Db::sql('update users left join stats on users.id = stats.id set battle = ?, team = 1 where users.id = ?', [$battleId, $uid['id']]);
                 }
             }
+
         } else {
-            $btl_id = $btli['id'];
             //Добавляем ботов
-            $sp = mysql_query(
-                'SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `delete` = "0" AND `dn` = "' . $this->info['id'] . '" AND `id2` = "' . $bot['id2'] . '" LIMIT 1'
-            );
-            $j = 0;
-            $logins_bot = [];
-            $logins_bot_text = [];
-            $logins_bot_vars = ['time1=' . time() . ''];
-            while ($pl = mysql_fetch_assoc($sp)) {
-                mysql_query(
-                    'UPDATE `dungeon_bots` SET `inBattle` = "' . $btl_id . '" WHERE `id2` = "' . $bot['id2'] . '" LIMIT 1'
-                );
-                $jui = 1;
-                while ($jui <= $pl['colvo']) {
-                    $k = $u->addNewbot($pl['id_bot'], null, null, $logins_bot);
-                    $logins_bot = $k['logins_bot'];
-                    $logins_bot_text[] = ' <strong>' . $k['login'] . '</strong>';
-                    if ($k != false) {
-                        $upd = mysql_query(
-                            'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $k['id'] . '" LIMIT 1'
-                        );
-                        if ($upd) {
-                            $upd = mysql_query(
-                                'UPDATE `stats` SET `team` = "2" WHERE `id` = "' . $k['id'] . '" LIMIT 1'
-                            );
-                            if ($upd) {
-                                $j++;
-                            }
-                        }
-                    }
-                    $jui++;
-                }
-                if ($j > 0) {
-                    $logins_bot_text = '{tm1} В поединок вмешались: ' . implode(', ', $logins_bot_text) . '.';
-                    $logins_bot_vars = implode('||', $logins_bot_vars);
-                    $battle_log = mysql_fetch_assoc(
-                        mysql_query(
-                            'SELECT * FROM `battle_logs` WHERE `battle`=' . $btl_id . ' ORDER BY `id_hod` DESC LIMIT 1'
-                        )
-                    );
-                    if ($battle_log['id_hod'] > 0) {
-                        mysql_query(
-                            'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $btl_id . '","' . ($battle_log['id_hod'] + 1) . '","' . $logins_bot_text . '","' . $logins_bot_vars . '","","","","",1)'
-                        );
-                    }
+            $dungeonBots = Db::getRow('select id_bot, colvo from dungeon_bots where for_dn = 0 and dn = ? and id2 = ?', [$this->info['id'], $bot['id2']]);
+            Db::sql('update dungeon_bots set inBattle = ? where id2 = ?', [$battleId, $bot['id2']]);
+
+            $addBotQuantity = 0;
+            $botNamesArray = [];
+            for ($i = 1; $i <= $dungeonBots['colvo']; $i++) {
+                $k = $u->addNewbot($dungeonBots['id_bot'], null, null);
+                if (!$k) {
+                    continue;
                 }
+
+                $botNamesArray[] = $k['login'];
+                Db::sql('update users left join stats on users.id = stats.id set battle = ?, team = 2 where users.id = ?', [$battleId, $k['id']]);
+                $addBotQuantity++;
             }
-            unset($logins_bot);
-            if ($j > 0) {
-                mysql_query(
-                    'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'
-                );
-                mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
+
+            if ($addBotQuantity > 0) {
+                $turnId = Db::getValue('select id_hod from battle_logs where battle = ? order by id_hod desc limit 1', [$battleId]);
+                if ($turnId > 0) {
+                    Db::sql(
+                        "insert into battle_logs (time, battle, id_hod, text, vars, zona1, zona2, zonb1, zonb2, type) values (unix_timestamp(),?,?,?,concat('time1=', unix_timestamp()),'','','','',1)",
+                        [
+                            $battleId,
+                            $turnId + 1,
+                            '{tm1} В поединок вмешались: <strong>' . implode(', ', $botNamesArray) . '</strong>.',
+                        ]
+                    );
+                }
+
+                Db::sql('update users left join stats on users.id = stats.id set battle = ?, team = 1 where users.id = ?', [$battleId, $uid['id']]);
             }
         }
     }
@@ -2083,7 +2027,7 @@ class Dungeon
         $pos = [];
         while ($pl = mysql_fetch_assoc($sp)) {
             if (!isset($this->cord[$pl['y'] . '_' . $pl['x']])) {
-               continue;
+                continue;
             }
 
             if (
@@ -2304,18 +2248,22 @@ class Dungeon
         }
 
 
-        $botsArr = Db::getRows('select * from dungeon_bots left join test_bot on dungeon_bots.id_bot = test_bot.id where dn = ? and x <= ? and x >= ? and y <= ? and y >= ? limit 50',[
-            $u->info['dnow'], $whrVals[$this->gs][0], $whrVals[$this->gs][1], $whrVals[$this->gs][2], $whrVals[$this->gs][3],
-        ]);
+        $botsArr = Db::getRows(
+            'select * from dungeon_bots left join test_bot on dungeon_bots.id_bot = test_bot.id where dn = ? and x <= ? and x >= ? and y <= ? and y >= ? limit 50', [
+                                                                                                                                                                      $u->info['dnow'], $whrVals[$this->gs][0], $whrVals[$this->gs][1], $whrVals[$this->gs][2], $whrVals[$this->gs][3],
+                                                                                                                                                                  ]
+        );
 
         foreach ($botsArr as $pl) {
-
-//        }
-//
-//        $sp = mysql_query(
-//            'SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "' . $u->info['dnow'] . '" AND ' . $whr[$this->gs] . ' AND `u`.`delete` = "0" LIMIT 50'
-//        );
-//        while ($pl = mysql_fetch_assoc($sp)) {
+            if (!isset($this->cord[$pl['y'] . '_' . $pl['x']])) {
+                continue;
+            }
+            //        }
+            //
+            //        $sp = mysql_query(
+            //            'SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "' . $u->info['dnow'] . '" AND ' . $whr[$this->gs] . ' AND `u`.`delete` = "0" LIMIT 50'
+            //        );
+            //        while ($pl = mysql_fetch_assoc($sp)) {
             $i++;
             if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
                 $pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
@@ -2329,7 +2277,7 @@ class Dungeon
             if ($pl['noatack'] == 1 && $this->info['bsid'] == 0) {
                 $noat = 0;
             }
-            $r .= ',' . ($i - 1) . ':{9:0,0:' . $pl['id2'] . ',1:\'' . $pl['login'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:' . $pl['sex'] . ',4:\'' . str_replace(
+            $r .= ',' . ($i - 1) . ':{9:0,0:' . $pl['id2'] . ',1:\'' . $pl['login'] . '\',2:' . ((int)$this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:' . $pl['sex'] . ',4:\'' . str_replace(
                     '.gif', '', $pl['obraz']
                 ) . '\',5:\'bot\',6:' . $pos[$this->cord[$pl['y'] . '_' . $pl['x']]] . ',7:' . $dlg . ',8:' . $noat . '}';
         }
diff --git a/modules_data/location/dungeon.php b/modules_data/location/dungeon.php
index a871d583..24c0840d 100644
--- a/modules_data/location/dungeon.php
+++ b/modules_data/location/dungeon.php
@@ -549,11 +549,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                         }
                     }
 
-                    zfloor0[rz] = '<img title="' + v[1] + '" onclick="' + actionNow + '" src="//img.new-combats.tech/1x1.gif" style="cursor: pointer; position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
+                    zfloor0[rz] = '<img title="' + v[1] + '" onclick="' + actionNow + '" src="<?= Config::img() ?>/1x1.gif" style="cursor: pointer; position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
                 } else {
-                    zfloor0[rz] = '<img title="' + v[1] + '" src="//img.new-combats.tech/1x1.gif" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
+                    zfloor0[rz] = '<img title="' + v[1] + '" src="<?= Config::img() ?>/1x1.gif" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />' + zfloor0[rz];
                 }
-                r = '<img title="obj" src="//img.new-combats.tech/i/sprites/' + v[4] + '" class="dObj" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />';
+                r = '<img title="obj" src="<?= Config::img() ?>/i/sprites/' + v[4] + '" class="dObj" style="position: absolute; top: ' + new_top + 'px; left: ' + new_left + 'px; width: ' + new_w + 'px; height: ' + new_h + 'px;" />';
             }
             return r;
         }
@@ -613,11 +613,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                     if (v[5] == 'bot' || <?=$d->info['bsid'];?> > 0) {
                         action = 'dialogMenu(' + v[0] + ',' + v[8] + ',' + v[7] + ',0,0,event,' + v[9] + ');';
                     }
-                    zfloor0[rz] += '<img title="' + v[1] + '" onClick="' + action + '" src="//img.new-combats.tech/1x1.gif" style="cursor:pointer;position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
+                    zfloor0[rz] += '<img title="' + v[1] + '" onClick="' + action + '" src="<?= Config::img() ?>/1x1.gif" style="cursor:pointer;position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
                 } else {
-                    zfloor0[rz] += '<img title="' + v[1] + '" src="//img.new-combats.tech/1x1.gif" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
+                    zfloor0[rz] += '<img title="' + v[1] + '" src="<?= Config::img() ?>/1x1.gif" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
                 }
-                r = '<img title="user" src="//img.new-combats.tech/chars/' + v[3] + '/' + v[4] + '.gif" class="dUser" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
+                r = '<img title="user" src="<?= Config::img() ?>/chars/' + v[3] + '/' + v[4] + '.gif" class="dUser" style="position:absolute;top:' + new_top + 'px;left:' + new_left + 'px;width:' + new_w + 'px;height:' + new_h + 'px;" />';
             }
             return r;
         }
@@ -764,9 +764,9 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                         }
                                                         $r = '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px">
 <div style="position:relative;"><div id="vhp-1234600000' . $pl['id'] . '" title="Выполнение задания" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . $xrz . '/' . $r . '</div>
-<div title="Выполнение задания" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
-<div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234600000' . $pl['id'] . '"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
-<div title="Выполнение задания" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="//img.new-combats.tech/1x1.gif" height="10"></div>
+<div title="Выполнение задания" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="'. Config::img() .'/1x1.gif" height="9" width="1"></div>
+<div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234600000' . $pl['id'] . '"><img src="'. Config::img() .'/1x1.gif" height="9" width="1"></div>
+<div title="Выполнение задания" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="'. Config::img() .'/1x1.gif" height="10"></div>
 </div></td></tr></table><br><script>top.startHpRegen("main",-1234600000' . $pl['id'] . ',' . $xrz . ',' . $r . ',0,0,0,0,0,0,1)</script>';
 
                                                         $qsee .= '<small>Задание: &nbsp; ' . $pl['info'] . ' ' . $r . '</small><br>';
@@ -782,14 +782,14 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                             </div>
                                         </td>
                                         <td width="530" height="260" valign="top"
-                                            style="background-image:url(//img.new-combats.tech/maze_layer.jpg); background-repeat:no-repeat;">
+                                            style="background-image:url(<?= Config::img() ?>/maze_layer.jpg); background-repeat:no-repeat;">
                                             <div style="position:relative;">
 
                                                 <div style="position:absolute;z-index:1;left:397px;top:0px;">
                                                     <div id="pline1"></div>
                                                 </div>
                                                 <div style="position:absolute; z-index:50; left: 374px; top: 110px;">
-                                                    <img src="//img.new-combats.tech/podzem-map.png"/>
+                                                    <img src="<?= Config::img() ?>/podzem-map.png"/>
                                                 </div>
                                                 <div id="minimap"
                                                      style="position:absolute; left: 374px; top: 110px;">
@@ -846,7 +846,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                                 position: absolute;
                                                                 top: -8px;
                                                                 left: -6px;
-                                                            / / background-image: url("//img.new-combats.tech/drgn/bg/r.gif");
+                                                            / / background-image: url("<?= Config::img() ?>/drgn/bg/r.gif");
                                                             }
                                                         </style>
                                                     </table>
@@ -889,7 +889,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
 
                                                         $sb1 = Db::getRow('select x, y from dungeon_obj where name like ? and dn = ? limit 1', ['%Шайба%', $d->info['id']]);
                                                         while($pl = mysql_fetch_array($sp)) {
-                                                        $css = '"background-image":"url(//img.new-combats.tech/fon555.png)",';
+                                                        $css = '"background-image":"url('. Config::img() .'/fon555.png)",';
                                                         $j = 0;
 
                                                         while ($j < 4) {
@@ -902,7 +902,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                         }
 
                                                         if(!empty($sb1) && $sb1['x'] == $pl['x'] && $sb1['y'] == $pl['y'] ) {
-                                                            echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/shb.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                            echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/shb.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                         }elseif ($u->info['x'] == $pl['x'] && $u->info['y'] == $pl['y']) {
                                                             if ($d->info['id2'] == 15) {
                                                                 $tmbth = 4;
@@ -912,9 +912,9 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                                 } elseif ($tm['team'] == 2) {
                                                                     $tmbth = 2;
                                                                 }
-                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/p' . $tmbth . '/d0.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/p' . $tmbth . '/d0.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                             } else {
-                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/p1/d0.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Это Вы\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/p1/d0.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                             }
                                                         } elseif ($d->info['id2'] == 15) {
                                                             $tmbth = 4;
@@ -930,12 +930,12 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                                 )
                                                             );
                                                             if (isset($tbshin['id'])) {
-                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/shb.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                                echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/shb.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                             } else {
-                                                                echo '$("#min_' . $uxy[$pl['x'] . '_' . $pl['y']]['x'] . '_' . $uxy[$pl['x'] . '_' . $pl['y']]['y'] . '").html("<img class=\"u_rot' . $uxy[$pl['x'] . '_' . $pl['y']]['s'] . '\" title=\"' . $uxy[$pl['x'] . '_' . $pl['y']]['login'] . '\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/p' . $tmbth . '/d0.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                                echo '$("#min_' . $uxy[$pl['x'] . '_' . $pl['y']]['x'] . '_' . $uxy[$pl['x'] . '_' . $pl['y']]['y'] . '").html("<img class=\"u_rot' . $uxy[$pl['x'] . '_' . $pl['y']]['s'] . '\" title=\"' . $uxy[$pl['x'] . '_' . $pl['y']]['login'] . '\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/p' . $tmbth . '/d0.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                             }
                                                         }elseif (isset($uxy[$pl['x'] . '_' . $pl['y']])) {
-                                                            echo '$("#min_' . $uxy[$pl['x'] . '_' . $pl['y']]['x'] . '_' . $uxy[$pl['x'] . '_' . $pl['y']]['y'] . '").html("<img class=\"u_rot' . $uxy[$pl['x'] . '_' . $pl['y']]['s'] . '\" title=\"' . $uxy[$pl['x'] . '_' . $pl['y']]['login'] . '\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/p4/d0.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
+                                                            echo '$("#min_' . $uxy[$pl['x'] . '_' . $pl['y']]['x'] . '_' . $uxy[$pl['x'] . '_' . $pl['y']]['y'] . '").html("<img class=\"u_rot' . $uxy[$pl['x'] . '_' . $pl['y']]['s'] . '\" title=\"' . $uxy[$pl['x'] . '_' . $pl['y']]['login'] . '\" style=\"margin:2px 3px 3px 2px;background-image:url('. Config::img() .'/i/move/p4/d0.gif)\" src=\"'. Config::img() .'/1x1.gif\" width=\"7\" height=\"7\">");';
                                                         } elseif( isset($bxy[$pl['x'] . '_' . $pl['y']]) ) {
 
                                                         $bobrz = $bxy[$pl['x'] . '_' . $pl['y']]['obraz'];
@@ -947,7 +947,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                         }
 
                                                         ?>
-                                                        $("#min_<?=$bxy[$pl['x'] . '_' . $pl['y']]['x']?>_<?=$bxy[$pl['x'] . '_' . $pl['y']]['y']?>").html("<div style='position:relative; display:inline-block; width:1px; height:1px;'><img class='dBot' title='<?=$bxy[$pl['x'] . '_' . $pl['y']]['login']?>'  src='//img.new-combats.tech/chars/<?=$bxy[$pl['x'] . '_' . $pl['y']]['sex']?>/<?=$bobrz?>'></div>");
+                                                        $("#min_<?=$bxy[$pl['x'] . '_' . $pl['y']]['x']?>_<?=$bxy[$pl['x'] . '_' . $pl['y']]['y']?>").html("<div style='position:relative; display:inline-block; width:1px; height:1px;'><img class='dBot' title='<?=$bxy[$pl['x'] . '_' . $pl['y']]['login']?>'  src='<?= Config::img() ?>/chars/<?=$bxy[$pl['x'] . '_' . $pl['y']]['sex']?>/<?=$bobrz?>'></div>");
                                                         <?php
                                                         }
                                                         $css = rtrim($css, ',');
@@ -958,23 +958,23 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                     </script>
                                                 </div>
                                                 <div style="position:absolute; z-index:50; left: 374px; top: 110px;">
-                                                    <img src="//img.new-combats.tech/podzem-map2.png" alt=""/>
+                                                    <img src="<?= Config::img() ?>/podzem-map2.png" alt=""/>
                                                 </div>
-                                                <img src="//img.new-combats.tech/g1.jpg" title="Обновить, X:<?= $u->info['x'] ?> ,Y:<?= $u->info['y'] ?>" width="31" height="18" id="g1" style="position: absolute; cursor:pointer; left: 435px; top: 53px;" alt=""/>
+                                                <img src="<?= Config::img() ?>/g1.jpg" title="Обновить, X:<?= $u->info['x'] ?> ,Y:<?= $u->info['y'] ?>" width="31" height="18" id="g1" style="position: absolute; cursor:pointer; left: 435px; top: 53px;" alt=""/>
                                                 <?php if ($d->testGone(3) > 0) { ?>
-                                                    <img src="//img.new-combats.tech/g2.jpg" onclick="goToLoca(3,'направо');" width="27" height="48" id="g2" style="position:absolute;cursor:pointer; left: 492px; top: 40px;" alt=""/>
+                                                    <img src="<?= Config::img() ?>/g2.jpg" onclick="goToLoca(3,'направо');" width="27" height="48" id="g2" style="position:absolute;cursor:pointer; left: 492px; top: 40px;" alt=""/>
                                                 <?php }
                                                 if ($d->testGone(4) > 0) { ?>
-                                                    <img src="//img.new-combats.tech/g3.jpg" onclick="goToLoca(4,'налево');" width="28" height="46" id="g3" style="position:absolute;cursor:pointer; left: 382px; top: 40px;" alt=""/>
+                                                    <img src="<?= Config::img() ?>/g3.jpg" onclick="goToLoca(4,'налево');" width="28" height="46" id="g3" style="position:absolute;cursor:pointer; left: 382px; top: 40px;" alt=""/>
                                                 <?php }
                                                 if ($d->testGone(2) > 0) { ?>
-                                                    <img src="//img.new-combats.tech/g4.jpg" onclick="goToLoca(2,'назад');" width="45" height="25" id="g4" style="position:absolute;cursor:pointer; left: 428px; top: 72px;" alt=""/>
+                                                    <img src="<?= Config::img() ?>/g4.jpg" onclick="goToLoca(2,'назад');" width="45" height="25" id="g4" style="position:absolute;cursor:pointer; left: 428px; top: 72px;" alt=""/>
                                                 <?php }
                                                 if ($d->testGone(1) > 0) { ?>
-                                                    <img src="//img.new-combats.tech/g5.jpg" onclick="goToLoca(1,'вперед');" width="46" height="26" id="g5" style="position:absolute;cursor:pointer; left: 428px; top: 26px;" alt=""/>
+                                                    <img src="<?= Config::img() ?>/g5.jpg" onclick="goToLoca(1,'вперед');" width="46" height="26" id="g5" style="position:absolute;cursor:pointer; left: 428px; top: 26px;" alt=""/>
                                                 <?php } ?>
-                                                <img src="//img.new-combats.tech/g6.jpg" width="30" height="19" id="g6" style="position:absolute;cursor:pointer; left: 399px; top: 28px;" alt=""/>
-                                                <img src="//img.new-combats.tech/g7.jpg" width="24" height="19" id="g7" style="position:absolute;cursor:pointer; left: 476px; top: 28px;" alt=""/>
+                                                <img src="<?= Config::img() ?>/g6.jpg" width="30" height="19" id="g6" style="position:absolute;cursor:pointer; left: 399px; top: 28px;" alt=""/>
+                                                <img src="<?= Config::img() ?>/g7.jpg" width="24" height="19" id="g7" style="position:absolute;cursor:pointer; left: 476px; top: 28px;" alt=""/>
                                                 <div id="Dungeon" class="Dungeon" style="width:352px;height:240px;padding:0;margin:10px;text-align:center;">
                                                     <!-- / MAP \ -->
 
@@ -1032,7 +1032,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
                                                         28 => 'RightSide0_0',
                                                     ];
                                                     foreach ($map as $k => $v) {
-                                                        if ($d->walls[$k] === 1) {
+                                                        if (isset($d->walls[$k]) && $d->walls[$k] === 1) {
                                                             continue;
                                                         }
                                                         $map[$k] = '';