query('UPDATE `online` SET `real_time` = ?i WHERE `user_id` = ?i', time(), $user['id']); } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
Стек: " . $e->getTraceAsString() . "
"; } if (!empty($user['battle'])) { header('location: fbattle.php'); die(); } //БС if (isset($user['in_tower']) && $user['in_tower'] == 1) { header('Location: towerin.php'); die(); } /* === проверяем соответствие комнаты и скрипта === */ if (in_array($user['room'], [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) { header('Location: city.php'); die(); } if ($user['room'] == 22) { header('Location: shop.php'); die(); } if ($user['room'] == 23) { header('Location: repair.php'); die(); } if ($user['room'] == 25) { header('Location: comission.php'); die(); } if ($user['room'] == 27) { header('Location: post.php'); die(); } if ($user['room'] == 29) { header('Location: bank.php'); die(); } if ($user['room'] == 31) { header('Location: tower.php'); die(); } if ($user['room'] == 30) { header('Location: clan_create.php'); die(); } if ($user['room'] == 34) { header('Location: fshop.php'); die(); } if ($user['room'] == 42) { header('Location: lotery.php'); die(); } if ($user['room'] == 43) { header('Location: znahar.php'); die(); } if ($user['room'] == 44) { header('Location: new_year.php'); die(); } if ($user['room'] == 45) { header('Location: clan_castle.php'); die(); } if ($user['room'] == 47) { header('Location: wall_build.php'); die(); } if ($user['room'] == 49) { header('Location: dig.php'); die(); } if ($user['room'] == 50) { header('Location: ashop.php'); die(); } if ($user['room'] == 53) { header('Location: library.php'); die(); } if ($user['room'] == 61) { header('Location: akadem.php'); die(); } if ($user['room'] == 650) { header('Location: ul_clans.php'); die(); } //Храм древнх if ($user['room'] == 203) { header('Location: church.php'); die(); } //ЦХ if ($user['room'] == 600) { header('Location: c_haos.php'); die(); } if ($user['room'] == 601) { header('Location: c_haos_in.php'); die(); } if ($user['room'] == 602) { header('Location: c_park.php'); die(); } if ($user['room'] == 603) { header('Location: aren_of_angels.php'); die(); } if ($user['room'] == 620) { header('Location: enter_cave.php'); die(); } if ($user['room'] == 621) { header('Location: cave.php'); die(); } if ($user['room'] == 660) { header('Location: hostel.php'); die(); } if ($user['room'] == 661) { header('Location: hostel_room.php'); die(); } if ($user['room'] == 662) { header('Location: quest_room.php'); die(); } if ($user['room'] == 760) { header('Location: c_forest.php'); die(); } if ($user['room'] == 1000) { header('Location: solib/enterbezdna.php'); die(); } if ($user['room'] == 1001) { header('Location: solib/dungeon.php'); die(); } if ($user['room'] == 1051) { header('Location: lab_enter.php'); die(); } if ($user['room'] == 1052) { header('Location: labirint.php'); die(); } if ($user['room'] == 402) { header('Location: vxod.php'); die(); } if ($user['room'] == 403) { header('Location: canalizaciya.php'); die(); } if ($user['room'] == 1054) { header('Location: fontan_luck.php'); die(); } if ($user['room'] == 1055) { header('Location: group_arena.php'); die(); } if ($user['room'] == 666) { header('Location: jail.php'); die(); } function sum_mf($u) { try { $sum = db::c()->query('SELECT SUM(`add_proc_mf`) AS `mf` FROM `inventory` WHERE `dressed` = 1 AND `add_proc_mf` > 0 AND `owner` = ?i', $u); if ($sum->fetch_assoc() > 0) { return $sum; } else { return 0; } } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
В файле: " . $e->getFile() . " (" . $e->getLine() . ")
"; } } function sum_dmg($u) { try { $sum = db::c()->query('SELECT SUM(`add_proc_uron`) AS `mf` FROM `inventory` WHERE `dressed` = 1 AND `add_proc_uron` > 0 AND `owner` = ?i', $u); if ($sum->fetch_assoc() > 0) { return $sum; } else { return 0; } } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
В файле: " . $e->getFile() . " (" . $e->getLine() . ")
"; } } function bron_ads($a1, $a2, $a3, $a4, $col) { return ['a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col)]; } function stack($it_id) { global $user; $it_id = (int)$it_id; $stack = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', $it_id, $user['id']); if (db::c()->getAffectedRows() === 1) { $stack = $stack->fetch_assoc(); $similar = mysql_fetch_array(mysql_query("SELECT SUM(`koll`) FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `id` != '" . $stack['id'] . "' AND `name` = '" . $stack['name'] . "' AND `present` = '" . $stack['present'] . "' AND `duration` = '" . $stack['duration'] . "' AND `maxdur` = '" . $stack['maxdur'] . "' AND `laba` = '" . $stack['laba'] . "' AND `gmeshok` = '" . $stack['gmeshok'] . "' AND `dressed` = 0 AND `goden` = 0 AND `setsale` = 0 AND `koll` >= 1 AND `isrep` = '" . $stack['isrep'] . "' AND FORMAT(`cost`/`koll`, 2) = FORMAT(" . ($stack['cost'] / $stack['koll']) . ", 2) AND FORMAT(`point`/`koll`, 2) = FORMAT(" . ($stack['point'] / $stack['koll']) . ", 2) AND FORMAT(`bcost`/`koll`, 2) = FORMAT(" . ($stack['bcost'] / $stack['koll']) . ", 2)")); if ($similar[0] >= 1) { mysql_query("UPDATE `inventory` SET `cost` = (`cost`+`cost`/`koll`*" . $similar[0] . "), `point` = (`point`+`point`/`koll`*" . $similar[0] . "), `bcost` = (`bcost`+`bcost`/`koll`*" . $similar[0] . "), `massa` = (`massa`+`massa`/`koll`*" . $similar[0] . "), `koll` = (`koll`+" . $similar[0] . "), `gmeshok` = (`gmeshok`+`gmeshok`*" . $similar[0] . ") WHERE `id` = '" . $stack['id'] . "' LIMIT 1"); mysql_query("DELETE FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `id` != '" . $stack['id'] . "' AND `name` = '" . $stack['name'] . "' AND `present` = '" . $stack['present'] . "' AND `duration` = '" . $stack['duration'] . "' AND `maxdur` = '" . $stack['maxdur'] . "' AND `dressed` = 0 AND `goden` = 0 AND `koll` >= 1 AND `setsale` = 0 AND `gmeshok` = '" . $stack['gmeshok'] . "' AND `laba` = '" . $stack['laba'] . "' AND `isrep` = '" . $stack['isrep'] . "' AND FORMAT(`cost`/`koll`, 2)=FORMAT(" . $stack['cost'] / $stack['koll'] . ", 2) AND FORMAT(`point`/`koll`, 2) = FORMAT(" . ($stack['point'] / $stack['koll']) . ", 2) AND FORMAT(`bcost`/`koll`, 2) = FORMAT(" . ($stack['bcost'] / $stack['koll']) . ", 2) "); } } } function unstack($it_id, $it_count) { global $user; $it_id = (int)$it_id; $it_count = (int)$it_count; $it_count = abs($it_count); try { $dress = db::c()->query('SELECT * FROM inventory WHERE owner = ?i AND id = ?i', $user['id'], $it_id)->fetch_assoc_array(); } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
В файле: " . $e->getFile() . " (" . $e->getLine() . ")
"; } if (isset($dress['id'])) { if ($it_count <= $dress['koll'] && $it_count > 0) { if ($dress['koll'] == $it_count) { db::c()->query('DELETE FROM inventory WHERE owner = ?i AND id = ?i', $user['id'], $dress['id']); } else { 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(); } else { return false; } } else { return false; } } //FIXME id and uid together??? function del_efs($uid, $id, $type) { global $user; $arr = [2, 3, 4, 5, 8, 10, 11, 12, 13, 14, 20]; if ($uid == $user['id'] && $id != null) { if (!in_array($type, $arr)) { db::c()->query('DELETE FROM `users_effects` WHERE `owner_id` = ?i AND `id` = ?i', $uid, $id); if ($type == 1022) { db::c()->query('UPDATE `users` SET `invis` = ?i WHERE `id` = ?i', 0, $uid); $user['invis'] = 0; } err('Эффект удалён.'); } else { err('Данный эффект нельзя удалить.'); } } } // одеть предмет function dressitem($id) { /* * FFFFUUUUUUU!!!!!!!!!!!! * 1. получаем id одеваемого предмета * 2. смотрим в кокой слот он хочет * 3. проверяем пустой ли слот * 4. если слот не пустой, освобождаем слот * 5. привязываем предмет к слоту * * если предмет кольцо * 1. смотрим три слота колец * 2. если слот не пустой смотрим слебующий слот * 3. если слот пустой одеваем предмет в слот * 4. если все три слота не пустые освобождаем последний слот * 5. привязываем предмет к слоту */ global $user; //$items = new DressedItems($_SESSION['uid']); //$items->undressItem($_GET['drop']); $selectedItem = db::c()->query('SELECT * FROM `inventory` WHERE item_id = ?i AND owner_id = ?i AND `dressed_slot` = 0', $id, $_SESSION['uid'])->fetch_object(); $itemInSlot = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot = ?i', $_SESSION['uid'], $selectedItem['item_type']); if ($itemInSlot->getNumRows()) { // снимаем предмет и одеваем поверх } else { // просто одеваем предмет в слот } if (in_array($selectedItem->item_type, [9, 10, 11])) { $wearedRings = db::c()->query('SELECT * FROM `inventory` WHERE owner_id = ?i AND dressed_slot IN (9,10,11)', $_SESSION['uid'])->fetch_object(); for ($i = 1; $i <= 3; $i++) { if (!$wearedRings->dressed_slot) { db::c()->query('UPDATE inventory SET dressed_slot = '); } } } if ($selectedItem) { db::c()->query('UPDATE inventory SET dressed_slot = item_type WHERE id = ?i', $selectedItem['item_id']); } if ($item['type'] == 5) { if (!$user['r1']) { $slot1 = 'r1'; } elseif (!$user['r2']) { $slot1 = 'r2'; } elseif (!$user['r3']) { $slot1 = 'r3'; } else { $slot1 = 'r1'; dropitem(5); } } elseif ($item['type'] == 12) { if (!$user['m1']) { $slot1 = 'm1'; } elseif (!$user['m2']) { $slot1 = 'm2'; } elseif (!$user['m3']) { $slot1 = 'm3'; } elseif (!$user['m4']) { $slot1 = 'm4'; } elseif (!$user['m5']) { $slot1 = 'm5'; } elseif (!$user['m6']) { $slot1 = 'm6'; } elseif (!$user['m7']) { $slot1 = 'm7'; } elseif (!$user['m8']) { $slot1 = 'm8'; } elseif (!$user['m9']) { $slot1 = 'm9'; } elseif (!$user['m10']) { $slot1 = 'm10'; } else { $slot1 = 'm1'; dropitem(12); } } else { dropitem($item['type']); } if (!($item['type'] == 12 && $user['level'] < 4)) { if (db::c()->query('UPDATE `users` AS `u`, `inventory` AS `i` SET `u`.?f = ?i, `i`.`dressed` = 1, `u`.`sila` = `u`.`sila` + `i`.`gsila`, `u`.`lovk` = `u`.`lovk` + `i`.`glovk`, `u`.`inta` = `u`.`inta` + `i`.`ginta`, `u`.`intel` = `u`.`intel` + `i`.`gintel`, `u`.`maxhp` = `u`.`maxhp` + `i`.`ghp`, `u`.`noj` = `u`.`noj` + `i`.`gnoj`, `u`.`topor` = `u`.`topor` + `i`.`gtopor`, `u`.`dubina` = `u`.`dubina` + `i`.`gdubina`, `u`.`mec` = `u`.`mec` + `i`.`gmech`, `u`.`mfire` = `u`.`mfire` + `i`.`gfire`, `u`.`mwater` = `u`.`mwater` + `i`.`gwater`, `u`.`mair` = `u`.`mair` + `i`.`gair`, `u`.`mearth` = `u`.`mearth` + `i`.`gearth`, `u`.`mlight` = `u`.`mlight` + `i`.`glight`, `u`.`mgray` = `u`.`mgray` + `i`.`ggray`, `u`.`mdark` = `u`.`mdark` + `i`.`gdark`, `u`.`ubron1` = `u`.`ubron1` + `i`.`bron1`, `u`.`ubron2` = `u`.`ubron2` + `i`.`bron2`, `u`.`ubron3` = `u`.`ubron3` + `i`.`bron3`, `u`.`ubron4` = `u`.`ubron4` + `i`.`bron4`, `u`.`fkrit` = `u`.`fkrit` + `i`.`mfkrit`, `u`.`fakrit` = `u`.`fakrit` + `i`.`mfakrit`, `u`.`fuvorot` = `u`.`fuvorot` + `i`.`mfuvorot`, `u`.`fauvorot` = `u`.`fauvorot` + `i`.`mfauvorot`, `u`.`uminu` = `u`.`uminu` + `i`.`minu`, `u`.`umaxu` = `u`.`umaxu` + `i`.`maxu` WHERE `i`.`needident` = 0 AND `i`.`id` = ?i AND `i`.`dressed` = 0 AND `i`.owner = ?i AND (20 + `u`.`sila`) >= `i`.`nsila` AND (20 + `u`.`lovk`) >= `i`.`nlovk` AND (20 + `u`.`inta`) >= `i`.`ninta` AND `u`.`vinos` >= `i`.`nvinos` AND (20 + `u`.`intel`) >= `i`.`nintel` AND `u`.`mudra` >= `i`.`nmudra` AND `u`.`level` >= `i`.`nlevel` AND (((?i = `i`.`nalign`)) OR (`i`.`nalign` = 0)) AND `u`.`noj` >= `i`.`nnoj` AND `u`.`topor` >= `i`.`ntopor` AND `u`.`dubina` >= `i`.`ndubina` AND `u`.`mec` >= `i`.`nmech` AND `u`.`mfire` >= `i`.`nfire` AND `u`.`mwater` >= `i`.`nwater` AND `u`.`mair` >= `i`.`nair` AND `u`.`mearth` >= `i`.`nearth` AND `u`.`mlight` >= `i`.`nlight` AND `u`.`mgray` >= `i`.`ngray` AND `u`.`mdark` >= `i`.`ndark` AND `i`.`setsale` = 0 AND `u`.`id` = ?i', $slot1, $id, $id, $user['id'], $user['align'], $user['id'])) { $user[$slot1] = $item['id']; } return true; } else { return false; } } // Входим и выходим если можем. if (isset($_GET['goto'])) { $imove = true; $d = db::c()->query('SELECT SUM(`weight`) AS `sum_weight` FROM `inventory` WHERE `owner` = ?i AND `on_sale` = 0', $user['id'])->fetch_assoc(); $eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user['id']); //(масса: getItemsWeight() . '/' . $showUser->strength * 4 if ($d['sum_weight'] > $user['strength'] * 4 && $_GET['got']) { err('У вас переполнен рюкзак, вы не можете передвигаться...'); $imove = false; } if ($eff->getNumRows() && $_GET['got']) { err('У вас тяжелая травма, вы не можете передвигатся...'); $imove = false; } if ($_GET['goto'] == 'plo' && empty($user['zayavka']) && $imove === true) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); header('Location: city.php'); die("Топ-топ-топ..."); } else { err('Подали заявку на бой и убегаете из клуба? Нехорошо...'); } if ($_GET['goto'] == 'arena' && $user['room'] === 20 && $imove === true) { db::c()->query('UPDATE `users`, `online` SET `users`.`room` = 1, `online`.`room` = 1 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); header('Location: main.php'); die("Топ-топ-топ..."); } } if (isset($_GET['use'])) { usemagic($_GET['use'], $_POST['target']); } unset($_SESSION['stackall']); if (isset($_GET["stack"])) { $_GET["stack"] = (int)$_GET["stack"]; $rec = db::c()->query('SELECT `id` FROM `inventory` WHERE `id` = ?i AND `owner` = ?i AND `setsale` = 0', $_GET['stack'], $user['id'])->fetch_assoc(); if (isset($rec['id'])) { stack($rec['id']); unset($rec); } } if (isset($_GET['unstack'])) { unstack((int)$_GET['unstack'], (int)$_POST["qty"]); } function setShadow($image) { global $user; $shadows = [ 'm01', 'm02', 'm03', 'm04', 'm05', 'm06', 'm07', 'm08', 'm09', 'm10', 'f01', 'f02', 'f03', 'f04', 'f05', 'f06', 'f07', 'f08', 'f09', 'f10', 'person', ]; if (in_array($image, $shadows)) { $i = $image . '.png'; db::c()->query('UPDATE `users` SET `shadow` = "?s" WHERE `id` = ?i', $i, $user['id']); } else { err('Ошибка!'); } } $obraz = filter_input(INPUT_GET, 'obraz'); if ($obraz && ($user['shadow'] == 'g0.gif' || $user['shadow'] == 'man0.gif')) { setShadow($obraz); } if (isset($_GET['del']) && $_GET['del'] == 1 && $_GET['efid'] > 0) { $pl = db::c()->query('SELECT `id`, `type` FROM `users_effects` WHERE `owner_id` = ?i AND `id` = ?i', $user['id'], (int)$_GET['efid'])->fetch_assoc(); if (isset($pl['id'])) { del_efs($user['id'], $pl['id'], $pl['type']); } else { echo "Эффект не найден!"; } } if (isset($_GET['modif_bron'])) { $brons = $_GET['modif_bron']; $ids = $_GET['ids']; try { $cur = db::c()->query('SELECT free_bron, bron1, bron2, bron3, bron4 FROM inventory WHERE owner = ?i AND id = ?i', $user['id'], $ids)->fetch_assoc(); } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
В файле: " . $e->getFile() . " (" . $e->getLine() . ")
"; } if ($cur['free_bron'] > 0 && $cur[$brons] > 0) { mysql_query("UPDATE `inventory` SET `free_bron` = (`free_bron`-1), `" . $brons . "` = (`" . $brons . "`+1) WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($ids) . "' LIMIT 1"); echo "Параметр брони увеличен!"; } } if (isset($_GET['modif_stat'])) { $stats = $_GET['modif_stat']; $ids = $_GET['ids']; $cur = mysql_fetch_assoc(mysql_query("SELECT `id`, `free_stat`, `gsila`, `glovk`, `ginta`, `gintel` FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($ids) . "' LIMIT 1")); if (isset($cur['id']) && $cur['free_stat'] > 0 && $cur[$stats] > 0) { mysql_query("UPDATE `inventory` SET `free_stat` = (`free_stat`-1), `" . $stats . "` = (`" . $stats . "`+1) WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($ids) . "' LIMIT 1"); echo "Параметр увеличен!"; } } if (isset($_GET['modif_mf'])) { $mfs = $_GET['modif_mf']; $ids = $_GET['ids']; $cur = mysql_fetch_assoc(mysql_query("SELECT `id`, `free_mf`, `mfkrit`, `mfakrit`, `mfuvorot`, `mfauvorot` FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($ids) . "' LIMIT 1")); if (isset($cur['id']) && $cur['free_mf'] > 0 && $cur[$mfs] > 0) { mysql_query("UPDATE `inventory` SET `free_mf` = (`free_mf`-1), `" . $mfs . "` = (`" . $mfs . "`+1) WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($ids) . "' LIMIT 1"); echo "Параметр увеличен!"; } } if (input::post('setshadow')) { ?>
Внимание! Образ персонажа выбирается только один раз.
m01 m02 m03 m04 m05 m06 m07 m08 m09 m10
f01 f02 f03 f04 f05 f06 f07 f08 f09 f10
undressItem($_GET['drop']); } if (isset($_GET['dress'])) { // $q = db::c()->query('SELECT `id`, `koll` FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', input::get('dress'), $_SESSION['uid']); // if ($q->getNumRows()) { // $q = $q->fetch_assoc(); // if ($q['koll'] > 1) { // $id = unstack($q['id'], 1); // dressitem($id); // } else { // dressitem(input::get('dress')); // } // } else { // err('Ошибка: предмет не найден!'); // } } if (input::get('destruct')) { $q = db::c()->query('SELECT `id`, `dressed`, `name`, `duration`, `maxdur` FROM `inventory` WHERE `owner` = ?i AND `id` = ?i', $_SESSION['uid'], input::get('destruct')); if ($q->getNumRows()) { $q = $q->fetch_assoc(); if (empty($q['dressed'])) { destructitem($q['id']); addToDelo($user['login'] . " выбросил предмет " . $q['name'] . " id:(cap" . $q['id'] . ")"); err('Предмет ' . $q['name'] . ' выброшен.'); } else { err('Ошибка: нельзя выбросить одетый предмет!'); } } else { err('Ошибка: предмет не найден!'); } } if (input::get('use')) { $q = db::c()->query('SELECT `id`, `koll` FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', input::get('use'), $_SESSION['uid']); if ($q->getNumRows()) { $q = $q->fetch_assoc(); if ($q['koll'] > 1) { $id = unstack($q['id'], 1); usemagic($id, $_POST['target']); } else { usemagic($_GET['use'], $_POST['target']); } } else { err('Ошибка: предмет не найден!'); } } if (input::get('undress')) { undressall($_SESSION['uid']); } if (input::get('delcomplect')) { db::c()->query('DELETE FROM `komplekt` WHERE `name` = "?s" AND `owner` = ?i', input::get('delcomplect'), $_SESSION['uid']); } if (input::get('complect')) { $hp = $user['hp']; undressall($_SESSION['uid']); $q = db::c()->query('SELECT `items` FROM `komplekt` WHERE `name` = "?s" AND `owner` = ?i', input::get('complect'), $_SESSION['uid'])->fetch_assoc(); $items_in_set = []; $items_in_set = explode(';', $q['items']); foreach ($items_in_set as $iis) { dressitem($iis); } db::c()->query('UPDATE `users` SET `hp` = ?i WHERE `id` = ?i', $hp, $_SESSION['uid']); // Если здоровье становится выше максимума - выравниваем: db::c()->query('UPDATE `users` SET `hp` = `maxhp` WHERE `hp` > `maxhp` AND `id` = ?i', $_SESSION['uid']); $user = (new users_row($_SESSION['uid']))->result(); # Нахера перевыгружать О_о)?! } //FIXME роняем вещи, которые больше не можем держать //ref_drop(); if (input::get('savecomplect')) { if (preg_match('/^[- \p{L}\d]+$/u', input::get('savecomplect'))) { $q = db::c()->query('SELECT `id` FROM `komplekt` WHERE `name` = "?s" AND `owner` = ?i', input::get('savecomplect'), $_SESSION['uid'])->getNumRows(); if (empty($q)) { $items = []; $q2 = db::c()->query('SELECT `id` FROM `inventory` WHERE `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i OR `id` = ?i', $user['sergi'], $user['kulon'], $user['perchi'], $user['weap'], $user['bron'], $user['rybax'], $user['r1'], $user['r2'], $user['r3'], $user['helm'], $user['shit'], $user['m1'], $user['m2'], $user['m3'], $user['m4'], $user['m5'], $user['m6'], $user['m7'], $user['m8'], $user['m9'], $user['m10'], $user['boots'], $user['plaw']); while ($res = $q2->fetch_assoc()) { $items[] = $res['id']; } $t_items = implode(";", $items); db::c()->query('INSERT INTO `komplekt` (`name`, `owner`, `items`) VALUES ("?s",?i,"?s")', input::get('savecomplect'), $_SESSION['uid'], $t_items); err('Комплект ' . $name . ' сохранён.'); } else { err('Ошибка: такое название комплекта уже используется!'); } } else { err('Ошибка: запрещённые символы!'); } } } ?> Окно игры query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60)); } catch (Exception $e) { echo '
В таблице online нет ячейки real_time так как неясно что она делает. Ошибка обращения в базу.
'; } ?>
showUserDoll(0, 1); ?>
Снять все
Запомнить комплект
query("SELECT `name` FROM komplekt WHERE `owner` = ?i", $user['id']); while ($u_k = $u_all_kompl->fetch_assoc()) { $k_name = $u_k['name']; echo " Надеть \"" . $k_name . "\"
"; } } catch (Exception $e) { echo '
Комплекты не работают, потому что нет таблицы и функции застряли в php5.3.
'; } ?>
show_eff_inf() не работаeт, потому что нет таблицы и функции застряли в php5.3.
'; } ?>


Уровень: level ?>
Опыт: experience ?>
Побед:
Поражений:
Ничьих:
Деньги: money ?> кр.
Сила: free_stat_points ? $showUser->getStrength(1) . '(' . strval($showUser->strength + $getItemsBonuses->getStrengthBonus()) . ')' : $showUser->strength + $getItemsBonuses->getStrengthBonus()) ?>
Ловкость: free_stat_points ? $showUser->getDexterity(1) . '(' . strval($showUser->dexterity + $getItemsBonuses->getDexterityBonus()) . ')' : $showUser->dexterity + $getItemsBonuses->getDexterityBonus()) ?>
Интуиция: free_stat_points ? $showUser->getIntuition(1) . '(' . strval($showUser->intuition + $getItemsBonuses->getIntuitionBonus()) . ')' : $showUser->intuition + $getItemsBonuses->getIntuitionBonus()) ?>
Выносливость: free_stat_points ? $showUser->getEndurance(1) . '(' . strval($showUser->endurance + $getItemsBonuses->getEnduranceBonus()) . ')' : $showUser->endurance + $getItemsBonuses->getEnduranceBonus()) ?>
Интеллект: free_stat_points ? $showUser->getIntelligence(1) . '(' . strval($showUser->intelligence + $getItemsBonuses->getIntelliganceBonus()) . ')' : $showUser->intelligence + $getItemsBonuses->getIntelliganceBonus()) ?>
Мудрость: free_stat_points ? $showUser->getWisdom(1) . '(' . strval($showUser->wisdom + $getItemsBonuses->getWisdomBonus()) . ')' : $showUser->wisdom + $getItemsBonuses->getWisdomBonus()) ?>
free_stat_points): ?> Возможных увеличений: free_stat_points ?>

