680 lines
24 KiB
PHP
680 lines
24 KiB
PHP
<?php
|
|
|
|
if (!defined('GAME_VERSION')) {
|
|
require_once '_incl_data/autoload.php';
|
|
}
|
|
|
|
use Core\{Config, Database, Db, Mail};
|
|
|
|
Config::init();
|
|
Database::init();
|
|
|
|
$chat = new Chat();
|
|
$filter = new Filter();
|
|
|
|
function addEffects(int $uid, int ...$eids)
|
|
{
|
|
foreach ($eids as $eid) {
|
|
$eff = Db::getRow('select * from eff_main where id2 = ?', [$eid]);
|
|
if (!$eff['id2']) {
|
|
continue;
|
|
}
|
|
Db::sql(
|
|
'insert into eff_users (overType, id_eff, uid, name, timeUse, data) values (?,?,?,?,unix_timestamp(),?)',
|
|
[
|
|
$eff['oneType'],
|
|
$eff['id2'],
|
|
$uid,
|
|
$eff['mname'],
|
|
$eff['mdata'],
|
|
]
|
|
);
|
|
}
|
|
}
|
|
|
|
function errorCheck(int $id, string $strU, $name = 0): string
|
|
{
|
|
$ur = new UserRegister();
|
|
session_start();
|
|
|
|
if ($id == 1 && !empty($strU)) {
|
|
$error = $ur->hasGoodLogin($strU);
|
|
}
|
|
|
|
if ($id == 2 && !empty($strU)) {
|
|
$error = $ur->hasGoodEmail($strU);
|
|
}
|
|
|
|
if ($id == 3 && !empty($strU) && !empty($name)) {//îòñûëêà åìàèëà ïðè óäà÷íîì åìàèëå str_u -> mail name -> nickname
|
|
$code = mt_rand(1000, 9999);
|
|
Db::sql('insert into secure_code (email, code, time) values (?,?,unix_timestamp())', [$strU, $code]);
|
|
Mail::send($strU, 'Ñåêðåòíûé Êîä: ' . $code, 'Ñåêðåòíûé Êîä - Íîâûé Áîéöîâñêèé Êëóá ' . $name);
|
|
}
|
|
|
|
if ($id == 4 && !empty($strU) && !empty($name)) {//ïðîâåðêà êîäà áåçîïàñíîñòè str_u -> ââåäåííûé êîä name -> email
|
|
$error = $ur->hasGoodEmailCode($name, (int)$strU);
|
|
}
|
|
if ($id == 5 && !empty($strU) && !empty($name)) {//ïðîâåðêà ïàðîëÿ str_u -> p1 êîä name -> p2
|
|
$error = $ur->hasGoodPassword($strU, $name);
|
|
}
|
|
|
|
return $error ?? '';
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>
|
|
<title>Ðåãèñòðàöèÿ - ñîçäàé ïåðñîíàæà â èãðå Íîâûé «Áîéöîâñêèé êëóá» </title>
|
|
<meta name="description" content="<?= Config::get('desc') ?>"/>
|
|
</head>
|
|
<style>
|
|
body {
|
|
/* Ïóòü ê ôîíîâîìó ðèñóíêó */
|
|
/* Ïîëîæåíèå ôîíà */
|
|
/* Îòìåíÿåì ïîâòîðåíèå ôîíà */
|
|
background: #000 url(/werhr.jpg) no-repeat center center fixed;
|
|
}
|
|
|
|
.visible_class {
|
|
background-image: url(script.png); /* Ïóòü ê ôîíîâîìó ðèñóíêó */
|
|
background-size: 100% 100%;
|
|
position: absolute;
|
|
top: 45%;
|
|
left: 50%;
|
|
margin: 0 -50% 0 0;
|
|
#min-width: 600px;
|
|
min-height: 200px;
|
|
transform: translate(-50%, -50%)
|
|
}
|
|
|
|
.visible_class input {
|
|
background: none repeat scroll 0 0 #720300;
|
|
border-color: #720300 #327CB5 #327CB5 #720300;
|
|
border-radius: 10px 10px 10px 10px;
|
|
border-style: solid;
|
|
border-width: 1px;
|
|
box-shadow: 1px 1px 3px #333333;
|
|
color: #FFFFFF;
|
|
cursor: pointer;
|
|
font-weight: bold;
|
|
padding: 5px;
|
|
text-shadow: 1px 1px 1px #000000;
|
|
display: block;
|
|
margin-right: auto;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.visible_class select {
|
|
background: none repeat scroll 0 0 #720300;
|
|
border-color: #720300 #327CB5 #327CB5 #720300;
|
|
border-radius: 10px 10px 10px 10px;
|
|
border-style: solid;
|
|
border-width: 1px;
|
|
box-shadow: 1px 1px 3px #333333;
|
|
color: #FFFFFF;
|
|
cursor: pointer;
|
|
font-weight: bold;
|
|
padding: 5px;
|
|
text-shadow: 1px 1px 1px #000000;
|
|
display: block;
|
|
margin-right: auto;
|
|
margin-left: auto;
|
|
overflow-x: hidden;
|
|
overflow-y: hidden;
|
|
}
|
|
|
|
.visible_class h3 {
|
|
|
|
text-align: center;
|
|
text-shadow: #000 0 0 10px; /* Ñâå÷åíèå ãîëóáîãî öâåòà */
|
|
color: #FFF;
|
|
margin-top: 20px;
|
|
margin-left: 50px;
|
|
margin-right: 50px;
|
|
#-webkit-text-stroke: 1px red;
|
|
|
|
}
|
|
|
|
.visible_class h4 {
|
|
|
|
text-align: center;
|
|
text-shadow: #000 0 0 10px;
|
|
color: #ffc6c6;
|
|
margin-bottom: 50px;
|
|
margin-left: 50px;
|
|
margin-right: 50px;
|
|
#-webkit-text-stroke: 1px red;
|
|
|
|
}
|
|
|
|
.visible_class radio {
|
|
|
|
text-align: center;
|
|
text-shadow: #000 0 0 10px;
|
|
color: red;
|
|
#-webkit-text-stroke: 1px red;
|
|
|
|
}
|
|
|
|
.visible_class a:visited {
|
|
color: red;
|
|
}
|
|
|
|
.visible_class_s input[type="submit"] {
|
|
margin: 20px 0;
|
|
padding: 0 10px;
|
|
background: #a50000;
|
|
color: #ffffff;
|
|
font-size: 22px;
|
|
text-transform: uppercase;
|
|
border-width: 0;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
transition: .2s linear
|
|
}
|
|
|
|
.visible_class_s input[type="submit"]:hover {
|
|
background: #C44D58;
|
|
}
|
|
|
|
.visible_class_s {
|
|
position: absolute;
|
|
top: 80%;
|
|
left: 50%;
|
|
margin: 0 -50% 0 0;
|
|
transform: translate(-50%, -50%)
|
|
}
|
|
|
|
.invisible_class {
|
|
display: none;
|
|
}
|
|
|
|
.form_radio_btn {
|
|
display: inline-block;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.form_radio_btn input[type=radio] {
|
|
display: none;
|
|
}
|
|
|
|
.form_radio_btn label {
|
|
display: inline-block;
|
|
cursor: pointer;
|
|
padding: 0 15px;
|
|
line-height: 34px;
|
|
border: 1px solid #EEE;
|
|
color: #EEE;
|
|
border-radius: 6px;
|
|
user-select: none;
|
|
}
|
|
|
|
/* Checked */
|
|
.form_radio_btn input[type=radio]:checked + label {
|
|
background: #790000;
|
|
color: white;
|
|
}
|
|
|
|
/* Hover */
|
|
.form_radio_btn label:hover {
|
|
color: #FFF;
|
|
}
|
|
|
|
/* Disabled */
|
|
.form_radio_btn input[type=radio]:disabled + label {
|
|
background: #efefef;
|
|
color: #666;
|
|
}
|
|
|
|
.box {
|
|
background: linear-gradient(to right, gold, darkorange);
|
|
color: white;
|
|
--width: 250px;
|
|
--height: calc(var(--width) / 3);
|
|
width: var(--width);
|
|
height: var(--height);
|
|
text-align: center;
|
|
line-height: var(--height);
|
|
font-size: calc(var(--height) / 2.5);
|
|
font-family: sans-serif;
|
|
letter-spacing: 0.2em;
|
|
border: 1px solid darkgoldenrod;
|
|
border-radius: 2em;
|
|
transform: perspective(500px) rotateY(-15deg);
|
|
text-shadow: 6px 3px 2px rgba(0, 0, 0, 0.2);
|
|
box-shadow: 2px 0 0 5px rgba(0, 0, 0, 0.2);
|
|
transition: 0.5s;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.box:hover {
|
|
transform: perspective(500px) rotateY(15deg);
|
|
text-shadow: -6px 3px 2px rgba(0, 0, 0, 0.2);
|
|
box-shadow: -2px 0 0 5px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.box::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent, white, transparent);
|
|
left: -100%;
|
|
transition: 0.5s;
|
|
}
|
|
|
|
.box:hover::before {
|
|
left: 100%;
|
|
}
|
|
</style>
|
|
|
|
<form action="register.php" method="post">
|
|
|
|
|
|
<?php
|
|
if (isset($_GET['ref']) || isset($_POST['ref'])) {
|
|
?>
|
|
<div class="invisible_class">
|
|
<p><input type="text" name="ref" value="<?php
|
|
if (isset($_GET['ref'])) {
|
|
print_r($_GET['ref']);
|
|
} else {
|
|
print_r($_POST['ref']);
|
|
}
|
|
|
|
?>"/></p>
|
|
</div>
|
|
<?php
|
|
}
|
|
if (!isset ($_POST['nick_u'])) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ïðèäóìàéòå èìÿ ïåðñîíàæà</h3>
|
|
<input type="text" name="nick_u" placeholder="Èìÿ"/>
|
|
</div>
|
|
<?php
|
|
} elseif (errorCheck(1, $_POST['nick_u']) !== "") {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ââåäèòå íèêíåéì äëÿ Âàøåãî ïåðñîíàæà </h3>
|
|
<input type="text" name="nick_u" value="<?php
|
|
print_r($_POST['nick_u']); ?>"/>
|
|
<h4><?= errorCheck(1, $_POST['nick_u']); ?></h4>
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
Èìÿ âàøåãî ïåðñîíàæà (login):
|
|
<input type="text" name="nick_u" value="<?php print_r($_POST['nick_u']); ?>"/>
|
|
</div>
|
|
<?php
|
|
} ?>
|
|
<?php
|
|
if (empty($_POST['email_u']) && !empty($_POST['nick_u']) && errorCheck(1, $_POST['nick_u']) == "") {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ââåäèòå âàø äåéñòâóþùèé è íàñòîÿùèé "Email" àäðåñ </h3>
|
|
<input type="text" name="email_u" placeholder="Ââåäèòå âàø email"/>
|
|
<h3>Âíèìàíèå! Ïðîâåðüòå ïàïêó "ÑÏÀÌ", èíîãäà, ïèñüìî ñ êîäîì ïîäòâåðæäåíèÿ ìîæåò ïîïàñòü òóäà.</h3>
|
|
</div>
|
|
<?php
|
|
} elseif (isset ($_POST['email_u']) && errorCheck(2, $_POST['email_u']) != "") {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ââåäèòå âàø äåéñòâóþùèé è íàñòîÿùèé "Email" àäðåñ </h3>
|
|
<input type="text" name="email_u" value="<?php print_r($_POST['email_u']); ?>"/>
|
|
<h4><?= errorCheck(2, $_POST['email_u']); ?></h4>
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
<input type="text" name="email_u" value="<?php print_r($_POST['email_u']); ?>"/>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
if (
|
|
empty($_POST['secure_code']) &&
|
|
!empty($_POST['email_u']) &&
|
|
errorCheck(2, $_POST['email_u']) == "" &&
|
|
errorCheck(3, $_POST['email_u'], $_POST['nick_u']) == ""
|
|
) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Íà email: <?php
|
|
print_r($_POST['email_u']) ?> áûëî îòïðàâëåíî ïèñüìî ñ ïðîâåðî÷íûì êîäîì,<br>
|
|
ñêîïèðóéòå åãî è âñòàâüòå ñþäà:</h3>
|
|
<input type="text" name="secure_code" placeholder="Ïðîâåðî÷íûé Êîä"/>
|
|
</div>
|
|
<?php
|
|
} elseif (isset ($_POST['secure_code']) && errorCheck(4, $_POST['secure_code'], $_POST['email_u']) != "") {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Íà email: <?php
|
|
print_r($_POST['email_u']) ?> áûëî îòïðàâëåíî ïèñüìî ñ ïðîâåðî÷íûì êîäîì,<br>
|
|
ñêîïèðóéòå åãî è âñòàâüòå ñþäà:</h3>
|
|
<input type="text" name="secure_code" placeholder="Ïðîâåðî÷íûé Êîä"/>
|
|
<h4><?= errorCheck(4, $_POST['secure_code'], $_POST['email_u']); ?></h4>
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
<input type="text" name="secure_code" value="<?php print_r($_POST['secure_code']); ?>"/>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
|
|
if (
|
|
(empty($_POST['pass1_u']) || empty($_POST['pass2_u'])) &&
|
|
!empty($_POST['secure_code']) &&
|
|
errorCheck(4, $_POST['secure_code'], $_POST['email_u']) == ""
|
|
) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ïðèäóìàéòå ïàðîëü äëÿ Âàøåãî ïåðñîíàæà </h3>
|
|
<input type="password" name="pass1_u" value=""/>
|
|
<h3>Ââåäèòå åãî ïîâòîðíî äëÿ íàä¸æíîñòè </h3>
|
|
<input type="password" name="pass2_u" value=""/><br>
|
|
<p>
|
|
<h3>Ìèíèìàëüíàÿ äëèííà ïàðîëÿ: 8 ñèìâîëîâ.</h3>
|
|
</div>
|
|
<?php
|
|
} elseif (
|
|
!empty($_POST['pass1_u']) &&
|
|
!empty($_POST['secure_code']) &&
|
|
errorCheck(5, $_POST['pass1_u'], $_POST['pass2_u']) != "") {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Ïðèäóìàéòå ïàðîëü äëÿ Âàøåãî ïåðñîíàæà </h3>
|
|
<input type="password" name="pass1_u" value=""/>
|
|
<h3>Ââåäèòå åãî ïîâòîðíî äëÿ íàä¸æíîñòè </h3>
|
|
<input type="password" name="pass2_u" value=""/><br>
|
|
<p>
|
|
<h3>Ìèíèìàëüíàÿ äëèííà ïàðîëÿ: 8 ñèìâîëîâ.</h3>
|
|
<h4><?= errorCheck(5, $_POST['pass1_u'], $_POST['pass2_u']); ?></h4><br>
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
<input type="password" name="pass1_u" value="<?php print_r($_POST['pass1_u']); ?>"/><br>
|
|
<input type="password" name="pass2_u" value="<?php print_r($_POST['pass2_u']); ?>"/><br>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
if (
|
|
empty($_POST['pol_u']) &&
|
|
!empty($_POST['pass1_u']) &&
|
|
!empty($_POST['pass2_u']) && errorCheck(5, $_POST['pass1_u'], $_POST['pass2_u']) == ""
|
|
) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Âûáåðèòå ïîë âàøåãî ïåðñîíàæà:</h3>
|
|
<select name="pol_u" size="2" multiple>
|
|
<option value="10">Ìóæñêîé</option>
|
|
<option value="11">Æåíñêèé</option>
|
|
</select>
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
<select name="pol_u" size="2" multiple>
|
|
<option selected value="<?php print_r($_POST['pol_u']); ?>"></option>
|
|
<option value="<?php print_r($_POST['pol_u']); ?>"></option>
|
|
</select>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
if (empty($_POST['bday_u']) && !empty($_POST['pol_u'])) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Óêàæèòå äàòó âàøåãî ðîæäåíèÿ:</h3>
|
|
<input type="date" id="start" name="bday_u" value="1980-01-01" max="2003-01-01">
|
|
</div>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<div class="invisible_class">
|
|
<input type="date" id="start" name="bday_u" value="<?php print_r($_POST['bday_u']); ?>">
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
if (empty($_POST['class_u']) && !empty($_POST['bday_u'])) {
|
|
?>
|
|
<div class="visible_class">
|
|
<h3>Âûáåðèòå èãðîâîé êëàññ äëÿ âàøåãî ïåðñîíàæà:</h3>
|
|
<h3>Âíèìàíèå! Âûáîð èãðîâîãî êëàññà íå âëèÿåò íà èãðó â öåëîì è íèãäå íå ôèêñèðóåòñÿ èëè æå èñïîëüçóåòñÿ,
|
|
ýòî íåîáõîäèìî äëÿ òîãî, ÷òîáû âàø ïåðñîíàæ ïîëó÷èë íóæíûå ïðåäìåòû â íà÷àëå èãðû, à òàê æå íóæíûå
|
|
áàôôû.</h3>
|
|
<div style="margin-left: 23%;">
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="1" id="radio-1" checked> <label
|
|
for="radio-1">Òîïîðùèê</label></p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="2" id="radio-2"> <label for="radio-2">Óâîðîò÷èê</label>
|
|
</p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="3" id="radio-3"> <label for="radio-3">Òàíê</label></p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="4" id="radio-4"> <label for="radio-4">Êðèòîâèê</label>
|
|
</p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="5" id="radio-5"> <label for="radio-5">Ìàã
|
|
Âîçäóõà</label></p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="6" id="radio-6"> <label for="radio-6">Ìàã Îãíÿ</label>
|
|
</p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="7" id="radio-7"> <label for="radio-7">Ìàã Çåìëè</label>
|
|
</p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="8" id="radio-8"> <label for="radio-8">Ìàã Âîäû</label>
|
|
</p>
|
|
</div>
|
|
<div class="form_radio_btn">
|
|
<p><input name="class_u" type="radio" value="9" id="radio-9"> <label for="radio-9">Êðèòîóâîðîò</label>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Âíèìàíèå! Âûáðàâ êëàññ ïåðñîíàæà âû àâòîìàòè÷åñêè ñîãëàøàåòåñü ñ <a
|
|
href='https://new-combats.com/encicl/law2.html'>ïðàâèëàìè è çàêîíàìè</a> èãðîâîãî ìèðà </h3>
|
|
<br>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
if (
|
|
!empty($_POST['nick_u']) &&
|
|
!empty($_POST['email_u']) &&
|
|
!empty($_POST['secure_code']) &&
|
|
!empty($_POST['pol_u']) &&
|
|
!empty($_POST['bday_u']) &&
|
|
!empty($_POST['class_u']) &&
|
|
errorCheck(4, $_POST['secure_code'], $_POST['email_u']) == ""
|
|
) {
|
|
|
|
session_start();
|
|
$u = User::start();
|
|
//Ñîçäàåì ïåðñîíàæà
|
|
if ($_POST['ref'] > 0) {
|
|
$_POST['ref'] = Db::getValue('select count(*) from users where id = ?', [$_POST['ref']]) ?: 0;
|
|
}
|
|
|
|
$uid = UserRegister::new(
|
|
$_POST['nick_u'],
|
|
$_POST['ref'],
|
|
$_POST['pass1_u'],
|
|
$_POST['email_u'],
|
|
$_POST['bday_u'],
|
|
$_POST['pol_u']
|
|
);
|
|
|
|
if ($uid > 0) {
|
|
|
|
|
|
|
|
if (isset($_COOKIE['from'])) {
|
|
Db::sql(
|
|
'insert into `from` (uid, time, val, ip) values (?,unix_timestamp(),?,?)',
|
|
[$uid, $_COOKIE['from'], UserIp::get()]
|
|
);
|
|
}
|
|
|
|
$stmt = Db::prepare('insert into stats (id,stats,ability,skills,exp) values (?,?,-75,-9,100000)');
|
|
$stmt2 = Db::prepare(
|
|
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?'
|
|
);
|
|
$stmt3 = Db::prepare('update users set `money` = 200 where `id` = ?');
|
|
|
|
if ($_POST['class_u'] == 1) { //òîïîð
|
|
addEffects($uid, 1, 20); // ñèëà + ñîêðóøåíèå
|
|
$stmt->execute(
|
|
[$uid, 's1=62|s2=3|s3=3|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=9|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6433, $uid);
|
|
$stmt2->execute([6433, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 2) { //óâîðîò
|
|
addEffects($uid, 8, 20); // ëîâêà + ñîêðóøåíèå
|
|
$stmt->execute(
|
|
[$uid, 's1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0']
|
|
);
|
|
$re = $u->addItem(6431, $uid);
|
|
$stmt2->execute([6431, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 3) { //òàíê
|
|
addEffects($uid, 1, 20); // ñèëà + ñîêðóøåíèå
|
|
$stmt->execute(
|
|
[$uid, 's1=42|s2=3|s3=3|s4=50|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=9|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6432, $uid);
|
|
$stmt2->execute([6432, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 4) { //êðèò
|
|
addEffects($uid, 7, 20); // èíòà + ñîêðóøåíèå
|
|
$stmt->execute(
|
|
[$uid, 's1=24|s2=15|s3=29|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=9|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6430, $uid);
|
|
$stmt2->execute([6430, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 5) { //âîçäóõ
|
|
addEffects($uid, 9, 32, 53, 439); // èíòåëåêò + Õîëîäíûé ðàçóì + Ìàã óñåëîê âîçäóõ + Ìàã óñåëîê
|
|
$stmt->execute(
|
|
[$uid, 's1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=6|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6435, $uid);
|
|
$stmt2->execute([6435, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 6) { //îãîíü
|
|
addEffects($uid, 9, 32, 51, 439); // èíòåëåêò + Õîëîäíûé ðàçóì + Ìàã óñåëîê îãîíü + Ìàã óñåëîê
|
|
$stmt->execute(
|
|
[$uid, 's1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=6|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6447, $uid);
|
|
$stmt2->execute([6447, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 7) { //çåìëÿ
|
|
addEffects($uid, 9, 32, 54, 439); // èíòåëåêò + Õîëîäíûé ðàçóì + Ìàã óñåëîê çåìëÿ + Ìàã óñåëîê
|
|
$stmt->execute(
|
|
[$uid, 's1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=0|mg4=6|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6436, $uid);
|
|
$stmt2->execute([6436, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 8) { //âîäà
|
|
addEffects($uid, 9, 32, 52, 439); // èíòåëåêò + Õîëîäíûé ðàçóì + Ìàã óñåëîê âîäà + Ìàã óñåëîê
|
|
$stmt->execute(
|
|
[$uid, 's1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=6|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0']
|
|
);
|
|
$re = $u->addItem(6448, $uid);
|
|
$stmt2->execute([6448, $re]);
|
|
$stmt3->execute([$uid]);
|
|
} elseif ($_POST['class_u'] == 9) { //Êðèòîóâîðîò
|
|
addEffects($uid, 8, 20); // ëîâêà + ñîêðóøåíèå
|
|
$stmt->execute(
|
|
[$uid, 's1=15|s2=23|s3=30|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0']
|
|
);
|
|
$re = $u->addItem(6530, $uid);
|
|
$stmt2->execute([6530, $re]);
|
|
$stmt3->execute([$uid]);
|
|
}
|
|
if ($_POST['ref'] > 0) {
|
|
$re = $u->addItem(4811, $uid);
|
|
}
|
|
|
|
/* Êàñòèì îñòàëüíûå ýôåêòû
|
|
25 Çàùèòà îò îðóæèÿ
|
|
37 Íåêòàð Íåóÿçâèìîñòè
|
|
38 Íåêòàð Îòðèöàíèÿ
|
|
283 Áóòåðáðîä -Çàâòðàê Ðûöàðÿ- òîëñòûé
|
|
296 Æàæäà Æèçíè +6
|
|
412 Áëàãîäàòü Àíãåëà [3]
|
|
472 Àìáðîçèÿ ïîäìàñòåðüÿ Âëàäûê
|
|
*/
|
|
addEffects($uid, 25, 37, 38, 283, 296, 412, 472);
|
|
|
|
User::setOnline($uid);
|
|
//Ñîçäàåì ñòàòû ïåðñîíàæà
|
|
Db::sql('insert into online (uid, timeStart) values (?,unix_timestamp())', [$uid]);
|
|
|
|
//ìóëüòû
|
|
$ppl = Db::getRow(
|
|
'select * from logs_auth where ip != \'\' and (ip = ? or ip = ? or ip = (select ip from logs_auth where uid = ? and ip != ?))',
|
|
[
|
|
UserIp::get(), $_COOKIE['ip'], $uid, UserIp::get(),
|
|
]
|
|
);
|
|
|
|
foreach ($ppl as $spl) {
|
|
$ml = Db::getValue('select id from mults where (uid = ? and uid2 = ?) or (uid = ? and uid2 = ?)', [$spl['uid'], $uid, $uid, $spl['uid']]);
|
|
|
|
if (!$ml && $spl['ip'] !== '' && $spl['ip'] !== '127.0.0.1') {
|
|
Db::sql('insert into mults (uid, uid2, ip) values (?,?,?)', [$uid, $spl['uid'], $spl['ip']]);
|
|
}
|
|
}
|
|
Db::sql('insert into logs_auth (uid, ip, browser, type, time) values (?,?,?,1,unix_timestamp())', [$uid, UserIp::get(), $_SERVER['HTTP_USER_AGENT']]);
|
|
|
|
//Îáíîâÿåì òàáëèöû
|
|
Db::sql('update users set ip = ? where id = ?', [UserIp::get(), $uid]);
|
|
|
|
if (
|
|
!setcookie('login', $_POST['nick_u'], (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') ||
|
|
!setcookie('pass', md5($_POST['pass1_u']), (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') ||
|
|
!setcookie('registrationModal', 'true', (time() + 60 * 60 * 24 * 7), '', 'new-combats.com')
|
|
) {
|
|
die('Îøèáêà ñîõðàíåíèÿ cookie.');
|
|
} else {
|
|
Db::sql('insert into users_learning_status (uid) values (?)', [$uid]);
|
|
die(
|
|
'Ñïàñèáî çà ðåãèñòðàöèþ â èãðîâîì ìèðå Áîéöîâñêîãî Êëóáà, æåëàåì âàì ïîáåä è äîëãîé èãðû.
|
|
 ñëó÷àå âîïðîñîâ ïî èãðå, Âàì áóäåò äîñòóïåí îáùèé ÷àò!
|
|
<br><script>function test(){ top.location.href="https://' . Config::get('host') . '/bk"; } setTimeout("test()",100);</script>'
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
?>
|
|
<div class="visible_class_s"><p><input class="box" type="submit"></p></div>
|
|
</form>
|
|
<?php
|
|
}
|