diff --git a/_incl_data/class/Battle.php b/_incl_data/class/Battle.php index fb2cf00c..e97faaa0 100644 --- a/_incl_data/class/Battle.php +++ b/_incl_data/class/Battle.php @@ -2667,18 +2667,20 @@ class Battle if ($this->info['money'] > 0) { if (isset($gm[$i])) { $prc .= ' Вы выйграли ' . $gm[$i] . ' кр. за этот бой.'; - $u->addDelo( - 4, $this->users[$i]['id'], - '"System.battle": Персонаж выйграл ' . $gm[$i] . ' кр. (В бою №' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$i]['id'], + '"System.battle": Персонаж выйграл ' . $gm[$i] . ' кр. (В бою №' . $this->info['id'] . ').', ); $this->users[$i]['money'] += $gm[$i]; } elseif (isset($bm[$i])) { $prc .= ' Вы заплатили ' . $bm[$i] . ' кр. за этот бой.'; - $u->addDelo( - 4, $this->users[$i]['id'], - '"System.battle": Персонаж проиграл ' . $gm[$i] . ' кр. (В бою №' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$i]['id'], + '"System.battle": Персонаж проиграл ' . $gm[$i] . ' кр. (В бою №' . $this->info['id'] . ').', ); $this->users[$i]['money'] -= $bm[$i]; } @@ -2758,10 +2760,11 @@ class Battle if ($this->info['type'] != 33) { $prc .= ', Награда ' . $admn . ' ЕКР за этот бой.'; } - $u->addDelo( - 4, $this->users[$i]['id'], - '"System.battle": Персонаж получил ' . $admn . ' ЕКР (В бою №' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$i]['id'], + '"System.battle": Персонаж получил ' . $admn . ' ЕКР (В бою №' . $this->info['id'] . ').', ); $this->users[$i]['money2'] += $admn; } @@ -2770,10 +2773,11 @@ class Battle if ($this->info['money3'] > 0) { if (isset($gms[$i])) { $prc .= ' Вы выйграли ' . $gms[$i] . ' $. за этот бой.'; - $u->addDelo( - 4, $this->users[$i]['id'], - '"System.battle": Персонаж выйграл ' . $gms[$i] . ' $. (В бою №' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$i]['id'], + '"System.battle": Персонаж выйграл ' . $gms[$i] . ' $. (В бою №' . $this->info['id'] . ').', ); $this->users[$i]['money3'] += $gms[$i]; mysql_query( @@ -2781,10 +2785,11 @@ class Battle ); } elseif (isset($bms[$i])) { $prc .= ' Вы заплатили ' . $bms[$i] . ' $. за этот бой.'; - $u->addDelo( - 4, $this->users[$i]['id'], - '"System.battle": Персонаж проиграл ' . $gms[$i] . ' $. (В бою №' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$i]['id'], + '"System.battle": Персонаж проиграл ' . $gms[$i] . ' $. (В бою №' . $this->info['id'] . ').', ); $this->users[$i]['money3'] -= $bms[$i]; mysql_query( @@ -3796,18 +3801,20 @@ class Battle if (!$resulttp) { $cmsg->setText("Трупожор был пуст!"); $chat->sendMsg($cmsg); - $u->addDelo( - 4, $this->users[$this->uids[$uid]]['id'], - '"System.battle": (В бою трупожор), ПУСТ!!! ', time(), - $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$this->uids[$uid]]['id'], + '"System.battle": (В бою трупожор), ПУСТ!!! ', ); } else { $cmsg->setText("Вы получили еврокредиты: $ecr екр."); $chat->sendMsg($cmsg); - $u->addDelo( - 4, $this->users[$this->uids[$uid]]['id'], - '"System.battle": Персонаж получил ' . $ecr . ' ЕКР (В бою трупожор), сейчас: ' . $this->users[$this->uids[$uid]]['money2'] . ' ЕКР', - time(), $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0 + Delo::add( + 4, + 'System.battle', + $this->users[$this->uids[$uid]]['id'], + '"System.battle": Персонаж получил ' . $ecr . ' ЕКР (В бою трупожор), сейчас: ' . $this->users[$this->uids[$uid]]['money2'] . ' ЕКР', ); } } diff --git a/_incl_data/class/Clan/ItemStorage.php b/_incl_data/class/Clan/ItemStorage.php index 5d8380d6..4e0ba0aa 100644 --- a/_incl_data/class/Clan/ItemStorage.php +++ b/_incl_data/class/Clan/ItemStorage.php @@ -3,6 +3,7 @@ namespace Clan; use Core\Db; +use Delo; use Helper\Conversion; use User; use User\ItemsModel; @@ -27,15 +28,11 @@ class ItemStorage if (!isset($idata['toclan'])) { $idata['toclan'] = $user['clan'] . '#' . $user['id']; $item['data'] = Conversion::arrayToDataString($idata); - User::start()->addDelo( + Delo::add( 2, + 'System.transfer.clan', $user['id'], '"System.transfer.MONEY": Предмет "' . $item['name'] . '" (#id : "' . $itemId . '") (x' . $col . ') был пожертвован клану "' . $clanName . '" (' . $clanId . ').', - time(), - $user['city'], - 'System.transfer.clan', - 0, - 0 ); $sendType = 4; } else { diff --git a/_incl_data/class/Delo.php b/_incl_data/class/Delo.php index 4bf816f8..2d81984f 100644 --- a/_incl_data/class/Delo.php +++ b/_incl_data/class/Delo.php @@ -7,18 +7,19 @@ class Delo { /** * Запись в личное дело персонажа. - * @param int $uid кому пишется - * @param string $text текст - * @param string $from отправитель записи - * @param float $moneyOut количество денег снятых с игрока - * @param int $type цифровой тип лога (??) + * @param int $type цифровой тип лога (??) + * @param string $from отправитель записи + * @param int $uid кому пишется + * @param string $text текст + * @param float $moneyOut количество денег снятых с игрока + * @param float $moneyIn количество денег полученных игроком * @return void */ - public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0): void + public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0, float $moneyIn = 0): void { - $sql = 'insert into users_delo (uid, time, text, login, `delete`, no_right, ip, moneyOut, type) values (?,unix_timestamp(),?,?,0,?,?,?,?)'; + $sql = 'insert into users_delo (uid, time, text, login, `delete`, no_right, ip, moneyOut, moneyIn, type) values (?,unix_timestamp(),?,?,0,?,?,?,?,?)'; Db::sql($sql, [ - $uid, $text, $from, '', UserIp::get(), $moneyOut, $type, + $uid, $text, $from, '', UserIp::get(), $moneyOut, $moneyIn, $type, ]); } diff --git a/_incl_data/class/Dialog.php b/_incl_data/class/Dialog.php index b0d07fd0..68560ee6 100644 --- a/_incl_data/class/Dialog.php +++ b/_incl_data/class/Dialog.php @@ -1,5 +1,8 @@ info['id'], '|nodelete=1'); + ItemsModel::addItem($act1[8], $u->info['id'], '|nodelete=1'); $txt .= '
Вы получили предмет "' . $itmb['name'] . '"'; } } @@ -229,16 +232,16 @@ class Dialog $txt .= ' за ' . $act1[2] . ' екр.'; } if ($act1[3] > 0) { - $txt .= ' на срок ' . $u->timeOut($act1[3]) . ''; - $act1dt .= '|srok=' . $act1[3] . ''; + $txt .= ' на срок ' . Conversion::secondsToTimeout($act1[3]); + $act1dt .= '|srok=' . $act1[3]; } $txt .= ''; - \User\ItemsModel::addItem($itmb['id'], $u->info['id'], $act1dt); + ItemsModel::addItem($itmb['id'], $u->info['id'], $act1dt); $pg = $act1[4]; } } else { - $txt .= '
Неудалось приобрести предмет...'; + $txt .= '
Неудалось приобрести предмет...'; $pg = 1; } } elseif ($act1[0] == 'quest') { @@ -263,7 +266,7 @@ class Dialog } $ic2 = 1; while ($ic2 <= $act3[2]) { - \User\ItemsModel::addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]); + ItemsModel::addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]); $ic2++; } } @@ -393,7 +396,7 @@ class Dialog if ($upd) { if ($itik > 0) { //Выдаем предметы - \User\ItemsModel::addItem($itik, $u->info['id'], '|nosale=1|srok=' . (7 * 86400) . '', null, 1); + ItemsModel::addItem($itik, $u->info['id'], '|nosale=1|srok=' . (7 * 86400) . '', null, 1); $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itik . '" LIMIT 1')); $txt = 'Вы получили предмет "' . $itm_nm['name'] . '"'; } else { @@ -413,7 +416,7 @@ class Dialog } $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; if ($arts_1 > 0) { - \User\ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); + ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); } $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1')); @@ -433,7 +436,7 @@ class Dialog } $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; if ($arts_1 > 0) { - \User\ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); + ItemsModel::addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100); } $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1')); @@ -523,7 +526,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -569,7 +572,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -615,7 +618,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i]['add'][1] . ' x' . $t[0] . '
'; @@ -647,7 +650,7 @@ class Dialog if (isset($keypr1['id'], $keypr2['id'])) { mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr1['id'] . '" OR `id` = "' . $keypr2['id'] . '" LIMIT 2'); $data = '|frompisher=' . $d->info['id2']; - \User\ItemsModel::addItem(2555, $u->info['id'], $data); + ItemsModel::addItem(2555, $u->info['id'], $data); $txt = 'Вы успешно получили "Пирамидальный ключ"'; } @@ -690,7 +693,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr['id'] . '" LIMIT 1'); @@ -746,7 +749,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $keypr['id'] . '" LIMIT 1'); @@ -802,7 +805,7 @@ class Dialog $data = '|frompisher=' . $d->info['id2']; $e = 1; while ($e <= $t[0]) { - \User\ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); + ItemsModel::addItem($cn[$i][$j]['add'][0], $u->info['id'], $data); $e++; } $txt .= $cn[$i][$j]['n'] . ' x' . ($t[0] * $this->objLevel($cn[$i][$j], $u->info['level'])) . ' = ' . $cn[$i][$j]['add'][1] . ' x' . $t[0] . '
'; @@ -957,7 +960,7 @@ class Dialog $qsw = 0; while ($qsw < $item['colvo']) { $txt .= '
Вы получили предмет'; - \User\ItemsModel::addItem($item['item_id'], $u->info['id']); + ItemsModel::addItem($item['item_id'], $u->info['id']); $qsw++; } } @@ -1214,7 +1217,7 @@ class Dialog $val = 4799; } } - \User\ItemsModel::addItem($val, $u->info['id'], $data_itm); + ItemsModel::addItem($val, $u->info['id'], $data_itm); $i1++; } } elseif ($var == 'up') { diff --git a/_incl_data/class/Dungeon.php b/_incl_data/class/Dungeon.php index 4b81b7a0..8c3c8204 100644 --- a/_incl_data/class/Dungeon.php +++ b/_incl_data/class/Dungeon.php @@ -1050,7 +1050,7 @@ class Dungeon ); if (isset($it['id'])) { $r .= 'Вы обнаружили предмет "' . $it['name'] . '".
'; - $this->addItem( + ItemsModel::addItem( ['uid' => $this->userinfo['id'], 'iid' => $it['id'], 'x' => $this->userinfo['x'], 'y' => $this->userinfo['y'], 'del' => (int)$itm[4]] ); } @@ -1099,7 +1099,7 @@ class Dungeon $u->addAction( time(), 'takeit_' . $this->info['id'] . '_' . $obj['id'], $this->userinfo['city'] ); - $this->addItem( + ItemsModel::addItem( ['uid' => $this->userinfo['id'], 'iid' => $it['id'], 'x' => $this->userinfo['x'], 'y' => $this->userinfo['y'], 'del' => (int)$itm[4]] ); $nj++; @@ -1147,7 +1147,7 @@ class Dungeon $u->addAction( time(), 'takeit_' . $this->info['id'] . '_' . $obj['id'], $this->userinfo['city'] ); - $this->addItem( + ItemsModel::addItem( ['uid' => $this->userinfo['id'], 'iid' => $it['id'], 'x' => $this->userinfo['x'], 'y' => $this->userinfo['y'], 'del' => (int)$itm[4]] ); $nj++; diff --git a/_incl_data/class/Location/DeathTower.php b/_incl_data/class/Location/DeathTower.php index e67cc122..6838ecf1 100644 --- a/_incl_data/class/Location/DeathTower.php +++ b/_incl_data/class/Location/DeathTower.php @@ -4,6 +4,7 @@ namespace Location; use Chat; use ChatMessage; +use Delo; use User; class DeathTower @@ -12,7 +13,7 @@ class DeathTower { $user = User::start(); if ($bu) { - /* */ + /* � ���� ��� ��������� ������ */ $i = 0; while ($i < count($bu[$i])) { if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) { @@ -22,7 +23,7 @@ class DeathTower mysql_query( 'UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "' . $id['id'] . '" LIMIT 1' ); - /* */ + /* ������� ����� */ if ($bu['inBot'] == 0) { $pls1 = mysql_fetch_array( mysql_query( @@ -33,7 +34,7 @@ class DeathTower mysql_query('DELETE FROM `users` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); - // + //���������� �������� �� ����� $spi = mysql_query( 'SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $bu[$i]['id'] . '" LIMIT 500' ); @@ -88,9 +89,9 @@ class DeathTower $chat = new Chat(); $cmsg = new ChatMessage(); - /* */ + /* ��������� �� */ if (isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) { - // + //���� ���������� $bsep = 0; if ($winr['level'] < 6) { $bsep = 2500; @@ -103,7 +104,7 @@ class DeathTower } else { $bsep = 50000; } - /* */ + /* ������ ���� */ $mn = (round($id['money'] / 100 * 85)); mysql_query( 'UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' @@ -111,10 +112,10 @@ class DeathTower mysql_query( 'UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1' ); - /* */ + /* ��� */ $cmsg->setTo($winr['login']); $cmsg->setText( - "! " "! : $bsep, : $mn ." + "�����������! �� �������� � ������� "����� ������"! �������� �����: $bsep, ������: $mn ��." ); $cmsg->setType(6); $chat->sendMsg($cmsg); @@ -122,21 +123,23 @@ class DeathTower $cmsg->setTo(''); $cmsg->setIsAlert(true); $cmsg->setText( - " " ", : {$winr['login']}! !" + "���������� ������ "����� ������", ���������� �������: {$winr['login']}! �����������!" ); $cmsg->setType(5); $chat->sendMsg($cmsg); - $user->addDelo( - 1, $uid, - '"WinTournament.' . $user->info['city'] . '" ( ): "' . $mn . ' ."', - time(), $user->info['city'], 'WinTournament.' . $user->info['city'], 0, 0 + Delo::add( + 1, + 'WinTournament.' . $user->info['city'], + $uid, + '"WinTournament.' . $user->info['city'] . '" (����� ������): �������� "' . $mn . ' ��."', ); + } else { - /* */ + /* ��� */ $cmsg->setIsAlert(true); $cmsg->setType(5); - $cmsg->setText(' , : .'); + $cmsg->setText('���������� ������ ������ ������, ���������� �������: �����������.'); } $sp = mysql_query( diff --git a/_incl_data/class/Magic.php b/_incl_data/class/Magic.php index 99e3d34b..51c57914 100644 --- a/_incl_data/class/Magic.php +++ b/_incl_data/class/Magic.php @@ -91,12 +91,12 @@ class Magic mysql_query( 'UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1' ); - $u->addDelo( - 1, $u->info['id'], - '"System.inventory":(КАСТ СГОРЕЛ) Персонаж использовал "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory":(КАСТ СГОРЕЛ) Персонаж использовал "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', ); - } elseif (isset($st['usefromfile'])) { //используем заклятие @@ -249,10 +249,11 @@ class Magic mysql_query( 'UPDATE `stats` SET `hpNow` = "' . $u->info['hpNow'] . '", `mpNow` = "' . $u->info['mpNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (+' . $use['moment_hp'] . ' HP) [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (+' . $use['moment_hp'] . ' HP) [itm:' . $itm['id'] . '].', ); $this->youuse++; $u->error = 'Вы успешно использовали эликсир "' . $itm['name'] . '"
' . $u->error . ''; @@ -303,10 +304,11 @@ class Magic mysql_query( 'UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1' ); - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', ); $this->youuse++; $u->error = 'Вы успешно использовали эликсир "' . $itm['name'] . '"
' . $us[1] . ''; @@ -1418,22 +1420,26 @@ class Magic ); } if ($u->info['id'] != $usr['id']) { - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа "' . $usr['login'] . '" (id' . $usr['id'] . ') [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа "' . $usr['login'] . '" (id' . $usr['id'] . ') [itm:' . $itm['id'] . '].', ); - $u->addDelo( - 1, $usr['id'], - '"System.inventory": Персонаж "' . $u->info['login'] . '" (id' . $u->info['id'] . ') использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа [itm:' . $itm['id'] . '].', - time(), $usr['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $usr['id'], + '"System.inventory": Персонаж "' . $u->info['login'] . '" (id' . $u->info['id'] . ') использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа [itm:' . $itm['id'] . '].', ); + $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '" на персонажа "' . $usr['login'] . '"
' . $us[1] . ''; } else { - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа самого себя [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа самого себя [itm:' . $itm['id'] . '].', ); $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '" на самого себя
' . $us[1] . ''; @@ -1566,7 +1572,7 @@ class Magic } } else { - $u->error = 'Задержка использования ' . $u->timeOut( + $u->error = 'Задержка использования ' . Conversion::secondsToTimeout( ($sz['time'] + 4 * 60 * 60) - time() ) . '.'; } @@ -1606,7 +1612,7 @@ class Magic ); $u->addAction(time(), 'sanich1', $u->info['battle']); } else { - $u->error = 'Задержка использования ' . $u->timeOut(($sz['time'] + 6 * 60) - time()) . '.'; + $u->error = 'Задержка использования ' . Conversion::secondsToTimeout(($sz['time'] + 6 * 60) - time()) . '.'; } } elseif ($itm['magic_inci'] == 'sanich3' && $u->info['battle'] > 0) { @@ -1654,7 +1660,7 @@ class Magic } } else { - $u->error = 'Задержка использования ' . $u->timeOut( + $u->error = 'Задержка использования ' . Conversion::secondsToTimeout( ($sz['time'] + 3 * 60 * 60) - time() ) . '.'; } @@ -1950,10 +1956,11 @@ class Magic 'UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); } - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', ); } else { $u->error = 'Не удалось использовать "' . $itm['name'] . '", что-то здесь не так ...'; @@ -1974,10 +1981,11 @@ class Magic 'UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); } - $u->addDelo( - 1, $u->info['id'], - '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', - time(), $u->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', ); $this->youuse++; $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '"
' . $us[1] . ''; diff --git a/_incl_data/class/Magic/396.php b/_incl_data/class/Magic/396.php index 1ed214a7..56da2e81 100644 --- a/_incl_data/class/Magic/396.php +++ b/_incl_data/class/Magic/396.php @@ -1,56 +1,24 @@ info['id'].'" AND `id_eff` = 396 LIMIT 1')); - if(isset($eff['id'])) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"'); - $this->add_eff($u->info['id'],$itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } else { - $this->add_eff($u->info['id'], $itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } -} elseif($itm['magic_inci'] == 397) { - $eff = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 397 LIMIT 1')); - if(isset($eff['id'])) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"'); - $this->add_eff($u->info['id'],$itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } else { - $this->add_eff($u->info['id'], $itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } -} elseif($itm['magic_inci'] == 398) { - $eff = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 398 LIMIT 1')); - if(isset($eff['id'])) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"'); - $this->add_eff($u->info['id'],$itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } else { - $this->add_eff($u->info['id'], $itm['magic_inc']); - $u->addDelo(1,$u->info['id'], '"System.inventory": Персонаж использовал эликсир "'.$itm['name'].'" ('.$u->info['id'].') [itm:'.$itm['id'].'].',time(), $u->info['city'], 'System.inventory', 0, 0); - $itm['iznosNOW']++; - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы успешно использовали эликсир "'.$itm['name'].'"'; - } -} +if (in_array($itm['magic_inci'], [396, 397, 398])) { + $eff = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = '. $itm['magic_inci'] .' LIMIT 1')); -?> \ No newline at end of file + if (isset($eff['id'])) { + mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"'); + } + $this->add_eff($u->info['id'], $itm['magic_inc']); + + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (' . $u->info['id'] . ') [itm:' . $itm['id'] . '].', + ); + + $itm['iznosNOW']++; + mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = ' . $itm['id']); + $u->error = 'Вы успешно использовали эликсир "' . $itm['name'] . '"'; +} diff --git a/_incl_data/class/Magic/addsnowball.php b/_incl_data/class/Magic/addsnowball.php index 921b0c32..62801a9a 100644 --- a/_incl_data/class/Magic/addsnowball.php +++ b/_incl_data/class/Magic/addsnowball.php @@ -1,9 +1,7 @@ addItem(1000,$this->info['id']); -?> \ No newline at end of file +ItemsModel::addItem(1000, $this->info['id']); diff --git a/_incl_data/class/Magic/antipropuskpsh.php b/_incl_data/class/Magic/antipropuskpsh.php index 61f9f782..be198367 100644 --- a/_incl_data/class/Magic/antipropuskpsh.php +++ b/_incl_data/class/Magic/antipropuskpsh.php @@ -1,61 +1,50 @@ "'.time().'" LIMIT 1')); - if(!isset($usr['id']) || $usr['room'] != $u->info['room']) { - $u->error = 'Неудалось найти персонажа "'.htmlspecialchars($_GET['login']).'" или он в другой комнате.'; - }elseif( $usr['admin'] > 0 || ($usr['align'] > 3 && $usr['align'] < 4) || ($usr['align'] > 1 && $usr['align'] < 2)) { - $u->error = 'Не удалось использовать "'.htmlspecialchars($_GET['login']).'" под защитой.'; - }elseif( $u->info['align'] != 2 ) { - if ($u->info['money']>100) - { - - if( !isset($test['id']) ) { - $u->addAction( time()+300 ,'psh0',$usr['id'],$usr['id']); - $test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "'.$usr['id'].'" AND `vars` = "psh0" AND `time` > "'.time().'" LIMIT 1')); - } - $u->addAction(time(),'propuskpsh','',$usr['id']); - $u->error = 'Все прошло успешно, задержки в пещеры увеличены на 24 часа для "'.$usr['login'].'".'; - $u->addDelo(4,$usr['id'],'"System.magic": На персонажа применил магию Клаустрофобия '.$u->info['login'],time(),$usr['id'],'System.magic',0,0); - $u->info['money'] = $u->info['money'] - 100; - mysql_query('UPDATE `users` SET `money` = `money` -100 WHERE `id` = '.$u->info['id'].' LIMIT 1'); - /*if($test['time'] < time()) { - $test['time'] = time(); - } - $test['time'] += 86400;*/ - $test['time'] = time() + 86400; - - - mysql_query('UPDATE `actions` SET `time` = "'.$test['time'].'" WHERE `uid` = '.$usr['id'].' AND `id` = "'.$test['id'].'" LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "'.$usr['id'].'" LIMIT 1')); - if(isset($eff['id'])) - { - mysql_query('DELETE FROM `eff_users` WHERE `id` = '.$eff['id'].' AND `id_eff` = 476'); - $this->add_eff($usr['id'],476); - mysql_query('UPDATE `eff_users` SET `name` = "Клаустрофобия «'.$u->info['login'].'»" WHERE `uid` = '.$usr['id'].' AND `uid` = "'.$usr['id'].'" AND `delete` = 0 AND `id_eff`= "476" LIMIT 1'); - } - else - { - $this->add_eff($usr['id'],476); - mysql_query('UPDATE `eff_users` SET `name` = "Клаустрофобия «'.$u->info['login'].'»" WHERE `uid` = '.$usr['id'].' AND `uid` = "'.$usr['id'].'" AND `delete` = 0 AND `id_eff`= "476" LIMIT 1'); - } - } - else - { - $u->error = 'У Вас недостаточно кр! Применение стоит 100кр.'; - } - - }else{ - $u->error = 'Хаосники не могут пользоваться этим свитком!'; - } +if ($itm['magic_inci'] != 'antipropuskpsh') { + return; +} + +$test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "' . $usr['id'] . '" AND `vars` = "psh0" AND `time` > "' . time() . '" LIMIT 1')); +if (!isset($usr['id']) || $usr['room'] != $u->info['room']) { + $u->error = 'Неудалось найти персонажа "' . htmlspecialchars($_GET['login']) . '" или он в другой комнате.'; +} elseif ($usr['admin'] > 0 || ($usr['align'] > 3 && $usr['align'] < 4) || ($usr['align'] > 1 && $usr['align'] < 2)) { + $u->error = 'Не удалось использовать "' . htmlspecialchars($_GET['login']) . '" под защитой.'; +} elseif ($u->info['align'] != 2) { + if ($u->info['money'] > 100) { + if (!isset($test['id'])) { + $u->addAction(time() + 300, 'psh0', $usr['id'], $usr['id']); + $test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "' . $usr['id'] . '" AND `vars` = "psh0" AND `time` > "' . time() . '" LIMIT 1')); + } + $u->addAction(time(), 'propuskpsh', '', $usr['id']); + $u->error = 'Все прошло успешно, задержки в пещеры увеличены на 24 часа для "' . $usr['login'] . '".'; + Delo::add( + 4, + 'System.magic', + $usr['id'], + '"System.magic": На персонажа применил магию Клаустрофобия ' . $u->info['login'], + ); + $u->info['money'] = $u->info['money'] - 100; + mysql_query('UPDATE `users` SET `money` = `money` -100 WHERE `id` = ' . $u->info['id'] . ' LIMIT 1'); + + $test['time'] = time() + 86400; + + mysql_query('UPDATE `actions` SET `time` = "' . $test['time'] . '" WHERE `uid` = ' . $usr['id'] . ' AND `id` = "' . $test['id'] . '" LIMIT 1'); + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); + + $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "' . $usr['id'] . '" LIMIT 1')); + if (isset($eff['id'])) { + mysql_query('DELETE FROM `eff_users` WHERE `id` = ' . $eff['id'] . ' AND `id_eff` = 476'); + } + $this->add_eff($usr['id'], 476); + mysql_query( + 'UPDATE `eff_users` SET `name` = "Клаустрофобия «' . $u->info['login'] . '»" WHERE `uid` = ' . $usr['id'] . ' AND `uid` = "' . $usr['id'] . '" AND `delete` = 0 AND `id_eff`= "476" LIMIT 1' + ); + } else { + $u->error = 'У Вас недостаточно кр! Применение стоит 100кр.'; + } +} else { + $u->error = 'Хаосники не могут пользоваться этим свитком!'; } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/hny2012.php b/_incl_data/class/Magic/hny2012.php index 2ac5c6f9..703e251b 100644 --- a/_incl_data/class/Magic/hny2012.php +++ b/_incl_data/class/Magic/hny2012.php @@ -1,4 +1,7 @@ info['id'] == 1) { 7. Новогодний Эликсир */ //Снежок 0/13 (x1) - $idit = \User\ItemsModel::addItem(1000,$u->info['id']); + $idit = ItemsModel::addItem(1000,$u->info['id']); if($idit > 0) { mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Новогодний эликсир (x1) - $idit = \User\ItemsModel::addItem(997,$u->info['id']); + $idit = ItemsModel::addItem(997,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Новогодний эликсир (x1) - $idit = \User\ItemsModel::addItem(2870,$u->info['id']); + $idit = ItemsModel::addItem(2870,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Звездное сияние (x1) - $idit = \User\ItemsModel::addItem(1462,$u->info['id']); + $idit = ItemsModel::addItem(1462,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1'); //Открытка (x1) - $idit = \User\ItemsModel::addItem(996,$u->info['id']); + $idit = ItemsModel::addItem(996,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2013, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1'); //Нападалка 0/13 (x1) - $idit = \User\ItemsModel::addItem(874,$u->info['id']); + $idit = ItemsModel::addItem(874,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Кольцо жизни (x1) - $idit = \User\ItemsModel::addItem(2101,$u->info['id'],'|noremont=1|srok=1209600|sudba='.$u->info['login']); + $idit = ItemsModel::addItem(2101,$u->info['id'],'|noremont=1|srok=1209600|sudba='.$u->info['login']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1'); //Восстановление Энергии 900НР (x3) - $idit = \User\ItemsModel::addItem(2710,$u->info['id']); + $idit = ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); - $idit = \User\ItemsModel::addItem(2710,$u->info['id']); + $idit = ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); - $idit = \User\ItemsModel::addItem(2710,$u->info['id']); + $idit = ItemsModel::addItem(2710,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1'); $u->error = 'Вы успешно использовали "'.$itm['name'].'". В инвентарь добавлены подарки. С Новым, 2013, Годом!'; diff --git a/_incl_data/class/Magic/hny2014.php b/_incl_data/class/Magic/hny2014.php index 973039cb..16df8edf 100644 --- a/_incl_data/class/Magic/hny2014.php +++ b/_incl_data/class/Magic/hny2014.php @@ -1,4 +1,7 @@ info['id']); + $idit = ItemsModel::addItem(5009,$u->info['id']); if($idit > 0) { mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //мастера - $idit = \User\ItemsModel::addItem(4041,$u->info['id']); + $idit = ItemsModel::addItem(4041,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //искуства - $idit = \User\ItemsModel::addItem(4948,$u->info['id']); + $idit = ItemsModel::addItem(4948,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1'); //жж6 - $idit = \User\ItemsModel::addItem(3101,$u->info['id']); + $idit = ItemsModel::addItem(3101,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "5" WHERE `id` = "'.$idit.'" LIMIT 1'); //Открытка (x1) - $idit = \User\ItemsModel::addItem(996,$u->info['id']); + $idit = ItemsModel::addItem(996,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2023, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1'); //точилка - $idit = \User\ItemsModel::addItem(6457,$u->info['id']); + $idit = ItemsModel::addItem(6457,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1'); //чек на 100 екров - $idit = \User\ItemsModel::addItem(5023,$u->info['id']); + $idit = ItemsModel::addItem(5023,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "1" WHERE `id` = "'.$idit.'" LIMIT 1'); //цепь защитника - $idit = \User\ItemsModel::addItem(6459,$u->info['id']); + $idit = ItemsModel::addItem(6459,$u->info['id']); mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1'); diff --git a/_incl_data/class/Magic/pandorax.php b/_incl_data/class/Magic/pandorax.php index 1d9809f4..666e3ddc 100644 --- a/_incl_data/class/Magic/pandorax.php +++ b/_incl_data/class/Magic/pandorax.php @@ -1,4 +1,7 @@ info['id'],'|srok=1209600|sudba='.$u->info['login']); -\User\ItemsModel::addItem($rnd0['itm2']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); +ItemsModel::addItem($rnd0['itm1']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); +ItemsModel::addItem($rnd0['itm2']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); if(rand(0,7) == 2) { $rnd0['itm3'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm3']).'" LIMIT 1')); }else{ - \User\ItemsModel::addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); + ItemsModel::addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']); } $u->deleteItem($itm['id'],$u->info['id']); diff --git a/_incl_data/class/Magic/podvig.php b/_incl_data/class/Magic/podvig.php index 30841d39..00e1eb30 100644 --- a/_incl_data/class/Magic/podvig.php +++ b/_incl_data/class/Magic/podvig.php @@ -1,41 +1,38 @@ info['id'].'" AND `vars` = "podvig" AND `time` > "'.(time()).'" LIMIT 1')); - if( $u->info['align'] != 2 ) { - if( isset($test['id']) ) { - $u->error = 'Задержка не прошла, еще '.$u->timeOut($test['time']-time()); - }else{ - // - $dngcity = array( - 5035 => array('angelscity','Бездна'), - 5036 => array('capitalcity','Пещера Тысячи Проклятий'), - 5037 => array('demonscity','Катакомбы'), - 5038 => array('abandonedplain','Гора Легиона'), //mooncity - 5039 => array('suncity','Грибница'), - 5040 => array('sandcity','Пещера Мглы') - ); - // - $dngcity = $dngcity[$itm['item_id']]; - // - $hgo1 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > "'.(time()-86400).'" AND `vars` = "psh_qt_'.$dngcity[0].'" LIMIT 1',1); - if(!isset($hgo1['id'])) { - $u->error = 'Нет задержки для подземелья '.$dngcity[1].'.'; - }else{ - // - $u->addAction(time(),'podvig',''); - //$u->error = 'Все прошло успешно, задержки на получение задания в пещеру '.$dngcity[1].' снята.'; - $u->error = 'Успешно использован свиток Право на Подвиг ('.$dngcity[1].')'; - mysql_query('UPDATE `actions` SET `time` = "'.(time()-86401).'" WHERE `id` = "'.($hgo1['id']).'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - } - }else{ - $u->error = 'Хаосники не могут пользоваться этим свитком!'; - } +if ($itm['magic_inci'] == 'podvig') { + $test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "podvig" AND `time` > "' . (time()) . '" LIMIT 1')); + if ($u->info['align'] != 2) { + if (isset($test['id'])) { + $u->error = 'Задержка не прошла, еще ' . Conversion::secondsToTimeout($test['time'] - time()); + } else { + // + $dngcity = [ + 5035 => ['angelscity', 'Бездна'], + 5036 => ['capitalcity', 'Пещера Тысячи Проклятий'], + 5037 => ['demonscity', 'Катакомбы'], + 5038 => ['abandonedplain', 'Гора Легиона'], //mooncity + 5039 => ['suncity', 'Грибница'], + 5040 => ['sandcity', 'Пещера Мглы'], + ]; + $dngcity = $dngcity[$itm['item_id']]; + $hgo1 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > "' . (time() - 86400) . '" AND `vars` = "psh_qt_' . $dngcity[0] . '" LIMIT 1', 1); + if (!isset($hgo1['id'])) { + $u->error = 'Нет задержки для подземелья ' . $dngcity[1] . '.'; + } else { + $u->addAction(time(), 'podvig', ''); + $u->error = 'Успешно использован свиток Право на Подвиг (' . $dngcity[1] . ')'; + mysql_query('UPDATE `actions` SET `time` = "' . (time() - 86401) . '" WHERE `id` = "' . ($hgo1['id']) . '" LIMIT 1'); + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); + } + } + } else { + $u->error = 'Хаосники не могут пользоваться этим свитком!'; + } } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/predl.php b/_incl_data/class/Magic/predl.php index 4ad71e21..0bbb4739 100644 --- a/_incl_data/class/Magic/predl.php +++ b/_incl_data/class/Magic/predl.php @@ -1,11 +1,11 @@ Акционный клановый комплект, '; - $this->addItem(11128,$this->info['id'],'|nosale=1|nodelete=1|sudba=0'); - $this->addItem(11128,$this->info['id'],'|nosale=1|nodelete=1|sudba=0'); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Акционный клановый комплект, '; +ItemsModel::addItem(11128, $this->info['id'], '|nosale=1|nodelete=1|sudba=0'); +ItemsModel::addItem(11128, $this->info['id'], '|nosale=1|nodelete=1|sudba=0'); diff --git a/_incl_data/class/Magic/propuskpsh.php b/_incl_data/class/Magic/propuskpsh.php index 3bd69718..b37e7bfc 100644 --- a/_incl_data/class/Magic/propuskpsh.php +++ b/_incl_data/class/Magic/propuskpsh.php @@ -1,35 +1,38 @@ info['id'].'" AND `vars` = "propuskpsh" AND `time` > "'.(time()-300).'" LIMIT 1')); - if( $u->info['align'] != 2 ) { - if( isset($test['id']) ) { - $u->error = 'Задержка не прошла, еще '.$u->timeOut($test['time']-time()+300); - }else{ - $u->addAction(time(),'propuskpsh',''); - $u->error = 'Все прошло успешно, задержки в пещеры снята 6 часов.'; +if ($itm['magic_inci'] == 'propuskpsh') { + $test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "propuskpsh" AND `time` > "' . (time() - 300) . '" LIMIT 1')); + if ($u->info['align'] != 2) { + if (isset($test['id'])) { + $u->error = 'Задержка не прошла, еще ' . Conversion::secondsToTimeout($test['time'] - time() + 300); + } else { + $u->addAction(time(), 'propuskpsh', ''); + $u->error = 'Все прошло успешно, задержки в пещеры снята 6 часов.'; - mysql_query('UPDATE `actions` SET `time` = `time` - 21600 WHERE `uid` = '.$u->info['id'].' AND `time` > "'.(time()-43200).'" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"'); - - $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "'.$u->info['id'].'" LIMIT 1')); - - if(isset($eff['id'])) - { - mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 21600 WHERE `id` = '.$eff['id'].' '); - } - + mysql_query( + 'UPDATE `actions` SET `time` = `time` - 21600 WHERE `uid` = ' . $u->info['id'] . ' AND `time` > "' . (time( + ) - 43200) . '" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"' + ); - // Действует только на: - // 1) где таймер меньше 12 часов. (чтобы очень старые походы не меняли время похода 4 свитка, и сутки назад, история походов некорректная). - // 2) не сработает на Пещеру Драконов. - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - }else{ - $u->error = 'Хаосники не могут пользоваться пропуском!'; - } + $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "' . $u->info['id'] . '" LIMIT 1')); + + if (isset($eff['id'])) { + mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 21600 WHERE `id` = ' . $eff['id'] . ' '); + } + + + // Действует только на: + // 1) где таймер меньше 12 часов. (чтобы очень старые походы не меняли время похода 4 свитка, и сутки назад, история походов некорректная). + // 2) не сработает на Пещеру Драконов. + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); + } + } else { + $u->error = 'Хаосники не могут пользоваться пропуском!'; + } } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/propuskpsh2.php b/_incl_data/class/Magic/propuskpsh2.php index 9e8ae128..0d23bdfe 100644 --- a/_incl_data/class/Magic/propuskpsh2.php +++ b/_incl_data/class/Magic/propuskpsh2.php @@ -1,37 +1,38 @@ info['id'].'" AND `vars` = "propuskpsh" AND `time` > "'.(time()-300).'" LIMIT 1')); - if( $u->info['align'] != 2 ) { - if( isset($test['id']) ) { - $u->error = 'Задержка не прошла, еще '.$u->timeOut($test['time']-time()+300); - }else{ - $u->addAction(time(),'propuskpsh2',''); - $u->error = 'Все прошло успешно, задержки в пещеры снята 24 часа.'; +if ($itm['magic_inci'] == 'propuskpsh2') { + $test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "propuskpsh" AND `time` > "' . (time() - 300) . '" LIMIT 1')); + if ($u->info['align'] != 2) { + if (isset($test['id'])) { + $u->error = 'Задержка не прошла, еще ' . Conversion::secondsToTimeout($test['time'] - time() + 300); + } else { + $u->addAction(time(), 'propuskpsh2', ''); + $u->error = 'Все прошло успешно, задержки в пещеры снята 24 часа.'; - mysql_query('UPDATE `actions` SET `time` = `time` - 86400 WHERE `uid` = '.$u->info['id'].' AND `time` > "'.(time()-86400).'" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"'); - - - $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "'.$u->info['id'].'" LIMIT 1')); - - if(isset($eff['id'])) - { - mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 86400 WHERE `id` = '.$eff['id'].' '); - } - - + mysql_query( + 'UPDATE `actions` SET `time` = `time` - 86400 WHERE `uid` = ' . $u->info['id'] . ' AND `time` > "' . (time( + ) - 86400) . '" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"' + ); - // Действует только на: - // 1) где таймер меньше 12 часов. (чтобы очень старые походы не меняли время похода 4 свитка, и сутки назад, история походов некорректная). - // 2) не сработает на Пещеру Драконов. - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - }else{ - $u->error = 'Хаосники не могут пользоваться пропуском!'; - } + + $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "' . $u->info['id'] . '" LIMIT 1')); + + if (isset($eff['id'])) { + mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 86400 WHERE `id` = ' . $eff['id'] . ' '); + } + + // Действует только на: + // 1) где таймер меньше 12 часов. (чтобы очень старые походы не меняли время похода 4 свитка, и сутки назад, история походов некорректная). + // 2) не сработает на Пещеру Драконов. + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); + } + } else { + $u->error = 'Хаосники не могут пользоваться пропуском!'; + } } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/ruletka.php b/_incl_data/class/Magic/ruletka.php index 6afbd6a7..cbfc4981 100644 --- a/_incl_data/class/Magic/ruletka.php +++ b/_incl_data/class/Magic/ruletka.php @@ -1,106 +1,108 @@ -
- - '.$tomorrow.' ( Через '.$u->timeOut($tomorrow['time']+60*60*24-time()).' )'; - } - if($itm['magic_inci']=='ruletka') { - $idv=array( - 0 => '4349', - 1 => '4306', - 2 => '4327', - 3 => '4342', - 4 => '4297', - 5 => '4316', - 6 => '4361', - 7 => '4359', - 8 => '4340', - 9 => '4324', - 10 => '4314', - 11 => '4351', - 12 => '4303', - 13 => '4294', - 14 => '4353', - 15 => '4335', - 16 => '4364', - 17 => '4319', - 18 => '4330', - 19 => '4289', - 20 => '4309', - 21 => '4355', - 22 => '4333', - 23 => '4317', - 24 => '4362', - 25 => '4328', - 26 => '4287', - 27 => '4307', - 28 => '4334', - 29 => '4288', - 30 => '4363', - 31 => '4354', - 32 => '4329', - 33 => '4318', - 34 => '4308', - 35 => '4366', - 36 => '4352', - 37 => '4336', - 38 => '4331', - 39 => '4320', - 40 => '4290', - 41 => '4310', - 42 => '4350', - 43 => '4305', - 44 => '4360', - 45 => '4341', - 46 => '4326', - 47 => '4296', - 48 => '4315', - 49 => '4356', - 50 => '4337', - 51 => '4351', - 52 => '4311', - 53 => '4299', - 54 => '4291', - 55 => '4292', - 56 => '4300', - 57 => '4312', - 58 => '4322', - 59 => '4338', - 60 => '4357', - 61 => '4293', - 62 => '4302', - 63 => '4313', - 64 => '4323', - 65 => '4339', - 66 => '4358', - 67 => '865', - 68 => '4781', - 69 => '2545', - 70 => '4684', - 71 => '1035', - 72 => '6168', - 73 => '4920', - 74 => '10015', - 75 => '10016', - 76 => '10017', - 77 => '10018', - 78 => '10035' - ); - $idve=$idv[rand(0,count($idv)-1)]; - \User\ItemsModel::addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']); - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); - $u->error = 'Вы получили:'.$inf['name'].''; - +use Helper\Conversion; +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$tomorrow = mktime(0, 0, 0, idate("m"), idate("d") + 1, idate("Y")); + +if ($tomorrow = 0) { + echo 'Вы еще не справились с текущим заданием.'; +} elseif (!isset($tomorrow['id'])) { + ?> +
+ + ' . $tomorrow . ' ( Через ' . Conversion::secondsToTimeout($tomorrow['time'] + 60 * 60 * 24 - time()) . ' )'; +} +if ($itm['magic_inci'] == 'ruletka') { + $idv = [ + 0 => '4349', + 1 => '4306', + 2 => '4327', + 3 => '4342', + 4 => '4297', + 5 => '4316', + 6 => '4361', + 7 => '4359', + 8 => '4340', + 9 => '4324', + 10 => '4314', + 11 => '4351', + 12 => '4303', + 13 => '4294', + 14 => '4353', + 15 => '4335', + 16 => '4364', + 17 => '4319', + 18 => '4330', + 19 => '4289', + 20 => '4309', + 21 => '4355', + 22 => '4333', + 23 => '4317', + 24 => '4362', + 25 => '4328', + 26 => '4287', + 27 => '4307', + 28 => '4334', + 29 => '4288', + 30 => '4363', + 31 => '4354', + 32 => '4329', + 33 => '4318', + 34 => '4308', + 35 => '4366', + 36 => '4352', + 37 => '4336', + 38 => '4331', + 39 => '4320', + 40 => '4290', + 41 => '4310', + 42 => '4350', + 43 => '4305', + 44 => '4360', + 45 => '4341', + 46 => '4326', + 47 => '4296', + 48 => '4315', + 49 => '4356', + 50 => '4337', + 51 => '4351', + 52 => '4311', + 53 => '4299', + 54 => '4291', + 55 => '4292', + 56 => '4300', + 57 => '4312', + 58 => '4322', + 59 => '4338', + 60 => '4357', + 61 => '4293', + 62 => '4302', + 63 => '4313', + 64 => '4323', + 65 => '4339', + 66 => '4358', + 67 => '865', + 68 => '4781', + 69 => '2545', + 70 => '4684', + 71 => '1035', + 72 => '6168', + 73 => '4920', + 74 => '10015', + 75 => '10016', + 76 => '10017', + 77 => '10018', + 78 => '10035', + ]; + $idve = $idv[rand(0, count($idv) - 1)]; + ItemsModel::addItem($idve, $u->info['id'], '|frompisher=1|sudba=' . $u->info['login']); + $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1')); + $u->error = 'Вы получили:' . $inf['name']; + } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/sanich.php b/_incl_data/class/Magic/sanich.php index d8508caa..f0237cee 100644 --- a/_incl_data/class/Magic/sanich.php +++ b/_incl_data/class/Magic/sanich.php @@ -1,91 +1,69 @@ 0, 'sudba' => 0); - $sp_pg = mysql_query('SELECT `id`,`item_id`,`gift` FROM `items_users` WHERE `item_id` >= 3143 AND `item_id` <= 3192 AND `delete` = 0 AND `inSHop` = 0 AND `inTransfer` = 0 AND `uid` = "'.$this->info['id'].'"'); - while($pl_pg = mysql_fetch_array($sp_pg)) { - $pg_id = $pl_pg['item_id']-3142; - if(!isset($pgs[$pg_id])) { - $pgs[$pg_id] = $pl_pg['id']; - if($pl_pg['gift'] != '') { - $pgs['sudba']++; - } - $pgs['all']++; - } - } - $lk = 1; - while($lk <= 50) { - if($pgs[$lk] < 1) { - $npgs .= ', '.$lk; - } - $lk++; - } - - if($pgs['all'] < 50) { - $npgs = ltrim($npgs,', '); - $io .= 'Не удалось собрать книгу, необходимо наличие всех страниц. ['.$pgs['all'].'/50]
Недостающие страницы: '.$npgs; - $no_open_itm = true; - }else{ - //забираем страницы - $pgs['delete'] = ''; - $sp_pg = 1; - while($sp_pg <= 50) { - $pgs['delete'] .= '`id` = "'.$pgs[$sp_pg].'" OR '; - $sp_pg++; - } - - if($pgs['delete'] != '') { - $pgs['delete'] = rtrim($pgs['delete'],' OR '); - $pgs['delete'] = '('.$pgs['delete'].') AND `uid` = "'.$this->info['id'].'" LIMIT 50'; - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE '.$pgs['delete']); - } - - $sz = $this->testAction('`vars` = "gold_sanich_bonus" LIMIT 1',1); - /*if(!isset($sz['id'])) { - $this->addAction(time(),'gold_sanich_bonus','gold_sanich_bonus'); - //выдаем книгу - if($pgs['sudba'] > 0) { - //привязанная - $this->addItem(3198,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - //не привязанная - $this->addItem(3198,$this->info['id']); - } - $io .= 'Вы получили предмет "Золотая Книга"
Вы собрали книгу Саныча одним из первых поэтому получаете Золотую книгу вместо Бронзовой! ;)'; - }else{ - $sz = $this->testAction('`vars` = "silver_sanich_bonus" LIMIT 1',1); - if(!isset($sz['id'])) { - $this->addAction(time(),'silver_sanich_bonus','silver_sanich_bonus'); - //выдаем книгу - if($pgs['sudba'] > 0) { - //привязанная - $this->addItem(3197,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - //не привязанная - $this->addItem(3197,$this->info['id']); - } - $io .= 'Вы получили предмет "Серебряная Книга"
Вы собрали книгу Саныча одним из первых поэтому получаете Серебряную книгу вместо Бронзовой! ;)'; - }else{*/ - //выдаем книгу - if($pgs['sudba'] > 0) { - //привязанная - $this->addItem(3196,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - //не привязанная - $this->addItem(3196,$this->info['id']); - } - $io .= 'Вы получили предмет "Бронзовая Книга"'; - //} - //} +if ($tr['var_id'] == 1) { + //Бронзовая книга + $pgs = ['all' => 0, 'sudba' => 0]; + $sp_pg = mysql_query( + 'SELECT `id`,`item_id`,`gift` FROM `items_users` WHERE `item_id` >= 3143 AND `item_id` <= 3192 AND `delete` = 0 AND `inSHop` = 0 AND `inTransfer` = 0 AND `uid` = "' . $this->info['id'] . '"' + ); + while ($pl_pg = mysql_fetch_array($sp_pg)) { + $pg_id = $pl_pg['item_id'] - 3142; + if (!isset($pgs[$pg_id])) { + $pgs[$pg_id] = $pl_pg['id']; + if ($pl_pg['gift'] != '') { + $pgs['sudba']++; + } + $pgs['all']++; + } + } + $lk = 1; + while ($lk <= 50) { + if ($pgs[$lk] < 1) { + $npgs .= ', ' . $lk; + } + $lk++; + } - } - }else{ - $io .= 'Данный предмет нельзя использовать!'; - $no_open_itm = true; - } -?> \ No newline at end of file + if ($pgs['all'] < 50) { + $npgs = ltrim($npgs, ', '); + $io .= 'Не удалось собрать книгу, необходимо наличие всех страниц. [' . $pgs['all'] . '/50]
Недостающие страницы: ' . $npgs; + $no_open_itm = true; + } else { + //забираем страницы + $pgs['delete'] = ''; + $sp_pg = 1; + while ($sp_pg <= 50) { + $pgs['delete'] .= '`id` = "' . $pgs[$sp_pg] . '" OR '; + $sp_pg++; + } + + if ($pgs['delete'] != '') { + $pgs['delete'] = rtrim($pgs['delete'], ' OR '); + $pgs['delete'] = '(' . $pgs['delete'] . ') AND `uid` = "' . $this->info['id'] . '" LIMIT 50'; + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE ' . $pgs['delete']); + } + + $sz = $this->testAction('`vars` = "gold_sanich_bonus" LIMIT 1', 1); + //выдаем книгу + if ($pgs['sudba'] > 0) { + //привязанная + ItemsModel::addItem(3196, $this->info['id'], '|sudba=' . $this->info['login']); + } else { + //не привязанная + ItemsModel::addItem(3196, $this->info['id']); + } + $io .= 'Вы получили предмет "Бронзовая Книга"'; + //} + //} + + } +} else { + $io .= 'Данный предмет нельзя использовать!'; + $no_open_itm = true; +} diff --git a/_incl_data/class/Magic/sun_per_kr.php b/_incl_data/class/Magic/sun_per_kr.php index a30a312c..30918a06 100644 --- a/_incl_data/class/Magic/sun_per_kr.php +++ b/_incl_data/class/Magic/sun_per_kr.php @@ -1,46 +1,47 @@ Подарочный комплект Критовика, '; - $this->addItem(842,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(842,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(749,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(666,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(580,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(594,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(642,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(814,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(777,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(787,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2621,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2621,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(871,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Подарочный комплект Критовика, '; +ItemsModel::addItem(842, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(842, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(749, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(666, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2469, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(580, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(594, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(642, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(814, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(777, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(787, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(803, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(803, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(803, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2621, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2621, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(871, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(994, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_kruv.php b/_incl_data/class/Magic/sun_per_kruv.php index bf053dfa..91a7754c 100644 --- a/_incl_data/class/Magic/sun_per_kruv.php +++ b/_incl_data/class/Magic/sun_per_kruv.php @@ -1,46 +1,46 @@ Подарочный комплект Уворота, '; - $this->addItem(4953,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4953,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4596,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4598,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4961,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4967,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4969,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4601,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4599,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4986,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4595,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4597,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4597,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4597,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(872,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Подарочный комплект Уворота, '; +ItemsModel::addItem(4953, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4953, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4596, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4598, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2469, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4961, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4967, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4969, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4601, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4599, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4986, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4595, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4597, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4597, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4597, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2643, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2643, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(872, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(994, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); diff --git a/_incl_data/class/Magic/sun_per_ogn.php b/_incl_data/class/Magic/sun_per_ogn.php index 60123222..6fe59d4b 100644 --- a/_incl_data/class/Magic/sun_per_ogn.php +++ b/_incl_data/class/Magic/sun_per_ogn.php @@ -1,45 +1,46 @@ Подарочный комплект Мага Огня, '; - $this->addItem(850,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(751,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(669,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(822,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(583,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(597,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(644,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(810,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4983,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4543,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // элик - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2146,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); //усилок - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$io .= 'Подарочный комплект Мага Огня, '; +ItemsModel::addItem(850, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(751, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(669, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1176, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(822, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(583, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(597, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(644, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(810, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4983, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4543, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5003, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5003, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5003, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2687, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(873, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); // элик +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4942, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1460, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2146, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); //усилок +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_tk.php b/_incl_data/class/Magic/sun_per_tk.php index 85eb1cbb..15c27b07 100644 --- a/_incl_data/class/Magic/sun_per_tk.php +++ b/_incl_data/class/Magic/sun_per_tk.php @@ -1,44 +1,45 @@ Подарочный комплект Танка, '; - $this->addItem(4648,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4654,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4647,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4651,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4962,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4968,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4650,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4653,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4652,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4987,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4646,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2430,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(870,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$io .= 'Подарочный комплект Танка, '; +ItemsModel::addItem(4648, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4654, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4647, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4651, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2469, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4962, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4968, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4650, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4653, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4652, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4987, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4646, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4649, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4649, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4649, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2430, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(870, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(994, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_tp.php b/_incl_data/class/Magic/sun_per_tp.php index 6010907c..ec89e508 100644 --- a/_incl_data/class/Magic/sun_per_tp.php +++ b/_incl_data/class/Magic/sun_per_tp.php @@ -1,46 +1,47 @@ Подарочный комплект Силача ( Топора ), '; - $this->addItem(6483,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6483,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6484,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6485,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6486,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6487,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6488,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6489,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6490,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6491,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6492,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2665,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2665,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(870,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Подарочный комплект Силача ( Топора ), '; +ItemsModel::addItem(6483, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6483, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6484, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6485, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2469, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6486, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6487, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6488, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6489, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6490, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6491, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6492, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6493, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6493, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(6493, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2665, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2665, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(870, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(994, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_uv.php b/_incl_data/class/Magic/sun_per_uv.php index 6d017acc..863935cc 100644 --- a/_incl_data/class/Magic/sun_per_uv.php +++ b/_incl_data/class/Magic/sun_per_uv.php @@ -1,46 +1,47 @@ Подарочный комплект Уворота, '; - $this->addItem(605,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(605,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(748,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(667,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(735,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(579,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(593,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(641,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(813,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(775,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(786,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(872,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Подарочный комплект Уворота, '; +ItemsModel::addItem(605, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(605, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(748, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(667, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2469, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(735, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(579, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(593, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(641, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(813, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(775, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(786, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(802, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(802, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(802, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2643, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2643, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(872, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(994, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_vod.php b/_incl_data/class/Magic/sun_per_vod.php index 0e22cd81..006728d1 100644 --- a/_incl_data/class/Magic/sun_per_vod.php +++ b/_incl_data/class/Magic/sun_per_vod.php @@ -1,45 +1,46 @@ Подарочный комплект Мага Воды, '; - $this->addItem(851,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(753,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(670,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(823,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(584,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(598,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(645,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(812,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4984,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4544,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // элик - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2147,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); //усилок - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$io .= 'Подарочный комплект Мага Воды, '; +ItemsModel::addItem(851, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(753, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(670, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1176, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(823, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(584, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(598, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(645, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(812, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4984, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4544, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5004, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5004, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5004, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2687, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(873, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); // элик +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4942, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1460, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2147, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); //усилок +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_voz.php b/_incl_data/class/Magic/sun_per_voz.php index cc14ecf8..c7659056 100644 --- a/_incl_data/class/Magic/sun_per_voz.php +++ b/_incl_data/class/Magic/sun_per_voz.php @@ -1,45 +1,46 @@ Подарочный комплект Мага Воздуха, '; - $this->addItem(848,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(752,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(671,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(820,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(581,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(595,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(646,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(811,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4982,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4545,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // элик - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2148,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); //усилок - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$io .= 'Подарочный комплект Мага Воздуха, '; +ItemsModel::addItem(848, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(752, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(671, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1176, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(820, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(581, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(595, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(646, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(811, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4982, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4545, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5002, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5002, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5002, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2687, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(873, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); // элик +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4942, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1460, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2148, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); //усилок +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sun_per_zem.php b/_incl_data/class/Magic/sun_per_zem.php index 275dd7fd..417368ed 100644 --- a/_incl_data/class/Magic/sun_per_zem.php +++ b/_incl_data/class/Magic/sun_per_zem.php @@ -1,45 +1,46 @@ Подарочный комплект Мага Земли, '; - $this->addItem(849,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(750,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(668,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(821,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(582,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(596,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(809,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4985,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4546,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - - $io .= 'Свитки и прочие материалы...., '; - $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // элик - $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(2149,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); //усилок - $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +$io .= 'Подарочный комплект Мага Земли, '; +ItemsModel::addItem(849, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(750, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(668, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1176, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(821, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(582, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(596, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(643, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(809, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4985, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4546, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5005, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5005, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5005, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4401, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + +$io .= 'Свитки и прочие материалы...., '; +ItemsModel::addItem(2712, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2687, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4736, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(873, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); // элик +ItemsModel::addItem(2139, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2140, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(5046, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2390, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4941, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(4942, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(1460, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(2149, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); //усилок +ItemsModel::addItem(1001, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); +ItemsModel::addItem(3102, $this->info['id'], '|nosale=1|srok=864000|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sunduk.php b/_incl_data/class/Magic/sunduk.php index f0ccf4bb..4fdd6ed2 100644 --- a/_incl_data/class/Magic/sunduk.php +++ b/_incl_data/class/Magic/sunduk.php @@ -1,149 +1,145 @@ 4) { - //маг - $itmadd = array( - //3053 - вечность , 3052 - МР 1000 - //суперсвиток - 0 => array(2142,2143,2144,2141,3052), - //простые свитки - 1 => array(3053,3043,2545,2709,874,2391), - //гарантированные - 2 => array(3044) - ); - $tr['var_id'] -= 4; - }else{ - //воин - $itmadd = array( - //суперсвиток - 0 => array(911,1172,2143,2144,1173), - //простые свитки - 1 => array(3043,2545,2709,874,2391), - //гарантированные - 2 => array(3044) - ); - } - - if($tr['var_id'] > 4) { - //Маг - $i3[9] = $this->addItem(4676,$this->info['id'],'|notr=1|sudba='.$this->info['login']); - }else{ - //Воин - $i3[9] = $this->addItem(2870,$this->info['id'],'|notr=1|sudba='.$this->info['login']); - } - - if($tr['var_id'] == 1) { - // 200 екр. - 1 суперсвиток 0/15, 2 простых 0/75 + Эссенция Здоровья 0/1 - $i4 = array( - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)] - ); - - $i3 = array(); - - $i3[0] = $this->addItem($i4[0],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,15); - - $i3[1] = $this->addItem($i4[1],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - $i3[2] = $this->addItem($i4[2],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - - $i3[3] = $this->addItem(3044,$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,1); - - if($io == '') { - $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; - } - - }elseif($tr['var_id'] == 2) { - // 400 екр. - 2 суперсвитка 0/15, 4 простых 0/75 + Эссенция Здоровья 0/2 + новогодний эликсир 0/7 - $i4 = array( - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)] - ); - - $i3 = array(); - - $i3[0] = $this->addItem($i4[0],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,15); - $i3[1] = $this->addItem($i4[1],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,15); - - $i3[2] = $this->addItem($i4[2],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - $i3[3] = $this->addItem($i4[3],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - $i3[4] = $this->addItem($i4[4],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - $i3[5] = $this->addItem($i4[5],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,75); - - $i3[6] = $this->addItem(3044,$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,2); - - if($io == '') { - $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; - } - - }elseif($tr['var_id'] == 3) { - // 600 екр. - 2 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/2 + новогодний эликсир 0/10 - $i4 = array( - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)] - ); - - $i3 = array(); - - $i3[0] = $this->addItem($i4[0],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - $i3[1] = $this->addItem($i4[1],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - - $i3[2] = $this->addItem($i4[2],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[3] = $this->addItem($i4[3],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[4] = $this->addItem($i4[4],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[5] = $this->addItem($i4[5],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - - $i3[6] = $this->addItem(3044,$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,2); - - if($io == '') { - $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; - } +if ($tr['var_id'] > 4) { + //маг + $itmadd = [ + //3053 - вечность , 3052 - МР 1000 + //суперсвиток + 0 => [2142, 2143, 2144, 2141, 3052], + //простые свитки + 1 => [3053, 3043, 2545, 2709, 874, 2391], + //гарантированные + 2 => [3044], + ]; + $tr['var_id'] -= 4; +} else { + //воин + $itmadd = [ + //суперсвиток + 0 => [911, 1172, 2143, 2144, 1173], + //простые свитки + 1 => [3043, 2545, 2709, 874, 2391], + //гарантированные + 2 => [3044], + ]; +} - }elseif($tr['var_id'] == 4) { - // 1000 екр. - 3-4 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/3 + новогодний эликсир 0/10 - $i4 = array( - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)] - ); - - $i3 = array(); - - $i3[0] = $this->addItem($i4[0],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - $i3[1] = $this->addItem($i4[1],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - $i3[3] = $this->addItem($i4[2],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - - if(rand(0,1000) > 250 && rand(0,1000) < 750) { - $i3[9] = $this->addItem($i4[3],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,20); - } - - $i3[4] = $this->addItem($i4[4],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[5] = $this->addItem($i4[5],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[6] = $this->addItem($i4[6],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - $i3[7] = $this->addItem($i4[7],$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,100); - - $i3[8] = $this->addItem(3044,$this->info['id'],'|notr=1|sudba='.$this->info['login'],NULL,3); - - if($io == '') { - $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; - } - - } - unset($itmadd,$i3,$i4); -?> \ No newline at end of file +if ($tr['var_id'] > 4) { + //Маг + $i3[9] = ItemsModel::addItem(4676, $this->info['id'], '|notr=1|sudba=' . $this->info['login']); +} else { + //Воин + $i3[9] = ItemsModel::addItem(2870, $this->info['id'], '|notr=1|sudba=' . $this->info['login']); +} + +if ($tr['var_id'] == 1) { + // 200 екр. - 1 суперсвиток 0/15, 2 простых 0/75 + Эссенция Здоровья 0/1 + $i4 = [ + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + ]; + + $i3 = []; + $i3[0] = ItemsModel::addItem($i4[0], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 15); + $i3[1] = ItemsModel::addItem($i4[1], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + $i3[2] = ItemsModel::addItem($i4[2], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + $i3[3] = ItemsModel::addItem(3044, $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 1); + + if ($io == '') { + $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; + } + +} elseif ($tr['var_id'] == 2) { + // 400 екр. - 2 суперсвитка 0/15, 4 простых 0/75 + Эссенция Здоровья 0/2 + новогодний эликсир 0/7 + $i4 = [ + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + ]; + + $i3 = []; + $i3[0] = ItemsModel::addItem($i4[0], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 15); + $i3[1] = ItemsModel::addItem($i4[1], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 15); + $i3[2] = ItemsModel::addItem($i4[2], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + $i3[3] = ItemsModel::addItem($i4[3], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + $i3[4] = ItemsModel::addItem($i4[4], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + $i3[5] = ItemsModel::addItem($i4[5], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 75); + + $i3[6] = ItemsModel::addItem(3044, $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 2); + + if ($io == '') { + $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; + } + +} elseif ($tr['var_id'] == 3) { + // 600 екр. - 2 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/2 + новогодний эликсир 0/10 + $i4 = [ + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + ]; + + $i3 = []; + + $i3[0] = ItemsModel::addItem($i4[0], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + $i3[1] = ItemsModel::addItem($i4[1], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + + $i3[2] = ItemsModel::addItem($i4[2], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[3] = ItemsModel::addItem($i4[3], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[4] = ItemsModel::addItem($i4[4], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[5] = ItemsModel::addItem($i4[5], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + + $i3[6] = ItemsModel::addItem(3044, $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 2); + + if ($io == '') { + $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; + } + +} elseif ($tr['var_id'] == 4) { + // 1000 екр. - 3-4 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/3 + новогодний эликсир 0/10 + $i4 = [ + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + ]; + + $i3 = []; + + $i3[0] = ItemsModel::addItem($i4[0], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + $i3[1] = ItemsModel::addItem($i4[1], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + $i3[3] = ItemsModel::addItem($i4[2], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + + if (rand(0, 1000) > 250 && rand(0, 1000) < 750) { + $i3[9] = ItemsModel::addItem($i4[3], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 20); + } + + $i3[4] = ItemsModel::addItem($i4[4], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[5] = ItemsModel::addItem($i4[5], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[6] = ItemsModel::addItem($i4[6], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + $i3[7] = ItemsModel::addItem($i4[7], $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 100); + + $i3[8] = ItemsModel::addItem(3044, $this->info['id'], '|notr=1|sudba=' . $this->info['login'], null, 3); + + if ($io == '') { + $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; + } + +} +unset($itmadd, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_50.php b/_incl_data/class/Magic/sunduk_50.php index 54239921..887e1046 100644 --- a/_incl_data/class/Magic/sunduk_50.php +++ b/_incl_data/class/Magic/sunduk_50.php @@ -1,47 +1,48 @@ info['level']; - if( $arts_lvl < 4 ) { - $arts_lvl = 4; - }elseif( $arts_lvl > 10 ) { - $arts_lvl = 10; - } - $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%"'); - while( $pl1 = mysql_fetch_array($sp1) ) { - $arts_1[] = $pl1['items_id']; - } - $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; - if( $arts_1 > 0 ) { - $this->addItem($arts_1,$this->info['id'],'|sroknext=1|nosale=1|srok='.(1*86400).'',NULL,75); - } - } - }else{ - //Выдаем предмет - $this->addItem($i3[0],$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,$i3[1]); - } - $i4++; - } - - if($io == '') { - $io .= 'Какие-то предметы добавлены к Вам в инвентарь...'; - } - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { + + $i4 = 0; + $i5 = explode('@', $tr['var_id']); + while ($i4 < count($i5)) { + $i3 = explode('-', $i5[$i4]); + if ($i3 == 'ekr') { + //Выдаем екр. + } elseif ($i3[0] == 'artefact') { + //Выдаем случайный артефакт. + if (rand(0, 100) <= $i3[1]) { + $io = 'Вы обнаружили временный Артефакт и какие-то предметы...'; + $arts_1 = []; + $arts_lvl = $this->info['level']; + if ($arts_lvl < 4) { + $arts_lvl = 4; + } elseif ($arts_lvl > 10) { + $arts_lvl = 10; + } + $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl=' . $arts_lvl . '%"'); + while ($pl1 = mysql_fetch_array($sp1)) { + $arts_1[] = $pl1['items_id']; + } + $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; + if ($arts_1 > 0) { + ItemsModel::addItem($arts_1, $this->info['id'], '|sroknext=1|nosale=1|srok=' . (1 * 86400) . '', null, 75); + } + } + } else { + //Выдаем предмет + ItemsModel::addItem($i3[0], $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, $i3[1]); + } + $i4++; + } + + if ($io == '') { + $io .= 'Какие-то предметы добавлены к Вам в инвентарь...'; + } + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_78.php b/_incl_data/class/Magic/sunduk_78.php index dd67947a..3f9e06b1 100644 --- a/_incl_data/class/Magic/sunduk_78.php +++ b/_incl_data/class/Magic/sunduk_78.php @@ -1,131 +1,143 @@ info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - - if( isset($key1['id']) && isset($key2['id']) && isset($key3['id']) && isset($key4['id']) ) { - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - if( rand(0,100) == 57 || $this->info['admin'] > 0 ) { - //Выдаем артефакт - $io .= 'Временный артефакт, '; - $arts_1 = array(); - $arts_lvl = $this->info['level']; - if( $arts_lvl < 4 ) { - $arts_lvl = 4; - }elseif( $arts_lvl > 10 ) { - $arts_lvl = 10; - } - $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%"'); - while( $pl1 = mysql_fetch_array($sp1) ) { - $arts_1[] = $pl1['items_id']; - } - $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; - if( $arts_1 > 0 ) { - $this->addItem($arts_1,$this->info['id'],'|nosale=1|srok='.(1*259200).'',NULL,50); - } - //echo '['.$arts_1[rand(0,count($arts_1)-1)].'!'.count($arts_1).'!'.$arts_lvl.']'; - } - - $recr=rand(1,200); // 0.5% 4510 - 40 екр /2% 5021 - 20 екр /5.5% 5020 -10 екр/ 10.5% 4465 -5 екр/ 100% 5017 - 1екр - $rcr=rand(1,200); // 5%4274 - 400 кр / 15% 4392/4392 - 100 кр / 30% 4392 -50 кр/ 100% 4464 - 20кр - $ryay=rand(1,200); // 5%4274 - 400 кр / 15% 4392/4392 - 100 кр / 30% 4392 -50 кр/ 100% 4464 - 20кр - - if( $recr > 199 ) { - //Выдаем чек +40 екр. - - $io .= 'Чек на 40 екр., '; - $this->addItem(4510,$this->info['id'],'|sudba='.$this->info['login']); - - }elseif( $recr > 198 ){ - //Выдаем чек +20 екр. - $io .= 'Чек на 20 екр., '; - $this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $recr > 192 ){ - //Выдаем чек +10 екр. - $io .= 'Чек на 10 екр., '; - $this->addItem(5020,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $recr > 180 ){ - //Выдаем чек +5 екр. - $io .= 'Чек на 5 екр., '; - $this->addItem(4465,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - //Выдаем чек +1 екр. - $io .= 'Чек на 1 екр., '; - $this->addItem(5017,$this->info['id'],'|sudba='.$this->info['login']); - } - - if( $rcr > 94 ) { - //Выдаем чек на 400 кр. - $io .= 'Чек на 400 кр. '; - $this->addItem(4274,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $rcr > 84 ){ - //Выдаем чек на 100 кр. - $io .= 'Чеки на сумму 100 кр. '; - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $rcr > 69 ){ - //Выдаем чек на 50 кр. - $io .= 'Чек на 50 кр. '; - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - //Выдаем чек на 20 кр. - $io .= 'Чек на 20 кр. '; - $this->addItem(4464,$this->info['id'],'|sudba='.$this->info['login']); - } - if( $ryay > 199 ) { - //Выдаем яйцо дракона. - $io .= 'Яйцо Дракона. '; - $this->addItem(6445,$this->info['id']); - } - - - $elik_1 = array( - 4037,4038,4039,4040 - ); - $elik_1 = $elik_1[rand(0,3)]; - if( $elik_1 > 0 ) { - //Выдаем 1 из 4 эликов - $io .= 'Эликсир +22 статов, '; - $this->addItem($elik_1,$this->info['id'],'|nosale=1|',NULL,1); - } - +use User\ItemsModel; - - //Выдаем свиток +200% - $io .= 'Свиток +100% опыта, '; - $this->addItem(4466,$this->info['id'],''); - - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("'.$this->info['id'].'","'.time().'","capitalcity","'.$this->info['room'].'","trup_sun"," ","","")'); - mysql_query('UPDATE `users_achiv` SET `snt`= `snt`+1 WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - - }else{ - $no_open_itm = true; - $this->error = 'Требуется 4 различных ключа с поля битвы.'; - } +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + $io = ''; + + /* + 1. Выпадает артефакт уровня персонажа - 1% , временный , не продается , судьба , 3 дн. срок годности + 2. Выпадает либо 5 екр. свиток, либо свиток +200% опыта на 3 часа (без заморозки) + 3. 1 из 4 эликсирова +15 (екр.) + 4. Чек 20 кр. + */ + $trgos = false; + + $key1 = mysql_fetch_array( + mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4460 AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1') + ); + $key2 = mysql_fetch_array( + mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1') + ); + $key3 = mysql_fetch_array( + mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1') + ); + $key4 = mysql_fetch_array( + mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1') + ); + + if (isset($key1['id']) && isset($key2['id']) && isset($key3['id']) && isset($key4['id'])) { + mysql_query( + 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = ' . $key1['id'] . ' OR `id` = ' . $key2['id'] . ' OR `id` = ' . $key3['id'] . ' OR `id` = ' . $key4['id'] . ' LIMIT 4' + ); + $trgos = true; + } + + if ($trgos == true) { + if (rand(0, 100) == 57 || $this->info['admin'] > 0) { + //Выдаем артефакт + $io .= 'Временный артефакт, '; + $arts_1 = []; + $arts_lvl = $this->info['level']; + if ($arts_lvl < 4) { + $arts_lvl = 4; + } elseif ($arts_lvl > 10) { + $arts_lvl = 10; + } + $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl=' . $arts_lvl . '%"'); + while ($pl1 = mysql_fetch_array($sp1)) { + $arts_1[] = $pl1['items_id']; + } + $arts_1 = $arts_1[rand(0, count($arts_1) - 1)]; + if ($arts_1 > 0) { + ItemsModel::addItem($arts_1, $this->info['id'], '|nosale=1|srok=' . (1 * 259200) . '', null, 50); + } + //echo '['.$arts_1[rand(0,count($arts_1)-1)].'!'.count($arts_1).'!'.$arts_lvl.']'; + } + + $recr = rand(1, 200); // 0.5% 4510 - 40 екр /2% 5021 - 20 екр /5.5% 5020 -10 екр/ 10.5% 4465 -5 екр/ 100% 5017 - 1екр + $rcr = rand(1, 200); // 5%4274 - 400 кр / 15% 4392/4392 - 100 кр / 30% 4392 -50 кр/ 100% 4464 - 20кр + $ryay = rand(1, 200); // 5%4274 - 400 кр / 15% 4392/4392 - 100 кр / 30% 4392 -50 кр/ 100% 4464 - 20кр + + if ($recr > 199) { + //Выдаем чек +40 екр. + + $io .= 'Чек на 40 екр., '; + ItemsModel::addItem(4510, $this->info['id'], '|sudba=' . $this->info['login']); + + } elseif ($recr > 198) { + //Выдаем чек +20 екр. + $io .= 'Чек на 20 екр., '; + ItemsModel::addItem(5021, $this->info['id'], '|sudba=' . $this->info['login']); + } elseif ($recr > 192) { + //Выдаем чек +10 екр. + $io .= 'Чек на 10 екр., '; + ItemsModel::addItem(5020, $this->info['id'], '|sudba=' . $this->info['login']); + } elseif ($recr > 180) { + //Выдаем чек +5 екр. + $io .= 'Чек на 5 екр., '; + ItemsModel::addItem(4465, $this->info['id'], '|sudba=' . $this->info['login']); + } else { + //Выдаем чек +1 екр. + $io .= 'Чек на 1 екр., '; + ItemsModel::addItem(5017, $this->info['id'], '|sudba=' . $this->info['login']); + } + + if ($rcr > 94) { + //Выдаем чек на 400 кр. + $io .= 'Чек на 400 кр. '; + ItemsModel::addItem(4274, $this->info['id'], '|sudba=' . $this->info['login']); + } elseif ($rcr > 84) { + //Выдаем чек на 100 кр. + $io .= 'Чеки на сумму 100 кр. '; + ItemsModel::addItem(4392, $this->info['id'], '|sudba=' . $this->info['login']); + ItemsModel::addItem(4392, $this->info['id'], '|sudba=' . $this->info['login']); + } elseif ($rcr > 69) { + //Выдаем чек на 50 кр. + $io .= 'Чек на 50 кр. '; + ItemsModel::addItem(4392, $this->info['id'], '|sudba=' . $this->info['login']); + } else { + //Выдаем чек на 20 кр. + $io .= 'Чек на 20 кр. '; + ItemsModel::addItem(4464, $this->info['id'], '|sudba=' . $this->info['login']); + } + if ($ryay > 199) { + //Выдаем яйцо дракона. + $io .= 'Яйцо Дракона. '; + ItemsModel::addItem(6445, $this->info['id']); + } + + + $elik_1 = [ + 4037, 4038, 4039, 4040, + ]; + $elik_1 = $elik_1[rand(0, 3)]; + if ($elik_1 > 0) { + //Выдаем 1 из 4 эликов + $io .= 'Эликсир +22 статов, '; + ItemsModel::addItem($elik_1, $this->info['id'], '|nosale=1|', null, 1); + } + + + //Выдаем свиток +200% + $io .= 'Свиток +100% опыта, '; + ItemsModel::addItem(4466, $this->info['id'], ''); + + mysql_query( + 'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->info['id'] . '","' . time( + ) . '","capitalcity","' . $this->info['room'] . '","trup_sun"," ","","")' + ); + mysql_query('UPDATE `users_achiv` SET `snt`= `snt`+1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); + + } else { + $no_open_itm = true; + $this->error = 'Требуется 4 различных ключа с поля битвы.'; + } + + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_79.php b/_incl_data/class/Magic/sunduk_79.php index 6f42c80e..6153a043 100644 --- a/_incl_data/class/Magic/sunduk_79.php +++ b/_incl_data/class/Magic/sunduk_79.php @@ -1,50 +1,51 @@ info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - */ - $keyall = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - if( $keyall[0] >= 2 ) { - mysql_query('DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 2'); - //mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - // - $io .= 'Целебный пирог (х2), '; - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Запас маны (х2), '; - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 600HP, '; - $this->addItem(4015,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 500MP, '; - $this->addItem(4024,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - }else{ - $no_open_itm = true; - $this->error = 'Требуется 2 ключа с поля битвы.'; - } - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { + + $io = ''; + + /* + 1. Требует 2 любых ключа + */ + $trgos = false; + $keyall = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1' + ) + ); + if ($keyall[0] >= 2) { + mysql_query( + 'DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 2' + ); + + $trgos = true; + } + + if ($trgos) { + // + $io .= 'Целебный пирог (х2), '; + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Запас маны (х2), '; + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 600HP, '; + ItemsModel::addItem(4015, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 500MP, '; + ItemsModel::addItem(4024, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + } else { + $no_open_itm = true; + $this->error = 'Требуется 2 ключа с поля битвы.'; + } + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_80.php b/_incl_data/class/Magic/sunduk_80.php index 94bebf73..057eceb0 100644 --- a/_incl_data/class/Magic/sunduk_80.php +++ b/_incl_data/class/Magic/sunduk_80.php @@ -1,58 +1,58 @@ info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - */ - $keyall = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - if( $keyall[0] >= 4 ) { - mysql_query('DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 4'); - //mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - // - $io .= 'Целебный пирог (х2), '; - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Запас маны (х2), '; - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 900HP, '; - $this->addItem(2710,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 1000MP, '; - $this->addItem(4030,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Зелье Жизни, '; - $this->addItem(724,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - $io .= 'Зелье Маны, '; - $this->addItem(1187,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - }else{ - $no_open_itm = true; - $this->error = 'Требуется 4 ключа с поля битвы.'; - } - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { + + $io = ''; + + /* + 1. Требует 4 любых ключа + */ + $trgos = false; + $keyall = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1' + ) + ); + if ($keyall[0] >= 4) { + mysql_query( + 'DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 4' + ); + $trgos = true; + } + + if ($trgos) { + // + $io .= 'Целебный пирог (х2), '; + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Запас маны (х2), '; + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 900HP, '; + ItemsModel::addItem(2710, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 1000MP, '; + ItemsModel::addItem(4030, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Зелье Жизни, '; + ItemsModel::addItem(724, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "' . $iidtm . '" LIMIT 1'); + // + $io .= 'Зелье Маны, '; + ItemsModel::addItem(1187, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "' . $iidtm . '" LIMIT 1'); + // + } else { + $no_open_itm = true; + $this->error = 'Требуется 4 ключа с поля битвы.'; + } + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_81.php b/_incl_data/class/Magic/sunduk_81.php index 49fbce0b..dd369d79 100644 --- a/_incl_data/class/Magic/sunduk_81.php +++ b/_incl_data/class/Magic/sunduk_81.php @@ -1,64 +1,65 @@ info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - */ - $keyall = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - if( $keyall[0] >= 6 ) { - mysql_query('DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 6'); - //mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - // - $io .= 'Целебный пирог (х3), '; - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Запас маны (х3), '; - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 900HP, '; - $this->addItem(2711,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 1000MP, '; - $this->addItem(4029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Пропуск забытых, '; - $this->addItem(2412,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Зелье Жизни, '; - $this->addItem(724,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - mysql_query('UPDATE `items_users` SET `iznosMAX` = 5 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - $io .= 'Зелье Маны, '; - $this->addItem(1187,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - $io .= 'Нападение, '; - $this->addItem(865,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - }else{ - $no_open_itm = true; - $this->error = 'Требуется 6 ключей с поля битвы.'; - } - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { + + $io = ''; + + /* + 1. Требует 6 любых ключа + */ + $trgos = false; + + $keyall = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1' + ) + ); + if ($keyall[0] >= 6) { + mysql_query( + 'DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 6' + ); + $trgos = true; + } + + if ($trgos) { + // + $io .= 'Целебный пирог (х3), '; + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Запас маны (х3), '; + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 900HP, '; + ItemsModel::addItem(2711, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Восстановление энергии 1000MP, '; + ItemsModel::addItem(4029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Пропуск забытых, '; + ItemsModel::addItem(2412, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + $io .= 'Зелье Жизни, '; + ItemsModel::addItem(724, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + mysql_query('UPDATE `items_users` SET `iznosMAX` = 5 WHERE `id` = "' . $iidtm . '" LIMIT 1'); + // + $io .= 'Зелье Маны, '; + ItemsModel::addItem(1187, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "' . $iidtm . '" LIMIT 1'); + // + $io .= 'Нападение, '; + ItemsModel::addItem(865, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + // + } else { + $no_open_itm = true; + $this->error = 'Требуется 6 ключей с поля битвы.'; + } + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_82.php b/_incl_data/class/Magic/sunduk_82.php index 8b0cbce5..d28cc165 100644 --- a/_incl_data/class/Magic/sunduk_82.php +++ b/_incl_data/class/Magic/sunduk_82.php @@ -1,68 +1,56 @@ info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - */ - $keyall = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - if( $keyall[0] >= 8 ) { - mysql_query('DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 8'); - //mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - // - $io .= 'Целебный пирог (х3), '; - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1028,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Запас маны (х3), '; - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(1029,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 1500HP, '; - $this->addItem(4022,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Восстановление энергии 1500MP, '; - $this->addItem(4034,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Пропуск Забытых, '; - $this->addItem(2412,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Нападение, '; - $this->addItem(865,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - // - $io .= 'Зелье Жизни, '; - $this->addItem(724,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - //mysql_query('UPDATE `items_users` SET `iznosMAX` = 5 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - $io .= 'Зелье Маны, '; - $this->addItem(1187,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - //mysql_query('UPDATE `items_users` SET `iznosMAX` = 5 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - $io .= 'Звездное Сияние, '; - $iidtm = $this->addItem(1463,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "'.$iidtm.'" LIMIT 1'); - // - }else{ - $no_open_itm = true; - $this->error = 'Требуется 8 ключей с поля битвы.'; - } - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($tr['var_id'] != '') { + + $io = ''; + + /* + 1. Требует 8 любых ключа + */ + $trgos = false; + $keyall = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1' + ) + ); + if ($keyall[0] >= 8) { + mysql_query( + 'DELETE FROM `items_users` WHERE (`item_id` = 4460 OR `item_id` = 4461 OR `item_id` = 4462 OR `item_id` = 4463) AND `uid` = ' . $this->info['id'] . ' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 8' + ); + $trgos = true; + } + + if ($trgos) { + $io .= 'Целебный пирог (х3), '; + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1028, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Запас маны (х3), '; + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + ItemsModel::addItem(1029, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Восстановление энергии 1500HP, '; + ItemsModel::addItem(4022, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Восстановление энергии 1500MP, '; + ItemsModel::addItem(4034, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Пропуск Забытых, '; + ItemsModel::addItem(2412, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Нападение, '; + ItemsModel::addItem(865, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Зелье Жизни, '; + ItemsModel::addItem(724, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Зелье Маны, '; + ItemsModel::addItem(1187, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + $io .= 'Звездное Сияние, '; + $iidtm = ItemsModel::addItem(1463, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + mysql_query('UPDATE `items_users` SET `iznosMAX` = 1 WHERE `id` = "' . $iidtm . '" LIMIT 1'); + } else { + $no_open_itm = true; + $this->error = 'Требуется 8 ключей с поля битвы.'; + } + +} +unset($i5, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_91.php b/_incl_data/class/Magic/sunduk_91.php index 58c8c321..9594fbd7 100644 --- a/_incl_data/class/Magic/sunduk_91.php +++ b/_incl_data/class/Magic/sunduk_91.php @@ -1,17 +1,14 @@ †ажда †изни +6, '; - $this->addItem(3101,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= '‡вездная ’Яжесть, '; - $this->addItem(1462,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - - $io .= '—ек на 2 екрК, '; - $this->addItem(5018,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Жажда Жизни +6, '; +ItemsModel::addItem(3101, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); +$io .= 'Звездная Тяжесть, '; +ItemsModel::addItem(1462, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); +$io .= 'Чек на 2 екр, '; +ItemsModel::addItem(5018, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); diff --git a/_incl_data/class/Magic/sunduk_92.php b/_incl_data/class/Magic/sunduk_92.php index 40a28b0e..da283034 100644 --- a/_incl_data/class/Magic/sunduk_92.php +++ b/_incl_data/class/Magic/sunduk_92.php @@ -1,20 +1,19 @@ Чек на 5 ЕКР, '; - $this->addItem(5019,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Бутерброд -The Best Friend-, '; - $this->addItem(5010,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Звездное Сияние, '; - $this->addItem(1463,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Амброзия подмастерья Владык, '; - $this->addItem(5239,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Чек на 5 ЕКР, '; +ItemsModel::addItem(5019, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Бутерброд -The Best Friend-, '; +ItemsModel::addItem(5010, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Звездное Сияние, '; +ItemsModel::addItem(1463, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Амброзия подмастерья Владык, '; +ItemsModel::addItem(5239, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); diff --git a/_incl_data/class/Magic/sunduk_93.php b/_incl_data/class/Magic/sunduk_93.php index e735c7bf..798b5a35 100644 --- a/_incl_data/class/Magic/sunduk_93.php +++ b/_incl_data/class/Magic/sunduk_93.php @@ -1,25 +1,26 @@ Чек на 10 ЕКР, '; - $this->addItem(5020,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Амброзия Скучающих Владык, '; - $this->addItem(5069,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Эликсир Магического Искусства, '; - $this->addItem(4948,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $io .= 'Звездное Сияние, '; - $this->addItem(1463,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Жажда Жизни +6, '; - $this->addItem(3101,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - - $io .= 'Бутерброд -The Best Friend-, '; - $this->addItem(5010,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - -?> \ No newline at end of file +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Чек на 10 ЕКР, '; +ItemsModel::addItem(5020, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Амброзия Скучающих Владык, '; +ItemsModel::addItem(5069, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Эликсир Магического Искусства, '; +ItemsModel::addItem(4948, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Звездное Сияние, '; +ItemsModel::addItem(1463, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Жажда Жизни +6, '; +ItemsModel::addItem(3101, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + +$io .= 'Бутерброд -The Best Friend-, '; +ItemsModel::addItem(5010, $this->info['id'], '|nosale=1|sudba=' . $this->info['login']); + diff --git a/_incl_data/class/Magic/sunduk_bd.php b/_incl_data/class/Magic/sunduk_bd.php index bd0b77d5..7456093b 100644 --- a/_incl_data/class/Magic/sunduk_bd.php +++ b/_incl_data/class/Magic/sunduk_bd.php @@ -1,51 +1,54 @@ array(911,1172,2143,2144,1173), - //простые свитки - 1 => array(3043,2545,2709,874,2391), - //гарантированные - 2 => array(3044) - ); - - // 1000 екр. - 3-4 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/3 + новогодний эликсир 0/10 - $i4 = array( - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[0][rand(0,count($itmadd[0])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)], - $itmadd[1][rand(0,count($itmadd[1])-1)] - ); - - $i3 = array(); - - if( $u->info['level'] > 8 ) { - $i3[0] = $this->addItem(2143,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - $i3[1] = $this->addItem(2144,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - } - - $i3[3] = $this->addItem(4020,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - $i3[4] = $this->addItem(4035,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - $i3[5] = $this->addItem(3101,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - $i3[6] = $this->addItem(4041,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,($u->info['level']*2-10)); - $i3[7] = $this->addItem(4541,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,1); - $i3[8] = $this->addItem(4542,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,1); - $i3[9] = $this->addItem(3048,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,1); - $i3[10] = $this->addItem(3041,$this->info['id'],'|nosale=1|notr=1|sudba='.$this->info['login'],NULL,1); - mysql_query('UPDATE `items_users` SET `gift` = "Ангел",`gtxt1` = "С Днем Рождения! Поздравляем! Удачи в боях и жизни!" WHERE - `id` = "'.$i3[8].'" OR `id` = "'.$i3[9].'" OR `id` = "'.$i3[10].'" - LIMIT 1'); - - if($io == '') { - $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; - } - unset($itmadd,$i3,$i4); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +//воин +$itmadd = [ + //суперсвиток + 0 => [911, 1172, 2143, 2144, 1173], + //простые свитки + 1 => [3043, 2545, 2709, 874, 2391], + //гарантированные + 2 => [3044], +]; + +// 1000 екр. - 3-4 суперсвитка 0/20, 4 простых 0/100 + Эссенция Здоровья 0/3 + новогодний эликсир 0/10 +$i4 = [ + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[0][rand(0, count($itmadd[0]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], + $itmadd[1][rand(0, count($itmadd[1]) - 1)], +]; + +$i3 = []; + +if ($u->info['level'] > 8) { + $i3[0] = ItemsModel::addItem(2143, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); + $i3[1] = ItemsModel::addItem(2144, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); +} + +$i3[3] = ItemsModel::addItem(4020, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); +$i3[4] = ItemsModel::addItem(4035, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); +$i3[5] = ItemsModel::addItem(3101, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); +$i3[6] = ItemsModel::addItem(4041, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, ($u->info['level'] * 2 - 10)); +$i3[7] = ItemsModel::addItem(4541, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, 1); +$i3[8] = ItemsModel::addItem(4542, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, 1); +$i3[9] = ItemsModel::addItem(3048, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, 1); +$i3[10] = ItemsModel::addItem(3041, $this->info['id'], '|nosale=1|notr=1|sudba=' . $this->info['login'], null, 1); +mysql_query( + 'UPDATE `items_users` SET `gift` = "Ангел",`gtxt1` = "С Днем Рождения! Поздравляем! Удачи в боях и жизни!" WHERE + `id` = "' . $i3[8] . '" OR `id` = "' . $i3[9] . '" OR `id` = "' . $i3[10] . '" + LIMIT 1' +); + +if ($io == '') { + $io = 'Какие-то предметы добавлены к Вам в инвентарь...'; +} +unset($itmadd, $i3, $i4); diff --git a/_incl_data/class/Magic/sunduk_new.php b/_incl_data/class/Magic/sunduk_new.php index 6f97f343..c0e0c318 100644 --- a/_incl_data/class/Magic/sunduk_new.php +++ b/_incl_data/class/Magic/sunduk_new.php @@ -1,4 +1,7 @@ addItem(3200, $this->info['id'], '|nosale=1|noremont=1'); + $i3 = ItemsModel::addItem(3200, $this->info['id'], '|nosale=1|noremont=1'); setMentorGiftStatus($i3); //Эликсир - $i3 = $this->addItem(2418, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2418, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3201, $this->info['id']); + $i3 = ItemsModel::addItem(3201, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -41,19 +44,19 @@ if ($tr['var_id'] == 1) { $add_nas = 1; //Рубаха 3209 - $i3 = $this->addItem(3209, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3209, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Штаны 3210 - $i3 = $this->addItem(3210, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3210, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Эликсир - $i3 = $this->addItem(2418, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2418, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3202, $this->info['id']); + $i3 = ItemsModel::addItem(3202, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -65,19 +68,19 @@ if ($tr['var_id'] == 1) { $add_nas = 1; //Перчатки 3211 - $i3 = $this->addItem(3211, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3211, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Наручи 3212 - $i3 = $this->addItem(3212, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3212, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Эликсир - $i3 = $this->addItem(2418, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2418, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3203, $this->info['id']); + $i3 = ItemsModel::addItem(3203, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -89,23 +92,23 @@ if ($tr['var_id'] == 1) { $add_nas = 1; //Сапоги 3213 - $i3 = $this->addItem(3213, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3213, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Шлем 3214 - $i3 = $this->addItem(3214, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3214, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Пояс 3215 - $i3 = $this->addItem(3215, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3215, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Эликсир - $i3 = $this->addItem(2418, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2418, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3204, $this->info['id']); + $i3 = ItemsModel::addItem(3204, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -117,27 +120,27 @@ if ($tr['var_id'] == 1) { $add_nas = 1; //Серьги 3216 - $i3 = $this->addItem(3216, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3216, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Амулет 3217 - $i3 = $this->addItem(3217, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3217, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Кольца 3218 - $i3 = $this->addItem(3218, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3218, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); - $i3 = $this->addItem(3218, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3218, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); - $i3 = $this->addItem(3218, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(3218, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Эликсир - $i3 = $this->addItem(2418, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2418, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3205, $this->info['id']); + $i3 = ItemsModel::addItem(3205, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -149,15 +152,15 @@ if ($tr['var_id'] == 1) { $add_nas = 1; //Броня 4002 - $i3 = $this->addItem(4002, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4002, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Учебник воспитанника 4004 - $i3 = $this->addItem(4004, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4004, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Сумка воспитанника 4003 - $i3 = $this->addItem(4003, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4003, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Образы @@ -172,7 +175,7 @@ if ($tr['var_id'] == 1) { ); //Новый сундук - $i3 = $this->addItem(3206, $this->info['id']); + $i3 = ItemsModel::addItem(3206, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -184,19 +187,19 @@ if ($tr['var_id'] == 1) { $add_nas = 2; //Учебник воспитанника 4004 - $i3 = $this->addItem(4004, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4004, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Сумка воспитанника 4003 - $i3 = $this->addItem(4003, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4003, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Нападалка - $i3 = $this->addItem(865, $this->info['id'], '|nosale=1', null, 50); + $i3 = ItemsModel::addItem(865, $this->info['id'], '|nosale=1', null, 50); setMentorGiftStatus($i3); //Новый сундук - $i3 = $this->addItem(3207, $this->info['id']); + $i3 = ItemsModel::addItem(3207, $this->info['id']); setMentorGiftStatus($i3); if ($io == '') { @@ -208,21 +211,21 @@ if ($tr['var_id'] == 1) { $add_nas = 3; //Учебник воспитанника 4004 - $i3 = $this->addItem(4004, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4004, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Сумка воспитанника 4003 - $i3 = $this->addItem(4003, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(4003, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Нападалка - $i3 = $this->addItem(865, $this->info['id'], '|nosale=1', null, 50); + $i3 = ItemsModel::addItem(865, $this->info['id'], '|nosale=1', null, 50); setMentorGiftStatus($i3); //Восстановление - $i3 = $this->addItem(2712, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2712, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); - $i3 = $this->addItem(2712, $this->info['id'], '|nosale=1'); + $i3 = ItemsModel::addItem(2712, $this->info['id'], '|nosale=1'); setMentorGiftStatus($i3); //Образы @@ -245,7 +248,7 @@ if ($tr['var_id'] == 1) { if ($add_nas > 0 && $this->info['level'] < 8 && isset($refer['id'])) { $ino = 0; while ($ino < $add_nas) { - $this->addItem(4005, $refer['id']); + ItemsModel::addItem(4005, $refer['id']); $ino++; } diff --git a/_incl_data/class/Magic/sunduk_ov3.php b/_incl_data/class/Magic/sunduk_ov3.php index 9fc4195c..527f6026 100644 --- a/_incl_data/class/Magic/sunduk_ov3.php +++ b/_incl_data/class/Magic/sunduk_ov3.php @@ -1,46 +1,46 @@ info['id'],'|srok=43200|sudba='.$u->info['login'].''); - if($ov_item > 0) { - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - - //пропуск забытых - $ov_item = \User\ItemsModel::addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //жж6 - $ov_item = \User\ItemsModel::addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //лечение средних травм - $ov_item = \User\ItemsModel::addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //право на подвиг (бездна) - $ov_item = \User\ItemsModel::addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //право на подвиг (грибница) - $ov_item = \User\ItemsModel::addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //Лечение тяжелых травм - $ov_item = \User\ItemsModel::addItem(4414,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //право на подвиг (ПТП) - $ov_item = \User\ItemsModel::addItem(5036,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //право на подвиг (Катакомбы) - $ov_item = \User\ItemsModel::addItem(5037,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - //право на подвиг (Гора легиона) - $ov_item = \User\ItemsModel::addItem(5038,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].''); - mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "'.$ov_item.'" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - $u->error = 'Вы получили предметы:
Лечение легких травм, Лечение средних травм, Лечение тяжелых травм, пропуск забытых, жажда жизни +6
право на подвиг(бездна), право на подвиг(грибница), - право на подвиг(ПТП), право на подвиг(катакомбы), право на подвиг(Гора легиона)'; - - } +//лечение легких травм +$ov_item = ItemsModel::addItem(4412, $u->info['id'], '|srok=43200|sudba=' . $u->info['login'] . ''); +if ($ov_item > 0) { + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); -?> \ No newline at end of file + //пропуск забытых + $ov_item = ItemsModel::addItem(2412, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //жж6 + $ov_item = ItemsModel::addItem(3101, $u->info['id'], '|srok=3600|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //лечение средних травм + $ov_item = ItemsModel::addItem(4413, $u->info['id'], '|srok=43200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //право на подвиг (бездна) + $ov_item = ItemsModel::addItem(5035, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //право на подвиг (грибница) + $ov_item = ItemsModel::addItem(5039, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //Лечение тяжелых травм + $ov_item = ItemsModel::addItem(4414, $u->info['id'], '|srok=43200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //право на подвиг (ПТП) + $ov_item = ItemsModel::addItem(5036, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //право на подвиг (Катакомбы) + $ov_item = ItemsModel::addItem(5037, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + //право на подвиг (Гора легиона) + $ov_item = ItemsModel::addItem(5038, $u->info['id'], '|srok=43200|battleUseZd=7200|sudba=' . $u->info['login'] . ''); + mysql_query('UPDATE `items_users` SET `iznosMAX` = "1" WHERE `id` = "' . $ov_item . '" LIMIT 1'); + // + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); + $u->error = 'Вы получили предметы:
Лечение легких травм, Лечение средних травм, Лечение тяжелых травм, пропуск забытых, жажда жизни +6
право на подвиг(бездна), право на подвиг(грибница), + право на подвиг(ПТП), право на подвиг(катакомбы), право на подвиг(Гора легиона)'; + +} diff --git a/_incl_data/class/Magic/tankkom.php b/_incl_data/class/Magic/tankkom.php index d8b82397..7146249f 100644 --- a/_incl_data/class/Magic/tankkom.php +++ b/_incl_data/class/Magic/tankkom.php @@ -1,23 +1,24 @@ Предметы Танка 8-го уровня,'; - $this->addItem(558,$this->info['id'],'|sudba=0'); - $this->addItem(722,$this->info['id'],'|sudba=0'); - $this->addItem(718,$this->info['id'],'|sudba=0'); - $this->addItem(700,$this->info['id'],'|sudba=0'); - $this->addItem(291,$this->info['id'],'|sudba=0'); - $this->addItem(545,$this->info['id'],'|sudba=0'); - $this->addItem(533,$this->info['id'],'|sudba=0'); - $this->addItem(536,$this->info['id'],'|sudba=0'); - $this->addItem(628,$this->info['id'],'|sudba=0'); - $this->addItem(710,$this->info['id'],'|sudba=0'); - $this->addItem(654,$this->info['id'],'|sudba=0'); - $this->addItem(684,$this->info['id'],'|sudba=0'); - $this->addItem(689,$this->info['id'],'|sudba=0'); - $this->addItem(689,$this->info['id'],'|sudba=0'); - $this->addItem(689,$this->info['id'],'|sudba=0'); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Предметы Танка 8-го уровня,'; +ItemsModel::addItem(558, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(722, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(718, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(700, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(291, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(545, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(533, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(536, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(628, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(710, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(654, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(684, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(689, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(689, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(689, $this->info['id'], '|sudba=0'); diff --git a/_incl_data/class/Magic/toporkom.php b/_incl_data/class/Magic/toporkom.php index 6efdb57a..91676053 100644 --- a/_incl_data/class/Magic/toporkom.php +++ b/_incl_data/class/Magic/toporkom.php @@ -1,23 +1,24 @@ Предметы Силача 8-го уровня,'; - $this->addItem(552,$this->info['id'],'|sudba=0'); - $this->addItem(552,$this->info['id'],'|sudba=0'); - $this->addItem(716,$this->info['id'],'|sudba=0'); - $this->addItem(320,$this->info['id'],'|sudba=0'); - $this->addItem(291,$this->info['id'],'|sudba=0'); - $this->addItem(543,$this->info['id'],'|sudba=0'); - $this->addItem(528,$this->info['id'],'|sudba=0'); - $this->addItem(540,$this->info['id'],'|sudba=0'); - $this->addItem(627,$this->info['id'],'|sudba=0'); - $this->addItem(709,$this->info['id'],'|sudba=0'); - $this->addItem(653,$this->info['id'],'|sudba=0'); - $this->addItem(681,$this->info['id'],'|sudba=0'); - $this->addItem(687,$this->info['id'],'|sudba=0'); - $this->addItem(687,$this->info['id'],'|sudba=0'); - $this->addItem(687,$this->info['id'],'|sudba=0'); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Предметы Силача 8-го уровня,'; +ItemsModel::addItem(552, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(552, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(716, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(320, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(291, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(543, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(528, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(540, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(627, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(709, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(653, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(681, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(687, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(687, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(687, $this->info['id'], '|sudba=0'); diff --git a/_incl_data/class/Magic/tznanie.php b/_incl_data/class/Magic/tznanie.php index 1ab5d994..b4f7a607 100644 --- a/_incl_data/class/Magic/tznanie.php +++ b/_incl_data/class/Magic/tznanie.php @@ -1,74 +1,52 @@ info['id'].'" LIMIT 1'); -}else{ - $st['timeRead'] = 0; - //$tst = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.time().' AND `vars` = "read" LIMIT 1',1); - if(isset($tst['id'])) - { - //Уже что-то изучаем - $u->error = 'Так не пойдет, вы уже что-то изучаете'; - }else{ - $tst = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "read" AND `vals` = "'.$itm['item_id'].'" LIMIT 1',1); - if(isset($tst['id'])) - { - $u->error = 'Вы уже изучили данное знание'; - }else{ - $fn = ''; $tom_iz = 0; - if(($itm['item_id']>=1045 && $itm['item_id']<=1047) || ($itm['item_id']>=4812 && $itm['item_id']<=4813)) - { - $tst2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "read" AND `vals` = "'.($itm['item_id']-1).'" LIMIT 1',1); - if(!isset($tst2['id'])) - { - $tom_iz = 1; - } - unset($tst2); - } - /* - if( $itm['item_id'] == 4811 ) { - //5 том знаний, нужен 1047 - $tst2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "read" AND `vals` = "1047" LIMIT 1',1); - if(!isset($tst2['id'])) - { - $tom_iz = 1; - } - unset($tst2); - } - */ - if($tom_iz==0) - { - if(($itm['item_id']>=1044 && $itm['item_id']<=1047) || $itm['item_id']==4813 || $itm['item_id']==4812) - { - mysql_query('UPDATE `stats` SET `priemslot` = `priemslot` + 1 WHERE `id` = "'.$itm['uid'].'" LIMIT 1'); - $fn .= 'finish_file=tznanie'; - } - if($itm['item_id']==4811) - { - mysql_query('UPDATE `stats` SET `priemslot` = `priemslot` + 2 WHERE `id` = "'.$itm['uid'].'" LIMIT 1'); - $fn .= 'finish_file=tznanie'; - } - //$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`img2`,`no_Ace`) VALUES ("8","2","'.$u->info['id'].'","Изучение: '.$itm['name'].'","'.(time()+$st['timeRead']).'","'.$fn.'","'.$itm['img'].'","1")'); - //if($ins) - //{ - //$u->error = 'Вы начали изучать "'.$itm['name'].'". Время изучения составит '.$u->timeOut($st['timeRead']).''; - $u->error = 'Вы изучили "'.$itm['name'].'".'; - $u->addAction(time()+$st['timeRead'],'read',$itm['item_id']); - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - //}else{ - // $u->error = 'Что-то здесь не так'; - //} - }else{ - $u->error = 'Требует изучения предыдущего тома'; - } - unset($tom_iz); - } - } +if (isset($po['finish_file']) && $po['finish_file'] == 'tznanie') { + //Добавляем слот + mysql_query( + 'UPDATE `actions` SET `val` = "cast" WHERE (`vals` = "1044" OR `vals` = "1045" OR `vals` = "1046" OR `vals` = "1047") AND `val` != "cast" AND `vars` = "read" AND `uid` = "' . $u->info['id'] . '" LIMIT 1' + ); +} else { + $st['timeRead'] = 0; + + if (isset($tst['id'])) { + //Уже что-то изучаем + $u->error = 'Так не пойдет, вы уже что-то изучаете'; + } else { + $tst = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "read" AND `vals` = "' . $itm['item_id'] . '" LIMIT 1', 1); + if (isset($tst['id'])) { + $u->error = 'Вы уже изучили данное знание'; + } else { + $fn = ''; + $tom_iz = 0; + if (($itm['item_id'] >= 1045 && $itm['item_id'] <= 1047) || ($itm['item_id'] >= 4812 && $itm['item_id'] <= 4813)) { + $tst2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "read" AND `vals` = "' . ($itm['item_id'] - 1) . '" LIMIT 1', 1); + if (!isset($tst2['id'])) { + $tom_iz = 1; + } + unset($tst2); + } + + if ($tom_iz == 0) { + if (($itm['item_id'] >= 1044 && $itm['item_id'] <= 1047) || $itm['item_id'] == 4813 || $itm['item_id'] == 4812) { + mysql_query('UPDATE `stats` SET `priemslot` = `priemslot` + 1 WHERE `id` = "' . $itm['uid'] . '" LIMIT 1'); + $fn .= 'finish_file=tznanie'; + } + if ($itm['item_id'] == 4811) { + mysql_query('UPDATE `stats` SET `priemslot` = `priemslot` + 2 WHERE `id` = "' . $itm['uid'] . '" LIMIT 1'); + $fn .= 'finish_file=tznanie'; + } + + $u->error = 'Вы изучили "' . $itm['name'] . '".'; + $u->addAction(time() + $st['timeRead'], 'read', $itm['item_id']); + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); + + } else { + $u->error = 'Требует изучения предыдущего тома'; + } + unset($tom_iz); + } + } } -?> \ No newline at end of file diff --git a/_incl_data/class/Magic/uvortkom.php b/_incl_data/class/Magic/uvortkom.php index 68f67603..dd1aff91 100644 --- a/_incl_data/class/Magic/uvortkom.php +++ b/_incl_data/class/Magic/uvortkom.php @@ -1,23 +1,24 @@ Предметы Уворотчика 8-го уровня,'; - $this->addItem(523,$this->info['id'],'|sudba=0'); - $this->addItem(523,$this->info['id'],'|sudba=0'); - $this->addItem(712,$this->info['id'],'|sudba=0'); - $this->addItem(1151,$this->info['id'],'|sudba=0'); - $this->addItem(290,$this->info['id'],'|sudba=0'); - $this->addItem(541,$this->info['id'],'|sudba=0'); - $this->addItem(525,$this->info['id'],'|sudba=0'); - $this->addItem(539,$this->info['id'],'|sudba=0'); - $this->addItem(633,$this->info['id'],'|sudba=0'); - $this->addItem(707,$this->info['id'],'|sudba=0'); - $this->addItem(647,$this->info['id'],'|sudba=0'); - $this->addItem(680,$this->info['id'],'|sudba=0'); - $this->addItem(685,$this->info['id'],'|sudba=0'); - $this->addItem(685,$this->info['id'],'|sudba=0'); - $this->addItem(685,$this->info['id'],'|sudba=0'); -?> \ No newline at end of file + +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} + +$io .= 'Предметы Уворотчика 8-го уровня,'; +ItemsModel::addItem(523, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(523, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(712, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(1151, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(290, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(541, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(525, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(539, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(633, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(707, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(647, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(680, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(685, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(685, $this->info['id'], '|sudba=0'); +ItemsModel::addItem(685, $this->info['id'], '|sudba=0'); diff --git a/_incl_data/class/Quests.php b/_incl_data/class/Quests.php index cd2da8f0..7c81bac7 100644 --- a/_incl_data/class/Quests.php +++ b/_incl_data/class/Quests.php @@ -1,6 +1,7 @@ info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` != "go" LIMIT 1')); - $t .= 'Задержка между выполнением задания: ' . $u->timeOut($d['tr_zdr'] * 60 * 60); + $t .= 'Задержка между выполнением задания: ' . Conversion::secondsToTimeout($d['tr_zdr'] * 60 * 60); if ($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time() > 0) { - $t .= '(Осталось: ' . $u->timeOut($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time()) . ' ч.)'; + $t .= '(Осталось: ' . Conversion::secondsToTimeout($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time()) . ' ч.)'; } $t .= '
'; unset($qlst); @@ -421,7 +422,7 @@ class Quests $x6 = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`img` FROM `eff_main` WHERE `id2` = "' . $x7[0] . '" LIMIT 1')); if (isset($x6['id2'])) { $x5 .= ' '; +Время действия: ' . Conversion::secondsToTimeout($x7[1]) . '"> '; } $x4++; } diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index c9b29ba0..0dc4f61e 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -1473,7 +1473,7 @@ class User ) ); if (isset($v['id']) && $v['time'] + 60 * 60 > time()) { - $r .= ' '; } else { @@ -1485,7 +1485,7 @@ class User ) ); if (isset($v['id']) && $v['time'] + 60 * 60 > time()) { - $r .= ' '; } else { @@ -1495,16 +1495,6 @@ class User return $r; } - /** - * @param $ttm - * @return string - * @deprecated использовать ConversionHelper::secondsToTimeout() - */ - public function timeOut($ttm): string - { - return Conversion::secondsToTimeout($ttm); - } - public function insertAlign($an, $uid): void { if ($an <= 0) { @@ -2130,23 +2120,6 @@ class User //Расчет защиты (магия) - /** Для совместимости. Поиск по файлам $this->additem выдаёт сотни отсылок с видимо подключаемымим файлами - * в которых невозможно отследить зависимость и сделать полноценную замену. - * @param $id - * @param $uid - * @param $md - * @param $dn - * @param $mxiznos - * @param $nosudba - * @param $plavka - * @return int|mixed|string - * @deprecated use ItemsModel::addItem() - */ - public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null): mixed - { - return ItemsModel::addItem($id, $uid, $md, $dn, $mxiznos, $nosudba, $plavka); - } - public function newAct($test): bool { $r = true; @@ -3053,7 +3026,7 @@ class User if ($data['srok'] + $id['time_create'] - time() > 86400 + 30) { $this->error = 'Нельзя использовать на предметы с сроком годности 30 и более дней.'; } elseif ($id['inslot'] > 0 && $id['inslot'] < 20) { - $this->error = 'Срок годности предмета "' . $id['name'] . '" продлен на ' . $this->timeOut( + $this->error = 'Срок годности предмета "' . $id['name'] . '" продлен на ' . Conversion::secondsToTimeout( $add['uptimeitem'] ) . '.'; @@ -3121,11 +3094,11 @@ class User $data['sv_yron_min'] += $add['upatack']; $data['sv_yron_max'] += $add['upatack']; - - $this->addDelo( - 2, $this->info['id'], - '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', - time(), $this->info['city'], 'System.remont.upatack', 0, 0 + Delo::add( + 2, + 'System.remont.upatack', + $this->info['id'], + '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', ); $data = Conversion::arrayToDataString($data); @@ -3173,12 +3146,13 @@ class User } } - - $this->addDelo( - 2, $this->info['id'], - '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', - time(), $this->info['city'], 'System.remont.upatack', 0, 0 + Delo::add( + 2, + 'System.remont.upatack', + $u->info['id'], + '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', ); + $this->error = 'Заточка "' . $id['name'] . '" прошла успешно! Колка:' . $data['tya1'] . ' Руб:' . $data['tya2'] . ' Дробь:' . $data['tya3'] . ' Реж:' . $data['tya4'] . ' '; $data = Conversion::arrayToDataString($data); mysql_query( @@ -3663,13 +3637,13 @@ class User } } if ($po['battleUseZd'] > 0) { - $is2 .= '
Задержка использования: ' . $this->timeOut($po['battleUseZd']) . ''; + $is2 .= '
Задержка использования: ' . Conversion::secondsToTimeout($po['battleUseZd']) . ''; } if (isset($po['srok']) && $po['srok'] > 0) { $pl['srok'] = $po['srok']; } if ($pl['srok'] > 0) { //Срок годности предмета - $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']) . ' (до ' . date( + $is2 .= '
Срок годности: ' . Conversion::secondsToTimeout($pl['srok']) . ' (до ' . date( 'd.m.Y H:i', $pl['time_create'] + $pl['srok'] ) . ')'; } @@ -3683,7 +3657,7 @@ class User ) ); if (isset($efi['id2']) && $efi['actionTime'] > 0) { - $is2 .= '
Продолжительность действия: ' . $this->timeOut($efi['actionTime']); + $is2 .= '
Продолжительность действия: ' . Conversion::secondsToTimeout($efi['actionTime']); } } @@ -4226,7 +4200,7 @@ class User 'UPDATE `items_users` SET `time_create` = "' . $pl['time_create'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' ); } - $is2 .= '
Предмет будет недоступен через ' . $this->timeOut( + $is2 .= '
Предмет будет недоступен через ' . Conversion::secondsToTimeout( $pl['time_create'] - time() ) . '
'; } else { @@ -4234,7 +4208,7 @@ class User if (($pl['time_create'] - time() + 86400 * 30) < 1) { $is2 .= '
Предмет рассыпался у Вас на глазах...
'; } else { - $is2 .= '
Предмет исчезнет через ' . $this->timeOut( + $is2 .= '
Предмет исчезнет через ' . Conversion::secondsToTimeout( $pl['time_create'] - time() + 86400 * 30 ) . '
'; } @@ -4302,7 +4276,7 @@ class User } elseif ($type == 68) { $is1 .= 'Забрать
Отказаться'; if ($pl['lastUPD'] > 0) { - $is1 .= '

(' . $this->timeOut(($pl['lastUPD'] + 7 * 24 * 60 * 60) - time()) . ')'; + $is1 .= '

(' . Conversion::secondsToTimeout(($pl['lastUPD'] + 7 * 24 * 60 * 60) - time()) . ')'; } $is1 .= '
'; } elseif ($type == 67) { @@ -4835,25 +4809,6 @@ class User return round((Config::get('shop_type2') / 100), 2); } - /** - * @param $type - * @param $uid - * @param $txt - * @param @deprecated $tm - * @param @deprecated $ct - * @param $frm - * @param $mo - * @param @deprecated $mi - * @param false $vvv - * @return bool - * @deprecated использовать Delo::add(). - */ - public function addDelo($type, $uid, $txt, $tm, $ct, $frm, $mo, $mi, false $vvv = false): bool - { - Delo::add($type, $frm, $uid, $txt, $mo); - return true; - } - public function testBattle($id): bool { return !($id == 0 || Db::getValue('select count(*) from battle where id = ? and team_win > -1', [$id]) > 0); @@ -6002,17 +5957,19 @@ LIMIT 1' 'UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr ); $this->error = 'Предметы "' . $itm['name'] . ' (x' . ($col + 1) . ')" выброшены'; - $this->addDelo( - 1, $uid, - '"System.inventory": Предметы "' . $itm['name'] . ' (x' . $col . ')" [itm:' . $itm['id'] . '=' . time() . '] были выброшены.', time(), - $this->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $uid, + '"System.inventory": Предметы "' . $itm['name'] . ' (x' . $col . ')" [itm:' . $itm['id'] . '=' . time() . '] были выброшены.', ); } else { $this->error = 'Предмет "' . $itm['name'] . '" выброшен'; - $this->addDelo( - 1, $uid, - '"System.inventory": Предмет "' . $itm['name'] . '" [itm:' . $itm['id'] . '] был выброшен.', - time(), $this->info['city'], 'System.inventory', 0, 0 + Delo::add( + 1, + 'System.inventory', + $uid, + '"System.inventory": Предмет "' . $itm['name'] . '" [itm:' . $itm['id'] . '] был выброшен.', ); } return 1; diff --git a/_incl_data/class/quest/sellitemspodzem.php b/_incl_data/class/quest/sellitemspodzem.php index b159cdb8..8ab6af26 100644 --- a/_incl_data/class/quest/sellitemspodzem.php +++ b/_incl_data/class/quest/sellitemspodzem.php @@ -29,33 +29,36 @@ WHERE `iu`.`data` LIKE '%frompisher=1%' AND `iu`.`uid` = "3" AND `iu`.`delete` = $u->info['money1']; */ -$itmm=mysql_query('SELECT `iu`.`id` AS iid, `iu`.*, `im`.* +$itmm = mysql_query( + 'SELECT `iu`.`id` AS iid, `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id`=`im`.`id` -WHERE `iu`.`data` LIKE "%frompisher=1%" AND `iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18'); -$sell=0; -$selli=0; -while( $itm = mysql_fetch_array($itmm)) -{ - $sell += $itm['price1']; - $u->info['money1'] + $itm['price1']; - mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$itm['iid'].'" LIMIT 1'); - $selli++; +WHERE `iu`.`data` LIKE "%frompisher=1%" AND `iu`.`uid` = "' . $u->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18' +); +$sell = 0; +$selli = 0; +while ($itm = mysql_fetch_array($itmm)) { + $sell += $itm['price1']; + mysql_query('UPDATE `items_users` SET `delete`="' . time() . '" WHERE `id` = "' . $itm['iid'] . '" LIMIT 1'); + $selli++; } -if ($sell>0) -{ - mysql_query('UPDATE `users` SET `money`=`money`+"'.$sell.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $txt .= '
Забрала у тебя '.$selli.' вещей.'; - $txt .= '
Держи '.$sell.' кр. малец.'; - $txt .= '
Приноси еще - люблю я такие вещички!'; - $u->addDelo(1,$u->info['id'],'"Babka.'.$u->info['city'].'": Продал бабке "'.$selli.'" предметов за '.$sell.' кр.',time(),$u->info['city'],'Babka.'.$u->info['city'].'',(int)$sell,0); - mysql_query('UPDATE `users_achiv` SET `bv`= `bv`+'.$selli.' WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); -} -else -{ - $txt .= '
Нечего не принес бабушке!'; +if ($sell > 0) { + $u->addKr($sell); + + $txt .= '
Забрала у тебя ' . $selli . ' вещей.'; + $txt .= '
Держи ' . $sell . ' кр. малец.'; + $txt .= '
Приноси еще - люблю я такие вещички!'; + Delo::add( + 1, + 'Babka.' . $u->info['city'], + $u->info['id'], + '"Babka.' . $u->info['city'] . '": Продал бабке "' . $selli . '" предметов за ' . $sell . ' кр.', + (int)$sell + ); + mysql_query('UPDATE `users_achiv` SET `bv`= `bv`+' . $selli . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); +} else { + $txt .= '
Нечего не принес бабушке!'; } -unlink($sell,$itmm,$itm); -?> \ No newline at end of file +unlink($sell, $itmm, $itm); diff --git a/_incl_data/class/quest/transferpilchar.php b/_incl_data/class/quest/transferpilchar.php index e26b18ec..571c4131 100644 --- a/_incl_data/class/quest/transferpilchar.php +++ b/_incl_data/class/quest/transferpilchar.php @@ -18,59 +18,25 @@ 16 Штаны 17 Ботинки - items_main items_users - -SELECT `iu`.*, `im`.* -FROM `items_users` AS `iu` -LEFT JOIN `items_main` AS `im` -ON `iu`.`item_id`=`im`.`id` -WHERE `iu`.`data` LIKE '%frompisher=1%' AND `iu`.`uid` = "3" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18; - - -$u->info['money1']; */ -$itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_users` WHERE `item_id` = "6168" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0"')); -if ($itmm['total']>=50) -{ - mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `uid`="'.$u->info['id'].'" AND `item_id` = "6168" AND `delete` = 0 LIMIT 50;'); - \User\ItemsModel::addItem(6167,$u->info['id'],'|sudba='.$u->info['login']); - $itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_users` WHERE `item_id` = "6168" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0"')); - $txt .= '
Держи свиток сынок.
Спасибо за пыль но у тебя еще осталось: '.$itmm['total'].' шт.'; - $u->addDelo(1,$u->info['id'],'"Babka.'.$u->info['city'].'": Поменял у бабки пыль на свиток!',time(),$u->info['city'],'Babka.'.$u->info['city'].'',1,0); -} -else -{ - $txt .= '
Чтож ты бабушку так разочаровал
Недостаточно Призрачной Пыли! У тебя: '.$itmm['total'].' шт. милок.'; + +use User\ItemsModel; + +$itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_users` WHERE `item_id` = "6168" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0"')); +if ($itmm['total'] >= 50) { + mysql_query('UPDATE `items_users` SET `delete`="' . time() . '" WHERE `uid`="' . $u->info['id'] . '" AND `item_id` = "6168" AND `delete` = 0 LIMIT 50;'); + ItemsModel::addItem(6167, $u->info['id'], '|sudba=' . $u->info['login']); + $itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_users` WHERE `item_id` = "6168" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0"')); + $txt .= '
Держи свиток сынок.
Спасибо за пыль но у тебя еще осталось: ' . $itmm['total'] . ' шт.'; + Delo::add( + 1, + 'Babka.' . $u->info['city'], + $u->info['id'], + '"Babka.' . $u->info['city'] . '": Поменял у бабки пыль на свиток!', + 1 + ); +} else { + $txt .= '
Чтож ты бабушку так разочаровал
Недостаточно Призрачной Пыли! У тебя: ' . $itmm['total'] . ' шт. милок.'; } -/* -$itmm=mysql_query('SELECT `iu`.`id` AS iid, `iu`.*, `im`.* -FROM `items_users` AS `iu` -LEFT JOIN `items_main` AS `im` -ON `iu`.`item_id`=`im`.`id` -WHERE `iu`.`data` LIKE "%frompisher=1%" AND `iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18'); -$sell=0; -$selli=0; -while( $itm = mysql_fetch_array($itmm)) -{ - $sell += $itm['price1']; - $u->info['money1'] + $itm['price1']; - mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$itm['iid'].'" LIMIT 1'); - $selli++; -} -if ($sell>0) -{ - mysql_query('UPDATE `users` SET `money`=`money`+"'.$sell.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $txt .= '
Забрала у тебя '.$selli.' вещей.'; - $txt .= '
Держи '.$sell.' кр. малец.'; - $txt .= '
Приноси еще - люблю я такие вещички!'; - $u->addDelo(1,$u->info['id'],'"Babka.'.$u->info['city'].'": Продал бабке "'.$selli.'" предметов за '.$sell.' кр.',time(),$u->info['city'],'Babka.'.$u->info['city'].'',(int)$sell,0); - mysql_query('UPDATE `users_achiv` SET `bv`= `bv`+'.$selli.' WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); -} -else -{ - $txt .= '
Нечего не принес бабушке!'; -} -*/ -unlink($sell,$itmm,$itm); -?> \ No newline at end of file +unlink($sell, $itmm, $itm); diff --git a/_incl_data/crons/cshop_returnToOwner.php b/_incl_data/crons/cshop_returnToOwner.php index ec307921..8136d5f1 100644 --- a/_incl_data/crons/cshop_returnToOwner.php +++ b/_incl_data/crons/cshop_returnToOwner.php @@ -36,61 +36,38 @@ foreach (Db::getRows($q) as $row) { if ($row['inGroup']) { $col = $u->itemsX($row['id']); if ($col > 1) { - $stmt = Db::prepare(' -update items_users set inShop = 0, 1price = ? -where - item_id = ? and - inShop = 30 and - uid = ? and - inGroup = ? -limit ' . $col); + $stmt = Db::prepare( + 'update items_users set inShop = 0, 1price = ? + where item_id = ? and inShop = 30 and uid = ? and inGroup = ? limit ' . $col); + if ($stmt->execute([$row['price1'], $row['item_id'], $row['uid'], $row['inGroup']])) { - $ld = $u->addDelo( + Delo::add( 1, + SHOP_TYPE, $row['uid'], sprintf(RETURN_GROUP, $row['item_id'], $row['name'], $row['price1'], $row['inGroup'] . '+1'), - time(), - $u->info['city'], - SHOP_TYPE, - 0, - 0 ); } } else { - $stmt = Db::prepare(' -update items_users set inShop = 0, 1price = ? -where - uid = ? and - id = ? and - inOdet = 0 and - `delete` = 0 and - inShop = 30 - '); + $stmt = Db::prepare('update items_users set inShop = 0, 1price = ? + where uid = ? and id = ? and inOdet = 0 and `delete` = 0 and inShop = 30'); if ($stmt->execute([$row['price1'], $row['uid'], $row['id']])) { - $ld = $u->addDelo( + Delo::add( 1, + SHOP_TYPE, $row['uid'], sprintf(RETURN_ONE, $row['item_id'], $row['name'], $row['price1']), - time(), - $u->info['city'], - SHOP_TYPE, - 0, - 0 ); } } } else { $stmt = Db::prepare('update items_users set inShop = 0, 1price = ? where id = ? and inShop = 30'); if ($stmt->execute([$row['price1'], $row['id']])) { - $ld = $u->addDelo( + Delo::add( 1, + SHOP_TYPE, $row['uid'], sprintf(RETURN_ONE, $row['item_id'], $row['name'], $row['price1']), - time(), - $u->info['city'], - SHOP_TYPE, - 0, - 0 ); } } diff --git a/hmonitor.php b/hmonitor.php index 7925a658..b467a406 100644 --- a/hmonitor.php +++ b/hmonitor.php @@ -1,5 +1,7 @@ 0) { $html .= ''; } - $html .= 'Бой начнется через ' . $u->timeOut( + $html .= 'Бой начнется через ' . Conversion::secondsToTimeout( $pl['time'] + $pl['time_start'] - time() - ) . ', таймаут ' . $u->timeOut($pl['timeout']) . ''; + ) . ', таймаут ' . Conversion::secondsToTimeout($pl['timeout']) . ''; if ($pl['priz'] > 0) { $html .= '(Героическое Сражение)'; } @@ -122,7 +124,7 @@ while ($pl = mysql_fetch_array($sp)) { if ($pl['arand'] > 0) { $html .= ''; } - $html .= ', таймаут ' . $u->timeOut($pl['timeout']) . ''; + $html .= ', таймаут ' . Conversion::secondsToTimeout($pl['timeout']) . ''; if ($pl['priz'] > 0) { $html .= '(Героическое Сражение)'; } @@ -151,7 +153,7 @@ while ($pl = mysql_fetch_array($sp)) { //Ожидаем начала нового турнира $html .= ' Начало турнира в "Башне Смерти" : ' . date( 'd.m.Y H:i', $pl['time_start'] - ) . ' ( Начнется через ' . $u->timeOut( + ) . ' ( Начнется через ' . Conversion::secondsToTimeout( $pl['time_start'] - time() ) . ') Призовой фонд на текущий момент: ' . round( ($pl['money'] / 100 * 85), 2 diff --git a/modules_data/_clan_new.php b/modules_data/_clan_new.php index 109dd857..8a9eaa29 100644 --- a/modules_data/_clan_new.php +++ b/modules_data/_clan_new.php @@ -1,283 +1,336 @@ info['clan'])."' LIMIT 1")); - $cpr = explode('|',$u->info['clan_prava']); - if(isset($_POST['invite']) && ($u->info['clan_prava']=='glava' || $cpr[0]==1)) - { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."'")); - if($u->testAlign( $res['align'] , $data['id'] ) == 0 ) { - echo 'У персонажа стоит ограничение на смену склонности. Вы не можете выдать данную склонность!'; - }elseif($data['palpro'] < time()) { - echo 'Нельзя принимать в клан без проверки...'; - }elseif($data['clan']=='0' && $data['align']=='0') { - $u->insertAlign( $res['align'] , $data['id'] ); - mysql_query("UPDATE `users` SET `align` = '".$res['align']."',`clan` = '".(int)$u->info['clan']."' WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."';"); - if($res['money1']>=100) - { - $res['money1'] -= 100; - mysql_query("UPDATE `clan` SET `money1` = `money1` - 100 WHERE `id` = '".$res['id']."'"); - }else{ - mysql_query("UPDATE `users` SET `money` = `money` - 100 WHERE `id` = '".$u->info['id']."'"); - } - }else{ - echo 'Не выйдет...'; - } - } - if(isset($_POST['dissmis']) && ($u->info['clan_prava']=='glava' || $cpr[1]==1)) - { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."'")); - if($data['clan']==$u->info['clan'] && $data['clan_prava']!='glava') { - $u->deleteAlign( $data['align'] , $data['id'] ); - mysql_query("UPDATE `users` SET `clan` = '0',`align` = '0',`mod_zvanie` = '' WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."';"); - if($res['money1']>=30) - { - $res['money1'] -= 30; - mysql_query("UPDATE `clan` SET `money1` = `money1` - 30 WHERE `id` = '".$res['id']."'"); - }else{ - mysql_query("UPDATE `users` SET `money` = `money` - 30 WHERE `id` = '".$u->info['id']."'"); - } - }else{ - echo 'Не выйдет...'; - } - } - if(isset($_POST['rang']) && ($u->info['clan_prava']=='glava' || $cpr[2]==1)) - { - $data = mysql_fetch_array(mysql_query("SELECT `clan_prava`,`clan` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."'")); - if($data['clan']==$u->info['clan'] && $data['clan_prava']!='glava') { - mysql_query("UPDATE `users` SET `mod_zvanie` = '".mysql_real_escape_string($_POST['rang'])."' WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."';"); - }else{ - echo 'Не выйдет...'; - } - } - if(isset($_POST['persedit']) && ($u->info['clan_prava']=='glava' || $cpr[2]==1)) { - $data = mysql_fetch_array(mysql_query("SELECT `clan` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."';")); - if($data['clan']==$u->info['clan']) { - $edit=1; - $prava = mysql_fetch_array(mysql_query("SELECT `clan_prava`,`mod_zvanie` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['logingo'])."';")); - $edcpr = explode('|',$prava[0]); - }else{ - echo 'Не выйдет...'; - } - } - if($_POST['save'] && ($u->info['clan_prava']=='glava' || $cpr[2]==1)) { - - $st = strip_tags($_POST['status']); - /* - $st = str_replace('','',$st); - */ - - if ($_POST['priem']=='on') { $ecpr[0]=1; } else { $ecpr[0]=0;} - if ($_POST['vigon']=='on') { $ecpr[1]=1; } else { $ecpr[1]=0;} - if ($_POST['editpriv']=='on') { $ecpr[2]=1; } else { $ecpr[2]=0;} - if ($_POST['givekazna']=='on') { $ecpr[3]=1; } else { $ecpr[3]=0;} - if ($_POST['usekazna']=='on') { $ecpr[4]=1; } else { $ecpr[4]=0;} - $igogo = implode('|',$ecpr); - mysql_query("UPDATE `users` SET `mod_zvanie` = '".mysql_real_escape_string($st)."' WHERE `login` = '".mysql_real_escape_string($_POST['login'])."' AND `clan` = '".mysql_real_escape_string($res['id'])."' ORDER BY `id` ASC LIMIT 1"); - - $prava['mod_zvanie'] = $st; - if ($cpr[2]==1 || $u->info['clan_prava']=='glava') { - mysql_query("UPDATE `users` SET `clan_prava` = '".$igogo."' WHERE `login` = '".mysql_real_escape_string($_POST['login'])."' AND `clan` = '".mysql_real_escape_string($res['id'])."' AND `clan_prava` != 'glava' ORDER BY `id` ASC LIMIT 1"); - echo 'Права успешно изменены.'; - } - } - if($_POST['igogo'] && $_POST['lojit'] && ($u->info['clan_prava']=='glava' || $cpr[3]==1) ) { - $_POST['igogo'] = round($_POST['igogo'],2); - if($_POST['igogo']<0 OR $_POST['igogo']>$u->info['money']){echo'не-а';}else{ - if(mysql_query("UPDATE `clan` SET `money1` = `money1`+'".mysql_real_escape_string($_POST['igogo'])."' WHERE `id` = '".mysql_real_escape_string($u->info['clan'])."';")){echo'Успешно'; - mysql_query("UPDATE `users` SET `money`=`money`-'".mysql_real_escape_string($_POST['igogo'])."' WHERE `id` = '".mysql_real_escape_string($u->info['id'])."'"); - $u->addDelo(1,$u->info['id'],'"Clan'.$u->info['clan'].'.'.$u->info['city'].'": Положено '.mysql_real_escape_string($_POST['igogo']).' кр. в казну клана',time(),$u->info['city'],'Clan'.$u->info['clan'].'.'.$u->info['city'].'',0,0); - }else{echo'Что-то не так...';} - $res['money1']+=$_POST['igogo']; - } - } - if($_POST['igogo'] && $_POST['zabrat'] && ($u->info['clan_prava']=='glava' || $cpr[4]==1)) { - $_POST['igogo'] = round($_POST['igogo'],2); - if($_POST['igogo']<0){echo'не-а';}else{ - if($res['money1']<$_POST['igogo']){echo'не-а';}else{ - if(mysql_query("UPDATE `clan` SET `money1` = `money1`-'".mysql_real_escape_string($_POST['igogo'])."' WHERE `id` = '".mysql_real_escape_string($u->info['clan'])."';")){echo'Успешно'; - mysql_query("UPDATE `users` SET `money`=`money`+'".mysql_real_escape_string($_POST['igogo'])."' WHERE `id` = '".mysql_real_escape_string($u->info['id'])."'"); - $u->addDelo(1,$u->info['id'],'"Clan'.$u->info['clan'].'.'.$u->info['city'].'": Взято '.mysql_real_escape_string($_POST['igogo']).' кр. из казны клана',time(),$u->info['city'],'Clan'.$u->info['clan'].'.'.$u->info['city'].'',0,0); - }else{echo'Что-то не так...';} - $res['money1']-=$_POST['igogo']; - } - } - } - +use Core\Config; + +if (!defined('GAME')) { + die(); + +} +$res = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '" . mysql_real_escape_string($u->info['clan']) . "' LIMIT 1")); +$cpr = explode('|', $u->info['clan_prava']); +if (isset($_POST['invite']) && ($u->info['clan_prava'] == 'glava' || $cpr[0] == 1)) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "'")); + if ($u->testAlign($res['align'], $data['id']) == 0) { + echo 'У персонажа стоит ограничение на смену склонности. Вы не можете выдать данную склонность!'; + } elseif ($data['palpro'] < time()) { + echo 'Нельзя принимать в клан без проверки...'; + } elseif ($data['clan'] == '0' && $data['align'] == '0') { + $u->insertAlign($res['align'], $data['id']); + mysql_query("UPDATE `users` SET `align` = '" . $res['align'] . "',`clan` = '" . (int)$u->info['clan'] . "' WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "';"); + if ($res['money1'] >= 100) { + $res['money1'] -= 100; + mysql_query("UPDATE `clan` SET `money1` = `money1` - 100 WHERE `id` = '" . $res['id'] . "'"); + } else { + mysql_query("UPDATE `users` SET `money` = `money` - 100 WHERE `id` = '" . $u->info['id'] . "'"); + } + } else { + echo 'Не выйдет...'; + } +} +if (isset($_POST['dissmis']) && ($u->info['clan_prava'] == 'glava' || $cpr[1] == 1)) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "'")); + if ($data['clan'] == $u->info['clan'] && $data['clan_prava'] != 'glava') { + $u->deleteAlign($data['align'], $data['id']); + mysql_query("UPDATE `users` SET `clan` = '0',`align` = '0',`mod_zvanie` = '' WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "';"); + if ($res['money1'] >= 30) { + $res['money1'] -= 30; + mysql_query("UPDATE `clan` SET `money1` = `money1` - 30 WHERE `id` = '" . $res['id'] . "'"); + } else { + mysql_query("UPDATE `users` SET `money` = `money` - 30 WHERE `id` = '" . $u->info['id'] . "'"); + } + } else { + echo 'Не выйдет...'; + } +} +if (isset($_POST['rang']) && ($u->info['clan_prava'] == 'glava' || $cpr[2] == 1)) { + $data = mysql_fetch_array(mysql_query("SELECT `clan_prava`,`clan` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "'")); + if ($data['clan'] == $u->info['clan'] && $data['clan_prava'] != 'glava') { + mysql_query("UPDATE `users` SET `mod_zvanie` = '" . mysql_real_escape_string($_POST['rang']) . "' WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "';"); + } else { + echo 'Не выйдет...'; + } +} +if (isset($_POST['persedit']) && ($u->info['clan_prava'] == 'glava' || $cpr[2] == 1)) { + $data = mysql_fetch_array(mysql_query("SELECT `clan` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "';")); + if ($data['clan'] == $u->info['clan']) { + $edit = 1; + $prava = mysql_fetch_array(mysql_query("SELECT `clan_prava`,`mod_zvanie` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['logingo']) . "';")); + $edcpr = explode('|', $prava[0]); + } else { + echo 'Не выйдет...'; + } +} +if ($_POST['save'] && ($u->info['clan_prava'] == 'glava' || $cpr[2] == 1)) { + + $st = strip_tags($_POST['status']); + + if ($_POST['priem'] == 'on') { + $ecpr[0] = 1; + } else { + $ecpr[0] = 0; + } + if ($_POST['vigon'] == 'on') { + $ecpr[1] = 1; + } else { + $ecpr[1] = 0; + } + if ($_POST['editpriv'] == 'on') { + $ecpr[2] = 1; + } else { + $ecpr[2] = 0; + } + if ($_POST['givekazna'] == 'on') { + $ecpr[3] = 1; + } else { + $ecpr[3] = 0; + } + if ($_POST['usekazna'] == 'on') { + $ecpr[4] = 1; + } else { + $ecpr[4] = 0; + } + + $igogo = implode('|', $ecpr); + mysql_query( + "UPDATE `users` SET `mod_zvanie` = '" . mysql_real_escape_string($st) . "' WHERE `login` = '" . mysql_real_escape_string($_POST['login']) . "' AND `clan` = '" . mysql_real_escape_string( + $res['id'] + ) . "' ORDER BY `id` ASC LIMIT 1" + ); + + $prava['mod_zvanie'] = $st; + if ($cpr[2] == 1 || $u->info['clan_prava'] == 'glava') { + mysql_query( + "UPDATE `users` SET `clan_prava` = '" . $igogo . "' WHERE `login` = '" . mysql_real_escape_string($_POST['login']) . "' AND `clan` = '" . mysql_real_escape_string( + $res['id'] + ) . "' AND `clan_prava` != 'glava' ORDER BY `id` ASC LIMIT 1" + ); + echo 'Права успешно изменены.'; + } +} +if ($_POST['igogo'] && $_POST['lojit'] && ($u->info['clan_prava'] == 'glava' || $cpr[3] == 1)) { + $_POST['igogo'] = round($_POST['igogo'], 2); + if ($_POST['igogo'] < 0 or $_POST['igogo'] > $u->info['money']) { + echo 'не-а'; + } else { + if (mysql_query("UPDATE `clan` SET `money1` = `money1`+'" . mysql_real_escape_string($_POST['igogo']) . "' WHERE `id` = '" . mysql_real_escape_string($u->info['clan']) . "';")) { + echo 'Успешно'; + mysql_query("UPDATE `users` SET `money`=`money`-'" . mysql_real_escape_string($_POST['igogo']) . "' WHERE `id` = '" . mysql_real_escape_string($u->info['id']) . "'"); + Delo::add( + 1, + 'Clan' . $u->info['clan'] . '.' . $u->info['city'], + $u->info['id'], + '"Clan' . $u->info['clan'] . '.' . $u->info['city'] . + '": Положено ' . mysql_real_escape_string($_POST['igogo']) . ' кр. в казну клана', + ); + } else { + echo 'Что-то не так...'; + } + $res['money1'] += $_POST['igogo']; + } +} +if ($_POST['igogo'] && $_POST['zabrat'] && ($u->info['clan_prava'] == 'glava' || $cpr[4] == 1)) { + $_POST['igogo'] = round($_POST['igogo'], 2); + if ($_POST['igogo'] < 0) { + echo 'не-а'; + } else { + if ($res['money1'] < $_POST['igogo']) { + echo 'не-а'; + } else { + if (mysql_query("UPDATE `clan` SET `money1` = `money1`- " . (int)$_POST['igogo'] . " WHERE `id` = " . $u->info['clan'])) { + echo 'Успешно'; + $u->addKr((int)$_POST['igogo']); + Delo::add( + 1, + 'Clan' . $u->info['clan'] . '.' . $u->info['city'], + $u->info['id'], + '"Clan' . $u->info['clan'] . '.' . $u->info['city'] . + '": Взято ' . $_POST['igogo'] . ' кр. из казны клана', + ); + } else { + echo 'Что-то не так...'; + } + $res['money1'] -= $_POST['igogo']; + } + } +} + ?> - + -

-
+
+
+
+
+

+ + +

+
+ + +
- + - +
-Казна клана: кр. -
- -info['clan_prava']=='glava'){?> - -info['clan_prava']=='glava'){?> - - -
-

-info['clan_prava'] == 'glava' || $cpr[0]==1) { ?> - -(Это обойдется вам в 100 кр.)
-(Перед приемом в клан,персонаж должен пройти проверку у паладинов)
-info['clan_prava'] == 'glava' || $cpr[1]==1) { ?> - -(Это обойдется вам в 30 кр.)
-info['clan_prava'] == 'glava' || $cpr[2]==1) { ?> - -


- - +
+ Казна клана: кр. +
+ + info['clan_prava'] == 'glava') { ?> + + info['clan_prava'] == 'glava') { ?> + + +
+

+ info['clan_prava'] == 'glava' || $cpr[0] == 1) { ?> + + (Это обойдется вам в 100 кр.)
+ (Перед приемом в клан,персонаж должен пройти проверку у паладинов)
+ info['clan_prava'] == 'glava' || $cpr[1] == 1) { ?> + + (Это обойдется вам в 30 кр.)
+ info['clan_prava'] == 'glava' || $cpr[2] == 1) { ?> + + +


+ + -Редактирование прав '.htmlspecialchars($_POST['logingo'],NULL).'
-Звание в клане
-Прием в клан
-Изгнание из клана
-Редактирование прав
-Пополнение казны клана
-Использование казны клана
+Редактирование прав ' . htmlspecialchars($_POST['logingo'], null) . '
+Звание в клане
+Прием в клан
Изгнание из клана
Редактирование прав
Пополнение казны клана
Использование казны клана
- + '; -} -?> -
+ } + ?> + -
-
-

/i/lock.gif WIDTH=20 HEIGHT=15 ALT="Приватно"> Соклановцы

- - - - -
-info['clan'])."' ORDER BY `online` DESC"); -while($data = mysql_fetch_array($res1)) { - if ($data['online']>time()-120) { - echo ' - '.$data['login'].' ['.$data['level'].']'; - if ($data['clan_prava'] == 'glava') { - echo ' - Глава клана'; - } else { - echo ' - ',$data['mod_zvanie'],''; - } - echo '
'; - } - elseif ($data['online'] - '.$data['login'].' ['.$data['level'].']'; - if ($data['clan_prava'] == 'glava') { - echo ' - Глава клана'; - } else { - echo ' - ',$data['mod_zvanie'],''; - } - echo '
'; - } -//echo ''.$data['login'].' ['.$data['level'].'] - '.$data['mod_zvanie'].'
'; -} -?> -
-
- -
-(список обновляется в полночь каждый раз) -

-
+ + + +
+
+

+ + /i/lock.gif WIDTH=20 HEIGHT=15 ALT="Приватно"> + + Соклановцы +

+ + + + +
+ info['clan'] + ) . "' ORDER BY `online` DESC" + ); + while ($data = mysql_fetch_array($res1)) { + if ($data['online'] > time() - 120) { + echo ' + ' . $data['login'] . ' [' . $data['level'] . ']'; + if ($data['clan_prava'] == 'glava') { + echo ' - Глава клана'; + } else { + echo ' - ', $data['mod_zvanie'], ''; + } + echo '
'; + } elseif ($data['online'] < time() - 120) { + echo ' + ' . $data['login'] . ' [' . $data['level'] . ']'; + if ($data['clan_prava'] == 'glava') { + echo ' - Глава клана'; + } else { + echo ' - ', $data['mod_zvanie'], ''; + } + echo '
'; + } + } + ?> +
+
+
+
+ +
- \ No newline at end of file + diff --git a/modules_data/_newanimal.php b/modules_data/_newanimal.php index 3f3c4bde..14d545c5 100644 --- a/modules_data/_newanimal.php +++ b/modules_data/_newanimal.php @@ -1,444 +1,456 @@ - var elem = document.getElementById('se-pre-con'); - elem.parentNode.removeChild(elem); - - "; -if(!defined('GAME')) { - die(); +echo ""; +if (!defined('GAME')) { + die(); } -$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1')); -if(!isset($slot['id'])) { - if( mysql_query('INSERT INTO `users_animal_slot` ( `uid`,`slots`,`ekr` ) VALUES ( "'.$u->info['id'].'","2","0" )') ) { - $slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1')); - }else{ - $u->error = 'Ошибка в работе базы данных...'; - } +$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "' . $u->info['id'] . '" LIMIT 1')); +if (!isset($slot['id'])) { + if (mysql_query('INSERT INTO `users_animal_slot` ( `uid`,`slots`,`ekr` ) VALUES ( "' . $u->info['id'] . '","2","0" )')) { + $slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "' . $u->info['id'] . '" LIMIT 1')); + } else { + $u->error = 'Ошибка в работе базы данных...'; + } } $slot['price_next'] = 5; -$petox = mysql_fetch_array(mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1')); +$petox = mysql_fetch_array(mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "' . $u->info['id'] . '" LIMIT 1')); $petox = $petox[0]; -$an_eda = array( - 0.05, - 0.07, - 0.10, - 0.15, - 0.20, - 0.30, - 0.40, - 0.50, - 0.60, - 0.70, - 0.80, - 1.00, - 1.50, - 2.00, - 2.50, - 3.00, - 3.50, - 4.00, - 4.50, - 5.00, - 5.50, - 7.00 -); +$an_eda = [ + 0.05, + 0.07, + 0.10, + 0.15, + 0.20, + 0.30, + 0.40, + 0.50, + 0.60, + 0.70, + 0.80, + 1.00, + 1.50, + 2.00, + 2.50, + 3.00, + 3.50, + 4.00, + 4.50, + 5.00, + 5.50, + 7.00, +]; -function en_ru($txt) { - $g = false; - $en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt); - $ru = preg_match("/^(([0-9а-яА-Я _-])+)$/i", $txt); - if(($ru && $en) || (!$ru && !$en)) { - $g = true; - } - return $g; +function en_ru($txt) +{ + $g = false; + $en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt); + $ru = preg_match("/^(([0-9а-яА-Я _-])+)$/i", $txt); + if (($ru && $en) || (!$ru && !$en)) { + $g = true; + } + return $g; } + // -function testBad($txt) { - $white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёйцукенгшщзхъфывапролджэячсмитьбю'; - $r = false; - $i = 0; - while( $i != -1 ) { - if( isset($txt[$i]) ) { - $g = false; - $j = 0; - while( $j != -1 ) { - if(isset($white[$j])) { - if( $white[$j] == $txt[$i] ) { - $g = true; - } - }else{ - $j = -2; - } - $j++; - } - if( $g == false ) { - $r = true; - } - }else{ - $i = -2; - } - $i++; - } - return $r; +function testBad($txt) +{ + $white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёйцукенгшщзхъфывапролджэячсмитьбю'; + $r = false; + $i = 0; + while ($i != -1) { + if (isset($txt[$i])) { + $g = false; + $j = 0; + while ($j != -1) { + if (isset($white[$j])) { + if ($white[$j] == $txt[$i]) { + $g = true; + } + } else { + $j = -2; + } + $j++; + } + if (!$g) { + $r = true; + } + } else { + $i = -2; + } + $i++; + } + return $r; } -function is_login_an($login) { - $r = true; - // - $login = htmlspecialchars($login,NULL); - // - $bad = array( - 'Мусорщик' => 1, - 'Мироздатель' => 1 - ); - // - //$login_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($login).'" LIMIT 1')); - //$login_an_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users_animal` WHERE `name` = "'.mysql_real_escape_string($login).'" LIMIT 1')); - if( isset($login_db['id']) || isset($login_an_db['id']) || isset($bad[$login]) ) { - $r = false; - }else{ - $true = true; - // - /* - Логин может содержать от 2 до 16 символов, и состоять только из букв русского ИЛИ английского алфавита, цифр, символов '_', '-' и пробела. - Логин не может начинаться или заканчиваться символами '_', '-' или пробелом. - */ - // - $login = str_replace(' ',' ',$login); - $login = str_replace('%',' ',$login); - $login = str_replace(' ',' ',$login); - // - if( strlen($login) > 16 ) { - $true = false; - }elseif( strlen($login) < 2 ) { - $true = false; - }elseif( strripos($login,' ') == true ) { - $true = false; - }elseif( substr($login,1) == ' ' || substr($login,-1) == ' ' ) { - $true = false; - }elseif( substr($login,1) == '-' || substr($login,-1) == '-' ) { - $true = false; - }elseif( substr($login,1) == '_' || substr($login,-1) == '_' ) { - $true = false; - }elseif( testBad($login) == true ) { - $true = false; - }elseif( en_ru(str_replace('ё','е',str_replace('Ё','Е',$login))) == true ) { - $true = false; - } - // - if( $true == false ) { - $r = false; - }else{ - $r = true; - } - } - return $r; +function is_login_an($login) +{ + $r = true; + // + $login = htmlspecialchars($login, null); + // + $bad = [ + 'Мусорщик' => 1, + 'Мироздатель' => 1, + ]; + // + if (isset($login_db['id']) || isset($login_an_db['id']) || isset($bad[$login])) { + $r = false; + } else { + $true = true; + // + /* + Логин может содержать от 2 до 16 символов, и состоять только из букв русского ИЛИ английского алфавита, цифр, символов '_', '-' и пробела. + Логин не может начинаться или заканчиваться символами '_', '-' или пробелом. + */ + // + $login = str_replace(' ', ' ', $login); + $login = str_replace('%', ' ', $login); + $login = str_replace(' ', ' ', $login); + // + if (strlen($login) > 16) { + $true = false; + } elseif (strlen($login) < 2) { + $true = false; + } elseif (strripos($login, ' ') == true) { + $true = false; + } elseif (substr($login, 1) == ' ' || substr($login, -1) == ' ') { + $true = false; + } elseif (substr($login, 1) == '-' || substr($login, -1) == '-') { + $true = false; + } elseif (substr($login, 1) == '_' || substr($login, -1) == '_') { + $true = false; + } elseif (testBad($login) == true) { + $true = false; + } elseif (en_ru(str_replace('ё', 'е', str_replace('Ё', 'Е', $login))) == true) { + $true = false; + } + // + if (!$true) { + $r = false; + } + } + return $r; } -if(isset($_GET['buy_slot'])) { - if($u->info['money2'] < $slot['price_nex']) { - $u->error = 'Недостаточно денег'; - }elseif($u->info['money2'] < 5 ) { - $u->error = 'Недостаточно екр!'; - }elseif( isset($slot['id']) && $slot['slots'] < 7 ) { - $slot['slots']++; - $u->info['money2'] -= 5; - mysql_query('UPDATE `users_animal_slot` SET `slots` = "'.$slot['slots'].'" WHERE `id` = "'.$slot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->error = 'Куплен слот для зверя.'; - }else{ - $u->error = 'Нельзя купить больше слотов'; - } -}elseif(isset($_GET['pet'])) { - $_GET['pet'] = round((int)$_GET['pet']); - $_GET['petname'] = htmlspecialchars($_GET['petname'],NULL); - $ax = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1')); - $ax = $ax[0]; - if( $_GET['pet'] < 1 || $_GET['pet'] > 7 ) { - $u->error = 'Нельзя привзвать такого зверя'; - }elseif( $ax >= $slot['slots'] ) { - $u->error = 'Нет свободных слотов для зверя'; - }elseif( $u->info['money'] < 50 ) { - $u->error = 'Недостаточно денег'; - }elseif(is_login_an($_GET['petname']) == false) { - $u->error = 'Неверная кличка зверя, выберите другую'; - }else{ - $u->error = 'Зверь пришел к Вам!'; - $u->info['money'] -= 50; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - $anm['type'] = $_GET['pet']; - // - if($anm['type']==1) - { - $anm['name'] = 'Кот'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'20864.gif',2=>'21301.gif',3=>'21139.gif',4=>'20427.gif'); - $anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==2) - { - $anm['name'] = 'Сова'; - $anm['sex'] = 1; - $anm['obraz'] = array(1=>'21415.gif',2=>'21722.gif',3=>'21550.gif'); - $anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==3) - { - $anm['name'] = 'Светляк'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'22277.gif',2=>'22265.gif',3=>'22333.gif',4=>'22298.gif'); - $anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==4) - { - $anm['name'] = 'Чертяка'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'22177.gif',2=>'21976.gif',3=>'21877.gif'); - $anm['stats'] = 's1=25|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==5) - { - $anm['name'] = 'Пес'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'22352.gif',2=>'23024.gif',3=>'22900.gif',4=>'22501.gif',5=>'22700.gif'); - $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==6) - { - $anm['name'] = 'Свин'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'24000.gif',2=>'25000.gif',3=>'27000.gif',4=>'28000.gif'); - $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; - }elseif($anm['type']==7) - { - $anm['name'] = 'Дракон'; - $anm['sex'] = 0; - $anm['obraz'] = array(1=>'21338_pgtpdbx.gif'); - $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; - } - // - $anm['name'] = htmlspecialchars($_GET['petname'],NULL); - $anm['name'] = preg_replace("/&#?[a-z0-9]+;/i","", $anm['name']); - // - $anm['obraz'] = $anm['obraz'][rand(1,count($anm['obraz']))]; - $anm['obraz'] = str_replace('.gif','',$anm['obraz']); - $anm['obraz'] = str_replace('.jpg','',$anm['obraz']); - $anm['obraz'] = str_replace('.png','',$anm['obraz']); - $ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`,`eda`) VALUES ("'.$anm['type'].'","'.$anm['name'].'","'.$u->info['id'].'","'.$anm['obraz'].'","'.$anm['stats'].'","'.$anm['sex'].'","0")'); - if($ins) - { - $u->addDelo(1,$u->info['id'],'"System.inventory": Персонаж призвал зверя "'.$_GET['petname'].'" ('.$_GET['pet'].') - 50 кр.',time(),$u->info['city'],'System.inventory',0,0); - }else{ - $u->error = 'Не удалось призвать зверя, что-то здесь не так ...'; - } - // - } - // -}elseif(isset($_GET['eda'])) { - $anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['eda']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1')); - $x = round((int)$_GET['vvv']); - if($x > 100 - $anm['eda']) { $x = 100 - $anm['eda']; } - if($x < 1) { $x = 1; } - if($x > 100) { $x = 100; } - if(!isset($anm['id'])) { - $u->error = 'Зверь не найден.'; - }elseif( $anm['eda'] >= 100 ) { - $u->error = 'Зверь сыт и не нуждается в еде.'; - }elseif($an_eda[$anm['level']]*$_GET['vvv'] > $u->info['money']) { - $u->error = 'Недостаточно денег.'; - }else{ - $u->error = 'Покормили зверя "'.$anm['name'].'" на '.$x.' ед. за '.($x*$an_eda[$anm['level']]).' кр.'; - $u->info['money'] -= ($x*$an_eda[$anm['level']]); - $anm['eda'] += $x; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users_animal` SET `eda` = "'.$anm['eda'].'" WHERE `id` = "'.$anm['id'].'" LIMIT 1'); - } -}elseif(isset($_GET['pet_del'])) { - if(mysql_query('UPDATE `users_animal` SET `delete` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($_GET['pet_del']).'" AND `delete` = 0 AND `uid` = "'.$u->info['id'].'" LIMIT 1')) { - $u->error = 'Зверь был выгнан.'; - }else{ - $u->error = 'Зверь не найден.'; - } -}elseif(isset($_GET['rename'])) { - $anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['rename']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1')); - $_GET['vvv'] = htmlspecialchars($_GET['vvv'],NULL); - if(!isset($anm['id'])) { - $u->error = 'Зверь не найден.'; - }elseif(30 > $u->info['money']) { - $u->error = 'Недостаточно денег.'; - }else{ - $u->info['money'] -= 30; - $anm['name'] = preg_replace('/\W/', '', $_GET['vvv']); //$_GET['vvv']; - $u->error = 'Кличка зверя изменена на "'.$anm['name'].'" за 30 кр.'; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users_animal` SET `name` = "'.mysql_real_escape_string($anm['name']).'" WHERE `id` = "'.mysql_real_escape_string($anm['id']).'" LIMIT 1'); - } -}elseif(isset($_GET['shadow']) && $petox > 0) { - if(isset($_GET['rechange'])) { - $u->error = 'Образ питомца снят.'; - mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"'); - }elseif(isset($_GET['change'])) { - $u->error = 'Образ питомца установлен.'; - mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"'); - mysql_query('UPDATE `obraz_pet` SET `use` = 1 WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.mysql_real_escape_string($_GET['change']).'" LIMIT 1'); - } +if (isset($_GET['buy_slot'])) { + if ($u->info['money2'] < $slot['price_nex']) { + $u->error = 'Недостаточно денег'; + } elseif ($u->info['money2'] < 5) { + $u->error = 'Недостаточно екр!'; + } elseif (isset($slot['id']) && $slot['slots'] < 7) { + $slot['slots']++; + $u->info['money2'] -= 5; + mysql_query('UPDATE `users_animal_slot` SET `slots` = "' . $slot['slots'] . '" WHERE `id` = "' . $slot['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money2` = "' . $u->info['money2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->error = 'Куплен слот для зверя.'; + } else { + $u->error = 'Нельзя купить больше слотов'; + } +} elseif (isset($_GET['pet'])) { + $_GET['pet'] = round((int)$_GET['pet']); + $_GET['petname'] = htmlspecialchars($_GET['petname'], null); + $ax = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users_animal` WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 LIMIT 1')); + $ax = $ax[0]; + if ($_GET['pet'] < 1 || $_GET['pet'] > 7) { + $u->error = 'Нельзя привзвать такого зверя'; + } elseif ($ax >= $slot['slots']) { + $u->error = 'Нет свободных слотов для зверя'; + } elseif ($u->info['money'] < 50) { + $u->error = 'Недостаточно денег'; + } elseif (!is_login_an($_GET['petname'])) { + $u->error = 'Неверная кличка зверя, выберите другую'; + } else { + $u->error = 'Зверь пришел к Вам!'; + $u->info['money'] -= 50; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + // + $anm['type'] = $_GET['pet']; + // + if ($anm['type'] == 1) { + $anm['name'] = 'Кот'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '20864.gif', 2 => '21301.gif', 3 => '21139.gif', 4 => '20427.gif']; + $anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 2) { + $anm['name'] = 'Сова'; + $anm['sex'] = 1; + $anm['obraz'] = [1 => '21415.gif', 2 => '21722.gif', 3 => '21550.gif']; + $anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 3) { + $anm['name'] = 'Светляк'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '22277.gif', 2 => '22265.gif', 3 => '22333.gif', 4 => '22298.gif']; + $anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 4) { + $anm['name'] = 'Чертяка'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '22177.gif', 2 => '21976.gif', 3 => '21877.gif']; + $anm['stats'] = 's1=25|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 5) { + $anm['name'] = 'Пес'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '22352.gif', 2 => '23024.gif', 3 => '22900.gif', 4 => '22501.gif', 5 => '22700.gif']; + $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 6) { + $anm['name'] = 'Свин'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '24000.gif', 2 => '25000.gif', 3 => '27000.gif', 4 => '28000.gif']; + $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; + } elseif ($anm['type'] == 7) { + $anm['name'] = 'Дракон'; + $anm['sex'] = 0; + $anm['obraz'] = [1 => '21338_pgtpdbx.gif']; + $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10'; + } + // + $anm['name'] = htmlspecialchars($_GET['petname'], null); + $anm['name'] = preg_replace("/&#?[a-z0-9]+;/i", "", $anm['name']); + // + $anm['obraz'] = $anm['obraz'][rand(1, count($anm['obraz']))]; + $anm['obraz'] = str_replace('.gif', '', $anm['obraz']); + $anm['obraz'] = str_replace('.jpg', '', $anm['obraz']); + $anm['obraz'] = str_replace('.png', '', $anm['obraz']); + $ins = mysql_query( + 'INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`,`eda`) VALUES ("' . $anm['type'] . '","' . $anm['name'] . '","' . $u->info['id'] . '","' . $anm['obraz'] . '","' . $anm['stats'] . '","' . $anm['sex'] . '","0")' + ); + if ($ins) { + Delo::add( + 1, + 'System.inventory', + $u->info['id'], + '"System.inventory": Персонаж призвал зверя "' . $_GET['petname'] . '" (' . $_GET['pet'] . ') - 50 кр.', + ); + } else { + $u->error = 'Не удалось призвать зверя, что-то здесь не так ...'; + } + // + } + // +} elseif (isset($_GET['eda'])) { + $anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "' . mysql_real_escape_string($_GET['eda']) . '" AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 LIMIT 1')); + $x = round((int)$_GET['vvv']); + if ($x > 100 - $anm['eda']) { + $x = 100 - $anm['eda']; + } + if ($x < 1) { + $x = 1; + } + if ($x > 100) { + $x = 100; + } + if (!isset($anm['id'])) { + $u->error = 'Зверь не найден.'; + } elseif ($anm['eda'] >= 100) { + $u->error = 'Зверь сыт и не нуждается в еде.'; + } elseif ($an_eda[$anm['level']] * $_GET['vvv'] > $u->info['money']) { + $u->error = 'Недостаточно денег.'; + } else { + $u->error = 'Покормили зверя "' . $anm['name'] . '" на ' . $x . ' ед. за ' . ($x * $an_eda[$anm['level']]) . ' кр.'; + $u->info['money'] -= ($x * $an_eda[$anm['level']]); + $anm['eda'] += $x; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users_animal` SET `eda` = "' . $anm['eda'] . '" WHERE `id` = "' . $anm['id'] . '" LIMIT 1'); + } +} elseif (isset($_GET['pet_del'])) { + if (mysql_query( + 'UPDATE `users_animal` SET `delete` = "' . time() . '" WHERE `id` = "' . mysql_real_escape_string($_GET['pet_del']) . '" AND `delete` = 0 AND `uid` = "' . $u->info['id'] . '" LIMIT 1' + )) { + $u->error = 'Зверь был выгнан.'; + } else { + $u->error = 'Зверь не найден.'; + } +} elseif (isset($_GET['rename'])) { + $anm = mysql_fetch_array( + mysql_query('SELECT * FROM `users_animal` WHERE `id` = "' . mysql_real_escape_string($_GET['rename']) . '" AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 LIMIT 1') + ); + $_GET['vvv'] = htmlspecialchars($_GET['vvv'], null); + if (!isset($anm['id'])) { + $u->error = 'Зверь не найден.'; + } elseif (30 > $u->info['money']) { + $u->error = 'Недостаточно денег.'; + } else { + $u->info['money'] -= 30; + $anm['name'] = preg_replace('/\W/', '', $_GET['vvv']); //$_GET['vvv']; + $u->error = 'Кличка зверя изменена на "' . $anm['name'] . '" за 30 кр.'; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users_animal` SET `name` = "' . mysql_real_escape_string($anm['name']) . '" WHERE `id` = "' . mysql_real_escape_string($anm['id']) . '" LIMIT 1'); + } +} elseif (isset($_GET['shadow']) && $petox > 0) { + if (isset($_GET['rechange'])) { + $u->error = 'Образ питомца снят.'; + mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "' . $u->info['id'] . '"'); + } elseif (isset($_GET['change'])) { + $u->error = 'Образ питомца установлен.'; + mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "' . $u->info['id'] . '"'); + mysql_query('UPDATE `obraz_pet` SET `use` = 1 WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string($_GET['change']) . '" LIMIT 1'); + } } ?> -
Ваши деньги: info['money']?> кр.
+
Ваши деньги: info['money'] ?> кр.
- 0 ) { - echo ' '; - }else{ - echo ' '; - } - ?> -   - - -   - - + 0) { + echo ' '; + } else { + echo ' '; + } + ?> +   + + +   + +
error != '' ) { - echo '
'.$u->error.'
'; +if ($u->error != '') { + echo '
' . $u->error . '
'; } ?>
- - 0) { - // - echo ''; - }else{ - $sp = mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 6'); - $i = 1; - while( $pl = mysql_fetch_array($sp) ) { - // - if( isset($_GET['selected']) && $pl['id'] == $_GET['selected'] ) { - if( $u->info['animal'] != $pl['id'] ) { - $u->info['animal'] = $pl['id']; - }else{ - $u->info['animal'] = 0; - } - mysql_query('UPDATE `users` SET `animal` = "'.$u->info['animal'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - // - //$kp = 0.05; //цена корма - $kp = $an_eda[$pl['level']]; - //$kp = $an_eda[1]; - // - echo ''; - $i++; - } - if( $i <= 6 ) { - $j = 0; - while( $i <= 6 ) { - if( $i <= $slot['slots'] ) { - echo ''; - }else{ - if( $j == 0 ) { - echo ''; - $j++; - }else{ - echo ''; - } - } - $i++; - } - } - } - ?> - + + 0) { + // + echo ''; + } else { + $sp = mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 LIMIT 6'); + $i = 1; + while ($pl = mysql_fetch_array($sp)) { + // + if (isset($_GET['selected']) && $pl['id'] == $_GET['selected']) { + if ($u->info['animal'] != $pl['id']) { + $u->info['animal'] = $pl['id']; + } else { + $u->info['animal'] = 0; + } + mysql_query('UPDATE `users` SET `animal` = "' . $u->info['animal'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + // + //$kp = 0.05; //цена корма + $kp = $an_eda[$pl['level']]; + // + echo ''; + $i++; + } + if ($i <= 6) { + $j = 0; + while ($i <= 6) { + if ($i <= $slot['slots']) { + echo ''; + } else { + if ($j == 0) { + echo ''; + $j++; + } else { + echo ''; + } + } + $i++; + } + } + } + ?> +
'; - $sp = mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'"'); - while( $pl = mysql_fetch_array($sp) ) { - echo '
'; - // - echo '
'; - if( $pl['use'] == 0 ) { - echo ''; - }else{ - echo ''; - } - echo '
'; - // - echo '
'; - } - echo '
'; - // - echo '
'.$pl['name'].'
'; - // - echo '
'; - // - echo '
'; - echo 'Уровень: '.$pl['level'].'
Опыт: '.$pl['exp'].'
Сытность: '.$pl['eda'].'/100
'; - // - echo '= 100 ) { - echo ' disabled="disabled" '; - }else{ - echo ' onclick="top.eda('.$pl['id'].',\''.$pl['name'].'\','.(0+$kp).','.(0+100-$pl['eda']).');" '; - } - echo 'type="button" value="Покормить" class="btn an_w120'; - if( $pl['eda'] < 1 ) { - echo ' btn-danger'; - } - echo '">'; - // - if( $pl['id'] != $u->info['animal'] || ( isset($_GET['selected']) && $pl['id'] != $_GET['selected'] ) ) { - echo ''; - }else{ - echo ''; - } - // - echo '
'; - // - echo '
 
 
 
'; + $sp = mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "' . $u->info['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + echo '
'; + // + echo '
'; + if ($pl['use'] == 0) { + echo ''; + } else { + echo ''; + } + echo '
'; + // + echo '
'; + } + echo '
'; + // + echo '
' . $pl['name'] . '
'; + // + echo '
'; + // + echo '
'; + echo 'Уровень: ' . $pl['level'] . '
Опыт: ' . $pl['exp'] . '
Сытность: ' . $pl['eda'] . '/100
'; + // + echo '= 100) { + echo ' disabled="disabled" '; + } else { + echo ' onclick="top.eda(' . $pl['id'] . ',\'' . $pl['name'] . '\',' . (0 + $kp) . ',' . (0 + 100 - $pl['eda']) . ');" '; + } + echo 'type="button" value="Покормить" class="btn an_w120'; + if ($pl['eda'] < 1) { + echo ' btn-danger'; + } + echo '">'; + // + if ($pl['id'] != $u->info['animal'] || (isset($_GET['selected']) && $pl['id'] != $_GET['selected'])) { + echo ''; + } else { + echo ''; + } + // + echo '
'; + // + echo '
 
 
 
diff --git a/modules_data/_umenie.php b/modules_data/_umenie.php index 8aceac2c..276a1acc 100644 --- a/modules_data/_umenie.php +++ b/modules_data/_umenie.php @@ -1493,7 +1493,7 @@ $tma = ''; echo '
Эффект "' . $u->stats['effects'][$i]['name'] . '" был принудительно завершен.
'; $clr = $clr == 'C7' ? 'D5' : 'C7'; } else { - $ae .= '' . $v1 . '' . $v2 . '' . $u->timeOut($u->stats['effects'][$i]['timeUse'] + $u->stats['effects'][$i]['actionTime'] - time()) . '"' . $u->stats['effects'][$i]['name'] . '"
' . $btnse . '
'; + $ae .= '' . $v1 . '' . $v2 . '' . Conversion::secondsToTimeout($u->stats['effects'][$i]['timeUse'] + $u->stats['effects'][$i]['actionTime'] - time()) . '"' . $u->stats['effects'][$i]['name'] . '"
' . $btnse . '
'; } } $i++; @@ -1540,7 +1540,7 @@ $tma = ''; $e['see'] = 1; } - $ae .= '' . $v1 . '' . $v2 . '' . $u->timeOut($e['endTime'] - time()) . '' . $v1 . '' . $v2 . '' . Conversion::secondsToTimeout($e['endTime'] - time()) . 'pgpar[$tp]; - $ae .= '• ' . $v[0] . ' [' . $lvlp . '], еще ' . $u->timeOut($pl['timeUse'] - time()) . ', начнет действовать через ' . $u->timeOut($pl['deactiveTime'] - time()) . '
'; + $ae .= '• ' . $v[0] . ' [' . $lvlp . '], еще ' . Conversion::secondsToTimeout($pl['timeUse'] - time()) . ', начнет действовать через ' . Conversion::secondsToTimeout($pl['deactiveTime'] - time()) . '
'; } if ($ae) { @@ -1587,7 +1587,7 @@ $tma = ''; ); if (isset($psh['id'])) { $clr = $clr == 'C7' ? 'D5' : 'C7'; - echo '
 Время до подземелья: ' . $u->timeOut(($psh['time'] + 60 * 60 * 3) - time()) . '

'; + echo '
 Время до подземелья: ' . Conversion::secondsToTimeout(($psh['time'] + 60 * 60 * 3) - time()) . '

'; } ?>  Эффекты:
@@ -2278,7 +2278,7 @@ $tma = ''; ); while ($pl = mysql_fetch_array($sp)) { $ic1 = str_replace('psh_qt_', '', $pl['vars']); - echo '
  Задержка на получение задания в ' . $u->city_name[$ic1] . ' ' . $u->timeOut((86400 + $pl['time']) - time()) . '

'; + echo '
  Задержка на получение задания в ' . $u->city_name[$ic1] . ' ' . Conversion::secondsToTimeout((86400 + $pl['time']) - time()) . '

'; } //Пещеры $dungeon_timeout = $u->testAction( @@ -2286,7 +2286,7 @@ $tma = ''; 1 ); if ($dungeon_timeout['vars'] == "psh0") { - echo '
Задержка на посещение подземелья: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '

'; + echo '
Задержка на посещение подземелья: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '

'; } ?>
diff --git a/modules_data/location/bsenter.php b/modules_data/location/bsenter.php index 7f0155a2..579cda5a 100644 --- a/modules_data/location/bsenter.php +++ b/modules_data/location/bsenter.php @@ -1,273 +1,340 @@ room['file'] == 'bsenter') { - $r = 2; - if(isset($_GET['r'])) { - $_GET['r'] = (int)$_GET['r']; - if($_GET['r'] == 7 || $_GET['r'] == 8 || $_GET['r'] == 9 || $_GET['r'] == 10 || $_GET['r'] == 11) { $r = round($_GET['r']-6); } - if($u->info['level'] < $r+6) { $r = 1; } +use Helper\Conversion; + +if (!defined('GAME')) { + die(); } -function changeSleep($uid,$sleep_action){ - global $u; - if( $sleep_action == 1 ){ - // - mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","1")'); - // - mysql_query("UPDATE `eff_users` SET `sleeptime`=".time().",`deactiveLast` = ( `deactiveTime` - ".time()." ) WHERE `uid`='".mysql_real_escape_string($uid)."' AND `no_Ace` = 0 AND `delete` = 0"); - mysql_query('UPDATE `items_users` SET `time_sleep` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); - $u->addAction(time(),'sleep',$u->info['city']); - // - } elseif( $sleep_action == 2 ){ - // - mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","2")'); - // - $sp = mysql_query('SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); - while( $pl = mysql_fetch_array($sp) ) { - $tm_add = time() - $pl['time_sleep']; - mysql_query('UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "'.($pl['time_create'] + $tm_add).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - $sp = mysql_query('SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "'.$uid.'" ORDER BY `timeUse` DESC'); - while($pl = mysql_fetch_array($sp)) { - mysql_query("UPDATE `eff_users` SET `deactiveTime` = ".(time()+$pl['deactiveLast'])." WHERE `id`='".$pl['id']."' "); - } - $sp = mysql_query('SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="'.mysql_real_escape_string($uid).'" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0'); - while($pl = mysql_fetch_array($sp)) { - $timeUsen = time()-($pl['sleeptime']-$pl['timeUse']); - mysql_query("UPDATE `eff_users` SET `timeUse`='".$timeUsen."',`sleeptime`='0' WHERE `id`='".$pl['id']."' "); - } - mysql_query('UPDATE `actions` SET `vars` = "unsleep",`val` = "'.time().'" WHERE `id` = "'.$sleep['id'].'" LIMIT 1'); - } -} +if ($u->room['file'] == 'bsenter') { + $r = 2; + if (isset($_GET['r'])) { + $_GET['r'] = (int)$_GET['r']; + if ($_GET['r'] == 7 || $_GET['r'] == 8 || $_GET['r'] == 9 || $_GET['r'] == 10 || $_GET['r'] == 11) { + $r = round($_GET['r'] - 6); + } + if ($u->info['level'] < $r + 6) { + $r = 1; + } + } -$t = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "'.$u->info['city'].'" AND `level` = "'.((int)($r+6)).'" LIMIT 1')); -if(isset($t['id'])) { - if($t['time_start'] > time()) { - $tz = mysql_fetch_array(mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = 0 LIMIT 1')); - $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` <= "'.$t['time_start'].'" LIMIT 1')); - } - if(isset($_POST['coin']) && $t['time_start'] > time() ) { - $_POST['coin'] = round((int)$_POST['coin'],2); - if((round((int)$tz['money'], 2) + $_POST['coin']) > 3*$u->info['level'] || $tz_all[0] > 3*$u->info['level']) { - $error = 'Вам нельзя делать ставку выше '.(3* $u->info['level']).' кр.'; - } elseif(($_POST['coin'] >= $t['min_money'] || (isset($tz['id']) && $_POST['coin'] >= 1)) && $u->info['money'] >= $_POST['coin']) { - $t['money'] += $_POST['coin']; - $u->info['money'] -= $_POST['coin']; - if(isset($tz['id'])) { - $tz['money'] += $_POST['coin']; - mysql_query('UPDATE `bs_zv` SET `money` = "'.$tz['money'].'" WHERE `id` = "'.$tz['id'].'" LIMIT 1'); - } else { - //создаем - $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1')); - $ins = mysql_query('INSERT INTO `bs_zv` (`bsid`,`money`,`time`,`uid`) VALUES ("'.$t['id'].'","'.mysql_real_escape_string($_POST['coin']).'","'.$t['time_start'].'","'.$u->info['id'].'")'); - if($ins) { - $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1')); - if( $tz_all[0] > 0 ) { - $_POST['coin'] = $tz_all[0]; - $error = 'Ваша ставка была возвращена. ('.round($_POST['coin'],2).' кр.)'; - } - $t['users']++; - $tz = array('id'=>1, 'bsid'=>$t['id'], 'money'=>$_POST['coin'], 'time'=>$t['time_start'], 'finish'=>0); - } - } - mysql_query('UPDATE `bs_turnirs` SET `money` = "'.$t['money'].'", `users` = "'.$t['users'].'" WHERE `id` = "'.$t['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } -} + function changeSleep($uid, $sleep_action) + { + global $u; + if ($sleep_action == 1) { + // + mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","1")'); + // + mysql_query( + "UPDATE `eff_users` SET `sleeptime`=" . time() . ",`deactiveLast` = ( `deactiveTime` - " . time() . " ) WHERE `uid`='" . mysql_real_escape_string( + $uid + ) . "' AND `no_Ace` = 0 AND `delete` = 0" + ); + mysql_query('UPDATE `items_users` SET `time_sleep` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); + $u->addAction(time(), 'sleep', $u->info['city']); + // + } elseif ($sleep_action == 2) { + // + mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","2")'); + // + $sp = mysql_query('SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); + while ($pl = mysql_fetch_array($sp)) { + $tm_add = time() - $pl['time_sleep']; + mysql_query('UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "' . ($pl['time_create'] + $tm_add) . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + $sp = mysql_query( + 'SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "' . $uid . '" ORDER BY `timeUse` DESC' + ); + while ($pl = mysql_fetch_array($sp)) { + mysql_query("UPDATE `eff_users` SET `deactiveTime` = " . (time() + $pl['deactiveLast']) . " WHERE `id`='" . $pl['id'] . "' "); + } + $sp = mysql_query('SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="' . mysql_real_escape_string($uid) . '" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0'); + while ($pl = mysql_fetch_array($sp)) { + $timeUsen = time() - ($pl['sleeptime'] - $pl['timeUse']); + mysql_query("UPDATE `eff_users` SET `timeUse`='" . $timeUsen . "',`sleeptime`='0' WHERE `id`='" . $pl['id'] . "' "); + } + mysql_query('UPDATE `actions` SET `vars` = "unsleep",`val` = "' . time() . '" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1'); + } + } -if($u->info['id'] != 7) { -?> - -'.$re.'
'; -} -?> - - - -
-

room['name']; ?>

-
- - - - - -
  - - - -
- - - - - - -
+ $t = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "' . $u->info['city'] . '" AND `level` = "' . ((int)($r + 6)) . '" LIMIT 1')); + if (isset($t['id'])) { + if ($t['time_start'] > time()) { + $tz = mysql_fetch_array( + mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = 0 LIMIT 1') + ); + $tz_all = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` <= "' . $t['time_start'] . '" LIMIT 1' + ) + ); + } + if (isset($_POST['coin']) && $t['time_start'] > time()) { + $_POST['coin'] = round((int)$_POST['coin'], 2); + if ((round((int)$tz['money'], 2) + $_POST['coin']) > 3 * $u->info['level'] || $tz_all[0] > 3 * $u->info['level']) { + $error = 'Вам нельзя делать ставку выше ' . (3 * $u->info['level']) . ' кр.'; + } elseif (($_POST['coin'] >= $t['min_money'] || (isset($tz['id']) && $_POST['coin'] >= 1)) && $u->info['money'] >= $_POST['coin']) { + $t['money'] += $_POST['coin']; + $u->info['money'] -= $_POST['coin']; + if (isset($tz['id'])) { + $tz['money'] += $_POST['coin']; + mysql_query('UPDATE `bs_zv` SET `money` = "' . $tz['money'] . '" WHERE `id` = "' . $tz['id'] . '" LIMIT 1'); + } else { + //создаем + $tz_all = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1' + ) + ); + $ins = mysql_query( + 'INSERT INTO `bs_zv` (`bsid`,`money`,`time`,`uid`) VALUES ("' . $t['id'] . '","' . mysql_real_escape_string( + $_POST['coin'] + ) . '","' . $t['time_start'] . '","' . $u->info['id'] . '")' + ); + if ($ins) { + $tz_all = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1' + ) + ); + if ($tz_all[0] > 0) { + $_POST['coin'] = $tz_all[0]; + $error = 'Ваша ставка была возвращена. (' . round($_POST['coin'], 2) . ' кр.)'; + } + $t['users']++; + $tz = ['id' => 1, 'bsid' => $t['id'], 'money' => $_POST['coin'], 'time' => $t['time_start'], 'finish' => 0]; + } + } + mysql_query('UPDATE `bs_turnirs` SET `money` = "' . $t['money'] . '", `users` = "' . $t['users'] . '" WHERE `id` = "' . $t['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + } + + if ($u->info['id'] != 7) { + ?> + + ' . $re . ''; + } + ?> +
+ + + - -
+
+

room['name']; ?>

+
+
+
+ - - + + -
Страшилкина ул.  + + + + +
+ + + + + + +
+ + + + + +
+ Страшилкина ул.
+
+
+
-
-

Поздравляем! Вы успешно допускаетесь к турниру!


-

 

-
-
-

Прием заявок на следующий турнир Текущий турнир

+
+ + + + +

Поздравляем! Вы успешно допускаетесь к турниру!


+

+ +  

+ +
+

Прием заявок на следующий турнир Текущий турнир

-
К сожалению турниры данного типа не проводятся в этом городе

'; } else { -if($t['status'] == 0) { -?> -Начало турнира в Башне Смерти: 59
-Призовой фонд на текущий момент: кр. и 1 екр.
-Всего подано заявок:
-'.$error.'

'; -} -?> - -info['exp'] >= 250000) { ?> +
К сожалению турниры данного типа не проводятся в этом городе

'; + } else { + if ($t['status'] == 0) { + ?> + Начало турнира в Башне Смерти: 59
+ Призовой фонд на текущий момент: кр. и 1 екр.
+ Всего подано заявок:
+ ' . $error . '
'; + } + ?> + + info['exp'] >= 250000) { ?> -Сколько ставите кредитов? (минимальная ставка .00 кр. у вас в наличии info['money']); ?> кр.)
-
-Чем выше ваша ставка, тем больше шансов принять участие в турнире.
+ Сколько ставите кредитов? (минимальная ставка .00 кр. у вас в наличии info['money']); ?> кр.)
+ +
+ Чем выше ваша ставка, тем больше шансов принять участие в турнире.
-info['exp'] < 250000){?> + info['exp'] < 250000) { ?> -Для регистрации в турнире нужно: 250000 опыта у вас: info['exp'];?> опыта
-Вам нужно набраться опыта.
+ Для регистрации в турнире нужно: 250000 опыта у вас: info['exp']; ?> опыта
+ Вам нужно набраться опыта.
- + -Вы уже сделали ставку кр. (У вас в наличии info['money']); ?> кр.) Сделать повторную ставку?
-Внимание! Покинув помещение Башни Смерти все Ваши ставки будут потеряны!
- - - - + Вы уже сделали ставку кр. (У вас в наличии info['money']); ?> кр.) Сделать повторную ставку?
+ Внимание! Покинув помещение Башни Смерти все Ваши ставки будут потеряны!
+ + + + '; -$notowerlog = false; -$log = mysql_fetch_array(mysql_query('SELECT `id`,`count_bs`,`m` FROM `bs_logs` WHERE `count_bs` = "'.mysql_real_escape_string($t['count']).'" ORDER BY `id` ASC LIMIT 1')); -if(!isset($log['id'])) { - $notowerlog = true; - $r = '
Скорее всего Архивариус снова потерял пергамент с хрониками турниров ...
'; -} else { - $sp = mysql_query('SELECT * FROM `bs_logs` WHERE `count_bs` = "'.$log['count_bs'].'" ORDER BY `id` ASC'); - while( $pl = mysql_fetch_array($sp) ) { - $datesb = ''; - if( $pl['type'] == 2 ) { - $datesb = '2'; - } - $r .= '
'.date('d.m.y H:i',$pl['time']).' '.$pl['text'].''; - } - $liveusers = ''; - $sp = mysql_query('SELECT `id` FROM `users` WHERE `inTurnir` = "'.$t['id'].'"'); - while( $plu = mysql_fetch_array($sp) ) { - $pl = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`level` FROM `users` WHERE `inUser` = "'.$plu['id'].'"')); - if( isset($pl['id']) ) { - $alc = ''; - if( $pl['align'] > 0 ) { - $alc .= ''; - } - if( $pl['clan'] > 0 ) { - $alc .= ''; - } - $liveusers .= ', '.$alc.$pl['login'].' ['.$pl['level'].']'; - } - } - $r .= '

Всего живых участников на данный момент: '.$t['users'].' ('.ltrim($liveusers,', ').')'; - unset($liveusers,$alc); -} -if( $notowerlog == false ) {?> -Призовой фонд: кр. - - -
-
- -

Топ 10 игроков (новая статистиика) турнир 5 уровней

-0 ORDER BY `win_bs` DESC LIMIT 10'); -$i = 1; -while ($pl = mysql_fetch_array($sp)) { - $wuser = ''.$pl['login'].' ['.$pl['level'].']'; - if( $pl['clan'] > 0 ) { - $wuser = ''.$wuser; - } - if( $pl['align'] > 0 ) { - $wuser = ''.$wuser; - } - echo ''.$i.'. Место: '.$wuser.' побед: '.$pl['win_bs'].'
'; - $i++; -} -?> -

Победители 10-ти предыдущих турниров для 5 уровней

- 0 ORDER BY `id` DESC LIMIT 10'); -$i = 1; -while ($pl = mysql_fetch_array($sp)) { - $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].']'; - if( $pl['wclan'] > 0 ) { - $wuser = ''.$wuser; - } - if( $pl['walign'] > 0 ) { - $wuser = ''.$wuser; - } - echo $i.'. Победитель: '.$wuser.' Начало турнира '.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »»
'; - $i++; -} -?> -

Максимальный выигрыш для 5 уровней

- 0 ORDER BY `money` DESC LIMIT 1'); -$i = 1; -while ($pl = mysql_fetch_array($sp)) { - $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].']'; - if( $pl['wclan'] > 0 ) { - $wuser = ''.$wuser; - } - if( $pl['walign'] > 0 ) { - $wuser = ''.$wuser; - } - echo 'Победитель: '.$wuser.' Начало турнира '.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »»
'; - $i++; -} -?> -

Самый продолжительный турнир для 5 уровней

- 0 ORDER BY `time_sf` DESC LIMIT 1'); -$i = 1; -while ($pl = mysql_fetch_array($sp)) { - $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].']'; - if( $pl['wclan'] > 0 ) { - $wuser = ''.$wuser; - } - if( $pl['walign'] > 0 ) { - $wuser = ''.$wuser; - } - echo 'Победитель: '.$wuser.' Начало турнира'.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »»
'; - $i++; -} -?> -

- \ No newline at end of file + $notowerlog = false; + $log = mysql_fetch_array(mysql_query('SELECT `id`,`count_bs`,`m` FROM `bs_logs` WHERE `count_bs` = "' . mysql_real_escape_string($t['count']) . '" ORDER BY `id` ASC LIMIT 1')); + if (!isset($log['id'])) { + $notowerlog = true; + $r = '
Скорее всего Архивариус снова потерял пергамент с хрониками турниров ...
'; + } else { + $sp = mysql_query('SELECT * FROM `bs_logs` WHERE `count_bs` = "' . $log['count_bs'] . '" ORDER BY `id` ASC'); + while ($pl = mysql_fetch_array($sp)) { + $datesb = ''; + if ($pl['type'] == 2) { + $datesb = '2'; + } + $r .= '
' . date('d.m.y H:i', $pl['time']) . ' ' . $pl['text'] . ''; + } + $liveusers = ''; + $sp = mysql_query('SELECT `id` FROM `users` WHERE `inTurnir` = "' . $t['id'] . '"'); + while ($plu = mysql_fetch_array($sp)) { + $pl = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`level` FROM `users` WHERE `inUser` = "' . $plu['id'] . '"')); + if (isset($pl['id'])) { + $alc = ''; + if ($pl['align'] > 0) { + $alc .= ''; + } + if ($pl['clan'] > 0) { + $alc .= ''; + } + $liveusers .= ', ' . $alc . $pl['login'] . ' [' . $pl['level'] . ']'; + } + } + $r .= '

Всего живых участников на данный момент: ' . $t['users'] . ' (' . ltrim($liveusers, ', ') . ')'; + unset($liveusers, $alc); + } + if ($notowerlog == false) { ?> + Призовой фонд: кр. + + +
+ + +

Топ 10 игроков (новая статистиика) турнир 5 уровней

+ 0 ORDER BY `win_bs` DESC LIMIT 10'); + $i = 1; + while ($pl = mysql_fetch_array($sp)) { + $wuser = '' . $pl['login'] . ' [' . $pl['level'] . ']'; + if ($pl['clan'] > 0) { + $wuser = '' . $wuser; + } + if ($pl['align'] > 0) { + $wuser = '' . $wuser; + } + echo '' . $i . '. Место: ' . $wuser . ' побед: ' . $pl['win_bs'] . '
'; + $i++; + } + ?> +

Победители 10-ти предыдущих турниров для 5 уровней

+ 0 ORDER BY `id` DESC LIMIT 10'); + $i = 1; + while ($pl = mysql_fetch_array($sp)) { + $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . ']'; + if ($pl['wclan'] > 0) { + $wuser = '' . $wuser; + } + if ($pl['walign'] > 0) { + $wuser = '' . $wuser; + } + echo $i . '. Победитель: ' . $wuser . ' Начало турнира ' . date( + 'd.m.Y H:i', ($pl['time_start'] + 60) + ) . ' продолжительность ' . Conversion::secondsToTimeout( + $pl['time_sf'] + ) . ' приз: ' . $pl['money'] . ' История турнира »»
'; + $i++; + } + ?> +

Максимальный выигрыш для 5 уровней

+ 0 ORDER BY `money` DESC LIMIT 1'); + $i = 1; + while ($pl = mysql_fetch_array($sp)) { + $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . ']'; + if ($pl['wclan'] > 0) { + $wuser = '' . $wuser; + } + if ($pl['walign'] > 0) { + $wuser = '' . $wuser; + } + echo 'Победитель: ' . $wuser . ' Начало турнира ' . date('d.m.Y H:i', ($pl['time_start'] + 60)) . ' продолжительность ' . Conversion::secondsToTimeout( + $pl['time_sf'] + ) . ' приз: ' . $pl['money'] . ' История турнира »»
'; + $i++; + } + ?> +

Самый продолжительный турнир для 5 уровней

+ 0 ORDER BY `time_sf` DESC LIMIT 1'); + $i = 1; + while ($pl = mysql_fetch_array($sp)) { + $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . ']'; + if ($pl['wclan'] > 0) { + $wuser = '' . $wuser; + } + if ($pl['walign'] > 0) { + $wuser = '' . $wuser; + } + echo 'Победитель: ' . $wuser . ' Начало турнира' . date('d.m.Y H:i', ($pl['time_start'] + 60)) . ' продолжительность ' . Conversion::secondsToTimeout( + $pl['time_sf'] + ) . ' приз: ' . $pl['money'] . ' История турнира »»
'; + $i++; + } + ?> +

+ \ No newline at end of file diff --git a/modules_data/location/dragopsh.php b/modules_data/location/dragopsh.php index efa134d4..354323ea 100644 --- a/modules_data/location/dragopsh.php +++ b/modules_data/location/dragopsh.php @@ -1,4 +1,7 @@ room['file'] != 'dragopsh') { } $d = new Dungeon; -function sendSysChat(string $message, bool $hasDn = false, bool $hasReceiver = false) { +function sendSysChat(string $message, bool $hasDn = false, bool $hasReceiver = false) +{ global $u; $cmsg = new ChatMessage(); $cmsg->setCity($u->info['city']); @@ -55,13 +59,23 @@ $dies = $dies[0]; $map_d = json_decode($map['data']); $varos = []; -$varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); +$varos['trap1'] = mysql_fetch_array( + mysql_query( + 'SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1' + ) +); $errors = ''; $effed = ''; if (isset($_GET['takeitm'])) { - $var = ['obj' => mysql_fetch_array(mysql_query('SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "' . mysql_real_escape_string($_GET['takeitm']) . '" AND `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" LIMIT 1'))]; + $var = ['obj' => mysql_fetch_array( + mysql_query( + 'SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "' . mysql_real_escape_string( + $_GET['takeitm'] + ) . '" AND `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" LIMIT 1' + ) + )]; if (isset($var['obj']['id'])) { if ($var['obj']['take'] == 0) { $var['sex'] = ''; @@ -84,7 +98,13 @@ if (isset($_GET['takeitm'])) { $errors = 'Предмет не найден...'; } } elseif (isset($_GET['useobj'])) { - $var = ['obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string($_GET['useobj']) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1'))]; + $var = ['obj' => mysql_fetch_array( + mysql_query( + 'SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string( + $_GET['useobj'] + ) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1' + ) + )]; if (isset($var['obj']['id'])) { if ($var['obj']['use'] == 0) { if ($var['obj']['type'] == 1) { @@ -101,9 +121,11 @@ if (isset($_GET['takeitm'])) { $var['itm'] = $var['itm'][0]; $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); if (isset($var['itm']['id'])) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + mysql_query( + 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" - )'); + )' + ); } else { $var['itm']['name'] = 'Предмет рассыпался на глазах...'; } @@ -135,9 +157,11 @@ if (isset($_GET['takeitm'])) { $var['itm'] = $var['itm'][0]; $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); if (isset($var['itm']['id'])) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + mysql_query( + 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" - )'); + )' + ); } else { $var['itm']['name'] = 'Предмет рассыпался на глазах...'; } @@ -146,9 +170,11 @@ if (isset($_GET['takeitm'])) { $var['itm'] = $var['itm'][0]; $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); if (isset($var['itm']['id'])) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + mysql_query( + 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" - )'); + )' + ); } else { $var['itm']['name'] = 'Предмет рассыпался на глазах...'; } @@ -207,7 +233,9 @@ if ($real_x > count($map_d) - 7) { $objs = []; -$sp = mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '" AND `x` > ' . ($real_x - 7) . ' AND `x` < ' . ($real_x + 7) . ' AND `y` > ' . ($real_y - 12) . ' AND `y` < ' . ($real_y + 12) . ' LIMIT 144'); +$sp = mysql_query( + 'SELECT * FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '" AND `x` > ' . ($real_x - 7) . ' AND `x` < ' . ($real_x + 7) . ' AND `y` > ' . ($real_y - 12) . ' AND `y` < ' . ($real_y + 12) . ' LIMIT 144' +); while ($pl = mysql_fetch_array($sp)) { $objs[$pl['x']][$pl['y']] = $pl; } @@ -260,7 +288,9 @@ if (isset($_GET['goto'])) { } $u->info['timeGo'] = time() + $varos['timego']; $u->info['timeGoL'] = time(); - mysql_query('UPDATE `stats` SET `x` = "' . $u->info['x'] . '" ,`y` = "' . $u->info['y'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '",`timeGo` = "' . $u->info['timeGo'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `stats` SET `x` = "' . $u->info['x'] . '" ,`y` = "' . $u->info['y'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '",`timeGo` = "' . $u->info['timeGo'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + ); } } @@ -331,9 +361,11 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { if ($var['add'][1] > 0) { $j = 0; while ($j < $var['add'][1]) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + mysql_query( + 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['add'][0] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" - )'); + )' + ); $j++; } } @@ -346,7 +378,9 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { mysql_query('DELETE FROM `laba_obj` WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); } elseif ($mitm['type'] == 2) { if ($mitm['use'] == 0) { - $tbtl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1')); + $tbtl = mysql_fetch_array( + mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1') + ); if (isset($tbtl['id'])) { //вступаем в поединок mysql_query('UPDATE `users` SET `battle` = "' . $tbtl['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); @@ -378,7 +412,8 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { $expB = 0; $btld = ['players' => '', 'timeout' => 180, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0]; - $ins = mysql_query('INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES ( + $ins = mysql_query( + 'INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES ( "102", "' . $lab['id'] . '", "' . $u->info['x'] . '", @@ -393,7 +428,8 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { "' . $btld['travmChance'] . '", "' . $btld['typeBattle'] . '", "' . $btld['addExp'] . '", - "' . $btld['money'] . '")'); + "' . $btld['money'] . '")' + ); $btl_id = mysql_insert_id(); } if ($btl_id > 0) { @@ -444,14 +480,23 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { } elseif ($mitm['type'] == 4) { if ($mitm['use'] == 0) { //Ловушка - $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); + $var['trap1'] = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time( + ) . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1' + ) + ); $var['time'] = rand(1, 60); if (isset($var['trap1']['id'])) { - mysql_query('UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '",`time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '",`time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1' + ); } else { - mysql_query('INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES ( + mysql_query( + 'INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES ( "' . $u->info['id'] . '","' . (time() + $var['time'] * 60) . '","' . $lab['id'] . '","trap1","' . $var['time'] . '" - )'); + )' + ); } mysql_query('UPDATE `laba_obj` SET `use` = "' . $u->info['id'] . '" WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); @@ -461,7 +506,12 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { } $var['text'] = ' ' . $u->info['login'] . ' угодил' . $var['sex'] . ' в ловушку...'; - $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); + $varos['trap1'] = mysql_fetch_array( + mysql_query( + 'SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time( + ) . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1' + ) + ); sendSysChat($var['text'], true); $errors .= ' ' . $u->info['login'] . ' угодил' . $var['sex'] . ' в ловушку... Время перехода +3 секунды (Длительность: +' . $var['time'] . ' мин.)'; } @@ -476,7 +526,9 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { unset($var); } -$sp = mysql_query('SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" AND `i`.`take` = "0"'); +$sp = mysql_query( + 'SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" AND `i`.`take` = "0"' +); while ($pl = mysql_fetch_array($sp)) { $itms .= ' '; } @@ -497,7 +549,10 @@ if ($itms != '') { mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); } \User\ItemsModel::addItem(4392, $u->info['id'], '|fromlaba=1|nosale=1'); - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"'); + mysql_query( + 'UPDATE `items_users` SET `delete` = "' . time( + ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"' + ); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); @@ -510,7 +565,9 @@ if ($itms != '') { die(''); } -$sp = mysql_query('SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $lab['id'] . '" AND `s`.`id` != "' . $u->info['id'] . '" LIMIT 5'); +$sp = mysql_query( + 'SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $lab['id'] . '" AND `s`.`id` != "' . $u->info['id'] . '" LIMIT 5' +); $pi = 1; while ($pl = mysql_fetch_array($sp)) { $objs[$pl['x']][$pl['y']] = [2 => '
']; //Персонаж 1 @@ -556,169 +613,171 @@ $mapsee = '
' . $mapsee . ' 0) { - $effed .= '
- Время перехода +3 секунды (Осталось: ' . $u->timeOut($varos['trap1']['time'] - time()) . ')
'; + $effed .= '
- Время перехода +3 секунды (Осталось: ' . Conversion::secondsToTimeout( + $varos['trap1']['time'] - time() + ) . ')
'; } unset($varos); ?> - - - - - - - - - - -
- - - - -
  -
error ?>
-
Карта:
- -
-
-
- usersDng($lab['id']); ?> -
- -
-
- + + .ddp1 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/m.gif"); + } + + .ddpStart { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/os.gif"); + } + + .ddpExit { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/of.gif"); + } + + .ddp1s { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/s.gif"); + } + + .ddp1m { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/r.gif"); + } + + .ddp1h { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/h.gif"); + } + + .ddp1l { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/b.gif"); + } + + .ddp1p { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/p.gif"); + } + + .ddp1me { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/u.gif"); + } + + .ddp1ee1 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/e1.gif"); + } + + .ddp1ee2 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/e2.gif"); + } + + .ddp1ee3 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/e3.gif"); + } + + .ddp1ee4 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/e4.gif"); + } + + .ddp1ee5 { + display: inline-block; + width: 15px; + height: 15px; + background-image: url("//img.new-combats.tech/drgn/bg/e5.gif"); + } + + + + + + + + + + + +
+ + + + + @@ -957,5 +1014,3 @@ unset($varos);
  +
error ?>
+
Карта:
+
- +
+ usersDng($lab['id']); ?> +
+ + +
+ +
+ 0) { echo 'Кол-во смертей: ' . $dies . '/3
'; } @@ -934,9 +993,7 @@ unset($varos);
- +
- \ No newline at end of file diff --git a/modules_data/location/dungeon_enter.php b/modules_data/location/dungeon_enter.php index 3796f306..89613846 100644 --- a/modules_data/location/dungeon_enter.php +++ b/modules_data/location/dungeon_enter.php @@ -1,944 +1,1081 @@ room['file']=='dungeon_enter') { +use Helper\Conversion; - $error = ''; // Собираем ошибки. - $dungeonGroupList = ''; // Сюда помещаем список Групп. - $dungeonGo = 1; // По умолчанию, мы идем в пещеру. -$dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') ); - -if(isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание - else $roomSection = 0; // Собираем группу для похода -//if( $u->info['admin'] > 0 ) var_info($dungeon); - -$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); -while( $t = mysql_fetch_array($all_dungeon) ) { $dungeon['list'][] = $t['city']; } -unset($all_dungeon); - -if( $u->info['dn'] > 0 ) { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])){ - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } +if (!defined('GAME')) { + die(); } +if ($u->room['file'] == 'dungeon_enter') { -$dungeon_timeout = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh0" AND `time` > '.(time()-60*60*2).' LIMIT 1',1); -if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры. -if(isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. -{ - $dungeonGo = 0; - if(isset($_GET['start'])){ - $error = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']); - } -} + $error = ''; // Собираем ошибки. + $dungeonGroupList = ''; // Сюда помещаем список Групп. + $dungeonGo = 1; // По умолчанию, мы идем в пещеру. + $dungeon = mysql_fetch_assoc( + mysql_query( + 'SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1' + ) + ); -if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 ) { - $ig = 1; - if( $ig > 0 ){ //перемещаем игроков в пещеру - //$u->addAction(time(),'psh'.$dun,''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dungeon['id'].'","'.$dungeon['name'].'","'.time().'")'); - if($ins){ - $zid = mysql_insert_id(); - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" /*LIMIT '.($zv['team_max']+1).'*/'); - $ids = ''; - - $map_locs = array(); - $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dungeon['id'].'"'); - while( $plm2 = mysql_fetch_array( $spm2 ) ) { - $map_locs[] = array($plm2['x'],$plm2['y']); - } - unset( $spm2 , $plm2 ); - - $pxd = 0; - while( $pu = mysql_fetch_array($su) ) { - $pxd++; - $ids .= ' `id` = "'.$pu['id'].'" OR'; - if( $u->stats['silver'] >= 3 ) { - $u->addAction( ( time() - ((60*60*2)/100*30) ) ,'psh0',$pu['id'],$pu['id']); - }else{ - $u->addAction(time(),'psh0',$pu['id'],$pu['id']); - } - //Добавляем квестовые обьекты для персонажей - $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `room` = '.$dungeon['room'].' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); - while($pl2 = mysql_fetch_array($sp)){ - $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "'.$dungeon['id'].'" LIMIT 1')); - if( isset($pl['id']) ) { - $act = explode(',',$pl['act_date']); - $i = 0; - while( $i < count($act) ) { - $act_date = explode(':|:',$act[$i]); - foreach($act_date as $key=>$val){ - $val = explode(':=:',$val); - $actdate[$val[0]] = $val[1]; - } - //Сбор ресурсов - if( isset($actdate['tk_itm']) && $actdate['tk_itm'] != '' ) { - $xr2 = explode('=',$actdate['tk_itm']); - if( $xr2[2] == 0 ) { - if( isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']) ) { - $actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY']; - $actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY']; - } - $ml_arr = array(); - foreach($map_locs as $ml){ // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов. - if( (isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) OR (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) ) { - if( $ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1] )$ml_arr[] = $ml; - elseif( !isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1] ) $ml_arr[] = $ml; - } else $ml_arr[] = $ml; - } - if( isset($ml_arr) && count($ml_arr) == 0 ) $ml_arr = $map_locs; - //Добавляем обьект для юзера - $j = 0; - while( $j < $xr2[1] ){ - $cord = $ml_arr[rand(0,count($ml_arr)-1)]; - if( $cord[0] != 0 || $cord[1] != 0 ) { - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$u->info['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$u->info['id'].'","'.$pl['id'].'" - )'); - } - $j++; - } - }else{ - //Предмет находится в конкретном месте - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$u->info['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$u->info['id'].'","'.$pl['id'].'" - )'); - } - } - $i++; - } - } - } - - } - $ids = rtrim($ids,'OR'); - $snew = 1; - if($dungeon['id'] == 106) { - $snew = 4; - }elseif($dungeon['id'] == 104) { - $snew = 4; - } - $upd1 = mysql_query('UPDATE `stats` SET `s`="'.$snew.'",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if( $upd1 ){ - $upd2 = mysql_query('UPDATE `users` SET `room` = "'.$dungeon['d_room'].'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dungeon['id'].'"'); - while( $pl = mysql_fetch_array( $sp ) ) { - if( $pl['id_bot'] == 0 && $pl['bot_group'] !=''){ - $bots = explode( ',', $pl['bot_group'] ); - $pl['id_bot'] = (int)$bots[rand(0, count($bots)-1 )]; - } - if( $pl['id_bot'] > 0 )$vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'","'.$pl['go_bot'].'","'.$pl['noatack'].'"),'; - unset($bots); - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dungeon['id'].'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - //Добавление обьектов (день святого валентина) - if( floor(date('m')) == 2 && floor(date('d')) >= 7 ) { - if( floor(date('m')) == 2 && floor(date('d')) >= 14 ) { - //Появляются мобы которые принимают цветы - $vlsbts = ''; - $ins1bts = NULL; - if( $dungeon['id'] == 1 ) { - //4 уровня (КАНАЛИЗАЦИЯ) - $vlsbts .='("'.$zid.'","410","1","","-5","3","8","0","0"),'; - //4-7 уровня - $vlsbts .='("'.$zid.'","413","1","","8","46","9","0","0"),'; - }elseif( $dungeon['id'] == 12 ) { - //(ПТП) - //4-7 уровня - $vlsbts .='("'.$zid.'","413","1","","-3","18","9","0","0"),'; - //4-9 уровня - $vlsbts .='("'.$zid.'","414","1","","-2","29","10","0","0"),'; - }elseif( $dungeon['id'] == 3 ) { - //(КАТАКОМБЫ) - //4-7 уровня - $vlsbts .='("'.$zid.'","413","1","","15","8","9","0","0"),'; - //4-9 уровня - $vlsbts .='("'.$zid.'","414","1","","3","35","10","0","0"),'; - }elseif( $dungeon['id'] == 101 ) { - //(бездна) - //4-7 уровня - $vlsbts .='("'.$zid.'","413","1","","-2","21","9","0","0"),'; - //4-9 уровня - $vlsbts .='("'.$zid.'","414","1","","2","43","10","0","0"),'; - } - - if( $vlsbts != '' ) { - $vlsbts = rtrim($vlsbts,','); - $ins1bts = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`) VALUES '.$vlsbts.''); - } - unset($vlsbts,$ins1bts); - } - //Раскидываем предметы по пещере (Блёклый подземник) - $dcords = array(); - $c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$dungeon['id'].'"'); - while( $c_pl = mysql_fetch_array($c_sp)) { - $dcords[] = array($c_pl['x'],$c_pl['y']); - } - $fcords = array(); - $i = 1; - while($i <= $pxd) { - $j = rand(1,10); - while( $j >= 0 ) { - $rndxy = rand(0,count($dcords)-1); - $rndx = $dcords[$rndxy][0]; - $rndy = $dcords[$rndxy][1]; - $fcords[$rndx][$rndy] = true; - unset($dcords[$rndxy]); - $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; - $j--; - } - $i++; - } - //Раскидываем предметы по пещере (Черепичный подземник) - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dungeon['id'].'"'); - $test = array(); - $dcords2 = array(); - $dcords3 = array(); - while( $pl = mysql_fetch_array( $sp ) ) { - if(!isset($test[$pl['id_bot']])) { - $test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$pl['id_bot'].'" LIMIT 1')); - } - if( isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2 ) { - if( $test[$pl['id_bot']]['level'] > 6 ) { - $dcords2[] = array($pl['x'],$pl['y']); - } - if( $test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9 ) { - $dcords3[] = array($pl['x'],$pl['y']); - } - }else{ - $test[$pl['id_bot']] = 2; - } - } - $i = 1; - while($i <= $pxd) { - $j = rand(1,5); - while( $j >= 0 ) { - $rndxy = rand(0,count($dcords2)-1); - $rndx = $dcords2[$rndxy][0]; - $rndy = $dcords2[$rndxy][1]; - if(!isset($fcords[$rndx][$rndy]) && isset($dcords2[$rndxy][0])) { - $fcords[$rndx][$rndy] = true; - unset($dcords2[$rndxy]); - $vls .= '("'.$zid.'","Черепичный подземник","vbig2.gif","'.$rndx.'","'.$rndy.'","fileact:vbig2","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; - } - $j--; - } - $i++; - } - $i = 1; - while($i <= $pxd) { - $j = rand(1,2); - while( $j >= 0 ) { - $rndxy = rand(0,count($dcords3)-1); - $rndx = $dcords3[$rndxy][0]; - $rndy = $dcords3[$rndxy][1]; - if(!isset($fcords[$rndx][$rndy]) && isset($dcords3[$rndxy][0])) { - $fcords[$rndx][$rndy] = true; - unset($dcords3[$rndxy]); - $vls .= '("'.$zid.'","Кровавый подземник","vbig3.gif","'.$rndx.'","'.$rndy.'","fileact:vbig3","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; - } - $j--; - } - $i++; - } - unset($test); - } - // - $vls = rtrim($vls,','); - if( $vls != '' ) { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - } else { - $ins2 = true; - } - if( $upd2 && $ins1 && $ins2 ){ - die(''); - } else { - $error = 'Ошибка перехода в подземелье...'; - } - } else { - $error = 'Ошибка перехода в подземелье...'; - } - } else { - $error = 'Ошибка перехода в подземелье...'; - } - } -} elseif( isset( $_POST['go'] , $_POST['goid'] ) && $dungeonGo == 1 ) { - if(!isset($zv['id'])) { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if( isset( $zv['id'] ) && $u->info['dn'] == 0) { - if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) { - $error = 'Вы ввели неправильный пароль'; - } elseif( $u->info['level'] > 7 && $zv['dun'] != 1 ){ - $row = 0; - if( 5 > $row ) { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if( !$upd ){ - $error = 'Не удалось вступить в эту группу'; - unset($zv); - } else { - $u->info['dn'] = $zv['id']; - } - } else { - $error = 'В группе нет места'; - unset($zv); - } - } elseif( $zv['dun'] == 1 ){ - //Канализация - $row_max = 5; - if( $u->info['level'] == 4 ) { - $row_max = 4; - }elseif( $u->info['level'] == 5 ) { - $row_max = 3; - }elseif( $u->info['level'] == 6 ) { - $row_max = 2; - }elseif( $u->info['level'] >= 7 ) { - $row_max = 1; - } - $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1')); - $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1')); - $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$row1['id'].'" LIMIT 1')); - $row = $row[0]; - $l45 = 0; - if( $row2['level'] == 4 && $u->info['level'] == 5 ) { - $l45 = 1; - }elseif( $row2['level'] == 5 && $u->info['level'] == 4 ) { - $l45 = 1; - } - if( $u->info['admin'] > 0 ) { - $l45 = 1; - } - if( $row2['level'] != $u->info['level'] && $l45 == 0 ) { - $error = 'Вы не подходите по уровню'; - }elseif( $row_max > $row ) { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if( !$upd ){ - $error = 'Не удалось вступить в эту группу'; - unset($zv); - } else { - $u->info['dn'] = $zv['id']; - } - } else { - $error = 'В группе нет места'; - unset($zv); - } - } elseif( ($u->info['level'] < 4 && $zv['dun'] == 104) || $u->info['admin'] > 0 ){ - //Шахты - $row_max = 3; - if( $u->info['level'] > 3 ) { - $row_max = 1; - } - $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1')); - $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1')); - $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$row1['id'].'" LIMIT 1')); - $row = $row[0]; - if( $row2['level'] != $u->info['level'] && $u->info['level'] > 3 && $u->info['admin'] == 0 ) { - $error = 'Вы не подходите по уровню'; - }elseif( $row_max > $row ) { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if( !$upd ){ - $error = 'Не удалось вступить в эту группу'; - unset($zv); - } else { - $u->info['dn'] = $zv['id']; - } - } else { - $error = 'В группе для вас нет места'; - unset($zv); - } - } else { - $error = 'Вы не подходите по уровню'; - unset($zv); - } - } else { - $error = 'Заявка не найдена'; - } - } else { - $error = 'Вы уже находитесь в группе'; - } -} elseif( isset( $_POST['leave'] ) && isset( $zv['id'] ) && $dungeonGo == 1 ) { - if( $zv['uid'] == $u->info['id'] ) { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if( isset($ld['id']) ){ - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } else { - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - } else { - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -} elseif( isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1 ) { - if( $u->info['dn'] == 0 ) { - $ins = mysql_query('INSERT INTO `dungeon_zv` + if (isset($_GET['rz']) && $dungeon['quest'] == 1) { + $roomSection = 1; + } // Получаем Задание + else { + $roomSection = 0; + } // Собираем группу для похода + //if( $u->info['admin'] > 0 ) var_info($dungeon); + + $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); + while ($t = mysql_fetch_array($all_dungeon)) { + $dungeon['list'][] = $t['city']; + } + unset($all_dungeon); + + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } + + $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh0" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); + + if ($u->info['admin'] > 0) { + unset($dungeon_timeout); + } // $dungeon_timeout - задержка на посещение пещеры. + if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. + { + $dungeonGo = 0; + if (isset($_GET['start'])) { + $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']); + } + } + + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { + $ig = 1; + if ($ig > 0) { //перемещаем игроков в пещеру + //$u->addAction(time(),'psh'.$dun,''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","' . $dungeon['name'] . '","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/' + ); + $ids = ''; + + $map_locs = []; + $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dungeon['id'] . '"'); + while ($plm2 = mysql_fetch_array($spm2)) { + $map_locs[] = [$plm2['x'], $plm2['y']]; + } + unset($spm2, $plm2); + + $pxd = 0; + while ($pu = mysql_fetch_array($su)) { + $pxd++; + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + if ($u->stats['silver'] >= 3) { + $u->addAction((time() - ((60 * 60 * 2) / 100 * 30)), 'psh0', $pu['id'], $pu['id']); + } else { + $u->addAction(time(), 'psh0', $pu['id'], $pu['id']); + } + //Добавляем квестовые обьекты для персонажей + $sp = mysql_query( + 'SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100' + ); + while ($pl2 = mysql_fetch_array($sp)) { + $pl = mysql_fetch_array( + mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1') + ); + if (isset($pl['id'])) { + $act = explode(',', $pl['act_date']); + $i = 0; + while ($i < count($act)) { + $act_date = explode(':|:', $act[$i]); + foreach ($act_date as $key => $val) { + $val = explode(':=:', $val); + $actdate[$val[0]] = $val[1]; + } + //Сбор ресурсов + if (isset($actdate['tk_itm']) && $actdate['tk_itm'] != '') { + $xr2 = explode('=', $actdate['tk_itm']); + if ($xr2[2] == 0) { + if (isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) { + $actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY']; + $actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY']; + } + $ml_arr = []; + foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов. + if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) { + if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) { + $ml_arr[] = $ml; + } elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) { + $ml_arr[] = $ml; + } + } else { + $ml_arr[] = $ml; + } + } + if (isset($ml_arr) && count($ml_arr) == 0) { + $ml_arr = $map_locs; + } + //Добавляем обьект для юзера + $j = 0; + while ($j < $xr2[1]) { + $cord = $ml_arr[rand(0, count($ml_arr) - 1)]; + if ($cord[0] != 0 || $cord[1] != 0) { + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time( + ) . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '" + )' + ); + } + $j++; + } + } else { + //Предмет находится в конкретном месте + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '" + )' + ); + } + } + $i++; + } + } + } + + } + $ids = rtrim($ids, 'OR'); + $snew = 1; + if ($dungeon['id'] == 106) { + $snew = 4; + } elseif ($dungeon['id'] == 104) { + $snew = 4; + } + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "' . $dungeon['d_room'] . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dungeon['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['id_bot'] == 0 && $pl['bot_group'] != '') { + $bots = explode(',', $pl['bot_group']); + $pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)]; + } + if ($pl['id_bot'] > 0) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),'; + } + unset($bots); + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dungeon['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + //Добавление обьектов (день святого валентина) + if (floor(date('m')) == 2 && floor(date('d')) >= 7) { + if (floor(date('m')) == 2 && floor(date('d')) >= 14) { + //Появляются мобы которые принимают цветы + $vlsbts = ''; + $ins1bts = null; + if ($dungeon['id'] == 1) { + //4 уровня (КАНАЛИЗАЦИЯ) + $vlsbts .= '("' . $zid . '","410","1","","-5","3","8","0","0"),'; + //4-7 уровня + $vlsbts .= '("' . $zid . '","413","1","","8","46","9","0","0"),'; + } elseif ($dungeon['id'] == 12) { + //(ПТП) + //4-7 уровня + $vlsbts .= '("' . $zid . '","413","1","","-3","18","9","0","0"),'; + //4-9 уровня + $vlsbts .= '("' . $zid . '","414","1","","-2","29","10","0","0"),'; + } elseif ($dungeon['id'] == 3) { + //(КАТАКОМБЫ) + //4-7 уровня + $vlsbts .= '("' . $zid . '","413","1","","15","8","9","0","0"),'; + //4-9 уровня + $vlsbts .= '("' . $zid . '","414","1","","3","35","10","0","0"),'; + } elseif ($dungeon['id'] == 101) { + //(бездна) + //4-7 уровня + $vlsbts .= '("' . $zid . '","413","1","","-2","21","9","0","0"),'; + //4-9 уровня + $vlsbts .= '("' . $zid . '","414","1","","2","43","10","0","0"),'; + } + + if ($vlsbts != '') { + $vlsbts = rtrim($vlsbts, ','); + $ins1bts = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`) VALUES ' . $vlsbts . ''); + } + unset($vlsbts, $ins1bts); + } + //Раскидываем предметы по пещере (Блёклый подземник) + $dcords = []; + $c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $dungeon['id'] . '"'); + while ($c_pl = mysql_fetch_array($c_sp)) { + $dcords[] = [$c_pl['x'], $c_pl['y']]; + } + $fcords = []; + $i = 1; + while ($i <= $pxd) { + $j = rand(1, 10); + while ($j >= 0) { + $rndxy = rand(0, count($dcords) - 1); + $rndx = $dcords[$rndxy][0]; + $rndy = $dcords[$rndxy][1]; + $fcords[$rndx][$rndy] = true; + unset($dcords[$rndxy]); + $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; + $j--; + } + $i++; + } + //Раскидываем предметы по пещере (Черепичный подземник) + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dungeon['id'] . '"'); + $test = []; + $dcords2 = []; + $dcords3 = []; + while ($pl = mysql_fetch_array($sp)) { + if (!isset($test[$pl['id_bot']])) { + $test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1')); + } + if (isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2) { + if ($test[$pl['id_bot']]['level'] > 6) { + $dcords2[] = [$pl['x'], $pl['y']]; + } + if ($test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9) { + $dcords3[] = [$pl['x'], $pl['y']]; + } + } else { + $test[$pl['id_bot']] = 2; + } + } + $i = 1; + while ($i <= $pxd) { + $j = rand(1, 5); + while ($j >= 0) { + $rndxy = rand(0, count($dcords2) - 1); + $rndx = $dcords2[$rndxy][0]; + $rndy = $dcords2[$rndxy][1]; + if (!isset($fcords[$rndx][$rndy]) && isset($dcords2[$rndxy][0])) { + $fcords[$rndx][$rndy] = true; + unset($dcords2[$rndxy]); + $vls .= '("' . $zid . '","Черепичный подземник","vbig2.gif","' . $rndx . '","' . $rndy . '","fileact:vbig2","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; + } + $j--; + } + $i++; + } + $i = 1; + while ($i <= $pxd) { + $j = rand(1, 2); + while ($j >= 0) { + $rndxy = rand(0, count($dcords3) - 1); + $rndx = $dcords3[$rndxy][0]; + $rndy = $dcords3[$rndxy][1]; + if (!isset($fcords[$rndx][$rndy]) && isset($dcords3[$rndxy][0])) { + $fcords[$rndx][$rndy] = true; + unset($dcords3[$rndxy]); + $vls .= '("' . $zid . '","Кровавый подземник","vbig3.gif","' . $rndx . '","' . $rndy . '","fileact:vbig3","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; + } + $j--; + } + $i++; + } + unset($test); + } + // + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + die(''); + } else { + $error = 'Ошибка перехода в подземелье...'; + } + } else { + $error = 'Ошибка перехода в подземелье...'; + } + } else { + $error = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id']) && $u->info['dn'] == 0) { + if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) { + $error = 'Вы ввели неправильный пароль'; + } elseif ($u->info['level'] > 7 && $zv['dun'] != 1) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $error = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $error = 'В группе нет места'; + unset($zv); + } + } elseif ($zv['dun'] == 1) { + //Канализация + $row_max = 5; + if ($u->info['level'] == 4) { + $row_max = 4; + } elseif ($u->info['level'] == 5) { + $row_max = 3; + } elseif ($u->info['level'] == 6) { + $row_max = 2; + } elseif ($u->info['level'] >= 7) { + $row_max = 1; + } + $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1')); + $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1')); + $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $row1['id'] . '" LIMIT 1')); + $row = $row[0]; + $l45 = 0; + if ($row2['level'] == 4 && $u->info['level'] == 5) { + $l45 = 1; + } elseif ($row2['level'] == 5 && $u->info['level'] == 4) { + $l45 = 1; + } + if ($u->info['admin'] > 0) { + $l45 = 1; + } + if ($row2['level'] != $u->info['level'] && $l45 == 0) { + $error = 'Вы не подходите по уровню'; + } elseif ($row_max > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $error = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $error = 'В группе нет места'; + unset($zv); + } + } elseif (($u->info['level'] < 4 && $zv['dun'] == 104) || $u->info['admin'] > 0) { + //Шахты + $row_max = 3; + if ($u->info['level'] > 3) { + $row_max = 1; + } + $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1')); + $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1')); + $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $row1['id'] . '" LIMIT 1')); + $row = $row[0]; + if ($row2['level'] != $u->info['level'] && $u->info['level'] > 3 && $u->info['admin'] == 0) { + $error = 'Вы не подходите по уровню'; + } elseif ($row_max > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $error = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $error = 'В группе для вас нет места'; + unset($zv); + } + } else { + $error = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $error = 'Заявка не найдена'; + } + } else { + $error = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) { + if ($u->info['dn'] == 0) { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dungeon['id'].'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); - if( $ins ) { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $error = 'Вы успешно создали группу'; - } else { - $error = 'Не удалось создать группу'; - } - } else { - $error = 'Вы уже находитесь в группе'; - } -} + "5")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $error = 'Вы успешно создали группу'; + } else { + $error = 'Не удалось создать группу'; + } + } else { + $error = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "'.$dungeon['id'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while( $pl = mysql_fetch_array( $sp ) ){ - $dungeonGroupList .= '
'; - if( $u->info['dn'] == 0 ) $dungeonGroupList .= ''; - $dungeonGroupList .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while( $pu = mysql_fetch_array( $su ) ) { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim( $pus, ', ' ); - - $dungeonGroupList .= $pus; unset($pus); - - if( $pl['pass'] != '' && $u->info['dn'] == 0 ) $dungeonGroupList .= ' '; - - if( $pl['com'] != '' ) { - $dl = ''; - // Если модератор, даем возможность удалять комментарий к походу. - $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); - if( ( $moder['boi'] == 1 || $u->info['admin'] > 0 ) && $pl['dcom'] == 0 ){ - $dl .= ' (удалить комментарий)'; - if( isset( $_GET['delcom'] ) && $_GET['delcom'] == $pl['id'] && $u->newAct( $_GET['key'] ) == true ) { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - $pl['com'] = htmlspecialchars($pl['com'],NULL); - if( $pl['dcom'] > 0 ) { - $dl = ' комментарий удален модератором'; - } - if( $pl['dcom'] > 0 ) { - if( $moder['boi'] == 1 || $u->info['admin'] > 0 ) { - $pl['com'] = ''.$pl['com'].''; - } else { - $pl['com'] = ''; - } - } - $dungeonGroupList .= ' | '.$pl['com'].''.$dl.''; - } - $dungeonGroupList .= '
'; -} -?> + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dungeonGroupList .= '
'; + if ($u->info['dn'] == 0) { + $dungeonGroupList .= ''; + } + $dungeonGroupList .= '' . date('H:i', $pl['time']) . ' '; - - - - - -
-

room['name']; ?>

-
- + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dungeonGroupList .= $pus; + unset($pus); + + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dungeonGroupList .= ' '; + } + + if ($pl['com'] != '') { + $dl = ''; + // Если модератор, даем возможность удалять комментарий к походу. + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + $pl['com'] = htmlspecialchars($pl['com'], null); + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + $dungeonGroupList .= ' | ' . $pl['com'] . '' . $dl . ''; + } + $dungeonGroupList .= ''; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - - 0 ) { - $shop = mysql_fetch_array( mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "'.$dungeon['shop'].'" LIMIT 1') ); - if( isset($shop['code']) ){?> - - - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - } elseif($u->info['city']=='abandonedplain'){ - echo "Центральная площадь"; - } elseif($u->info['room']==188){ - echo "Зал воинов"; - } elseif($u->info['room']==393){ - echo "Зал воинов 2"; - } elseif($u->info['room']==372){ - echo "Большая парковая улица"; - } elseif($u->info['room']==395){ - echo "Зал воинов"; - } elseif($u->info['room']==397){ - echo "Зал воинов 2"; - } elseif($u->info['room']==242){ - echo "Страшилкина улица"; - } else { - echo "Магический Портал"; - } - ?>
Рыцарский магазин
-
- -
+
+

room['name']; ?>

+
+
+
+ + + + + +
  + + + + + +
+ + + + + + +
+ + + + + + 0) { + $shop = mysql_fetch_array( + mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1') + ); + if (isset($shop['code'])) { + ?> + + + + + +
+ info['city'] == 'fallenearth') { + echo "Темный Портал"; + } elseif ($u->info['city'] == 'abandonedplain') { + echo "Центральная площадь"; + } elseif ($u->info['room'] == 188) { + echo "Зал воинов"; + } elseif ($u->info['room'] == 393) { + echo "Зал воинов 2"; + } elseif ($u->info['room'] == 372) { + echo "Большая парковая улица"; + } elseif ($u->info['room'] == 395) { + echo "Зал воинов"; + } elseif ($u->info['room'] == 397) { + echo "Зал воинов 2"; + } elseif ($u->info['room'] == 242) { + echo "Страшилкина улица"; + } else { + echo "Магический Портал"; + } + ?>
+ Рыцарский магазин
+
+
+ +
+
+
-
- -
-

- -
- -

-
- -
-

- - -
- - -

-
- -'.$error.'
'; +
+ +
+

+ +
+ +

+
+ +
+

+ + +
+ + +

+
+ + ' . $error . '
'; + } -//отображаем -if( $dungeonGroupList == '' ) { - $dungeonGroupList = ''; -} else { - if( !isset( $zv['id'] ) || $u->info['dn'] == 0 ){ - if($dungeonGo==1 || $u->info['dn'] == 0 ){ - $pr = ''; - } - $dungeonGroupList = '
'.$pr.'
'.$dungeonGroupList.''.$pr.'
'; - } - $dungeonGroupList .= '
'; -} + //отображаем + if ($dungeonGroupList == '') { + $dungeonGroupList = ''; + } else { + if (!isset($zv['id']) || $u->info['dn'] == 0) { + if ($dungeonGo == 1 || $u->info['dn'] == 0) { + $pr = ''; + } + $dungeonGroupList = '
' . $pr . '
' . $dungeonGroupList . '' . $pr . '
'; + } + $dungeonGroupList .= '
'; + } -if( $roomSection == 0 ) { echo $dungeonGroupList; } -if( $roomSection == 1 ) { - # endQuest завершаем задание по нажатию. - if( isset( $_GET['endQuest'] ) && $_GET['endQuest'] != '' ){ - $action = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = '.$u->info['id'].' AND `id`="'.$_GET['endQuest'].'" AND `vals` = "go" LIMIT 1')); - $quest = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$action['vars']).'" LIMIT 1')); - if( $q->questCheckEnd($quest)==1 ){ - $q->questSuccesEnd($quest, $action); - } - } -?> -
-
-testAction('`uid` = "'.$u->info['id'].'" AND `room` = "'.$u->info['room'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_'.$dungeon['city'].'" LIMIT 1',1); - $qc=0; // Quest Count - //Генерируем список текущих квестов - $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); - while( $pl = mysql_fetch_array( $sp ) ) { - if($pl['room'] == $u->info['room']){ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - if( $q->questCheckEnd($pq)==1 ) $qsee2 = ''; else $qsee2 = ''; - - $qsee .= ' - - '.$pq['name'].' -
'.$pq['info'].'
'.$q->info($pq).''.$qsee2.'
+ if ($roomSection == 0) { + echo $dungeonGroupList; + } + if ($roomSection == 1) { + # endQuest завершаем задание по нажатию. + if (isset($_GET['endQuest']) && $_GET['endQuest'] != '') { + $action = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = ' . $u->info['id'] . ' AND `id`="' . $_GET['endQuest'] . '" AND `vals` = "go" LIMIT 1')); + $quest = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $action['vars']) . '" LIMIT 1')); + if ($q->questCheckEnd($quest) == 1) { + $q->questSuccesEnd($quest, $action); + } + } + ?> +
+ + testAction( + '`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1 + ); + $qc = 0; // Quest Count + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['room'] == $u->info['room']) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + if ($q->questCheckEnd($pq) == 1) { + $qsee2 = ''; + } else { + $qsee2 = ''; + } + + $qsee .= ' + + ' . $pq['name'] . ' +
' . $pq['info'] . '
' . $q->info($pq) . '' . $qsee2 . '

'; - - # - - $qc++; - } - } - - if( isset( $_GET['add_quest'] ) && $qc == 0 ) { - if( isset( $hgo['id'] ) ) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - } else { - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = '.$dungeon['id'].''); - $dq_add = array(); - while( $pl = mysql_fetch_array( $sp ) ) { - if( $u->rep['rep'.$dungeon['city']] == 9999 ) { - //квет, рыцарского задания - if( $pl['kin'] == 1 ) { - $dq_add = array( 0 => $pl ); - } - } elseif( $u->rep['rep'.$dungeon['city']] == 24999 ) { - //квет, рыцарского задания - if( $pl['kin'] == 2 ) { - $dq_add = array( 0 => $pl ); - } - } else { - if( $pl['kin'] == 0 ) { - $dq_add[count($dq_add)] = $pl; - } - } - } - $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']); - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - - if( $q->testGood($dq_add) == 1 && $dq_add > 0 ) { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $u->addAction(time(),'psh_qt_'.$dungeon['city'],$dq_add['id']); - } else { - if ( $u->rep['rep'.$dungeon['city']] == 9999 ) { - //квест, рыцарского задания - echo 'Вы уже получили задание на достижение титула рыцаря!
'; - } elseif( $u->rep['rep'.$dungeon['city']] >= 24999 ) { - //квест, рыцарского задания - echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; - } else { - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - } - unset( $dq_add ); - } - } elseif( isset( $_GET['add_quest'] ) && $qc > 0 ) { - echo 'Что-то пошло не так... осторожнее..


'; - } - if( $qsee == '' ) { - $qsee = 'К сожалению у вас нет ни одного задания

'; - } -?> -
-
- Текущие задания: - - + + # + + $qc++; + } + } + + if (isset($_GET['add_quest']) && $qc == 0) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . ''); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + if ($u->rep['rep' . $dungeon['city']] == 9999) { + //квет, рыцарского задания + if ($pl['kin'] == 1) { + $dq_add = [0 => $pl]; + } + } elseif ($u->rep['rep' . $dungeon['city']] == 24999) { + //квет, рыцарского задания + if ($pl['kin'] == 2) { + $dq_add = [0 => $pl]; + } + } else { + if ($pl['kin'] == 0) { + $dq_add[count($dq_add)] = $pl; + } + } + } + $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']); + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + + if ($q->testGood($dq_add) == 1 && $dq_add > 0) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $u->addAction(time(), 'psh_qt_' . $dungeon['city'], $dq_add['id']); + } else { + if ($u->rep['rep' . $dungeon['city']] == 9999) { + //квест, рыцарского задания + echo 'Вы уже получили задание на достижение титула рыцаря!
'; + } elseif ($u->rep['rep' . $dungeon['city']] >= 24999) { + //квест, рыцарского задания + echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + } + unset($dq_add); + } + } elseif (isset($_GET['add_quest']) && $qc > 0) { + echo 'Что-то пошло не так... осторожнее..


'; + } + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания

'; + } + ?> +
+
+ Текущие задания: + + 0 ){ - echo 'Вы еще не справились с текущим заданием.'; - } elseif( !isset( $hgo['id'] ) && $qc == 0 ) { - ?> -
- - '.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; - } - ?> + if ($qc > 0) { + echo 'Вы еще не справились с текущим заданием.'; + } elseif (!isset($hgo['id']) && $qc == 0) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; + } + ?>
-
- -
- rep['add_stats']*100); - $cur_price = array('price'=>0); - if( 25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price ) { // Характеристики! - foreach( $dungeon['list'] as $key => $val ) { - if( !( $cur_price['price'] >= $price ) ) { - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['ability'] += 1; $u->rep['add_stats'] += 1; - mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 способность за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 2 ) { // Умения! - $price = 10000; - $cur_price = array('price'=>0); - if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения! - foreach($dungeon['list'] as $key=>$val){ - if( !( $cur_price['price'] >= $price ) ) { - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['skills'] += 1; $u->rep['add_skills'] += 1; - mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 умение за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 3 ) { // Кредиты - $price = 100; - $cur_price = array('price'=>0); - if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты - foreach($dungeon['list'] as $key=>$val){ - if( !( $cur_price['price'] >= $price ) ) { - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['money'] += 10; $u->rep['add_money'] += 10; - mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 10 кр. за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 4 ) { // Особенности - $price = 3000; - $cur_price = array('price'=>0); - if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности - foreach($dungeon['list'] as $key=>$val){ - if( !( $cur_price['price'] >= $price ) ) { - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['sskills'] += 1; $u->rep['add_skills2'] += 1; - mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `sskills` = "'.$u->info['sskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 особенность за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - - } else { - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: rep['allrep']-$u->rep['allnurep'])-$cur_price['price'] : ($u->rep['allrep']-$u->rep['allnurep']) );?> - ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за rep['add_stats']*100);?> ед.
Умение (еще rep['add_skills'])?>)за 10000 ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-
- info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - ?> -
-

+

+ +
+ rep['add_stats'] * 100); + $cur_price = ['price' => 0]; + if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['ability'] += 1; + $u->rep['add_stats'] += 1; + mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 способность за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { // Умения! + $price = 10000; + $cur_price = ['price' => 0]; + if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['skills'] += 1; + $u->rep['add_skills'] += 1; + mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 умение за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { // Кредиты + $price = 100; + $cur_price = ['price' => 0]; + if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['money'] += 10; + $u->rep['add_money'] += 10; + mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { // Особенности + $price = 3000; + $cur_price = ['price' => 0]; + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['sskills'] += 1; + $u->rep['add_skills2'] += 1; + mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: rep['allrep'] - $u->rep['allnurep']) - $cur_price['price'] : ($u->rep['allrep'] - $u->rep['allnurep'])); ?> + ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за rep['add_stats'] * 100); ?> ед. +
Умение (еще rep['add_skills']) ?>)за 10000 ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+
+ info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + ?> +
+

info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - ?> + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + ?>

-
0) { - ?> - - -
- - $val){ - //if( $u->rep['rep'.$val] > 0 ) { - echo ' - - + 0) { + ?> + + +
+
Репутация в '.ucfirst(str_replace('city',' city',$val)).':'.$u->rep['rep'.$val].' ед.
+ $val) { + //if( $u->rep['rep'.$val] > 0 ) { + echo ' + + '; - //} - } - ?> -
Репутация в ' . ucfirst(str_replace('city', ' city', $val)) . ':' . $u->rep['rep' . $val] . ' ед.
- Текущая репутация: -
-
-info['dn']==0){ - ?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
- info['id']){ - $psh_start = '  '; - } - echo '
+ //} + } + ?> +
+ Текущая репутация: + + + info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } - } - }else{ - echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; - } - } + } + } + } else { + echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout( + 60 * 60 * 2 - time() + $dungeon_timeout['time'] + ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -?> + diff --git a/modules_data/location/dungeon_enter_all.php b/modules_data/location/dungeon_enter_all.php index c41854c6..a3de4357 100644 --- a/modules_data/location/dungeon_enter_all.php +++ b/modules_data/location/dungeon_enter_all.php @@ -656,7 +656,9 @@ if ($roomSection == 1) { if (!isset($hgo1['id'])) { ?> - (Пещера Тысячи Проклятий)' + (Пещера Тысячи Проклятий)' onclick='location="main.php?rz=1&add_quest=1&city_quest=capitalcity"'/> @@ -1078,7 +1080,7 @@ if ($roomSection == 1) { } } } else { - echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut( + echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout( 60 * 60 * 2 - time() + $dungeon_timeout['time'] ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; diff --git a/modules_data/location/enterbezdna.php b/modules_data/location/enterbezdna.php index f564acfd..510da259 100644 --- a/modules_data/location/enterbezdna.php +++ b/modules_data/location/enterbezdna.php @@ -1,781 +1,796 @@ room['file']=='enterbezdna') -{ +if ($u->room['file'] == 'enterbezdna') { -if(isset($_GET['rz'])) { - $rz = 1; -}else{ - $rz = 0; -} + if (isset($_GET['rz'])) { + $rz = 1; + } else { + $rz = 0; + } -$dun = 101; + $dun = 101; -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; + $g111 = 1; -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh101" AND `time` > '.(time()-60*60*2).' LIMIT 1',1); + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh101" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if($u->info['dn']>0) -{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh101',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Бездна","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); + $ids = ''; -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh101',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Бездна","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).''); - $ids = ''; - - $map_locs = array(); - $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dun.'"'); - while( $plm2 = mysql_fetch_array($spm2)) { - $map_locs[] = array($plm2['x'],$plm2['y']); - } - unset($spm2,$plm2); - - $ppx = 0; - while($pu = mysql_fetch_array($su)) - { - $ppx++; - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh101','',$pu['id']); - //Добавляем квестовые обьекты для персонажей - $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$pu['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); - //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); - while($pl2 = mysql_fetch_array($sp)) - { - $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "101" LIMIT 1')); - if( isset($pl['id']) ) { - $act = explode(',',$pl['act_date']); - $i = 0; - while( $i < count($act) ) { - $xr = explode(':=:',$act[$i]); - //Сбор ресурсов - if( $xr[0] == 'tk_itm' ) { - $xr2 = explode('=',$xr[1]); - if( $xr2[2] == 0 ) { - //Добавляем обьект для юзера - $j = 0; - while( $j < $xr2[1] ) { - $cord = $map_locs[rand(0,count($map_locs)-1)]; - if( $cord[0] != 0 || $cord[1] != 0 ) { - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$pu['id'].'","'.$pl['id'].'" - )'); - } - $j++; - } - }else{ - //Предмет находится в конкретном месте - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$pu['id'].'","'.$pl['id'].'" - )'); - } - // - } - $i++; - } - } - } - // - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - //Добавление обьектов (день святого валентина) - if( floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0 ) { - //Раскидываем предметы по пещере (Блёклый подземник) - $i = 1; - while($i <= $ppx) { - $j = rand(1,3); - while( $j >= 0 ) { - $rndx = 0; - $rndy = 0; - $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:101/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; - $j--; - } - $i++; - } - } - // - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv['id'])) - { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id']) && $u->info['dn'] == 0) - { - if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) { - $re = 'Вы ввели неправильный пароль'; - }elseif($u->info['level'] > 7) - { - $row = 0; - if(5 > $row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) -{ - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $ins = mysql_query('INSERT INTO `dungeon_zv` + $map_locs = []; + $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dun . '"'); + while ($plm2 = mysql_fetch_array($spm2)) { + $map_locs[] = [$plm2['x'], $plm2['y']]; + } + unset($spm2, $plm2); + + $ppx = 0; + while ($pu = mysql_fetch_array($su)) { + $ppx++; + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh101', '', $pu['id']); + //Добавляем квестовые обьекты для персонажей + $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $pu['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); + //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); + while ($pl2 = mysql_fetch_array($sp)) { + $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "101" LIMIT 1')); + if (isset($pl['id'])) { + $act = explode(',', $pl['act_date']); + $i = 0; + while ($i < count($act)) { + $xr = explode(':=:', $act[$i]); + //Сбор ресурсов + if ($xr[0] == 'tk_itm') { + $xr2 = explode('=', $xr[1]); + if ($xr2[2] == 0) { + //Добавляем обьект для юзера + $j = 0; + while ($j < $xr2[1]) { + $cord = $map_locs[rand(0, count($map_locs) - 1)]; + if ($cord[0] != 0 || $cord[1] != 0) { + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $pu['id'] . '","' . $pl['id'] . '" + )' + ); + } + $j++; + } + } else { + //Предмет находится в конкретном месте + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $pu['id'] . '","' . $pl['id'] . '" + )' + ); + } + // + } + $i++; + } + } + } + // + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + //Добавление обьектов (день святого валентина) + if (floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0) { + //Раскидываем предметы по пещере (Блёклый подземник) + $i = 1; + while ($i <= $ppx) { + $j = rand(1, 3); + while ($j >= 0) { + $rndx = 0; + $rndy = 0; + $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:101/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; + $j--; + } + $i++; + } + } + // + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id']) && $u->info['dn'] == 0) { + if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) { + $re = 'Вы ввели неправильный пароль'; + } elseif ($u->info['level'] > 7) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + "5")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "101" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '
'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if( $pl['pass'] != '' && $u->info['dn']==0 ) { - $dzs .= ' '; - } - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "101" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dzs .= ' '; + } + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - - - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - }else { - echo "Магический Портал"; - } - ?>
Рыцарский магазин
-
- -
+
+

room['name']; ?>

+
+
+ +
-
- -
-

- -
- -

-
- -
-

- -
- -

-
- -'.$re.'
'; -} +
+ +
+

+ +
+ +

+
+ +
+

+ +
+ +

+
+ + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id']) || $u->info['dn'] == 0) - { - if($g111==1 || $u->info['dn'] == 0) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id']) || $u->info['dn'] == 0) { + if ($g111 == 1 || $u->info['dn'] == 0) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -if($rz==0) { echo $dzs; } -if($rz == 1) { -?> -
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_angelscity" LIMIT 1',1); -if(isset($_GET['add_quest'])) { - if(isset($hgo['id'])) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - }else{ - - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 101'); - $dq_add = array(); - while($pl = mysql_fetch_array($sp)) { - if($u->rep['repangelscity'] == 9999) { - //квет, рыцарского задания - if( $pl['kin'] == 1 ) { - $dq_add = array( 0 => $pl ); - } - }elseif($u->rep['repangelscity'] == 24999) { - //квет, рыцарского задания - if( $pl['kin'] == 2 ) { - $dq_add = array( 0 => $pl ); - } - }else{ - if( $pl['kin'] == 0 ) { - $dq_add[count($dq_add)] = $pl; - } - } - } - - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - if($q->testGood($dq_add)==1 && $dq_add > 0) - { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $hgo['id'] = 1; - $u->addAction(time(),'psh_qt_angelscity',$dq_add['id']); - }else{ - if($u->rep['repangelscity'] == 9999) { - //квет, рыцарского задания - echo 'Вы уже получили задание на достижение титула рыцаря!
'; - }elseif($u->rep['repangelscity'] == 24999) { - //квет, рыцарского задания - echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; - }else{ - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - } - unset($dq_add); - } -} + if ($rz == 0) { + echo $dzs; + } + if ($rz == 1) { + ?> +
+ + testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_angelscity" LIMIT 1', 1); + if (isset($_GET['add_quest'])) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { -//Генерируем список текущих квестов -$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); -while($pl = mysql_fetch_array($sp)) -{ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - $qsee .= ' '.$pq['name'].'
'.$pq['info'].'
'.$q->info($pq).'

'; - $qx++; -} + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 101'); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + if ($u->rep['repangelscity'] == 9999) { + //квет, рыцарского задания + if ($pl['kin'] == 1) { + $dq_add = [0 => $pl]; + } + } elseif ($u->rep['repangelscity'] == 24999) { + //квет, рыцарского задания + if ($pl['kin'] == 2) { + $dq_add = [0 => $pl]; + } + } else { + if ($pl['kin'] == 0) { + $dq_add[count($dq_add)] = $pl; + } + } + } -if($qsee == '') -{ - $qsee = 'К сожалению у вас нет ни одного задания'; -} -?> -
-
-Текущие задания: [/28] - - + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + if ($q->testGood($dq_add) == 1 && $dq_add > 0) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $hgo['id'] = 1; + $u->addAction(time(), 'psh_qt_angelscity', $dq_add['id']); + } else { + if ($u->rep['repangelscity'] == 9999) { + //квет, рыцарского задания + echo 'Вы уже получили задание на достижение титула рыцаря!
'; + } elseif ($u->rep['repangelscity'] == 24999) { + //квет, рыцарского задания + echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + } + unset($dq_add); + } + } + + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; + $qx++; + } + + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания'; + } + ?> +
+
+ Текущие задания: [/28] + + -
- -'.date('d.m.Y H:i',$hgo['time']+60*60*24).'
( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; +if (!isset($hgo['id'])) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . '
( Через ' . Conversion::secondsToTimeout( + $hgo['time'] + 60 * 60 * 24 - time() + ) . ' )'; } ?> -
- -
- 'capitalcity',2=>'demonscity',3=>'angelscity'); - if($_GET['buy1']==1) { - //покупаем статы - $price = 2000+($u->rep['add_stats']*100); - $cur_price = array('price'=>0); - if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики! - - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 способность за '.$price.' ед. награды
'; - $u->info['ability'] += 1; - $u->rep['add_stats'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif($_GET['buy1']==2) { // Умения! - $price = 2000+(2000*$u->rep['add_skills']); - $cur_price = array('price'=>0); - if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения! - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 умение за '.$price.' ед. награды
'; - $u->info['skills'] += 1; - $u->rep['add_skills'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==3) { // Кредиты - $price = 100; - $cur_price = array('price'=>0); - if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 10 кр. за '.$price.' ед. награды
'; - $u->info['money'] += 10; - $u->rep['add_money'] += 10; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - }elseif( $_GET['buy1'] == 4 ) { // Особенности - $price = 3000; - $cur_price = array('price'=>0); - if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 особенность за '.$price.' ед. награды
'; - $u->info['nskills'] += 1; - $u->rep['add_skills2'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: - rep['allrep']-$u->rep['allnurep'])?> - ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за rep['add_stats']*100);?> ед.
Умение (еще rep['add_skills'])?>)за rep['add_skills']);?> ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-

+

+ +
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity']; + if ($_GET['buy1'] == 1) { + //покупаем статы + $price = 2000 + ($u->rep['add_stats'] * 100); + $cur_price = ['price' => 0]; + if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! + + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 способность за ' . $price . ' ед. награды
'; + $u->info['ability'] += 1; + $u->rep['add_stats'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { // Умения! + $price = 2000 + (2000 * $u->rep['add_skills']); + $cur_price = ['price' => 0]; + if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 умение за ' . $price . ' ед. награды
'; + $u->info['skills'] += 1; + $u->rep['add_skills'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { // Кредиты + $price = 100; + $cur_price = ['price' => 0]; + if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды
'; + $u->info['money'] += 10; + $u->rep['add_money'] += 10; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { // Особенности + $price = 3000; + $cur_price = ['price' => 0]; + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды
'; + $u->info['nskills'] += 1; + $u->rep['add_skills2'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: + rep['allrep'] - $u->rep['allnurep']) ?> + ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за rep['add_stats'] * 100); ?> ед. +
Умение (еще rep['add_skills']) ?>)за rep['add_skills']); ?> ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+

info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - - } - if($chk[0]>0) { - ?> - - + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + + } + if ($chk[0] > 0) { + ?> + +

-
-
- - - - - - - - - - - - - -
Репутация в Capital city:rep['repcapitalcity']?> ед.
Репутация в Demons city:rep['repdemonscity']?> ед.
Репутация в Angels city:rep['repangelscity']?> ед.
- Текущая репутация: -
-
-info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ +
+ + + + + + + + + + + + + +
Репутация в Capital city:rep['repcapitalcity'] ?> ед.
Репутация в Demons city:rep['repdemonscity'] ?> ед.
Репутация в Angels city:rep['repangelscity'] ?> ед.
+ Текущая репутация: +
+
+ info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(60*60*2-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -} -} -?> + diff --git a/modules_data/location/entercat.php b/modules_data/location/entercat.php index 33da7d73..b0c135fd 100644 --- a/modules_data/location/entercat.php +++ b/modules_data/location/entercat.php @@ -1,694 +1,704 @@ room['file']=='entercat') -{ +if ($u->room['file'] == 'entercat') { -if(isset($_GET['rz'])) { - $rz = 1; -}else{ - $rz = 0; -} + if (isset($_GET['rz'])) { + $rz = 1; + } else { + $rz = 0; + } -$dun = 3; //для новичков 2-7 лвл + $dun = 3; //для новичков 2-7 лвл -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1); + $g111 = 1; + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -if($u->info['dn']>0) -{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh1',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Катакомбы","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).''); - $ids = ''; - while($pu = mysql_fetch_array($su)) - { - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh1','',$pu['id']); - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "19" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv['id'])) - { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id'])) - { - if($u->info['level']>7) - { - $row = 0; - if(5>$row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) -{ - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $ins = mysql_query('INSERT INTO `dungeon_zv` + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh1',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Катакомбы","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); + $ids = ''; + while ($pu = mysql_fetch_array($su)) { + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh1', '', $pu['id']); + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "19" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id'])) { + if ($u->info['level'] > 7) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + "5")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "3" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '
'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "3" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - }else { - echo "Магический Портал"; - } - ?>
-
- -
+
+

room['name']; ?>

+
+
+ +
-
- -
-

- -
- -

-
- -
-

- -
- -

-
- -'.$re.'
'; -} + + +
+

+ +
+ +

+
+ +
+

+ +
+ +

+
+ + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id'])) - { - if($g111==1) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id'])) { + if ($g111 == 1) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -if($rz==0) { echo $dzs; } -if($rz == 1) { -?> -
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_demonscity" LIMIT 1',1); -if(isset($_GET['add_quest'])) { - if(isset($hgo['id'])) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - }else{ - - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 3'); - $dq_add = array(); - while($pl = mysql_fetch_array($sp)) { - if($u->rep['repdemonscity'] == 9999) { - //квет, рыцарского задания - if( $pl['kin'] == 1 ) { - $dq_add = array( 0 => $pl ); - } - }elseif($u->rep['repdemonscity'] == 24999) { - //квет, рыцарского задания - if( $pl['kin'] == 2 ) { - $dq_add = array( 0 => $pl ); - } - }else{ - if( $pl['kin'] == 0 ) { - $dq_add[count($dq_add)] = $pl; - } - } - } - - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - if($q->testGood($dq_add)==1) - { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $hgo['id'] = 1; - $u->addAction(time(),'psh_qt_demonscity',$dq_add['id']); - }else{ - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - unset($dq_add); - } -} + if ($rz == 0) { + echo $dzs; + } + if ($rz == 1) { + ?> +
+ + testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_demonscity" LIMIT 1', 1); + if (isset($_GET['add_quest'])) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { -//Генерируем список текущих квестов -$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); -while($pl = mysql_fetch_array($sp)) -{ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - $qsee .= ' '.$pq['name'].'
'.$pq['info'].'
'.$q->info($pq).'

'; - $qx++; -} + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 3'); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + if ($u->rep['repdemonscity'] == 9999) { + //квет, рыцарского задания + if ($pl['kin'] == 1) { + $dq_add = [0 => $pl]; + } + } elseif ($u->rep['repdemonscity'] == 24999) { + //квет, рыцарского задания + if ($pl['kin'] == 2) { + $dq_add = [0 => $pl]; + } + } else { + if ($pl['kin'] == 0) { + $dq_add[count($dq_add)] = $pl; + } + } + } -if($qsee == '') -{ - $qsee = 'К сожалению у вас нет ни одного задания'; -} -?> -
-
-Текущие задания: [/28] - - + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + if ($q->testGood($dq_add) == 1) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $hgo['id'] = 1; + $u->addAction(time(), 'psh_qt_demonscity', $dq_add['id']); + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + unset($dq_add); + } + } + + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; + $qx++; + } + + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания'; + } + ?> +
+
+ Текущие задания: [/28] + + -
- -'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; +if (!isset($hgo['id'])) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout( + $hgo['time'] + 60 * 60 * 24 - time() + ) . ' )'; } ?>
-
- -
- 'capitalcity',2=>'demonscity',3=>'angelscity'); - if($_GET['buy1']==1) { - //покупаем статы - $price = 2000+($u->rep['add_stats']*100); - $cur_price = array('price'=>0); - if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики! - - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 способность за '.$price.' ед. награды
'; - $u->info['ability'] += 1; - $u->rep['add_stats'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif($_GET['buy1']==2) { // Умения! - $price = 2000+(2000*$u->rep['add_skills']); - $cur_price = array('price'=>0); - if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения! - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 умение за '.$price.' ед. награды
'; - $u->info['skills'] += 1; - $u->rep['add_skills'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==3) { // Кредиты - $price = 100; - $cur_price = array('price'=>0); - if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 10 кр. за '.$price.' ед. награды
'; - $u->info['money'] += 10; - $u->rep['add_money'] += 10; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - }elseif( $_GET['buy1'] == 4 ) { // Особенности - $price = 3000; - $cur_price = array('price'=>0); - if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 особенность за '.$price.' ед. награды
'; - $u->info['nskills'] += 1; - $u->rep['add_skills2'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: - rep['allrep']-$u->rep['allnurep'])?> - ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за rep['add_stats']*100);?> ед.
Умение (еще rep['add_skills'])?>)за rep['add_skills']);?> ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-

+

+ +
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity']; + if ($_GET['buy1'] == 1) { + //покупаем статы + $price = 2000 + ($u->rep['add_stats'] * 100); + $cur_price = ['price' => 0]; + if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! + + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 способность за ' . $price . ' ед. награды
'; + $u->info['ability'] += 1; + $u->rep['add_stats'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { // Умения! + $price = 2000 + (2000 * $u->rep['add_skills']); + $cur_price = ['price' => 0]; + if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 умение за ' . $price . ' ед. награды
'; + $u->info['skills'] += 1; + $u->rep['add_skills'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { // Кредиты + $price = 100; + $cur_price = ['price' => 0]; + if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды
'; + $u->info['money'] += 10; + $u->rep['add_money'] += 10; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { // Особенности + $price = 3000; + $cur_price = ['price' => 0]; + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды
'; + $u->info['nskills'] += 1; + $u->rep['add_skills2'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: + rep['allrep'] - $u->rep['allnurep']) ?> + ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за rep['add_stats'] * 100); ?> ед. +
Умение (еще rep['add_skills']) ?>)за rep['add_skills']); ?> ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+

info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - - } - if($chk[0]>0) { - ?> - - + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + + } + if ($chk[0] > 0) { + ?> + +

-
-
- - - - - - - - - - - - - -
Репутация в Capital city:rep['repcapitalcity']?> ед.
Репутация в Demons city:rep['repdemonscity']?> ед.
Репутация в Angels city:rep['repangelscity']?> ед.
- Текущая репутация: -
-
-info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ +
+ + + + + + + + + + + + + +
Репутация в Capital city:rep['repcapitalcity'] ?> ед.
Репутация в Demons city:rep['repdemonscity'] ?> ед.
Репутация в Angels city:rep['repangelscity'] ?> ед.
+ Текущая репутация: +
+
+ info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -} -} -?> + diff --git a/modules_data/location/enterdrago.php b/modules_data/location/enterdrago.php index 6f280839..452e8ae4 100644 --- a/modules_data/location/enterdrago.php +++ b/modules_data/location/enterdrago.php @@ -1,935 +1,1051 @@ room['file']=='enterdrago') { -if(isset($_GET['rz'])) $roomSection = 1; // Получаем Задание - else $roomSection = 0; // Собираем группу для похода - $error = ''; // Собираем ошибки. - $dungeonGroupList = ''; // Сюда помещаем список Групп. - $dungeonGo = 1; // По умолчанию, мы идем в пещеру. +use Helper\Conversion; -$dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') ); -//var_info($dungeon); -$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); -while( $t = mysql_fetch_array($all_dungeon) ) { $dungeon['list'][] = $t['city']; } -unset($all_dungeon); +if (!defined('GAME')) { + die(); +} +if ($u->room['file'] == 'enterdrago') { -if( $u->info['dn'] > 0 ) { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])){ - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if (isset($_GET['rz'])) { + $roomSection = 1; + } // Получаем Задание + else { + $roomSection = 0; + } // Собираем группу для похода + $error = ''; // Собираем ошибки. + $dungeonGroupList = ''; // Сюда помещаем список Групп. + $dungeonGo = 1; // По умолчанию, мы идем в пещеру. -$dungeon_timeout = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh'.$dungeon['id'].'" AND `time` > '.(time()-60*60*20).' LIMIT 1',1); -//if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры. -if(isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. -{ - $dungeonGo = 0; - if(isset($_GET['start'])){ - $error = 'До следующего похода осталось еще: '.$u->timeOut(60*60*20-time()+$dungeon_timeout['time']); - } -} + $dungeon = mysql_fetch_assoc( + mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1') + ); + //var_info($dungeon); + $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); + while ($t = mysql_fetch_array($all_dungeon)) { + $dungeon['list'][] = $t['city']; + } + unset($all_dungeon); -if( isset($_GET['start']) && $zv['uid']==$u->info['id'] && $dungeonGo == 1 ) { //начинаем поход - //Генирируем случайный поход - //$level = $u->info['level']; - if( $zv['type'] == 0 ) { - $level = 5; - }elseif( $zv['type'] == 1 ) { - $level = 8; - }elseif( $zv['type'] == 2 ) { - $level = 10; - } + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } - $k=floor(2.5*$level); // k=maze size - $s=$k*2+3; // s=array size - $r=10; // r=cell size (in pixels) - $count=1; // count=cells visited. - - $a=array(); // A [Row][Col] array of cells (0=open, 1=filled) of the maze. - for($y=0;$y<$s;$y++) { // Initialize array to all 1 (green). - for($x=0;$x<$s;$x++) { - $a[$y][$x]=1; - } - } - for($x=0;$x<$s;$x++) { // Clear rim to 0, to serve as a barricade. - $a[0][$x]=0;$a[$s-1][$x]=0; - $a[$x][0]=0;$a[$x][$s-1]=0; - } - $x=$y=($k-1)>>1;$a[$y*2+2][$x*2+2]=0; // start from center - while(1) { // Open paths for k^2 cells. - do { // Dig as far as possible until we reach a cul-de-sac. - $d=rand(0,3); // Pick initial direction raqndomly. - for($i=0;$i<4;$i++) { // Look for a good direction. - if($d==0 && $a[$y*2+2][$x*2+4]) { // right - $a[$y*2+2][$x++*2+3]=0;$a[$y*2+2][$x*2+2]=0; - $i=5;$count++;break; // found - } elseif($d==1 && $a[$y*2][$x*2+2]) { // up - $a[$y--*2+1][$x*2+2]=0;$a[$y*2+2][$x*2+2]=0; - $i=5;$count++;break; // found - } elseif($d==2 && $a[$y*2+2][$x*2]) { // left - $a[$y*2+2][$x--*2+1]=0;$a[$y*2+2][$x*2+2]=0; - $i=5;$count++;break; // found - } elseif($d==3 && $a[$y*2+4][$x*2+2]) { // down - $a[$y++*2+3][$x*2+2]=0;$a[$y*2+2][$x*2+2]=0; - $i=5;$count++;break; // found - } - $d=($d+1)%4; // wrap right->up->left->down->right - } // for - } while ($i!=4); // i=4 means we are stuck - if($count>=$k*$k) { // Did we visit k^2 cells? - break; // while(1) The entire maze has been created. - } - $x=rand(0,$k-1);$y=rand(0,$k-1); // Pick random cell on maze. - // Scan left-to-right top-to-botton for a dug cell with at least - while($a[$y*2+2][$x*2+2] || // one expandable neighbor - !$a[$y*2+2][$x*2+4] && !$a[$y*2][$x*2+2] && - !$a[$y*2+2][$x*2] && !$a[$y*2+4][$x*2+2]) { - if(++$x>=$k) { // wrap right edge to left edge - $x=0; - if(++$y>=$k) { // wrap bottom to top - $y=0; - } - } - } - } // while(1) - $rnds = array( - rand(1,3), //start - rand(1,3) //end - ); - $srg = array(); - $objects = array(); - - if( $rnds[0] == 1 ) { - //вход сверху - $a[2][1]=0; - $a[2][2]=0; - $srg = array( 2,1 ); - $objects[2][1] = '
'; - }elseif( $rnds[0] == 2 ) { - //вход по центру - $a[$k][1]=0; - $a[$k][2]=0; - $srg = array( $k,1 ); - $objects[$k][1] = '
'; - }elseif( $rnds[0] == 3 ) { - //вход снизу - $a[$k*2][1]=0; - $a[$k*2][2]=0; - $srg = array( $k*2,1 ); - $objects[$k*2][1] = '
'; - } - - if( $rnds[1] == 1 ) { - //вход сверху - $a[2][$k*2+1]=0; - $a[2][$k*2]=0; - $objects[2][$k*2+1] = '
'; - }elseif( $rnds[1] == 2 ) { - //вход по центру - $a[$k][$k*2+1]=0; - $a[$k][$k*2]=0; - $objects[$k][$k*2+1] = '
'; - }elseif( $rnds[1] == 3 ) { - //вход снизу - $a[$k*2][$k*2+1]=0; - $a[$k*2][$k*2]=0; - $objects[$k*2][$k*2+1] = '
'; - } - //$a[1][2]=0; - //$a[$k*2+1][$k*2]=0; // Draw entrance and exit. -?> - - 1 && $j > 1 && $i <= $k*2 && $j <= $k*2 ) { - $map[] = array($i,$j); - } - $j++; - } - $i++; - } - - //Раскидываем обьекты (XX %) - /* - $proc1 = 10; //Сколько % занимают сундуки - $proc2 = 15; //Сколько % занимают монстры - $proc3 = 10; //Сколько % занимают хилки - $proc4 = 5; //Сколько % занимают ловушки - $proc5 = 2; //Сколько % занимают пандоры*/ - $proc1 = round(1.7*$level); //Сколько % занимают сундуки - $proc2 = round(2.5*$level); //Сколько % занимают монстры - $proc3 = round(1.35*$level); //Сколько % занимают хилки - $proc4 = round(0.5*$level); //Сколько % занимают ловушки - $proc5 = round(0.1*$level); //Сколько % занимают пандоры - // - $proc1 = round($proc1/2); - $proc1 = round(count($map)/100*$proc1); - $proc2 = round($proc2/2); - $proc2 = round(count($map)/100*$proc2); - $proc3 = round($proc3/2); - $proc3 = round(count($map)/100*$proc3); - $proc4 = round($proc4/2); - $proc4 = round(count($map)/100*$proc4); - $proc5 = round($proc5/2); - $proc5 = round(count($map)/100*$proc5); - // - //if( $u->info['id'] == 1002 ) { - - $usi = 0; - - //Сохраняем карту - mysql_query('INSERT INTO `laba_now` ( `time`,`uid`,`users`,`map_id`,`end`,`type` ) VALUES ( - "'.time().'","'.$u->info['id'].'","-1","0","0","'.$zv['type'].'" - )'); - $ding = mysql_insert_id(); - $sp = mysql_query( 'SELECT `id`,`dn` FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 4' ); - while( $pl = mysql_fetch_array( $sp ) ) { - $u->addAction(time(),'psh102','',$pl['id']); - mysql_query('UPDATE `users` SET `room` = "370" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0",`dnow` = "'.$ding.'",`x` = "'.$srg[0].'",`y` = "'.$srg[1].'",`res_x` = "'.$srg[0].'",`res_y` = "'.$srg[1].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $usi++; - } - mysql_query('UPDATE `laba_now` SET `users` = "'.$usi.'" WHERE `id` = "'.$ding.'" LIMIT 1'); - mysql_query('INSERT INTO `laba_map` ( `id`,`data`,`update` ) VALUES ( - "'.$ding.'","'.json_encode($a).'","'.time().'" - )'); - mysql_query('DELETE FROM `dungeon_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - //} - // - $i = 1; - while( $i <= 5 ) { - if( ${'proc'.$i} > 0 ) { - $j = 0; - while( $j < ${'proc'.$i} ) { - $cord = $map[rand(0,count($map)-1)]; - $obj = ''; - if( $i == 1 ) { - //сундуки - $obj = 'ddp1s'; - }elseif( $i == 2 ) { - //монстры - $obj = 'ddp1m'; - }elseif( $i == 3 ) { - //хилки - $obj = 'ddp1h'; - }elseif( $i == 4 ) { - //ловушки - $obj = 'ddp1l'; - }elseif( $i == 5 ) { - //пандора - $obj = 'ddp1p'; - } - $test = mysql_fetch_assoc(mysql_query(' SELECT id FROM `laba_obj` WHERE `img`="'.$obj.'" AND `x`= "'.$cord[0].'" AND `y`= "'.$cord[1].'" AND `lib` = "'.$ding.'" ')); - if( !isset($test['id']) ){ - mysql_query('INSERT INTO `laba_obj` ( `lib`,`x`,`y`,`type`,`img`,`name`,`time`,`use` ) VALUES ( - "'.$ding.'","'.$cord[0].'","'.$cord[1].'","'.$i.'","'.$obj.'","{standart}","'.time().'","0" - )'); - $j++; - } - //$objects[$cord[0]][$cord[1]] = $obj; - - } - } - $i++; - } - - die(''); - - //Генирация карты - /* - $i = 1; - while( $i < count($a) - 1 ) { - $j = 1; - while( $j < count($a[$i]) - 1 ) { - if( $a[$i][$j] == 0 ) { - echo '
'.$objects[$i][$j].'
'; - }else{ - echo '
'; - } - $j++; - } - echo '
'; - $i++; - } - */ - -}elseif(isset($_POST['go'],$_POST['goid']) && $dungeonGo==1){ - if(!isset($zv['id'])){ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id']) && $u->info['dn'] == 0){ - if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) { - $error = 'Вы ввели неправильный пароль'; - }elseif($u->info['level'] > 3 && $u->info['level'] == $zv['lvlmin']){ - $row = 0; - if(4 > $row){ - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd){ - $error = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $error = 'В группе нет места'; - unset($zv); - } - }else{ - $error = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $error = 'Заявка не найдена'; - } - }else{ - $error = 'Вы уже находитесь в группе'; - } -}elseif( isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1 ) { - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])){ - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $dungeonGo == 1){ - if($u->info['dn']==0){ - if( $_POST['type_gors'] == 1 ) { - $_POST['type_gors'] = 1; - }elseif( $_POST['type_gors'] == 2 ) { - $_POST['type_gors'] = 2; - }else{ - $_POST['type_gors'] = 0; - } - if( $_POST['type_gors'] == 2 && ($u->info['level'] < 9 || $u->rep['rep3'] < 20000) ) { - $error = 'Создавать турниры для Легендарных могут персонажи страше 8-го уровня
Так-же у персонажа должно быть более 20000 воинственности!'; - }elseif( $_POST['type_gors'] == 1 && $u->info['level'] < 8 ) { - $error = 'Создавать турниры для Опытных могут персонажи страше 7-го уровня'; - }elseif( $_POST['type_gors'] == 0 && $u->info['level'] > 7 ) { - $error = 'Создавать турниры для Новичков могут персонажи младше 8-го уровня'; - }else{ - $ins = mysql_query('INSERT INTO `dungeon_zv` + $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh' . $dungeon['id'] . '" AND `time` > ' . (time() - 60 * 60 * 20) . ' LIMIT 1', 1); + + if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. + { + $dungeonGo = 0; + if (isset($_GET['start'])) { + $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 20 - time() + $dungeon_timeout['time']); + } + } + + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { //начинаем поход + //Генирируем случайный поход + //$level = $u->info['level']; + if ($zv['type'] == 0) { + $level = 5; + } elseif ($zv['type'] == 1) { + $level = 8; + } elseif ($zv['type'] == 2) { + $level = 10; + } + + $k = floor(2.5 * $level); // k=maze size + $s = $k * 2 + 3; // s=array size + $r = 10; // r=cell size (in pixels) + $count = 1; // count=cells visited. + + $a = []; // A [Row][Col] array of cells (0=open, 1=filled) of the maze. + for ($y = 0; $y < $s; $y++) { // Initialize array to all 1 (green). + for ($x = 0; $x < $s; $x++) { + $a[$y][$x] = 1; + } + } + for ($x = 0; $x < $s; $x++) { // Clear rim to 0, to serve as a barricade. + $a[0][$x] = 0; + $a[$s - 1][$x] = 0; + $a[$x][0] = 0; + $a[$x][$s - 1] = 0; + } + $x = $y = ($k - 1) >> 1; + $a[$y * 2 + 2][$x * 2 + 2] = 0; // start from center + while (1) { // Open paths for k^2 cells. + do { // Dig as far as possible until we reach a cul-de-sac. + $d = rand(0, 3); // Pick initial direction raqndomly. + for ($i = 0; $i < 4; $i++) { // Look for a good direction. + if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) { // right + $a[$y * 2 + 2][$x++ * 2 + 3] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; // found + } elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) { // up + $a[$y-- * 2 + 1][$x * 2 + 2] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; // found + } elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) { // left + $a[$y * 2 + 2][$x-- * 2 + 1] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; // found + } elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) { // down + $a[$y++ * 2 + 3][$x * 2 + 2] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; // found + } + $d = ($d + 1) % 4; // wrap right->up->left->down->right + } // for + } while ($i != 4); // i=4 means we are stuck + if ($count >= $k * $k) { // Did we visit k^2 cells? + break; // while(1) The entire maze has been created. + } + $x = rand(0, $k - 1); + $y = rand(0, $k - 1); // Pick random cell on maze. + // Scan left-to-right top-to-botton for a dug cell with at least + while ($a[$y * 2 + 2][$x * 2 + 2] || // one expandable neighbor + !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] && + !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) { + if (++$x >= $k) { // wrap right edge to left edge + $x = 0; + if (++$y >= $k) { // wrap bottom to top + $y = 0; + } + } + } + } // while(1) + $rnds = [ + rand(1, 3), //start + rand(1, 3), //end + ]; + $srg = []; + $objects = []; + + if ($rnds[0] == 1) { + //вход сверху + $a[2][1] = 0; + $a[2][2] = 0; + $srg = [2, 1]; + $objects[2][1] = '
'; + } elseif ($rnds[0] == 2) { + //вход по центру + $a[$k][1] = 0; + $a[$k][2] = 0; + $srg = [$k, 1]; + $objects[$k][1] = '
'; + } elseif ($rnds[0] == 3) { + //вход снизу + $a[$k * 2][1] = 0; + $a[$k * 2][2] = 0; + $srg = [$k * 2, 1]; + $objects[$k * 2][1] = '
'; + } + + if ($rnds[1] == 1) { + //вход сверху + $a[2][$k * 2 + 1] = 0; + $a[2][$k * 2] = 0; + $objects[2][$k * 2 + 1] = '
'; + } elseif ($rnds[1] == 2) { + //вход по центру + $a[$k][$k * 2 + 1] = 0; + $a[$k][$k * 2] = 0; + $objects[$k][$k * 2 + 1] = '
'; + } elseif ($rnds[1] == 3) { + //вход снизу + $a[$k * 2][$k * 2 + 1] = 0; + $a[$k * 2][$k * 2] = 0; + $objects[$k * 2][$k * 2 + 1] = '
'; + } + //$a[1][2]=0; + //$a[$k*2+1][$k*2]=0; // Draw entrance and exit. + ?> + + 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) { + $map[] = [$i, $j]; + } + $j++; + } + $i++; + } + + //Раскидываем обьекты (XX %) + /* + $proc1 = 10; //Сколько % занимают сундуки + $proc2 = 15; //Сколько % занимают монстры + $proc3 = 10; //Сколько % занимают хилки + $proc4 = 5; //Сколько % занимают ловушки + $proc5 = 2; //Сколько % занимают пандоры*/ + $proc1 = round(1.7 * $level); //Сколько % занимают сундуки + $proc2 = round(2.5 * $level); //Сколько % занимают монстры + $proc3 = round(1.35 * $level); //Сколько % занимают хилки + $proc4 = round(0.5 * $level); //Сколько % занимают ловушки + $proc5 = round(0.1 * $level); //Сколько % занимают пандоры + // + $proc1 = round($proc1 / 2); + $proc1 = round(count($map) / 100 * $proc1); + $proc2 = round($proc2 / 2); + $proc2 = round(count($map) / 100 * $proc2); + $proc3 = round($proc3 / 2); + $proc3 = round(count($map) / 100 * $proc3); + $proc4 = round($proc4 / 2); + $proc4 = round(count($map) / 100 * $proc4); + $proc5 = round($proc5 / 2); + $proc5 = round(count($map) / 100 * $proc5); + // + //if( $u->info['id'] == 1002 ) { + + $usi = 0; + + //Сохраняем карту + mysql_query( + 'INSERT INTO `laba_now` ( `time`,`uid`,`users`,`map_id`,`end`,`type` ) VALUES ( + "' . time() . '","' . $u->info['id'] . '","-1","0","0","' . $zv['type'] . '" + )' + ); + $ding = mysql_insert_id(); + $sp = mysql_query('SELECT `id`,`dn` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 4'); + while ($pl = mysql_fetch_array($sp)) { + $u->addAction(time(), 'psh102', '', $pl['id']); + mysql_query('UPDATE `users` SET `room` = "370" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `stats` SET `dn` = "0",`dnow` = "' . $ding . '",`x` = "' . $srg[0] . '",`y` = "' . $srg[1] . '",`res_x` = "' . $srg[0] . '",`res_y` = "' . $srg[1] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + $usi++; + } + mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1'); + mysql_query( + 'INSERT INTO `laba_map` ( `id`,`data`,`update` ) VALUES ( + "' . $ding . '","' . json_encode($a) . '","' . time() . '" + )' + ); + mysql_query('DELETE FROM `dungeon_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + //} + // + $i = 1; + while ($i <= 5) { + if (${'proc' . $i} > 0) { + $j = 0; + while ($j < ${'proc' . $i}) { + $cord = $map[rand(0, count($map) - 1)]; + $obj = ''; + if ($i == 1) { + //сундуки + $obj = 'ddp1s'; + } elseif ($i == 2) { + //монстры + $obj = 'ddp1m'; + } elseif ($i == 3) { + //хилки + $obj = 'ddp1h'; + } elseif ($i == 4) { + //ловушки + $obj = 'ddp1l'; + } elseif ($i == 5) { + //пандора + $obj = 'ddp1p'; + } + $test = mysql_fetch_assoc( + mysql_query(' SELECT id FROM `laba_obj` WHERE `img`="' . $obj . '" AND `x`= "' . $cord[0] . '" AND `y`= "' . $cord[1] . '" AND `lib` = "' . $ding . '" ') + ); + if (!isset($test['id'])) { + mysql_query( + 'INSERT INTO `laba_obj` ( `lib`,`x`,`y`,`type`,`img`,`name`,`time`,`use` ) VALUES ( + "' . $ding . '","' . $cord[0] . '","' . $cord[1] . '","' . $i . '","' . $obj . '","{standart}","' . time() . '","0" + )' + ); + $j++; + } + //$objects[$cord[0]][$cord[1]] = $obj; + + } + } + $i++; + } + + die(''); + + //Генирация карты + /* + $i = 1; + while( $i < count($a) - 1 ) { + $j = 1; + while( $j < count($a[$i]) - 1 ) { + if( $a[$i][$j] == 0 ) { + echo '
'.$objects[$i][$j].'
'; + }else{ + echo '
'; + } + $j++; + } + echo '
'; + $i++; + } + */ + + } elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id']) && $u->info['dn'] == 0) { + if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) { + $error = 'Вы ввели неправильный пароль'; + } elseif ($u->info['level'] > 3 && $u->info['level'] == $zv['lvlmin']) { + $row = 0; + if (4 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $error = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $error = 'В группе нет места'; + unset($zv); + } + } else { + $error = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $error = 'Заявка не найдена'; + } + } else { + $error = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) { + if ($u->info['dn'] == 0) { + if ($_POST['type_gors'] == 1) { + $_POST['type_gors'] = 1; + } elseif ($_POST['type_gors'] == 2) { + $_POST['type_gors'] = 2; + } else { + $_POST['type_gors'] = 0; + } + if ($_POST['type_gors'] == 2 && ($u->info['level'] < 9 || $u->rep['rep3'] < 20000)) { + $error = 'Создавать турниры для Легендарных могут персонажи страше 8-го уровня
Так-же у персонажа должно быть более 20000 воинственности!'; + } elseif ($_POST['type_gors'] == 1 && $u->info['level'] < 8) { + $error = 'Создавать турниры для Опытных могут персонажи страше 7-го уровня'; + } elseif ($_POST['type_gors'] == 0 && $u->info['level'] > 7) { + $error = 'Создавать турниры для Новичков могут персонажи младше 8-го уровня'; + } else { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`,`type`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dungeon['id'].'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", - "'.$u->info['level'].'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", + "' . $u->info['level'] . '", "21", "5", - "'.mysql_real_escape_string($_POST['type_gors']).'")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $error = 'Вы успешно создали группу'; - }else{ - $error = 'Не удалось создать группу'; - } - } - }else{ - $error = 'Вы уже находитесь в группе'; - } -} + "' . mysql_real_escape_string($_POST['type_gors']) . '")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $error = 'Вы успешно создали группу'; + } else { + $error = 'Не удалось создать группу'; + } + } + } else { + $error = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$pltype = array( - 0 => 'Новичок', - 1 => 'Опытный', - 2 => 'Старый' -); + //Генерируем список групп + $pltype = [ + 0 => 'Новичок', + 1 => 'Опытный', + 2 => 'Старый', + ]; -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `lvlmin` = "'.$u->info['level'].'" AND `dun` = "'.$dungeon['id'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); + $sp = mysql_query( + 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `lvlmin` = "' . $u->info['level'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time( + ) - 60 * 60 * 2) . '"' + ); -while( $pl = mysql_fetch_array( $sp ) ) { - $dungeonGroupList .= '
'; - if( $u->info['dn'] == 0 ) $dungeonGroupList .= ''; - $dungeonGroupList .= ''.date('H:i',$pl['time']).' '; - $dungeonGroupList .= 'Тип: '.$pltype[$pl['type']].' | '; - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while( $pu = mysql_fetch_array( $su ) ) { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim( $pus, ', ' ); - - $dungeonGroupList .= $pus; unset($pus); + while ($pl = mysql_fetch_array($sp)) { + $dungeonGroupList .= '
'; + if ($u->info['dn'] == 0) { + $dungeonGroupList .= ''; + } + $dungeonGroupList .= '' . date('H:i', $pl['time']) . ' '; + $dungeonGroupList .= 'Тип: ' . $pltype[$pl['type']] . ' | '; + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); - if( $pl['pass'] != '' && $u->info['dn'] == 0 ) $dungeonGroupList .= ' '; - if( $pl['com'] != '' ) { - $dl = ''; - // Если модератор, даем возможность удалять комментарий к походу. - $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); - if( ( $moder['boi'] == 1 || $u->info['admin'] > 0 ) && $pl['dcom'] == 0 ){ - $dl .= ' (удалить комментарий)'; - if( isset( $_GET['delcom'] ) && $_GET['delcom'] == $pl['id'] && $u->newAct( $_GET['key'] ) == true ) { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - $pl['com'] = htmlspecialchars($pl['com'],NULL); - if( $pl['dcom'] > 0 ) { - $dl = ' комментарий удален модератором'; - } - if( $pl['dcom'] > 0 ) { - if( $moder['boi'] == 1 || $u->info['admin'] > 0 ) { - $pl['com'] = ''.$pl['com'].''; - } else { - $pl['com'] = ''; - } - } - $dungeonGroupList .= ' | '.$pl['com'].''.$dl.''; - } - $dungeonGroupList .= '
'; -} -?> - - - - - - -
- error!='') { - echo ''.$u->error.''; - }elseif($re!='') { - echo ''.$re.''; - } - ?> -
-

room['name']; ?>

-
- Если вы не найдете выход из пещеры, то любые найденные вами ресурсы (даже в предыдущих походах) - исчезнут. То же самое, если вы умрёте 3 раза. -
- + $dungeonGroupList .= $pus; + unset($pus); + + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dungeonGroupList .= ' '; + } + if ($pl['com'] != '') { + $dl = ''; + // Если модератор, даем возможность удалять комментарий к походу. + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + $pl['com'] = htmlspecialchars($pl['com'], null); + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + $dungeonGroupList .= ' | ' . $pl['com'] . '' . $dl . ''; + } + $dungeonGroupList .= ''; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - }else { - echo "Магический Портал"; - } - ?>
-
- -
+ error != '') { + echo '' . $u->error . ''; + } elseif ($re != '') { + echo '' . $re . ''; + } + ?> +
+

room['name']; ?>

+
+ Если вы не найдете выход из пещеры, то любые найденные вами ресурсы (даже в предыдущих походах) - исчезнут. То же самое, если вы умрёте 3 раза. +
+ +
-
- -
-

- -
- -

-
- -
-

- - ?> -

-
- -'.$error.'
'; -} + + +
+

+ +
+ +

+
+ +
+

+ + ?> +

+
+ + ' . $error . '
'; + } -//отображаем -if($dungeonGroupList=='') -{ - $dungeonGroupList = ''; -}else{ - if(!isset($zv['id']) || $u->info['dn'] == 0) - { - if($dungeonGo==1 || $u->info['dn'] == 0) - { - $pr = ''; - } - $dungeonGroupList = '
'.$pr.'
'.$dungeonGroupList.''.$pr.'
'; - } - $dungeonGroupList .= '
'; -} + //отображаем + if ($dungeonGroupList == '') { + $dungeonGroupList = ''; + } else { + if (!isset($zv['id']) || $u->info['dn'] == 0) { + if ($dungeonGo == 1 || $u->info['dn'] == 0) { + $pr = ''; + } + $dungeonGroupList = '
' . $pr . '
' . $dungeonGroupList . '' . $pr . '
'; + } + $dungeonGroupList .= '
'; + } -if($roomSection==0) { echo $dungeonGroupList; } - if($roomSection == 1) { - ?> -
-
- testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_'.$dungeon['city'].'" LIMIT 1',1); - $qc=0; // Quest Count - //Генерируем список текущих квестов - $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); - while( $pl = mysql_fetch_array( $sp ) ) { - if($pl['room'] == $u->info['room']){ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - $qsee .= ' '.$pq['name'].'
'.$pq['info'].'
'.$q->info($pq).'

'; - $qc++; - } - } - - if( isset( $_GET['add_quest'] ) && $qc == 0 ) { - if( isset( $hgo['id'] ) ) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - } else { - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = '.$dungeon['id'].''); - $dq_add = array(); - while( $pl = mysql_fetch_array( $sp ) ) { - if( $u->rep['rep'.$dungeon['city']] == 9999 ) { - //квет, рыцарского задания - if( $pl['kin'] == 1 ) { - $dq_add = array( 0 => $pl ); - } - } elseif( $u->rep['rep'.$dungeon['city']] == 19999 ) { - //квет, рыцарского задания - if( $pl['kin'] == 2 ) { - $dq_add = array( 0 => $pl ); - } - } else { - if( $pl['kin'] == 0 ) { - $dq_add[count($dq_add)] = $pl; - } - } - } - $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']); - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - - if( $q->testGood($dq_add) == 1 && $dq_add > 0 ) { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $u->addAction(time(),'psh_qt_'.$dungeon['city'],$dq_add['id']); - } else { - if ( $u->rep['rep'.$dungeon['city']] == 9999 ) { - //квест, рыцарского задания - echo 'Вы уже получили задание на достижение титула рыцаря!
'; - } elseif( $u->rep['rep'.$dungeon['city']] == 19999 ) { - //квест, рыцарского задания - echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; - } else { - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - } - unset( $dq_add ); - } - } elseif( isset( $_GET['add_quest'] ) && $qc > 0 ) { - echo 'Что-то пошло не так... осторожнее..


'; - } - if( $qsee == '' ) { - $qsee = 'К сожалению у вас нет ни одного задания

'; - } - ?> -
-
- Текущие задания: - - + if ($roomSection == 0) { + echo $dungeonGroupList; + } + if ($roomSection == 1) { + ?> +
+ + testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1); + $qc = 0; // Quest Count + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['room'] == $u->info['room']) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; + $qc++; + } + } + + if (isset($_GET['add_quest']) && $qc == 0) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . ''); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + if ($u->rep['rep' . $dungeon['city']] == 9999) { + //квет, рыцарского задания + if ($pl['kin'] == 1) { + $dq_add = [0 => $pl]; + } + } elseif ($u->rep['rep' . $dungeon['city']] == 19999) { + //квет, рыцарского задания + if ($pl['kin'] == 2) { + $dq_add = [0 => $pl]; + } + } else { + if ($pl['kin'] == 0) { + $dq_add[count($dq_add)] = $pl; + } + } + } + $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']); + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + + if ($q->testGood($dq_add) == 1 && $dq_add > 0) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $u->addAction(time(), 'psh_qt_' . $dungeon['city'], $dq_add['id']); + } else { + if ($u->rep['rep' . $dungeon['city']] == 9999) { + //квест, рыцарского задания + echo 'Вы уже получили задание на достижение титула рыцаря!
'; + } elseif ($u->rep['rep' . $dungeon['city']] == 19999) { + //квест, рыцарского задания + echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + } + unset($dq_add); + } + } elseif (isset($_GET['add_quest']) && $qc > 0) { + echo 'Что-то пошло не так... осторожнее..


'; + } + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания

'; + } + ?> +
+
+ Текущие задания: + + 0 ){ - echo 'Вы еще не справились с текущим заданием.'; - } elseif( !isset( $hgo['id'] ) && $qc == 0 ) { - ?> -
- - '.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; - } - ?> + if ($qc > 0) { + echo 'Вы еще не справились с текущим заданием.'; + } elseif (!isset($hgo['id']) && $qc == 0) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout( + $hgo['time'] + 60 * 60 * 24 - time() + ) . ' )'; + } + ?>
-
- -
- - rep['add_stats']*100); - $cur_price = array('price'=>0); - if( 25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price ) { // Характеристики! - foreach( $dungeon['list'] as $key => $val ) { - if( !( $cur_price['price'] >= $price ) ) { - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur; - } - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['ability'] += 1; $u->rep['add_stats'] += 1; - mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 способность за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 2 ) { // Умения! - $price = 2000+(2000*$u->rep['add_skills']); - $cur_price = array('price'=>0); - if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения! - foreach($dungeon['list'] as $key=>$val){ - if( !( $cur_price['price'] >= $price ) ) { - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur; - } - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['skills'] += 1; $u->rep['add_skills'] += 1; - mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 умение за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 3 ) { // Кредиты - $price = 100; - $cur_price = array('price'=>0); - if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты - foreach($dungeon['list'] as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ) { - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur; - } - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['money'] += 10; $u->rep['add_money'] += 10; - mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 10 кр. за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - } elseif( $_GET['buy1'] == 4 ) { // Особенности - $price = 3000; - $cur_price = array('price'=>0); - if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности - foreach($dungeon['list'] as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur; - } - } - } - if( $price == $cur_price['price'] ) { - foreach( $dungeon['list'] as $key => $val ) { - if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) { - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($r) $rt = 1; else $rt = 0; - } - } - if($rt==1){ - $u->info['sskills'] += 1; $u->rep['add_skills2'] += 1; - mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `sskills` = "'.$u->info['sskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно приобрели 1 особенность за '.$price.' ед. награды
'; - } else { - echo 'Ничего не получилось...
'; - } - } else echo 'Недостаточно репутации.'; - - } else { - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: rep['allrep']-$u->rep['allnurep'])?> ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за rep['add_stats']*100);?> ед.
Умение (еще rep['add_skills'])?>)за rep['add_skills']);?> ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-

- info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - - } - if($chk[0]>0) { - ?> - - -

-
-
- - - - - - - - - - - - - - - - - -
Репутация в Dragons city:rep['repdragonscity']?> ед.
Репутация в Capital city:rep['repcapitalcity']?> ед.
Репутация в Demons city:rep['repdemonscity']?> ед.
Репутация в Angels city:rep['repangelscity']?> ед.
- Текущая репутация: -
-
- info['dn']==0){ - ?> - - - - -
-
-
- Группа - Тип похода: - -
- Комментарий - -
- Пароль - -
- -  
-
-
-
+
+ +
+ + rep['add_stats'] * 100); + $cur_price = ['price' => 0]; + if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['ability'] += 1; + $u->rep['add_stats'] += 1; + mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 способность за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { // Умения! + $price = 2000 + (2000 * $u->rep['add_skills']); + $cur_price = ['price' => 0]; + if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['skills'] += 1; + $u->rep['add_skills'] += 1; + mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 умение за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { // Кредиты + $price = 100; + $cur_price = ['price' => 0]; + if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['money'] += 10; + $u->rep['add_money'] += 10; + mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { // Особенности + $price = 3000; + $cur_price = ['price' => 0]; + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности + foreach ($dungeon['list'] as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + foreach ($dungeon['list'] as $key => $val) { + if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($r) { + $rt = 1; + } else { + $rt = 0; + } + } + } + if ($rt == 1) { + $u->info['sskills'] += 1; + $u->rep['add_skills2'] += 1; + mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды
'; + } else { + echo 'Ничего не получилось...
'; + } + } else { + echo 'Недостаточно репутации.'; + } + + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: rep['allrep'] - $u->rep['allnurep']) ?> ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за rep['add_stats'] * 100); ?> ед. +
Умение (еще rep['add_skills']) ?>)за rep['add_skills']); ?> ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+

info['id']) - { - $psh_start = '  '; - } - - echo '

+ $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + + } + if ($chk[0] > 0) { + ?> + + +

+
+
+ + + + + + + + + + + + + + + + + +
Репутация в Dragons city:rep['repdragonscity'] ?> ед.
Репутация в Capital city:rep['repcapitalcity'] ?> ед.
Репутация в Demons city:rep['repdemonscity'] ?> ед.
Репутация в Angels city:rep['repangelscity'] ?> ед.
+ Текущая репутация: +
+
+ info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Тип похода: + +
+ Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } - } - } else { - echo 'Поход в пещеры разрешен один раз в двадцать часов. Осталось еще: '.$u->timeOut(60*60*20-time()+$dungeon_timeout['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; - } - } + } + } + } else { + echo 'Поход в пещеры разрешен один раз в двадцать часов. Осталось еще: ' . Conversion::secondsToTimeout( + 60 * 60 * 20 - time() + $dungeon_timeout['time'] + ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -?> + diff --git a/modules_data/location/entergrib.php b/modules_data/location/entergrib.php index 7f0272fd..ace2fda4 100644 --- a/modules_data/location/entergrib.php +++ b/modules_data/location/entergrib.php @@ -1,572 +1,572 @@ room['file']=='entergrib') -{ +if ($u->room['file'] == 'entergrib') { -if(isset($_GET['rz'])) { - $rz = 1; -}else{ - $rz = 0; -} + if (isset($_GET['rz'])) { + $rz = 1; + } else { + $rz = 0; + } -$dun = 10; //для новичков 2-7 лвл + $dun = 10; //для новичков 2-7 лвл -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; -//Задержка в Санд -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh2" AND `time`>'.(time()-7200).' LIMIT 1',1); + $g111 = 1; + //Задержка в Санд + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh2" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -if($u->info['dn']>0) -{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh2',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Катакомбы","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).''); - $ids = ''; - while($pu = mysql_fetch_array($su)) - { - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh2','',$pu['id']); - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "305" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv['id'])) - { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id'])) - { - if($u->info['level']>7) - { - $row = 0; - if(5>$row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) -{ - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $ins = mysql_query('INSERT INTO `dungeon_zv` + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh2',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Катакомбы","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); + $ids = ''; + while ($pu = mysql_fetch_array($su)) { + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh2', '', $pu['id']); + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "305" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id'])) { + if ($u->info['level'] > 7) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + "5")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "3" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '
'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "3" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - -
Центральная площадь
-
- -
+
+

room['name']; ?>

+
+
+
+ + + + + +
  + + + + + +
+ + + + + + +
+ + + + + +
+ Центральная площадь
+
+
+ +
+
+
-
- -
-

- -
- -

-
- -
-

- -
- -

-
- -'.$re.'
'; -} + + +
+

+ +
+ +

+
+ +
+

+ +
+ +

+
+ + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id'])) - { - if($g111==1) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id'])) { + if ($g111 == 1) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -if($rz==0) { echo $dzs; } -if($rz == 1) { -?> -
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_allcity" LIMIT 1',1); -if(isset($_GET['add_quest'])) { - if(isset($hgo['id'])) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - }else{ - - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 4'); - $dq_add = array(); - while($pl = mysql_fetch_array($sp)) { - $dq_add[count($dq_add)] = $pl; - } - - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - if($q->testGood($dq_add)==1) - { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $hgo['id'] = 1; - $u->addAction(time(),'psh_qt_allcity',$dq_add['id']); - }else{ - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - unset($dq_add); - } -} + if ($rz == 0) { + echo $dzs; + } + if ($rz == 1) { + ?> +
+ + testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_allcity" LIMIT 1', 1); + if (isset($_GET['add_quest'])) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { -//Генерируем список текущих квестов -$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); -while($pl = mysql_fetch_array($sp)) -{ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - $qsee .= ' '.$pq['name'].'
'.$pq['info'].'
'.$q->info($pq).'

'; - $qx++; -} + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 4'); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + $dq_add[count($dq_add)] = $pl; + } -if($qsee == '') -{ - $qsee = 'К сожалению у вас нет ни одного задания'; -} -?> -
-
-Текущие задания: [/28] - - + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + if ($q->testGood($dq_add) == 1) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $hgo['id'] = 1; + $u->addAction(time(), 'psh_qt_allcity', $dq_add['id']); + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + unset($dq_add); + } + } + + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; + $qx++; + } + + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания'; + } + ?> +
+
+ Текущие задания: [/28] + + -
- -'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; +if (!isset($hgo['id'])) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout( + $hgo['time'] + 60 * 60 * 24 - time() + ) . ' )'; } ?>
-
- -
- rep['add_stats']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=2000) { - echo 'Вы успешно приобрели 1 способность за 2000 ед. награды
'; - $u->info['ability'] += 1; - $u->rep['nu_suncity'] += 2000; - $u->rep['add_stats'] += 1; - mysql_query('UPDATE `rep` SET `add_stats` = `add_stats`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }else{ - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==2) { - //покупаем статы - if(10-$u->rep['add_skills']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=2000) { - echo 'Вы успешно приобрели 1 умение за 2000 ед. награды
'; - $u->info['skills'] += 1; - $u->rep['nu_suncity'] += 2000; - $u->rep['add_skills'] += 1; - mysql_query('UPDATE `rep` SET `add_skills` = `add_skills`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }else{ - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==3) { - //покупаем статы - if($u->rep['repsuncity']-$u->rep['nu_suncity']>=100) { - echo 'Вы успешно приобрели 10 кр. за 100 ед. награды
'; - $u->info['money'] += 10; - $u->rep['nu_suncity'] += 100; - $u->rep['add_money'] += 10; - mysql_query('UPDATE `rep` SET `add_money` = `add_money`+10,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }else{ - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==4) { - //покупаем статы - if(5-$u->rep['add_skills2']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=3000) { - echo 'Вы успешно приобрели 1 особенность за 3000 ед. награды
'; - $u->info['nskills'] += 1; - $u->rep['nu_suncity'] += 3000; - $u->rep['add_skills2'] += 1; - mysql_query('UPDATE `rep` SET `add_skills2` = `add_skills2`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }else{ - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: - rep['repsuncity']-$u->rep['nu_suncity'])?> - ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за 2000 ед.
Умение (еще rep['add_skills'])?>)за 2000 ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-

+

+ +
+ rep['add_stats'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 2000) { + echo 'Вы успешно приобрели 1 способность за 2000 ед. награды
'; + $u->info['ability'] += 1; + $u->rep['nu_suncity'] += 2000; + $u->rep['add_stats'] += 1; + mysql_query('UPDATE `rep` SET `add_stats` = `add_stats`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { + //покупаем статы + if (10 - $u->rep['add_skills'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 2000) { + echo 'Вы успешно приобрели 1 умение за 2000 ед. награды
'; + $u->info['skills'] += 1; + $u->rep['nu_suncity'] += 2000; + $u->rep['add_skills'] += 1; + mysql_query('UPDATE `rep` SET `add_skills` = `add_skills`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { + //покупаем статы + if ($u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 100) { + echo 'Вы успешно приобрели 10 кр. за 100 ед. награды
'; + $u->info['money'] += 10; + $u->rep['nu_suncity'] += 100; + $u->rep['add_money'] += 10; + mysql_query('UPDATE `rep` SET `add_money` = `add_money`+10,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { + //покупаем статы + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 3000) { + echo 'Вы успешно приобрели 1 особенность за 3000 ед. награды
'; + $u->info['nskills'] += 1; + $u->rep['nu_suncity'] += 3000; + $u->rep['add_skills2'] += 1; + mysql_query('UPDATE `rep` SET `add_skills2` = `add_skills2`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: + rep['repsuncity'] - $u->rep['nu_suncity']) ?> + ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за 2000 ед. +
Умение (еще rep['add_skills']) ?>)за 2000 ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+

info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - - } - if($chk[0]>0) { - ?> - - + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + + } + if ($chk[0] > 0) { + ?> + +

-
-
- Репутация в Sun city: rep['repsuncity']?> -
-
-info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ +
+ Репутация в Sun city: rep['repsuncity'] ?> +
+
+ info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -} -} -?> + diff --git a/modules_data/location/enternekro.php b/modules_data/location/enternekro.php index e6c298e7..ffbaeb0c 100644 --- a/modules_data/location/enternekro.php +++ b/modules_data/location/enternekro.php @@ -1,369 +1,352 @@ room['file']=='enternekro') -{ +if ($u->room['file'] == 'enternekro') { -$dun = 11; //для новичков 2-7 лвл + $dun = 11; //для новичков 2-7 лвл -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1); + $g111 = 1; + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -if($u->info['dn']>0) -{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh1',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Бездна","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).''); - $ids = ''; - while($pu = mysql_fetch_array($su)) - { - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh1','',$pu['id']); - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `x`="1",`y`="-6",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "297" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv['id'])) - { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id'])) - { - if($u->info['level']>5) - { - $row = 0; - if(5>$row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) -{ - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $lmn = 6; - $lmx = 21; - $tmx = 5; - - //только своего уровня - $lmn = $u->info['level']; - - $ins = mysql_query('INSERT INTO `dungeon_zv` + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh1',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Бездна","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); + $ids = ''; + while ($pu = mysql_fetch_array($su)) { + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh1', '', $pu['id']); + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query('UPDATE `stats` SET `x`="1",`y`="-6",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "297" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id'])) { + if ($u->info['level'] > 5) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $lmn = 6; + $lmx = 21; + $tmx = 5; + + //только своего уровня + $lmn = $u->info['level']; + + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", - "'.$lmn.'", - "'.$lmx.'", - "'.$tmx.'")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", + "' . $lmn . '", + "' . $lmx . '", + "' . $tmx . '")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '
'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - -
- - - - - - -
- - - - -
Вход в подземелье
+
+

room['name']; ?>

+
+
+
+ + + + + +
  + + + + +
+ + + + + + +
+ + + + + +
+ Вход в подземелье
+
+
+
+
+
-
-'.$re.'
'; -} + + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id'])) - { - if($g111==1) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id'])) { + if ($g111 == 1) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -echo $dzs; -if($g111 == 1) -{ -if($u->info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ echo $dzs; + if ($g111 == 1) { + if ($u->info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } } -} - -?> diff --git a/modules_data/location/enternizin.php b/modules_data/location/enternizin.php index f5c8bd7a..154b1d4e 100644 --- a/modules_data/location/enternizin.php +++ b/modules_data/location/enternizin.php @@ -1,777 +1,783 @@ room['file']=='enternizin') -{ +if ($u->room['file'] == 'enternizin') { -if(isset($_GET['rz'])) { - $rz = 1; -}else{ - $rz = 0; -} + if (isset($_GET['rz'])) { + $rz = 1; + } else { + $rz = 0; + } -$dun = 444; + $dun = 444; -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; + $g111 = 1; -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh444" AND `time` > '.(time()-60*60*2).' LIMIT 1',1); + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh444" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + if ($u->info['dn'] > 0) { + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if($u->info['dn']>0) -{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh444',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Низины","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); + $ids = ''; -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh444',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Низины","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).''); - $ids = ''; - - $map_locs = array(); - $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dun.'"'); - while( $plm2 = mysql_fetch_array($spm2)) { - $map_locs[] = array($plm2['x'],$plm2['y']); - } - unset($spm2,$plm2); - - $ppx = 0; - while($pu = mysql_fetch_array($su)) - { - $ppx++; - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh444','',$pu['id']); - //Добавляем квестовые обьекты для персонажей - $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$pu['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); - //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); - while($pl2 = mysql_fetch_array($sp)) - { - $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "444" LIMIT 1')); - if( isset($pl['id']) ) { - $act = explode(',',$pl['act_date']); - $i = 0; - while( $i < count($act) ) { - $xr = explode(':=:',$act[$i]); - //Сбор ресурсов - if( $xr[0] == 'tk_itm' ) { - $xr2 = explode('=',$xr[1]); - if( $xr2[2] == 0 ) { - //Добавляем обьект для юзера - $j = 0; - while( $j < $xr2[1] ) { - $cord = $map_locs[rand(0,count($map_locs)-1)]; - if( $cord[0] != 0 || $cord[1] != 0 ) { - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$pu['id'].'","'.$pl['id'].'" - )'); - } - $j++; - } - }else{ - //Предмет находится в конкретном месте - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$pu['id'].'","'.$pl['id'].'" - )'); - } - // - } - $i++; - } - } - } - // - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - //Добавление обьектов (день святого валентина) - if( floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0 ) { - //Раскидываем предметы по пещере (Блёклый подземник) - $i = 1; - while($i <= $ppx) { - $j = rand(1,3); - while( $j >= 0 ) { - $rndx = 0; - $rndy = 0; - $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:444/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; - $j--; - } - $i++; - } - } - // - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv['id'])) - { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1')); - if(isset($zv['id']) && $u->info['dn'] == 0) - { - if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) { - $re = 'Вы ввели неправильный пароль'; - }elseif($u->info['level'] > 7) - { - $row = 0; - if(5 > $row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv); - }else{ - $u->info['dn'] = $zv['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) -{ - if($zv['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $ins = mysql_query('INSERT INTO `dungeon_zv` + $map_locs = []; + $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dun . '"'); + while ($plm2 = mysql_fetch_array($spm2)) { + $map_locs[] = [$plm2['x'], $plm2['y']]; + } + unset($spm2, $plm2); + + $ppx = 0; + while ($pu = mysql_fetch_array($su)) { + $ppx++; + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh444', '', $pu['id']); + //Добавляем квестовые обьекты для персонажей + $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $pu['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); + //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); + while ($pl2 = mysql_fetch_array($sp)) { + $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "444" LIMIT 1')); + if (isset($pl['id'])) { + $act = explode(',', $pl['act_date']); + $i = 0; + while ($i < count($act)) { + $xr = explode(':=:', $act[$i]); + //Сбор ресурсов + if ($xr[0] == 'tk_itm') { + $xr2 = explode('=', $xr[1]); + if ($xr2[2] == 0) { + //Добавляем обьект для юзера + $j = 0; + while ($j < $xr2[1]) { + $cord = $map_locs[rand(0, count($map_locs) - 1)]; + if ($cord[0] != 0 || $cord[1] != 0) { + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $pu['id'] . '","' . $pl['id'] . '" + )' + ); + } + $j++; + } + } else { + //Предмет находится в конкретном месте + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $pu['id'] . '","' . $pl['id'] . '" + )' + ); + } + // + } + $i++; + } + } + } + // + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + //Добавление обьектов (день святого валентина) + if (floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0) { + //Раскидываем предметы по пещере (Блёклый подземник) + $i = 1; + while ($i <= $ppx) { + $j = rand(1, 3); + while ($j >= 0) { + $rndx = 0; + $rndy = 0; + $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:444/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),'; + $j--; + } + $i++; + } + } + // + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv['id'])) { + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); + if (isset($zv['id']) && $u->info['dn'] == 0) { + if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) { + $re = 'Вы ввели неправильный пароль'; + } elseif ($u->info['level'] > 7) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv); + } else { + $u->info['dn'] = $zv['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) { + if ($zv['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv['id'] = $u->info['dn']; - $zv['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + "5")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv['id'] = $u->info['dn']; + $zv['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "444" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '
'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if( $pl['pass'] != '' && $u->info['dn']==0 ) { - $dzs .= ' '; - } - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "444" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dzs .= ' '; + } + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - - - -
- - - - - - -
- - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - }else { - echo "Магический Портал"; - } - ?>
-
- -
+
+

room['name']; ?>

+
+
+ +
-
- -
-

- -
- -

-
- -
-

- -
- -

-
- -'.$re.'
'; -} + + +
+

+ +
+ +

+
+ +
+

+ +
+ +

+
+ + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id']) || $u->info['dn'] == 0) - { - if($g111==1 || $u->info['dn'] == 0) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id']) || $u->info['dn'] == 0) { + if ($g111 == 1 || $u->info['dn'] == 0) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -if($rz==0) { echo $dzs; } -if($rz == 1) { -?> -
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_angelscity" LIMIT 1',1); -if(isset($_GET['add_quest'])) { - if(isset($hgo['id'])) { - echo 'Нельзя получать задания чаще одного раза в сутки
'; - }else{ - - $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 444'); - $dq_add = array(); - while($pl = mysql_fetch_array($sp)) { - if($u->rep['repangelscity'] == 9999) { - //квет, рыцарского задания - if( $pl['kin'] == 1 ) { - $dq_add = array( 0 => $pl ); - } - }elseif($u->rep['repangelscity'] == 24999) { - //квет, рыцарского задания - if( $pl['kin'] == 2 ) { - $dq_add = array( 0 => $pl ); - } - }else{ - if( $pl['kin'] == 0 ) { - $dq_add[count($dq_add)] = $pl; - } - } - } - - $dq_add = $dq_add[rand(0,count($dq_add)-1)]; - - if($q->testGood($dq_add)==1 && $dq_add > 0) - { - $q->startq_dn($dq_add['id']); - echo 'Вы успешно получили новое задание "'.$dq_add['name'].'".
'; - $hgo['id'] = 1; - $u->addAction(time(),'psh_qt_angelscity',$dq_add['id']); - }else{ - if($u->rep['repangelscity'] == 9999) { - //квет, рыцарского задания - echo 'Вы уже получили задание на достижение титула рыцаря!
'; - }elseif($u->rep['repangelscity'] == 24999) { - //квет, рыцарского задания - echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; - }else{ - echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще...
'; - } - } - unset($dq_add); - } -} + if ($rz == 0) { + echo $dzs; + } + if ($rz == 1) { + ?> +
+ + testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_angelscity" LIMIT 1', 1); + if (isset($_GET['add_quest'])) { + if (isset($hgo['id'])) { + echo 'Нельзя получать задания чаще одного раза в сутки
'; + } else { -//Генерируем список текущих квестов -$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); -while($pl = mysql_fetch_array($sp)) -{ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1')); - $qsee .= ' '.$pq['name'].'
'.$pq['info'].'
'.$q->info($pq).'

'; - $qx++; -} + $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 444'); + $dq_add = []; + while ($pl = mysql_fetch_array($sp)) { + if ($u->rep['repangelscity'] == 9999) { + //квет, рыцарского задания + if ($pl['kin'] == 1) { + $dq_add = [0 => $pl]; + } + } elseif ($u->rep['repangelscity'] == 24999) { + //квет, рыцарского задания + if ($pl['kin'] == 2) { + $dq_add = [0 => $pl]; + } + } else { + if ($pl['kin'] == 0) { + $dq_add[count($dq_add)] = $pl; + } + } + } -if($qsee == '') -{ - $qsee = 'К сожалению у вас нет ни одного задания'; -} -?> -
-
-Текущие задания: [/28] - - + $dq_add = $dq_add[rand(0, count($dq_add) - 1)]; + + if ($q->testGood($dq_add) == 1 && $dq_add > 0) { + $q->startq_dn($dq_add['id']); + echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '".
'; + $hgo['id'] = 1; + $u->addAction(time(), 'psh_qt_angelscity', $dq_add['id']); + } else { + if ($u->rep['repangelscity'] == 9999) { + //квет, рыцарского задания + echo 'Вы уже получили задание на достижение титула рыцаря!
'; + } elseif ($u->rep['repangelscity'] == 24999) { + //квет, рыцарского задания + echo 'Вы завершили квестовую линию, ожидайте новых заданий!
'; + } else { + echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще...
'; + } + } + unset($dq_add); + } + } + + //Генерируем список текущих квестов + $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); + while ($pl = mysql_fetch_array($sp)) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; + $qx++; + } + + if ($qsee == '') { + $qsee = 'К сожалению у вас нет ни одного задания'; + } + ?> +
+
+ Текущие задания: [/28] + + -
- -'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' )'; +if (!isset($hgo['id'])) { + ?> +
+ + ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; } ?>
-
- -
- 'capitalcity',2=>'demonscity',3=>'angelscity'); - if($_GET['buy1']==1) { - //покупаем статы - $price = 2000+($u->rep['add_stats']*100); - $cur_price = array('price'=>0); - if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики! - - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 способность за '.$price.' ед. награды
'; - $u->info['ability'] += 1; - $u->rep['add_stats'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - } elseif($_GET['buy1']==2) { // Умения! - $price = 2000+(2000*$u->rep['add_skills']); - $cur_price = array('price'=>0); - if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения! - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 умение за '.$price.' ед. награды
'; - $u->info['skills'] += 1; - $u->rep['add_skills'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - } else { - echo 'Ничего не получилось...
'; - } - }elseif($_GET['buy1']==3) { // Кредиты - $price = 100; - $cur_price = array('price'=>0); - if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 10 кр. за '.$price.' ед. награды
'; - $u->info['money'] += 10; - $u->rep['add_money'] += 10; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - }elseif( $_GET['buy1'] == 4 ) { // Особенности - $price = 3000; - $cur_price = array('price'=>0); - if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности - foreach($dungeon as $key=>$val){ - if(!($cur_price['price'] >= $price)){ - if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){ - $cur_price['price'] = $price; - $cur_price['nu_'.$val] = $price; - } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){ - $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); - $cur_price['nu_'.$val] = $cur; - } - } - } - if($price==$cur_price['price']) { - echo 'Вы успешно приобрели 1 особенность за '.$price.' ед. награды
'; - $u->info['nskills'] += 1; - $u->rep['add_skills2'] += 1; - - foreach($dungeon as $key=>$val){ - if($key!='price'){ - $u->rep['nu_'.$val] += $cur_price['nu_'.$val]; - mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } else echo 'Недостаточно репутации.'; - }else{ - echo 'Ничего не получилось...
'; - } - } - } - ?> -
- Награда: - rep['allrep']-$u->rep['allnurep'])?> - ед. - - - - - - - - - - - - - - - - - - - - - -
Способность (еще rep['add_stats'])?>)за rep['add_stats']*100);?> ед.
Умение (еще rep['add_skills'])?>)за rep['add_skills']);?> ед.
Деньги (10 кр.)за 100 ед.
Особенность (еще rep['add_skills2'])?>)за 3000 ед.
-

+

+ +
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity']; + if ($_GET['buy1'] == 1) { + //покупаем статы + $price = 2000 + ($u->rep['add_stats'] * 100); + $cur_price = ['price' => 0]; + if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики! + + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 способность за ' . $price . ' ед. награды
'; + $u->info['ability'] += 1; + $u->rep['add_stats'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 2) { // Умения! + $price = 2000 + (2000 * $u->rep['add_skills']); + $cur_price = ['price' => 0]; + if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения! + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 умение за ' . $price . ' ед. награды
'; + $u->info['skills'] += 1; + $u->rep['add_skills'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 3) { // Кредиты + $price = 100; + $cur_price = ['price' => 0]; + if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды
'; + $u->info['money'] += 10; + $u->rep['add_money'] += 10; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } elseif ($_GET['buy1'] == 4) { // Особенности + $price = 3000; + $cur_price = ['price' => 0]; + if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности + foreach ($dungeon as $key => $val) { + if (!($cur_price['price'] >= $price)) { + if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) { + $cur_price['price'] = $price; + $cur_price['nu_' . $val] = $price; + } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) { + $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1))); + $cur_price['nu_' . $val] = $cur; + } + } + } + if ($price == $cur_price['price']) { + echo 'Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды
'; + $u->info['nskills'] += 1; + $u->rep['add_skills2'] += 1; + + foreach ($dungeon as $key => $val) { + if ($key != 'price') { + $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; + mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } else { + echo 'Недостаточно репутации.'; + } + } else { + echo 'Ничего не получилось...
'; + } + } + } + ?> +
+ Награда: + rep['allrep'] - $u->rep['allnurep']) ?> + ед. + + + + + + + + + + + + + + + + + + + + + +
Способность (еще rep['add_stats']) ?>)за rep['add_stats'] * 100); ?> ед. +
Умение (еще rep['add_skills']) ?>)за rep['add_skills']); ?> ед. +
Деньги (10 кр.)за 100 ед. +
Особенность (еще rep['add_skills2']) ?>)за 3000 ед. +
+

info['id'].'" LIMIT 1000')); - if(isset($_GET['buy777']) && $chk[0]>0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000'); - while($chk_pl = mysql_fetch_array($chk_cl)) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1')); - { - $x++; $prc += $chk_pl['price1']; - } - } - $u->info['money'] += $prc; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр.
'; - $chk[0] = 0; - - } - if($chk[0]>0) { - ?> - - + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); + if (isset($_GET['buy777']) && $chk[0] > 0) { + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); + while ($chk_pl = mysql_fetch_array($chk_cl)) { + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } + { + $x++; + $prc += $chk_pl['price1']; + } + } + $u->info['money'] += $prc; + mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр.
'; + $chk[0] = 0; + + } + if ($chk[0] > 0) { + ?> + +

-
-
- - - - - - - - - - - - - -
Репутация в Capital city:rep['repcapitalcity']?> ед.
Репутация в Demons city:rep['repdemonscity']?> ед.
Репутация в Angels city:rep['repangelscity']?> ед.
- Текущая репутация: -
-
-info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ +
+ + + + + + + + + + + + + +
Репутация в Capital city:rep['repcapitalcity'] ?> ед.
Репутация в Demons city:rep['repdemonscity'] ?> ед.
Репутация в Angels city:rep['repangelscity'] ?> ед.
+ Текущая репутация: +
+
+ info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } + } + } + } else { + echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout( + 60 * 60 * 2 - time() + $g11['time'] + ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } + } } -?> - -timeOut(60*60*2-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; -} -} -} -?> diff --git a/modules_data/location/enterptp.php b/modules_data/location/enterptp.php index c5dae366..dea7af98 100644 --- a/modules_data/location/enterptp.php +++ b/modules_data/location/enterptp.php @@ -1,4 +1,7 @@ info['dn'] > 0) { // Если ты пошел гулять, так ид } $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh' . $dungeon['id'] . '" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); // Проверка - последний визит? -// if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры. + if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. { $dungeonGo = 0; if (isset($_GET['start'])) { - $re = 'До следующего похода осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']); + $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']); } } @@ -63,13 +66,17 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { if ($ig > 0) { //перемещаем игроков в пещеру //$u->addAction(time(),'psh'.$dun,''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","Бездна","' . time() . '")'); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","Бездна","' . time() . '")' + ); if ($ins) { $zid = mysql_insert_id(); mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''); + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '' + ); $ids = ''; $map_locs = []; @@ -100,17 +107,21 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { while ($j < $xr2[1]) { $cord = $map_locs[rand(0, count($map_locs) - 1)]; if ($cord[0] != 0 || $cord[1] != 0) { - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '" - )'); + )' + ); } $j++; } } else { //Предмет находится в конкретном месте - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '" - )'); + )' + ); } // } @@ -121,7 +132,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { // } $ids = rtrim($ids, 'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); if ($upd1) { $upd2 = mysql_query('UPDATE `users` SET `room` = "374" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] @@ -141,7 +154,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { } $vls = rtrim($vls, ','); if ($vls != '') { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''); + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); } else { $ins2 = true; } @@ -159,7 +174,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { } } elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) { if (!isset($zv['id'])) { - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')); + $zv = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1') + ); if (isset($zv['id']) && $u->info['dn'] == 0) { if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) { $re = 'Вы ввели неправильный пароль'; @@ -212,14 +229,16 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { } } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) { if ($u->info['dn'] == 0) { - $ins = mysql_query('INSERT INTO `dungeon_zv` + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '", "' . mysql_real_escape_string($_POST['pass']) . '", "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); + "5")' + ); if ($ins) { $u->info['dn'] = mysql_insert_id(); $zv['id'] = $u->info['dn']; @@ -238,11 +257,15 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); while ($pl = mysql_fetch_array($sp)) { $dungeonGroupList .= '
'; - if ($u->info['dn'] == 0) $dungeonGroupList .= ''; + if ($u->info['dn'] == 0) { + $dungeonGroupList .= ''; + } $dungeonGroupList .= '' . date('H:i', $pl['time']) . ' '; $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''); + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); while ($pu = mysql_fetch_array($su)) { $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; $pus .= ', '; @@ -252,7 +275,9 @@ while ($pl = mysql_fetch_array($sp)) { $dungeonGroupList .= $pus; unset($pus); - if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' '; + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dungeonGroupList .= ' '; + } if ($pl['com'] != '') { $dl = ''; @@ -286,79 +311,79 @@ while ($pl = mysql_fetch_array($sp)) { $dungeonGroupList .= '
'; } ?> - - - - - + +
-
-

room['name']; ?>

-
-
- +

@@ -377,7 +402,9 @@ while ($pl = mysql_fetch_array($sp)) {

' . $re . '
'; +if ($re != '') { + echo '' . $re . '
'; +} //отображаем if ($dungeonGroupList == '') { @@ -411,11 +438,11 @@ if ($roomSection == 1) { echo 'Нельзя получать задания чаще одного раза в сутки
'; } else { -//if($u->info['admin']>0){ -// $sp = mysql_query('SELECT * FROM `quests` WHERE `id` = "236" && `tr_date` LIKE "%tr_dn:=:'.$dun.'%"'); // Только дашку -//} else { + //if($u->info['admin']>0){ + // $sp = mysql_query('SELECT * FROM `quests` WHERE `id` = "236" && `tr_date` LIKE "%tr_dn:=:'.$dun.'%"'); // Только дашку + //} else { $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . ''); -//} + //} $dq_add = []; while ($pl = mysql_fetch_array($sp)) { @@ -462,7 +489,9 @@ if ($roomSection == 1) { $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); while ($pl = mysql_fetch_array($sp)) { $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); - $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info($pq) . '

'; + $qsee .= ' ' . $pq['name'] . '
' . $pq['info'] . '
' . $q->info( + $pq + ) . '

'; $qx++; } @@ -482,7 +511,7 @@ if (!isset($hgo['id'])) { ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . $u->timeOut($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; + echo 'Получить новое задание можно ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; } ?> @@ -522,7 +551,9 @@ if (!isset($hgo['id'])) { } mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -554,7 +585,9 @@ if (!isset($hgo['id'])) { } mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -586,7 +619,9 @@ if (!isset($hgo['id'])) { } mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -618,7 +653,9 @@ if (!isset($hgo['id'])) { } mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } // echo 'Вы успешно приобрели 1 особенность за 3000 ед. награды
'; // $u->info['nskills'] += 1; @@ -668,11 +705,19 @@ if (!isset($hgo['id'])) {

info['id'] . '" LIMIT 1000')); + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); if (isset($_GET['buy777']) && $chk[0] > 0) { - $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'); + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); while ($chk_pl = mysql_fetch_array($chk_cl)) { - if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ; + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } { $x++; $prc += $chk_pl['price1']; @@ -750,7 +795,9 @@ if (!isset($hgo['id'])) { } } } else { - echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout( + 60 * 60 * 2 - time() + $dungeon_timeout['time'] + ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; } } -?> + diff --git a/modules_data/location/entersnow.php b/modules_data/location/entersnow.php index 51e64977..e931ad2e 100644 --- a/modules_data/location/entersnow.php +++ b/modules_data/location/entersnow.php @@ -1,370 +1,357 @@ room['file']=='entersnow') -{ +if ($u->room['file'] == 'entersnow') { -$dun = 20; //для новичков 2-7 лвл + $dun = 20; //для новичков 2-7 лвл -$er = ''; + $er = ''; -$dzs = ''; + $dzs = ''; -$g111 = 1; + $g111 = 1; -$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1); + $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1); -$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1')); + $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1')); -if($u->info['dn']>0) -{ - $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `dun` = "'.$dun.'" AND `delete` = "0" LIMIT 1')); - if(!isset($zv_dn['id'])) - { - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - } -} + if ($u->info['dn'] > 0) { + $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `dun` = "' . $dun . '" AND `delete` = "0" LIMIT 1')); + if (!isset($zv_dn['id'])) { + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + } + } -if(isset($g11['id'])) -{ - $g111 = 0; - if(isset($_GET['start'])) - { - $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']); - } -} -if(isset($_GET['start']) && $zv_dn['uid']==$u->info['id'] && $g111 == 1) -{ - //начинаем поход - //начинаем поход - $ig = 1; - if($ig>0) - { - //перемещаем игроков в пещеру - //$u->addAction(time(),'psh1',''); - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("'.$zv_dn['city'].'","'.$zv_dn['uid'].'","'.$dun.'","Ледяная пещера","'.time().'")'); - if($ins) - { - $zid = mysql_insert_id(); - //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv_dn['id'].'" LIMIT '.($zv_dn['team_max']+1).''); - $ids = ''; - while($pu = mysql_fetch_array($su)) - { - $ids .= ' `id` = "'.$pu['id'].'" OR'; - $u->addAction(time(),'psh1','',$pu['id']); - } - $ids = rtrim($ids,'OR'); - $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv_dn['team_max']+1).''); - if($upd1) - { - $upd2 = mysql_query('UPDATE `users` SET `room` = "304" WHERE '.$ids.' LIMIT '.($zv_dn['team_max']+1).''); - //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun - //Добавляем ботов - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),'; - } - $vls = rtrim($vls,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.''); - //Добавляем обьекты - $vls = ''; - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"'); - while($pl = mysql_fetch_array($sp)) - { - $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),'; - } - $vls = rtrim($vls,','); - if($vls!='') - { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.''); - }else{ - $ins2 = true; - } - if($upd2 && $ins1 && $ins2) - { - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1'); - die(''); - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - }else{ - $re = 'Ошибка перехода в подземелье...'; - } - } -}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1) -{ - if(!isset($zv_dn['id'])) - { - $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `dun` = "'.$dun.'" AND `delete` = "0" LIMIT 1')); - if(isset($zv_dn['id'])) - { - if($u->info['level']>5) - { - $row = 0; - if(5>$row) - { - $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv_dn['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if(!$upd) - { - $re = 'Не удалось вступить в эту группу'; - unset($zv_dn); - }else{ - $u->info['dn'] = $zv_dn['id']; - } - }else{ - $re = 'В группе нет места'; - unset($zv_dn); - } - }else{ - $re = 'Вы не подходите по уровню'; - unset($zv_dn); - } - }else{ - $re = 'Заявка не найдена'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -}elseif(isset($_POST['leave']) && isset($zv_dn['id']) && $g111 == 1) -{ - if($zv_dn['uid']==$u->info['id']) - { - //ставим в группу нового руководителя - $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv_dn['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1')); - if(isset($ld['id'])) - { - $zv_dn['uid'] = $ld['id']; - mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv_dn['uid'].'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv_dn); - }else{ - //удаляем группу целиком - mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv_dn); - } - }else{ - //просто выходим с группы - mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['dn'] = 0; - unset($zv_dn); - } -}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1) -{ - if($u->info['dn']==0) - { - $lmn = 6; - $lmx = 21; - $tmx = 5; - - //только своего уровня - $lmn = $u->info['level']; - - $ins = mysql_query('INSERT INTO `dungeon_zv` + if (isset($g11['id'])) { + $g111 = 0; + if (isset($_GET['start'])) { + $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']); + } + } + if (isset($_GET['start']) && $zv_dn['uid'] == $u->info['id'] && $g111 == 1) { + //начинаем поход + //начинаем поход + $ig = 1; + if ($ig > 0) { + //перемещаем игроков в пещеру + //$u->addAction(time(),'psh1',''); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv_dn['city'] . '","' . $zv_dn['uid'] . '","' . $dun . '","Ледяная пещера","' . time() . '")' + ); + if ($ins) { + $zid = mysql_insert_id(); + //обновляем пользователей + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv_dn['id'] . '" LIMIT ' . ($zv_dn['team_max'] + 1) . '' + ); + $ids = ''; + while ($pu = mysql_fetch_array($su)) { + $ids .= ' `id` = "' . $pu['id'] . '" OR'; + $u->addAction(time(), 'psh1', '', $pu['id']); + } + $ids = rtrim($ids, 'OR'); + $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv_dn['team_max'] + 1) . ''); + if ($upd1) { + $upd2 = mysql_query('UPDATE `users` SET `room` = "304" WHERE ' . $ids . ' LIMIT ' . ($zv_dn['team_max'] + 1) . ''); + //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun + //Добавляем ботов + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),'; + } + $vls = rtrim($vls, ','); + $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . ''); + //Добавляем обьекты + $vls = ''; + $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"'); + while ($pl = mysql_fetch_array($sp)) { + $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),'; + } + $vls = rtrim($vls, ','); + if ($vls != '') { + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); + } else { + $ins2 = true; + } + if ($upd2 && $ins1 && $ins2) { + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1'); + die(''); + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } else { + $re = 'Ошибка перехода в подземелье...'; + } + } + } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) { + if (!isset($zv_dn['id'])) { + $zv_dn = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string( + $_POST['goid'] + ) . '" AND `dun` = "' . $dun . '" AND `delete` = "0" LIMIT 1' + ) + ); + if (isset($zv_dn['id'])) { + if ($u->info['level'] > 5) { + $row = 0; + if (5 > $row) { + $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv_dn['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if (!$upd) { + $re = 'Не удалось вступить в эту группу'; + unset($zv_dn); + } else { + $u->info['dn'] = $zv_dn['id']; + } + } else { + $re = 'В группе нет места'; + unset($zv_dn); + } + } else { + $re = 'Вы не подходите по уровню'; + unset($zv_dn); + } + } else { + $re = 'Заявка не найдена'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } elseif (isset($_POST['leave']) && isset($zv_dn['id']) && $g111 == 1) { + if ($zv_dn['uid'] == $u->info['id']) { + //ставим в группу нового руководителя + $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv_dn['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1')); + if (isset($ld['id'])) { + $zv_dn['uid'] = $ld['id']; + mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv_dn['uid'] . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv_dn); + } else { + //удаляем группу целиком + mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv_dn); + } + } else { + //просто выходим с группы + mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['dn'] = 0; + unset($zv_dn); + } + } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) { + if ($u->info['dn'] == 0) { + $lmn = 6; + $lmx = 21; + $tmx = 5; + + //только своего уровня + $lmn = $u->info['level']; + + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES - ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'", - "'.mysql_real_escape_string($_POST['pass']).'", - "'.mysql_real_escape_string($_POST['text']).'", - "'.$lmn.'", - "'.$lmx.'", - "'.$tmx.'")'); - if($ins) - { - $u->info['dn'] = mysql_insert_id(); - $zv_dn['id'] = $u->info['dn']; - $zv_dn['uid'] = $u->info['id']; - mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $re = 'Вы успешно создали группу'; - }else{ - $re = 'Не удалось создать группу'; - } - }else{ - $re = 'Вы уже находитесь в группе'; - } -} + ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '", + "' . mysql_real_escape_string($_POST['pass']) . '", + "' . mysql_real_escape_string($_POST['text']) . '", + "' . $lmn . '", + "' . $lmx . '", + "' . $tmx . '")' + ); + if ($ins) { + $u->info['dn'] = mysql_insert_id(); + $zv_dn['id'] = $u->info['dn']; + $zv_dn['uid'] = $u->info['id']; + mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $re = 'Вы успешно создали группу'; + } else { + $re = 'Не удалось создать группу'; + } + } else { + $re = 'Вы уже находитесь в группе'; + } + } -//Генерируем список групп -$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "'.$dun.'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"'); -while($pl = mysql_fetch_array($sp)) -{ - $dzs .= '

'; - if($u->info['dn']==0) - { - $dzs .= ''; - } - $dzs .= ''.date('H:i',$pl['time']).' '; - - $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).''); - while($pu = mysql_fetch_array($su)) - { - $pus .= ''.$pu['login'].' ['.$pu['level'].']'; - $pus .= ', '; - } - $pus = trim($pus,', '); - - $dzs .= $pus; - - if($pl['com']!='') - { - $dl = ''; - if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0) - { - $dl .= ' (удалить комментарий)'; - if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true) - { - mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['dcom'] = $u->info['id']; - } - } - - $pl['com'] = htmlspecialchars($pl['com'],NULL); - - if($pl['dcom']>0) - { - $dl = ' комментарий удален модератором'; - } - - if($pl['dcom']>0) - { - if($moder['boi']==1 || $u->info['admin']>0) - { - $pl['com'] = ''.$pl['com'].''; - }else{ - $pl['com'] = ''; - } - } - - $dzs .= ' | '.$pl['com'].''.$dl.''; - } - - $dzs .= '
'; -} -?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dun . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - -
- - - - - - -
- - - - -
Елка
+
+

room['name']; ?>

+
+
+
+ + + + + +
  + + + + +
+ + + + + + +
+ + + + + +
+ Елка
+
+
+
+
+
-
-'.$re.'
'; -} + + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv_dn['id'])) - { - if($g111==1) - { - $pr = ''; - } - $dzs = '
'.$pr.'
'.$dzs.''.$pr.'
'; - } - $dzs .= '
'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv_dn['id'])) { + if ($g111 == 1) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -echo $dzs; -if($g111 == 1) -{ -if($u->info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ echo $dzs; + if ($g111 == 1) { + if ($u->info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } } -} - -?> diff --git a/modules_data/location/house_belaun.php b/modules_data/location/house_belaun.php index 33d361d7..cf973819 100644 --- a/modules_data/location/house_belaun.php +++ b/modules_data/location/house_belaun.php @@ -1,5 +1,10 @@ room['file'] == 'house_belaun') { $notify = ['type' => '', 'text' => '']; // Ошибки или Уведомления здесь! $action = ''; @@ -292,7 +297,9 @@ if ($u->room['file'] == 'house_belaun') {
' . $notify['text'] . '
'; + if ($notify['text'] != '') { + echo '
' . $notify['text'] . '
'; + } if ($action == "dialog") { } @@ -305,12 +312,16 @@ if ($u->room['file'] == 'house_belaun') { $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); while ($pl = mysql_fetch_array($sp)) { $dungeonGroupList .= '
'; - if ($u->info['dn'] == 0) $dungeonGroupList .= ''; + if ($u->info['dn'] == 0) { + $dungeonGroupList .= ''; + } $dungeonGroupList .= '' . date('H:i', $pl['time']) . ' '; $dungeonGroupList .= ' '; $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''); + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); while ($pu = mysql_fetch_array($su)) { $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; $pus .= ', '; @@ -320,7 +331,9 @@ if ($u->room['file'] == 'house_belaun') { $dungeonGroupList .= $pus; unset($pus); - if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' '; + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dungeonGroupList .= ' '; + } if ($pl['com'] != '') { $dl = ''; @@ -427,7 +440,11 @@ if ($u->room['file'] == 'house_belaun' && false) { $error = ''; // Собираем ошибки. $dungeonGroupList = ''; // Сюда помещаем список Групп. $dungeonGo = 1; // По умолчанию, мы идем в пещеру. - $dungeon = mysql_fetch_assoc(mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1')); + $dungeon = mysql_fetch_assoc( + mysql_query( + 'SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1' + ) + ); $dunname = [ 12 => ['capitalcity', 'Пещера Тысячи Проклятий'], @@ -439,9 +456,13 @@ if ($u->room['file'] == 'house_belaun' && false) { //106 => array('devilscity','Туманные Низины') ]; - if (isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание - else $roomSection = 0; // Собираем группу для похода -//if( $u->info['admin'] > 0 ) var_info($dungeon); + if (isset($_GET['rz']) && $dungeon['quest'] == 1) { + $roomSection = 1; + } // Получаем Задание + else { + $roomSection = 0; + } // Собираем группу для похода + //if( $u->info['admin'] > 0 ) var_info($dungeon); $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 '); while ($t = mysql_fetch_array($all_dungeon)) { @@ -459,28 +480,32 @@ if ($u->room['file'] == 'house_belaun' && false) { $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh0" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); - if ($u->info['admin'] > 0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры. + if ($u->info['admin'] > 0) { + unset($dungeon_timeout); + } // $dungeon_timeout - задержка на посещение пещеры. if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был. { $dungeonGo = 0; if (isset($_GET['start'])) { - $error = 'До следующего похода осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']); + $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']); } } if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { $ig = 1; if ($ig > 0) { //перемещаем игроков в пещеру - //$u->addAction(time(),'psh'.$dun,''); - // - $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) - VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $zv['dun'] . '","' . $dunname[$zv['dun']][1] . '","' . time() . '")'); + $ins = mysql_query( + 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) + VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $zv['dun'] . '","' . $dunname[$zv['dun']][1] . '","' . time() . '")' + ); if ($ins) { $zid = mysql_insert_id(); mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); //обновляем пользователей - $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/'); + $su = mysql_query( + 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/' + ); $ids = ''; $map_locs = []; @@ -500,9 +525,13 @@ if ($u->room['file'] == 'house_belaun' && false) { $u->addAction(time(), 'psh0', $pu['id'], $pu['id']); } //Добавляем квестовые обьекты для персонажей - $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'); + $sp = mysql_query( + 'SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100' + ); while ($pl2 = mysql_fetch_array($sp)) { - $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1')); + $pl = mysql_fetch_array( + mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1') + ); if (isset($pl['id'])) { $act = explode(',', $pl['act_date']); $i = 0; @@ -523,27 +552,39 @@ if ($u->room['file'] == 'house_belaun' && false) { $ml_arr = []; foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов. if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) { - if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml; - elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml; - } else $ml_arr[] = $ml; + if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) { + $ml_arr[] = $ml; + } elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) { + $ml_arr[] = $ml; + } + } else { + $ml_arr[] = $ml; + } + } + if (isset($ml_arr) && count($ml_arr) == 0) { + $ml_arr = $map_locs; } - if (isset($ml_arr) && count($ml_arr) == 0) $ml_arr = $map_locs; //Добавляем обьект для юзера $j = 0; while ($j < $xr2[1]) { $cord = $ml_arr[rand(0, count($ml_arr) - 1)]; if ($cord[0] != 0 || $cord[1] != 0) { - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( - "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '" - )'); + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time( + ) . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '" + )' + ); } $j++; } } else { //Предмет находится в конкретном месте - mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES ( "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '" - )'); + )' + ); } } $i++; @@ -554,7 +595,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } $ids = rtrim($ids, 'OR'); $snew = 1; - $upd1 = mysql_query('UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); + $upd1 = mysql_query( + 'UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '' + ); if ($upd1) { $upd2 = mysql_query('UPDATE `users` SET `room` = "405" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''); //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] @@ -566,7 +609,9 @@ if ($u->room['file'] == 'house_belaun' && false) { $bots = explode(',', $pl['bot_group']); $pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)]; } - if ($pl['id_bot'] > 0) $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),'; + if ($pl['id_bot'] > 0) { + $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),'; + } unset($bots); } $vls = rtrim($vls, ','); @@ -692,7 +737,9 @@ if ($u->room['file'] == 'house_belaun' && false) { // $vls = rtrim($vls, ','); if ($vls != '') { - $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''); + $ins2 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '' + ); } else { $ins2 = true; } @@ -839,14 +886,16 @@ if ($u->room['file'] == 'house_belaun' && false) { $dun5 = 12; //ПТП } // - $ins = mysql_query('INSERT INTO `dungeon_zv` + $ins = mysql_query( + 'INSERT INTO `dungeon_zv` (`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES ("all","' . time() . '","' . $u->info['id'] . '","' . $dun5 . '", "' . mysql_real_escape_string($_POST['pass']) . '", "' . mysql_real_escape_string($_POST['text']) . '", "8", "21", - "5")'); + "5")' + ); if ($ins) { $u->info['dn'] = mysql_insert_id(); $zv['id'] = $u->info['dn']; @@ -861,17 +910,21 @@ if ($u->room['file'] == 'house_belaun' && false) { } } -//Генерируем список групп + //Генерируем список групп $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'); while ($pl = mysql_fetch_array($sp)) { $dungeonGroupList .= '
'; - if ($u->info['dn'] == 0) $dungeonGroupList .= ''; + if ($u->info['dn'] == 0) { + $dungeonGroupList .= ''; + } $dungeonGroupList .= '' . date('H:i', $pl['time']) . ' '; $dungeonGroupList .= ' '; $pus = ''; //группа - $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''); + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); while ($pu = mysql_fetch_array($su)) { $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; $pus .= ', '; @@ -881,7 +934,9 @@ if ($u->room['file'] == 'house_belaun' && false) { $dungeonGroupList .= $pus; unset($pus); - if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' '; + if ($pl['pass'] != '' && $u->info['dn'] == 0) { + $dungeonGroupList .= ' '; + } if ($pl['com'] != '') { $dl = ''; @@ -1011,7 +1066,9 @@ if ($u->room['file'] == 'house_belaun' && false) { ?> 0) { - $shop = mysql_fetch_array(mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1')); + $shop = mysql_fetch_array( + mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1') + ); if (isset($shop['code'])) { ?> @@ -1057,9 +1114,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
' . $error . '
'; + if ($error != '') { + echo '' . $error . '
'; + } -//отображаем + //отображаем if ($dungeonGroupList == '') { $dungeonGroupList = ''; } else { @@ -1089,14 +1148,20 @@ if ($u->room['file'] == 'house_belaun' && false) {
testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1); + $hgo = $u->testAction( + '`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1 + ); $qc = 0; // Quest Count //Генерируем список текущих квестов $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'); while ($pl = mysql_fetch_array($sp)) { if ($pl['room'] == $u->info['room']) { $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1')); - if ($q->questCheckEnd($pq) == 1) $qsee2 = ''; else $qsee2 = ''; + if ($q->questCheckEnd($pq) == 1) { + $qsee2 = ''; + } else { + $qsee2 = ''; + } $qsee .= ' @@ -1175,7 +1240,7 @@ if ($u->room['file'] == 'house_belaun' && false) { ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . $u->timeOut($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; + echo 'Получить новое задание можно ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )'; } ?> @@ -1202,7 +1267,11 @@ if ($u->room['file'] == 'house_belaun' && false) { if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - if ($r) $rt = 1; else $rt = 0; + if ($r) { + $rt = 1; + } else { + $rt = 0; + } } } if ($rt == 1) { @@ -1214,7 +1283,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } else { echo 'Ничего не получилось...
'; } - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -1233,7 +1304,11 @@ if ($u->room['file'] == 'house_belaun' && false) { if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - if ($r) $rt = 1; else $rt = 0; + if ($r) { + $rt = 1; + } else { + $rt = 0; + } } } if ($rt == 1) { @@ -1245,7 +1320,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } else { echo 'Ничего не получилось...
'; } - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -1264,7 +1341,11 @@ if ($u->room['file'] == 'house_belaun' && false) { if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - if ($r) $rt = 1; else $rt = 0; + if ($r) { + $rt = 1; + } else { + $rt = 0; + } } } if ($rt == 1) { @@ -1276,7 +1357,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } else { echo 'Ничего не получилось...
'; } - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; } @@ -1295,7 +1378,11 @@ if ($u->room['file'] == 'house_belaun' && false) { if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) { $u->rep['nu_' . $val] += $cur_price['nu_' . $val]; $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - if ($r) $rt = 1; else $rt = 0; + if ($r) { + $rt = 1; + } else { + $rt = 0; + } } } if ($rt == 1) { @@ -1307,7 +1394,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } else { echo 'Ничего не получилось...
'; } - } else echo 'Недостаточно репутации.'; + } else { + echo 'Недостаточно репутации.'; + } } else { echo 'Ничего не получилось...
'; @@ -1350,15 +1439,23 @@ if ($u->room['file'] == 'house_belaun' && false) { info['id'] . '" LIMIT 1000')); + $chk = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ) + ); if (isset($_GET['buy777']) && $chk[0] > 0) { ?>

info['id'] . '" LIMIT 1000'); + $chk_cl = mysql_query( + 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000' + ); while ($chk_pl = mysql_fetch_array($chk_cl)) { - if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ; + if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) { + ; + } { $x++; $prc += $chk_pl['price1']; @@ -1468,7 +1565,9 @@ if ($u->room['file'] == 'house_belaun' && false) { } } } else { - echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout( + 60 * 60 * 2 - time() + $dungeon_timeout['time'] + ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; } } } diff --git a/modules_data/location/karcer.php b/modules_data/location/karcer.php index e7a7f468..3a1a7b2f 100644 --- a/modules_data/location/karcer.php +++ b/modules_data/location/karcer.php @@ -1,4 +1,7 @@ info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `delete` = "0" WHERE `uid` = ' . $u->info['id'] . ' AND `delete` = "1357908642"'); $u->error = date('d.m.Y H:i', time()) . ' Вы успешно оплатили штраф ' . $_GET['payshtraf'] . ' и вышли из тюрьмы'; - $u->addDelo(3, $u->info['id'], 'Оплачен штраф: ' . $_GET['payshtraf'] . ' кр. и выпущен на свободу.', time(), $u->info['city'], 'Prison.System', 0, 0); + Delo::add( + 3, + 'Prison.System', + $u->info['id'], + 'Оплачен штраф: ' . $_GET['payshtraf'] . ' кр. и выпущен на свободу.', + ); } else { $u->error = 'Что то пошло не так'; } @@ -76,17 +84,17 @@ if (isset($_GET['ekrobmen'])) { $u->error .= 'запил но на следующий день принес вам кр.'; } - $u->addDelo(3, $u->info['id'], 'Обмен 4 екр на 1000 кр.', time(), $u->info['city'], 'Prison.System', 0, 0); + Delo::add(3, 'Prison.System', $u->info['id'], 'Обмен 4 екр на 1000 кр.',); } else { $u->error = 'Не хватает средств!'; } } ?> - - - - - - -
-

room['name']; ?>

-
- + //Генерируем список групп + $sp = mysql_query( + 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `lvlmin` = "' . $u->info['level'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"' + ); + while ($pl = mysql_fetch_array($sp)) { + $dzs .= '
'; + if ($u->info['dn'] == 0) { + $dzs .= ''; + } + $dzs .= '' . date('H:i', $pl['time']) . ' '; + + $pus = ''; //группа + $su = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '' + ); + while ($pu = mysql_fetch_array($su)) { + $pus .= '' . $pu['login'] . ' [' . $pu['level'] . ']'; + $pus .= ', '; + } + $pus = trim($pus, ', '); + + $dzs .= $pus; + + if ($pl['com'] != '') { + $dl = ''; + if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { + $dl .= ' (удалить комментарий)'; + if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) { + mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['dcom'] = $u->info['id']; + } + } + + $pl['com'] = htmlspecialchars($pl['com'], null); + + if ($pl['dcom'] > 0) { + $dl = ' комментарий удален модератором'; + } + + if ($pl['dcom'] > 0) { + if ($moder['boi'] == 1 || $u->info['admin'] > 0) { + $pl['com'] = '' . $pl['com'] . ''; + } else { + $pl['com'] = ''; + } + } + + $dzs .= ' | ' . $pl['com'] . '' . $dl . ''; + } + + $dzs .= '
'; + } + ?> + +
- - + + -
  - - - -
- - - - - - -
- - - - -
info['city']=='fallenearth'){ - echo "Темный Портал"; - }else { - echo "Магический Портал"; - } - ?>
+
+

room['name']; ?>

+
+
+ +
-
-'.$re.'
'; -} + + ' . $re . '
'; + } -//отображаем -if($dzs=='') -{ - $dzs = ''; -}else{ - if(!isset($zv['id'])) - { - if($g111==1) - { - $pr = ''; - } - $dzs = ''.$pr.'
'.$dzs.''.$pr.''; - } - $dzs .= '


'; -} + //отображаем + if ($dzs == '') { + $dzs = ''; + } else { + if (!isset($zv['id'])) { + if ($g111 == 1) { + $pr = ''; + } + $dzs = '
' . $pr . '
' . $dzs . '' . $pr . '
'; + } + $dzs .= '
'; + } -echo $dzs; -if($g111 == 1) -{ -if($u->info['dn']==0) -{ -?> - - - - -
-
-
- Группа - Комментарий - -
- Пароль - -
- -  
-
-
-
-info['id']) - { - $psh_start = '  '; - } - - echo '
+ echo $dzs; + if ($g111 == 1) { + if ($u->info['dn'] == 0) { + ?> + + + + +
+ +
+ Группа + Комментарий + +
+ Пароль + +
+ +  
+
+ +
+ info['id']) { + $psh_start = '  '; + } + + echo '
Группа - '.$psh_start.' + ' . $psh_start . '
'; - } -} -?> + } + } + ?> -timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)'; + } } -} - -?> diff --git a/modules_data/location/remont.php b/modules_data/location/remont.php index ea477986..d2077a42 100644 --- a/modules_data/location/remont.php +++ b/modules_data/location/remont.php @@ -42,7 +42,13 @@ if (isset($_GET['r'])) { if (isset($_GET['upgrade']) && true == false) { //улучшение предмета - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['upgrade']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['upgrade'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $po = []; $po = Conversion::dataStringToArray($ir['data']); @@ -112,9 +118,14 @@ if (isset($_GET['upgrade']) && true == false) { $po['add_hpAll'] += $fadd[3]; $po['upgrade']++; - $re = '
Предмет "' . $ir['name'] . '" был успешно улучшен (' . $po['upgrade'] . '/5) за ' . $pcena . ' кр.
'; + $re = '
Предмет "' . $ir['name'] . '" был успешно улучшен (' . $po['upgrade'] . '/5) за ' . $pcena . ' кр.
'; - $u->addDelo(2, $u->info['id'], '"System.remont.itemUpgrade": Предмет "' . $ir['name'] . '" [itm:' . $ir['id'] . '] был успешно улучшен (' . $po['upgrade'] . '/5) за ' . $pcena . ' кр..', time(), $u->info['city'], 'System.remont.itemUpgrade', 0, 0); + Delo::add( + 2, + 'System.remont.itemUpgrade', + $u->info['id'], + '"System.remont.itemUpgrade": Предмет "' . $ir['name'] . '" [itm:' . $ir['id'] . '] был успешно улучшен (' . $po['upgrade'] . '/5) за ' . $pcena . ' кр..', + ); $po = Conversion::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "' . $po . '",`1price` = "' . $ir['1price'] . '" WHERE `id` = "' . $ir['id'] . '" LIMIT 1'); @@ -132,9 +143,13 @@ if (isset($_GET['upgrade']) && true == false) { } } elseif (isset($_GET['modif']) && true == false) { //модификация - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` NOT LIKE "%modif%" AND `im`.`type` > 0 AND `im`.`type` < 16 AND (`iu`.`data` LIKE "%add_s1%" OR `iu`.`data` LIKE "%add_s2%" OR `iu`.`data` LIKE "%add_s3%" OR `iu`.`data` LIKE "%add_s5%" OR `iu`.`data` LIKE "%add_hpAll%" OR `iu`.`data` LIKE "%add_mib%") - AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['modif']) . '" LIMIT 1')); + AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['modif']) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $po = []; $po = Conversion::dataStringToArray($ir['data']); @@ -266,7 +281,13 @@ if (isset($_GET['upgrade']) && true == false) { } } elseif (isset($_GET['ubeff']) && true == false) { // Берем в переменную текущий предмет. - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['ubeff']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['ubeff'] + ) . '" LIMIT 1' + ) + ); // Предмет существует. if (isset($ir['id'])) { @@ -291,7 +312,13 @@ if (isset($_GET['upgrade']) && true == false) { $pcena -= 14; // Уменьшаем цену после извлеченния заточки. if (isset($po['upatack_id'])) { // Добавляем заточку в инвентарь. // Берем в переменную свиток заточки, который находится в предмете. - $upattack = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . mysql_real_escape_string((int)$po["upatack"]) . '" LIMIT 1')); + $upattack = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . mysql_real_escape_string( + (int)$po["upatack"] + ) . '" LIMIT 1' + ) + ); if (isset($upattack) && $upattack['item_id'] && $upattack['delete'] > 0) { // Если старый предмет не удален из базы, мы его восстанавливаем. mysql_query('UPDATE `items_users` SET `delete` = "' . mysql_real_escape_string(0) . '" WHERE `id` = "' . $po["upatack"] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = CONCAT(`data`,"noremont=1") WHERE `id` = "' . $po["upatack"] . '" LIMIT 1'); @@ -313,7 +340,9 @@ if (isset($_GET['upgrade']) && true == false) { if ($upattack['uptype'] == 22) { $po['add_m11'] -= $upattack['upatack'] * 2; $po['tr_lvl'] = $item_default['tr_lvl']; - if (isset($po['add_m11']) && $po['add_m11'] == 0) unset($po['add_m11']); + if (isset($po['add_m11']) && $po['add_m11'] == 0) { + unset($po['add_m11']); + } } else { $po['sv_yron_min'] -= $upattack['upatack']; $po['sv_yron_max'] -= $upattack['upatack']; @@ -339,7 +368,13 @@ if (isset($_GET['upgrade']) && true == false) { } } elseif (isset($_GET['unrune'])) { require_once $_SERVER['DOCUMENT_ROOT'] . '/_incl_data/class/Insallah/Runes/Runes.php'; - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%rune_id%" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['unrune']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%rune_id%" AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['unrune'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $po = []; $po = Conversion::dataStringToArray($ir['data']); @@ -356,12 +391,12 @@ if (isset($_GET['upgrade']) && true == false) { /** Самое новое изъятие рун. ;)*/ $item_and_rune = Runes::removeRuneData($po); if (!empty($item_and_rune)) { -# Добавляем предмет без руны + # Добавляем предмет без руны mysql_query(sprintf("update items_users set data = '%s' where id = %d", $item_and_rune['item'], $ir['id'])); -# Отнимаем деньги + # Отнимаем деньги $u->info['money'] -= $pcena; mysql_query(sprintf("update users set money = money - %f where id = %d", $pcena, $u->info['id'])); -# Добавляем руну + # Добавляем руну ItemsModel::addItem($item_and_rune['rune_id'], $u->info['id'], $item_and_rune['rune'], null, null, true); } else { /** Если пытаемся извлечь любую руну кроме 6001, 6002, 6003. */ @@ -374,7 +409,13 @@ if (isset($_GET['upgrade']) && true == false) { $re = '
Подходящий предмет не найден в инвентаре
'; } } elseif (isset($_GET['ubeff'])) { - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['ubeff']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['ubeff'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $po = []; $po = Conversion::dataStringToArray($ir['data']); @@ -409,9 +450,15 @@ if (isset($_GET['upgrade']) && true == false) { } ItemsModel::addItem($po['upatack_id'], $u->info['id'], null, null, null, 1); - $re = '
Заточка "' . $po['upatack_name'] . '" была успешно извлечена из предмета "' . $ir['name'] . '" за ' . $pcena . ' кр.
'; + $re = '
Заточка "' . $po['upatack_name'] . '" была успешно извлечена из предмета "' . $ir['name'] . '" за ' . $pcena . ' кр.
'; + + Delo::add( + 2, + 'System.remont.ubeff', + $u->info['id'], + '"System.remont.ubeff": Руна "' . $po['upatack_name'] . '" была успешно извлечена из предмета "' . $ir['name'] . '" [itm:' . $ir['id'] . '] за ' . $pcena . ' кр.', + ); - $u->addDelo(2, $u->info['id'], '"System.remont.ubeff": Руна "' . $po['upatack_name'] . '" была успешно извлечена из предмета "' . $ir['name'] . '" [itm:' . $ir['id'] . '] за ' . $pcena . ' кр.', time(), $u->info['city'], 'System.remont.ubeff', 0, 0); unset($po['upatack'], $po['upatack_id'], $po['upatack_name'], $po['upatack_lvl']); $po = Conversion::arrayToDataString($po); mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir['id'] . '" LIMIT 1'); @@ -419,13 +466,19 @@ if (isset($_GET['upgrade']) && true == false) { $u->info['money'] -= $pcena; } else { - $re = '
У вас не достаточно средств для извлечения, стоимость извлечения заточки ' . $pcena . ' кр
'; + $re = '
У вас не достаточно средств для извлечения, стоимость извлечения заточки ' . $pcena . ' кр
'; } } else { - $re = '
Подходящий предмет не найден в инвентаре
'; + $re = '
Подходящий предмет не найден в инвентаре
'; } } elseif (isset($_GET['un_grav'])) { - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['un_grav']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['un_grav'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $pcena = 30; if ($ir['type'] == 22) { @@ -458,7 +511,13 @@ if (isset($_GET['upgrade']) && true == false) { $re = '
Подходящий предмет не найден в инвентаре
'; } } elseif (isset($_GET['grav'])) { - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['grav']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['grav'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $pcena = 30; if ($ir['type'] == 22) { @@ -491,7 +550,13 @@ if (isset($_GET['upgrade']) && true == false) { $re = '
Подходящий предмет не найден в инвентаре
'; } } elseif (isset($_GET['podgon'])) { - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = 5 AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['podgon']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = 5 AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['podgon'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $po = []; $po = Conversion::dataStringToArray($ir['data']); @@ -525,7 +590,13 @@ if (isset($_GET['upgrade']) && true == false) { } elseif ($_GET['t'] == 3) { $t = 3; } - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['remon']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['remon'] + ) . '" LIMIT 1' + ) + ); $rem_price = round($ir['price1'] * 0.1 / 100, 2);//цена ремонта за 1ед поломки $rem_all = round($ir['price1'] * $ir['iznosNOW'] * 0.1 / 100, 2);//цена ремонта full @@ -590,7 +661,12 @@ if (isset($_GET['upgrade']) && true == false) { $re2 .= '
К сожалению, максимальная долговечность предмета из-за ремонта уменьшилась.'; $dop = 1; } - $u->addDelo(2, $u->info['id'], '"System.remont": Предмет "' . $ir['name'] . '" [itm:' . $ir['id'] . '] был отремонтирован, максимальная долговечность уменьшилась: ' . $dop . ' (' . $rm . ' ед. за ' . $t . ' кр.).', time(), $u->info['city'], 'System.remont', 0, 0); + Delo::add( + 2, + 'System.remont', + $u->info['id'], + '"System.remont": Предмет "' . $ir['name'] . '" [itm:' . $ir['id'] . '] был отремонтирован, максимальная долговечность уменьшилась: ' . $dop . ' (' . $rm . ' ед. за ' . $t . ' кр.).', + ); } else { $re2 = 'Что-то здесь не так...'; } @@ -600,7 +676,13 @@ if (isset($_GET['upgrade']) && true == false) { $re2 = 'Предмет подходящий для ремонта не найден в инвентаре'; } } elseif (isset($_GET['upgradelvl'])) { - $ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . mysql_real_escape_string((int)$_GET['upgradelvl']) . '" LIMIT 1')); + $ir = mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . mysql_real_escape_string( + (int)$_GET['upgradelvl'] + ) . '" LIMIT 1' + ) + ); if (isset($ir['id'])) { $ur = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "' . $ir['item_id'] . '" LIMIT 1')); if (isset($ur['id'])) { @@ -612,7 +694,9 @@ if (isset($_GET['upgrade']) && true == false) { $ui1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $ur['iup'] . '" LIMIT 1')); $ui2 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $ur['iup'] . '" LIMIT 1')); if (isset($ui1['id'], $ui2['id'])) { - mysql_query('UPDATE `items_users` SET `item_id` = "' . $ui1['id'] . '",`1price` = "' . $ui1['price1'] . '",`2price` = "' . $ui1['price2'] . '",`iznosMAX` = "' . $ui1['iznosMAXi'] . '",`data` = "' . $ui2['data'] . '" WHERE `id` = "' . $ir['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `items_users` SET `item_id` = "' . $ui1['id'] . '",`1price` = "' . $ui1['price1'] . '",`2price` = "' . $ui1['price2'] . '",`iznosMAX` = "' . $ui1['iznosMAXi'] . '",`data` = "' . $ui2['data'] . '" WHERE `id` = "' . $ir['id'] . '" LIMIT 1' + ); $re2 = 'Предмет "' . $ir['name'] . '" был успешно улучшен до следующего уровня за ' . $ur['price2'] . ' екр.'; $u->info['money2'] -= $ur['price2']; $u->addEkr(-$ur['price2']); @@ -635,11 +719,16 @@ if ($r == 1) { $see = $see[2]; } elseif ($r == 5) { //подгонка брони - $see = $u->genInv(56, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = "5" AND `iu`.`data` NOT LIKE "%podgon%" ORDER BY `lastUPD` DESC'); + $see = $u->genInv( + 56, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = "5" AND `iu`.`data` NOT LIKE "%podgon%" ORDER BY `lastUPD` DESC' + ); $see = $see[2]; } elseif ($r == 2) { //гравировка оружия - $see = $u->genInv(57, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") ORDER BY `lastUPD` DESC'); + $see = $u->genInv( + 57, + '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") ORDER BY `lastUPD` DESC' + ); $see = $see[2]; } elseif ($r == 4) { //вытаскивание рун @@ -651,17 +740,25 @@ if ($r == 1) { $see = $see[2]; } elseif ($r == 7) { //модификация - $see = $u->genInv(60, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` NOT LIKE "%modif%" AND `im`.`type` > 0 AND `im`.`type` < 16 AND - (`iu`.`data` LIKE "%add_s1%" OR `iu`.`data` LIKE "%add_s2%" OR `iu`.`data` LIKE "%add_s3%" OR `iu`.`data` LIKE "%add_s5%" OR `iu`.`data` LIKE "%add_hpAll%" OR `iu`.`data` LIKE "%add_mib%") ORDER BY `lastUPD` DESC'); + $see = $u->genInv( + 60, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` NOT LIKE "%modif%" AND `im`.`type` > 0 AND `im`.`type` < 16 AND + (`iu`.`data` LIKE "%add_s1%" OR `iu`.`data` LIKE "%add_s2%" OR `iu`.`data` LIKE "%add_s3%" OR `iu`.`data` LIKE "%add_s5%" OR `iu`.`data` LIKE "%add_hpAll%" OR `iu`.`data` LIKE "%add_mib%") ORDER BY `lastUPD` DESC' + ); $see = $see[2]; } elseif ($r == 6) { //Усиление - $see = $u->genInv(61, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" ORDER BY `lastUPD` DESC'); + $see = $u->genInv( + 61, + '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" ORDER BY `lastUPD` DESC' + ); $see = $see[2]; } elseif ($r == 8) { if ($u->info['money2'] > 0) { //Улучшения - $see = $u->genInv(62, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (SELECT `id` FROM `items_upgrade` WHERE `iid` = `iu`.`item_id` AND `activ` = 1 LIMIT 1) > 0 ORDER BY `lastUPD` DESC'); + $see = $u->genInv( + 62, + '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (SELECT `id` FROM `items_upgrade` WHERE `iid` = `iu`.`item_id` AND `activ` = 1 LIMIT 1) > 0 ORDER BY `lastUPD` DESC' + ); $see = $see[2]; } } elseif ($r == 9) { @@ -676,7 +773,11 @@ if ($r == 1) { $see = $u->genInv(63, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" ' . $itmos . ')'); } else { //Подгонка под комплект - $see = $u->genInv(64, '`iu`.`id` = "' . mysql_real_escape_string($_GET['upgradelvlcom']) . '" AND `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" ' . $itmos . ')'); + $see = $u->genInv( + 64, '`iu`.`id` = "' . mysql_real_escape_string( + $_GET['upgradelvlcom'] + ) . '" AND `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" ' . $itmos . ')' + ); } $see = $see[2]; } diff --git a/modules_data/stats_inv.php b/modules_data/stats_inv.php index b81c7d3a..2ed11842 100644 --- a/modules_data/stats_inv.php +++ b/modules_data/stats_inv.php @@ -1,4 +1,7 @@ info['noreal']) && $c['bonussocial'] == true) { $gd = 0; $zdml = 3600; //час if (isset($mcf['id']) && $mcf['time'] > time() - $zdml) { - echo '
Нельзя подтверждать эл.почту так часто. Осталось ' . $u->timeOut( + echo '
Нельзя подтверждать эл.почту так часто. Осталось ' . Conversion::secondsToTimeout( $mcf['time'] + $zdml - time() - ) . '
'; + ) . '
'; $gd = 1; } elseif (!preg_match( '#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $_GET['confmail'] )) { - echo '
Вы указали явно ошибочный E-mail.
'; + echo '
Вы указали явно ошибочный E-mail.
'; $gd = 1; } diff --git a/modules_data/usemarry.php b/modules_data/usemarry.php index c533610d..325d943c 100644 --- a/modules_data/usemarry.php +++ b/modules_data/usemarry.php @@ -1,86 +1,80 @@ 0) - { - $uer = 'Персонаж уже находится в браке
'; - }elseif($uu['marry']>0) - { - $uer = 'Персонаж уже находится в браке
'; - }elseif($uu['align']>1 && $uu['align']<2 && $u->info['admin']==0) - { - $uer = 'Вы не можете использовать данное заклятие на Паладинов.
'; - }elseif($uu['align']>3 && $uu['align']<4 && $u->info['admin']==0) - { - $uer = 'Вы не можете использовать данное заклятие на Тарманов.
'; - }elseif($uu['admin']>0 && $u->info['admin']==0) - { - $uer = 'Вы не можете накладывать заклятие на Ангелов'; - }elseif($uu['city']!=$u->info['city'] && $p['citym1']==0){ - $uer = 'Персонаж находится в другом городе'; - }elseif($uu['id']==$u->info['id'] && $u->info['admin']==0){ - $uer = 'Вы не можете использовать на самого себя'; - }elseif($uu2['align']>1 && $uu['align']<2 && $u->info['admin']==0) - { - $uer = 'Вы не можете использовать данное заклятие на Паладинов.
'; - }elseif($uu2['align']>3 && $uu['align']<4 && $u->info['admin']==0) - { - $uer = 'Вы не можете использовать данное заклятие на Тарманов.
'; - }elseif($uu2['admin']>0 && $u->info['admin']==0) - { - $uer = 'Вы не можете накладывать заклятие на Ангелов'; - }elseif($uu2['city']!=$u->info['city'] && $p['citym1']==0){ - $uer = 'Персонаж находится в другом городе'; - }elseif($uu2['id']==$u->info['id'] && $u->info['admin']==0){ - $uer = 'Вы не можете использовать на самого себя'; - }else{ - $uu['palpro'] = time()+60*60*24*7; - $upd = mysql_query('UPDATE `users` SET `marry` = "'.$uu2['id'].'" WHERE `id` = "'.$uu['id'].'" LIMIT 1'); - $upd = mysql_query('UPDATE `users` SET `marry` = "'.$uu['id'].'" WHERE `id` = "'.$uu2['id'].'" LIMIT 1'); - if($upd) - { - $sx = ''; - if($u->info['sex']==1) - { - $sx = 'а'; - } - $rtxt = '[img[items/marry.gif]] '.$rang.' "'.$u->info['login'].'" подтвердил'.$sx.' законность брака между "'.$uu['login'].'" и "'.$uu2['login'].'".'; - - mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '".$uu['login']."' LIMIT 1000"); -$cmsg = new ChatMessage(); -$cmsg->setCity($u->info['city']); -$cmsg->setRoom($u->info['room']); -$cmsg->setText($rtxt); -$cmsg->setType(6); -$cmsg->setTypeTime(1); -(new Chat())->sendMsg($cmsg); - $rtxt = $rang.' "'.$u->info['login'].'" подтвердил'.$sx.' законность брака с '.$uu2['id'].'.'; - mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)"); - $rtxt = $rang.' "'.$u->info['login'].'" подтвердил'.$sx.' законность брака с '.$uu['id'].'.'; - mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$uu2['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)"); - - $this->addItem(76,$uu['id'],'sudba='.$uu['login'].'|noremont=1|notransfer=1'); - $this->addItem(76,$uu2['id'],'sudba='.$uu2['login'].'|noremont=1|notransfer=1'); - - $uer = 'Вы успешно зафиксировали брак "'.$uu['login'].'" и "'.$uu2['login'].'".'; - }else{ - $uer = 'Не удалось использовать данное заклятие'; - } - } - }else{ - $uer = 'Персонаж не найден в этом городе'; - } -}else{ - $uer = 'У Вас нет прав на использование данного заклятия'; -} -?> \ No newline at end of file +use User\ItemsModel; + +if (!defined('GAME')) { + die(); +} +if ($p['banned'] == 1 || $p['proverka'] == 1) { + $uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['logingo']) . '" LIMIT 1')); + $uu2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['logingo2']) . '" LIMIT 1')); + if (isset($uu['id']) && isset($uu2['id'])) { + + if ($uu['marry'] > 0) { + $uer = 'Персонаж уже находится в браке
'; + } elseif ($uu['marry'] > 0) { + $uer = 'Персонаж уже находится в браке
'; + } elseif ($uu['align'] > 1 && $uu['align'] < 2 && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать данное заклятие на Паладинов.
'; + } elseif ($uu['align'] > 3 && $uu['align'] < 4 && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать данное заклятие на Тарманов.
'; + } elseif ($uu['admin'] > 0 && $u->info['admin'] == 0) { + $uer = 'Вы не можете накладывать заклятие на Ангелов'; + } elseif ($uu['city'] != $u->info['city'] && $p['citym1'] == 0) { + $uer = 'Персонаж находится в другом городе'; + } elseif ($uu['id'] == $u->info['id'] && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать на самого себя'; + } elseif ($uu2['align'] > 1 && $uu['align'] < 2 && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать данное заклятие на Паладинов.
'; + } elseif ($uu2['align'] > 3 && $uu['align'] < 4 && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать данное заклятие на Тарманов.
'; + } elseif ($uu2['admin'] > 0 && $u->info['admin'] == 0) { + $uer = 'Вы не можете накладывать заклятие на Ангелов'; + } elseif ($uu2['city'] != $u->info['city'] && $p['citym1'] == 0) { + $uer = 'Персонаж находится в другом городе'; + } elseif ($uu2['id'] == $u->info['id'] && $u->info['admin'] == 0) { + $uer = 'Вы не можете использовать на самого себя'; + } else { + $uu['palpro'] = time() + 60 * 60 * 24 * 7; + $upd = mysql_query('UPDATE `users` SET `marry` = "' . $uu2['id'] . '" WHERE `id` = "' . $uu['id'] . '" LIMIT 1'); + $upd = mysql_query('UPDATE `users` SET `marry` = "' . $uu['id'] . '" WHERE `id` = "' . $uu2['id'] . '" LIMIT 1'); + if ($upd) { + $sx = ''; + if ($u->info['sex'] == 1) { + $sx = 'а'; + } + $rtxt = '[img[items/marry.gif]] ' . $rang . ' "' . $u->info['login'] . '" подтвердил' . $sx . ' законность брака между "' . $uu['login'] . '" и "' . $uu2['login'] . '".'; + + mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '" . $uu['login'] . "' LIMIT 1000"); + + $cmsg = new ChatMessage(); + $cmsg->setRoom($u->info['room']); + $cmsg->setText($rtxt); + $cmsg->setType(6); + $cmsg->setTypeTime(1); + (new Chat())->sendMsg($cmsg); + $rtxt = $rang . ' "' . $u->info['login'] . '" подтвердил' . $sx . ' законность брака с ' . $uu2['id'] . '.'; + mysql_query( + "INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $uu['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time( + ) . "','" . $rtxt . "','" . $u->info['login'] . "',0)" + ); + $rtxt = $rang . ' "' . $u->info['login'] . '" подтвердил' . $sx . ' законность брака с ' . $uu['id'] . '.'; + mysql_query( + "INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $uu2['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time( + ) . "','" . $rtxt . "','" . $u->info['login'] . "',0)" + ); + + ItemsModel::addItem(76, $uu['id'], 'sudba=' . $uu['login'] . '|noremont=1|notransfer=1'); + ItemsModel::addItem(76, $uu2['id'], 'sudba=' . $uu2['login'] . '|noremont=1|notransfer=1'); + + $uer = 'Вы успешно зафиксировали брак "' . $uu['login'] . '" и "' . $uu2['login'] . '".'; + } else { + $uer = 'Не удалось использовать данное заклятие'; + } + } + } else { + $uer = 'Персонаж не найден в этом городе'; + } +} else { + $uer = 'У Вас нет прав на использование данного заклятия'; +} diff --git a/ruletka2.php b/ruletka2.php index 7369a872..e591d955 100644 --- a/ruletka2.php +++ b/ruletka2.php @@ -527,11 +527,8 @@ foreach ($sp as $pl) { } if ($wn > 0 || $wn2 > 0) { - $u->addDelo( - 1, $pl2['uid'], - '"Casino.' . $u->info['city'] . '": Выиграл ' . $nmn . ' екр.', - time(), $u->info['city'], 'Casino.' . $u->info['city'], 0, 0 - ); + Delo::add(1, 'Casino', $pl2['uid'], '"Casino.": Выиграл ' . $nmn . ' екр.'); + if (!isset($u_w[1][$pl2['uid']])) { $u_w[0][count($u_w[0])] = $pl2['uid']; $u_w[2][count($u_w[0]) - 1] = $pl2['game_id']; diff --git a/transfer.php b/transfer.php index 244a9ca8..484cf964 100644 --- a/transfer.php +++ b/transfer.php @@ -74,21 +74,24 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { 'UPDATE `users` SET `money` = `money` + "' . $mn1 . '" WHERE `id` = "' . $inf[$u->tfer['uid2']]['id'] . '" LIMIT 1' ); if ($upd) { - $u->addDelo( - 2, $inf[$u->tfer['uid1']]['id'], - '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').' ); - $u->addDelo( - 2, $inf[$u->tfer['uid2']]['id'], - '"System.transfer.MONEY": Получено ' . $mn1 . ' кр. от персонажа "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": Получено ' . $mn1 . ' кр. от персонажа "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').', ); } else { - $u->addDelo( - 2, $inf[$u->tfer['uid1']]['id'], - '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . '), ошибка во время передачи.', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . '), ошибка во время передачи.', ); } } @@ -104,21 +107,24 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { 'UPDATE `users` SET `money` = `money` + "' . $mn2 . '" WHERE `id` = "' . $inf[$u->tfer['uid1']]['id'] . '" LIMIT 1' ); if ($upd) { - $u->addDelo( - 2, $inf[$u->tfer['uid2']]['id'], - '"System.transfer.MONEY": Передано ' . $mn2 . ' кр. персонажу "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').' ); - $u->addDelo( - 2, $inf[$u->tfer['uid1']]['id'], - '"System.transfer.MONEY": Получено ' . $mn2 . ' кр. от персонажа "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": Получено ' . $mn1 . ' кр. от персонажа "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').', ); } else { - $u->addDelo( - 2, $inf[$u->tfer['uid2']]['id'], - '"System.transfer.MONEY": Передано ' . $mn2 . ' кр. персонажу "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . '), ошибка во время передачи.', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": Передано ' . $mn1 . ' кр. персонажу "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . '), ошибка во время передачи.', ); } } @@ -165,15 +171,17 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $i_s = '[Предмет из подземелья]'; } //заносим в личные дела - $u->addDelo( - 2, $fu, - '"System.transfer": Предмет "' . $pl['name'] . ' (стоимость: ' . $pl['1price'] . ' кр. , ' . $pl['2price'] . ' екр.) (x' . $x . ')" [itm:' . $pl['id'] . '] ' . $i_s . ' был передан персонажу "' . $us['login'] . '"(' . $pl['uid'] . '), Тип передачи: ' . $pl['inTransfer'] . '.', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $fu, + '"System.transfer": Предмет "' . $pl['name'] . ' (стоимость: ' . $pl['1price'] . ' кр. , ' . $pl['2price'] . ' екр.) (x' . $x . ')" [itm:' . $pl['id'] . '] ' . $i_s . ' был передан персонажу "' . $us['login'] . '"(' . $pl['uid'] . '), Тип передачи: ' . $pl['inTransfer'] . '.', ); - $u->addDelo( - 2, $pl['uid'], - '"System.transfer": Персонаж "' . $uus['login'] . '"(' . $uus['id'] . ') передал предмет "' . $pl['name'] . ' ' . $i_s . ' (стоимость: ' . $pl['1price'] . ' кр. , ' . $pl['2price'] . ' екр.) (x' . $x . ')" [itm:' . $pl['id'] . '], Тип передачи: ' . $pl['inTransfer'] . '.', - time(), $u->info['city'], 'System.transfer', 0, 0 + Delo::add( + 2, + 'System.transfer', + $pl['uid'], + '"System.transfer": Персонаж "' . $uus['login'] . '"(' . $uus['id'] . ') передал предмет "' . $pl['name'] . ' ' . $i_s . ' (стоимость: ' . $pl['1price'] . ' кр. , ' . $pl['2price'] . ' екр.) (x' . $x . ')" [itm:' . $pl['id'] . '], Тип передачи: ' . $pl['inTransfer'] . '.', ); } else { echo 'Ошибка передачи предмета';