setOnline(); $req = (object)[]; $keys = ['ups', 'drop', 'dress', 'destruct', 'use', 'undress', 'edit', 'goto', 'obraz', 'setshadow']; foreach ($keys as $key) { $req->$key = $_REQUEST[$key] ?? null; } if ($req->edit) { if ($req->ups) { try { $up = new UserInfo(User::$current->getId()); $up->addOnePointToStat($req->ups); unset($up); } catch (GameException $e) { echo $e; } } if ($req->drop) { $items = new DressedItems(User::$current->getId()); $items->undressItem($req->drop); unset($items); } //Пока что одеваем предмет отсюда. if ($req->dress) { $dressing = new InventoryItem(DBPDO::$db->ofetch('select * from inventory where item_id = ? ', $req->dress)); $dressing->dressItem(); unset($dressing); } if ($req->destruct) { $q = DBPDO::$db->ofetch('select name,dressed_slot from inventory where owner_id = ? and item_id = ?', [User::$current->getId(), $req->destruct]); if ($q) { if (empty($q->dressed_slot)) { InventoryItem::destroyItem($req->destruct); GameLogs::addUserLog(User::$current->getId(), User::$current->getLogin() . ' выбросил предмет ' . $q->name . ' id:(cap' . $req->destruct . ')'); err('Предмет ' . $q->name . ' выброшен.'); } else { err('Ошибка: нельзя выбросить одетый предмет!'); } } else { err('Ошибка: предмет не найден!'); } } if ($req->use) { usemagic($req->use, $req->useTarget); } if ($req->undress) { DressedItems::undressAllItems(User::$current->getId()); } } // Подготавливаем отображение инфы и предметов. $userInfo = new UserInfo(User::$current->getId()); $userStats = new UserStats(User::$current->getId()); $stat = $userStats->getFullStats(); $data = DBPDO::$db->ofetchAll('SELECT * FROM inventory WHERE owner_id = ? AND dressed_slot = 0 AND on_sale = 0', User::$current->getId()); $iteminfo = []; foreach ($data as $row) { $iteminfo = new InventoryItem($row); } //Обработчики нажатий на кнопки. if ($req->battlefield ?? 0 && User::$current->getRoom() == 1) { header('Location: zayavka.php'); exit(); } if ($req->module_quest ?? 0) { header('Location: module_quest.php'); exit(); } if ($req->move_inside ?? 0 && User::$current->getRoom() == 20) { header('Location: main.php?goto=arena'); exit(); } if ($req->move_outside ?? 0 && User::$current->getRoom() == 1) { header('Location: main.php?goto=plo'); exit(); } if ($req->main_page ?? 0) { header('Location: main.php'); exit(); } if (!$req->edit) { /* === проверяем соответствие комнаты и скрипта === */ if (in_array(User::$current->getRoom(), [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) { header('Location: city.php'); exit(); } if (in_array(User::$current->getRoom(), [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) { header('location: ' . Travel::$roomFileName[User::$current->getRoom()]); exit(); } } function del_efs($id, $type) { if ($id && !in_array($type, [2, 3, 4, 5, 8, 10, 11, 12, 13, 14, 20])) { db::c()->query('DELETE FROM users_effects WHERE owner_id = ?i AND effect_id = ?i', $_SESSION['uid'], $id); if ($type == 1022) { db::c()->query('UPDATE `users` SET `invis` = 0 WHERE `id` = ?i', $_SESSION['uid']); } return 'Эффект удалён.'; } else { return 'Эффект нельзя удалить.'; } } // Входим и выходим если можем. if ($req->goto) { $imove = true; $d = db::c()->query('SELECT SUM(weight) AS sum_weight FROM inventory WHERE owner_id = ?i AND on_sale = 0', User::$current->getId())->fetch_assoc(); $eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', User::$current->getId()); //(масса: getItemsWeight() . '/' . User::$current->strength * 4 if ($d['sum_weight'] > $userStats->getMaxWeight()) { err('У вас переполнен рюкзак, вы не можете передвигаться...'); $imove = false; } if ($eff->getNumRows()) { err('У вас тяжелая травма, вы не можете передвигатся...'); $imove = false; } if ($req->goto == 'plo' && !User::$current->getZayavka() && $imove && User::$current->getRoom() != 20) { db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', User::$current->getId()); header('Location: city.php'); exit("Топ-топ-топ..."); } else { err('Подали заявку на бой и убегаете из клуба? Нехорошо...'); } if ($req->goto == 'arena' && User::$current->getRoom() == 20 && $imove) { db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', User::$current->getId()); header('Location: main.php'); exit("Топ-топ-топ..."); } } if ($req->use) { usemagic($req->use, $req->target); } if ($req->obraz) { User::$current->setShadow($req->obraz); User::$current->saveUser(); } if ($req->setshadow) { Template::header('Образ персонажа'); ?>
Внимание! Образ персонажа выбирается только один раз.
m01 m02 m03 m04 m05 m06 m07 m08 m09 m10
f01 f02 f03 f04 f05 f06 f07 f08 f09 f10
showUserInfoMain() ?>
showUserDoll(0, 1); ?>
Снять все
showUserEffects() ?>


Уровень: getLevel() ?>
Опыт: getExperience() ?>
Побед: ??
Поражений: ??
Ничьих: ??
Деньги: getMoney() ?> кр.
Сила: getFreeStatPoints() ? $userStats->getStat('strength', 1) . '(' . strval($stat->strength) . ')' : $stat->strength) ?>
Ловкость: getFreeStatPoints() ? $userStats->getStat('dexterity', 1) . '(' . strval($stat->dexterity) . ')' : $stat->dexterity) ?>
Интуиция: getFreeStatPoints() ? $userStats->getStat('intuition', 1) . '(' . strval($stat->intuition) . ')' : $stat->intuition) ?>
Выносливость: getFreeStatPoints() ? $userStats->getStat('endurance', 1) . '(' . strval($stat->endurance) . ')' : $stat->endurance) ?>
Интеллект: getFreeStatPoints() ? $userStats->getStat('intelligence', 1) . '(' . strval($stat->intelligence) . ')' : $stat->intelligence) ?>
Мудрость: getFreeStatPoints() ? $userStats->getStat('wisdom', 1) . '(' . strval($stat->wisdom) . ')' : $stat->wisdom) ?>
getFreeStatPoints()): ?> Возможных увеличений: getFreeStatPoints() ?>

Здоровье: getHealth() ?>
Пыль: getMana() ?>
Уворот: evasion ?>
Точность: accuracy ?>
Шанс крита: criticals ?>
Урон: min_physical_damage ?> - max_physical_damage ?>

Защита от огня: ??
Защита от воды: ??
Защита от вохдуха: ??
Защита от земли: ??
Защита от яда: ??
Броня головы: getHeadArmor() ?>
Броня корпуса: getChestArmor() ?>
Броня ног: getLegArmor() ?>
getShadow() == '0.gif' || User::$current->getAdmin() == 1): ?>
getRoom() == 20): ?> getRoom() == 1): ?>
Рюкзак (масса: getMaxWeight() ?>)
"; $ii->printImage(); $ii->printControls(); echo ""; $ii->printInfo(); } if (!$data) { echo "
Пусто"; } ?>