Здоровье: getHealth() ?>
Уворот: ?? + getEvasionBonus() ?>
Точность: ?? + getAccuracyBonus() ?>
Шанс крита: ?? + getCriticalsBonus() ?>
Урон: minDamage ?> - maxDamage ?>

Защита от огня: ??
Защита от воды: ??
Защита от вохдуха: ??
Защита от земли: ??
Защита от яда: ??
Броня головы: headArmor ?>
Броня корпуса: chestArmor ?>
Броня ног: legArmor ?>
query($data_query, $_SESSION['uid']); $groupNum = []; $viewInventory = []; $getItems = []; $row = []; $iteminfo = []; while ($row = $data->fetch_assoc()) { //FIXME Какая-то хуета. Зачем я каждый прежмет делал новым классом? $iteminfo[] = new InventoryItem($row); } foreach ($iteminfo as $ii) { echo "
Рюкзак (масса: strength * 4 ?>)
"; $ii->printImage(); $ii->printControls(); echo ""; $ii->printInfo(); } if ($viewInventory and $getItems) { foreach ($viewInventory as $viewCategiryes) { echo $viewCategiryes['header']; foreach ($viewCategiryes['ids'] as $viewItem) { echo $getItems[$viewItem]; } echo $viewCategiryes['fooder']; } } if ($data->getNumRows() == 0) { echo "
Пусто"; } ?>