* Project name: Battles-Game */ require_once 'config.php'; require_once 'classes/u.php'; $u = new u($_SESSION['uid']); /** Бля, если это сработает... */ $user = $u->i(); define("HPADDICTIONEFFECT", 33); $ip = filter_input(INPUT_SERVER,'REMOTE_ADDR', FILTER_VALIDATE_IP); if (isset($_GET['goto']) and isset($_GET['tStamp']) and isset($_GET['vcode'])) { if ($_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_GET['goto'], $_GET['goto'], $_SESSION['uid']); $user['room'] = intval($_GET['goto']); } } function createbot($bot, $login = "") { $rec = db::c()->query('SELECT `id`, `login`, `maxhp` FROM `users` WHERE `id` = "?s" LIMIT 1', $bot)->fetch_assoc(); if (isset($rec['id'])) { if ($login) { $rec['login'] = $login; } $botname = $rec['login']; db::c()->query('INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ("?s", "?s", "?s", "?s")', $botname, $bot, $battle, $rec['maxhp']); $nid = db::c()->getLastInsertId(); return array("id" => $nid, "login" => $botname); } else { return false; } } #####Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонаж на которого нельзя напасть. $unkilable = array( 'rooms' => array(620, 621, 1051, 1052), 'users' => array(10962, 10964, 10965) ); $runes_exp = array('1' => 10500, '2' => 23500, '3' => 38500, '4' => 57000, '5' => 77000, '6' => 103000, '7' => 136500, '8' => 171500, '9' => 212500, '10' => 257500); $canalenters = array(620); $caverooms = array(621); $userslots = array('sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'); function getuserdata($id = 0) { if (!$id) $id = isset($_SESSION['uid'])?$_SESSION['uid']:NULL; // Хорошее решение проверок, кстати. if (!$id) return array(); $rec = db::c()->query('SELECT `hp`, `maxhp`, `fullhptime`, `battle` FROM `users` WHERE `id` = "?s"', $id)->fetch_assoc(); if ($rec['hp'] < $rec['maxhp'] && time() > $rec['fullhptime'] && !$rec['battle'] && ($rec['hp'] > 0)) { regenhp($rec, 0); if ($rec['hp'] == $rec['maxhp']) { $rec['hp']--; } } return $rec; } if (!isset($user)) { $user = getuserdata(); } if (empty($user['battle']) && ($user['hp'] < @$user['maxhp'])) { regenhp($user); } $inder = filter_input(INPUT_COOKIE, 'inder'); if (!isset($banks['id'])) { $banks = db::c()->query('SELECT `id`, `cr`, `ekr` FROM `bank` WHERE `id` = "?s" AND `owner` = "?s" LIMIT 1', $inder, $u->i()['id'])->fetch_assoc(); } function auth_bank($id, $pass, $us) { global $banks; $bn = db::c()->query('SELECT `id`, `pass` FROM `bank` WHERE `id` = ?i AND `owner` = "?s"', $id, $us)->fetch_assoc(); if (isset($bn['id'])) { if ($bn['pass'] == md5($pass)) { setcookie('inder', $bn['id'], time() + 60 * 60 * 24 * 7, '/', GAMEDOMAIN, 0, true); $banks['id'] = $bn['id']; $msg = 'Успешная авторизация ...'; } else { $msg = 'Неверный пароль ...'; } } else { $msg = 'Счёт не найден ...'; } return $msg; } function exit_bank($link) { global $banks; $r = 'Работа со счётом завершена ...'; setcookie('inder', '', time() + 60 * 60 * 24 * 7, '', GAMEDOMAIN); $banks['id'] = null; header('Location: ' . $link); return $r; } function getNum($v) { $plid = $v; $pi = iconv_strlen($plid); if ($pi < 5) { $i = 0; while ($i <= 5 - $pi) { $plid = '0' . $plid; $i++; } } return $plid; } function banks() { global $user, $banks; $bank = db::c()->query('SELECT `id`, `cr`, `ekr` FROM `bank` WHERE `id` = "?s" AND `owner` = "?s" LIMIT 1', $banks['id'], $user['id'])->fetch_assoc(); if (isset($bank['id'])) { echo '
СчётБанковский счёт №' . $bank['id'] . '. x
На счету ' . $bank['ekr'] . ' еврокредитов.
'; } else { $sp = db::c()->query('SELECT `id` FROM `bank` WHERE `owner` = "?s" ORDER BY `id` ASC', $user['id']); if ($sp->getNumRows() > 0) { $nums .= ' '; } else { $nums = 'У вас нет счетов'; } $auth = $nums; echo '
Авторизация
' . $auth . '
'; } } if (isset($user['id']) && $user['block'] == 1) { die(); } $var_map = array( 'cell_1' => 'Березовая роща', 'cell_2' => 'Березовая просека', 'cell_3' => 'Тёмный угол', 'cell_4' => 'Мрачная опушка', 'cell_5' => 'Тёмное урочище', 'cell_6' => 'Бурелом', 'cell_7' => 'Старая ива', 'cell_8' => 'Разнолесье', 'cell_9' => 'Сосновая тропа', 'cell_10' => 'Забытая дорога', 'cell_11' => 'Новая дорога', 'cell_12' => 'Мщаник', 'cell_13' => 'Ясная поляна', 'cell_14' => 'Заросший тракт', 'cell_15' => 'Смутный ельник', 'cell_16' => 'Сосновый бор', 'cell_17' => 'Тихоход', 'cell_18' => 'Сосновый гай', 'cell_19' => 'Смешаный лес', 'cell_20' => 'Темная поляна', 'cell_21' => 'Осенний угол', 'cell_22' => 'Грибное место', 'cell_23' => 'Опушка', 'cell_24' => 'Рыжий лес', 'cell_25' => 'Полесье' ); function close_dangling_tags($html) { preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU", $html, $result); $openedtags = $result[1]; preg_match_all("##iU", $html, $result); $closedtags = $result[1]; $len_opened = count($openedtags); if (count($closedtags) == $len_opened) { return $html; } $openedtags = array_reverse($openedtags); for ($i = 0; $i < $len_opened; $i++) { if (!in_array($openedtags[$i], $closedtags)) { $html .= ''; } else { unset($closedtags[array_search($openedtags[$i], $closedtags)]); } } return $html; } function gotoroom($r, $redir = 1) { mysql_query("UPDATE `users`, `online` SET `users`.`room` = '$r', `online`.`room` = '$r' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}'"); if ($redir) { redirectbyroom($r); } } function redirectbyroom($r) { global $canalenters; if (in_array($r, $canalenters)) { header("location: enter_cave.php"); die(); } if ($r == 1) { header("location: main.php"); die(); } } function battlewithbot($b, $name = '', $time = 3, $blood = 1, $group = 1, $battleid = 0, $otherbots = array(), $noredir = 0, $userid = 0, $type = 1) { global $user; if (!$userid) { $user1 = $user; } elseif (is_array($userid)) { $user1 = $userid; } else { $user1 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$userid' LIMIT 1")); } $bot = mysql_fetch_array(mysql_query("SELECT `login`, `maxhp` FROM `users` WHERE `id` = '$b' LIMIT 1")); if (!$name) { $name = $bot['login']; } if ($battleid) { $botid = mysql_fetch_assoc(mysql_query("SELECT `id` FROM `bots` WHERE `prototype` = '$b' AND `battle` = '$battleid' LIMIT 1")); } elseif ($group) { $arha = mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `prototype` = '$b' ORDER BY `id` DESC LIMIT 1")); $battleid = $arha['battle']; $botid = $arha['id']; } if (@$battleid > 0) { $bd = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '$battleid' LIMIT 1")); $battle = unserialize($bd['teams']); $t1 = explode(";", $bd['t1']); $t2 = explode(";", $bd['t2']); $ak = array_keys($battle[$t2[0]]); $battle[$user1['id']] = $battle[$ak[0]]; foreach ($battle[$user1['id']] as $k => $v) { $battle[$user1['id']][$k] = array(0, 0, time()); $battle[$k][$user1['id']] = array(0, 0, time()); } if (in_array($botid, $t1)) { $ttt = 2; } else { $ttt = 1; } if ($user1['invis'] == 1) { addlog($battleid, '' . date("H:i") . ' невидимка вмешался в поединок!
'); } else { addlog($battleid, '' . date("H:i") . ' ' . nick5($user1['id'], "B" . $ttt) . ' вмешался в поединок!
'); } mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $user1['id'] . '\') WHERE `id` = ' . $battleid . ' LIMIT 1'); mysql_query("UPDATE `users` SET `battle` = " . $battleid . ", `zayavka` = 0 WHERE `id`= " . $user1['id'] . " LIMIT 1"); if (!$noredir) { header("Location: fbattle.php"); } } else { mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('$name', '$b', '', '" . $bot['maxhp'] . "')"); $botnames = array(); $botnames[$name] = 1; $hps[$b] = $bot['maxhp']; $botid1 = mysql_insert_id(); $cond = " `id` = '$botid1' "; $teams = array(); $teams[$user1['id']][$botid1] = array(0, 0, time()); $teams[$botid1][$user1['id']] = array(0, 0, time()); $t2 = "$botid1"; $others = ""; $hps = array(); foreach ($otherbots as $k => $v) { if (@$botnames[$v['name']]) { $i = 1; while (@$botnames["$v[name] ($i)"]) $i++; $botname = "$v[name] ($i)"; } else { $botname = $v['name']; } $botnames[$botname] = 1; if (!@$hps[$v['id']]) { $hps[$v['id']] = mysql_fetch_array(mysql_query("SELECT `maxhp` FROM `users` WHERE `id` = '$v[id]' LIMIT 1")); } mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('$botname', '$v[id]', '', '" . $hps[$v['id']]['maxhp'] . "')"); $botid = mysql_insert_id(); $cond .= " OR `id` = '$botid' "; $teams[$user1['id']][$botid] = array(0, 0, time()); $teams[$botid][$user1['id']] = array(0, 0, time()); $others .= "" . date("H:i") . " $botname вмешался в поединок.
"; $t2 .= ";$botid"; } mysql_query("INSERT INTO `battle` (`id`, `coment`, `teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `blood`, `date`) VALUES (NULL, '', '" . serialize($teams) . "', '" . $time . "', '$type', '0', '" . $user1['id'] . "', '" . $t2 . "', '" . time() . "', '" . time() . "', '$blood', '" . date("Y-m-d H:i") . "')"); $battleid = mysql_insert_id(); mysql_query("UPDATE `bots` SET `battle` = {$battleid} WHERE $cond"); mysql_query("UPDATE `users` SET `battle` = {$battleid} WHERE `id` = {$user1['id']} LIMIT 1"); if ($user1['invis'] == 1) { $rr = "невидимка и " . nick3($botid1) . ""; } else { $rr = "" . nick3($user1['id']) . " и " . nick3($botid1) . ""; } addlog($battleid, "Часы показывали " . date("Y.m.d H.i") . ", когда " . $rr . " бросили вызов друг другу.
" . ($others ? "$others
" : "")); if (!$noredir) { header("Location: fbattle.php"); } } return $battleid; } function backpacksize($u = 0) { $l = 0; if ($u) { $l = $u['level']; } if ($l == 0) { return 75; } if ($l == 1) { return 100; } if ($l == 2) { return 125; } if ($l == 3) { return 175; } if ($l == 4) { return 225; } if ($l == 5) { return 325; } if ($l == 6) { return 425; } if ($l == 7) { return 525; } if ($l == 8) { return 625; } if ($l == 9) { return 725; } if ($l == 10) { return 825; } if ($l == 11) { return 925; } if ($l >= 12) { return 1025; } } function placeinbackpack($qty, $userid = 0) { global $user; if (!$userid) { $userid = $user['id']; } if ($userid == $user['id']) { $user1 = $user; } else { $user1 = mysql_fetch_array(mysql_query("SELECT `id`, `level` FROM `users` WHERE `id` = '$user1[id]' LIMIT 1")); } $cnt = mysql_fetch_assoc(mysql_query("SELECT COUNT(`id`) AS `cnt` FROM `inventory` WHERE `owner` = '$user1[id]' AND `dressed` = 0 AND `setsale` = 0")); return $cnt['cnt'] + $qty <= backpacksize($user1['id']); } function cancarry($m, $u) { global $user; if (!$u) { $u = $user['id']; } $bp = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `massa`, SUM(`gmeshok`) AS `gmeshok` FROM `inventory` WHERE `owner` = '$u[id]' AND `dressed` = 1 AND `setsale` = 0")); $mw = 40 * $user['level'] + $user['vinos'] + $bp['gmeshok']; if ($bp['massa'] + $m > $mw) { return false; } return true; } function secs2hrs($s, $short = 0) { if ($s < 60) return "$s сек."; $retstr = ''; if ($s < 3600) { $min = floor($s / 60); if ($min || !$short) $retstr .= "$min мин. "; $sec = $s % 60; if ($sec || !$short) $retstr .= "$sec сек."; return $retstr; } $ret = floor($s / 3600); $s = $s % 3600; $d = floor($ret / 24); $h = $ret % 24; if ($d && ($d > 1 || $h || $s)) { $retstr .= "$d д. "; if ($h || !$short) $retstr .= "$h ч. "; $min = floor($s / 60); if ($min || !$short) $retstr .= "$min мин."; return $retstr; } elseif ($d) $h += $d * 24; if ($h) { $retstr = "$h ч. "; $min = floor($s / 60); if ($min || !$short) $retstr .= "$min мин."; return $retstr; } return floor($s / 60) . " мин. " . ($s % 60) . " сек."; } function show_itm_hostel($uid, $otdel, $type = 1) { $r = ''; if ($type != 1) { $sql = $uid; $txt = 'В сундук'; } else { $sql = '-101' . $uid . ''; $txt = 'В инвентарь'; } $data = mysql_query("SELECT * FROM `inventory` WHERE `otdel` = '{$otdel}' AND `owner` = " . $sql . " AND `dressed`='0' ORDER BY `id` ASC"); while ($pl = mysql_fetch_array($data)) { $r .= show_item($pl, 10, $txt, $type); } if ($r == '') { $r = '
Пусто.
Попробуйте другой вариант фильтрации.
'; } return $r; } function get_out($u) { $pers = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $u . '" LIMIT 1')); undressall($pers['id']); mysql_query('UPDATE `inventory` SET `owner` = "' . $pers['id'] . '" WHERE `owner` = "' . ($pers['id'] + _BOTSEPARATOR_) . '"'); ### $row = mysql_query('SELECT * FROM `effects` WHERE `owner` = "' . ($pers['id'] + _BOTSEPARATOR_) . '"'); while ($efs = mysql_fetch_array($row)) { efs_go_storage($efs, $pers); } ### } function enter_bs($u) { $pers = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $u . '" LIMIT 1')); undressall($pers['id']); ### mysql_query('UPDATE `inventory` SET `owner` = "' . ($pers['id'] + _BOTSEPARATOR_) . '" WHERE `owner` = "' . $pers['id'] . '"'); ### ### $efs = mysql_query('SELECT * FROM `effects` WHERE `owner` = "' . $pers['id'] . '"'); while ($row = mysql_fetch_array($efs)) { efs_add_storage($row, $pers); } ### ### makeuserdata($pers); ### } function makeuserdata($pl) { $udata = mysql_fetch_array(mysql_query('SELECT * FROM `deztow_realchars` WHERE `owner` = "' . $pl['id'] . '" LIMIT 1')); if (isset($udata['id'])) { $udata['sila'] = $pl['sila']; $udata['lovk'] = $pl['lovk']; $udata['inta'] = $pl['inta']; $udata['vinos'] = $pl['vinos']; $udata['maxhp'] = $pl['maxhp']; $udata['money'] = $pl['money']; $udata['level'] = $pl['level']; $udata['exp'] = $pl['exp']; $udata['nextup'] = $pl['nextup']; $udata['align'] = $pl['align']; $udata['stats'] = $pl['stats']; $udata['master'] = $pl['master']; $udata['intel'] = $pl['intel']; $udata['noj'] = $pl['noj']; $udata['mec'] = $pl['mec']; $udata['topor'] = $pl['topor']; $udata['dubina'] = $pl['dubina']; $udata['mlight'] = $pl['mlight']; $udata['mgray'] = $pl['mgray']; $udata['mdark'] = $pl['mdark']; mysql_query('UPDATE `deztow_realchars` SET `sila` = "' . $udata['sila'] . '", `lovk` = "' . $udata['lovk'] . '", `inta` = "' . $udata['inta'] . '", `vinos` = "' . $udata['vinos'] . '", `maxhp` = "' . $udata['maxhp'] . '", `money` = "' . $udata['money'] . '", `intel` = "' . $udata['intel'] . '", `level` = "' . $udata['level'] . '", `exp` = "' . $udata['exp'] . '", `nextup` = "' . $udata['nextup'] . '", `align` = "' . $udata['align'] . '", `stats` = "' . $udata['stats'] . '", `master` = "' . $udata['master'] . '", `noj` = "' . $udata['noj'] . '", `mec` = "' . $udata['mec'] . '", `topor` = "' . $udata['topor'] . '", `dubina` = "' . $udata['dubina'] . '", `mlight` = "' . $udata['mlight'] . '", `mgray` = "' . $udata['mgray'] . '", `mdark` = "' . $udata['mdark'] . '" WHERE `owner` = "' . $udata['id'] . '" LIMIT 1'); } else { mysql_query('INSERT INTO `deztow_realchars` (`owner`, `sila`, `lovk`, `inta`, `vinos`, `maxhp`, `intel`, `level`, `money`, `exp`, `nextup`, `align`, `stats`, `master`, `noj`, `mec`, `topor`, `dubina`, `mlight`, `mgray`, `mdark`) VALUES ("' . $pl['id'] . '", "' . $pl['sila'] . '", "' . $pl['lovk'] . '", "' . $pl['inta'] . '", "' . $pl['vinos'] . '", "' . $pl['maxhp'] . '", "' . $pl['intel'] . '", "' . $pl['level'] . '", "' . $pl['money'] . '", "' . $pl['exp'] . '", "' . $pl['nextup'] . '", "' . $pl['align'] . '", "' . $pl['stats'] . '", "' . $pl['master'] . '", "' . $pl['noj'] . '", "' . $pl['mec'] . '", "' . $pl['topor'] . '", "' . $pl['dubina'] . '", "' . $pl['mlight'] . '", "' . $pl['mgray'] . '", "' . $pl['mdark'] . '")'); } } function efs_add_storage($pl, $us) { $travm = array(11, 12, 13, 14); if (in_array($pl['type'], $travm)) { $us['sila'] += $pl['sila']; $us['lovk'] += $pl['lovk']; $us['inta'] += $pl['inta']; $us['vinos'] += $pl['vinos']; } else { $us['sila'] -= $pl['sila']; $us['lovk'] -= $pl['lovk']; $us['inta'] -= $pl['inta']; $us['vinos'] -= $pl['vinos']; $us['maxhp'] -= $pl['hp']; } $pl['owner'] = ($user['id'] + _BOTSEPARATOR_); mysql_query('UPDATE `effects` SET `owner` = "' . $pl['owner'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `sila` = "' . $us['sila'] . '", `lovk` = "' . $us['lovk'] . '", `inta` = "' . $us['inta'] . '", `vinos` = "' . $us['vinos'] . '", `maxhp` = "' . $us['maxhp'] . '" WHERE `id` = "' . $us['id'] . '" LIMIT 1'); } function efs_go_storage($pl, $us) { $travm = array(11, 12, 13, 14); if (in_array($pl['type'], $travm)) { $us['sila'] -= $pl['sila']; $us['lovk'] -= $pl['lovk']; $us['inta'] -= $pl['inta']; $us['vinos'] -= $pl['vinos']; } else { $us['sila'] += $pl['sila']; $us['lovk'] += $pl['lovk']; $us['inta'] += $pl['inta']; $us['vinos'] += $pl['vinos']; $us['maxhp'] += $pl['hp']; } $pl['owner'] = $user['id']; mysql_query('UPDATE `effects` SET `owner` = "' . $pl['owner'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `sila` = "' . $us['sila'] . '", `lovk` = "' . $us['lovk'] . '", `inta` = "' . $us['inta'] . '", `vinos` = "' . $us['vinos'] . '", `maxhp` = "' . $us['maxhp'] . '" WHERE `id` = "' . $us['id'] . '" LIMIT 1'); } function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '', $fields = 0, $uid = 0, $koll = 1, $podzem = 0) { global $user; if (!$uid) { $uid = $user['id']; } $r = mysql_query("SHOW FIELDS FROM $table"); $r2 = mysql_query("SHOW FIELDS FROM inventory"); while ($rec = mysql_fetch_assoc($r2)) { $flds[$rec['Field']] = 1; } $rec1 = mysql_fetch_array(mysql_query("SELECT * FROM `$table` WHERE `id` = '$item' LIMIT 1")); if ($rec1['koll']) { mysql_query("UPDATE `inventory` SET `koll` = (`koll`+$koll), `massa` = (`massa`+" . ($rec1['massa'] * $koll) . "), `cost` = (`cost`+" . $rec1['cost'] . ") WHERE `owner` = '$uid' AND `prototype` = '$item' LIMIT 1"); if (mysql_affected_rows() > 0) return array("img" => $rec1['img'], "name" => $rec1['name']); $rec1['koll'] = $koll; $rec1['massa'] *= $koll; } if ($rec1['onlyone']) { $i = mysql_fetch_row(mysql_query("SELECT `id` FROM `inventory` WHERE `owner` = '$uid' AND `prototype` = '$item'")); if ($i) { return array("error" => "У вас слишком много таких вещей."); } } if ($present) { $rec1['present'] = $present; $rec1['cost'] = 0; $rec1['ecost'] = 0; } // if ($fields) { // foreach ($fields as $k => $v) { // $rec1[$k] = $v; // } // } $sql = ""; while ($rec = mysql_fetch_assoc($r)) { if (!@$flds[$rec['Field']]) continue; if ($rec['Field'] == "dategoden") { $goden = $rec1[$rec['Field']]; } if ($rec['Field'] == "goden") { $goden = $rec1[$rec['Field']]; } if ($rec['Field'] == "id" || $rec['Field'] == "prototype" || $rec['Field'] == "dategoden") continue; $sql .= ", `$rec[Field]` = '" . $rec1[$rec['Field']] . "' "; } if ($podzem) { $rec1['podzem'] = $podzem; } if ($fields['goden']) { $goden = $fields["goden"]; } mysql_query("INSERT INTO `inventory` SET " . ($present ? "`present` = '$present'," : "") . (@$rec1['podzem'] ? "`podzem` = '$rec1[podzem]'," : "") . " `owner` = '$uid', `otdel` = $rec1[razdel] , `prototype` = '$item' " . ($onlyonetrip ? ", `foronetrip` = 1" : "") . ($goden ? ", `dategoden` = '" . ($goden * 60 * 60 * 24 + time()) . "'" : "") . " $sql"); return array("img" => $rec1['img'], "name" => $rec1['name'], "id" => mysql_insert_id()); } function select_arenda($u, $type, $redirect = false) { $hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1')); $price = array(1 => 8, 2 => 15, 3 => 25, 4 => 40); if (!isset($u['id'])) { $r = 'Персонаж не найден ...'; } else { if ($type > 0 && $type <= 4) { if (isset($hostel['id'])) { $r = 'Не более 1 арендованного места ...'; } else { if ($u['money'] >= $price[$type]) { $u['money'] -= $price[$type]; mysql_query('UPDATE `users` SET `money` = "' . $u['money'] . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1'); mysql_query('INSERT INTO `hostel` (`uid`, `type`, `time`) VALUES ("' . $u['id'] . '", "' . $type . '", "' . (time() + 60 * 60 * 24 * 7) . '")'); $r = 'Поздравляем с успешной арендой ...'; } else { $r = 'Недостаточно денег ...'; } } } else { $r = 'Неверный тип аренды ...'; } } if ($redirect == true) { header('Location: main.php'); } return $r; } function remove_hostel_items($u) { $itms = mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `owner` = "-101' . $u . '"'); while ($pl = mysql_fetch_array($itms)) { mysql_query('UPDATE `inventory` SET `owner` = "' . $u . '" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "-101' . $u . '"'); } } $abils_array = array('attack', 'sleep', 'sleepf'); $ab_user = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'); function vip_relicts() { global $user; $r = ''; if ($user['vip'] > 0 && $user['vip_time'] > time()) { $abils = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); if ($abils['sokr'] > 0) { $r .= '
' . $abils['sokr'] . '
'; } else { $r .= '
0
'; } if ($abils['zash'] > 0) { $r .= '
' . $abils['zash'] . '
'; } else { $r .= '
0
'; } if ($abils['invisible'] > 0) { $r .= '
' . $abils['invisible'] . '
'; } else { $r .= '
0
'; } if ($abils['attack'] > 0) { $r .= '
' . $abils['attack'] . '
'; } else { $r .= '
0
'; } if ($abils['bloodattack'] > 0) { $r .= '
' . $abils['bloodattack'] . '
'; } else { $r .= '
0
'; } if ($abils['sleep30'] > 0) { $r .= '
' . $abils['sleep30'] . '
'; } else { $r .= '
0
'; } if ($abils['travmoff'] > 0) { $r .= '
' . $abils['travmoff'] . '
'; } else { $r .= '
0
'; } if ($abils['dontattack'] > 0) { $r .= '
' . $abils['dontattack'] . '
'; } else { $r .= '
0
'; } if ($abils['unsleep'] > 0) { $r .= '
' . $abils['unsleep'] . '
'; } else { $r .= '
0
'; } if ($abils['pers_attack'] > 0) { $r .= '
' . $abils['pers_attack'] . '
'; } else { $r .= '
0
'; } } elseif ($user['vip'] == 0) { $r = 'Вы не вип пользователь ...'; } elseif ($user['vip_time'] <= time()) { $r = 'Вы не вип пользователь ...'; } else { $r = 'Ошибка ...'; } return $r; } function klan_relicts() { global $user; $r = ''; if ($user['klan'] > 0) { $abils = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1')); if ($abils['sleep15'] > 0) { $r .= '
' . $abils['sleep15'] . '
'; } else { $r .= '
0
'; } if ($abils['sleep30'] > 0) { $r .= '
' . $abils['sleep30'] . '
'; } else { $r .= '
0
'; } if ($abils['closebattle'] > 0) { $r .= '
' . $abils['closebattle'] . '
'; } else { $r .= '
0
'; } if ($abils['heal20'] > 0) { $r .= '
' . $abils['heal20'] . '
'; } else { $r .= '
0
'; } if ($abils['heal35'] > 0) { $r .= '
' . $abils['heal35'] . '
'; } else { $r .= '
0
'; } if ($abils['heal50'] > 0) { $r .= '
' . $abils['heal50'] . '
'; } else { $r .= '
0
'; } if ($abils['travmoff'] > 0) { $r .= '
' . $abils['travmoff'] . '
'; } else { $r .= '
0
'; } if ($abils['attack'] > 0) { $r .= '
' . $abils['attack'] . '
'; } else { $r .= '
0
'; } if ($abils['bloodattack'] > 0) { $r .= '
' . $abils['bloodattack'] . '
'; } else { $r .= '
0
'; } if ($abils['death'] > 0) { $r .= '
' . $abils['death'] . '
'; } else { $r .= '
0
'; } if ($abils['comment'] > 0) { $r .= '
' . $abils['comment'] . '
'; } else { $r .= '
0
'; } if ($abils['openbattle'] > 0) { $r .= '
' . $abils['openbattle'] . '
'; } else { $r .= '
0
'; } if ($abils['reamdeath'] > 0) { $r .= '
' . $abils['reamdeath'] . '
'; } else { $r .= '
0
'; } if ($abils['clone'] > 0) { $r .= '
' . $abils['clone'] . '
'; } else { $r .= '
0
'; } if ($abils['unclone'] > 0) { $r .= '
' . $abils['unclone'] . '
'; } else { $r .= '
0
'; } } else { $r = 'Вы не состоите в клане ...'; } return $r; } function user_relicts() { global $user; $r = ''; $abils = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); if ($abils['sleep15'] > 0) { $r .= '
' . $abils['sleep15'] . '
'; } else { $r .= '
0
'; } if ($abils['sleep30'] > 0) { $r .= '
' . $abils['sleep30'] . '
'; } else { $r .= '
0
'; } if ($abils['closebattle'] > 0) { $r .= '
' . $abils['closebattle'] . '
'; } else { $r .= '
0
'; } if ($abils['heal20'] > 0) { $r .= '
' . $abils['heal20'] . '
'; } else { $r .= '
0
'; } if ($abils['heal35'] > 0) { $r .= '
' . $abils['heal35'] . '
'; } else { $r .= '
0
'; } if ($abils['heal50'] > 0) { $r .= '
' . $abils['heal50'] . '
'; } else { $r .= '
0
'; } if ($abils['travmoff'] > 0) { $r .= '
' . $abils['travmoff'] . '
'; } else { $r .= '
0
'; } if ($abils['attack'] > 0) { $r .= '
' . $abils['attack'] . '
'; } else { $r .= '
0
'; } if ($abils['bloodattack'] > 0) { $r .= '
' . $abils['bloodattack'] . '
'; } else { $r .= '
0
'; } if ($abils['death'] > 0) { $r .= '
' . $abils['death'] . '
'; } else { $r .= '
0
'; } if ($abils['comment'] > 0) { $r .= '
' . $abils['comment'] . '
'; } else { $r .= '
0
'; } if ($abils['openbattle'] > 0) { $r .= '
' . $abils['openbattle'] . '
'; } else { $r .= '
0
'; } if ($abils['reamdeath'] > 0) { $r .= '
' . $abils['reamdeath'] . '
'; } else { $r .= '
0
'; } if ($abils['clone'] > 0) { $r .= '
' . $abils['clone'] . '
'; } else { $r .= '
0
'; } if ($abils['unclone'] > 0) { $r .= '
' . $abils['unclone'] . '
'; } else { $r .= '
0
'; } if ($user['id'] == 10022 || $user['id'] == 9081) { $r .= '
~
'; } return $r; } function lookStats($m) { $ist = array(); $di = explode('|', $m); $i = 0; while ($i < count($di)) { $de = explode('=', $di[$i]); if (isset($de[0], $de[1])) { if (!isset($ist[$de[0]])) { $ist[$de[0]] = 0; } $ist[$de[0]] = $de[1]; } $i++; } return $ist; } function impStats($m) { $i = 0; $k = array_keys($m); $d = ''; while ($i <= count($k)) { if ($k[$i] != '') { $d .= $k[$i] . '=' . $m[$k[$i]] . '|'; } $i++; } $d = rtrim($d, '|'); return $d; } function add_user_abil($ab, $cost) { global $user, $banks; if (isset($ab)) { if ($banks['ekr'] >= $cost) { $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); $isset[$ab] += 1; mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1'); $banks['ekr'] -= $cost; mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `owner` = "' . $user['id'] . '" LIMIT 1'); return true; } } return false; } function add_klan_abil($ab, $cost) { global $user, $banks; $clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1')); if (isset($ab)) { if ($banks['ekr'] >= $cost && $clan['glava'] == $user['id']) { $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1')); $isset[$ab] += 1; mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'); $banks['ekr'] -= $cost; mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `owner` = "' . $user['id'] . '" LIMIT 1'); return true; } } return false; } function remove_vip($uid) { mysql_query('UPDATE `users` SET `vip` = "0", `vip_time` = "0" WHERE `id` = "' . $uid . '" LIMIT 1'); $abil = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `daontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "' . $uid . '" LIMIT 1')); if (isset($abil['id'])) { mysql_query('UPDATE `abils_vip` SET `sokr` = 0, `zash` = 0, `invisible` = 0, `attack` = 0, `bloodattack` = 0, `sleep30` = 0, `travmoff` = 0, `daontattack` = 0, `unsleep` = 0, `pers_attack` = 0 WHERE `id` = "' . $abil['id'] . '" LIMIT 1'); } return true; } function upd_vip($u, $type) { $abli = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "' . $u . '" LIMIT 1')); if ($type == 1) { $abli['attack'] += 1; $abli['bloodattack'] += 1; if ($abli['attack'] > 10) { $abli['attack'] = 10; } if ($abli['bloodattack'] > 10) { $abli['bloodattack'] = 10; } mysql_query('UPDATE `abils_vip` SET `sokr` = 1, `zash` = 1, `attack` = "' . $abli['attack'] . '", `bloodattack` = "' . $abli['bloodattack'] . '" WHERE `id` = "' . $abli['id'] . '" LIMIT 1'); echo mysql_error(); } elseif ($type == 2) { $abli['attack'] += 1; $abli['bloodattack'] += 1; $abli['travmoff'] += 1; if ($abli['attack'] > 10) { $abli['attack'] = 10; } if ($abli['bloodattack'] > 10) { $abli['bloodattack'] = 10; } if ($abli['travmoff'] > 10) { $abli['travmoff'] = 10; } mysql_query('UPDATE `abils_vip` SET `sokr` = 1, `zash` = 1, `attack` = "' . $abli['attack'] . ', `bloodattack` = "' . $abli['bloodattack'] . '", `travmoff` = "' . $abli['travmoff'] . '" WHERE `id` = "' . $abli['id'] . '" LIMIT 1'); } elseif ($type == 3) { $abli['attack'] += 1; $abli['bloodattack'] += 1; $abli['travmoff'] += 1; if ($abli['attack'] > 10) { $abli['attack'] = 10; } if ($abli['bloodattack'] > 10) { $abli['bloodattack'] = 10; } if ($abli['travmoff'] > 10) { $abli['travmoff'] = 10; } mysql_query('UPDATE `abils_vip` SET `sokr` = 1, `zash` = 1, `attack` = "' . $abli['attack'] . ', `bloodattack` = "' . $abli['bloodattack'] . '", `travmoff` = "' . $abli['travmoff'] . '" WHERE `id` = "' . $abli['id'] . '" LIMIT 1'); } } define('_BOTSEPARATOR_', 10000000); $exptable = [ 0 => [0, 0, 0, 0, 0, 20], 20 => [1, 0, 0, 0, 0, 45], 45 => [1, 0, 0, 2, 0, 75], 75 => [1, 0, 0, 4, 0, 110], 110 => [3, 1, 1, 8, 1, 160], # Это первый уровень 160 => [1, 0, 0, 2, 0, 215], 215 => [1, 0, 0, 2, 0, 280], 280 => [1, 0, 0, 4, 0, 350], 350 => [1, 0, 0, 8, 0, 410], 410 => [3, 1, 1, 16, 1, 530], # Это второй уровень 530 => [1, 0, 0, 8, 0, 670], 670 => [1, 0, 0, 12, 0, 830], 830 => [1, 0, 0, 16, 0, 950], 950 => [1, 0, 0, 24, 0, 1100], 1100 => [1, 0, 0, 32, 0, 1300], 1300 => [3, 1, 1, 40, 1, 1450], # Это третий уровень 1450 => [1, 0, 0, 10, 0, 1650], 1650 => [1, 0, 0, 20, 0, 1850], 1850 => [1, 0, 0, 30, 0, 2050], 2050 => [1, 0, 0, 40, 0, 2200], 2200 => [1, 0, 0, 50, 0, 2500], 2500 => [5, 1, 1, 70, 1, 2900], # Это четвёртый уровень 2900 => [1, 0, 0, 10, 0, 3350], 3350 => [1, 0, 0, 20, 0, 3800], 3800 => [1, 0, 0, 30, 0, 4200], 4200 => [1, 0, 0, 40, 0, 4600], 4600 => [1, 0, 0, 50, 0, 5000], 5000 => [3, 1, 1, 80, 1, 6000], # Это пятый уровень 6000 => [1, 0, 0, 15, 0, 7000], 7000 => [1, 0, 0, 30, 0, 8000], 8000 => [1, 0, 0, 40, 0, 9000], 9000 => [1, 0, 0, 50, 0, 10000], 10000 => [1, 0, 0, 40, 0, 11000], 11000 => [1, 0, 0, 50, 0, 12000], 12000 => [1, 0, 0, 60, 0, 12500], 12500 => [3, 1, 1, 90, 1, 14000], # Это шестой уровень 14000 => [1, 0, 0, 20, 0, 15500], 15500 => [1, 0, 0, 30, 0, 17000], 17000 => [1, 0, 0, 50, 0, 19000], 19000 => [1, 0, 0, 55, 0, 21000], 21000 => [1, 0, 0, 50, 0, 23000], 23000 => [1, 0, 0, 55, 0, 27000], 27000 => [1, 0, 0, 50, 0, 30000], 30000 => [5, 1, 1, 100, 1, 60000], # Это седьмой уровень 60000 => [1, 0, 0, 100, 0, 75000], 75000 => [1, 0, 0, 100, 0, 150000], 150000 => [1, 0, 0, 150, 0, 175000], 175000 => [1, 0, 0, 50, 0, 200000], 200000 => [1, 0, 0, 100, 0, 225000], 225000 => [1, 0, 0, 50, 0, 250000], 250000 => [1, 0, 0, 100, 0, 260000], 260000 => [1, 0, 0, 50, 0, 280000], 280000 => [1, 0, 0, 100, 0, 300000], 300000 => [5, 1, 1, 700, 1, 1500000], # Это восьмой уровень 1500000 => [1, 0, 0, 500, 0, 1750000], 1750000 => [1, 0, 0, 200, 0, 2000000], 2000000 => [1, 0, 0, 300, 0, 2175000], 2175000 => [1, 0, 0, 100, 0, 2300000], 2300000 => [1, 0, 0, 100, 0, 2400000], 2400000 => [1, 0, 0, 100, 0, 2500000], 2500000 => [1, 0, 0, 200, 0, 2600000], 2600000 => [1, 0, 0, 100, 0, 2800000], 2800000 => [1, 0, 0, 200, 0, 3000000], 3000000 => [5, 1, 2, 1000, 1, 6000000], # Это девятый уровень 6000000 => [1, 0, 0, 200, 0, 6500000], 6500000 => [1, 0, 0, 250, 0, 7500000], 7500000 => [1, 0, 0, 200, 0, 8500000], 8500000 => [1, 0, 0, 250, 0, 9000000], 9000000 => [1, 0, 0, 400, 0, 9250000], 9250000 => [1, 0, 0, 250, 0, 9500000], 9500000 => [1, 0, 0, 400, 0, 9750000], 9750000 => [1, 0, 0, 350, 0, 9900000], 9900000 => [1, 0, 0, 500, 0, 10000000], 10000000 => [9, 1, 3, 2000, 1, 13000000], # Это десятый уровень 13000000 => [2, 0, 0, 200, 0, 14000000], 14000000 => [2, 0, 0, 200, 0, 15000000], 15000000 => [2, 0, 0, 200, 0, 16000000], 16000000 => [2, 0, 0, 200, 0, 17000000], 17000000 => [2, 0, 0, 200, 0, 17500000], 17500000 => [2, 0, 0, 200, 0, 18000000], 18000000 => [2, 0, 0, 200, 0, 19000000], 19000000 => [2, 0, 0, 200, 0, 19500000], 19500000 => [2, 0, 0, 200, 0, 20000000], 20000000 => [2, 0, 0, 250, 0, 30000000], 30000000 => [2, 0, 0, 200, 0, 32000000], 32000000 => [2, 0, 0, 250, 0, 34000000], 34000000 => [2, 0, 0, 200, 0, 35000000], 35000000 => [2, 0, 0, 250, 0, 36000000], 36000000 => [2, 0, 0, 200, 0, 38000000], 38000000 => [2, 0, 0, 250, 0, 40000000], 40000000 => [2, 0, 0, 200, 0, 42000000], 42000000 => [2, 0, 0, 250, 0, 44000000], 44000000 => [2, 0, 0, 350, 0, 47000000], 47000000 => [2, 0, 0, 300, 0, 50000000], 50000000 => [2, 0, 0, 350, 0, 52000000], 52000000 => [10, 1, 3, 3000, 1, 58000000], # Это одиннадцатый уровень 58000000 => [1, 0, 0, 350, 0, 65000000], 65000000 => [1, 0, 0, 300, 0, 72000000], 72000000 => [1, 0, 0, 350, 0, 77000000], 77000000 => [1, 0, 0, 350, 0, 82000000], 82000000 => [1, 0, 0, 300, 0, 87000000], 87000000 => [1, 0, 0, 350, 0, 92000000], 92000000 => [1, 0, 0, 350, 0, 100000000], 100000000 => [1, 0, 0, 350, 0, 120000000], 120000000 => [2, 0, 0, 400, 0, 140000000], 140000000 => [2, 0, 0, 400, 0, 160000000], 160000000 => [2, 0, 0, 600, 0, 180000000], 180000000 => [2, 0, 0, 400, 0, 210000000], 210000000 => [2, 0, 0, 400, 0, 240000000], 240000000 => [10, 2, 4, 5000, 1, 260000000], # Это двеннадцатый уровень 260000000 => [2, 0, 0, 400, 0, 320000000], 320000000 => [2, 0, 0, 400, 0, 400000000], 400000000 => [3, 0, 0, 600, 0, 455000000], 455000000 => [2, 0, 0, 150, 0, 510000000], 510000000 => [2, 0, 0, 100, 0, 600000000], 600000000 => [2, 0, 0, 300, 0, 750000000], 750000000 => [5, 0, 0, 700, 0, 770000000], 770000000 => [1, 0, 0, 400, 0, 815000000], 815000000 => [1, 0, 0, 200, 0, 860000000], 860000000 => [1, 0, 0, 600, 0, 1000000000], 1000000000 => [1, 0, 0, 300, 0, 1100000000], 1100000000 => [1, 0, 0, 450, 0, 1250000000], 1250000000 => [1, 0, 0, 450, 0, 1500000000], 1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень ]; $rooms = [ "0" => "Секретная Комната", "1" => "Комната Новичков", "2" => "Комната Новичков 2", "3" => "Комната Новичков 3", "4" => "Комната Новичков 4", "5" => "Зал Воинов ", "6" => "Зал Воинов 1", "7" => "Зал Воинов 2", "8" => "Торговый зал", "9" => "Рыцарский зал", "10" => "Башня рыцарей-магов", "11" => "Колдовской мир", "12" => "Этажи духов", "13" => "Астральные этажи", "14" => "Огненный мир", "15" => "Зал Паладинов", "16" => "Совет Белого Братства", "17" => "Зал Тьмы", "18" => "Царство Тьмы", "19" => "Будуар", "20" => "Центральная площадь", "2702" => "Центральная площадь", "21" => "Страшилкина улица", "22" => "Магазин", "23" => "Ремонтная мастерская", "24" => "Памятник Архангелу", "25" => "Комиссионный магазин", "26" => "Большая парковая улица", "2655" => "Арена Богов", "2601" => "Замковая Площадь", "27" => "Почта", "28" => "Регистратура кланов", "29" => "Банк", "30" => "Регистратура кланов", "31" => "Башня смерти", "32" => "Готический замок", "33" => "Лабиринт хаоса", "34" => "Цветочный магазин", "35" => "Сувенирный магазин", "36" => "Зал Стихий", "37" => "Готический замок - приемная", "38" => "Готический замок - арсенал", "39" => "Готический замок - внутренний двор", "40" => "Готический замок - мастерские", "41" => "Готический замок - комнаты отдыха", "42" => "Лотерея Сталкеров", "43" => "Хижина Знахаря", "44" => "Новогодняя елка", "45" => "Замок Мэра", "47" => "Замок (строительство)", "48" => "Обитель Хаоса", "49" => "Проход к Цитадели Хаоса", "50" => "Магазин Берёзка", "51" => "Парковая улица", "52" => "Квартал Законников", "53" => "Библиотека", "54" => "Зал Света", "55" => "Царство Света", "56" => "Царство Стихий", "57" => "Зал Клановых Войн", "101" => "Противостояние сил", "200" => "Турнир", "401" => "Врата Ада", // БС "501" => "Восточная Крыша", "502" => "Бойница", "503" => "Келья 3", "504" => "Келья 2", "505" => "Западная Крыша 2", "506" => "Келья 4", "507" => "Келья 1", "508" => "Служебная комната", "509" => "Зал Отдыха 2", "510" => "Западная Крыша 1", "511" => "Выход на Крышу", "512" => "Зал Статуй 2", "513" => "Храм", "514" => "Восточная комната", "515" => "Зал Отдыха 1", "516" => "Старый Зал 2", "517" => "Старый Зал 1", "518" => "Красный Зал 3", "519" => "Зал Статуй 1", "520" => "Зал Статуй 3", "521" => "Трапезная 3", "522" => "Зал Ожиданий", "523" => "Оружейная", "524" => "Красный Зал-Окна", "525" => "Красный Зал", "526" => "Гостинная", "527" => "Трапезная 1", "528" => "Внутренний Двор", "529" => "Внутр.Двор-Вход", "530" => "Желтый Коридор", "531" => "Мраморный Зал 1", "532" => "Красный Зал 2", "533" => "Библиотека 1", "534" => "Трапезная 2", "535" => "Проход Внутр. Двора", "536" => "Комната с Камином", "537" => "Библиотека 3", "538" => "Выход из Мрам.Зала", "539" => "Красный Зал-Коридор", "540" => "Лестница в Подвал 1", "541" => "Южный Внутр. Двор", "542" => "Трапезная 4", "543" => "Мраморный Зал 3", "544" => "Мраморный Зал 2", "545" => "Картинная Галерея 1", "546" => "Лестница в Подвал 2", "547" => "Проход Внутр. Двора 2", "548" => "Внутр.Двор-Выход", "549" => "Библиотека 2", "550" => "Картинная Галерея 3", "551" => "Картинная Галерея 2", "552" => "Лестница в Подвал 3", "553" => "Терасса", "554" => "Оранжерея", "555" => "Зал Ораторов", "556" => "Лестница в Подвал 4", "557" => "Темная Комната", "558" => "Винный Погреб", "559" => "Комната в Подвале", "560" => "Подвал", "600" => "Вход в Цитадель Хаоса", "601" => "Цитадель Хаоса", "602" => "Городской парк", "603" => "Арена Ангелов", 620 => "Вход в Рудник", 621 => "Рудник", 660 => "Гостиница, холл", 661 => "Гостиница", 662 => "Памятник Архангелу", 760 => "Тёмный Лес", // Клановая улица "650" => "Клановая улица", "651" => "Клановая улица", "652" => "Клановый Замок", // "1000" => "Вход в рудник", "1001" => "Рудник", 1051 => "Вход в Лабиринты", 1052 => "Лабиринты", 1053 => "Храмовая лавка", 1054 => "Фонтан Удачи", 1055 => "Групповое сражение", // Тайный проход из Клуба в Замок Законников "2000" => "Подземный проход", "2001" => "Подземный проход (1)", "2002" => "Подземный проход (2)", "2003" => "Подземный проход (3)", "2004" => "Подземный проход (4)", "2005" => "Подземный проход (5)", "2006" => "Подземный проход (6)", "2007" => "Подземный проход (7)", "2008" => "Подземный проход (8)", "2009" => "Подземный проход (9)", "2010" => "Подземный проход (10)", "2011" => "Подземный проход (11)", "2012" => "Подземный проход (12)", "2013" => "Подземный проход (13)", "2014" => "Подземный проход (14)", "2015" => "Подземный проход (15)", "2016" => "Подземный проход (16)", "2017" => "Подземный проход (17)", "2018" => "Подземный проход (18)", "2019" => "Подземный проход (19)", "2020" => "Подземный проход (20)", "2021" => "Подземный проход (21)", "2022" => "Подземный проход (22)", "2023" => "Подземный проход (23)", "2024" => "Подземный проход (24)", "2025" => "Подземный проход (25)", "2026" => "Подземный проход (26)", "2027" => "Подземный проход (27)", "2028" => "Подземный проход (28)", "2029" => "Подземный проход (29)", "2030" => "Подземный проход (30)", "2031" => "Подземный проход (31)", "2032" => "Подземный проход (32)", "2033" => "Подземный проход (33)", "2034" => "Подземный проход (34)", "2035" => "Подземный проход (35)", "2036" => "Подземный проход (36)", "2037" => "Подземный проход (37)", "2038" => "Подземный проход (38)", "2039" => "Подземный проход (39)", "2040" => "Подземный проход (40)", "2041" => "Подземный проход (41)", "2042" => "Подземный проход (42)", "2043" => "Подземный проход (43)", "2044" => "Подземный проход (44)", "2045" => "Подземный проход (45)", "2046" => "Подземный проход (46)", "2047" => "Подземный проход (47)", "2048" => "Подземный проход (48)", "2049" => "Подземный проход (49)", "2050" => "Подземный проход (50)", "2051" => "Подземный проход (51)", "2052" => "Подземный проход (52)", "2053" => "Подземный проход (53)", "2054" => "Подземный проход (54)", "2055" => "Подземный проход (55)", "2056" => "Подземный проход (56)", "2057" => "Подземный проход (57)", "2100" => "Сектор 2100" ]; //эффективность магии $elem_align = array( "a" => array("a" => "1", "e" => "0", "f" => "0.5", "w" => "0.5"), "e" => array("a" => "0", "e" => "1", "f" => "0.5", "w" => "0.5"), "f" => array("a" => "0.5", "e" => "0.5", "f" => "1", "w" => "0"), "w" => array("a" => "0.5", "e" => "0.5", "f" => "0", "w" => "1"), ); $elem_bonus = array( "a" => array("a" => "1", "e" => "0.75", "f" => "1.25", "w" => "1"), "e" => array("a" => "1.25", "e" => "1", "f" => "1", "w" => "0.75"), "f" => array("a" => "0.75", "e" => "1", "f" => "1", "w" => "1.25"), "w" => array("a" => "1", "e" => "1.25", "f" => "0.75", "w" => "1"), ); header("Cache-Control: no-cache"); function level_up($uid) { global $exptable; $us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `sex`, `exp`, `vinos`, `nextup`, `stats`, `master`, `maxhp`, `refer`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc(); if (isset($us['id'])) { if ($us['exp'] >= $us['nextup'] && !$us['in_tower']) { if ($exptable[$us['nextup']][4] == 1) { addch("Персонаж {$us['login']} перешел на " . ($us['level'] + 1) . " уровень."); addchp('Внимание! Вы перешли на новый уровень. За это Вы получаете: ' . $exptable[$us['nextup']][3] . ' кр.', '{[]}' . $us['login'] . '{[]}'); } elseif ($exptable[$us['nextup']][4] == 0) { addchp('Внимание! Вы перешли на новый АП. За это Вы получаете: ' . $exptable[$us['nextup']][3] . ' кр.', '{[]}' . $us['login'] . '{[]}'); } $us['nextup'] = $exptable[$us['nextup']][5]; $us['stats'] += $exptable[$us['nextup']][0]; $us['master'] += $exptable[$us['nextup']][1]; $us['vinos'] += $exptable[$us['nextup']][2]; $us['maxhp'] += ($exptable[$us['nextup']][2] * 6); $us['money'] += $exptable[$us['nextup']][3]; db::c()->query('UPDATE `users` SET `nextup` = ?i, `stats` = ?i, `master` = ?i, `vinos` = ?i, `maxhp` = ?i, `money` = ?i, `level` = ?i WHERE `id` = ?i', $us['nextup'], $us['stats'], $us['master'], $us['vinos'], $us['maxhp'], $us['money'], $us['level'], $us['id']); } } } ######## FIXME ВЕЧНЫЕ 12-ТКИ!!!!!!!!!!!! $in_user = db::c()->query('SELECT `id`, `exp`, `nextup`, `level` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); if (isset($in_user['id']) && ($in_user['exp'] >= $in_user['nextup']) && $in_user['level'] < 13) { level_up($in_user['id']); } ######## function getcavedata($caveleader, $floor) { return unserialize(implode("", file("cavedata/$caveleader-$floor.dat"))); } function savecavedata($cavedata, $caveleader, $floor) { $f1 = fopen("cavedata/$caveleader-$floor.dat", "wb+"); flock($f1, LOCK_EX); fwrite($f1, serialize($cavedata)); flock($f1, LOCK_UN); fclose($f1); } function topsethp() { global $user; if ($user['hp'] >= $user['maxhp'] || $user['battle']) { return "top.setHP($user[hp], $user[maxhp], 0)"; } $fulltime = timetoheals($user); $delay = round(1 / ($user['maxhp'] / $fulltime) * 1000); return "top.setHP($user[hp], $user[maxhp], $delay);"; } function timetoheal() { $fulltime = 600; return $fulltime; } function getslot($i, $user1 = 0) { global $userslots, $user; if (!$user1) { $user1 = $user; } foreach ($userslots as $k => $v) { if ($user1[$v] == $i) { return $v; } } } function nickname(){ $s=1; } function nick($user) { $r = ''; if ($user['align'] > 0) { $al = $user['align']; } else { $al = 0; } if ($user['klan'] != '') { $cl = ''; } else { $cl = ''; } $r .= '
' . $cl . ''; $r .= '' . $user['login'] . ' [' . $user['level'] . '] '; $r .= ' : ' . $user['hp'] . '/' . $user['maxhp'] . '
'; $r .= ''; return $r; } function mick2s($id, $showinvis = 1) { $user = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ($user[0]) { if ($showinvis) { $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1")); if ($effect) { $user['level'] = '??'; $user['login'] = 'невидимка'; $user['align'] = '0'; $user['klan'] = ''; $user['id'] = ''; $user['hp'] = '??'; $user['maxhp'] = '??'; } } $mm .= " 0 ? $user['align'] : "0") . ".gif\" />"; if ($user['klan'] != '') { $mm .= ''; } $mm .= "{$user['login']} [{$user['level']}]\"Инф."; } return $mm; } // nick function nick2($id, $showinvis = 1) { $user = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ($user[0]) { if ($showinvis) { $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1")); if ($effect) { $user['level'] = '??'; $user['login'] = 'невидимка'; $user['align'] = '0'; $user['klan'] = ''; $user['id'] = ''; $user['hp'] = '??'; $user['maxhp'] = '??'; } } ?> .gif" /> '; ?> [] target=_blank>Инф. о <?= $user['login'] ?> невидимка'; $user['level'] = '??'; $user['id'] = '??'; $user['align'] = '0'; $user['klan'] = '0'; } if ($user['align'] > 0) { $mm .= " 0 ? $user['align'] : "0") . ".gif\" />"; } if ($user['klan'] > 0) { $mm .= ''; } $mm .= "{$user['login']} [{$user['level']}]"; } return $mm; } function nick4($id, $st) { $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ($user[0]) { $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1")); if ($effect) { $user['level'] = '??'; $user['login'] = 'невидимка'; $user['align'] = '0'; $user['klan'] = ''; $user['id'] = ''; $user['hp'] = '??'; $user['maxhp'] = '??'; } return "" . $user['login'] . " [" . $user['hp'] . "/" . $user['maxhp'] . "]"; } } function nick5($id, $st) { $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ($user[0]) { $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1")); if ($effect) { $user['login'] = 'невидимка'; } return "" . $user['login'] . ""; } } //function nick6($id) //{ // $user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $id . ' LIMIT 1')); // if ($user[0]) { // $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' AND `type` = '1022' LIMIT 1")); // if ($effect) { // $user['login'] = 'невидимка'; // $user['level'] = '??'; // $user['id'] = '??'; // } // return "" . $user['login'] . " [" . $user['level'] . "] \"Инф."; // } //} function nick7($id) { $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ($user[0]) { if ($user['invis']) { $user['login'] = 'невидимка'; } return $user['login']; } } function check_proc($u) { $r = 100; $usr = mysql_fetch_array(mysql_query('SELECT `id`, `vip`, `vip_time` FROM `users` WHERE `id` = "' . $u . '" LIMIT 1')); if ($usr['vip_time'] > time()) { if ($usr['vip'] == 1) { $r += 10; } elseif ($usr['vip'] == 2) { $r += 15; } elseif ($usr['vip'] == 3) { $r += 20; } } $effes = mysql_fetch_array(mysql_query('SELECT SUM(`proc_exp`) AS `sums` FROM `effects` WHERE `owner` = "' . $usr['id'] . '" AND `proc_exp` > 0')); if ($effes['sums'] > 0) { $r += $effes['sums']; } return $r; } function join_arena($u, $btl, $team, $at) { $bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $btl . '" LIMIT 1')); $battle = unserialize($bd['teams']); $ak = array_keys($battle[$at]); $battle[$u] = $battle[$ak[0]]; foreach ($battle[$u] as $k => $v) { $battle[$u][$k] = array(0, 0, time()); $battle[$k][$u] = array(0, 0, time()); } if ($team == 1) { $adtxt = 'За сторону Тьмы.'; } else { $adtxt = 'За сторону Света.'; } addlog($btl, '' . date("H:i") . ' ' . nick5($u, "B" . $team) . ' вмешался в поединок! ' . $adtxt . '
'); mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $team . '` = CONCAT(`t' . $team . '`,\';' . $u . '\') WHERE `id` = "' . $btl . '" LIMIT 1'); mysql_query("UPDATE users SET `battle` = '" . $btl . "', `zayavka` = 0 WHERE `id` = '" . $u . "' LIMIT 1"); header("Location: fbattle.php"); } function aligntype($a) { $lightaligns = array("1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9"); $darkaligns = array("2.2", "3", "8.21"); $neutralaligns = array("2", "8.31"); if (in_array($a, $lightaligns)) { return 1; } if (in_array($a, $darkaligns)) { return 2; } if (in_array($a, $neutralaligns)) { return 3; } return 0; } function ClanImage($clan_id) { $clanimg = db::c()->query('SELECT `short` FROM `clans` WHERE `id` = ?i ', $clan_id)->fetch_assoc(); if ($clanimg['short']) { $clanimg = $clanimg['short']; } else { $clanimg = "1x1"; } return $clanimg; } function GiveExp($id, $exp) { mysql_query("UPDATE `users` SET `exp` = (`exp`+'" . $exp . "') WHERE `id` = '" . $id . "' LIMIT 1"); } function GiveRep($id, $rep) { mysql_query("UPDATE `users` SET `doblest` = (`doblest`+$rep), `rep_laba` = (`rep_laba`+$rep) WHERE `id` = '" . $id . "' LIMIT 1"); } function GiveKr($id, $kr, $text = "Вы получили ") { mysql_query("UPDATE `users` SET `money` = (`money`+{$kr}) WHERE `id` = {$id} LIMIT 1"); if ($text != null) { addchp($text . $kr . ' кр. ', '{[]}' . nick7($id) . '{[]}'); } mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$id}', '\"" . $user['login'] . "\"" . $text . " " . $kr . " кр. ', '1', '" . time() . "')"); } function GiveDoblest($id, $dobl, $text = "Вы получили ") { mysql_query("UPDATE `users` SET `doblest` = (`doblest`+{$dobl}), `rep_laba` = (`rep_laba`+$dobl) WHERE `id` = {$id} LIMIT 1"); if ($text != null) { addchp($text . $dobl . ' доблести. ', '{[]}' . nick7($id) . '{[]}'); } mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$id}', '\"" . $user['login'] . "\"" . $text . " " . $dobl . " доблести. ', '1', '" . time() . "')"); } // полоска НР function setHP($hp, $maxhp) { $rr = ''; if ($hp < $maxhp * 0.33) { $polosa = 'i/1red.gif'; } elseif ($hp < $maxhp * 0.66) { $polosa = 'i/1yellow.gif'; } else { $polosa = 'i/1green.gif'; } $rr .= "\"УровеньУровень жизни'; $rr .= '' . $hp . '/' . $maxhp . ''; return $rr; } function echoscroll($slot) { global $user; if ($user['battle']) { $script = 'fbattle'; } else { $script = 'main'; } if ($user['battle'] > 0) $bat = mysql_fetch_array(mysql_query("SELECT `id`, `magic` FROM `battle` WHERE `id` = '{$user['battle']}' LIMIT 1")); $all_magic = unserialize($bat['magic']); $dress = mysql_fetch_array(mysql_query("SELECT `id`, `magic`, `name`, `img`, `duration`, `maxdur` FROM `inventory` WHERE `id` = '{$user[$slot]}' LIMIT 1")); $need_charge = mysql_fetch_array(mysql_query("SELECT `needcharge` FROM `magic` WHERE `id` = '{$dress['magic']}' LIMIT 1")); if (($user[$slot] > 0) && ($all_magic[$user['id']] < 1 || $need_charge['needcharge'] == 0)) { $row['id'] = $user[$slot]; if ($dress['magic']) { $magic = magicinf($dress['magic']); echo ""; } echo ''; } elseif (($user[$slot] > 0) && ($all_magic[$user['id']] >= 1) && $need_charge['needcharge'] > 0) { echo ""; } else { echo ""; } } // ссылка на магию function showhrefmagic($dress) { global $user; $r = ''; if ($user['battle']) { $script = 'fbattle'; } else { $script = 'main'; } $magic = magicinf($dress['includemagic']); $r .= ""; $r .= "" . $dress['name'] . "

Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . (($dress['ghp'] > 0) ? "
Уровень жизни +{$dress['ghp']}" : "") . (($dress['minu'] > 0) ? "
Урон {$dress['minu']}-{$dress['maxu']}" : "") . (($dress['text'] != null) ? "
На оружии выгравировано '{$dress['text']}'" : "") . "
Встроена магия: " . $magic['name'] . "\" />
"; return $r; } function timeOut($ttm) { $out = ''; $time_still = $ttm; $tmp = floor($time_still / 2592000); $id = 0; if ($tmp > 0) { $id++; if ($id < 3) { $out .= $tmp . " мес. "; } $time_still = $time_still - $tmp * 2592000; } $tmp = floor($time_still / 86400); if ($tmp > 0) { $id++; if ($id < 3) { $out .= $tmp . " дн. "; } $time_still = $time_still - $tmp * 86400; } $tmp = floor($time_still / 3600); if ($tmp > 0) { $id++; if ($id < 3) { $out .= $tmp . " ч. "; } $time_still = $time_still - $tmp * 3600; } $tmp = floor($time_still / 60); if ($tmp > 0) { $id++; if ($id < 3) { $out .= $tmp . " мин. "; } } if ($out == '') { if ($time_still < 0) { $time_still = 0; } $out = $time_still . ' сек.'; } return $out; } $img = [ 1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif", 5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif", 10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif", 14 => "travma.gif", 20 => "check.gif", 21 => "magic/al_neut_power.gif", 22 => "magic/fist_def.gif", 201 => "magic/defence.gif", 202 => "magic/devastate.gif", 203 => "magic/spell_luck.gif", 215 => "magic/wis_air_def1.gif", 216 => "magic/wis_air_def2.gif", 217 => "magic/wis_air_def3.gif", 218 => "magic/wis_earth_def1.gif", 219 => "magic/wis_earth_def2.gif", 220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif", 224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif", 1022 => "sh/hidden.gif" ]; function show_eff_inf($u, $type) { global $img; $r = ''; $and = ''; if ($type == 1) { $and = " AND `type` != 1022"; } $effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i'.$and, $u)->fetch_assoc(); if ($type == 1) { while ($effs) { if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) { if ($effs['type'] == 11) { $adds = 'Легкая '; } elseif ($effs['type'] == 12) { $adds = 'Средняя '; } elseif ($effs['type'] == 13) { $adds = 'Тяжелая '; } elseif ($effs['type'] == 14) { $adds = 'Неизлечимая '; } else { $adds = ''; } } else { $adds = ''; } $r .= '
'; $r .= ''; $r .= '' . $adds . $effs['name'] . ''; if ($effs['sleep'] != 0) { $r .= '
Эффект заморожен
'; } else { $r .= '
' . timeOut($effs['time'] - time()) . '
'; } $r .= '
'; } } else { while ($effs) { if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) { if ($effs['type'] == 11) { $adds = 'Легкая '; } elseif ($effs['type'] == 12) { $adds = 'Средняя '; } elseif ($effs['type'] == 13) { $adds = 'Тяжелая '; } elseif ($effs['type'] == 14) { $adds = 'Неизлечимая '; } else { $adds = ''; } } else { $adds = ''; } $r .= '
'; $r .= ' '; $r .= '' . $adds . $effs['name'] . ''; if ($effs['sleep'] != 0) { $r .= '
Эффект заморожен
'; } else { $r .= '
' . timeOut($effs['time'] - time()) . '
'; } $r .= '
'; } } return $r; } //function nick5_1($id, $st) //{ // if ($id > _BOTSEPARATOR_) { // $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = ' . $id . ' LIMIT 1;')); // $id = $bots['prototype']; // $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;")); // $user['login'] = $bots['name']; // $user['hp'] = $bots['hp']; // $user['id'] = $bots['id']; // } else { // $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;")); // } // // if ($user[0]) { // $effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$id}' and `type` = '1022' LIMIT 1;")); // if ($effect) { // $user['level'] = '??'; // $user['login'] = 'невидимка'; // $user['align'] = '0'; // $user['klan'] = ''; // $user['id'] = ''; // $user['hp'] = '??'; // $user['maxhp'] = '??'; // $user['mana'] = '??'; // $user['maxmana'] = '??'; // } // $align = ($user['align'] > 0 ? $user['align'] : "0"); // if ($user['klan'] != '') { // $klan = ''; // } // $userb = "" . $klan . $user['login'] . " [" . $user['level'] . "]\"Инф."; // return "" . $userb . ""; // } //} function del_efs($uid, $id, $type) { global $user; $arr = [2, 3, 4, 5, 8, 10, 11, 12, 13, 14, 20]; if ($uid == $user['id']) { if ($id != null) { if (!in_array($type, $arr)) { db::c()->query('DELETE FROM `effects` WHERE `owner` = ?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 haseffect($data, $type) { foreach ($data['effects'] as $k => $v) { if ($v['type'] == $type) { return $k; } } return false; } function addictval($a) { $l = 0; $step = 300; $curr = 0; while (true) { if ($a < $curr + $step) return $l; $l++; $curr += $step; $step += 40; if ($l == 25) return $l; } } function timetoheals($user) { $efs = mysql_fetch_array(mysql_query('SELECT SUM(`speed`) AS `speed` FROM `effects` WHERE `owner` = "' . $user['id'] . '" LIMIT 1')); $efs['speed'] += 0; if ($efs['speed'] > 0) { $fulltime = $efs['speed'] * 2000; } else { $fulltime = 2000; } return $fulltime; } function regenhp($us, $update = 1) { global $user; if ($us['hp'] < $us['maxhp'] && time() > $us['fullhptime']) { $fulltime = timetoheals($us); $delta = ceil((time() - $us['fullhptime']) / $fulltime * $us['maxhp']); if ($delta > 0) { $us['hp'] = min($us['hp'] + $delta, $us['maxhp']); if ($update) { mysql_query("UPDATE `users` SET `hp` = if(`hp`+$delta > `maxhp`, `maxhp`, `hp`+$delta), `fullhptime` = '" . time() . "' WHERE `id` = '$us[id]' LIMIT 1"); } if ($us['id'] == $user['id']) { $user['hp'] = $us['hp']; } } } return $us['hp']; } function showinf_pers($id, $pas = 0, $battle = 0, $me = 0, $main = false) //FIXME 37 запросов! ТРИДЦАТЬ СЕМЬ! Чтобы отобразить предметы на персонаже. { global $rooms; $r = ''; if ($id > _BOTSEPARATOR_) { //FIXME Оно как бы и работает, но два тяжёлющих запроса в самые крупные базы, чтобы подменить два значения... // $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = "' . (int)$id . '" LIMIT 1')); // $id = $bots['prototype']; // $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); // $user = db::c()->query('SELECT * FROM `users` WHERE `id` = (SELECT `prototype` FROM `bots` WHERE `bots`.`id` = ?i)', $id)->fetch_assoc(); // $user['login'] = $bots['name']; // $user['hp'] = $bots['hp']; die('Неустранимая ошибка в showinf_pers(), обратитесь к разработчику.'); } else { // $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); $user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $id)->fetch_assoc(); $invis = $user['invis']; } if ($battle && $invis && $user['id'] != $_SESSION['uid']) { $user['level'] = '??'; $user['login'] = 'невидимка'; $user['align'] = '0'; $user['klan'] = ''; $user['id'] = ''; $user['hp'] = '??'; $user['maxhp'] = '??'; $user['sila'] = '??'; $user['lovk'] = '??'; $user['inta'] = '??'; $user['vinos'] = '??'; $user['intel'] = '??'; $user['deal'] = 0; $user['sergi'] = 0; $user['kulon'] = 0; $user['r1'] = 0; $user['r2'] = 0; $user['r3'] = 0; $user['weap'] = 0; $user['bron'] = 0; $user['helm'] = 0; $user['perchi'] = 0; $user['shit'] = 0; $user['boots'] = 0; $user['shadow'] = 'invis.gif'; } $r .= '
'; if ($user['deal'] > 0) { $deal = '💰 '; } $r .= "$deal" . ($user['align'] > 0 ? "" : "") . ($user['klan'] != '' ? '' : "") . "$user[login] ["; $r .= $user['level']; $r .= "]"; if ($user['block']) { $r .= "
Персонаж заблокирован"; } $r .= "'; if (($user['level'] > 3) && !$pas && !$battle) { $r .= ''; $r .= ''; } $r .= ''; $r .= '
"; $r .= setHP($user['hp'], $user['maxhp'], $battle); $r .= '
'; $r .= echoscroll('m1'); $r .= echoscroll('m2'); $r .= echoscroll('m3'); $r .= echoscroll('m4'); $r .= echoscroll('m5'); $r .= '
'; $r .= echoscroll('m6') . '' . echoscroll('m7') . '' . echoscroll('m8') . '' . echoscroll('m9') . '' . echoscroll('m10'); $r .= '
'; if ($user['sergi'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['sergi'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На серьгах выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['kulon'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['kulon'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На ожерелье выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['weap'] > 0) { $dress = db::c()->query('SELECT `minu`, `maxu`, `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['weap'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['minu'] > 0) ? "
Урон {$dress['minu']}-{$dress['maxu']}" : "") . (($dress['text'] != null) ? "
На оружии выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['bron'] > 0 || $user['rybax'] > 0 || $user['plaw'] > 0) { $title = ''; if ($user['plaw']) { $d = $user['plaw']; if ($user['bron']) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['bron'])->fetch_assoc(); $title .= '
--------------------
' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '
Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '
На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '
Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '
Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '
Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '
Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '
Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '
Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '
Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '
Броня ног: ' . plusorminus($dress['bron4']) . '' : '') . ''; } if ($user['rybax']) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['rybax'])->fetch_assoc(); $title .= '
--------------------
' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '
Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '
На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '
Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '
Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '
Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '
Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '
Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '
Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '
Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '
Броня ног: ' . plusorminus($dress['bron4']) . '' : '') . ''; } } elseif ($user['bron']) { $d = $user['bron']; if ($user['rybax']) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['rybax'])->fetch_assoc(); $title .= "
--------------------
$dress[name]
Прочность $dress[duration]/$dress[maxdur]" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На одежде вышито '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '"'; } } elseif ($user['rybax']) { $d = $user['rybax']; } if ($main == true) { $title = ''; } $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $d)->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=80 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На одежде вышито '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '' . $title . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['r1'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['r1'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['r2'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['r2'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['r3'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['r3'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['helm'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['helm'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На шлеме выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['perchi'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['perchi'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=40 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На перчатках выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . '" />'; } } else { $r .= 'Пустой слот Перчатки'; } $r .= '
'; if ($user['shit'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['shit'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На щите выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } $r .= '
'; if ($user['boots'] > 0) { $dress = db::c()->query('SELECT `name`, `img`, `duration`, `maxdur`, `ghp`, `gsila`, `glovk`, `ginta`, `gintel`, `text`, `bron1`, `bron2`, `bron3`, `bron4`, `includemagicdex` FROM `inventory` WHERE `id` = ?i', $user['boots'])->fetch_assoc(); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { $r .= showhrefmagic($dress); } else { $r .= ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=40 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На ботинках выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { $r .= ''; } if ($invis) { $data['id'] = null; } else { $data = db::c()->query('SELECT * FROM `online` WHERE `date` >= ?i AND `id` = ?i', time()-60, $user['id'])->fetch_assoc(); } $r .= '
'; $ru_1 = show_rune(1, $user['id']); $ru_2 = show_rune(2, $user['id']); $ru_3 = show_rune(3, $user['id']); $r .= '
' . $ru_1 . '' . $ru_2 . '' . $ru_3 . '
'; $r .= '
'; if (!$battle) { if ($pas) { $r .= ''; } $r .= '
'.GAMEDOMAIN.'
'; $online = db::c()->query('SELECT `u`.*, `o`.`date`, `u`.*, `o`.`real_time` FROM `users` AS `u`, `online` AS `o` WHERE `u`.`id` = `o`.`id` AND `u`.`id` = ?i ', $user['id'])->fetch_assoc(); if ($invis) { $invis = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = 1022', $user['id'])->fetch_assoc();//FIXME Тип содержит число, невозможное в базе. } if ($invis > time()) { $data['id'] = null; $online['date'] -= 60 * 120 - ($invis - time()); } if ($data['id'] != null && $user['id'] != 326) { if ($data['room'] > 500 && $data['room'] < 561) { $rrm = 'Башня смерти, участвует в турнире'; } else { $rrm = $rooms[$data['room']]; } $r .= '
Персонаж сейчас находится в игре."' . $rrm . '"
'; } else { $r .= "
Персонаж не в игре.
"; } if ($user['battle'] > 0 && $user['invis'] == 0) { $r .= '
Персонаж сейчас в поединке'; } $r .= '
'; $r .= '
'; $r .= show_eff_inf($user['id'], 1); $r .= '
'; $r .= ''; $r .= 'Сила: ' . $user['sila'] . '
'; $r .= 'Ловкость: ' . $user['lovk'] . '
'; $r .= 'Интуиция: ' . $user['inta'] . '
'; $r .= 'Выносливость: ' . $user['vinos'] . '
'; if ($user['level'] > 3) { $r .= 'Интеллект: ' . $user['intel'] . '
'; } if (!$pas && (($user['stats'] > 0) || ($user['master'] > 0))) { $r .= '+ Способности
'; } $r .= '

'; if (!$pas) { $r .= 'Опыт: ' . $user['exp'] . ' (' . $user['nextup'] . ')
'; } $r .= 'Уровень: ' . $user['level'] . '
'; $r .= 'Побед: ' . $user['win'] . '
'; $r .= 'Поражений: ' . $user['lose'] . '
'; $r .= 'Ничьих: ' . $user['nich'] . '
'; if ($user['klan'] && !$pas) { $r .= "Клан: " . ClanImage($user['klan']) . "
"; } elseif ($user['klan']) { // $clann = mysql_fetch_array(mysql_query("SELECT `name`,`short` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1")); $clann = db::c()->query('SELECT `name`,`short` FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc(); $r .= "" . close_dangling_tags($clann['name']) . " " . close_dangling_tags($user['status']) . "
"; } elseif ($user['align'] > 0) { if ((int)$user['align'] == 1) { $r .= "Орден Паладинов {$user['status']}
"; } if ($user['align'] == 3) { $r .= "Темное братство
"; } if ($user['align'] == 2) { $r .= "Нейтральное братство
"; } if ($user['align'] == 6) { $r .= "Светлое братство
"; } } if ($pas) { $date1 = explode(" ", $user['borntime']); $date2 = explode("-", $date1[0]); $date3 = "" . $date2[2] . "-" . $date2[1] . "-" . $date2[0] . ""; $r .= 'Место рождения: ' . $user['borncity'] . '
'; $r .= 'День рождения персонажа: ' . $date3 . '
'; $r .= '
'; if ($user['palcom'] && $pas) { $r .= "Сообщение от Паладинов о причине отправки в хаос/блокировке:
{$user['palcom']}"; } $ischaos = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = 4 ', $user['id'])->fetch_assoc(); if ($ischaos['time']) { $r .= "
Хаос еще " . timeOut($ischaos['time'] - time()) . ""; } } } else { $r .= ''; $r .= 'Сила: ' . $user['sila'] . '
'; $r .= 'Ловкость: ' . $user['lovk'] . '
'; $r .= 'Интуиция: ' . $user['inta'] . '
'; $r .= 'Выносливость: ' . $user['vinos'] . '
'; if ($user['level'] > 3) { $r .= 'Интеллект: ' . $user['intel'] . '
'; } $r .= ''; } return $r; } function showpersout($id, $pas = 0, $battle = 0, $me = 0) { global $rooms; if ($id > _BOTSEPARATOR_) { $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = ' . (int)$id . ' LIMIT 1')); $id = $bots['prototype']; $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); $user['login'] = $bots['name']; $user['hp'] = $bots['hp']; } else { $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1")); $invis = $user["invis"]; } if ($battle && $invis && $user['id'] != $_SESSION['uid']) { $user['level'] = '??'; $user['login'] = 'невидимка'; $user['align'] = '0'; $user['klan'] = ''; $user['id'] = ''; $user['hp'] = '??'; $user['maxhp'] = '??'; $user['sila'] = '??'; $user['lovk'] = '??'; $user['inta'] = '??'; $user['vinos'] = '??'; $user['intel'] = '??'; $user['deal'] = 0; $user['sergi'] = 0; $user['kulon'] = 0; $user['r1'] = 0; $user['r2'] = 0; $user['r3'] = 0; $user['weap'] = 0; $user['bron'] = 0; $user['helm'] = 0; $user['perchi'] = 0; $user['shit'] = 0; $user['boots'] = 0; $user['shadow'] = 'invis.gif'; } echo '
'; if ($user['deal'] > 0) { $deal = ' '; } else { $deal = ''; } echo "$deal" . ($user['align'] > 0 ? "" : "") . ($user['klan'] <> '' ? '' : "") . "$user[login] ["; echo $user['level']; echo "]\"Инф."; if ($user['block']) { echo "
Персонаж заблокирован!"; } ?> 3) && !$pas && !$battle) { ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['sergi']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На серьгах выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['kulon']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На ожерелье выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['weap']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['minu'] > 0) ? "
Урон {$dress['minu']}-{$dress['maxu']}" : "") . (($dress['text'] != null) ? "
На оружии выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0 || $user['rybax'] > 0 || $user['plaw'] > 0) { $title = ''; if ($user['plaw']) { $d = $user['plaw']; if ($user['bron']) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '$user[bron]' LIMIT 1")); $title .= '
--------------------
' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '
Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '
На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '
Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '
Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '
Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '
Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '
Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '
Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '
Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '
Броня ног: ' . plusorminus($dress['bron4']) . '' : ''); } if ($user['rybax']) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '$user[rybax]' LIMIT 1")); $title .= '
--------------------
' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '
Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '
На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '
Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '
Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '
Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '
Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '
Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '
Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '
Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '
Броня ног: ' . plusorminus($dress['bron4']) . '' : ''); } } elseif ($user['bron']) { $d = $user['bron']; if ($user['rybax']) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '$user[rybax]' LIMIT 1")); $title .= "
--------------------
$dress[name]
Прочность $dress[duration]/$dress[maxdur]" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На одежде вышито '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '"'; } } elseif ($user['rybax']) { $d = $user['rybax']; } $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$d}' LIMIT 1")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=80 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На одежде вышито '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . $title . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r1']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r2']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r3']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=20 height=20 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На кольце выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
<?= $user['login'] ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['helm']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На шлеме выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['perchi']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=40 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На перчатках выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . '" />'; } } else { echo 'Пустой слот Перчатки'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['shit']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=60 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На щите выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['boots']}' LIMIT 1;")); if ($dress['includemagicdex'] && (!$pas || ($battle && $me))) { echo showhrefmagic($dress); } else { echo ' 2 && !$pas) ? " style='background-image:url(i/blink.gif);' " : "") . ' src="i/sh/' . $dress['img'] . '" width=60 height=40 title="' . $dress['name'] . "
Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . "" . (($dress['ghp'] > 0) ? "
Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "
На ботинках выгравировано '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "
Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "
Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "
Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "
Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "
Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "
Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "
Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "
Броня ног: " . plusorminus($dress['bron4']) : "") . '" />'; } } else { echo ''; } if ($invis) $data["id"] = null; else $data = mysql_fetch_array(mysql_query("SELECT * FROM `online` WHERE `date` >= " . (time() - 60) . " AND `id` = " . $user['id'] . ";")); $dd = mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . ";"); ?>
"; } while ($row = mysql_fetch_array($dd)) { if ($row['time'] < time()) { $row['time'] = time(); } if ($row['type'] == 21) { $param_bonus = array(); $param_bonus['sila'] = $row['sila']; $param_bonus['lovk'] = $row['lovk']; $param_bonus['inta'] = $row['inta']; $param_bonus['vinos'] = $row['vinos']; } } ?>
time()) { $data['id'] = null; $online['date'] -= 60 * 120 - ($invis - time()); } if ($data['id'] != null && $user['id'] != 326) { if ($data['room'] > 500 && $data['room'] < 561) { $rrm = 'Башня смерти, участвует в турнире'; } else { $rrm = $rooms[$data['room']]; } echo '
Персонаж сейчас находится в игре."' . $rrm . '"
'; } else { echo "
Персонаж не в игре.
"; } ?> 0 && $user['invis'] == 0) { echo '
Персонаж сейчас в поединке'; } ?>
У персонажа $trt травма.
?> Сила: (+" . $param_bonus['sila'] . ")"; ?>
Ловкость: (+" . $param_bonus['lovk'] . ")"; ?>
Интуиция: (+" . $param_bonus['inta'] . ")"; ?>
Выносливость: (+" . $param_bonus['vinos'] . ")"; ?>
3) { ?> Интеллект:
0) || ($user['master'] > 0))) { ?> + Способности
Опыт: ()
Уровень:
Побед: '>
Поражений: '>
Ничьих: '>
Деньги: кр.
В банке: кр. / eкр.
"; } elseif ($user['klan']) { $clann = mysql_fetch_array(mysql_query("SELECT `name`,`short` FROM `clans` WHERE `id`='{$user['klan']}' LIMIT 1;")); $clanname = $clann['name']; $clannamesh = $clann['short']; echo "" . close_dangling_tags($clanname) . " - " . close_dangling_tags($user['status']) . "
"; } elseif ($user['align'] > 0) { if (($user['align'] > 1) && ($user['align'] < 2)) echo "Орден Паладинов {$user['status']}
"; if (($user['align'] == 3)) echo "Темное братство
"; if (($user['align'] == 2)) echo "Нейтральное братство
"; if (($user['align'] == 6)) echo "Светлое братство
"; } if ($pas) { $date1 = explode(" ", $user['borntime']); $date2 = explode("-", $date1[0]); $date3 = "" . $date2[2] . "-" . $date2[1] . "-" . $date2[0] . ""; if ($user['id'] >= 233 && $user['id'] <= 235) { $date3 = 'До начала времён ...'; } ?> Место рождения:
День рождения персонажа:
"); if ($user['palcom'] && $pas) { echo "Сообщение от Паладинов о причине отправки в хаос/блокировке:
"; echo "{$user['palcom']}"; } $effect = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $user['id'], 4)->fetch_assoc(); if ($effect['time']) { echo "
Хаос еще " . timeOut($effect['time'] - time()) . ""; } } } else { ?> Сила:
Ловкость:
Интуиция:
Выносливость:
3): ?> Интеллект:
6): ?> Мудрость:
= 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) "); } } } /** * @param $time * @param $vars * @param $vls * @param $uid * @return bool */ function addActions($time, $vars, $vls, $uid) { db::c()->query('LOCK TABLES `actions` WRITE'); $ins = db::c()->query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES (?i, ?i, "?s", ?i, "?s", "?s", "?s")', $uid, $time, "capitalcity", 0, $_SERVER['HTTP_X_REAL_IP'], $vls); db::c()->query('UNLOCK TABLES'); if ($ins) { return true; } else { return false; } } function unstack($it_id, $it_count) { global $user; $it_id = (int)$it_id; $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("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(); } } } function plusorminus($n, $shownum = 1) { if (!$shownum) { if ($n >= 2) return "++"; if ($n > 0) return "+"; if ($n < 0) return "-"; } if ($n >= 0) { return "+$n"; } else { return $n; } } /** * Показать предмет в магазине * * @param $it * @param string $from * @return string */ function show_shop_items($it, $from = 'shop') { global $user; $r = ''; $item = mysql_fetch_array(mysql_query("SELECT * FROM `{$from}` WHERE `id` = '{$it}' LIMIT 1")); if (isset($item['id'])) { $magic = magicinf($item['magic']); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = "' . $item['includemagic'] . '" LIMIT 1')); $incmagic['name'] = $item['includemagicname']; $incmagic['cur'] = $item['includemagicdex']; $incmagic['max'] = $item['includemagicmax']; if (!$magic) { $magic['chanse'] = $incmagic['chanse']; $magic['time'] = $incmagic['time']; $magic['targeted'] = $incmagic['targeted']; } if ($item['destiny'] > 0) { $r .= "{$item['name']} (Масса: {$item['massa']})
"; } else { $r .= "{$item['name']} (Масса: {$item['massa']})
"; } if ($item['ecost'] > 0) { $r .= "Цена: {$item['ecost']} екр.    "; } elseif ($item['point'] > 0) { $r .= "Цена: {$item['point']} реп.    "; } else { $r .= "Цена: {$item['cost']} кр.    "; } if ($item['zeton'] > 0) { $r .= "
Жетон: {$item['zeton']} 
"; } if (@$item['count']) { $r .= "(количество: {$item['count']})"; } if ($item['for_me'] > 0) { $r .= '
После покупки вещь будет привязана к персонажу.'; } $r .= "
Долговечность: {$item['duration']}/{$item['maxdur']}"; $r .= "
"; if (!$item['needident']) { if ($magic['chanse'] >= 98) { $magic['chanse'] = 99; } $r .= (($magic['chanse']) ? "Вероятность срабатывания: " . $magic['chanse'] . "%
" : "") . " " . (($magic['time']) ? "Продолжительность действия магии: " . $magic['time'] . " мин.
" : "") . " " . (($item['goden']) ? "Срок годности: {$item['goden']} дн. " . ((!$item['count']) ? "(до " . date("Y.m.d H:i", $item['dategoden']) . ")" : "") . "
" : "") . " " . (($item['nsila'] || $item['nlovk'] || $item['ninta'] || $item['nvinos'] || $item['nlevel'] || $item['nintel'] || $item['nmudra'] || $item['nnoj'] || $item['ntopor'] || $item['ndubina'] || $item['nmech'] || $item['nfire'] || $item['nwater'] || $item['nair'] || $item['nearth'] || $item['nearth'] || $item['nlight'] || $item['ngray'] || $item['ndark']) ? "Требуется минимальное:
" : "") . " " . (($item['nsila'] > 0) ? "• " . (($item['nsila'] > $user['sila']) ? "" : "") . "Сила: {$item['nsila']}
" : "") . " " . (($item['nlovk'] > 0) ? "• " . (($item['nlovk'] > $user['lovk']) ? "" : "") . "Ловкость: {$item['nlovk']}
" : "") . " " . (($item['ninta'] > 0) ? "• " . (($item['ninta'] > $user['inta']) ? "" : "") . "Интуиция: {$item['ninta']}
" : "") . " " . (($item['nvinos'] > 0) ? "• " . (($item['nvinos'] > $user['vinos']) ? "" : "") . "Выносливость: {$item['nvinos']}
" : "") . " " . (($item['nlevel'] > 0) ? "• " . (($item['nlevel'] > $user['level']) ? "" : "") . "Уровень: {$item['nlevel']}
" : "") . " " . (($item['nintel'] > 0) ? "• " . (($item['nintel'] > $user['intel']) ? "" : "") . "Интеллект: {$item['nintel']}
" : "") . " " . (($item['nnoj'] > 0) ? "• " . (($item['nnoj'] > $user['noj']) ? "" : "") . "Мастерство владения ножами и кастетами: {$item['nnoj']}
" : "") . " " . (($item['ntopor'] > 0) ? "• " . (($item['ntopor'] > $user['topor']) ? "" : "") . "Мастерство владения топорами и секирами: {$item['ntopor']}
" : "") . " " . (($item['ndubina'] > 0) ? "• " . (($item['ndubina'] > $user['dubina']) ? "" : "") . "Мастерство владения дубинами и булавами: {$item['ndubina']}
" : "") . " " . (($item['nmech'] > 0) ? "• " . (($item['nmech'] > $user['mec']) ? "" : "") . "Мастерство владения мечами: {$item['nmech']}
" : "") . " " . (($item['nfire'] > 0) ? "• " . (($item['nfire'] > $user['mfire']) ? "" : "") . "Мастерство владения стихией Огня: {$item['nfire']}
" : "") . " " . (($item['nwater'] > 0) ? "• " . (($item['nwater'] > $user['mwater']) ? "" : "") . "Мастерство владения стихией Воды: {$item['nwater']}
" : "") . " " . (($item['nair'] > 0) ? "• " . (($item['nair'] > $user['mair']) ? "" : "") . "Мастерство владения стихией Воздуха: {$item['nair']}
" : "") . " " . (($item['nearth'] > 0) ? "• " . (($item['nearth'] > $user['mearth']) ? "" : "") . "Мастерство владения стихией Земли: {$item['nearth']}
" : "") . " " . (($item['nlight'] > 0) ? "• " . (($item['nlight'] > $user['mlight']) ? "" : "") . "Мастерство владения магией Света: {$item['nlight']}
" : "") . " " . (($item['ngray'] > 0) ? "• " . (($item['ngray'] > $user['mgray']) ? "" : "") . "Мастерство владения серой магией: {$item['ngray']}
" : "") . " " . (($item['ndark'] > 0) ? "• " . (($item['ndark'] > $user['mdark']) ? "" : "") . "Мастерство владения магией Тьмы: {$item['ndark']}
" : "") . " " . (($item['gmeshok'] || $item['gsila'] || $item['mfkrit'] || $item['mfakrit'] || $item['mfuvorot'] || $item['mfauvorot'] || $item['glovk'] || $item['ghp'] || $item['ginta'] || $item['gintel'] || $item['gnoj'] || $item['gtopor'] || $item['gdubina'] || $item['gmech'] || $item['gfire'] || $item['gwater'] || $item['gair'] || $item['gearth'] || $item['gearth'] || $item['glight'] || $item['ggray'] || $item['gdark'] || $item['minu'] || $item['maxu'] || $item['bron1'] || $item['bron2'] || $item['bron3'] || $item['bron4']) ? "Действует на:
" : "") . " " . (($item['minu']) ? "• Минимальное наносимое повреждение: +{$item['minu']}
" : "") . " " . (($item['maxu']) ? "• Максимальное наносимое повреждение: +{$item['maxu']}
" : ""); if ($item['gsila']) { $r .= "• Сила: +" . $item['gsila']; $r .= "
"; } if ($item['glovk']) { $r .= "• Ловкость: " . plusorminus($item['glovk']); $r .= "
"; } if ($item['ginta']) { $r .= "• Интуиция: " . plusorminus($item['ginta']); $r .= "
"; } if ($item['gintel']) { $r .= "• Интеллект: " . plusorminus($item['gintel']); $r .= "
"; } $r .= (($item['ghp']) ? "• Уровень жизни: " . plusorminus($item['ghp']) . "
" : ""); if ($item['mfkrit'] > 0) { $r .= "• Мф. критических ударов: " . plusorminus($item['mfkrit']) . "%"; $r .= "
"; } if ($item['mfakrit'] > 0) { $r .= "• Мф. против крит. ударов: " . plusorminus($item['mfakrit']) . "%"; $r .= "
"; } if ($item['mfuvorot'] > 0) { $r .= "• Мф. увертливости: " . plusorminus($item['mfuvorot']) . "%"; $r .= "
"; } if ($item['mfauvorot'] > 0) { $r .= "• Мф. против увертлив.: " . plusorminus($item['mfauvorot']) . "%"; $r .= "
"; } $r .= (($item['gnoj']) ? "• Мастерство владения ножами и кастетами: +{$item['gnoj']}
" : "") . " " . (($item['gtopor']) ? "• Мастерство владения топорами и секирами: +{$item['gtopor']}
" : "") . " " . (($item['gdubina']) ? "• Мастерство владения дубинами и булавами: +{$item['gdubina']}
" : "") . " " . (($item['gmech']) ? "• Мастерство владения мечами: +{$item['gmech']}
" : "") . " " . (($item['gfire']) ? "• Мастерство владения стихией Огня: +{$item['gfire']}
" : "") . " " . (($item['gwater']) ? "• Мастерство владения стихией Воды: +{$item['gwater']}
" : "") . " " . (($item['gair']) ? "• Мастерство владения стихией Воздуха: +{$item['gair']}
" : "") . " " . (($item['gearth']) ? "• Мастерство владения стихией Земли: +{$item['gearth']}
" : "") . " " . (($item['glight']) ? "• Мастерство владения магией Света: +{$item['glight']}
" : "") . " " . (($item['ggray']) ? "• Мастерство владения серой магией: +{$item['ggray']}
" : "") . " " . (($item['gdark']) ? "• Мастерство владения магией Тьмы: +{$item['gdark']}
" : ""); if ($item['bron1'] > 0) { $r .= "• Броня головы: " . $item['bron1']; $r .= "
"; } if ($item['bron2'] > 0) { $r .= "• Броня корпуса: " . $item['bron2']; $r .= "
"; } if ($item['bron3'] > 0) { $r .= "• Броня пояса: " . $item['bron3']; $r .= "
"; } if ($item['bron4'] > 0) { $r .= "• Броня ног: " . $item['bron4']; $r .= "
"; } $r .= (($item['gmeshok']) ? "• Увеличивает рюкзак: +{$item['gmeshok']}
" : "") . " " . (($item['letter']) ? "Количество символов: " . strlen($item['letter']) . "" : "") . " " . (($item['letter']) ? "На бумаге записан текст:
" . nl2br($item['letter']) . "
" : "") . " " . (($item['opisan']) ? "• " . nl2br($item['opisan']) . "
" : "") . " " . (($magic['name'] && $item['type'] != 50) ? "Наложены заклятия: " . $magic['name'] . "
" : "") . " " . (($item['text']) ? "На ручке выгравирована надпись:
" . $item['text'] . "

" : "") . " " . (($incmagic['max']) ? " Встроено заклятие " . $incmagic['cur'] . " шт.
" : "") . " " . (($item['podzem']) ? "Предмет из подземелья
" : "") . " " . (($item['laba'] == 1) ? "Пропадёт если не найти выход
" : "") . " " . (($item['laba'] == 2) ? "Предмет пропадёт после выхода
" : "") . " " . ((!$item['isrep']) ? "Предмет не подлежит ремонту
" : ""); if ($item['free_bron'] > 0) { $r .= "Свободных улучшений брони: " . $item['free_bron'] . "
"; } if ($item['free_stat'] > 0) { $r .= "Свободных улучшений параметров: " . $item['free_stat'] . "
"; } if ($item['free_mf'] > 0) { $r .= "Свободных улучшений модификаторов: " . $item['free_mf'] . "%
"; } if ($item['add_proc_mf'] > 0 || $item['add_proc_uron'] > 0 || $item['add_proc_bron'] > 0) { $r .= 'Усиление:
'; if ($item['add_proc_mf'] > 0) { $r .= '• Максимального мф.:' . plusorminus($item['add_proc_mf']) . '%
'; } if ($item['add_proc_uron'] > 0) { $r .= '• Урона:' . plusorminus($item['add_proc_uron']) . '%
'; } if ($item['add_proc_bron'] > 0) { $r .= '• Брони:' . plusorminus($item['add_proc_bron']) . '%
'; } } } else { $r .= "Свойства предмета не идентифицированы
"; } $osob = array(22, 23); if (in_array($item['type'], $osob)) { $r .= 'Особенности:
'; if ($item['type'] == 22) { $r .= '• может одеваться под броню
'; } elseif ($item['type'] == 23) { $r .= '• может одеваться на броню
'; } } $r .= "Сделано в CapitalCity
"; } else { $r = 'Предмет не найден : {' . $it . '}'; } return $r; } /** * По ходу, главная функция отображения предметов. * * @param $row * @param $type * @param bool $returned * @return string */ function showitem($row, $type, $returned = false) { global $user, $runes_exp; $returnHTML = ''; if ((($row['maxdur'] <= ($row['duration'])) || ($row['dategoden'] && $row['dategoden'] <= time()))) { destructitem($row['id']); } $magic = magicinf($row['magic']); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1;')); $incmagic['name'] = $row['includemagicname']; $incmagic['cur'] = $row['includemagicdex']; $incmagic['max'] = $row['includemagicmax']; if (!$magic) { $magic['chanse'] = $incmagic['chanse']; $magic['time'] = $incmagic['time']; $magic['targeted'] = $incmagic['targeted']; } if (@!$row['count'] || $type == 10) { $up = ($row['upgrade'] > 0 ? " [" . $row['upgrade'] . "]" : ""); $returnHTML .= ''; if ($incmagic['max']) { $returnHTML .= "
";// 2)?" style='background-image:url(i/blink.gif);' ":"")." src='i/sh/{$row['img']}' style=\"margin:0px,0px,-100000%,0px;\">
} else { $returnHTML .= " 2) ? " style='background-image:url(i/blink.gif);' " : "") . " src='i/sh/{$row['img']}'>
"; } if (($user['sila'] >= $row['nsila']) && ($user['lovk'] >= $row['nlovk']) && ($user['inta'] >= $row['ninta']) && ($user['vinos'] >= $row['nvinos']) && ($user['intel'] >= $row['nintel']) && ($user['mudra'] >= $row['nmudra']) && ($user['level'] >= $row['nlevel']) && (((int)$user['align'] == $row['nalign']) || ($row['nalign'] == 0) || ($row['nalign'] == 1.1 && ($user['align'] > 1 && $user['align'] < 2) || $user['align'] == 6)) && ($user['noj'] >= $row['nnoj']) && ($user['topor'] >= $row['ntopor']) && ($user['dubina'] >= $row['ndubina']) && ($user['mec'] >= $row['nmech']) && ($user['mfire'] >= $row['nfire']) && ($user['mwater'] >= $row['nwater']) && ($user['mair'] >= $row['nair']) && ($user['mearth'] >= $row['nearth']) && ($user['mlight'] >= $row['nlight']) && ($user['mgray'] >= $row['ngray']) && ($user['mdark'] >= $row['ndark']) && ($row['type'] < 13 || ($row['type'] == 50 || $row['type'] == 22 || $row['type'] == 23 || $row['type'] == 24)) && ($row['needident'] == 0) ) { if (($row['type'] == 12) || ($row['magic']) || ($incmagic['cur'])) { $returnHTML .= "исп-ть
"; } if ($row['type'] != 50) { $returnHTML .= "надеть "; } } elseif (($row['type'] == 50) OR ($row['type'] == 12) OR ($row['magic']) OR ($incmagic['cur'])) { $returnHTML .= "исп-ть
"; } if ($type != 10) { $returnHTML .= '
ID: ' . $row['id'] . '
'; // if ($row["koll"]) $returnHTML .= "
 
"; if ($row["koll"] > 1) $returnHTML .= " "; #onclick=\"delItmsNo('Выкинуть предмет?','deleteItems',0,'','".$row['img']."','".$row['name']."','main.php?edit=1&destruct=".$row['id']."');\" $returnHTML .= ""; #$returnHTML .= ""; } else { $returnHTML .= "Улучшить"; } } if ($row['destinyinv'] > 0) { $returnHTML .= "{$row['name']}{$up} (Масса: {$row['massa']})\"Этот" . (($row['present']) ? ' Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.' : "") . "
"; } elseif ($row['destiny'] > 0) { $returnHTML .= "{$row['name']}{$up} (Масса: {$row['massa']})\"Этот" . (($row['present']) ? ' Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.' : "") . "
"; } else { $returnHTML .= "{$row['name']}{$up} (Масса: {$row['massa']})" . (($row['present']) ? ' Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.' : "") . "
"; } if ($row['type'] == 24 && $type != 11) { $returnHTML .= 'Уровень руны: ' . $row['rune_level'] . ' (' . $row['rune_exp'] . '/' . $runes_exp[$row['rune_level'] + 1] . ')
'; } if ($row['ecost'] > 0) { $returnHTML .= "Цена: {$row['ecost']} екр.    "; } elseif ($row['point'] > 0) { $returnHTML .= "Цена: {$row['point']} реп.    "; } else { $returnHTML .= "Цена: {$row['cost']} кр.    "; } if ($row['zeton'] > 0) { $returnHTML .= "
Жетон: {$row['zeton']} 
"; } if (@$row['count']) { $returnHTML .= "(количество: {$row['count']})"; } if ($row['for_me'] > 0) { $returnHTML .= '
После покупки вещь будет привязана к персонажу.'; } $returnHTML .= "
Долговечность: {$row['duration']}/{$row['maxdur']}"; if ($row['podgon'] > 0) { $returnHTML .= " [Подогнано: " . $row['podgon'] . " раз]"; } $returnHTML .= "
"; if (!$row['needident']) { if ($magic['chanse'] >= 98) $magic['chanse'] = 99; $returnHTML .= (($magic['chanse']) ? "Вероятность срабатывания: " . $magic['chanse'] . "%
" : "") . " " . (($magic['time']) ? "Продолжительность действия магии: " . $magic['time'] . " мин.
" : "") . " " . (($row['goden']) ? "Срок годности: {$row['goden']} дн. " . ((!$row['count']) ? "(до " . date("Y.m.d H:i", $row['dategoden']) . ")" : "") . "
" : "") . " " . (($row['nsila'] || $row['nlovk'] || $row['ninta'] || $row['nvinos'] OR $row['nlevel'] OR $row['nintel'] OR $row['nmudra'] OR $row['nnoj'] OR $row['ntopor'] OR $row['ndubina'] OR $row['nmech'] OR $row['nfire'] OR $row['nwater'] OR $row['nair'] OR $row['nearth'] OR $row['nearth'] OR $row['nlight'] OR $row['ngray'] OR $row['ndark']) ? "Требуется минимальное:
" : "") . " " . (($row['nsila'] > 0) ? "• " . (($row['nsila'] > $user['sila']) ? "" : "") . "Сила: {$row['nsila']}
" : "") . " " . (($row['nlovk'] > 0) ? "• " . (($row['nlovk'] > $user['lovk']) ? "" : "") . "Ловкость: {$row['nlovk']}
" : "") . " " . (($row['ninta'] > 0) ? "• " . (($row['ninta'] > $user['inta']) ? "" : "") . "Интуиция: {$row['ninta']}
" : "") . " " . (($row['nvinos'] > 0) ? "• " . (($row['nvinos'] > $user['vinos']) ? "" : "") . "Выносливость: {$row['nvinos']}
" : "") . " " . (($row['nlevel'] > 0) ? "• " . (($row['nlevel'] > $user['level']) ? "" : "") . "Уровень: {$row['nlevel']}
" : "") . " " . (($row['nintel'] > 0) ? "• " . (($row['nintel'] > $user['intel']) ? "" : "") . "Интеллект: {$row['nintel']}
" : "") . " " . (($row['nnoj'] > 0) ? "• " . (($row['nnoj'] > $user['noj']) ? "" : "") . "Мастерство владения ножами и кастетами: {$row['nnoj']}
" : "") . " " . (($row['ntopor'] > 0) ? "• " . (($row['ntopor'] > $user['topor']) ? "" : "") . "Мастерство владения топорами и секирами: {$row['ntopor']}
" : "") . " " . (($row['ndubina'] > 0) ? "• " . (($row['ndubina'] > $user['dubina']) ? "" : "") . "Мастерство владения дубинами и булавами: {$row['ndubina']}
" : "") . " " . (($row['nmech'] > 0) ? "• " . (($row['nmech'] > $user['mec']) ? "" : "") . "Мастерство владения мечами: {$row['nmech']}
" : "") . " " . (($row['nfire'] > 0) ? "• " . (($row['nfire'] > $user['mfire']) ? "" : "") . "Мастерство владения стихией Огня: {$row['nfire']}
" : "") . " " . (($row['nwater'] > 0) ? "• " . (($row['nwater'] > $user['mwater']) ? "" : "") . "Мастерство владения стихией Воды: {$row['nwater']}
" : "") . " " . (($row['nair'] > 0) ? "• " . (($row['nair'] > $user['mair']) ? "" : "") . "Мастерство владения стихией Воздуха: {$row['nair']}
" : "") . " " . (($row['nearth'] > 0) ? "• " . (($row['nearth'] > $user['mearth']) ? "" : "") . "Мастерство владения стихией Земли: {$row['nearth']}
" : "") . " " . (($row['nlight'] > 0) ? "• " . (($row['nlight'] > $user['mlight']) ? "" : "") . "Мастерство владения магией Света: {$row['nlight']}
" : "") . " " . (($row['ngray'] > 0) ? "• " . (($row['ngray'] > $user['mgray']) ? "" : "") . "Мастерство владения серой магией: {$row['ngray']}
" : "") . " " . (($row['ndark'] > 0) ? "• " . (($row['ndark'] > $user['mdark']) ? "" : "") . "Мастерство владения магией Тьмы: {$row['ndark']}
" : "") . " " . (($row['gmeshok'] OR $row['gsila'] OR $row['mfkrit'] OR $row['mfakrit'] OR $row['mfuvorot'] OR $row['mfauvorot'] OR $row['glovk'] OR $row['ghp'] OR $row['ginta'] OR $row['gintel'] OR $row['gnoj'] OR $row['gtopor'] OR $row['gdubina'] OR $row['gmech'] OR $row['gfire'] OR $row['gwater'] OR $row['gair'] OR $row['gearth'] OR $row['gearth'] OR $row['glight'] OR $row['ggray'] OR $row['gdark'] OR $row['minu'] OR $row['maxu'] OR $row['bron1'] OR $row['bron2'] OR $row['bron3'] OR $row['bron4']) ? "Действует на:
" : "") . " " . (($row['minu']) ? "• Минимальное наносимое повреждение: +{$row['minu']}
" : "") . " " . (($row['maxu']) ? "• Максимальное наносимое повреждение: +{$row['maxu']}
" : ""); if ($row['gsila']) { $returnHTML .= "• Сила: +" . $row['gsila']; if ($row['free_stat'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['glovk']) { $returnHTML .= "• Ловкость: " . plusorminus($row['glovk']); if ($row['free_stat'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['ginta']) { $returnHTML .= "• Интуиция: " . plusorminus($row['ginta']); if ($row['free_stat'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['gintel']) { $returnHTML .= "• Интеллект: " . plusorminus($row['gintel']); if ($row['free_stat'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } $returnHTML .= (($row['ghp']) ? "• Уровень жизни: " . plusorminus($row['ghp']) . "
" : ""); if ($row['mfkrit'] > 0) { $returnHTML .= "• Мф. критических ударов: " . plusorminus($row['mfkrit']) . "%"; if ($row['free_mf'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['mfakrit'] > 0) { $returnHTML .= "• Мф. против крит. ударов: " . plusorminus($row['mfakrit']) . "%"; if ($row['free_mf'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['mfuvorot'] > 0) { $returnHTML .= "• Мф. увертливости: " . plusorminus($row['mfuvorot']) . "%"; if ($row['free_mf'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['mfauvorot'] > 0) { $returnHTML .= "• Мф. против увертлив.: " . plusorminus($row['mfauvorot']) . "%"; if ($row['free_mf'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } $returnHTML .= (($row['gnoj']) ? "• Мастерство владения ножами и кастетами: +{$row['gnoj']}
" : "") . " " . (($row['gtopor']) ? "• Мастерство владения топорами и секирами: +{$row['gtopor']}
" : "") . " " . (($row['gdubina']) ? "• Мастерство владения дубинами и булавами: +{$row['gdubina']}
" : "") . " " . (($row['gmech']) ? "• Мастерство владения мечами: +{$row['gmech']}
" : "") . " " . (($row['gfire']) ? "• Мастерство владения стихией Огня: +{$row['gfire']}
" : "") . " " . (($row['gwater']) ? "• Мастерство владения стихией Воды: +{$row['gwater']}
" : "") . " " . (($row['gair']) ? "• Мастерство владения стихией Воздуха: +{$row['gair']}
" : "") . " " . (($row['gearth']) ? "• Мастерство владения стихией Земли: +{$row['gearth']}
" : "") . " " . (($row['glight']) ? "• Мастерство владения магией Света: +{$row['glight']}
" : "") . " " . (($row['ggray']) ? "• Мастерство владения серой магией: +{$row['ggray']}
" : "") . " " . (($row['gdark']) ? "• Мастерство владения магией Тьмы: +{$row['gdark']}
" : ""); if ($row['bron1'] > 0) { $returnHTML .= "• Броня головы: " . $row['bron1']; if ($row['free_bron'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['bron2'] > 0) { $returnHTML .= "• Броня корпуса: " . $row['bron2']; if ($row['free_bron'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['bron3'] > 0) { $returnHTML .= "• Броня пояса: " . $row['bron3']; if ($row['free_bron'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } if ($row['bron4'] > 0) { $returnHTML .= "• Броня ног: " . $row['bron4']; if ($row['free_bron'] > 0) { $returnHTML .= " "; } $returnHTML .= "
"; } $returnHTML .= (($row['gmeshok']) ? "• Увеличивает рюкзак: +{$row['gmeshok']}
" : "") . " " . (($row['letter']) ? "Количество символов: " . strlen($row['letter']) . "" : "") . " " . (($row['letter']) ? "На бумаге записан текст:
" . nl2br($row['letter']) . "
" : "") . " " . (($row['opisan']) ? "• " . nl2br($row['opisan']) . "
" : "") . " " . (($magic['name'] && $row['type'] != 50) ? "Наложены заклятия: " . $magic['name'] . "
" : "") . " " . (($row['text']) ? "На ручке выгравирована надпись:
" . $row['text'] . "

" : "") . " " . (($incmagic['max']) ? " Встроено заклятие " . $incmagic['cur'] . " шт.
" : "") . " " . (($row['podzem']) ? "Предмет из подземелья
" : "") . " " . (($row['laba'] == 1) ? "Пропадёт если не найти выход
" : "") . " " . (($row['laba'] == 2) ? "Предмет пропадёт после выхода
" : "") . " " . ((!$row['isrep']) ? "Предмет не подлежит ремонту
" : ""); if ($row['free_bron'] > 0) { $returnHTML .= "Свободных улучшений брони: " . $row['free_bron'] . "
"; } if ($row['free_stat'] > 0) { $returnHTML .= "Свободных улучшений параметров: " . $row['free_stat'] . "
"; } if ($row['free_mf'] > 0) { $returnHTML .= "Свободных улучшений модификаторов: " . $row['free_mf'] . "%
"; } if ($row['add_proc_mf'] > 0 || $row['add_proc_uron'] > 0 || $row['add_proc_bron'] > 0) { $returnHTML .= 'Усиление:
'; if ($row['add_proc_mf'] > 0) { $returnHTML .= '• Максимального мф.:' . plusorminus($row['add_proc_mf']) . '%
'; } if ($row['add_proc_uron'] > 0) { $returnHTML .= '• Урона:' . plusorminus($row['add_proc_uron']) . '%
'; } if ($row['add_proc_bron'] > 0) { $returnHTML .= '• Брони:' . plusorminus($row['add_proc_bron']) . '%
'; } } } else { $returnHTML .= "Свойства предмета не идентифицированы
"; } $osob = array(22, 23); if (in_array($row['type'], $osob)) { $returnHTML .= 'Особенности:
'; if ($row['type'] == 22) { $returnHTML .= '• может одеваться под броню
'; } elseif ($row['type'] == 23) { $returnHTML .= '• может одеваться на броню
'; } } $returnHTML .= "Сделано в CapitalCity
"; if ($returned) { return $returnHTML; } echo $returnHTML; } function show_item($row, $txt, $place) { if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) destructitem($row['id']); $r = ''; $ntxt = "В инвентаре"; if ($txt == "В сундук") $ntxt = "В сундуке"; $magic = magicinf($row['magic']); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1')); $incmagic['name'] = $row['includemagicname']; $incmagic['cur'] = $row['includemagicdex']; $incmagic['max'] = $row['includemagicmax']; if (!$magic) { $magic['chanse'] = $incmagic['chanse']; $magic['time'] = $incmagic['time']; $magic['targeted'] = $incmagic['targeted']; } #href="?search=1&otdel='.$row['otdel'].'&place='.$place.'&itm='.$row['id'].'&set=1" if (isset($row['id'])) { $r .= '
'; $r .= ''; $r .= ''; $r .= ''; $r .= ''; $r .= ''; $r .= '
'; $r .= '
' . $row['name'] . ' (масса: ' . $row['massa'] . ') ' . (($row['present']) ? ' ' : "") . '
'; if ($row['ecost'] > 0) { $r .= 'Цена: ' . $row['ecost'] . ' екр.    
'; } elseif ($row['point'] > 0) { $r .= 'Цена: ' . $row['point'] . ' реп.    
'; } else { $r .= 'Цена: ' . $row['cost'] . ' кр.    
'; } if ($row['zeton'] > 0) { $r .= 'Жетон: ' . $row['zeton'] . ' 
'; } $r .= 'Долговечность: ' . $row['duration'] . '/' . $row['maxdur'] . '
'; if (!$row['needident']) { if ($magic['chanse']) { if ($magic['chanse'] >= 95) $magic['chanse'] = 95; $r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%
'; } if ($magic['time']) { $r .= 'Продолжительность действия магии: ' . $magic['time'] . ' мин.
'; } if ($row['goden']) { $r .= 'Срок годности: ' . $row['goden'] . ' дн. (до ' . date("Y.m.d H:i", $row['dategoden']) . ')
'; } $r .= '
'; $user = array(); if ($row['nsila']) { $r .= '• '; if ($row['nsila'] > $user['sila']) { $r .= ''; } $r .= 'Требуется Сила: ' . $row['nsila'] . '
'; } if ($row['nlovk']) { $r .= '• '; if ($row['nlovk'] > $user['lovk']) { $r .= ''; } $r .= 'Требуется Ловкость: ' . $row['nlovk'] . '
'; } if ($row['ninta']) { $r .= '• '; if ($row['ninta'] > $user['inta']) { $r .= ''; } $r .= 'Требуется Интуиция: ' . $row['ninta'] . '
'; } if ($row['nvinos']) { $r .= '• '; if ($row['nvinos'] > $user['vinos']) { $r .= ''; } $r .= 'Требуется Выносливость: ' . $row['nvinos'] . '
'; } if ($row['nlevel']) { $r .= '• '; if ($row['nlevel'] > $user['level']) { $r .= ''; } $r .= 'Требуется Уровень: ' . $row['nlevel'] . '
'; } if ($row['nintel']) { $r .= '• '; if ($row['nintel'] > $user['intel']) { $r .= ''; } $r .= 'Требуется Интеллект: ' . $row['nintel'] . '
'; } if ($row['nnoj']) { $r .= '• '; if ($row['nnoj'] > $user['noj']) { $r .= ''; } $r .= 'Требуется Мастерство владения ножами и кастетами: ' . $row['nnoj'] . '
'; } if ($row['ntopor']) { $r .= '• '; if ($row['ntopor'] > $user['topor']) { $r .= ''; } $r .= 'Требуется Мастерство владения топорами и секирами: ' . $row['ntopor'] . '
'; } if ($row['ndubina']) { $r .= '• '; if ($row['ndubina'] > $user['dubina']) { $r .= ''; } $r .= 'Требуется Мастерство владения дубинами и булавами: ' . $row['ndubina'] . '
'; } if ($row['nmech']) { $r .= '• '; if ($row['nmech'] > $user['mech']) { $r .= ''; } $r .= 'Требуется Мастерство владения мечами: ' . $row['nmech'] . '
'; } if ($row['nfire']) { $r .= '• '; if ($row['nfire'] > $user['mfire']) { $r .= ''; } $r .= 'Требуется Магия Огня: ' . $row['nfire'] . '
'; } if ($row['nwater']) { $r .= '• '; if ($row['nwater'] > $user['mwater']) { $r .= ''; } $r .= 'Требуется Магия Воды: ' . $row['nwater'] . '
'; } if ($row['nair']) { $r .= '• '; if ($row['nair'] > $user['mair']) { $r .= ''; } $r .= 'Требуется Магия Воздуха:: ' . $row['nair'] . '
'; } if ($row['nearth']) { $r .= '• '; if ($row['nearth'] > $user['mearth']) { $r .= ''; } $r .= 'Требуется Магия Земли: ' . $row['nearth'] . '
'; } if ($row['nlight']) { $r .= '• '; if ($row['nlight'] > $user['mlight']) { $r .= ''; } $r .= 'Требуется Магия Света: ' . $row['nlight'] . '
'; } if ($row['ngray']) { $r .= '• '; if ($row['ngray'] > $user['mgray']) { $r .= ''; } $r .= 'Требуется Магия Равновесия: ' . $row['ngray'] . '
'; } if ($row['ndark']) { $r .= '• '; if ($row['ndark'] > $user['mdark']) { $r .= ''; } $r .= 'Требуется Магия Тьмы: ' . $row['ndark'] . '
'; } $r .= '

'; $r .= '
'; if ($row['minu']) $r .= '+' . $row['minu'] . ' Минимальное наносимое повреждение
'; if ($row['maxu']) $r .= '+' . $row['maxu'] . ' Максимальное наносимое повреждение
'; if ($row['gsila']) $r .= '+' . $row['gsila'] . ' Сила
'; if ($row['glovk']) $r .= '+' . $row['glovk'] . ' Ловкость
'; if ($row['ginta']) $r .= '+' . $row['ginta'] . ' Интуиция
'; if ($row['gintel']) $r .= '+' . $row['gintel'] . ' Интеллект
'; if ($row['ghp']) $r .= '+' . $row['ghp'] . ' Уровень жизни
'; if ($row['mfkrit']) $r .= '+' . $row['mfkrit'] . '% Мф. критических ударов
'; if ($row['mfakrit']) $r .= '+' . $row['mfakrit'] . '% Мф. против крит. ударов
'; if ($row['mfuvorot']) $r .= '+' . $row['mfuvorot'] . '% Мф. увертливости
'; if ($row['mfauvorot']) $r .= '+' . $row['mfauvorot'] . '% Мф. против увертливости
'; if ($row['gnoj']) $r .= '+' . $row['gnoj'] . ' Мастерство владения ножами и кастетами
'; if ($row['gtopor']) $r .= '+' . $row['gtopor'] . ' Мастерство владения топорами и секирами
'; if ($row['gdubina']) $r .= '+' . $row['gdubina'] . ' Мастерство владения дубинами и булавами
'; if ($row['gmech']) $r .= '+' . $row['gmech'] . ' Мастерство владения мечами
'; if ($row['gfire']) $r .= '+' . $row['gfire'] . ' Мастерство владения стихией Огня
'; if ($row['gwater']) $r .= '+' . $row['gwater'] . ' Мастерство владения стихией Воды
'; if ($row['gair']) $r .= '+' . $row['gair'] . ' Мастерство владения стихией Воздуха
'; if ($row['gearth']) $r .= '+' . $row['gearth'] . ' Мастерство владения стихией Земли
'; if ($row['glight']) $r .= '+' . $row['glight'] . ' Мастерство владения магией Светa
'; if ($row['ggray']) $r .= '+' . $row['ggray'] . ' Мастерство владения Cерой магией
'; if ($row['gdark']) $r .= '+' . $row['gdark'] . ' Мастерство владения магией Тьмы
'; if ($row['bron1']) $r .= '+' . $row['bron1'] . ' Броня головы
'; if ($row['bron2']) $r .= '+' . $row['bron2'] . ' Броня корпуса
'; if ($row['bron3']) $r .= '+' . $row['bron3'] . ' Броня пояса
'; if ($row['bron4']) $r .= '+' . $row['bron4'] . ' Броня ног
'; if ($row['gmeshok']) $r .= '+' . $row['gmeshok'] . ' Увеличивает рюкзак:
'; $r .= ''; if ($row['letter']) $r .= 'На бумаге записан текст:
' . nl2br($row['letter']) . '

'; if ($magic['name'] && $row['type'] != 50) $r .= 'Наложены заклятия: ' . $magic['name'] . '
'; if ($row['text']) $r .= 'На ручке выгравирована надпись:
' . $row['text'] . '

'; if ($incmagic['max']) $r .= 'Встроено заклятие ' . $incmagic['cur'] . ' шт.
'; if ($row['podzem']) $r .= 'Предмет из подземелья
'; if ($row['laba'] == 1) $r .= 'Пропадёт если не найти выход
'; if ($row['laba'] == 2) $r .= 'Предмет пропадёт после выхода
'; if ($row['isrep']) $r .= 'Предмет не подлежит ремонту
'; if ($row['free_bron']) $r .= '+' . $row['free_bron'] . ' Улучшений брони
'; if ($row['free_stat']) $r .= '+' . $row['free_stat'] . ' Улучшений параметров
'; if ($row['free_mf']) $r .= '+' . $row['free_mf'] . ' Улучшений модификаторов
'; $r .= '
'; } else { $r .= 'Свойства предмета не идентифицированы
'; } $osob = array(22, 23); if (in_array($row['type'], $osob)) { $r .= 'Особенности:
'; if ($row['type'] == 22) { $r .= '• может одеваться под броню'; } elseif ($row['type'] == 23) { $r .= '• может одеваться на броню'; } } $r .= '
'; } return $r; } /** * @param $id * @return array */ function magicinf($id) { return db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $id)->fetch_assoc(); } /** * @param $id */ function showpersinfo($id) { $items = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i', $id)->fetch_assoc(); } /** * Отображение персонажа в main.php * @param $id */ function showpersinv($id) { $user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $id)->fetch_assoc(); $dressed = []; $r = mysql_query("SELECT * FROM `inventory` WHERE `id` = '$user[helm]' OR `id` = '$user[weap]' OR `id` = '$user[plaw]' OR `id` = '$user[bron]' OR `id` = '$user[rybax]' OR `id` = '$user[belt]' OR `id` = '$user[sergi]' OR `id` = '$user[kulon]' OR `id` = '$user[r1]' OR `id` = '$user[r2]' OR `id` = '$user[r3]' OR `id` = '$user[perchi]' OR `id` = '$user[shit]' OR `id` = '$user[leg]' OR `id` = '$user[boots]' OR `id` = '$user[m1]' OR `id` = '$user[m2]' OR `id` = '$user[m3]' OR `id` = '$user[m4]' OR `id` = '$user[m5]' OR `id` = '$user[m6]' OR `id` = '$user[m7]' OR `id` = '$user[m8]' OR `id` = '$user[m9]' OR `id` = '$user[m10]' OR `id` = '$user[m11]' OR `id` = '$user[m12]'"); while ($rec = mysql_fetch_assoc($r)) { $dressed[$rec['id']] = $rec; } ?>
.gif"> ; [] target=_blank>Инф. о <?= $user['login'] ?> 3) { ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m1']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m2'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m2']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m3'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m3']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m4'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m4']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m5'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m5']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m6']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m7'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m7']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m8'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m8']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m9'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m9']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } if ($user['m10'] > 0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['m10']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur']; echo ''; } else { $mess = 'Пустой слот магия'; echo ''; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['sergi']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Серьги\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['kulon']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Ожерелье\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['weap']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Оружие\' />'; } ?>
0 || $user['rybax'] > 0 || $user['plaw'] > 0) { if ($user['plaw']) { $d = $user['plaw']; $n = 23; } elseif ($user['bron']) { $d = $user['bron']; $n = 4; } elseif ($user['rybax']) { $d = $user['rybax']; $n = 22; } $dress = $dressed[$d]; $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Броня\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r1']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Кольцо\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r2']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Кольцо\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['r3']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Кольцо\' />'; } ?>
<?= $user['login'] ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['helm']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Шлем\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['perchi']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Перчатки\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['shit']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . ''; echo ''; } else { echo 'Пустой слот Щит\' />'; } ?>
0) { $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '{$user['boots']}' LIMIT 1;")); $mess = 'Снять ' . $dress['name'] . '
Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '
'; echo ''; } else { echo 'Пустой слот Обувь\' />'; } ?>
query('SELECT `id`, `rune_1`, `rune_2`, `rune_3` FROM `users` WHERE `id` = ?i', $uid)->fetch_assoc(); if (isset($us['id'])) { if ($us['rune_' . $slot] > 0) { $ruid = $us['rune_' . $slot]; $rtype = (23 + $slot); $dress = db::c()->query('SELECT `id`, `img`, `name`, `duration`, `maxdur`, `rune_level`, `rune_exp` FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', $ruid, $us['id'])->fetch_assoc(); if (isset($dress['id'])) { if ($us['id'] == $user['id'] && $type == 1) { $r = ''; } else { $r = ''; } } else { $r = ''; } } else { $r = ''; } } else { $r = ''; } return $r; } function undressall($id) { for ($i = 1; $i <= 26; $i++) { dropitemid($i, $id); } } function dropitemid_cave($slot, $id) { global $user; switch ($slot) { case 'sergi': $slot = 1; break; case 'kulon': $slot = 2; break; case 'weap': $slot = 3; break; case 'bron': $slot = 4; break; case 'r1': $slot = 5; break; case 'r2': $slot = 6; break; case 'r3': $slot = 7; break; case 'helm': $slot = 8; break; case 'perchi': $slot = 9; break; case 'shit': $slot = 10; break; case 'boots': $slot = 11; break; case 'm1': $slot = 12; break; case 'm2': $slot = 13; break; case 'm3': $slot = 14; break; case 'm4': $slot = 15; break; case 'm5': $slot = 16; break; case 'm6': $slot = 17; break; case 'm7': $slot = 18; break; case 'm8': $slot = 19; break; case 'm9': $slot = 20; break; case 'm10': $slot = 21; break; case 'rybax': $slot = 22; break; case 'plaw': $slot = 23; break; } if (mysql_query('UPDATE `users`, `inventory` SET `users`.' . $slot . ' = 0, `inventory`.`dressed` = 0, `users`.`sila` = `users`.`sila` - `inventory`.`gsila`, `users`.`lovk` = `users`.`lovk` - `inventory`.`glovk`, `users`.`inta` = `users`.`inta` - `inventory`.`ginta`, `users`.`intel` = `users`.`intel` - `inventory`.`gintel`, `users`.`maxhp` = `users`.`maxhp` - `inventory`.`ghp`, `users`.`noj` = `users`.`noj` - `inventory`.`gnoj`, `users`.`topor` = `users`.`topor` - `inventory`.`gtopor`, `users`.`dubina` = `users`.`dubina` - `inventory`.`gdubina`, `users`.`mec` = `users`.`mec` - `inventory`.`gmech`, `users`.`mfire` = `users`.`mfire` - `inventory`.`gfire`, `users`.`mwater` = `users`.`mwater` - `inventory`.`gwater`, `users`.`mair` = `users`.`mair` - `inventory`.`gair`, `users`.`mearth` = `users`.`mearth` - `inventory`.`gearth`, `users`.`mlight` = `users`.`mlight` - `inventory`.`glight`, `users`.`mgray` = `users`.`mgray` - `inventory`.`ggray`, `users`.`mdark` = `users`.`mdark` - `inventory`.`gdark`, `users`.`fkrit` = `users`.`fkrit` - `inventory`.`mfkrit`, `users`.`fakrit` = `users`.`fakrit` - `inventory`.`mfakrit`, `users`.`fuvorot` = `users`.`fuvorot` - `inventory`.`mfuvorot`, `users`.`fauvorot` = `users`.`fauvorot` - `inventory`.`mfauvorot`, `users`.`ubron1` = `users`.`ubron1` - `inventory`.`bron1`, `users`.`ubron2` = `users`.`ubron2` - `inventory`.`bron2`, `users`.`ubron3` = `users`.`ubron3` - `inventory`.`bron3`, `users`.`ubron4` = `users`.`ubron4` - `inventory`.`bron4`, `users`.`uminu` = `users`.`uminu` - `inventory`.`minu`, `users`.`umaxu` = `users`.`umaxu` - `inventory`.`maxu` WHERE `inventory`.`id` = `users`.' . $slot . ' AND `inventory`.`dressed` = 1 AND `inventory`.`owner` = "' . $user['id'] . '" AND `users`.`id` = "' . $user['id'] . '"')) { mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$id}' LIMIT 1"); if ($id == $user['id']) { $user[$slot] = 0; } return true; } else { echo mysql_error(); } } function del_effs($uid, $eff, $txt) { $pers = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `sila`, `lovk`, `inta`, `vinos`, `intel`, `hp`, `maxhp` FROM `users` WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1')); if (isset($pers['id'])) { $effect = mysql_fetch_array(mysql_query('SELECT `id`, `type`, `name`, `time`, `sila`, `lovk`, `inta`, `vinos`, `hp`, `proc_exp`, `owner`, `sleep`, `lastup`, `can` FROM `effects` WHERE `id` = "' . mysql_real_escape_string($eff) . '" AND `owner` = "' . $pers['id'] . '" LIMIT 1')); if (isset($effect['id'])) { if ($effect['type'] == 11 || $effect['type'] == 12 || $effect['type'] == 13 || $effect['type'] == 14) { $pers['sila'] += $effect['sila']; $pers['lovk'] += $effect['lovk']; $pers['inta'] += $effect['inta']; $pers['vinos'] += $effect['vinos']; $pers['maxhp'] += $effect['hp']; } else { $pers['sila'] -= $effect['sila']; $pers['lovk'] -= $effect['lovk']; $pers['inta'] -= $effect['inta']; $pers['vinos'] -= $effect['vinos']; $pers['maxhp'] -= $effect['hp']; } mysql_query('UPDATE `users` SET `sila` = "' . $pers['sila'] . '", `lovk` = "' . $pers['lovk'] . '", `inta` = "' . $pers['inta'] . '", `vinos` = "' . $pers['vinos'] . '", `maxhp` = "' . $pers['maxhp'] . '" WHERE `id` = "' . $pers['id'] . '" LIMIT 1'); mysql_query('DELETE FROM `effects` WHERE `owner` = "' . $pers['id'] . '" AND `id` = "' . $effect['id'] . '" LIMIT 1'); $text = 'Закончилось действие эффекта ' . $effect['name'] . '.'; if ($txt == 1) { addchp('Внимание! ' . $text, '{[]}' . nick7($pers['id']) . '{[]}'); } unset($pers, $effect, $uid, $eff, $text); } } } function dropitemid($slot, $id) { $user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $id . '" LIMIT 1')); switch ($slot) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 13: $slot1 = 'm2'; break; case 14: $slot1 = 'm3'; break; case 15: $slot1 = 'm4'; break; case 16: $slot1 = 'm5'; break; case 17: $slot1 = 'm6'; break; case 18: $slot1 = 'm7'; break; case 19: $slot1 = 'm8'; break; case 20: $slot1 = 'm9'; break; case 21: $slot1 = 'm10'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; case 24: $slot1 = 'rune_1'; break; case 25: $slot1 = 'rune_2'; break; case 26: $slot1 = 'rune_3'; break; } if (mysql_query('UPDATE `users`, `inventory` SET `users`.`' . $slot1 . '` = 0, `inventory`.`dressed` = 0, `users`.`sila` = `users`.`sila` - `inventory`.`gsila`, `users`.`lovk` = `users`.`lovk` - `inventory`.`glovk`, `users`.`inta` = `users`.`inta` - `inventory`.`ginta`, `users`.`intel` = `users`.`intel` - `inventory`.`gintel`, `users`.`maxhp` = `users`.`maxhp` - `inventory`.`ghp`, `users`.`noj` = `users`.`noj` - `inventory`.`gnoj`, `users`.`topor` = `users`.`topor` - `inventory`.`gtopor`, `users`.`dubina` = `users`.`dubina` - `inventory`.`gdubina`, `users`.`mec` = `users`.`mec` - `inventory`.`gmech`, `users`.`mfire` = `users`.`mfire` - `inventory`.`gfire`, `users`.`mwater` = `users`.`mwater` - `inventory`.`gwater`, `users`.`mair` = `users`.`mair` - `inventory`.`gair`, `users`.`mearth` = `users`.`mearth` - `inventory`.`gearth`, `users`.`mlight` = `users`.`mlight` - `inventory`.`glight`, `users`.`mgray` = `users`.`mgray` - `inventory`.`ggray`, `users`.`mdark` = `users`.`mdark` - `inventory`.`gdark`, `users`.`fkrit` = `users`.`fkrit` - `inventory`.`mfkrit`, `users`.`fakrit` = `users`.`fakrit` - `inventory`.`mfakrit`, `users`.`fuvorot` = `users`.`fuvorot` - `inventory`.`mfuvorot`, `users`.`fauvorot` = `users`.`fauvorot` - `inventory`.`mfauvorot`, `users`.`ubron1` = `users`.`ubron1` - `inventory`.`bron1`, `users`.`ubron2` = `users`.`ubron2` - `inventory`.`bron2`, `users`.`ubron3` = `users`.`ubron3` - `inventory`.`bron3`, `users`.`ubron4` = `users`.`ubron4` - `inventory`.`bron4`, `users`.`uminu` = `users`.`uminu` - `inventory`.`minu`, `users`.`umaxu` = `users`.`umaxu` - `inventory`.`maxu` WHERE `inventory`.`id` = `users`.`' . $slot1 . '` AND `inventory`.`dressed` = 1 AND `inventory`.`owner` = "' . $user['id'] . '" AND `users`.`id` = "' . $user['id'] . '"')) { mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$id}' LIMIT 1"); if ($id == $user['id']) { $user[$slot1] = 0; } return true; } } // снять предмет function dropitem($slot) { global $user; switch ($slot) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 13: $slot1 = 'm2'; break; case 14: $slot1 = 'm3'; break; case 15: $slot1 = 'm4'; break; case 16: $slot1 = 'm5'; break; case 17: $slot1 = 'm6'; break; case 18: $slot1 = 'm7'; break; case 19: $slot1 = 'm8'; break; case 20: $slot1 = 'm9'; break; case 21: $slot1 = 'm10'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; case 24: $slot1 = 'rune_1'; break; case 25: $slot1 = 'rune_2'; break; case 26: $slot1 = 'rune_3'; break; } { if (mysql_query("UPDATE `users` as u, `inventory` as i SET u.{$slot1} = 0, i.dressed = 0, 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.id = u.{$slot1} AND i.dressed = 1 AND i.owner = {$user['id']} AND u.id = {$user['id']};")) mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$user['id']}' LIMIT 1;"); $wear_raw = mysql_query("SELECT * FROM inventory where owner={$user['id']} AND dressed='1';"); while ($wear_list = mysql_fetch_array($wear_raw)) { $wear_arr[] = $wear_list['prototype']; }; $item['id'] = $user[$slot1]; //foreach($wear_arr as $wt) echo($wt."
"); $get_pro_raw = mysql_query("SELECT * FROM inventory where id={$item['id']} limit 1;"); $get_pro = mysql_fetch_array($get_pro_raw); ///////////////////// $sets_items = mysql_query("SELECT * FROM item_sets"); //для каждого комплекта while ($items_in_set = mysql_fetch_array($sets_items)) { $checker = 0; $temp_is = explode(",", $items_in_set['prot_id']); $set_id = $items_in_set['set_id']; //если прото в комплекте и не одет if (in_array($get_pro['prototype'], $temp_is) && (!in_array($get_pro['prototype'], $wear_arr))) { $checker = 1; // echo("
ITEM SETS
"); //foreach($temp_is as $tis) echo($tis."
"); //для каждого одетого предмета foreach ($temp_is as $check_proto) if ($check_proto != $get_pro['prototype']) { if (!in_array($check_proto, $wear_arr)) { $checker = 0; }; // echo("Checker=".$checker." at set #".$set_id." item #".$check_proto." Compare=".$get_pro['prototype']."
"); } //echo("Checker=".$checker." at set #".$set_id); } // if (($checker == 1) && (!in_array($get_pro['prototype'], $wear_arr))) { mysql_query("UPDATE `users` as u, `item_sets` as s SET u.uminu = u.uminu - s.minu, u.umaxu = u.umaxu - s.maxu, u.sila = u.sila - s.gsila, u.lovk = u.lovk - s.glovk, u.inta = u.inta - s.ginta, u.intel = u.intel - s.gintel, u.maxhp = u.maxhp - s.ghp, u.maxmana = u.maxmana - s.gmana, u.fkrit = u.fkrit - s.mfkrit, u.fakrit = u.fakrit - s.mfakrit, u.fuvorot = u.fuvorot - s.mfuvorot, u.fauvorot = u.fauvorot - s.mfauvorot, u.noj = u.noj - s.gnoj, u.topor = u.topor - s.gtopor, u.dubina = u.dubina - s.gdubina, u.mec = u.mec - s.gmech, u.ubron1 = u.ubron1 - s.bron1, u.ubron2 = u.ubron2 - s.bron2, u.ubron3 = u.ubron3 - s.bron3, u.ubron4 = u.ubron4 - s.bron4, u.mfire = u.mfire - s.gfire, u.mwater = u.mwater - s.gwater, u.mair = u.mair - s.gair, u.mearth = u.mearth - s.gearth, u.mlight = u.mlight - s.glight, u.mgray = u.mgray - s.ggray WHERE u.id = {$user['id']} AND s.set_id={$set_id};"); //echo ("Сняли ".$set_id); }; }; return true; } } //сможет держать function derj($id) { global $user; $ts = mysql_fetch_array(mysql_query('SELECT `id`, `nalign` FROM `inventory` WHERE `id` = "' . $id . '" LIMIT 1')); $al = '(1 = 1)'; if ($ts['nalign'] > 0) { if ($ts['nalign'] == 1.1) { if (($user['align'] == 6 || ($user['align'] > 1 && $user['align'] < 2))) { $al = '(1 = 1)'; } else { $al = '(1 = 2)'; } } } if ($dd = mysql_query("SELECT i.`id` FROM`users` AS `u`, `inventory` AS `i` WHERE i.needident = 0 AND i.id = {$id} AND i.duration < i.maxdur AND i.owner = {$user['id']} AND u.sila >= i.nsila AND u.lovk >= i.nlovk AND u.inta >= i.ninta AND u.vinos >= i.nvinos AND u.intel >= i.nintel AND u.mudra >= i.nmudra AND u.level >= i.nlevel AND ($al OR (" . (int)$user['align'] . " = 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 = {$user['id']};")) { $dd = mysql_fetch_array($dd); if ($dd[0] > 0) { return true; } else { return false; } } } function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float)$sec + ((float)$usec * 100000); } function ref_drop() { global $user; $slot = array('sergi', 'kulon', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'perchi', 'shit', 'boots', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'); for ($i = 0; $i <= 20; $i++) { if ($user[$slot[$i]] && !derj($user[$slot[$i]])) { dropitem($i + 1); $user[$slot[$i]] = null; } } } function GetWeaponType($idwep) { if ($idwep == 0 || $idwep == null || $idwep == '') { return "kulak"; } $wep = mysql_fetch_array(mysql_query('SELECT `otdel`, `minu` FROM `inventory` WHERE `id` = "' . $idwep . '" LIMIT 1')); if ($wep[0] == '1') { return "noj"; } elseif ($wep[0] == '12') { return "dubina"; } elseif ($wep[0] == '11') { return "topor"; } elseif ($wep[0] == '13') { return "mech"; } elseif ($wep[1] > 0) { return "buket"; } else { return "kulak"; } } function stripslashes_deep($text) { while (strstr($text, "\\")) { $text = stripslashes($text); } return $text; } function countmf() { //TODO пересчитать модификаторы global $user; $zo = mysql_fetch_row(mysql_query("SELECT `id` FROM `effects` WHERE `type` = 201 AND `owner` = {$user['id']} LIMIT 1")); $sokr = mysql_fetch_row(mysql_query("SELECT `id` FROM `effects` WHERE `type` = 202 AND `owner` = {$user['id']} LIMIT 1")); if (isset($sokr[0])) { $bmfud += 5; } else { $bmfud = 0; } if (isset($zo[0]) > 0) { $bmfbron += 25; } else { $bmfbron = 0; } $mf = array(); $ud_raw = mysql_query('SELECT SUM(`minu`), SUM(`maxu`), SUM(`mfkrit`), SUM(`mfakrit`), SUM(`mfuvorot`), SUM(`mfauvorot`), SUM(`bron1`), SUM(`bron2`), SUM(`bron3`), SUM(`bron4`) FROM `inventory` WHERE `dressed` = 1 AND `owner` = \'' . $user['id'] . '\' LIMIT 1'); $user_dress = mysql_fetch_array($ud_raw); $user_dress[6] = $bmfbron; $user_dress[7] = $bmfbron; $user_dress[8] = $bmfbron; $user_dress[9] = $bmfbron; $user_dress[6] += $user['ubron1']; $user_dress[7] += $user['ubron2']; $user_dress[8] += $user['ubron3']; $user_dress[9] += $user['ubron4']; $mykrit = $user_dress[2] + ($user['inta'] * 2.95); $myakrit = $user_dress[3] + ($user['inta'] * 2.75); $myuvorot = $user_dress[4] + ($user['lovk'] * 5); $myauvorot = $user_dress[5] + ($user['lovk'] * 4); $mf['me'] = array('udar' => (floor($user['sila'] / 3) + 1 + $user_dress[0]), 'maxudar' => (floor($user['sila'] / 3) + 4 + $user_dress[1])); if ($mf['me']['udar'] < 0) { $mf['me']['udar'] = 0; } $weap_b = 0; switch (GetWeaponType($user['weap'])) { case "noj": $weap_b += $user['noj']; break; case "dubina": $weap_b += $user['dubina']; break; case "topor": $weap_b += $user['topor']; break; case "mech": $weap_b += $user['mec']; break; } return array('minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]); } // одеть предмет function dressitem($id) { global $user; $item = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` AS `i` WHERE `duration` < `maxdur` AND `id` = '{$id}' AND `owner` = '{$user['id']}' AND `dressed` = 0 LIMIT 1")); switch ($item['type']) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; case 24: $slot1 = 'rune_1'; break; case 25: $slot1 = 'rune_2'; break; case 26: $slot1 = 'rune_3'; break; } 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'] == 24) { if (!$user['rune_1']) { $slot1 = 'rune_1'; } elseif (!$user['rune_2']) { $slot1 = 'rune_2'; } elseif (!$user['rune_3']) { $slot1 = 'rune_3'; } else { $slot1 = 'rune_1'; dropitem(24); } } 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']); } $al = '(1 = 1)'; if ($item['nalign'] > 0) { if ($item['nalign'] == 1.1) { if (($user['align'] == 6 || ($user['align'] > 1 && $user['align'] < 2))) { $al = '(1 = 1)'; } else { $al = '(1 = 2)'; } } } if (!($item['type'] == 12 && $user['level'] < 4)) { if (mysql_query("UPDATE `users` AS `u`, `inventory` AS `i` SET `u`.`{$slot1}` = {$id}, `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` = {$id} AND `i`.`dressed` = 0 AND `i`.owner = {$user['id']} 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 (($al OR (" . (int)$user['align'] . " = `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` = {$user['id']}")) $user[$slot1] = $item['id']; return true; } } function dressitemkomplekt($id, $idd) { global $user; $item = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = " . $user['id'] . " AND `dressed` = 0 AND `duration` < `maxdur` AND `id` = '" . $idd . "' LIMIT 1")); if (!isset($item['id'])) { $item = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = " . $user['id'] . " AND `dressed` = 0 AND `duration` < `maxdur` AND `name` = '" . $id . "' ORDER BY `duration` DESC LIMIT 1")); } switch ($item['type']) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; case 24: $slot1 = 'rune_1'; break; case 25: $slot1 = 'rune_2'; break; case 26: $slot1 = 'rune_3'; break; } if ($item['type'] == 5) { if ($user['r1'] == 0) { $slot1 = 'r1'; } elseif ($user['r2'] == 0) { $slot1 = 'r2'; } elseif ($user['r3'] == 0) { $slot1 = 'r3'; } else { $slot1 = 'r1'; dropitem(5); } } elseif ($item['type'] == 24) { if ($user['rune_1'] == 0) { $slot1 = 'rune_1'; } elseif ($user['rune_2'] == 0) { $slot1 = 'rune_2'; } elseif ($user['rune_3'] == 0) { $slot1 = 'rune_3'; } else { $slot1 = 'rune_1'; dropitem(24); } } elseif ($item['type'] == 12) { if ($user['m1'] == 0) { $slot1 = 'm1'; } elseif ($user['m2'] == 0) { $slot1 = 'm2'; } elseif ($user['m3'] == 0) { $slot1 = 'm3'; } elseif ($user['m4'] == 0) { $slot1 = 'm4'; } elseif ($user['m5'] == 0) { $slot1 = 'm5'; } elseif ($user['m6'] == 0) { $slot1 = 'm6'; } elseif ($user['m7'] == 0) { $slot1 = 'm7'; } elseif ($user['m8'] == 0) { $slot1 = 'm8'; } elseif ($user['m9'] == 0) { $slot1 = 'm9'; } elseif ($user['m10'] == 0) { $slot1 = 'm10'; } else { $slot1 = 'm1'; dropitem(12); } } else { dropitem($item['type']); } if (!($item['type'] == 12 && $user['level'] < 4)) { if (mysql_query("UPDATE `users` AS `u`, `inventory` AS `i` SET `u`.`{$slot1}` = `{$item['id']}`, `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`.`fkrit` = `u`.fkrit + i.mfkrit, `u`.`fakrit` = `u`.fakrit + i.mfakrit, `u`.`fuvorot` = `u`.fuvorot + i.mfuvorot, `u`.`fauvorot` = `u`.fauvorot + i.mfauvorot, `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`.`uminu` = `u`.uminu + i.minu, `u`.`umaxu` = `u`.umaxu + i.maxu WHERE `i`.`needident` = 0 AND `i`.`id` = {$item['id']} AND `i`.`dressed` = 0 AND `i`.`owner` = {$user['id']} AND ((('" . $user['align'] . "' > 7) AND ('" . $user['align'] . "' < 8)) OR ('" . (int)$user['align'] . "' = `i`.`nalign`) OR (`i`.`nalign` = 0)) AND `i`.`setsale` = 0 AND `u`.`id` = {$user['id']}")) { $user[$slot1] = $item['id']; return true; } } } // убить предмет function destructitem($id) { $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `id` = '{$id}' LIMIT 1;")); switch ($dress['type']) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; case 24: $slot1 = 'rune_1'; break; case 25: $slot1 = 'rune_2'; break; case 26: $slot1 = 'rune_3'; break; } if ($dress['type'] == 5) { if ($user['r1'] == $dress['id']) { $slot1 = 'r1'; } elseif ($user['r2'] == $dress['id']) { $slot1 = 'r2'; } elseif ($user['r3'] == $dress['id']) { $slot1 = 'r3'; } } elseif ($dress['type'] == 24) { if ($user['rune_1'] == $dress['id']) { $slot1 = 'rune_1'; } elseif ($user['rune_2'] == $dress['id']) { $slot1 = 'rune_2'; } elseif ($user['rune_3'] == $dress['id']) { $slot1 = 'rune_3'; } } elseif ($dress['type'] == 12) { if ($user['m1'] == $dress['id']) { $slot1 = 'm1'; } elseif ($user['m2'] == $dress['id']) { $slot1 = 'm2'; } elseif ($user['m3'] == $dress['id']) { $slot1 = 'm3'; } elseif ($user['m4'] == $dress['id']) { $slot1 = 'm4'; } elseif ($user['m5'] == $dress['id']) { $slot1 = 'm5'; } elseif ($user['m6'] == $dress['id']) { $slot1 = 'm6'; } elseif ($user['m7'] == $dress['id']) { $slot1 = 'm7'; } elseif ($user['m8'] == $dress['id']) { $slot1 = 'm8'; } elseif ($user['m9'] == $dress['id']) { $slot1 = 'm9'; } elseif ($user['m10'] == $dress['id']) { $slot1 = 'm10'; } } if (($dress['owner'] == $user['id'])) { mysql_query("DELETE FROM `inventory` WHERE `id` = '{$id}' LIMIT 1;"); //mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','Выброшен предмент {$dress['name']}. Цена:{$dress['cost']} кр.',1,'".time()."');"); //echo "Предмет \"{$dress['name']}\" утерян."; if ($dress['dressed'] == 1) { mysql_query("UPDATE `users` SET `" . $slot1 . "` = 0 WHERE `id` = '{$user['id']}';"); } } } // использовать магию function usemagic($id) { global $user; $row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `id` = '" . mysql_real_escape_string($id) . "' LIMIT 1")); $bat = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '{$user['battle']}' LIMIT 1")); $all_magic = unserialize($bat['magic']); $charge = 0; $magic = mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '" . $row['magic'] . "' LIMIT 1")); if ($magic['needcharge'] > 0) { $charge = $magic['needcharge']; } $incmagic = mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '" . $row['includemagic'] . "' LIMIT 1")); if ($incmagic['needcharge'] > 0) { $charge = $incmagic['needcharge']; } if (($all_magic[$user['id']] < 1) || ($charge == '0')) if ((($user['sila'] >= $row['nsila']) && ($user['lovk'] >= $row['nlovk']) && ($user['inta'] >= $row['ninta']) && ($user['vinos'] >= $row['nvinos']) && ($user['intel'] >= $row['nintel']) && ($user['level'] >= $row['nlevel']) && (($user['align'] > 7 && $user['align'] < 8) || ((int)$user['align'] == (int)$row['nalign']) || ($row['nalign'] == 0)) && ($user['noj'] >= $row['nnoj']) && ($user['topor'] >= $row['ntopor']) && ($user['dubina'] >= $row['ndubina']) && ($user['mec'] >= $row['nmech']) && ($row['type'] < 13 || $row['type'] == 50) && ($user['mfire'] >= $row['nfire']) && ($user['mwater'] >= $row['nwater']) && ($user['mair'] >= $row['nair']) && ($user['mearth'] >= $row['nearth']) && ($user['mlight'] >= $row['nlight']) && ($user['mgray'] >= $row['ngray']) && ($user['mdark'] >= $row['ndark']) && ($row['needident'] == 0) ) || $row['magic'] == 48 || $row['magic'] == 50) { if (!$row['magic']) { $incmagic['name'] = $row['includemagicname']; $incmagic['cur'] = $row['includemagicdex']; $incmagic['max'] = $row['includemagicmax']; if ($incmagic['cur'] <= 0) { return false; } $magic['targeted'] = $incmagic['targeted']; echo ""; include("magic/" . $incmagic['file']); echo ""; } else { echo ""; include("magic/" . $magic['file']); echo ""; } if ($bet) { if ($row['maxdur'] <= ($row['duration'] + 1)) { //echo ""; } else { if (!$row['magic']) { mysql_query("UPDATE `inventory` SET `includemagicdex` =`includemagicdex`-{$bet} WHERE `id` = {$row['id']} LIMIT 1;"); } else { mysql_query("UPDATE `inventory` SET `duration` =`duration`+{$bet} WHERE `id` = {$row['id']} LIMIT 1;"); } } if (!$charge) $charge = 0; //ограничение по кол-ву за ход if ($user['battle'] > 0) $bat = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id`='{$user['battle']}';")); if ($bat['magic'] == '') $all_magic = array(); else $all_magic = unserialize($bat['magic']); $all_magic[$user['id']] += $charge; mysql_query("UPDATE `battle` SET `magic`='" . serialize($all_magic) . "' WHERE `id`='{$user['battle']}';"); } } } function addch($text, $room = 0) { global $user; if ($room == 0) { $room = $user['room']; } if ($fp = @fopen("tmp/chat.txt", "a")) { //открытие flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА fputs($fp, ":[" . time() . "]:[!sys!!]:[" . ($text) . "]:[" . $room . "]\r\n"); //работа с файлом fflush($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ flock($fp, LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ fclose($fp); //закрытие } } function cavesys($text) { global $user; if ($fp = @fopen("tmp/chat.txt", "a")) { flock($fp, LOCK_EX); fputs($fp, ":[" . time() . "]:[!cavesys!!]:[$text]:[$user[caveleader]]\r\n"); fflush($fp); flock($fp, LOCK_UN); fclose($fp); } } function getchance($p) { if (mt_rand(1, 100) <= $p) { return 1; } else { return 0; } } function addchp($text, $who, $room = 0) { global $user; if ($room == 0) { $room = $user['room']; } $fp = fopen("tmp/chat.txt", "a"); //открытие flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА fputs($fp, ":[" . time() . "]:[{$who}]:[" . ($text) . "]:[" . $room . "]\r\n"); //работа с файлом fflush($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ flock($fp, LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ fclose($fp); //закрытие } function AddChatSystem($text) { $fp = fopen("tmp/chat.txt", "a"); flock($fp, LOCK_EX); fputs($fp, ":[" . time() . "]:[!sys2all!!]:[" . ($text) . "]:[1]\r\n"); fflush($fp); flock($fp, LOCK_UN); fclose($fp); } function err($t) { echo '' . $t . ''; return true; } // ставим травму function settravma($id, $type, $time = 86400, $kill = false) { $user = mysql_fetch_array(mysql_query("SELECT `align`, `level` FROM `users` WHERE `id` = '{$id}' LIMIT 1")); if ((($user['align'] == 2 && mt_rand(1, 100) > 20) && !$kill) || ($user['level'] == 0)) { return false; } else { $travmalist = array("разбитый нос", "сотрясение первой степени", "потрепанные уши", "прикушенный язык", "перелом переносицы", "растяжение ноги", "растяжение руки", "подбитый глаз", "синяк под глазом", "кровоточащее рассечение", "отбитая <пятая точка>", "заклинившая челюсть", "выбитый зуб <мудрости>", "косоглазие"); $travmalist2 = array("отбитые почки", "вывих <вырезано цензурой>", "сотрясение второй степени", "оторванное ухо", "вывих руки", "оторванные уши", "поврежденный позвоночник", "отбитые почки", "поврежденный копчик", "разрыв сухожилия", "перелом ребра", "перелом двух ребер", "вывих ноги", "сломанная челюсть"); $travmalist3 = array("пробитый череп", "разрыв селезенки", "смещение позвонков", "открытый перелом руки", "открытый перелом <вырезано цензурой>", "излом носоглотки", "непонятные, но множественные травмы", "сильное внутреннее кровотечение", "раздробленная коленная чашечка", "перелом шеи", "смещение позвонков", "открытый перелом ключицы", "перелом позвоночника", "вывих позвоночника", "сотрясение третьей степени"); $owntravma = mysql_fetch_array(mysql_query("SELECT `type`, `id`, `sila`, `lovk`, `inta`, `hp` FROM `effects` WHERE `owner` = " . $id . " AND (`type` = 11 OR `type` = 12 OR `type` = 13) ORDER BY `type` DESC LIMIT 1")); if ($type != 0 && $type != 100) { $owntravma['type'] = $type; } elseif ($type != 0 && $type == 100 && $owntravma['type'] == 0) { $type = mt_rand(1, 100); if ($type < 10) { $owntravma['type'] = 25; } elseif ($type < 60) { $owntravma['type'] = "set"; } elseif ($type < 85) { $owntravma['type'] = 11; } else { $owntravma['type'] = 12; } } elseif ($owntravma['type'] == 0) { $tr = mt_rand(1, 3); switch ($tr) { case 1: $owntravma['type'] = 0; break; case 2: $owntravma['type'] = 11; break; case 3: $owntravma['type'] = 12; break; } } switch ($owntravma['type']) { case 20: $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = ($user['level'] + $st) * 3; break; case 2: $l = ($user['level'] + $st) * 3; break; case 3: $i = ($user['level'] + $st) * 3; break; } $trv = $travmalist3[mt_rand(0, count($travmalist3) - 1)]; mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '13', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; case 0: $st = mt_rand(0, 2); $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = $user['level'] + $st; break; case 2: $l = $user['level'] + $st; break; case 3: $i = $user['level'] + $st; break; } $trv = $travmalist[mt_rand(0, count($travmalist) - 1)]; $time = 60 * 60 * mt_rand(1, 5); mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '11', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; case "set": $st = mt_rand(0, 2); $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = $user['level'] + $st; break; case 2: $l = $user['level'] + $st; break; case 3: $i = $user['level'] + $st; break; } $trv = $travmalist[mt_rand(0, count($travmalist) - 1)]; $time = 60 * 60 * mt_rand(1, 5); mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '11', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; case 11: $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = ($user['level']) * 2; break; case 2: $l = ($user['level']) * 2; break; case 3: $i = ($user['level']) * 2; break; } $trv = $travmalist2[mt_rand(0, count($travmalist2) - 1)]; $time = 60 * 60 * mt_rand(5, 15); mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '12', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; case 12: $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = ($user['level']) * 3; break; case 2: $l = ($user['level']) * 3; break; case 3: $i = ($user['level']) * 3; break; } $trv = $travmalist3[mt_rand(0, count($travmalist3) - 1)]; $time = 60 * 60 * mt_rand(15, 24); mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '13', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; case 13: $zz = mt_rand(1, 3); $s = 0; $l = 0; $i = 0; switch ($zz) { case 1: $s = ($user['level']) * 3; break; case 2: $l = ($user['level']) * 3; break; case 3: $i = ($user['level']) * 3; break; } $trv = $travmalist3[mt_rand(0, count($travmalist3) - 1)]; $time = 60 * 60 * mt_rand(25, 26); mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`, `sila`, `lovk`, `inta`, `vinos`) VALUES ('" . $id . "', 'Травма "" . $trv . ""', " . (time() + $time) . ", '14', '" . $s . "', '" . $l . "', '" . $i . "', '0')"); mysql_query("UPDATE `users` SET `sila` = (`sila`-'" . $s . "'), `lovk` = (`lovk`-'" . $l . "'), `inta` = (`inta`-'" . $i . "') WHERE `id` = '" . $id . "' LIMIT 1"); return $trv; break; } } } function deltravma($id) { $owntravmadb = mysql_query("SELECT `type`, `id`, `sila`, `lovk`, `inta`, `owner` FROM `effects` WHERE `id` = " . $id . " AND (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14)"); while ($owntravma = mysql_fetch_array($owntravmadb)) { mysql_query("DELETE FROM `effects` WHERE `id` = '" . $owntravma['id'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = (`sila`+'" . $owntravma['sila'] . "'), `lovk` = (`lovk`+'" . $owntravma['lovk'] . "'), `inta` = (`inta`+'" . $owntravma['inta'] . "') WHERE `id` = '" . $owntravma['owner'] . "' LIMIT 1"); } } // telegrafick function telegraph($to, $text) { //todo переписать, под логику, когда телеграф ВСЕГДА приходит на почту. global $user; $ur = mysql_fetch_array(mysql_query("select `id` from `users` WHERE `login` = '{$to}' LIMIT 1;")); $us = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$ur['id']}' LIMIT 1;")); if (!$ur) { echo "Персонаж не найден."; } elseif ($us[0]) { addchp(' (' . date("Y.m.d H:i") . ') Сообщение телеграфом от ' . nick7($user['id']) . ': ' . $text . ' ', '{[]}' . $to . '{[]}'); echo "Персонаж получил ваше сообщение"; } else { // если в офе echo "Сообщение будет доставлено, как только персонаж будет on-line."; mysql_query("INSERT INTO `telegraph` (`owner`,`date`,`text`) VALUES ('" . $ur['id'] . "','','" . '[' . date("d.m.Y H:i") . '] Сообщение по телеграфу от ' . nick7($user['id']) . ': ' . $text . ' ' . "');"); } } // telegrafick function tele_check($to, $text) { //todo проверить где используется и убрать, как дублирующую telegraph(). global $user; $ur = mysql_fetch_array(mysql_query("select `id` from `users` WHERE `login` = '{$to}' LIMIT 1;")); $us = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$ur['id']}' LIMIT 1;")); if (!$ur) { echo "Персонаж не найден."; } elseif ($us[0]) { addchp(' (' . date("Y.m.d H:i") . ') Сообщение телеграфом от ' . nick7($user['id']) . ': ' . $text . ' ', '{[]}' . $to . '{[]}'); } else { // если в офе mysql_query("INSERT INTO `telegraph` (`owner`,`date`,`text`) VALUES ('" . $ur['id'] . "','','" . '[' . date("d.m.Y H:i") . '] Сообщение по телеграфу от ' . nick7($user['id']) . ': ' . $text . ' ' . "');"); } } function get_meshok() { global $user; $d = mysql_fetch_array(mysql_query("SELECT SUM(`gmeshok`) FROM `inventory` WHERE `owner` = '{$user['id']}' AND `setsale` = 0 AND `gmeshok` > 0")); return ($user['sila'] * 4 + $d[0]); } function get_meshok_to($to) { $d = mysql_fetch_array(mysql_query("SELECT SUM(`gmeshok`) FROM `inventory` WHERE `owner` = '{$to}' AND `setsale` = 0 AND `gmeshok` > 0")); $s = mysql_fetch_array(mysql_query("SELECT `sila` FROM `users` WHERE `id` = '{$to}' LIMIT 1")); return ($s['sila'] * 4 + $d[0]); } function getweight($id) { return mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `weight`, COUNT(`id`) AS `cnt` FROM `inventory` WHERE `owner` = $id AND `dressed` = 0 AND `setsale` = 0")); } function addlog($id, $log) { $fp = fopen("backup/logs/battle" . $id . ".txt", "a"); flock($fp, LOCK_EX); fputs($fp, $log); fflush($fp); flock($fp, LOCK_UN); fclose($fp); unset($id, $log); } function max_mf() { $r = ''; $mfs = countmf(); if (($mfs['fkrit'] > $mfs['fakrit']) && ($mfs['fkrit'] > $mfs['fuvorot']) && ($mfs['fkrit'] > $mfs['fauvorot'])) { $r = 'fkrit'; } elseif (($mfs['fakrit'] > $mfs['fkrit']) && ($mfs['fakrit'] > $mfs['fuvorot']) && ($mfs['fakrit'] > $mfs['fauvorot'])) { $r = 'fakrit'; } elseif (($mfs['fuvorot'] > $mfs['fkrit']) && ($mfs['fuvorot'] > $mfs['fakrit']) && ($mfs['fuvorot'] > $mfs['fauvorot'])) { $r = 'fuvorot'; } elseif (($mfs['fauvorot'] > $mfs['fkrit']) && ($mfs['fauvorot'] > $mfs['fakrit']) && ($mfs['fauvorot'] > $mfs['fuvorot'])) { $r = 'fauvorot'; } return $r; } /// fixme заводить переменную равную нулю и целую функцию, чтобы прибавить к нулю значение? исправить! function sum_mf($u) { $t = 0; $r = mysql_fetch_array(mysql_query('SELECT SUM(`add_proc_mf`) AS `mf` FROM `inventory` WHERE `owner` = "' . $u . '" AND `dressed` = "1" AND `add_proc_mf` > 0')); $r = $t + $r['mf']; return $r; } function sum_dmg($u) { $t = 0; $r = mysql_fetch_array(mysql_query('SELECT SUM(`add_proc_uron`) AS `mf` FROM `inventory` WHERE `owner` = "' . $u . '" AND `dressed` = "1" AND `add_proc_uron` > 0')); $r = $t + $r['mf']; return $r; } function sum_bron($u) { $t = 0; $r = mysql_fetch_array(mysql_query('SELECT SUM(`add_proc_bron`) AS `mf` FROM `inventory` WHERE `owner` = "' . $u . '" AND `dressed` = "1" AND `add_proc_bron` > 0')); $r = $t + $r['mf']; return $r; } function bron_ads($a1, $a2, $a3, $a4, $col) { return array('a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col)); } function dressitem2($id) { global $user; $item = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `duration` < `maxdur` AND `id` = '{$id}' AND `dressed` = 0; ")); switch ($item['type']) { case 1: $slot1 = 'sergi'; break; case 2: $slot1 = 'kulon'; break; case 3: $slot1 = 'weap'; break; case 4: $slot1 = 'bron'; break; case 5: $slot1 = 'r1'; break; case 6: $slot1 = 'r2'; break; case 7: $slot1 = 'r3'; break; case 8: $slot1 = 'helm'; break; case 9: $slot1 = 'perchi'; break; case 10: $slot1 = 'shit'; break; case 11: $slot1 = 'boots'; break; case 12: $slot1 = 'm1'; break; case 22: $slot1 = 'rybax'; break; case 23: $slot1 = 'plaw'; break; } 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']); } //echo $slot1,$id,$user['id'],$user['align'],$item['id']; if (!($item['type'] == 12 && $user['level'] < 4)) { if (mysql_query("UPDATE `users` as u, `inventory` as i SET u.{$slot1} = {$id}, 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 WHERE i.needident = 0 AND i.id = {$id} AND i.dressed = 0 AND i.owner = {$user['id']} AND u.sila >= i.nsila AND u.lovk >= i.nlovk AND u.inta >= i.ninta AND u.vinos >= i.nvinos AND u.intel >= i.nintel AND u.mudra >= i.nmudra AND u.level >= i.nlevel AND (((" . $user['align'] . " > 7) AND (" . $user['align'] . " < 8)) OR (" . (int)$user['align'] . " = i.nalign) or (i.nalign = 0)) AND u.id = {$user['id']};")) { $user[$slot1] = $item['id']; return true; } } } function star_sign($month, $day) { $signs = ["10", "11", "12", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; $signsstart = [1 => 21, 2 => 20, 3 => 20, 4 => 20, 5 => 20, 6 => 20, 7 => 21, 8 => 22, 9 => 23, 10 => 23, 11 => 23, 12 => 23]; return $day < $signsstart[$month + 1] ? $signs[$month - 1] : $signs[$month % 12]; } function SolveExp($at_id, $def_id, $damage) { $mods = ['bloodb' => 1.2, 'btl_1' => 1, 'btl_2' => 0.5, 'btl_3' => 0.05]; $baseexp = ["0" => "2", "1" => "5", "2" => "10", "3" => "15", "4" => "30", "5" => "60", "6" => "90", "7" => "115", "8" => "300", "9" => "400", "10" => "500", "11" => "600", "12" => "700", "13" => "800", "14" => "900", "15" => "1000", "16" => "1100", "17" => "1200", "18" => "1300", "19" => "1400", "20" => "1500", "21" => "1600"]; if ($at_id > _BOTSEPARATOR_) { $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = "' . $at_id . '" LIMIT 1')); $at_id = $bots['prototype']; $bot_active = true; } $at = db::c()->query('SELECT `level` FROM `users` WHERE `id` = ?i', $at_id)->fetch_assoc(); $def = db::c()->query('SELECT `level` FROM `users` WHERE `id` = ?i', $def_id)->fetch_assoc(); $at_cost = mysql_fetch_array(mysql_query("SELECT 1+IFNULL((SELECT SUM(`cost`) FROM `inventory` WHERE `owner` = `users`.`id` AND `dressed` = 1), 0), `align` FROM `users` WHERE `id` = '" . $at_id . "' LIMIT 1")); $def_cost = mysql_fetch_array(mysql_query("SELECT 1+IFNULL((SELECT SUM(`cost`) FROM `inventory` WHERE `owner` = `users`.`id` AND `dressed` = 1), 0), `align` FROM `users` WHERE `id` = '" . $def_id . "' LIMIT 1")); if ($at_id > _BOTSEPARATOR_) { $bat_raw = mysql_fetch_array(mysql_query("SELECT `battle` FROM `bots` WHERE `id` = '$at_id' LIMIT 1")); } else { $bat_raw = mysql_fetch_array(mysql_query("SELECT `battle` FROM `users` WHERE `id` = '$at_id' LIMIT 1")); } $bat = $bat_raw['battle']; $bt = db::c()->query('SELECT `blood`,`type`,`t1`,`t2` FROM `battle` WHERE `id` = ?i', $bat)->fetch_assoc(); if ($def_id > _BOTSEPARATOR_) { $bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = "' . $def_id . '" LIMIT 1')); $def_id = $bots['prototype']; $bot_def = true; } if ($bt['blood']) { $expmf = $mods['bloodb']; } $filebtl = '/tmp/' . $at_id . '.btl'; if ($bt['type'] == 1 && file_exists($filebtl)) { $btfl = fopen($filebtl, 'r'); $contents = fread($btfl, filesize($filebtl)); fclose($btfl); $cnt = substr_count($contents, $def_id); $exmod = 1; if ($cnt <= 1) { $exmod = $mods['btl_1']; } elseif ($cnt == 2) { $exmod = $mods['btl_2']; } elseif ($cnt > 2) { $exmod = $mods['btl_3']; } $expmf = $expmf * $exmod; } $standart = [ "0" => 1, "1" => 1, "2" => 15, "3" => 111, "4" => 265, "5" => 526, "6" => 882, "7" => 919, "8" => 919, "9" => 919, "10" => 919, "11" => 919, "12" => 919, "13" => 919, "14" => 919, "15" => 919, "16" => 919, "17" => 919, "18" => 919, "19" => 919, "20" => 919, "21" => 919, "22" => 919, "23" => 919, "24" => 919, "25" => 919]; $mfit = ($at_cost[0] / ($standart[$at['level']] / 3)); if ($mfit < 0.8) { $mfit = 0.8; } if ($mfit > 1.5) { $mfit = 1.5; } $pls = count(explode(";", $bt['t1'])) + count(explode(";", $bt['t2'])); if ($pls > 2) { $mfbot = $bot_active == true ? 0.3 : 1; $mfbot2 = $bot_def == true ? 0.7 : 1; } else { $mfbot = 1; $mfbot2 = 1; } if ($expmf == 0) { $expmf = 1; } $result = ($baseexp[$def['level']]) * ($def_cost[0] / (($at_cost[0] + $def_cost[0]) / 2)) * ($damage / $def['maxhp']) * $expmf * $mfit * $mfbot * $mfbot2; $result = $result / 3; $result = round($result, 0); return $result; } function vCode($LocID, $Stamp) { return md5(sha1($LocID . $Stamp)); } ?>