Убираем увеличение рюкзака из магазина

This commit is contained in:
lopar 2018-12-12 22:50:32 +02:00
parent 6e3c20e53c
commit 8a1eabb6cb
2 changed files with 2 additions and 10 deletions

View File

@ -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();

View File

@ -161,9 +161,7 @@ function show_shop_items($it, $from = 'shop')
$r .= "<br />";
}
$r .= (($item['gmeshok']) ? "• Увеличивает рюкзак: +{$item['gmeshok']}<br />" : "") . "
" . ((!empty($magic['name']) && $item['type'] != 50) ? "<span style='color: darkred;'>Наложены заклятия:</span> " . $magic['name'] . "<br />" : "") . "
" . (($item['text']) ? "<span style='color: darkorange;'>" . $item['text'] . "</span><br />" : "") . "
$r .= ((!empty($magic['name']) && $item['type'] != 50) ? "<span style='color: darkred;'>Наложены заклятия:</span> " . $magic['name'] . "<br />" : "") . "
" . ((!empty($incmagic['max'])) ? " Встроено заклятие <img src=\"i/magic/" . $incmagic['img'] . "\" /> " . $incmagic['cur'] . " шт. <br />" : "") . "
" . ((!$item['isrep']) ? "<small><span style='color: darkred;'>Предмет не подлежит ремонту</span></small><br />" : "");