From 8a1eabb6cb099555e75e90657de80fc0cb6227e2 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 12 Dec 2018 22:50:32 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20?= =?UTF-8?q?=D1=83=D0=B2=D0=B5=D0=BB=D0=B8=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=80=D1=8E=D0=BA=D0=B7=D0=B0=D0=BA=D0=B0=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.php | 8 +------- shop.php | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/main.php b/main.php index aac7b29..749983b 100644 --- a/main.php +++ b/main.php @@ -84,18 +84,12 @@ function unstack($it_id, $it_count) $it_count = (int)$it_count; $it_count = abs($it_count); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = " . $user['id'] . " AND `id` = '" . mysql_real_escape_string($it_id) . "' LIMIT 1")); - $prototype = mysql_fetch_array(mysql_query('SELECT `id`, `gmeshok` FROM `shop` WHERE `id` = "' . $dress['prototype'] . '" LIMIT 1')); if (isset($dress['id'])) { if ($it_count <= $dress['koll'] && $it_count > 0) { if ($dress['koll'] == $it_count) { mysql_query('DELETE FROM `inventory` WHERE `id` = "' . $dress['id'] . '" AND `owner` = "' . $user['id'] . '" LIMIT 1'); } else { - if ($dress['gmeshok'] > 0) { - $sqla = ", `gmeshok` = `gmeshok`-" . $prototype['gmeshok']; - } else { - $sqla = ""; - } - mysql_query("UPDATE `inventory` SET `cost` = (`cost`-`cost`/`koll`*" . $it_count . "), `point` = (`point`-`point`/`koll`*" . $it_count . "), `bcost` = (`bcost`-`bcost`/`koll`*" . $it_count . "), `massa` = (`massa`-`massa`/`koll`*" . $it_count . "), `koll` = (`koll`-" . $it_count . ")$sqla WHERE `id` = '$dress[id]' AND `owner` = '$user[id]' LIMIT 1"); + mysql_query("UPDATE `inventory` SET `cost` = (`cost`-`cost`/`koll`*" . $it_count . "), `point` = (`point`-`point`/`koll`*" . $it_count . "), `bcost` = (`bcost`-`bcost`/`koll`*" . $it_count . "), `massa` = (`massa`-`massa`/`koll`*" . $it_count . "), `koll` = (`koll`-" . $it_count . ") WHERE `id` = '$dress[id]' AND `owner` = '$user[id]' LIMIT 1"); } mysql_query("INSERT INTO `inventory` (`name`, `upgrade`, `modif`, `podgon`, `duration`, `maxdur`, `cost`, `bcost`, `point`, `nlevel`, `nsila`, `nlovk`, `ninta`, `nvinos`, `nintel`, `nmudra`, `nnoj`, `ntopor`, `ndubina`, `nmech`, `nalign`, `minu`, `maxu`, `gsila`, `glovk`, `ginta`, `gintel`, `ghp`, `mfkrit`, `mfakrit`, `mfuvorot`, `mfauvorot`, `gnoj`, `gtopor`, `gdubina`, `gmech`, `img`, `text`, `owner`, `dressed`, `bron1`, `bron2`, `bron3`, `bron4`, `dategoden`, `magic`, `type`, `present`, `sharped`, `massa`, `goden`, `needident`, `nfire`, `nwater`, `nair`, `nearth`, `nlight`, `ngray`, `ndark`, `gfire`, `gwater`, `gair`, `gearth`, `glight`, `ggray`, `gdark`, `free_bron`, `free_stat`, `free_mf`, `letter`, `isrep`, `update`, `setsale`, `prototype`, `otdel`, `bs`, `gmp`, `includemagic`, `includemagicdex`, `includemagicmax`, `includemagicname`, `includemagicuses`, `includemagiccost`, `gmeshok`, `tradesale`, `podzem`, `x_mis`, `artefact`, `destinyinv`, `encicl`, `foronetrip`, `koll`) VALUES ('" . $dress['name'] . "', '" . $dress['upgrade'] . "', '" . $dress['modif'] . "', '" . $dress['podgon'] . "', '" . $dress['duration'] . "', '" . $dress['maxdur'] . "', '" . ($dress['cost'] / $dress['koll'] * $it_count) . "', '" . ($dress['bcost'] / $dress['koll'] * $it_count) . "', '" . ($dress['point'] / $dress['koll'] * $it_count) . "', '" . $dress['nlevel'] . "', '" . $dress['nsila'] . "', '" . $dress['nlovk'] . "', '" . $dress['ninta'] . "', '" . $dress['nvinos'] . "', '" . $dress['nintel'] . "', '" . $dress['nmudra'] . "', '" . $dress['nnoj'] . "', '" . $dress['ntopor'] . "', '" . $dress['ndubina'] . "', '" . $dress['nmech'] . "', '" . $dress['nalign'] . "', '" . $dress['minu'] . "', '" . $dress['maxu'] . "', '" . $dress['gsila'] . "', '" . $dress['glovk'] . "', '" . $dress['ginta'] . "', '" . $dress['gintel'] . "', '" . $dress['ghp'] . "', '" . $dress['mfkrit'] . "', '" . $dress['mfakrit'] . "', '" . $dress['mfuvorot'] . "', '" . $dress['mfauvorot'] . "', '" . $dress['gnoj'] . "', '" . $dress['gtopor'] . "', '" . $dress['gdubina'] . "', '" . $dress['gmech'] . "', '" . $dress['img'] . "', '" . $dress['text'] . "', '" . $dress['owner'] . "', '" . $dress['dressed'] . "', '" . $dress['bron1'] . "', '" . $dress['bron2'] . "', '" . $dress['bron3'] . "', '" . $dress['bron4'] . "', '" . $dress['dategoden'] . "', '" . $dress['magic'] . "', '" . $dress['type'] . "', '" . $dress['present'] . "', '" . $dress['sharped'] . "', '" . ($dress['massa'] / $dress['koll'] * $it_count) . "', '" . $dress['goden'] . "', '" . $dress['needident'] . "', '" . $dress['nfire'] . "', '" . $dress['nwater'] . "', '" . $dress['nair'] . "', '" . $dress['nearth'] . "', '" . $dress['nlight'] . "', '" . $dress['ngray'] . "', '" . $dress['ndark'] . "', '" . $dress['gfire'] . "', '" . $dress['gwater'] . "', '" . $dress['gair'] . "', '" . $dress['gearth'] . "', '" . $dress['glight'] . "', '" . $dress['ggray'] . "', '" . $dress['gdark'] . "', '" . $dress['free_bron'] . "', '" . $dress['free_bron'] . "', '" . $dress['free_mf'] . "', '" . $dress['letter'] . "', '" . $dress['isrep'] . "', '" . $dress['update'] . "', '" . $dress['setsale'] . "', '" . $dress['prototype'] . "', '" . $dress['otdel'] . "', '" . $dress['bs'] . "', '" . $dress['gmp'] . "', '" . $dress['includemagic'] . "', '" . $dress['includemagicdex'] . "', '" . $dress['includemagicmax'] . "', '" . $dress['includemagicname'] . "', '" . $dress['ggrincludemagicusesay'] . "', '" . $dress['includemagiccost'] . "', '" . ($dress['gmeshok'] / $dress['koll'] * $it_count) . "', '" . $dress['tradesale'] . "', '" . $dress['podzem'] . "', '" . $dress['x_mis'] . "', '" . $dress['artefact'] . "', '" . $dress['destinyinv'] . "', '" . $dress['encicl'] . "', '" . $dress['foronetrip'] . "', '" . $it_count . "')"); return mysql_insert_id(); diff --git a/shop.php b/shop.php index db2c4d4..438f35e 100644 --- a/shop.php +++ b/shop.php @@ -161,9 +161,7 @@ function show_shop_items($it, $from = 'shop') $r .= "
"; } - $r .= (($item['gmeshok']) ? "• Увеличивает рюкзак: +{$item['gmeshok']}
" : "") . " - " . ((!empty($magic['name']) && $item['type'] != 50) ? "Наложены заклятия: " . $magic['name'] . "
" : "") . " - " . (($item['text']) ? "" . $item['text'] . "
" : "") . " + $r .= ((!empty($magic['name']) && $item['type'] != 50) ? "Наложены заклятия: " . $magic['name'] . "
" : "") . " " . ((!empty($incmagic['max'])) ? " Встроено заклятие " . $incmagic['cur'] . " шт.
" : "") . " " . ((!$item['isrep']) ? "Предмет не подлежит ремонту
" : "");