From 2bc67ce543ac62a393ff0b4053be0b0ff5cdb4a6 Mon Sep 17 00:00:00 2001 From: Ivor Barhansky Date: Sun, 16 Apr 2023 02:54:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B5=D0=B7=D0=B4=20im?= =?UTF-8?q?pstats=20=D0=B8=20additem..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _incl_data/class/Battle.php | 22 +- _incl_data/class/BotLogic.php | 10 +- _incl_data/class/Dialog.php | 30 +- _incl_data/class/Dungeon.php | 2 +- _incl_data/class/DungeonEditor.php | 2 +- _incl_data/class/FightRequest.php | 6 +- _incl_data/class/Location/DeathTower.php | 170 +++++++++ _incl_data/class/Magic.php | 2 +- _incl_data/class/Priems.php | 75 ++-- _incl_data/class/User.php | 345 +++--------------- _incl_data/class/User/ItemsModel.php | 86 +++++ _incl_data/class/User/Register.php | 2 +- _incl_data/class/dnaction/101/laba1.php | 2 +- _incl_data/class/dnaction/108/fontan2.php | 2 +- _incl_data/class/dnaction/108/fontan3.php | 2 +- _incl_data/class/dnaction/12/fontan1.php | 2 +- _incl_data/class/dnaction/12/fontan2.php | 2 +- _incl_data/class/dnaction/12/fontan3.php | 2 +- _incl_data/class/dnaction/12/fontan4.php | 2 +- _incl_data/class/dnaction/15/shaiba.php | 2 +- .../class/dnaction/_dungeon_replace.php | 2 +- _incl_data/class/magic/hny2012.php | 20 +- _incl_data/class/magic/hny2014.php | 16 +- _incl_data/class/magic/ironbad.php | 2 +- _incl_data/class/magic/irongod.php | 2 +- _incl_data/class/magic/ironnorm.php | 2 +- _incl_data/class/magic/pandorax.php | 6 +- _incl_data/class/magic/ruletka.php | 2 +- _incl_data/class/magic/sunduk_ov.php | 6 +- _incl_data/class/magic/sunduk_ov2.php | 12 +- _incl_data/class/magic/sunduk_ov3.php | 20 +- _incl_data/class/magic/toms.php | 2 +- _incl_data/class/magic/upexp.php | 2 +- _incl_data/class/priem/121.php | 2 +- _incl_data/class/priem/122.php | 2 +- _incl_data/class/priem/123.php | 2 +- _incl_data/class/priem/124.php | 2 +- _incl_data/class/priem/125.php | 2 +- _incl_data/class/priem/192.php | 2 +- _incl_data/class/priem/205.php | 2 +- _incl_data/class/priem/21.php | 2 +- _incl_data/class/priem/22.php | 2 +- _incl_data/class/priem/23.php | 2 +- _incl_data/class/priem/241.php | 2 +- _incl_data/class/priem/244.php | 2 +- _incl_data/class/priem/247.php | 2 +- _incl_data/class/priem/251.php | 2 +- _incl_data/class/priem/252.php | 2 +- _incl_data/class/priem/262.php | 4 +- _incl_data/class/priem/263.php | 2 +- _incl_data/class/priem/280.php | 2 +- _incl_data/class/priem/282.php | 2 +- _incl_data/class/priem/294.php | 2 +- _incl_data/class/priem/295.php | 2 +- _incl_data/class/priem/296.php | 2 +- _incl_data/class/priem/299.php | 2 +- _incl_data/class/priem/300.php | 2 +- _incl_data/class/priem/301.php | 2 +- _incl_data/class/priem/36.php | 2 +- _incl_data/class/priem/42.php | 2 +- _incl_data/class/priem/70.php | 2 +- _incl_data/class/priem/71.php | 2 +- _incl_data/class/priem/72.php | 2 +- _incl_data/class/priem/73.php | 2 +- _incl_data/class/priem/74.php | 2 +- _incl_data/class/priem/75.php | 2 +- _incl_data/class/priem/76.php | 2 +- _incl_data/class/priem/77.php | 2 +- _incl_data/class/priem/78.php | 2 +- _incl_data/class/priem/79.php | 2 +- _incl_data/class/priem/80.php | 2 +- _incl_data/class/priem/81.php | 2 +- _incl_data/class/priem/82.php | 2 +- _incl_data/class/priem/83.php | 2 +- _incl_data/class/priem/84.php | 2 +- _incl_data/class/priem/85.php | 2 +- _incl_data/class/priem/86.php | 2 +- _incl_data/class/priem/87.php | 2 +- _incl_data/class/priem/88.php | 2 +- _incl_data/class/priem/89.php | 2 +- _incl_data/class/priem/90.php | 2 +- _incl_data/class/priems/air.php | 4 +- _incl_data/class/priems/bloodring.php | 2 +- _incl_data/class/priems/bloodring2.php | 4 +- _incl_data/class/priems/bloodring2_end.php | 2 +- _incl_data/class/priems/bot_priems1.end.php | 2 +- _incl_data/class/quest/1september_obmen1.php | 2 +- _incl_data/class/quest/1september_obmen2.php | 2 +- _incl_data/class/quest/1september_obmen3.php | 2 +- _incl_data/class/quest/1september_obmen4.php | 2 +- _incl_data/class/quest/1september_obmen5.php | 2 +- _incl_data/class/quest/dailyquestend.php | 28 +- _incl_data/class/quest/transferpilchar.php | 2 +- lotowork.php | 2 +- lotoworkekr.php | 2 +- main.php | 8 +- main_bot.php | 4 +- modules_data/1_panel.php | 2 +- modules_data/3_panel.php | 2 +- modules_data/7_panel.php | 2 +- modules_data/_mod.php | 4 +- modules_data/_umenie.php | 4 +- modules_data/act_trf.php | 2 +- modules_data/add_eff.php | 2 +- modules_data/location/_shop_referal_.php | 2 +- modules_data/location/ab/hram.php | 6 +- modules_data/location/ab/hramOLD.php | 4 +- modules_data/location/altar_cat.php | 4 +- modules_data/location/an/flower.php | 4 +- modules_data/location/an/remont.php | 26 +- modules_data/location/an/shop_.php | 2 +- modules_data/location/an/znahar.php | 6 +- modules_data/location/dragopsh.php | 8 +- modules_data/location/elka.php | 2 +- modules_data/location/flower.php | 4 +- modules_data/location/katok.php | 22 +- modules_data/location/miloserdie.php | 2 +- modules_data/location/padalshik.php | 2 +- modules_data/location/remont.php | 28 +- modules_data/location/shop_.php | 2 +- modules_data/location/spavedlivost.php | 2 +- modules_data/location/znahar.php | 6 +- modules_data/moder/usemarry.php | 4 +- modules_data/moder/useunmarry.php | 4 +- modules_data/stats_loc.php | 4 +- modules_data/vip.php | 2 +- modules_data/vip1.php | 2 +- 127 files changed, 584 insertions(+), 612 deletions(-) create mode 100644 _incl_data/class/Location/DeathTower.php diff --git a/_incl_data/class/Battle.php b/_incl_data/class/Battle.php index 34d9452b..22a48e15 100644 --- a/_incl_data/class/Battle.php +++ b/_incl_data/class/Battle.php @@ -1663,7 +1663,7 @@ class Battle $i01 = 1; while ($i01 <= (($this->info['izlomObr'] - $this->info['izlomObrNow'])) * 7) { - $u->addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']); $i01++; } mysql_query( @@ -2182,18 +2182,18 @@ class Battle if (isset($pld['id'])) { if ($this->users[$i]['battle_yron'] >= 500) { - $u->addItem(4754, $pld['id'], ''); - $u->addItem(4754, $pld['id'], ''); - $u->addItem(4754, $pld['id'], ''); - $u->addItem(4754, $pld['id'], ''); - $u->addItem(4754, $pld['id'], ''); + \User\ItemsModel::addItem(4754, $pld['id'], ''); + \User\ItemsModel::addItem(4754, $pld['id'], ''); + \User\ItemsModel::addItem(4754, $pld['id'], ''); + \User\ItemsModel::addItem(4754, $pld['id'], ''); + \User\ItemsModel::addItem(4754, $pld['id'], ''); $pld['battle_text'] .= ' За Героическое Сражение вы получаете Реликвия Ангела (x5). '; mysql_query( 'UPDATE `users_achiv` SET `pg`= `pg`+1 WHERE `id` = "' . $pld['id'] . '" LIMIT 1' ); if ($this->users[$i]['team'] == $this->info['team_win'] && rand(1, 100) <= 5) { - $u->addItem(10020, $pld['id'], ''); + \User\ItemsModel::addItem(10020, $pld['id'], ''); $pld['battle_text'] .= ' и Жетон Успеха. '; } } else { @@ -3153,7 +3153,7 @@ class Battle } $tmoni = 1; while ($tmoni <= floor($tmon / 2)) { - $u->addItem(4754, $this->users[$i]['id'], ''); // + \User\ItemsModel::addItem(4754, $this->users[$i]['id'], ''); // $tmoni++; } $this->users[$i]['battle_text'] .= ' За призовой хаот вы получаете Призовой Жетон (x' . floor( @@ -3313,7 +3313,7 @@ class Battle } while ($tmoni >= 1) { if ($u->info['ang_g'] < $limitg) { - $u->addItem(4754, $this->users[$i]['id'], ''); + \User\ItemsModel::addItem(4754, $this->users[$i]['id'], ''); mysql_query( 'UPDATE `users` SET `ang_g`=`ang_g`+1 WHERE `id` =' . $this->users[$i]['id'] . '' ); @@ -3334,7 +3334,7 @@ class Battle if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)) { //Хэллоуин 4504 $this->users[$i]['battle_text'] .= ' Вы получаете Тыква (x1).'; - $u->addItem(4504, $this->users[$i]['id'], '|sudba=1'); + \User\ItemsModel::addItem(4504, $this->users[$i]['id'], '|sudba=1'); } } @@ -4144,7 +4144,7 @@ class Battle if ($itm_e[0] > 0) { $j = 0; while ($j < $itm_e[1]) { - $u->addItem($itm_e[0], $uid, '|' . $itm_e[2]); + \User\ItemsModel::addItem($itm_e[0], $uid, '|' . $itm_e[2]); $j++; } if (!isset($this->ainm[$itm_e[0]])) { diff --git a/_incl_data/class/BotLogic.php b/_incl_data/class/BotLogic.php index df41510c..4de6d5b7 100644 --- a/_incl_data/class/BotLogic.php +++ b/_incl_data/class/BotLogic.php @@ -123,7 +123,7 @@ class BotLogic $cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "' . self::$bot['id'] . '" AND `delete` = "0" LIMIT 1')); if (!isset($cr['id'])) { //Покупаем кристалл - $u->addItem(1204, self::$bot['id']); + \User\ItemsModel::addItem(1204, self::$bot['id']); } } //Переходим в комнату для сражений @@ -194,7 +194,7 @@ class BotLogic while ($i <= 20) { if ($com['e' . $i] > 0) { //Выдаем и надеваем предмет - //$it = $u->addItem($com['e'.$i],self::$bot['id']); + //$it = \User\ItemsModel::addItem($com['e'.$i],self::$bot['id']); $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $com['e' . $i] . '" LIMIT 1')); mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . self::$bot['id'] . '","' . $eff['mname'] . '","' . (time() + 9640000) . '","' . $eff['mdata'] . '","' . $eff['noAce'] . '")'); } @@ -205,7 +205,7 @@ class BotLogic while ($i <= 20) { if ($com['w' . $i] > 0) { //Выдаем и надеваем предмет - $it = $u->addItem($com['w' . $i], self::$bot['id']); + $it = \User\ItemsModel::addItem($com['w' . $i], self::$bot['id']); $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `item_id` = "' . $com['w' . $i] . '" LIMIT 1')); if ($it > 0) { mysql_query('UPDATE `items_users` SET `inOdet` = "' . $i . '",`delete` = "0", `1price` = "' . $eff1['price_1'] . '" WHERE `uid` = "' . self::$bot['id'] . '" AND `id` = "' . $it . '" LIMIT 1'); @@ -314,7 +314,7 @@ class BotLogic while ($i <= 20) { if ($com['e' . $i] > 0) { //Выдаем и надеваем предмет - //$it = $u->addItem($com['e'.$i],self::$bot['id']); + //$it = \User\ItemsModel::addItem($com['e'.$i],self::$bot['id']); $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $com['e' . $i] . '" LIMIT 1')); mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . self::$bot['id'] . '","' . $eff['mname'] . '","' . (time() + 86400 * 7) . '","' . $eff['mdata'] . '","' . $eff['noAce'] . '")'); } @@ -1007,7 +1007,7 @@ class BotLogic if (self::$bot['level'] <= 5 && self::$bot['exp'] >= 12499) { $cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "' . self::$bot['id'] . '" AND `delete` = "0" LIMIT 1')); if (!isset($cr['id'])) { - $u->addItem(1204, self::$bot['id']); + \User\ItemsModel::addItem(1204, self::$bot['id']); self::$bot['exp'] = 12500; } } diff --git a/_incl_data/class/Dialog.php b/_incl_data/class/Dialog.php index a82fccbb..f5391e6e 100644 --- a/_incl_data/class/Dialog.php +++ b/_incl_data/class/Dialog.php @@ -208,7 +208,7 @@ class Dialog //Выдаем предмет для квеста $itmb = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $act1[8] . '" LIMIT 1')); if (isset($itmb['id'])) { - $u->addItem($act1[8], $u->info['id'], '|nodelete=1'); + \User\ItemsModel::addItem($act1[8], $u->info['id'], '|nodelete=1'); $txt .= '
Вы получили предмет "' . $itmb['name'] . '"'; } } @@ -234,7 +234,7 @@ class Dialog } $txt .= ''; - $u->addItem($itmb['id'], $u->info['id'], $act1dt); + \User\ItemsModel::addItem($itmb['id'], $u->info['id'], $act1dt); $pg = $act1[4]; } } else { @@ -263,7 +263,7 @@ class Dialog } $ic2 = 1; while ($ic2 <= $act3[2]) { - $u->addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]); + \User\ItemsModel::addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]); $ic2++; } } @@ -393,7 +393,7 @@ class Dialog if ($upd) { if ($itik > 0) { //Выдаем предметы - $u->addItem($itik, $u->info['id'], '|nosale=1|srok=' . (7 * 86400) . '', null, 1); + \User\ItemsModel::addItem($itik, $u->info['id'], '|nosale=1|srok=' . (7 * 86400) . '', null, 1); $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itik . '" LIMIT 1')); $txt = 'Вы получили предмет "' . $itm_nm['name'] . '"'; } else { @@ -413,7 +413,7 @@ class Dialog } $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; if ($arts_1 > 0) { - $u->addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); + \User\ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); } $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1')); @@ -433,7 +433,7 @@ class Dialog } $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; if ($arts_1 > 0) { - $u->addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); + \User\ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); } $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1')); @@ -523,7 +523,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -569,7 +569,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -615,7 +615,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -647,7 +647,7 @@ class Dialog if (isset($keypr1['id'], $keypr2['id'])) { mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr1['id'] . '" OR `id` = "' . $keypr2['id'] . '" LIMIT 2'); $data = '|frompisher=' . $d->info['id2']; - $u->addItem(2555, $u->info['id'], $data); + \User\ItemsModel::addItem(2555, $u->info['id'], $data); $txt = 'Вы успешно получили "Пирамидальный ключ"'; } @@ -690,7 +690,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr['id'] . '" LIMIT 1'); @@ -746,7 +746,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr['id'] . '" LIMIT 1'); @@ -802,7 +802,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - $u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i][$j]['add'][1] . ' x' . $t[0] . '
'; @@ -957,7 +957,7 @@ class Dialog $qsw = 0; while ($qsw < $item['colvo']) { $txt .= '
Вы получили предмет'; - $u->addItem($item['item_id'], $u->info['id']); + \User\ItemsModel::addItem($item['item_id'], $u->info['id']); $qsw++; } } @@ -1215,7 +1215,7 @@ class Dialog $val = 4799; } } - $u->addItem($val, $u->info['id'], $data_itm); + \User\ItemsModel::addItem($val, $u->info['id'], $data_itm); $i1++; } } elseif ($var == 'up') { diff --git a/_incl_data/class/Dungeon.php b/_incl_data/class/Dungeon.php index baa6a17a..efea8bc0 100644 --- a/_incl_data/class/Dungeon.php +++ b/_incl_data/class/Dungeon.php @@ -1309,7 +1309,7 @@ class Dungeon } $data = str_replace('|sudba=-1', '|sudba=' . $u->info['login'] . '', $data); - $idl = $u->addItem($obj['item_id'], $u->info['id'], $data, $obj); + $idl = \User\ItemsModel::addItem($obj['item_id'], $u->info['id'], $data, $obj); if ($obj['del'] > 0) { mysql_query( 'UPDATE `items_users` SET `dn_delete` = 1 WHERE `id` = "' . $idl . '" LIMIT 1' diff --git a/_incl_data/class/DungeonEditor.php b/_incl_data/class/DungeonEditor.php index dd5aaf60..d8e648bf 100644 --- a/_incl_data/class/DungeonEditor.php +++ b/_incl_data/class/DungeonEditor.php @@ -20,7 +20,7 @@ class DungeonEditor $this->bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "' . $u->info['city'] . '" AND `id` = "' . $this->info['bsid'] . '" AND `time_start` = "' . $this->info['time_start'] . '" LIMIT 1')); //Если БС закончена if (isset($this->bs['id']) && $this->bs['users'] - $this->bs['users_finish'] < 2) { - $u->bsfinish($this->bs, false, null); + \Location\DeathTower::finish($this->bs, false, null); } } diff --git a/_incl_data/class/FightRequest.php b/_incl_data/class/FightRequest.php index b83263c5..5f88f2ea 100644 --- a/_incl_data/class/FightRequest.php +++ b/_incl_data/class/FightRequest.php @@ -341,10 +341,10 @@ class FightRequest Db::sql('delete from stats where id = ?', [$user['id']]); Db::sql('delete from items_users where uid = ?', [$user['id']]); Db::sql('delete from eff_users where uid = ?', [$user['id']]); - $this->u->addItem(4754, $user['id']); + \Core\ConversionHelper::dataStringToArray(4754, $user['id']); } } else { - $this->u->addItem(4754, $user['id']); + \Core\ConversionHelper::dataStringToArray(4754, $user['id']); } } return [ @@ -1605,7 +1605,7 @@ class FightRequest $items = $classItems[$sellclass]; foreach ($items as $slot => $itemId) { - $re = $this->u->addItem($itemId, $uidb); + $re = \Core\ConversionHelper::dataStringToArray($itemId, $uidb); $stmt1->execute([$slot, $re]); $stmt2->execute([$itemId, $re]); } diff --git a/_incl_data/class/Location/DeathTower.php b/_incl_data/class/Location/DeathTower.php new file mode 100644 index 00000000..e67cc122 --- /dev/null +++ b/_incl_data/class/Location/DeathTower.php @@ -0,0 +1,170 @@ + 0 || $bu[$i]['nich']) { + mysql_query( + 'UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "' . $id['id'] . '" LIMIT 1' + ); + /* */ + if ($bu['inBot'] == 0) { + $pls1 = mysql_fetch_array( + mysql_query( + 'SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1' + ) + ); + if (isset($pls1['id'])) { + mysql_query('DELETE FROM `users` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); + + // + $spi = mysql_query( + 'SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $bu[$i]['id'] . '" LIMIT 500' + ); + $ins = ''; + while ($pli = mysql_fetch_array($spi)) { + $ins .= '("' . $di['dn_id'] . '","' . $pli['item_id'] . '","' . time( + ) . '","' . $di['x'] . '","' . $di['y'] . '"),'; + } + + $ins = rtrim($ins, ','); + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ' . $ins . '' + ); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `bs_zv` SET `finish` = "' . time( + ) . '" WHERE `id` = "' . $pls1['id'] . '" LIMIT 1' + ); + mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pls1['uid'] . '" LIMIT 1'); + } + } + $id['users_finish']++; + } + $i++; + } + } + if ($id['users'] - $id['users_finish'] >= 2) { + return; + } + $win = []; + $sp = mysql_query( + 'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = "0" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100' + ); + while ($pl = mysql_fetch_array($sp)) { + $ur = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1' + ) + ); + $ub = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1' + ) + ); + if (isset($ur['id']) && isset($ub['id']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) { + $win = $ub; + $winr = $ur; + } + } + + $chat = new Chat(); + $cmsg = new ChatMessage(); + + /* */ + if (isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) { + // + $bsep = 0; + if ($winr['level'] < 6) { + $bsep = 2500; + } elseif ($winr['level'] < 7) { + $bsep = 5000; + } elseif ($winr['level'] < 8) { + $bsep = 15000; + } elseif ($winr['level'] < 9) { + $bsep = 25000; + } else { + $bsep = 50000; + } + /* */ + $mn = (round($id['money'] / 100 * 85)); + mysql_query( + 'UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' + ); + /* */ + $cmsg->setTo($winr['login']); + $cmsg->setText( + "! " "! : $bsep, : $mn ." + ); + $cmsg->setType(6); + $chat->sendMsg($cmsg); + + $cmsg->setTo(''); + $cmsg->setIsAlert(true); + $cmsg->setText( + " " ", : {$winr['login']}! !" + ); + $cmsg->setType(5); + $chat->sendMsg($cmsg); + + $user->addDelo( + 1, $uid, + '"WinTournament.' . $user->info['city'] . '" ( ): "' . $mn . ' ."', + time(), $user->info['city'], 'WinTournament.' . $user->info['city'], 0, 0 + ); + } else { + /* */ + $cmsg->setIsAlert(true); + $cmsg->setType(5); + $cmsg->setText(' , : .'); + } + + $sp = mysql_query( + 'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100' + ); + while ($pl = mysql_fetch_array($sp)) { + $ur = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1' + ) + ); + $ub = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1' + ) + ); + if (isset($ub['id'])) { + //del + mysql_query('DELETE FROM `users` WHERE `id` = "' . $ub['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $ub['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500'); + //upd + mysql_query( + 'UPDATE `bs_zv` SET `finish` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'); + } + } + } +} \ No newline at end of file diff --git a/_incl_data/class/Magic.php b/_incl_data/class/Magic.php index 592d2cb7..60604f42 100644 --- a/_incl_data/class/Magic.php +++ b/_incl_data/class/Magic.php @@ -1828,7 +1828,7 @@ class Magic $trnt .= $pl['login'] . ' Комната : ' . $rrm['name'] . ', '; } $trnt = rtrim($trnt, ', '); - $it_ = $u->addItem( + $it_ = \User\ItemsModel::addItem( 2435, $u->info['id'], 'noodet=1|noremont=1|sudba=' . $u->info['login'] . '' ); mysql_query( diff --git a/_incl_data/class/Priems.php b/_incl_data/class/Priems.php index d7d4ded1..23657abe 100644 --- a/_incl_data/class/Priems.php +++ b/_incl_data/class/Priems.php @@ -1,5 +1,6 @@ impStats($data); + $data = ConversionHelper::arrayToDataString($data); Db::sql( 'update eff_users set x = ?, data = ? where uid = ? and `delete` = 0 and v2 = 260 and user_use = ?', [$x, $data, $uid, $this->u->info['id']] @@ -415,40 +416,6 @@ class Priems return $r; } - /** Превращает строку data ('a=1|b=2|c=3') из БД в массив [a=>1, b=>2, c=>3]. - * @param $m - * @return array - */ - public function lookStatsArray($m) - { - $arr = json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $m . '}'), true); - return $arr ?: []; - } - - /** Превращает массив [a=>1, b=>2, c=>3] в строку data ('a=1|b=2|c=3') для БД. - * @param array $m - * @return string - */ - private function impStats(array $m) - { - $str = json_encode($m); - return $str ? str_replace(['":', ',"', '{"', '}'], ['=', '|'], $str) : ''; - } - - /** - * @param $data - * @param array $values - * @return string - */ - private function changeStatsData($data, array $values) - { - $arr = $this->lookStatsArray($data); - foreach ($values as $key => $value) { - $arr[$key] = $value; - } - return $this->impStats($arr); - } - public function magicRegen($ue, $hpmin, $tmp, $pl, $eff, $rp = 0, $dp = 0, $krituet = true, $dopyrn = 0) { global $btl; @@ -533,7 +500,7 @@ class Priems mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1') ); if (isset($pl2['priem']['id'])) { - $dt1 = $this->lookStatsArray($pl2['priem']['date2']); + $dt1 = ConversionHelper::dataStringToArray($pl2['priem']['date2']); if (isset($dt1['yron_u2'])) { $minu = $this->getdr( @@ -1041,7 +1008,7 @@ class Priems mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1') ); if (isset($pl2['priem']['id'])) { - $dt1 = $this->lookStatsArray($pl2['priem']['date2']); + $dt1 = ConversionHelper::dataStringToArray($pl2['priem']['date2']); if (isset($dt1['yron_u2'])) { $minu = $this->getdr( $dt1['yron_u2'], [0 => 'lvl1', 1 => 'yr1', 2 => 'ts5', 3 => 'ts6'], @@ -1661,8 +1628,8 @@ class Priems public function plusData($d1, $d2) { global $u; - $j1 = $this->lookStatsArray($d1); - $j2 = $this->lookStatsArray($this->redate($d2, $this->u->info['id'])); + $j1 = ConversionHelper::dataStringToArray($d1); + $j2 = ConversionHelper::dataStringToArray($this->redate($d2, $this->u->info['id'])); $v = $this->u->lookKeys($this->redate($d2, $this->u->info['id']), 0); // ключи 2 //добавляем данные друг к другу $i = 0; @@ -1680,7 +1647,7 @@ class Priems $i++; } $inf = rtrim($inf, ', '); - $j1 = $this->u->impStats($j1); + $j1 = ConversionHelper::arrayToDataString($j1); return $j1; } @@ -1688,7 +1655,7 @@ class Priems { global $u, $btl; $rcu = false; - $j = $this->lookStatsArray($pl['date2']); + $j = ConversionHelper::dataStringToArray($pl['date2']); $mpr = false; $addch = 0; $uid = $this->u->info['id']; @@ -1790,8 +1757,8 @@ class Priems } } elseif ($j['onlyOne'] > 1) { if ($mpr['x'] < $j['onlyOne'] && isset($j['date3Plus'])) { - $j1 = $this->lookStatsArray($mpr['data']); - $j2 = $this->lookStatsArray($this->redate($pl['date3'], $this->u->info['id'])); + $j1 = ConversionHelper::dataStringToArray($mpr['data']); + $j2 = ConversionHelper::dataStringToArray($this->redate($pl['date3'], $this->u->info['id'])); $v = $this->u->lookKeys($this->redate($pl['date3'], $this->u->info['id']), 0); // ключи 2 //добавляем данные друг к другу $i = 0; @@ -1809,7 +1776,7 @@ class Priems $i++; } $inf = rtrim($inf, ', '); - $j1 = $this->u->impStats($j1); + $j1 = ConversionHelper::arrayToDataString($j1); $pld[0] = ' x' . ($mpr['x'] + 1); if ($j['refHod'] == 1) { $mpr['hod'] = $pl['limit']; @@ -1982,7 +1949,7 @@ class Priems $this->u->info['priems_z'] = $pz; $btl->users[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; $btl->stats[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; - $tr = $this->lookStatsArray($pl['tr']); + $tr = ConversionHelper::dataStringToArray($pl['tr']); if (isset($tr['tr_mpNow'])) { $tr['tr_mpNow'] = round($tr['tr_mpNow'] / 100 * (100 - $this->u->stats['min_use_mp'])); $btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] -= $tr['tr_mpNow']; @@ -2167,8 +2134,8 @@ class Priems public function testpriem($pl, $t = 1, $o = 0) { global $c, $u, $code, $btl; - $tr = $this->lookStatsArray($pl['tr']); - $d2 = $this->lookStatsArray($pl['date2']); + $tr = ConversionHelper::dataStringToArray($pl['tr']); + $d2 = ConversionHelper::dataStringToArray($pl['date2']); $x = 1; $notr = 0; @@ -2342,7 +2309,7 @@ class Priems { global $u, $c, $code, $btl; $pz = explode('|', $this->u->info['priems_z']); - $tr = $this->lookStatsArray($pl['tr']); + $tr = ConversionHelper::dataStringToArray($pl['tr']); $trs = ''; $x = 0; $notr = 0; @@ -2586,7 +2553,7 @@ class Priems ); $leveledDamage = $baseDamage[$level] + 40 / 100 * (5 * $magicTargetTier); - list($damage, $isCrit, $isMiss) = $this->magicAttack( + [$damage, $isCrit, $isMiss] = $this->magicAttack( $btl, $this->u->info['id'], $this->ue['id'], $leveledDamage, self::FIRE, 1 ); //Используем проверку на урон приемов @@ -2668,7 +2635,7 @@ class Priems ) : $pl['date3']; // Костыль. Будет работать, пока приём изменяет ОДИН параметр. - $effect = "Защита от магии {$data[$element][1]}: " . current($this->lookStatsArray($dataStr)); + $effect = "Защита от магии {$data[$element][1]}: " . current(ConversionHelper::dataStringToArray($dataStr)); $color = $this->logColor[$element]; $name = "Цель {$data[$element][1]}"; @@ -2715,7 +2682,7 @@ class Priems }//Проверяем эффект $prv['j_priem'] = $btl->stats[$btl->uids[$u1]]['u_priem'][$j_id][0]; - $pvr['data'] = $this->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pName = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['name']; $pvr['hp'] = $pvr['data']['atgm']; @@ -2763,7 +2730,7 @@ class Priems private function devouringFlameInit($id, array $pl, Battle $btl) { $baseDamage = [6 => 53, 7 => 63, 8 => 77, 9 => 91, 10 => 110, 11 => 133,]; - list($damage, , $isMiss) = $this->magicAttack( + [$damage, , $isMiss] = $this->magicAttack( $btl, $this->u->info['id'], $this->ue['id'], $baseDamage[$pl['level']], self::FIRE ); if ($isMiss || $damage <= 0) { @@ -2777,7 +2744,7 @@ class Priems $logText, $btl->hodID + 1 ); - $data = $this->impStats(['atgm' => max(floor($damage / 5), 1)]); + $data = ConversionHelper::arrayToDataString(['atgm' => max(floor($damage / 5), 1)]); $this->addPriem( $this->ue['id'], $pl['id'], $data, 0, 77, 5, $this->u->info['id'], 1, 'пожирающеепламя', 0, 0, 1 @@ -2801,7 +2768,7 @@ class Priems $datas = Db::getColumn($q, array_fill(0, 3, $this->ue['id'])); $stats = array_fill_keys(['s1', 's2', 's3', 's5', 's6'], 0); foreach ($datas as $data) { - $data = $this->lookStatsArray($data); + $data = ConversionHelper::dataStringToArray($data); print_r($data); foreach (array_keys($stats) as $stat) { if (isset($data[$stat])) { diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index 97a2f8b8..3d6177af 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -4,6 +4,7 @@ use Core\Config; use Core\ConversionHelper; use Core\Database; use Core\Db; +use User\ItemsModel; class User { @@ -911,6 +912,9 @@ class User return $e; } + /** Singletone. + * @return User + */ public static function start(): User { if (!isset(self::$flag_one)) { @@ -931,188 +935,6 @@ class User return $r; } - public function bsfinish($id, $bu, $di) - { - if ($bu) { - /* в этом бою проверяем юзеров */ - $i = 0; - while ($i < count($bu[$i])) { - if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) { - mysql_query( - 'UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1' - ); - mysql_query( - 'UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "' . $id['id'] . '" LIMIT 1' - ); - /* удаляем юзера */ - if ($bu['inBot'] == 0) { - $pls1 = mysql_fetch_array( - mysql_query( - 'SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1' - ) - ); - if (isset($pls1['id'])) { - mysql_query('DELETE FROM `users` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); - - //выкидываем предметы на землю - $spi = mysql_query( - 'SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $bu[$i]['id'] . '" LIMIT 500' - ); - $ins = ''; - while ($pli = mysql_fetch_array($spi)) { - $ins .= '("' . $di['dn_id'] . '","' . $pli['item_id'] . '","' . time( - ) . '","' . $di['x'] . '","' . $di['y'] . '"),'; - } - - $ins = rtrim($ins, ','); - mysql_query( - 'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ' . $ins . '' - ); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1'); - mysql_query( - 'UPDATE `bs_zv` SET `finish` = "' . time( - ) . '" WHERE `id` = "' . $pls1['id'] . '" LIMIT 1' - ); - mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pls1['uid'] . '" LIMIT 1'); - } - } - $id['users_finish']++; - } - $i++; - } - } - if ($id['users'] - $id['users_finish'] >= 2) { - return; - } - $win = []; - $sp = mysql_query( - 'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = "0" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100' - ); - while ($pl = mysql_fetch_array($sp)) { - $ur = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1' - ) - ); - $ub = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1' - ) - ); - if (isset($ur['id']) && isset($ub['id']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) { - $win = $ub; - $winr = $ur; - } - } - - $chat = new Chat(); - $cmsg = new ChatMessage(); - - /* завершаем БС */ - if (isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) { - //есть победитель - $bsep = 0; - if ($winr['level'] < 6) { - $bsep = 2500; - } elseif ($winr['level'] < 7) { - $bsep = 5000; - } elseif ($winr['level'] < 8) { - $bsep = 15000; - } elseif ($winr['level'] < 9) { - $bsep = 25000; - } else { - $bsep = 50000; - } - /* Выдаем приз */ - $mn = (round($id['money'] / 100 * 85)); - mysql_query( - 'UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' - ); - mysql_query( - 'UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' - ); - /* чат */ - $cmsg->setTo($winr['login']); - $cmsg->setText( - "Поздравляем! Вы победили в турнире "Башня Смерти"! Получено опыта: $bsep, деньги: $mn кр." - ); - $cmsg->setType(6); - $chat->sendMsg($cmsg); - - $cmsg->setTo(''); - $cmsg->setIsAlert(true); - $cmsg->setText( - "Завершился турнир "Башня Смерти", победитель турнира: {$winr['login']}! Поздравляем!" - ); - $cmsg->setType(5); - $chat->sendMsg($cmsg); - - $this->addDelo( - 1, $uid, - '"WinTournament.' . $this->info['city'] . '" (Башня Смерти): Получено "' . $mn . ' кр."', - time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0 - ); - } else { - /* чат */ - $cmsg->setIsAlert(true); - $cmsg->setType(5); - $cmsg->setText('Завершился турнир «Башня Смерти», победитель турнира: отсутствует.'); - } - - $sp = mysql_query( - 'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100' - ); - while ($pl = mysql_fetch_array($sp)) { - $ur = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1' - ) - ); - $ub = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1' - ) - ); - if (isset($ub['id'])) { - //del - mysql_query('DELETE FROM `users` WHERE `id` = "' . $ub['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "' . $ub['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500'); - //upd - mysql_query( - 'UPDATE `bs_zv` SET `finish` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' - ); - mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'); - } - } - } - - //вес предметов у юзера - public function ves($u): array - { - $r = ['now' => 0, 'max' => 0]; - if ($u == null) { - //текущий персонаж - $r['now'] = mysql_fetch_array( - mysql_query( - 'SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"' - ) - ); - $r['now'] = 0 + $r['now'][0]; - $r['max'] = 40 + ($this->stats['os7'] * 10) + $this->stats['s4'] + $this->stats['maxves'] + $this->stats['s1'] * 4; - $r['items'] = mysql_fetch_array( - mysql_query( - 'SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"' - ) - ); - $r['items'] = $r['items'][0]; - } - return $r; - } - //Переплавка вещей \ рун public function plavka($id, $type): string { @@ -1626,75 +1448,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` return $r; } + /** Для совместимости. Поиск по файлам $this->additem выдаёт сотни отсылок с видимо подключаемымим файлами + * в которых невозможно отследить зависимость и сделать полноценную замену. + * @param $id + * @param $uid + * @param $md + * @param $dn + * @param $mxiznos + * @param $nosudba + * @param $plavka + * @return int|mixed|string + */ public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) { - $rt = -1; - $i = Db::getRow('select * from items_main where id = ?', [$id]); - if (isset($i['id'])) { - $d = Db::getRow('select id, items_id, data from items_main_data where items_id = ?', [$i['id']]); - //новая дата - $data = $d['data']; - if ($i['ts'] > 0 && $nosudba == null) { - $ui = Db::getValue('select login from users where id = ?', [$uid]); - $data .= '|sudba=' . $ui; - } - if ($md != null) { - $data .= $md; - $data = ConversionHelper::dataStringToArray($data); // Если в функции имеются две одинаковых константы SROK? - $data = $this->impStats($data); - } - - //предмет с настройками из подземелья - if ($dn != null && $dn['dn_delete'] > 0) { - $i['dn_delete'] = 1; - } - if ($mxiznos > 0) { - $i['iznosMAXi'] = $mxiznos; - } - if ($this->info['dnow'] > 0) { - $room = $this->room['city']; - } else { - $room = $this->info['city']; - } - $args = [ - $i['overTypei'], - $i['id'], - $uid, - $data, - $i['iznosMAXi'], - $i['geni'], - $i['magic_inci'], - $room, - $i['dn_delete'] ?? 0, - ]; - Db::sql( - 'insert into items_users (overType, item_id, uid, data, iznosMAX, geniration, magic_inc, maidin, lastUPD, time_create, dn_delete) values (?,?,?,?,?,?,?,?,unix_timestamp(),unix_timestamp(),?)', - $args - ); - $rt = Db::lastInsertId() ?? 0; - if ($rt !== 0) { - Db::sql('update items_users set dn_delete = 1 where id = ? and data like ?', [$rt, '%dn_delete=%']); - if ($uid == $this->info['id']) { - $this->stack($rt); - } - $ads = ''; - if ($plavka != null) { - $ads = 'Расплавлен предмет : [' . $plavka . ']'; - } - //Записываем в личное дело что предмет получен - $this->addDelo( - 1, - $uid, - '"AddItems.' . $this->info['city'] . '": Получен предмет "' . $i['name'] . '" (x1) [#' . $i['iid'] . ']. ' . $ads . '', - time(), - $this->info['city'], - 'AddItems.' . $this->info['city'] . '', - 0, - 0 - ); - } - } - return $rt; + return ItemsModel::addItem($id, $uid, $md, $dn, $mxiznos, $nosudba, $plavka); } public function getNum($v) @@ -2683,7 +2450,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $statss['m5'] = ceil($statss['m5'] * (1 + 0.1 * ($round))); $statss['za'] = ceil($statss['za'] * (1 + 0.1 * ($round))); $statss['zm'] = ceil($statss['zm'] * (1 + 0.1 * ($round))); - $clon['stats'] = $this->impStats($statss); + $clon['stats'] = ConversionHelper::arrayToDataString($statss); unset($statss); } if ($luser && $clon['level'] < 8) { @@ -2696,7 +2463,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $statss['m5'] = ceil($statss['m5'] * 0.75); $statss['za'] = ceil($statss['za'] * 0.25); - $clon['stats'] = $this->impStats($statss); + $clon['stats'] = ConversionHelper::arrayToDataString($statss); unset($statss); } $uid = mysql_insert_id(); @@ -2807,7 +2574,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $statss['m5'] = ceil($statss['m5'] * (1 + 0.20 * ($round))); $statss['za'] = ceil($statss['za'] * (1 + 0.20 * ($round))); $statss['zm'] = ceil($statss['zm'] * (1 + 0.20 * ($round))); - $bot['stats'] = $this->impStats($statss); + $bot['stats'] = ConversionHelper::arrayToDataString($statss); unset($statss); } $ins2 = mysql_query( @@ -3650,8 +3417,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } - $data = $this->impStats($data); - $c_itm_data = $this->impStats($c_itm_data_a); + $data = ConversionHelper::arrayToDataString($data); + $c_itm_data = ConversionHelper::arrayToDataString($c_itm_data_a); $data .= '|' . $c_itm_data; } @@ -4982,7 +4749,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } //сохраняем данные - $st = $this->impStats($st); + $st = ConversionHelper::arrayToDataString($st); $upd = mysql_query( 'UPDATE `stats` SET `wipe`="0",`stats`="' . $st . '",`ability`="' . $n1 . '",`skills`="' . $n2 . '",`sskills`="' . $n3 . '",`nskills`="' . $n4 . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1' ); @@ -5045,7 +4812,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $po['mf_stats'] -= 1; $po['add_' . $_GET['mf']] += 1; - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); @@ -5056,7 +4823,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $po['mf_mod'] -= 1; $po['add_' . $_GET['mf']] += 1; - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); @@ -5075,7 +4842,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $po['add_mib' . $s] += 1; } - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); @@ -5104,7 +4871,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $po['add_s' . $s] += 1; } } - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } @@ -5189,7 +4956,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } } - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $po . '",`so` = "' . $itm['so'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); @@ -5311,7 +5078,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } - $po = $this->impStats($po); + $po = ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); unset($mx1, $mx2, $mx3, $po); @@ -5493,7 +5260,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $i++; } - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( ) . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1' @@ -5593,7 +5360,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` // - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); unset($srune, $irun, $nrune, $ntrune, $addrune, $addrunes); $tid = mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -5668,7 +5435,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $imposed['sudba'] = 1; $data = array_merge($data, $imposed); - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -5810,7 +5577,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (!isset($this->is[$rnda]) && isset($imposed)) { $data = array_merge($data, $imposed); - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -5862,7 +5629,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { unset($data['spell_st_val_hp']); } - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); $this->is['mab1'] = 'Броня головы'; $this->is['mab2'] = 'Броня корпуса'; @@ -5944,7 +5711,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` unset($data['sleep_moroz']); } - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -6012,7 +5779,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` time(), $this->info['city'], 'System.remont.upatack', 0, 0 ); - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -6065,7 +5832,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` time(), $this->info['city'], 'System.remont.upatack', 0, 0 ); $this->error = 'Заточка "' . $id['name'] . '" прошла успешно! Колка:' . $data['tya1'] . ' Руб:' . $data['tya2'] . ' Дробь:' . $data['tya3'] . ' Реж:' . $data['tya4'] . ' '; - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( ) . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1' @@ -6124,7 +5891,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $data['open'] = 1; - $data = $this->impStats($data); + $data = ConversionHelper::arrayToDataString($data); mysql_query( 'UPDATE `items_users` SET `delete` = "' . time( @@ -6159,7 +5926,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $add['item_inbox'] = $id['id']; $add['open'] = 1; $add['nosale'] = 1; - $add = $this->impStats($add); + $add = ConversionHelper::arrayToDataString($add); // mysql_query( 'UPDATE `items_users` SET `inGroup` = 0,`data` = "' . $add . '" WHERE `id` = "' . $rune['id'] . '" LIMIT 1' @@ -7030,7 +6797,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $pl['inOdet'] = 0; $pl['uid'] = $plpo['id']; unset($po['toclan1'], $po['toclan']); - $pl['data'] = $this->impStats($po); + $pl['data'] = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . mysql_real_escape_string( $pl['data'] @@ -7734,10 +7501,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` while ($pl = mysql_fetch_array($sp)) { $pl['data'] = ConversionHelper::dataStringToArray($pl['data']); unset($pl['data']['frompisher']); - $pl['data'] = $this->impStats($pl['data']); + $pl['data'] = ConversionHelper::arrayToDataString($pl['data']); $itm['data'] = ConversionHelper::dataStringToArray($itm['data']); unset($itm['data']['frompisher']); - $itm['data'] = $this->impStats($itm['data']); + $itm['data'] = ConversionHelper::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']) { $upd = mysql_query( @@ -7891,7 +7658,7 @@ LIMIT 1' } if (isset($po['sudba']) && $po['sudba'] == 1) { $po['sudba'] = $u['login']; - $itm['data'] = $this->impStats($po); + $itm['data'] = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1' ); @@ -7899,7 +7666,7 @@ LIMIT 1' if (isset($po['zazuby']) && !isset($po['srok']) && ($itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34)) { //Предметы за зубы со сроком годности $po['srok'] = 86400 * 7; - $itm['data'] = $this->impStats($po); + $itm['data'] = ConversionHelper::arrayToDataString($po); mysql_query( 'UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1' ); @@ -9120,24 +8887,6 @@ LIMIT 1' return $upd ? 1 : 0; } - public function impStats($m): string - { - $i = 0; - if (array_keys($m)) { - $k = array_keys($m); - } else { - $k = 0; - } - $d = ''; - while ($i <= count($k)) { - if ($k[$i] != '') { - $d .= $k[$i] . '=' . $m[$k[$i]] . '|'; - } - $i++; - } - return rtrim($d, '|'); - } - public function odetItem(int $id, int $uid) { if ($uid != 0) { @@ -9197,7 +8946,7 @@ LIMIT 1' $notr++; } elseif ($tr['sudba'] == '0') { $tr['sudba'] = $this->info['login']; - $itm['data'] = $this->impStats($tr); + $itm['data'] = ConversionHelper::arrayToDataString($tr); $msb = ',`data`="' . $itm['data'] . '"'; } } @@ -11468,7 +11217,7 @@ LIMIT 1' $tst = ConversionHelper::dataStringToArray($this->info['stats']); $tst['s4'] += $lvl['vinos']; $tst['s7'] += $lvl['duh']; - $this->info['stats'] = $this->impStats($tst); + $this->info['stats'] = ConversionHelper::arrayToDataString($tst); $this->info['level'] = $lvl['nextLevel']; $this->stats['levels'] = $lvln; @@ -11709,7 +11458,7 @@ LIMIT 1' $r = 'Не удалось'; } elseif (!isset($po['toclan'])) { $po['toclan'] = $user['clan'] . '#' . $user['id']; - $item_['data'] = $this->impStats($po); + $item_['data'] = ConversionHelper::arrayToDataString($po); if (mysql_query( 'UPDATE `items_users` SET `lastUPD` = "' . time( ) . '", `uid` = "-21' . $user['clan'] . '", `data` = "' . $item_['data'] . '" WHERE `id` = "' . $id . '" LIMIT 1' @@ -11842,7 +11591,7 @@ LIMIT 1' } } unset($po['toclan']); - $pl['data'] = $this->impStats($po); + $pl['data'] = ConversionHelper::arrayToDataString($po); $col = $this->itemsX(((int)$pl['id'])); $it_n = mysql_fetch_array( mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"') diff --git a/_incl_data/class/User/ItemsModel.php b/_incl_data/class/User/ItemsModel.php index 301282c6..d9abb588 100644 --- a/_incl_data/class/User/ItemsModel.php +++ b/_incl_data/class/User/ItemsModel.php @@ -2,6 +2,7 @@ namespace User; +use Core\ConversionHelper; use Core\Db; use User; @@ -60,4 +61,89 @@ class ItemsModel [$id, User::start()->info['id'], $coldel] ); } + + //вес предметов у юзера + public static function inventoryWeightAndItemQuantity(): array + { + $uid = User::start()->info['id']; + $stats = User::start()->stats; + + return [ + 'now' => Db::getValue('select sum(massa) from items_users left join items_main on item_id = items_main.id where uid = ? and (`delete` = 0 or (`delete` = 1000 and inGroup > 0)) and inShop = 0 and inOdet = 0', [$uid]), + 'max' => 40 + ($stats['os7'] * 10) + $stats['s4'] + $stats['maxves'] + $stats['s1'] * 4, + 'items' => Db::getValue('select count(*) from items_users where uid = ? and `delete` = 0 and inShop = 0 and inOdet = 0', [$uid]), + ]; + } + + public static function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) + { + $user = User::start(); + $rt = -1; + $i = Db::getRow('select * from items_main where id = ?', [$id]); + if (isset($i['id'])) { + $d = Db::getRow('select id, items_id, data from items_main_data where items_id = ?', [$i['id']]); + //новая дата + $data = $d['data']; + if ($i['ts'] > 0 && $nosudba == null) { + $ui = Db::getValue('select login from users where id = ?', [$uid]); + $data .= '|sudba=' . $ui; + } + if ($md != null) { + $data .= $md; + $data = ConversionHelper::dataStringToArray($data); // Если в функции имеются две одинаковых константы SROK? + $data = ConversionHelper::arrayToDataString($data); + } + + //предмет с настройками из подземелья + if ($dn != null && $dn['dn_delete'] > 0) { + $i['dn_delete'] = 1; + } + if ($mxiznos > 0) { + $i['iznosMAXi'] = $mxiznos; + } + if ($user->info['dnow'] > 0) { + $room = $user->room['city']; + } else { + $room = $user->info['city']; + } + $args = [ + $i['overTypei'], + $i['id'], + $uid, + $data, + $i['iznosMAXi'], + $i['geni'], + $i['magic_inci'], + $room, + $i['dn_delete'] ?? 0, + ]; + Db::sql( + 'insert into items_users (overType, item_id, uid, data, iznosMAX, geniration, magic_inc, maidin, lastUPD, time_create, dn_delete) values (?,?,?,?,?,?,?,?,unix_timestamp(),unix_timestamp(),?)', + $args + ); + $rt = Db::lastInsertId() ?? 0; + if ($rt !== 0) { + Db::sql('update items_users set dn_delete = 1 where id = ? and data like ?', [$rt, '%dn_delete=%']); + if ($uid == $user->info['id']) { + $user->stack($rt); + } + $ads = ''; + if ($plavka != null) { + $ads = 'Расплавлен предмет : [' . $plavka . ']'; + } + //Записываем в личное дело что предмет получен + $user->addDelo( + 1, + $uid, + '"AddItems.' . $user->info['city'] . '": Получен предмет "' . $i['name'] . '" (x1) [#' . $i['iid'] . ']. ' . $ads, + time(), + $user->info['city'], + 'AddItems.' . $user->info['city'], + 0, + 0 + ); + } + } + return $rt; + } } \ No newline at end of file diff --git a/_incl_data/class/User/Register.php b/_incl_data/class/User/Register.php index ed49b63b..509e78fa 100644 --- a/_incl_data/class/User/Register.php +++ b/_incl_data/class/User/Register.php @@ -200,7 +200,7 @@ class Register ); foreach ($this->classBonuses[$this->class]['items'] as $item) { - $itemId = $u->addItem($item, $uid); + $itemId = \User\ItemsModel::addItem($item, $uid); Db::sql( 'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) diff --git a/_incl_data/class/dnaction/101/laba1.php b/_incl_data/class/dnaction/101/laba1.php index ef8148a2..e4b04d2a 100644 --- a/_incl_data/class/dnaction/101/laba1.php +++ b/_incl_data/class/dnaction/101/laba1.php @@ -171,7 +171,7 @@ if (isset($s[1]) && $s[1] == '101/laba1') { ) . '","obj_act' . $obj['id'] . '_lab","' . $obj['x'] . '","' . $obj['y'] . '" )' ); - $u->addItem($vad['itm']['id'], $u->info['id'], '|frompisher=101'); + \User\ItemsModel::addItem($vad['itm']['id'], $u->info['id'], '|frompisher=101'); $r = 'Вы создали предмет "' . $vad['itm']['name'] . '"! Расплавив ресурсы ...'; if ($u->info['sex'] == 0) { $vad['text'] = '' . $u->info['login'] . ' создал предмет "' . $vad['itm']['name'] . '" при помощи "' . $obj['name'] . '".'; diff --git a/_incl_data/class/dnaction/108/fontan2.php b/_incl_data/class/dnaction/108/fontan2.php index 37395d8d..d8721b47 100644 --- a/_incl_data/class/dnaction/108/fontan2.php +++ b/_incl_data/class/dnaction/108/fontan2.php @@ -34,7 +34,7 @@ if(isset($s[1]) && $s[1] == '108/fontan2') { "'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'")'); $r = 'Опустив пустую бутылку в фонтан вы наполнили её.'; $u->deleteItem(intval($vad['bt']['id']),$u->info['id'],1); - $u->addItem(round(2417),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 3); + \User\ItemsModel::addItem(round(2417),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 3); } unset($vad); diff --git a/_incl_data/class/dnaction/108/fontan3.php b/_incl_data/class/dnaction/108/fontan3.php index a1bfacba..cf948da5 100644 --- a/_incl_data/class/dnaction/108/fontan3.php +++ b/_incl_data/class/dnaction/108/fontan3.php @@ -23,7 +23,7 @@ if(isset($s[1]) && $s[1] == '108/fontan3') { mysql_query('INSERT INTO `dungeon_actions` (`dn`, `time`, `x`, `y`, `uid`, `vars`, `vals`) VALUES ( "'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'")'); //4041 - $u->addItem(round(4041),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 1); + \User\ItemsModel::addItem(round(4041),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 1); $r = 'Вы получили Снадобье Забытых Мастеров'; } unset($vad); diff --git a/_incl_data/class/dnaction/12/fontan1.php b/_incl_data/class/dnaction/12/fontan1.php index a722f6e1..f9bb25a8 100644 --- a/_incl_data/class/dnaction/12/fontan1.php +++ b/_incl_data/class/dnaction/12/fontan1.php @@ -22,7 +22,7 @@ if(isset($s[1]) && $s[1] == '12/fontan1') { $r = 'Вы воспользовались "Ключ №1". Опустив пустую бутылку в фонтан вы наполнили её.'; $u->deleteItem(intval($vad['key']['id']), $u->info['id'], 1); $u->deleteItem(intval($vad['bottle']['id']), $u->info['id'], 1); - $u->addItem(round(4403), $u->info['id'], '|musor=2|noremont=1|nosale=1',12); + \User\ItemsModel::addItem(round(4403), $u->info['id'], '|musor=2|noremont=1|nosale=1',12); } unset($vad); } diff --git a/_incl_data/class/dnaction/12/fontan2.php b/_incl_data/class/dnaction/12/fontan2.php index a4bce90c..07dc46f1 100644 --- a/_incl_data/class/dnaction/12/fontan2.php +++ b/_incl_data/class/dnaction/12/fontan2.php @@ -37,7 +37,7 @@ if( isset($s[1]) && $s[1] == '12/fontan2' ) { mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( "'.$u->info['id'].'","'.$u->info['dnow'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'", "use_fontan","2" )'); // Выпили раз, вот и хватит с вас! $r = 'Опустив пустую бутылку в фонтан вы наполнили её.'; $u->deleteItem(intval($vad['bt']['id']),$u->info['id'],1); // Удаляем Пустая Бутылка = 2. - $u->addItem(round(1186),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Стойкости 1186 + \User\ItemsModel::addItem(round(1186),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Стойкости 1186 } unset($vad); } diff --git a/_incl_data/class/dnaction/12/fontan3.php b/_incl_data/class/dnaction/12/fontan3.php index 2e6c73cf..1f4d5903 100644 --- a/_incl_data/class/dnaction/12/fontan3.php +++ b/_incl_data/class/dnaction/12/fontan3.php @@ -51,7 +51,7 @@ if( isset($s[1]) && $s[1] == '12/fontan3' ) { mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['gems']['query'])).'" LIMIT 1'); mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['bt']['id'])).'" LIMIT 1'); - $u->addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Отрицания 1188 + \User\ItemsModel::addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Отрицания 1188 } unset($vad); } diff --git a/_incl_data/class/dnaction/12/fontan4.php b/_incl_data/class/dnaction/12/fontan4.php index 1430c18d..c1c3f1ac 100644 --- a/_incl_data/class/dnaction/12/fontan4.php +++ b/_incl_data/class/dnaction/12/fontan4.php @@ -38,7 +38,7 @@ if(isset($s[1]) && $s[1] == '12/fontan4') { $r = 'Опустив пустую бутылку в фонтан вы наполнили её.'; $vad['drug'] = array(0 => 2588, 1 => 2590, 2 => 2589, 3 => 2145); mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['bottle']['id'])).'" LIMIT 1'); - $u->addItem(round($vad['drug'][rand(0,3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3); + \User\ItemsModel::addItem(round($vad['drug'][rand(0,3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3); } unset($vad); } diff --git a/_incl_data/class/dnaction/15/shaiba.php b/_incl_data/class/dnaction/15/shaiba.php index 0d860153..ba331da5 100644 --- a/_incl_data/class/dnaction/15/shaiba.php +++ b/_incl_data/class/dnaction/15/shaiba.php @@ -15,7 +15,7 @@ if( isset($s[1]) && $s[1] == '15/shaiba' ) { mysql_query('DELETE FROM `dungeon_obj` WHERE `id` = "'.$obj['id'].'" LIMIT 1'); //Добавляем шайбу в инвентарь игрока - $vad['itm'] = $u->addItem(4910,$u->info['id']); + $vad['itm'] = \User\ItemsModel::addItem(4910,$u->info['id']); if($vad['itm'] > 0) { mysql_query('UPDATE `items_users` SET `gift` = "Шайба" WHERE `id` = "'.$vad['itm'].'" LIMIT 1'); } diff --git a/_incl_data/class/dnaction/_dungeon_replace.php b/_incl_data/class/dnaction/_dungeon_replace.php index 9a0f9e84..7a1d0006 100644 --- a/_incl_data/class/dnaction/_dungeon_replace.php +++ b/_incl_data/class/dnaction/_dungeon_replace.php @@ -27,7 +27,7 @@ function combineItems(array $parts, int $result, string $data = '|frompisher=12' $obj = Db::getRow('select * from items_main where id = ?', [$result]); $checkItems = ItemsModel::hasNoItemsInInventory($parts); if (empty($checkItems)) { - $u->addItem($result, $u->info['id'], $data, $obj); + \User\ItemsModel::addItem($result, $u->info['id'], $data, $obj); foreach ($parts as $part) { ItemsModel::deleteItemsById($part); } diff --git a/_incl_data/class/magic/hny2012.php b/_incl_data/class/magic/hny2012.php index 4d8fd91a..2ac5c6f9 100644 --- a/_incl_data/class/magic/hny2012.php +++ b/_incl_data/class/magic/hny2012.php @@ -15,40 +15,40 @@ if(date('Y')==2013 || $u->info['id'] == 1) { 7. Новогодний Эликсир */ //Снежок 0/13 (x1) - $idit = $u->addItem(1000,$u->info['id']); + $idit = \User\ItemsModel::addItem(1000,$u->info['id']); if($idit > 0) { mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Новогодний эликсир (x1) - $idit = $u->addItem(997,$u->info['id']); + $idit = \User\ItemsModel::addItem(997,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Новогодний эликсир (x1) - $idit = $u->addItem(2870,$u->info['id']); + $idit = \User\ItemsModel::addItem(2870,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Звездное сияние (x1) - $idit = $u->addItem(1462,$u->info['id']); + $idit = \User\ItemsModel::addItem(1462,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Открытка (x1) - $idit = $u->addItem(996,$u->info['id']); + $idit = \User\ItemsModel::addItem(996,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2013, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1'); //Нападалка 0/13 (x1) - $idit = $u->addItem(874,$u->info['id']); + $idit = \User\ItemsModel::addItem(874,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Кольцо жизни (x1) - $idit = $u->addItem(2101,$u->info['id'],'|noremont=1|srok=1209600|sudba='.$u->info['login']); + $idit = \User\ItemsModel::addItem(2101,$u->info['id'],'|noremont=1|srok=1209600|sudba='.$u->info['login']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Восстановление Энергии 900НР (x3) - $idit = $u->addItem(2710,$u->info['id']); + $idit = \User\ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); - $idit = $u->addItem(2710,$u->info['id']); + $idit = \User\ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); - $idit = $u->addItem(2710,$u->info['id']); + $idit = \User\ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); $u->error = 'Вы успешно использовали "'.$itm['name'].'". В инвентарь добавлены подарки. С Новым, 2013, Годом!'; diff --git a/_incl_data/class/magic/hny2014.php b/_incl_data/class/magic/hny2014.php index ee8671ca..973039cb 100644 --- a/_incl_data/class/magic/hny2014.php +++ b/_incl_data/class/magic/hny2014.php @@ -15,38 +15,38 @@ if(date('Y')==2023) { 7. Новогодний Эликсир */ //рыба (x1) - $idit = $u->addItem(5009,$u->info['id']); + $idit = \User\ItemsModel::addItem(5009,$u->info['id']); if($idit > 0) { mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //мастера - $idit = $u->addItem(4041,$u->info['id']); + $idit = \User\ItemsModel::addItem(4041,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //искуства - $idit = $u->addItem(4948,$u->info['id']); + $idit = \User\ItemsModel::addItem(4948,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //жж6 - $idit = $u->addItem(3101,$u->info['id']); + $idit = \User\ItemsModel::addItem(3101,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "5" WHERE `id` = "'.$idit.'" LIMIT 1'); //Открытка (x1) - $idit = $u->addItem(996,$u->info['id']); + $idit = \User\ItemsModel::addItem(996,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2023, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1'); //точилка - $idit = $u->addItem(6457,$u->info['id']); + $idit = \User\ItemsModel::addItem(6457,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1'); //чек на 100 екров - $idit = $u->addItem(5023,$u->info['id']); + $idit = \User\ItemsModel::addItem(5023,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "1" WHERE `id` = "'.$idit.'" LIMIT 1'); //цепь защитника - $idit = $u->addItem(6459,$u->info['id']); + $idit = \User\ItemsModel::addItem(6459,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1'); diff --git a/_incl_data/class/magic/ironbad.php b/_incl_data/class/magic/ironbad.php index 79fb1fd8..b63fee59 100644 --- a/_incl_data/class/magic/ironbad.php +++ b/_incl_data/class/magic/ironbad.php @@ -80,7 +80,7 @@ if(!defined('GAME')) 70 => '10036' ); $idve=$idv[rand(0,count($idv)-1)]; - $u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); + \User\ItemsModel::addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); $u->error = 'Вы получили:'.$inf['name'].''; diff --git a/_incl_data/class/magic/irongod.php b/_incl_data/class/magic/irongod.php index 30c59c90..35f952db 100644 --- a/_incl_data/class/magic/irongod.php +++ b/_incl_data/class/magic/irongod.php @@ -87,7 +87,7 @@ if(!defined('GAME')) 78 => '10035' ); $idve=$idv[rand(0,count($idv)-1)]; - $u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); + \User\ItemsModel::addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); $u->error = 'Вы получили:'.$inf['name'].''; diff --git a/_incl_data/class/magic/ironnorm.php b/_incl_data/class/magic/ironnorm.php index d67d0511..2d9f13f0 100644 --- a/_incl_data/class/magic/ironnorm.php +++ b/_incl_data/class/magic/ironnorm.php @@ -93,7 +93,7 @@ if(!defined('GAME')) 84 => '10037' ); $idve=$idv[rand(0,count($idv)-1)]; - $u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); + \User\ItemsModel::addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); $u->error = 'Вы получили:'.$inf['name'].''; diff --git a/_incl_data/class/magic/pandorax.php b/_incl_data/class/magic/pandorax.php index be7f8eef..1d9809f4 100644 --- a/_incl_data/class/magic/pandorax.php +++ b/_incl_data/class/magic/pandorax.php @@ -17,13 +17,13 @@ $rnd0['itm3'] = $rnd0[rand(0,count($rnd0))]; $rnd0['itm1'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm1']).'" LIMIT 1')); $rnd0['itm2'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm2']).'" LIMIT 1')); -$u->addItem($rnd0['itm1']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); -$u->addItem($rnd0['itm2']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); +\User\ItemsModel::addItem($rnd0['itm1']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); +\User\ItemsModel::addItem($rnd0['itm2']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); if(rand(0,7) == 2) { $rnd0['itm3'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm3']).'" LIMIT 1')); }else{ - $u->addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); + \User\ItemsModel::addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); } $u->deleteItem($itm['id'],$u->info['id']); diff --git a/_incl_data/class/magic/ruletka.php b/_incl_data/class/magic/ruletka.php index 7c91c53f..6afbd6a7 100644 --- a/_incl_data/class/magic/ruletka.php +++ b/_incl_data/class/magic/ruletka.php @@ -98,7 +98,7 @@ $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); 78 => '10035' ); $idve=$idv[rand(0,count($idv)-1)]; - $u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); + \User\ItemsModel::addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); $u->error = 'Вы получили:'.$inf['name'].''; diff --git a/_incl_data/class/magic/sunduk_ov.php b/_incl_data/class/magic/sunduk_ov.php index 6fe22e91..c56a3147 100644 --- a/_incl_data/class/magic/sunduk_ov.php +++ b/_incl_data/class/magic/sunduk_ov.php @@ -5,15 +5,15 @@ if(!defined('GAME')) } //лечение легких травм - $ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); if($ov_item > 0) { mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //пропуск забытых - $ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //жж6 - $ov_item = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); diff --git a/_incl_data/class/magic/sunduk_ov2.php b/_incl_data/class/magic/sunduk_ov2.php index 1ae5b2a7..becdbb4a 100644 --- a/_incl_data/class/magic/sunduk_ov2.php +++ b/_incl_data/class/magic/sunduk_ov2.php @@ -5,24 +5,24 @@ if(!defined('GAME')) } //лечение легких травм - $ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); if($ov_item > 0) { mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //пропуск забытых - $ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //жж6 - $ov_item = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //лечение средних травм - $ov_item = $u->addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (бездна) - $ov_item = $u->addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (грибница) - $ov_item = $u->addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); // mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); diff --git a/_incl_data/class/magic/sunduk_ov3.php b/_incl_data/class/magic/sunduk_ov3.php index e6c3a2a0..9fc4195c 100644 --- a/_incl_data/class/magic/sunduk_ov3.php +++ b/_incl_data/class/magic/sunduk_ov3.php @@ -5,36 +5,36 @@ if(!defined('GAME')) } //лечение легких травм - $ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); if($ov_item > 0) { mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //пропуск забытых - $ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //жж6 - $ov_item = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //лечение средних травм - $ov_item = $u->addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (бездна) - $ov_item = $u->addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (грибница) - $ov_item = $u->addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //Лечение тяжелых травм - $ov_item = $u->addItem(4414,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(4414,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (ПТП) - $ov_item = $u->addItem(5036,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5036,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (Катакомбы) - $ov_item = $u->addItem(5037,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5037,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); //право на подвиг (Гора легиона) - $ov_item = $u->addItem(5038,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); + $ov_item = \User\ItemsModel::addItem(5038,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); // mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); diff --git a/_incl_data/class/magic/toms.php b/_incl_data/class/magic/toms.php index 075293dc..97b3693c 100644 --- a/_incl_data/class/magic/toms.php +++ b/_incl_data/class/magic/toms.php @@ -49,7 +49,7 @@ if($goodkast == 1) { );"); } // - $u->addItem( 4752 , $u->info['id'] , '|sudba=1' ); + \User\ItemsModel::addItem( 4752 , $u->info['id'] , '|sudba=1' ); mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = "'.$itm['id'].'" LIMIT 1'); // } diff --git a/_incl_data/class/magic/upexp.php b/_incl_data/class/magic/upexp.php index 7379c932..c5b59551 100644 --- a/_incl_data/class/magic/upexp.php +++ b/_incl_data/class/magic/upexp.php @@ -16,7 +16,7 @@ if( $u->info['twink'] != 0 ) { //Выдаем еще и кристалл $test_itm = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 1204 AND `uid` = "'.$u->info['id'].'" LIMIT 1')); if( !isset($test_itm['id']) ) { - $u->addItem(1204,$u->info['id']); + \User\ItemsModel::addItem(1204,$u->info['id']); } } */ diff --git a/_incl_data/class/priem/121.php b/_incl_data/class/priem/121.php index d528a3b1..ac4027f9 100644 --- a/_incl_data/class/priem/121.php +++ b/_incl_data/class/priem/121.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/122.php b/_incl_data/class/priem/122.php index 0cc026ba..3b4ab91d 100644 --- a/_incl_data/class/priem/122.php +++ b/_incl_data/class/priem/122.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/123.php b/_incl_data/class/priem/123.php index 62b98cb6..be8efbcb 100644 --- a/_incl_data/class/priem/123.php +++ b/_incl_data/class/priem/123.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/124.php b/_incl_data/class/priem/124.php index f052d2de..1e524b05 100644 --- a/_incl_data/class/priem/124.php +++ b/_incl_data/class/priem/124.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/125.php b/_incl_data/class/priem/125.php index 1754c0c6..ca66fd9f 100644 --- a/_incl_data/class/priem/125.php +++ b/_incl_data/class/priem/125.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/192.php b/_incl_data/class/priem/192.php index 1400733b..1c88a828 100644 --- a/_incl_data/class/priem/192.php +++ b/_incl_data/class/priem/192.php @@ -55,7 +55,7 @@ if( isset($pvr['pl']['priem']) && isset($pvr['pl']['id']) ) { $pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']); $pvr['edt']['add_zm2proc'] = 0; $pvr['edt']['add_mg2static_points'] = 0; - $pvr['edt'] = $u->impStats($pvr['edt']); + $pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']); if( $pvr['pl']['priem']['id'] == 260 ) { $prv['color2'] = '000000'; diff --git a/_incl_data/class/priem/205.php b/_incl_data/class/priem/205.php index 5f4ae87a..c355aa5f 100644 --- a/_incl_data/class/priem/205.php +++ b/_incl_data/class/priem/205.php @@ -82,7 +82,7 @@ if( true == true ) { $pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']); $pvr['edt']['add_zm2proc'] = 0; $pvr['edt']['add_mg2static_points'] = 0; - $pvr['edt'] = $u->impStats($pvr['edt']); + $pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']); if( $pvr['pl']['priem']['id'] == 260 ) { $prv['color2'] = '000000'; diff --git a/_incl_data/class/priem/21.php b/_incl_data/class/priem/21.php index 6eddef28..234a790f 100644 --- a/_incl_data/class/priem/21.php +++ b/_incl_data/class/priem/21.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/22.php b/_incl_data/class/priem/22.php index 80ae20f1..e91d1713 100644 --- a/_incl_data/class/priem/22.php +++ b/_incl_data/class/priem/22.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/23.php b/_incl_data/class/priem/23.php index 2c552c53..16e85b84 100644 --- a/_incl_data/class/priem/23.php +++ b/_incl_data/class/priem/23.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/241.php b/_incl_data/class/priem/241.php index c77f6153..5f111977 100644 --- a/_incl_data/class/priem/241.php +++ b/_incl_data/class/priem/241.php @@ -18,7 +18,7 @@ else if( isset($pvr['mg']['id']) ) { //Действие при клике $pvr['hp'] = 0; - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/244.php b/_incl_data/class/priem/244.php index fe7ad406..6e6427ef 100644 --- a/_incl_data/class/priem/244.php +++ b/_incl_data/class/priem/244.php @@ -18,7 +18,7 @@ if ( $cup = true; } else { //Действие при клике - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']); $pvr['name'] = $pvr['mg']['name']; // Урон = 150% оставшегося урона (урон за ход * количество ходов * 150/100). diff --git a/_incl_data/class/priem/247.php b/_incl_data/class/priem/247.php index 28ae00a4..4dcf7b3e 100644 --- a/_incl_data/class/priem/247.php +++ b/_incl_data/class/priem/247.php @@ -106,7 +106,7 @@ if( isset($pr_momental_this)) { $pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']); $pvr['edt']['add_zm2proc'] = 0; $pvr['edt']['add_mg2static_points'] = 0; - $pvr['edt'] = $u->impStats($pvr['edt']); + $pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']); if( $pvr['pl']['priem']['id'] == 260 ) { $prv['color2'] = '000000'; diff --git a/_incl_data/class/priem/251.php b/_incl_data/class/priem/251.php index a8b45734..ff33e55c 100644 --- a/_incl_data/class/priem/251.php +++ b/_incl_data/class/priem/251.php @@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/252.php b/_incl_data/class/priem/252.php index 31287868..fdb7be0a 100644 --- a/_incl_data/class/priem/252.php +++ b/_incl_data/class/priem/252.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['mp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/262.php b/_incl_data/class/priem/262.php index c0bb9c16..d5e2e49b 100644 --- a/_incl_data/class/priem/262.php +++ b/_incl_data/class/priem/262.php @@ -13,7 +13,7 @@ if( isset($pvr['mg']['id']) ) { //$pvr['hp'] = floor(144/3*$pvr['mg']['x']); /*$pvr['hp'] = 1;*/ // - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']); // /**/ if( $pvr['data']['add_mg2static_points'][0] < 1 ) { @@ -73,7 +73,7 @@ if( isset($pvr['mg']['id']) ) { $pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']); $pvr['edt']['add_zm2proc'] = 0; $pvr['edt']['add_mg2static_points'] = 0; - $pvr['edt'] = $u->impStats($pvr['edt']); + $pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']); mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "'.$pvr['edt'].'" WHERE `id` = "'.$pvr['mg']['id'].'" LIMIT 1'); //Отнимаем тактики diff --git a/_incl_data/class/priem/263.php b/_incl_data/class/priem/263.php index a188060e..96801f71 100644 --- a/_incl_data/class/priem/263.php +++ b/_incl_data/class/priem/263.php @@ -11,7 +11,7 @@ if (!isset($pvr['mg']['id'])) { echo 'На персонаже нет Статики'; $cup = true; } else { - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']); // /**/ if ($pvr['data']['add_mg2static_points'] < 1) { diff --git a/_incl_data/class/priem/280.php b/_incl_data/class/priem/280.php index 67ae7354..91344432 100644 --- a/_incl_data/class/priem/280.php +++ b/_incl_data/class/priem/280.php @@ -35,7 +35,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { $prv['priem_th'] = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id']; //действия - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/282.php b/_incl_data/class/priem/282.php index 316ecf95..6adf0282 100644 --- a/_incl_data/class/priem/282.php +++ b/_incl_data/class/priem/282.php @@ -74,7 +74,7 @@ if( isset($pr_momental_this)) { $prv['priem_th'] = $btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['id']; // $pvr['hp'] = 1; - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); // //$pvr['hp'] = floor($btl->stats[$btl->uids[$u2]]['hpAll']/50); diff --git a/_incl_data/class/priem/294.php b/_incl_data/class/priem/294.php index d2cbd674..26acb382 100644 --- a/_incl_data/class/priem/294.php +++ b/_incl_data/class/priem/294.php @@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { } // /* - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/295.php b/_incl_data/class/priem/295.php index 99d7e91f..cec9d758 100644 --- a/_incl_data/class/priem/295.php +++ b/_incl_data/class/priem/295.php @@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { } // /* - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/296.php b/_incl_data/class/priem/296.php index b1b7b8c0..b40ba934 100644 --- a/_incl_data/class/priem/296.php +++ b/_incl_data/class/priem/296.php @@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { } // /* - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/299.php b/_incl_data/class/priem/299.php index 115a4dda..595a317f 100644 --- a/_incl_data/class/priem/299.php +++ b/_incl_data/class/priem/299.php @@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { $pvr['krit'] = $pvr['hp'][1]; $pvr['hp'] = $pvr['hp'][0]; /*// - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/300.php b/_incl_data/class/priem/300.php index f4dcdabc..0aa66407 100644 --- a/_incl_data/class/priem/300.php +++ b/_incl_data/class/priem/300.php @@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = rand(15,25); /*// - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/301.php b/_incl_data/class/priem/301.php index c4bccd56..ea9918e7 100644 --- a/_incl_data/class/priem/301.php +++ b/_incl_data/class/priem/301.php @@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { $pvr['krit'] = $pvr['hp'][1]; $pvr['hp'] = $pvr['hp'][0]; /*// - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/36.php b/_incl_data/class/priem/36.php index dcfc4859..0145cfbc 100644 --- a/_incl_data/class/priem/36.php +++ b/_incl_data/class/priem/36.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $uid , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/42.php b/_incl_data/class/priem/42.php index 7c575366..f3063b11 100644 --- a/_incl_data/class/priem/42.php +++ b/_incl_data/class/priem/42.php @@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/70.php b/_incl_data/class/priem/70.php index ed9ea58c..8d238335 100644 --- a/_incl_data/class/priem/70.php +++ b/_incl_data/class/priem/70.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/71.php b/_incl_data/class/priem/71.php index abdd8d93..048ac17a 100644 --- a/_incl_data/class/priem/71.php +++ b/_incl_data/class/priem/71.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/72.php b/_incl_data/class/priem/72.php index f8ba7dcc..7e27fbad 100644 --- a/_incl_data/class/priem/72.php +++ b/_incl_data/class/priem/72.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/73.php b/_incl_data/class/priem/73.php index c9928a24..4d895ee6 100644 --- a/_incl_data/class/priem/73.php +++ b/_incl_data/class/priem/73.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/74.php b/_incl_data/class/priem/74.php index b11ae261..b280288b 100644 --- a/_incl_data/class/priem/74.php +++ b/_incl_data/class/priem/74.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/75.php b/_incl_data/class/priem/75.php index 7c3e04c1..68c734f3 100644 --- a/_incl_data/class/priem/75.php +++ b/_incl_data/class/priem/75.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/76.php b/_incl_data/class/priem/76.php index 9c13e69a..3a95e8ac 100644 --- a/_incl_data/class/priem/76.php +++ b/_incl_data/class/priem/76.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/77.php b/_incl_data/class/priem/77.php index 62173616..fe1aa778 100644 --- a/_incl_data/class/priem/77.php +++ b/_incl_data/class/priem/77.php @@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/78.php b/_incl_data/class/priem/78.php index 920f807d..1de5115f 100644 --- a/_incl_data/class/priem/78.php +++ b/_incl_data/class/priem/78.php @@ -36,7 +36,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/79.php b/_incl_data/class/priem/79.php index f858ec86..3d146172 100644 --- a/_incl_data/class/priem/79.php +++ b/_incl_data/class/priem/79.php @@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/80.php b/_incl_data/class/priem/80.php index e4a0f088..4635f4f3 100644 --- a/_incl_data/class/priem/80.php +++ b/_incl_data/class/priem/80.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/81.php b/_incl_data/class/priem/81.php index 9314bcee..a93942f4 100644 --- a/_incl_data/class/priem/81.php +++ b/_incl_data/class/priem/81.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/82.php b/_incl_data/class/priem/82.php index 2199b99c..9a137184 100644 --- a/_incl_data/class/priem/82.php +++ b/_incl_data/class/priem/82.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/83.php b/_incl_data/class/priem/83.php index f5e45414..b42b7a42 100644 --- a/_incl_data/class/priem/83.php +++ b/_incl_data/class/priem/83.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/84.php b/_incl_data/class/priem/84.php index 6ae220f7..7f1ec3ae 100644 --- a/_incl_data/class/priem/84.php +++ b/_incl_data/class/priem/84.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { //действия $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['di'] = 0; $pvr['dc'] = count($pvr['data']['atgm']); $pvr['rd'] = 0; diff --git a/_incl_data/class/priem/85.php b/_incl_data/class/priem/85.php index 9b7087cb..31dacd60 100644 --- a/_incl_data/class/priem/85.php +++ b/_incl_data/class/priem/85.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/86.php b/_incl_data/class/priem/86.php index d4be3a14..48c8eb4f 100644 --- a/_incl_data/class/priem/86.php +++ b/_incl_data/class/priem/86.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/87.php b/_incl_data/class/priem/87.php index 93f2703c..73035c06 100644 --- a/_incl_data/class/priem/87.php +++ b/_incl_data/class/priem/87.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/88.php b/_incl_data/class/priem/88.php index be8848be..0edd75b6 100644 --- a/_incl_data/class/priem/88.php +++ b/_incl_data/class/priem/88.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/89.php b/_incl_data/class/priem/89.php index 0b00ba72..65ff1b4f 100644 --- a/_incl_data/class/priem/89.php +++ b/_incl_data/class/priem/89.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priem/90.php b/_incl_data/class/priem/90.php index 0a589b92..a1adbc6a 100644 --- a/_incl_data/class/priem/90.php +++ b/_incl_data/class/priem/90.php @@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { // $pvr['hp'] = 1; // - $pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); + $pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); $pvr['hp'] = floor($pvr['data']['add_atgm'][0]); $pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] ); // diff --git a/_incl_data/class/priems/air.php b/_incl_data/class/priems/air.php index 0e4a3974..f83967fd 100644 --- a/_incl_data/class/priems/air.php +++ b/_incl_data/class/priems/air.php @@ -12,7 +12,7 @@ function mg2static_points($uid,$st) { $mg['data'] = \Core\ConversionHelper::dataStringToArray($mg['data']); $mg['data']['add_mg2static_points']++; $mg['data']['add_zm2proc']--; - $mg['data'] = $u->impStats($mg['data']); + $mg['data'] = \Core\ConversionHelper::arrayToDataString($mg['data']); mysql_query('UPDATE `eff_users` SET `data` = "'.$mg['data'].'" WHERE `id` = "'.$mg['id'].'" LIMIT 1'); } } @@ -114,7 +114,7 @@ if(isset($hod)) $mg['data']['add_mg2static_points'] = 0; $mg['data']['add_zm2proc'] = 0; - $mg['data'] = $u->impStats($mg['data']); + $mg['data'] = \Core\ConversionHelper::arrayToDataString($mg['data']); echo 'Прием "'.$pl['name'].'" успешно использован.'; mysql_query('UPDATE `eff_users` SET `data` = "'.$mg['data'].'" WHERE `id` = "'.$mg['id'].'" LIMIT 1'); diff --git a/_incl_data/class/priems/bloodring.php b/_incl_data/class/priems/bloodring.php index 94fa6acb..0ff0cd8a 100644 --- a/_incl_data/class/priems/bloodring.php +++ b/_incl_data/class/priems/bloodring.php @@ -19,7 +19,7 @@ if($st['usefromfile']=='bloodring' && $u->info['battle'] > 0 && $u->info['hpNow' }else{ mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 15 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['tactic6'] -= 15; - $u->addItem(3134,$u->info['id'],'|sudba='.$u->info['login']); + \User\ItemsModel::addItem(3134,$u->info['id'],'|sudba='.$u->info['login']); $ins = mysql_query('INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`) VALUES ("-1",228,"invoke_create_lesserbloodstone.gif",22,"'.$u->info['id'].'","Кровавый Сбор","","30","77","priem")'); $u->error = 'Вы успешно использовали заклинание "Кровавый сбор"'; diff --git a/_incl_data/class/priems/bloodring2.php b/_incl_data/class/priems/bloodring2.php index 8476b9be..e8f1ec14 100644 --- a/_incl_data/class/priems/bloodring2.php +++ b/_incl_data/class/priems/bloodring2.php @@ -25,13 +25,13 @@ if($st['usefromfile']=='bloodring2' && $u->info['battle'] > 0 && $u->info['hpNow $st['td_cast']++; - $stimp = $u->impStats($st); + $stimp = \Core\ConversionHelper::arrayToDataString($st); mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($stimp).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['tactic6'] -= 5; - //$u->addItem(3136,$u->info['id'],'|sudba='.$u->info['login']); + //\User\ItemsModel::addItem(3136,$u->info['id'],'|sudba='.$u->info['login']); //Если эффект есть, тогда добавляем к нему +1 каст (Максимум 6) if(isset($bu['id'])) { diff --git a/_incl_data/class/priems/bloodring2_end.php b/_incl_data/class/priems/bloodring2_end.php index 4a4aa188..03883dd7 100644 --- a/_incl_data/class/priems/bloodring2_end.php +++ b/_incl_data/class/priems/bloodring2_end.php @@ -9,7 +9,7 @@ if ($ple['file_finish'] == 'bloodring2_end' && $this->users[$i]['team'] == $this $ple['x'] = 6; } while ($i1k < $ple['x']) { - $u->addItem(3136, $this->users[$i]['id'], '|sudba=' . $this->users[$i]['login']); + \User\ItemsModel::addItem(3136, $this->users[$i]['id'], '|sudba=' . $this->users[$i]['login']); $i1k++; } if ($ple['x'] > 1) { diff --git a/_incl_data/class/priems/bot_priems1.end.php b/_incl_data/class/priems/bot_priems1.end.php index 5f1ed0a9..489b0909 100644 --- a/_incl_data/class/priems/bot_priems1.end.php +++ b/_incl_data/class/priems/bot_priems1.end.php @@ -1420,7 +1420,7 @@ elseif($this->users[$this->uids[$uid1]]['bot_id'] == 254) { $i56++; } $inf = rtrim($inf, ', '); - $j1 = $u->impStats($j1); + $j1 = \Core\ConversionHelper::arrayToDataString($j1); $pld[0] = ' x'.($mpr['x']+1); $upd = mysql_query('UPDATE `eff_users` SET `data` = "'.$j1.'", `x` = `x`+1 WHERE `id` = "'.$mpr['id'].'" LIMIT 1'); if($upd) { diff --git a/_incl_data/class/quest/1september_obmen1.php b/_incl_data/class/quest/1september_obmen1.php index bd90ef83..d7a4bcca 100644 --- a/_incl_data/class/quest/1september_obmen1.php +++ b/_incl_data/class/quest/1september_obmen1.php @@ -46,7 +46,7 @@ if(isset($test['id'])) { //все ок if( rand(0,100) < $pvr['ch'] ) { $txt .= '
Вы получили "Зеленый Том Знаний"'; - $pvr['itm'] = $u->addItem(4740,$u->info['id']); + $pvr['itm'] = \User\ItemsModel::addItem(4740,$u->info['id']); // mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); // diff --git a/_incl_data/class/quest/1september_obmen2.php b/_incl_data/class/quest/1september_obmen2.php index 70949cae..e40d827b 100644 --- a/_incl_data/class/quest/1september_obmen2.php +++ b/_incl_data/class/quest/1september_obmen2.php @@ -46,7 +46,7 @@ if(isset($test['id'])) { //все ок if( rand(0,100) < $pvr['ch'] ) { $txt .= '
Вы получили "Желтый Том Знаний"'; - $pvr['itm'] = $u->addItem(4741,$u->info['id']); + $pvr['itm'] = \User\ItemsModel::addItem(4741,$u->info['id']); // mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); // diff --git a/_incl_data/class/quest/1september_obmen3.php b/_incl_data/class/quest/1september_obmen3.php index 4e544d1b..bcbb417d 100644 --- a/_incl_data/class/quest/1september_obmen3.php +++ b/_incl_data/class/quest/1september_obmen3.php @@ -46,7 +46,7 @@ if(isset($test['id'])) { //все ок if( rand(0,100) < $pvr['ch'] ) { $txt .= '
Вы получили "Красный Том Знаний"'; - $pvr['itm'] = $u->addItem(4742,$u->info['id']); + $pvr['itm'] = \User\ItemsModel::addItem(4742,$u->info['id']); // mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); // diff --git a/_incl_data/class/quest/1september_obmen4.php b/_incl_data/class/quest/1september_obmen4.php index 37d97a0e..7c54a049 100644 --- a/_incl_data/class/quest/1september_obmen4.php +++ b/_incl_data/class/quest/1september_obmen4.php @@ -45,7 +45,7 @@ if(isset($test['id'])) { //все ок if( rand(0,100) < $pvr['ch'] ) { $txt .= '
Вы получили "Синий Том Знаний"'; - $pvr['itm'] = $u->addItem(4743,$u->info['id']); + $pvr['itm'] = \User\ItemsModel::addItem(4743,$u->info['id']); // mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); // diff --git a/_incl_data/class/quest/1september_obmen5.php b/_incl_data/class/quest/1september_obmen5.php index 32e1d17a..ee448e8d 100644 --- a/_incl_data/class/quest/1september_obmen5.php +++ b/_incl_data/class/quest/1september_obmen5.php @@ -45,7 +45,7 @@ if(isset($test['id'])) { //все ок if( rand(0,100) < $pvr['ch'] ) { $txt .= '
Вы получили "Белый Том Знаний"'; - $pvr['itm'] = $u->addItem(4744,$u->info['id']); + $pvr['itm'] = \User\ItemsModel::addItem(4744,$u->info['id']); // mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); // diff --git a/_incl_data/class/quest/dailyquestend.php b/_incl_data/class/quest/dailyquestend.php index bab8e752..b220b430 100644 --- a/_incl_data/class/quest/dailyquestend.php +++ b/_incl_data/class/quest/dailyquestend.php @@ -37,9 +37,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -62,9 +62,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -86,9 +86,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -104,9 +104,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -128,9 +128,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -152,9 +152,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 @@ -176,9 +176,9 @@ if (!isset($test['id'])) { 'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"' ); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 diff --git a/_incl_data/class/quest/transferpilchar.php b/_incl_data/class/quest/transferpilchar.php index fe82f7ca..e26b18ec 100644 --- a/_incl_data/class/quest/transferpilchar.php +++ b/_incl_data/class/quest/transferpilchar.php @@ -33,7 +33,7 @@ $itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_user if ($itmm['total']>=50) { mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `uid`="'.$u->info['id'].'" AND `item_id` = "6168" AND `delete` = 0 LIMIT 50;'); - $u->addItem(6167,$u->info['id'],'|sudba='.$u->info['login']); + \User\ItemsModel::addItem(6167,$u->info['id'],'|sudba='.$u->info['login']); $itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_users` WHERE `item_id` = "6168" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0"')); $txt .= '
Держи свиток сынок.
Спасибо за пыль но у тебя еще осталось: '.$itmm['total'].' шт.'; $u->addDelo(1,$u->info['id'],'"Babka.'.$u->info['city'].'": Поменял у бабки пыль на свиток!',time(),$u->info['city'],'Babka.'.$u->info['city'].'',1,0); diff --git a/lotowork.php b/lotowork.php index c18d0a06..a963c124 100644 --- a/lotowork.php +++ b/lotowork.php @@ -130,7 +130,7 @@ if (!isset($user) || $user['id'] != $u->info['id']) { echo 'Error'; } else { $idve = $droplist['idgame']; - $u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); + \User\ItemsModel::addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1')); $titm = mysql_query( 'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $user['id'] . '","' . time( diff --git a/lotoworkekr.php b/lotoworkekr.php index 1377ea5b..ed259cd4 100644 --- a/lotoworkekr.php +++ b/lotoworkekr.php @@ -57,7 +57,7 @@ if (!isset($user) || $user['id'] != $u->info['id']) { echo 'Error'; } else { $idve = $droplist['idgame']; - $u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); + \User\ItemsModel::addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1')); $u->info['money2'] = $u->info['money2'] - 5; mysql_query('UPDATE `users` SET `money2`= `money2` - 5 WHERE `id` = "' . $u->info['id'] . '"'); diff --git a/main.php b/main.php index 35f1e971..f4dca136 100644 --- a/main.php +++ b/main.php @@ -138,7 +138,7 @@ if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) { $act = -2; $act2 = 0; $u->stats = $u->getStats($u->info['id'], 0); -$u->aves = $u->ves(null); +$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity(); if (!isset($u->stats['act'])) { $u->stats['act'] = 0; } @@ -365,7 +365,7 @@ if ($magic->youuse > 0) { //Получение статов if ($act != -2) { $u->stats = $u->getStats($u->info['id'], 0, 1); - $u->aves = $u->ves(null); + $u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity(); if (!isset($sleep['id'])) { $act2 = $u->testItems($u->info['id'], $u->stats, 0); } @@ -532,11 +532,11 @@ foreach ($sp as $pl) { //выдаем предмет $glid = 1; if ($pl['data'] == '0') { - $u->addItem( + \User\ItemsModel::addItem( $pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] ); } else { - $u->addItem( + \User\ItemsModel::addItem( $pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data'] ); diff --git a/main_bot.php b/main_bot.php index b0b34315..a370cc96 100644 --- a/main_bot.php +++ b/main_bot.php @@ -153,7 +153,7 @@ if ($u->info['battle_text'] != '') { $act = -2; $act2 = 0; $u->stats = $u->getStats($u->info['id'], 0); -$u->aves = $u->ves(null); +$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity(); if (!isset($u->stats['act'])) { $u->stats['act'] = 0; } @@ -221,7 +221,7 @@ if ($u->info['repass'] > 0 && $u->info['id'] != 5433446) { //Получение статов if ($act != -2) { $u->stats = $u->getStats($u->info['id'], 0, 1); - $u->aves = $u->ves(null); + $u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity(); $act2 = $u->testItems($u->info['id'], $u->stats, 0); if ($act2 != -2 && $act == -2) { $act = $act2; diff --git a/modules_data/1_panel.php b/modules_data/1_panel.php index 2e5bb8ff..941b6a46 100644 --- a/modules_data/1_panel.php +++ b/modules_data/1_panel.php @@ -40,7 +40,7 @@ foreach ($item_light as $item) { } $vix = $vix[0]; if ($item[1] - $vix > 0 && $_GET['take_item_light_panel'] == $itm['id']) { - $nitm = $u->addItem($itm['id'], $u->info['id'], $item[5]); + $nitm = \User\ItemsModel::addItem($itm['id'], $u->info['id'], $item[5]); $u->addAction(time(), 'dark_itm' . $itm['id'], ''); echo 'Предмет "' . $itm['name'] . '" перемещен к Вам в инвентарь!

'; } diff --git a/modules_data/3_panel.php b/modules_data/3_panel.php index 412532e2..198d1cd7 100644 --- a/modules_data/3_panel.php +++ b/modules_data/3_panel.php @@ -56,7 +56,7 @@ $vi = array( } if($item_dark[$dark_panel][$i][1]-$vix > 0) { if(isset($_GET['take_item_dark_panel']) && $_GET['take_item_dark_panel'] == $itm['id']) { - $nitm = $u->addItem($itm['id'],$u->info['id'],$item_dark[$dark_panel][$i][5]); + $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_dark[$dark_panel][$i][5]); if($item_dark[$dark_panel][6]>0) { } $u->addAction(time(),'dark_itm'.$itm['id'],''); diff --git a/modules_data/7_panel.php b/modules_data/7_panel.php index c9c98670..cb672dd5 100644 --- a/modules_data/7_panel.php +++ b/modules_data/7_panel.php @@ -56,7 +56,7 @@ $vi = array( } if($item_neytral[$neytral_panel][$i][1]-$vix > 0) { if(isset($_GET['take_item_neytral_panel']) && $_GET['take_item_neytral_panel'] == $itm['id']) { - $nitm = $u->addItem($itm['id'],$u->info['id'],$item_neytral[$neytral_panel][$i][5]); + $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_neytral[$neytral_panel][$i][5]); if($item_neytral[$neytral_panel][6]>0) { } $u->addAction(time(),'dark_itm'.$itm['id'],''); diff --git a/modules_data/_mod.php b/modules_data/_mod.php index b5b7df98..72583d95 100644 --- a/modules_data/_mod.php +++ b/modules_data/_mod.php @@ -1011,7 +1011,7 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) { $uer = "Персонаж $_POST[log_itm] не найден."; } if ($giv_itm['id'] > 0 && $usr['id'] > 0) { - $u->addItem($giv_itm['id'], $usr['id']); + \User\ItemsModel::addItem($giv_itm['id'], $usr['id']); $uer = "Персонажу $_POST[log_itm] выдана вещь $giv_itm[name]."; $rtxt = $rang . ' "' . $u->info['login'] . '" Выдал' . $sx . ' персонажу "' . $user_teleport['login'] . '" вещь "' . $giv_itm['name'] . '".'; } @@ -1839,7 +1839,7 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) { ) ); if (isset($uad['id'])) { - $u->addItem(round((int)$_POST['add_item_to_user']), $uad['id']); + \User\ItemsModel::addItem(round((int)$_POST['add_item_to_user']), $uad['id']); mysql_query( 'INSERT INTO `users_delo` (`onlyAdmin`,`hb`,`uid`,`time`,`city`,`text`,`login`,`ip`) VALUES ("1","0","' . $uad['id'] . '","' . time( ) . '","' . $uad['city'] . '","' . $rang . ' "' . $u->info['login'] . '" выдал предмет: №' . round( diff --git a/modules_data/_umenie.php b/modules_data/_umenie.php index 4991be34..bd18e660 100644 --- a/modules_data/_umenie.php +++ b/modules_data/_umenie.php @@ -264,7 +264,7 @@ $tma = ''; $st['os9'] += (int)$_GET['speed_HP']; $st['os10'] += (int)$_GET['speed_MP']; $st['os11'] += (int)$_GET['speed_debuff']; - $u->info['stats'] = $u->impStats($st); + $u->info['stats'] = \Core\ConversionHelper::arrayToDataString($st); } if ($u->info['sskills'] - (int)$summs < 0) { echo '   У вас нет свободных особенностей
'; @@ -469,7 +469,7 @@ $tma = ''; $st['s10'] += (int)$_GET['god']; } - $u->info['stats'] = $u->impStats($st); + $u->info['stats'] = \Core\ConversionHelper::arrayToDataString($st); if ( $_GET['str'] < 0 || $_GET['dex'] < 0 || $_GET['intel'] < 0 || $_GET['wis'] < 0 || $_GET['spirit'] < 0 || $_GET['will'] < 0 || $_GET['freedom'] < 0 || $_GET['god'] < 0 || $_GET['inst'] < 0 || $_GET['power'] < 0 || $_GET['m_sword'] < 0 || $_GET['m_tohand'] < 0 || $_GET['m_molot'] < 0 || $_GET['m_staff'] < 0 || $_GET['m_magic1'] < 0 || $_GET['m_magic2'] < 0 || $_GET['m_magic3'] < 0 || $_GET['m_magic4'] < 0 || $_GET['m_magic5'] < 0 || $_GET['m_magic6'] < 0 || $_GET['m_magic7'] < 0) { diff --git a/modules_data/act_trf.php b/modules_data/act_trf.php index 8f567239..270da09f 100644 --- a/modules_data/act_trf.php +++ b/modules_data/act_trf.php @@ -17,7 +17,7 @@ if(isset($_POST['date'])) { if($u->info['money'] >= 0.5) { $red = 'Отчеты о переводах за '.date('d.m.Y',$odate).' передан Вам и находится в разделе "Заклятия".
'; //создаем отчет - $itm = $u->addItem(2435,$u->info['id'],'noodet=1|noremont=1'); + $itm = \User\ItemsModel::addItem(2435,$u->info['id'],'noodet=1|noremont=1'); $u->info['money'] -= 0.5; mysql_query('UPDATE `users` SET `money` = `money` - 0.5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `use_text` = 100 WHERE `id` = "'.$itm.'" LIMIT 1'); diff --git a/modules_data/add_eff.php b/modules_data/add_eff.php index c2629902..27adab50 100644 --- a/modules_data/add_eff.php +++ b/modules_data/add_eff.php @@ -75,7 +75,7 @@ function useItem($int): string return 'Недостаточно денег!'; } - $additm = $u->addItem($items[$int]['id'], $u->info['id']); + $additm = \User\ItemsModel::addItem($items[$int]['id'], $u->info['id']); if (empty($additm)) { return 'Что-то пошло не так, каст не сработал...'; } diff --git a/modules_data/location/_shop_referal_.php b/modules_data/location/_shop_referal_.php index d93914d5..28cc17ac 100644 --- a/modules_data/location/_shop_referal_.php +++ b/modules_data/location/_shop_referal_.php @@ -37,7 +37,7 @@ if(isset($_POST['itemgift'])) if( isset($itm_l['id']) && $itm_l['money'] > $u->info['money'] ) { $re = '
Недостаточно денег
'; }elseif( isset($itm_l['id']) ) { - $itm = $u->addItem(4533,1,'|gift_id='.$itm_l['id'].''); + $itm = \User\ItemsModel::addItem(4533,1,'|gift_id='.$itm_l['id'].''); if( $itm > 0 ) { $itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "63" OR `im`.`type` = "64") AND `iu`.`id` = "'.mysql_real_escape_string($itm).'" AND `iu`.`uid` = "1" AND `iu`.`gift` = "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" LIMIT 1')); if(isset($itm['id'])) { diff --git a/modules_data/location/ab/hram.php b/modules_data/location/ab/hram.php index ee235dd4..2eac2252 100644 --- a/modules_data/location/ab/hram.php +++ b/modules_data/location/ab/hram.php @@ -46,7 +46,7 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) { mysql_query(sprintf($check['query'], $u->info['id'])); $newRune = \Insallah\Runes::get($check['rune_level']); if (!empty($newRune)) { - $u->addItem($check['rune_id'], $u->info['id'], $newRune[0]); + \User\ItemsModel::addItem($check['rune_id'], $u->info['id'], $newRune[0]); $resz = $newRune[1]; mysql_query(sprintf('update items_users set `delete` = unix_timestamp() where id in (%d, %d, %d)', $itm1['iid'], $itm2['iid'], $itm3['iid'])); @@ -66,7 +66,7 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) { } $itm4 = $itm4[rand(0, count($itm4) - 1)]; mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm3['iid'] . '" OR `id` = "' . $itm2['iid'] . '" OR `id` = "' . $itm1['iid'] . '"'); - $u->addItem($itm4['id'], $u->info['id']); + \User\ItemsModel::addItem($itm4['id'], $u->info['id']); $resz = 'Удачно преобразованы руны "' . $itm1['name'] . '","' . $itm2['name'] . '" и "' . $itm3['name'] . '" в "' . $itm4['name'] . '".'; } else { $itm4 = []; @@ -77,7 +77,7 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) { } $itm4 = $itm4[rand(0, count($itm4) - 1)]; mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm3['iid'] . '" OR `id` = "' . $itm2['iid'] . '" OR `id` = "' . $itm1['iid'] . '"'); - $u->addItem($itm4['id'], $u->info['id']); + \User\ItemsModel::addItem($itm4['id'], $u->info['id']); $resz = 'Удачно преобразованы руны "' . $itm1['name'] . '","' . $itm2['name'] . '" и "' . $itm3['name'] . '" в "' . $itm4['name'] . '".'; } diff --git a/modules_data/location/ab/hramOLD.php b/modules_data/location/ab/hramOLD.php index 6f86f89e..848fea84 100644 --- a/modules_data/location/ab/hramOLD.php +++ b/modules_data/location/ab/hramOLD.php @@ -62,7 +62,7 @@ if($u->room['file']=='ab/hram') mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm3['iid'].'" OR `id` = "'.$itm2['iid'].'" OR `id` = "'.$itm1['iid'].'"'); $u->rep['rep1'] += 10; mysql_query('UPDATE `rep` SET `rep1` = "'.$u->rep['rep1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->addItem($itm4['id'],$u->info['id']); + \User\ItemsModel::addItem($itm4['id'],$u->info['id']); $resz = 'Удачно преобразованы руны "'.$itm1['name'].'","'.$itm2['name'].'" и "'.$itm3['name'].'" в "'.$itm4['name'].'".'; $resz .= '
Добавлена репутация Храма Знаний +10'; }else{ @@ -76,7 +76,7 @@ if($u->room['file']=='ab/hram') mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm3['iid'].'" OR `id` = "'.$itm2['iid'].'" OR `id` = "'.$itm1['iid'].'"'); $u->rep['rep1'] += 1; mysql_query('UPDATE `rep` SET `rep1` = "'.$u->rep['rep1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->addItem($itm4['id'],$u->info['id']); + \User\ItemsModel::addItem($itm4['id'],$u->info['id']); $resz = 'Удачно преобразованы руны "'.$itm1['name'].'","'.$itm2['name'].'" и "'.$itm3['name'].'" в "'.$itm4['name'].'".'; $resz .= '
Добавлена репутация Храма Знаний +1'; } diff --git a/modules_data/location/altar_cat.php b/modules_data/location/altar_cat.php index 12193483..597f23a4 100644 --- a/modules_data/location/altar_cat.php +++ b/modules_data/location/altar_cat.php @@ -93,12 +93,12 @@ if(isset($file) && $file[0]=='altar_cat.php') $itm_data['srok'] = (int)$itm_data['srok']; // Только Цифры! if(isset($itm_data['srok']) and $itm_data['srok']>0){ $itm_data['srok'] = $itm_data['srok']*3; // В три раза больше срок хранения! - $itm_data = '|'.$u->impStats($itm_data); + $itm_data = '|'.\Core\ConversionHelper::arrayToDataString($itm_data); } } else { $itm_data = NULL; } - $u->addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); mysql_query('UPDATE `items_users` SET `delete` = "'.time().'",`inShop` = "0" WHERE '.$rec3.' LIMIT '.$rec3l); $re = 'Предмет "'.$itm['name'].'" был успешно создан!'; }else{ diff --git a/modules_data/location/an/flower.php b/modules_data/location/an/flower.php index f97431c9..c9a516a4 100644 --- a/modules_data/location/an/flower.php +++ b/modules_data/location/an/flower.php @@ -101,13 +101,13 @@ if($u->room['file']=='an/flower') $itm_data['srok'] = (int)$itm_data['srok']; // Только Цифры! if(isset($itm_data['srok']) and $itm_data['srok']>0){ $itm_data['srok'] = $itm_data['srok']*3; // В три раза больше срок хранения! - $itm_data = '|'.$u->impStats($itm_data); + $itm_data = '|'.\Core\ConversionHelper::arrayToDataString($itm_data); } } else { $itm_data = NULL; } - $u->addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); mysql_query('UPDATE `items_users` SET `delete` = "'.time().'",`inShop` = "0" WHERE '.$rec3.' LIMIT '.$rec3l); $re = 'Предмет "'.$itm['name'].'" был успешно перемещен в инвентарь'; }else{ diff --git a/modules_data/location/an/remont.php b/modules_data/location/an/remont.php index 78c90803..fe742d6b 100644 --- a/modules_data/location/an/remont.php +++ b/modules_data/location/an/remont.php @@ -114,7 +114,7 @@ if($u->room['file']=='an/remont') $u->addDelo(2,$u->info['id'],'"System.remont.itemUpgrade": Предмет "'.$ir['name'].'" [itm:'.$ir['id'].'] был успешно улучшен ('.$po['upgrade'].'/5) за '.$pcena.' кр..',time(),$u->info['city'],'System.remont.itemUpgrade',0,0); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`1price` = "'.$ir['1price'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['money'] -= $pcena; @@ -245,7 +245,7 @@ if($u->room['file']=='an/remont') $po['mf_mib'] += $fadd[2]; } $po['modif'] = 1; - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`1price` = "'.$ir['1price'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); @@ -297,7 +297,7 @@ if($u->room['file']=='an/remont') mysql_query('UPDATE `items_users` SET `delete` = "'.mysql_real_escape_string(0).'" WHERE `id` = "'.$po["upatack"].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = CONCAT(`data`,"|nosale=1") WHERE `id` = "'.$po["upatack"].'" LIMIT 1'); } else { // Если старый предмет не существует, создаем новый. - $u->addItem($po['upatack_id'],$u->info['id'],'|fromshop=1|nosale=1', NULL, NULL, true); + \User\ItemsModel::addItem($po['upatack_id'],$u->info['id'],'|fromshop=1|nosale=1', NULL, NULL, true); $irs .= ','.$po['upatack_name']; } } @@ -326,13 +326,13 @@ if($u->room['file']=='an/remont') unset($po["upatack_lvl"]); unset($item_default); unset($upattack); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); // Заточка tr_lvl=4|tr_s5=10|tr_mg7=4|uptype=21|upatack=4|tr_a4=4|srok=432000 /* if(isset($po['spell_id'])) { //Извлечение чарки - $u->addItem($po['spell_id'],$u->info['id']); + \User\ItemsModel::addItem($po['spell_id'],$u->info['id']); $irs .= ','.$po['spell_name']; } @@ -369,7 +369,7 @@ if($u->room['file']=='an/remont') */ /* - $iidis = $u->addItem($ir['item_id'],$u->info['id'],$pon); + $iidis = \User\ItemsModel::addItem($ir['item_id'],$u->info['id'],$pon); mysql_query('UPDATE `items_users` SET `iznosMAX` = "'.$ir['iznosMAX'].'", `iznosNOW` = "'.$ir['iznosNOW'].'", @@ -425,11 +425,11 @@ if($u->room['file']=='an/remont') $i++; } - $u->addItem($po['rune_id'],$u->info['id']); + \User\ItemsModel::addItem($po['rune_id'],$u->info['id']); $re = '
Руна "'.$po['rune_name'].'" была успешно извлечена из предмета "'.$ir['name'].'" за '.$pcena.' кр.
'; $u->addDelo(2,$u->info['id'],'"System.remont.unrune": Руна "'.$po['rune_name'].'" была успешно извлечена из предмета "'.$ir['name'].'" [itm:'.$ir['id'].'] за '.$pcena.' кр.',time(),$u->info['city'],'System.remont.unrune',0,0); unset($po['rune'],$po['rune_id'],$po['rune_name'],$po['rune_lvl']); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['money'] -= $pcena; @@ -461,7 +461,7 @@ if($u->room['file']=='an/remont') $tst = str_replace(' ','',$po['gravi']); $po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']); if($po['gravi'] != '' && $tst != '') { - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
На предмете "'.$ir['name'].'" был успешно выгровирован текст за '.$pcena.' кр.
'; @@ -494,7 +494,7 @@ if($u->room['file']=='an/remont') $tst = str_replace(' ','',$po['gravi']); $po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']); if($po['gravi'] != '' && $tst != '') { - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
На предмете "'.$ir['name'].'" был успешно выгровирован текст за '.$pcena.' кр.
'; @@ -522,7 +522,7 @@ if($u->room['file']=='an/remont') $po['podgon'] = 1; $po['add_hpAll'] += $prhp; $po['sudba'] = $u->info['login']; - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
Предмет "'.$ir['name'].'" был успешно подогнан за '.$pcena.' кр. (Добавлено +'.$prhp.'HP)
'; @@ -711,7 +711,7 @@ if($u->room['file']=='an/remont') { $ir['iznosMAX'] = 1; } - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`iznosNOW` = "'.$ir['iznosNOW'].'",`iznosMAX` = "'.$ir['iznosMAX'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re2 = 'Удачно произведен ремонт '.$re2.' предмета "'.$ir['name'].'" за '.$u->zuby($rem_cell,1).'.'; $dop = 0; @@ -1036,7 +1036,7 @@ if($u->room['file']=='an/remont') if($wrk == 1 && ($sti['sudba'] == '0' || !isset($sti['sudba']))) { $sti['sudba'] = $u->info['login']; } - $sti_imp = $u->impStats($sti); + $sti_imp = \Core\ConversionHelper::arrayToDataString($sti); mysql_query('UPDATE `bank` SET `money2` = `money2` - "'.$epr.'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($sti_imp).'" WHERE `id` = "'.$itmu['id'].'" LIMIT 1'); $er2 = 'Предмет "'.$itmm['name'].'" успешно подогнан под "'.$com2['name'].'" за '.$epr.' екр.'; diff --git a/modules_data/location/an/shop_.php b/modules_data/location/an/shop_.php index 7ae586cd..12ae7b81 100644 --- a/modules_data/location/an/shop_.php +++ b/modules_data/location/an/shop_.php @@ -27,7 +27,7 @@ if($u->room['file']=='an/shop_') if( isset($itm_l['id']) && $itm_l['money'] > $u->info['money'] ) { $re = '
Недостаточно денег
'; }elseif( isset($itm_l['id']) ) { - $itm = $u->addItem(4533,1,'|gift_id='.$itm_l['id'].''); + $itm = \User\ItemsModel::addItem(4533,1,'|gift_id='.$itm_l['id'].''); if( $itm > 0 ) { $itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "63" OR `im`.`type` = "64") AND `iu`.`id` = "'.mysql_real_escape_string($itm).'" AND `iu`.`uid` = "1" AND `iu`.`gift` = "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" LIMIT 1')); if(isset($itm['id'])) { diff --git a/modules_data/location/an/znahar.php b/modules_data/location/an/znahar.php index 67f2b5d4..00d99bae 100644 --- a/modules_data/location/an/znahar.php +++ b/modules_data/location/an/znahar.php @@ -263,7 +263,7 @@ if(isset($tst_trvm['id'])) { $st['s13'] = 0; $st['s14'] = 0; $st['s15'] = 0; - $st = $u->impStats($st); + $st = \Core\ConversionHelper::arrayToDataString($st); $n1 = test_ability(); $n2 = $u->info['skills']; $n3 = $u->info['sskills']; @@ -296,7 +296,7 @@ if(isset($tst_trvm['id'])) { $st['mg5'] = 0; $st['mg6'] = 0; $st['mg7'] = 0; - $st = $u->impStats($st); + $st = \Core\ConversionHelper::arrayToDataString($st); $n1 = $u->info['ability']; $n2 = test_skills(); $n3 = $u->info['sskills']; @@ -368,7 +368,7 @@ if(isset($tst_trvm['id'])) { }elseif($st['s1']>=3 && $st['s2']>=3 && $st['s3']>=3 && $st['s4']>=test_s5() && $st['s5']>=0 && $st['s6']>=0 && $st['s7']>=0 && $st['s8']>=0 && $st['s9']>=0 && $st['s10']>=0){ //Желательно проверку на статы по уровню (можно ли этот стат поднимать на текущем уровне перса) - $u->info['stats'] = $u->impStats($st); + $u->info['stats'] = \Core\ConversionHelper::arrayToDataString($st); if(mysql_query('UPDATE `stats` SET `stats` = "'.mysql_real_escape_string($u->info['stats']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1')) { add_narkoz(2,'Переброс характеристик'); diff --git a/modules_data/location/dragopsh.php b/modules_data/location/dragopsh.php index e50238d9..ee8b3c67 100644 --- a/modules_data/location/dragopsh.php +++ b/modules_data/location/dragopsh.php @@ -73,9 +73,9 @@ if (isset($_GET['takeitm'])) { $errors .= 'Вы подняли предмет "' . $var['obj']['name'] . '"'; mysql_query('UPDATE `laba_itm` SET `take` = "' . $u->info['id'] . '" WHERE `id` = "' . $var['obj']['id'] . '" LIMIT 1'); if ($var['obj']['inslot'] > 0) { - $u->addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1|nosavelaba=1|nosale=1'); + \User\ItemsModel::addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1|nosavelaba=1|nosale=1'); } else { - $u->addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1'); + \User\ItemsModel::addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1'); } sendSysChat($var['text'], true); } else { @@ -114,7 +114,7 @@ if (isset($_GET['takeitm'])) { $var['itm'] = $var['itm'][0]; $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); if (isset($var['itm']['id'])) { - $u->addItem($var['itm']['id'], $u->info['id'], '|fromlaba=1'); + \User\ItemsModel::addItem($var['itm']['id'], $u->info['id'], '|fromlaba=1'); } else { $var['itm']['name'] = 'Предмет рассыпался на глазах...'; } @@ -497,7 +497,7 @@ if ($itms != '') { $lab['users']--; mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); } - $u->addItem(4392, $u->info['id'], '|fromlaba=1|nosale=1'); + \User\ItemsModel::addItem(4392, $u->info['id'], '|fromlaba=1|nosale=1'); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"'); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); diff --git a/modules_data/location/elka.php b/modules_data/location/elka.php index 5e5f7fd5..93baa061 100644 --- a/modules_data/location/elka.php +++ b/modules_data/location/elka.php @@ -74,7 +74,7 @@ if($u->room['file']=='elka') $smt = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "take_gift_'.$dt.'" LIMIT 1',1); if(!isset($smt['id'])) { - $pid = $u->addItem($pidid,$u->info['id']); + $pid = \User\ItemsModel::addItem($pidid,$u->info['id']); if($pid>0) { mysql_query('UPDATE `items_users` SET `gift` = "Администрация",`gtxt1` = "Поздравляем Вас с Новым Годом!" WHERE `id` = "'.$pid.'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); diff --git a/modules_data/location/flower.php b/modules_data/location/flower.php index 6cef7d2a..b2c73624 100644 --- a/modules_data/location/flower.php +++ b/modules_data/location/flower.php @@ -101,13 +101,13 @@ if($u->room['file']=='flower') $itm_data['srok'] = (int)$itm_data['srok']; // Только Цифры! if(isset($itm_data['srok']) and $itm_data['srok']>0){ $itm_data['srok'] = $itm_data['srok']*3; // В три раза больше срок хранения! - $itm_data = '|'.$u->impStats($itm_data); + $itm_data = '|'.\Core\ConversionHelper::arrayToDataString($itm_data); } } else { $itm_data = NULL; } - $u->addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); mysql_query('UPDATE `items_users` SET `delete` = "'.time().'",`inShop` = "0" WHERE '.$rec3.' LIMIT '.$rec3l); $re = 'Предмет "'.$itm['name'].'" был успешно перемещен в инвентарь'; }else{ diff --git a/modules_data/location/katok.php b/modules_data/location/katok.php index 0e7475c7..e8060acd 100644 --- a/modules_data/location/katok.php +++ b/modules_data/location/katok.php @@ -122,19 +122,19 @@ if($tcount >= 6 ) { "39","5","'.$x1.'","'.$y1.'" )'); //Выдаем амуницию - $u->addItem(4815,$inbot); + \User\ItemsModel::addItem(4815,$inbot); if($pl['team'] == 1) { - $u->addItem(4816,$inbot); - $u->addItem(4818,$inbot); - $u->addItem(4820,$inbot); - $u->addItem(4822,$inbot); - $u->addItem(4824,$inbot); + \User\ItemsModel::addItem(4816,$inbot); + \User\ItemsModel::addItem(4818,$inbot); + \User\ItemsModel::addItem(4820,$inbot); + \User\ItemsModel::addItem(4822,$inbot); + \User\ItemsModel::addItem(4824,$inbot); }elseif($pl['team'] == 2) { - $u->addItem(4817,$inbot); - $u->addItem(4819,$inbot); - $u->addItem(4821,$inbot); - $u->addItem(4823,$inbot); - $u->addItem(4825,$inbot); + \User\ItemsModel::addItem(4817,$inbot); + \User\ItemsModel::addItem(4819,$inbot); + \User\ItemsModel::addItem(4821,$inbot); + \User\ItemsModel::addItem(4823,$inbot); + \User\ItemsModel::addItem(4825,$inbot); } // mysql_query('UPDATE `users` SET `room` = "410", `inUser` = "'.$inbot.'" WHERE `id` = "'.$bus['id'].'" LIMIT 1'); diff --git a/modules_data/location/miloserdie.php b/modules_data/location/miloserdie.php index d91758b4..6b2d0897 100644 --- a/modules_data/location/miloserdie.php +++ b/modules_data/location/miloserdie.php @@ -93,7 +93,7 @@ elseif($_GET['get']=='10' && $is_eff[0]>0){ $take_today = 0 + $take_today[0]; if( $take_today < 2 ) { $error .= 'Вы взяли у Ангела «'.$itm['name'].'» найти вы его можете у себя в рюкзаке.'; - $u->addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); }else{ $error .= 'Ангел Вам уже выдал предмет, больше вы не получите, если хотите поменять свою вещь, отдайте Ангелу те которые вы уже взяли !'; } diff --git a/modules_data/location/padalshik.php b/modules_data/location/padalshik.php index 1df82319..1a65831d 100644 --- a/modules_data/location/padalshik.php +++ b/modules_data/location/padalshik.php @@ -84,7 +84,7 @@ elseif($_GET['get']=='10' && $is_eff[0]>0){ $take_today = 0 + $take_today[0]; if( $take_today < 2 ) { $error .= 'Вы взяли у Ангела «'.$itm['name'].'» найти вы его можете у себя в рюкзаке.'; - $u->addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); }else{ $error .= 'Ангел Вам уже выдал предмет, больше вы не получите, если хотите поменять свою вещь, отдайте Ангелу те которые вы уже взяли !'; } diff --git a/modules_data/location/remont.php b/modules_data/location/remont.php index 5e1aab74..efed396b 100644 --- a/modules_data/location/remont.php +++ b/modules_data/location/remont.php @@ -114,7 +114,7 @@ if($u->room['file']=='remont') $u->addDelo(2,$u->info['id'],'"System.remont.itemUpgrade": Предмет "'.$ir['name'].'" [itm:'.$ir['id'].'] был успешно улучшен ('.$po['upgrade'].'/5) за '.$pcena.' кр..',time(),$u->info['city'],'System.remont.itemUpgrade',0,0); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`1price` = "'.$ir['1price'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['money'] -= $pcena; @@ -245,7 +245,7 @@ if($u->room['file']=='remont') $po['mf_mib'] += $fadd[2]; } $po['modif'] = 1; - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`1price` = "'.$ir['1price'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); @@ -295,7 +295,7 @@ if($u->room['file']=='remont') mysql_query('UPDATE `items_users` SET `delete` = "'.mysql_real_escape_string(0).'" WHERE `id` = "'.$po["upatack"].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = CONCAT(`data`,"noremont=1") WHERE `id` = "'.$po["upatack"].'" LIMIT 1'); } else { // Если старый предмет не существует, создаем новый. - $u->addItem($po['upatack_id'],$u->info['id'],'|noremont=1', NULL, NULL, true); + \User\ItemsModel::addItem($po['upatack_id'],$u->info['id'],'|noremont=1', NULL, NULL, true); $irs .= ','.$po['upatack_name']; } } @@ -324,13 +324,13 @@ if($u->room['file']=='remont') unset($po["upatack_lvl"]); unset($item_default); unset($upattack); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); // Заточка tr_lvl=4|tr_s5=10|tr_mg7=4|uptype=21|upatack=4|tr_a4=4|srok=432000 /* if(isset($po['spell_id'])) { //Извлечение чарки - $u->addItem($po['spell_id'],$u->info['id']); + \User\ItemsModel::addItem($po['spell_id'],$u->info['id']); $irs .= ','.$po['spell_name']; } @@ -362,7 +362,7 @@ if($u->room['file']=='remont') $pon .= '|icos='.$po['icos'].''; } - $iidis = $u->addItem($ir['item_id'],$u->info['id'],$pon); + $iidis = \User\ItemsModel::addItem($ir['item_id'],$u->info['id'],$pon); mysql_query('UPDATE `items_users` SET `iznosMAX` = "'.$ir['iznosMAX'].'", `iznosNOW` = "'.$ir['iznosNOW'].'", @@ -416,7 +416,7 @@ if($u->room['file']=='remont') $u->info['money'] -= $pcena; mysql_query(sprintf("update users set money = money - %f where id = %d", $pcena, $u->info['id'])); # Добавляем руну - $u->addItem($item_and_rune['rune_id'],$u->info['id'],$item_and_rune['rune'], null, null, true); + \User\ItemsModel::addItem($item_and_rune['rune_id'],$u->info['id'],$item_and_rune['rune'], null, null, true); } else { /** Если пытаемся извлечь любую руну кроме 6001, 6002, 6003. */ $re = 'Руна слилась с предметом и не извлекается...'; @@ -462,12 +462,12 @@ if($u->room['file']=='remont') $i++; } - $u->addItem($po['upatack_id'],$u->info['id'],NULL,NULL,NULL,1); + \User\ItemsModel::addItem($po['upatack_id'],$u->info['id'],NULL,NULL,NULL,1); $re = '
Заточка "'.$po['upatack_name'].'" была успешно извлечена из предмета "'.$ir['name'].'" за '.$pcena.' кр.
'; $u->addDelo(2,$u->info['id'],'"System.remont.ubeff": Руна "'.$po['upatack_name'].'" была успешно извлечена из предмета "'.$ir['name'].'" [itm:'.$ir['id'].'] за '.$pcena.' кр.',time(),$u->info['city'],'System.remont.ubeff',0,0); unset($po['upatack'],$po['upatack_id'],$po['upatack_name'],$po['upatack_lvl']); - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $u->info['money'] -= $pcena; @@ -498,7 +498,7 @@ if($u->room['file']=='remont') $tst = str_replace(' ','',$po['gravi']); $po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']); if($po['gravi'] != '' && $tst != '') { - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
На предмете "'.$ir['name'].'" был успешно выгровирован текст за '.$pcena.' кр.
'; @@ -531,7 +531,7 @@ if($u->room['file']=='remont') $tst = str_replace(' ','',$po['gravi']); $po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']); if($po['gravi'] != '' && $tst != '') { - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
На предмете "'.$ir['name'].'" был успешно выгровирован текст за '.$pcena.' кр.
'; @@ -559,7 +559,7 @@ if($u->room['file']=='remont') $po['podgon'] = 1; $po['add_hpAll'] += $prhp; $po['sudba'] = $u->info['login']; - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re = '
Предмет "'.$ir['name'].'" был успешно подогнан за '.$pcena.' кр. (Добавлено +'.$prhp.'HP)
'; @@ -738,7 +738,7 @@ if($u->room['file']=='remont') { $ir['iznosMAX'] = 1; } - $po = $u->impStats($po); + $po = \Core\ConversionHelper::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`iznosNOW` = "'.$ir['iznosNOW'].'",`iznosMAX` = "'.$ir['iznosMAX'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1'); $re2 = 'Удачно произведен ремонт '.$re2.' предмета "'.$ir['name'].'" за '.$u->zuby($rem_cell,1).'.'; $dop = 0; @@ -1037,7 +1037,7 @@ if($u->room['file']=='remont') if($wrk == 1 && ($sti['sudba'] == '0' || !isset($sti['sudba']))) { $sti['sudba'] = $u->info['login']; } - $sti_imp = $u->impStats($sti); + $sti_imp = \Core\ConversionHelper::arrayToDataString($sti); mysql_query('UPDATE `bank` SET `money2` = `money2` - "'.$epr.'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($sti_imp).'" WHERE `id` = "'.$itmu['id'].'" LIMIT 1'); $er2 = 'Предмет "'.$itmm['name'].'" успешно подогнан под "'.$com2['name'].'" за '.$epr.' екр.'; diff --git a/modules_data/location/shop_.php b/modules_data/location/shop_.php index 38ce3898..9e099312 100644 --- a/modules_data/location/shop_.php +++ b/modules_data/location/shop_.php @@ -32,7 +32,7 @@ if(isset($_POST['itemgift'])) if( isset($itm_l['id']) && $itm_l['money'] > $u->info['money'] ) { $re = '
Недостаточно денег
'; }elseif( isset($itm_l['id']) ) { - $itm = $u->addItem(4533,1,'|gift_id='.$itm_l['id'].''); + $itm = \User\ItemsModel::addItem(4533,1,'|gift_id='.$itm_l['id'].''); if( $itm > 0 ) { $itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = "28" OR `im`.`type` = "38" OR `im`.`type` = "63" OR `im`.`type` = "64" OR `im`.`type` = "37") AND `iu`.`id` = "'.mysql_real_escape_string($itm).'" AND `iu`.`uid` = "1" AND `iu`.`gift` = "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" LIMIT 1')); if(isset($itm['id'])) { diff --git a/modules_data/location/spavedlivost.php b/modules_data/location/spavedlivost.php index 907956dc..f279b3dc 100644 --- a/modules_data/location/spavedlivost.php +++ b/modules_data/location/spavedlivost.php @@ -94,7 +94,7 @@ elseif($_GET['get']=='10' && $is_eff[0]>0){ $take_today = 0 + $take_today[0]; if( $take_today < 2 ) { $error .= 'Вы взяли у Ангела «'.$itm['name'].'» найти вы его можете у себя в рюкзаке.'; - $u->addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); + \User\ItemsModel::addItem($itm['id'],$u->info['id'],'|sudba='.$u->info['login'].'|nosale=1|frompisher=1|musor_art=1'); }else{ $error .= 'Ангел Вам уже выдал предмет, больше вы не получите, если хотите поменять свою вещь, отдайте Ангелу те которые вы уже взяли !'; } diff --git a/modules_data/location/znahar.php b/modules_data/location/znahar.php index f5a45516..8a156fea 100644 --- a/modules_data/location/znahar.php +++ b/modules_data/location/znahar.php @@ -280,7 +280,7 @@ if(isset($tst_trvm['id'])) { $st['s13'] = 0; $st['s14'] = 0; $st['s15'] = 0; - $st = $u->impStats($st); + $st = \Core\ConversionHelper::arrayToDataString($st); $n1 = test_ability(); $n2 = $u->info['skills']; $n3 = $u->info['sskills']; @@ -313,7 +313,7 @@ if(isset($tst_trvm['id'])) { $st['mg5'] = 0; $st['mg6'] = 0; $st['mg7'] = 0; - $st = $u->impStats($st); + $st = \Core\ConversionHelper::arrayToDataString($st); $n1 = $u->info['ability']; $n2 = test_skills(); $n3 = $u->info['sskills']; @@ -386,7 +386,7 @@ if(isset($tst_trvm['id'])) { }elseif($st['s1']>=3 && $st['s2']>=3 && $st['s3']>=3 && $st['s4']>=test_s5() && $st['s5']>=0 && $st['s6']>=0 && $st['s7']>=test_s7() && $st['s8']>=0 && $st['s9']>=0 && $st['s10']>=0){ //Желательно проверку на статы по уровню (можно ли этот стат поднимать на текущем уровне перса) - $u->info['stats'] = $u->impStats($st); + $u->info['stats'] = \Core\ConversionHelper::arrayToDataString($st); if(mysql_query('UPDATE `stats` SET `stats` = "'.mysql_real_escape_string($u->info['stats']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1')) { add_narkoz(2,'Переброс характеристик'); diff --git a/modules_data/moder/usemarry.php b/modules_data/moder/usemarry.php index a27f1984..f5781fe9 100644 --- a/modules_data/moder/usemarry.php +++ b/modules_data/moder/usemarry.php @@ -59,8 +59,8 @@ $cmsg->setTypeTime(1); $rtxt = $rang.' "'.$u->info['login'].'" подтвердил'.$sx.' законность брака с '.$uu['id'].'.'; mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu2['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)"); - $u->addItem(76,$uu['id'],'sudba='.$uu['login'].'|noremont=1|notransfer=1'); - $u->addItem(76,$uu2['id'],'sudba='.$uu2['login'].'|noremont=1|notransfer=1'); + \User\ItemsModel::addItem(76,$uu['id'],'sudba='.$uu['login'].'|noremont=1|notransfer=1'); + \User\ItemsModel::addItem(76,$uu2['id'],'sudba='.$uu2['login'].'|noremont=1|notransfer=1'); $uer = 'Вы успешно зафиксировали брак "'.$uu['login'].'" и "'.$uu2['login'].'".'; }else{ diff --git a/modules_data/moder/useunmarry.php b/modules_data/moder/useunmarry.php index e68ac414..30d0f72e 100644 --- a/modules_data/moder/useunmarry.php +++ b/modules_data/moder/useunmarry.php @@ -57,8 +57,8 @@ $cmsg->setTypeTime(1); $rtxt = $rang.' "'.$u->info['login'].'" расторгнул'.$sx.' законность брака с '.$uu['id'].'.'; mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu2['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)"); - $u->addItem(76,$uu['id'],'sudba='.$uu['login'].'|noremont=1|notransfer=1'); - $u->addItem(76,$uu2['id'],'sudba='.$uu2['login'].'|noremont=1|notransfer=1'); + \User\ItemsModel::addItem(76,$uu['id'],'sudba='.$uu['login'].'|noremont=1|notransfer=1'); + \User\ItemsModel::addItem(76,$uu2['id'],'sudba='.$uu2['login'].'|noremont=1|notransfer=1'); mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = 76 AND (`uid` = "'.$uu['id'].'" OR `uid` = "'.$uu2['id'].'")'); diff --git a/modules_data/stats_loc.php b/modules_data/stats_loc.php index ee21cf97..39cd7d0e 100644 --- a/modules_data/stats_loc.php +++ b/modules_data/stats_loc.php @@ -73,9 +73,9 @@ function giveDailyQuestPrize() Db::sql('update actions set vals = 0 where vars = ? and uid = ?', ['day_quest', $u->info['id']]); Db::sql('update users_achiv set zb = zb + 1 where id = ?', [$u->info['id']]); if ($u->info['level'] < 12) { - $u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']); } else { - $u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); + \User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']); } StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20 } diff --git a/modules_data/vip.php b/modules_data/vip.php index ece87c0c..9455206f 100644 --- a/modules_data/vip.php +++ b/modules_data/vip.php @@ -197,7 +197,7 @@ $vi = array( if($ability[$account][$i][1]-$vix > 0) { if(isset($_GET['take_item_vip']) && $_GET['take_item_vip'] == $itm['id']) { - $nitm = $u->addItem($itm['id'],$u->info['id'],$ability[$account][$i][5]); + $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$ability[$account][$i][5]); if($ability[$account][6]>0) { } $u->addAction(time(),'vitm_'.$itm['id'],''); diff --git a/modules_data/vip1.php b/modules_data/vip1.php index 96e22cfb..ee78fd01 100644 --- a/modules_data/vip1.php +++ b/modules_data/vip1.php @@ -78,7 +78,7 @@ $vi = array( if($vi[$i][1][$u->stats['silver']]-$vix > 0) { if(isset($_GET['take_item_vip']) && $_GET['take_item_vip'] == $itm['id']) { $vix++; - $nitm = $u->addItem($itm['id'],$u->info['id'],$vi[$i][5]); + $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$vi[$i][5]); if($vi[$i][6]>0) { mysql_query('UPDATE `items_users` SET `data`="'.$vi[$i][5].'",`iznosMAX` = "'.$vi[$i][6].'",`1price` = "0.01" WHERE `id` = "'.$nitm.'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'); }