diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php
index 1058e8f7..d285640d 100644
--- a/_incl_data/class/User.php
+++ b/_incl_data/class/User.php
@@ -633,8 +633,8 @@ class User
);
$this->addAction(
time(), 'frg', '[ ' . $this->info['login'] . ' ] ' . date(
- 'd.m.Y H:i:s'
- ) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
+ 'd.m.Y H:i:s'
+ ) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
);
} else {
mysql_query(
@@ -645,8 +645,8 @@ class User
if ($sb - 10 > $this->info['catch'] - $this->info['frg']) {
$this->addAction(
time(), 'frgfalse', '[ ' . $this->info['login'] . ' ] ' . date(
- 'd.m.Y H:i:s'
- ) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
+ 'd.m.Y H:i:s'
+ ) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
);
}
}
@@ -745,7 +745,8 @@ class User
'UPDATE `items_users` SET `use_text` = "' . $itm['use_text'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
);
mysql_query(
- 'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time() . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
+ 'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time(
+ ) . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
htmlspecialchars($txt, null)
) . '","' . $this->info['city'] . '","' . $sx . '")'
);
@@ -801,7 +802,8 @@ class User
$this->error = 'Персонаж уже проводит сделку';
} else {
$ins = mysql_query(
- 'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time() . '","' . mysql_real_escape_string(
+ 'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time(
+ ) . '","' . mysql_real_escape_string(
htmlspecialchars($_POST['textarea'], null)
) . '","' . time() . '")'
);
@@ -2048,234 +2050,136 @@ class User
$clon['login'] .= ' (Клон)';
}
//копируем пользователя
- $ins1 = mysql_query(
- 'INSERT INTO `users` (
- `align`,
- `login`,
- `level`,
- `pass`,
- `city`,
- `cityreg`,
- `name`,
- `sex`,
- `hobby`,
- `timereg`,
- `obraz`,
- `bot_id`,
- `inTurnir`,
- `temp`
- ) VALUES (
- "' . $clon['align'] . '",
- "' . $clon['login'] . '",
- "' . $clon['level'] . '",
- "' . md5('bot_pass_' . $clon['login'] . '_') . '",
- "' . $this->info['city'] . '",
- "' . $clon['city_reg'] . '",
- "' . $clon['login'] . '",
- "' . $clon['sex'] . '",
- "",
- "' . $clon['time_reg'] . '",
- "' . $clon['obraz'] . '",
- "' . mysql_real_escape_string($id) . '",
- "' . $clon['inTurnir'] . '",
- 5
- )'
- );
- if ($ins1) {
- if ($round > 0) {
- //Улучшаем мф. и статы и НР 1 раунд = +10%
- $statss = Conversion::dataStringToArray($clon['stats']);
- //
- $statss['s1'] = ceil($statss['s1'] * (1 + 0.1 * ($round)));
- $statss['s2'] = ceil($statss['s2'] * (1 + 0.1 * ($round)));
- $statss['s3'] = ceil($statss['s3'] * (1 + 0.1 * ($round)));
- $statss['s4'] = ceil($statss['s4'] * (1 + 0.1 * ($round)));
- //
- $statss['hpAll'] = ceil($statss['hpAll'] * (1 + 0.1 * ($round)));
- $statss['mpAll'] = ceil($statss['mpAll'] * (1 + 0.1 * ($round)));
- //
- $statss['m1'] = ceil($statss['m1'] * (1 + 0.1 * ($round)));
- $statss['m2'] = ceil($statss['m2'] * (1 + 0.1 * ($round)));
- $statss['m3'] = ceil($statss['m3'] * (1 + 0.1 * ($round)));
- $statss['m4'] = ceil($statss['m4'] * (1 + 0.1 * ($round)));
- $statss['m5'] = ceil($statss['m5'] * (1 + 0.1 * ($round)));
- $statss['za'] = ceil($statss['za'] * (1 + 0.1 * ($round)));
- $statss['zm'] = ceil($statss['zm'] * (1 + 0.1 * ($round)));
- $clon['stats'] = Conversion::arrayToDataString($statss);
- unset($statss);
- }
- if ($luser && $clon['level'] < 8) {
- //Хуже уворот, крит и защита
- $statss = Conversion::dataStringToArray($clon['stats']);
- $statss['m1'] = ceil($statss['m1'] * 0.75);
- $statss['m2'] = ceil($statss['m2'] * 0.75);
- $statss['m3'] = ceil($statss['m3'] * 0.75);
- $statss['m4'] = ceil($statss['m4'] * 0.75);
- $statss['m5'] = ceil($statss['m5'] * 0.75);
- $statss['za'] = ceil($statss['za'] * 0.25);
- $clon['stats'] = Conversion::arrayToDataString($statss);
- unset($statss);
- }
- $uid = mysql_insert_id();
- //копируем статы
- $ins2 = mysql_query(
- 'INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("' . $clon['id'] . '","' . $uid . '","' . $clon['stats'] . '","1000000","' . $clon['upLevel'] . '","1","' . $clon['priems'] . '")'
- );
- if ($ins2) {
- //копируем предметы
- $sp = mysql_query(
- 'SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "' . $clon['id'] . '" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50'
- );
- while ($pl = mysql_fetch_array($sp)) {
- $pl['data'] = str_replace('toclan', 'to_clan_', $pl['data']);
- mysql_query(
- 'INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("' . $uid . '","' . $pl['item_id'] . '","' . $pl['data'] . '","' . $pl['inOdet'] . '","' . $pl['iznosMAX'] . '","' . $pl['kolvo'] . '")'
- );
- }
- //копируем эффекты
- $sp = mysql_query(
- 'SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "' . $clon['id'] . '" AND `delete` = "0" AND `deactiveTime` < "' . time() . '" AND `v1` != "priem" LIMIT 50'
- );
- while ($pl = mysql_fetch_array($sp)) {
- mysql_query(
- 'INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("' . $uid . '","' . $pl['id_eff'] . '","' . $pl['data'] . '","' . $pl['name'] . '","' . $pl['overType'] . '","' . $pl['timeUse'] . '","' . $pl['x'] . '")'
- );
- }
- $r = $uid;
- }
+ Db::sql(
+ "insert into users (align, login, level, pass, city, cityreg, name, sex, timereg, obraz, bot_id, inTurnir) values (?,?,?,uuid(),'Неведомые земли','Неведомые земли',?,?,?,?,?,?)",
+ [
+ $clon['align'],
+ $clon['login'],
+ $clon['level'],
+ $clon['login'],
+ $clon['sex'],
+ $clon['time_reg'],
+ $clon['obraz'],
+ $id,
+ $clon['inTurnir'],
+ ]
+ );
+
+ if ($round > 0) {
+ //Улучшаем мф. и статы и НР 1 раунд = +10%
+ $statss = Conversion::dataStringToArray($clon['stats']);
+ //
+ $statss['s1'] = ceil($statss['s1'] * (1 + 0.1 * ($round)));
+ $statss['s2'] = ceil($statss['s2'] * (1 + 0.1 * ($round)));
+ $statss['s3'] = ceil($statss['s3'] * (1 + 0.1 * ($round)));
+ $statss['s4'] = ceil($statss['s4'] * (1 + 0.1 * ($round)));
+ //
+ $statss['hpAll'] = ceil($statss['hpAll'] * (1 + 0.1 * ($round)));
+ $statss['mpAll'] = ceil($statss['mpAll'] * (1 + 0.1 * ($round)));
+ //
+ $statss['m1'] = ceil($statss['m1'] * (1 + 0.1 * ($round)));
+ $statss['m2'] = ceil($statss['m2'] * (1 + 0.1 * ($round)));
+ $statss['m3'] = ceil($statss['m3'] * (1 + 0.1 * ($round)));
+ $statss['m4'] = ceil($statss['m4'] * (1 + 0.1 * ($round)));
+ $statss['m5'] = ceil($statss['m5'] * (1 + 0.1 * ($round)));
+ $statss['za'] = ceil($statss['za'] * (1 + 0.1 * ($round)));
+ $statss['zm'] = ceil($statss['zm'] * (1 + 0.1 * ($round)));
+ $clon['stats'] = Conversion::arrayToDataString($statss);
+ unset($statss);
}
+
+ $uid = Db::lastInsertId();
+
+ //копируем статы
+ Db::sql('insert into stats (clone, id, stats, hpNow, upLevel, bot, priems) values (?,?,?,1000000,?,1,?)', [$clon['id'], $uid, $clon['stats'], $clon['upLevel'], $clon['priems']]);
+
+ //копируем предметы
+ Db::sql(
+ "insert into items_users (uid, item_id, data, inOdet, iznosMAX, kolvo) select ?, item_id, replace(data, 'toclan', 'to_clan_'), inOdet, iznosMAX, kolvo from items_users where inOdet > 0 and uid = ?",
+ [$uid, $clon['id']]
+ );
+
+ //копируем эффекты
+ Db::sql(
+ "insert into eff_users (uid, id_eff, data, name, overType, timeUse, x) select ?, id_eff, data, name, overType, timeUse, x from eff_users where uid = ? and deactiveTime < unix_timestamp() and v1 != 'priem'",
+ [$uid, $clon['id']]
+ );
+
+ $r = $uid;
}
return $r;
+
} else {
- if ($botDate == null) {
- $bot = mysql_fetch_array(
- mysql_query(
- 'SELECT `id`,`login`,`stats`,`obraz`,`level`,`sex`,`name`,`hobby`,`type`,`itemsUse`,`priemUse`,`align`,`clan`,`align_zvanie`,`bonus`,`clan_zvanie`,`time_reg`,`city_reg`,`upLevel`,`active`,`expB`,`p_items`,`agressor`,`priems`,`priems_z`,`award` FROM `test_bot` WHERE `id` = "' . $id . '" LIMIT 1'
- )
- );
+
+ $bot = Db::getRow('select id, login, stats, upLevel, itemsUse from test_bot where id = ?', [$id]);
+
+ if (!isset($bot['id'])) {
+ return [];
} else {
- $bot = $botDate;
- }
- if (isset($bot['id'])) {
if (isset($logins_bot[$bot['login']])) {
$logins_bot[$bot['login']]++;
$bot['login'] = $bot['login'] . ' (' . $logins_bot[$bot['login']] . ')';
} else {
$logins_bot[$bot['login']] = 1;
}
- $ret = true;
- if ($bot['time_reg'] == 100) {
- $bot['time_reg'] = time();
- }
- if ($bot['city_reg'] == '{thiscity}') {
- $bot['city_reg'] = $this->info['city'];
- }
- $ins1 = mysql_query(
- 'INSERT INTO `users` (
- `align`,
- `login`,
- `level`,
- `pass`,
- `city`,
- `cityreg`,
- `name`,
- `sex`,
- `hobby`,
- `timereg`,
- `obraz`,
- `bot_id`,
- `temp`
- ) VALUES (
- "' . $bot['align'] . '",
- "' . $bot['login'] . '",
- "' . $bot['level'] . '",
- "' . md5('bot_pass_' . $bot['login'] . '_') . '",
- "' . $this->info['city'] . '",
- "' . $bot['city_reg'] . '",
- "' . $bot['name'] . '",
- "' . $bot['sex'] . '",
- "' . $bot['hobby'] . '",
- "' . $bot['time_reg'] . '",
- "' . $bot['obraz'] . '",
- "' . mysql_real_escape_string($id) . '",
- 6
- )'
+ Db::sql(
+ "insert into users (align, login, level, pass, city, cityreg, name, sex, hobby, timereg, obraz, bot_id)
+ select align, ?, level, uuid(), 'Неведомые земли', 'Неведомые земли', name, sex, hobby, replace(time_reg, 100, unix_timestamp()), obraz, id
+ from test_bot where id = ?",
+ [$bot['login'], $id]
);
- if ($ins1) {
- $uid = mysql_insert_id();
- if ($round > 0) {
- //Улучшаем мф. и статы и НР 1 раунд = +20%
- $statss = Conversion::dataStringToArray($bot['stats']);
- //
- $statss['s1'] = ceil($statss['s1'] * (1 + 0.20 * ($round)));
- $statss['s2'] = ceil($statss['s2'] * (1 + 0.20 * ($round)));
- $statss['s3'] = ceil($statss['s3'] * (1 + 0.20 * ($round)));
- $statss['s4'] = ceil($statss['s4'] * (1 + 0.20 * ($round)));
- //
- $statss['hpAll'] = ceil($statss['hpAll'] * (1 + 0.20 * ($round)));
- $statss['mpAll'] = ceil($statss['mpAll'] * (1 + 0.20 * ($round)));
- //
- $statss['m1'] = ceil($statss['m1'] * (1 + 0.20 * ($round)));
- $statss['m2'] = ceil($statss['m2'] * (1 + 0.20 * ($round)));
- $statss['m3'] = ceil($statss['m3'] * (1 + 0.20 * ($round)));
- $statss['m4'] = ceil($statss['m4'] * (1 + 0.20 * ($round)));
- $statss['m5'] = ceil($statss['m5'] * (1 + 0.20 * ($round)));
- $statss['za'] = ceil($statss['za'] * (1 + 0.20 * ($round)));
- $statss['zm'] = ceil($statss['zm'] * (1 + 0.20 * ($round)));
- $bot['stats'] = Conversion::arrayToDataString($statss);
- unset($statss);
- }
- $ins2 = mysql_query(
- 'INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("' . $uid . '","' . $bot['stats'] . '","1000000","' . $bot['upLevel'] . '","1")'
- );
- if ($ins2) {
- $bot['id'] = $uid;
- $bot['logins_bot'] = $logins_bot;
- $ret = $bot;
- //Выдаем предметы
- $iu = explode(',', $bot['itemsUse']);
- $i = 0;
- $w3b = 0;
- while ($i < count($iu)) {
- if ($iu[$i] > 0) {
- $idiu = $this->addItem($iu[$i], $bot['id']);
- $islot = mysql_fetch_array(
- mysql_query(
- 'SELECT `id`,`inslot` FROM `items_main` WHERE `id` = "' . $iu[$i] . '" LIMIT 1'
- )
- );
- if (isset($islot['id'])) {
- if ($islot['inslot'] == 3) {
- if ($w3b == 1) {
- $islot = 14;
- } else {
- $islot = 3;
- $w3b = 1;
- }
- } else {
- $islot = $islot['inslot'];
- }
- } else {
- $islot = 2000;
- }
- mysql_query(
- 'UPDATE `items_users` SET `inOdet` = "' . $islot . '" WHERE `id` = "' . $idiu . '" LIMIT 1'
- );
- }
- $i++;
- }
- } else {
- $ret = false;
- }
- } else {
- $ret = false;
+ $uid = Db::lastInsertId();
+
+ if ($round > 0) { //Улучшаем мф. и статы и НР 1 раунд = +20%
+ $statss = Conversion::dataStringToArray($bot['stats']);
+
+ $statss['s1'] = ceil($statss['s1'] * (1 + 0.20 * ($round)));
+ $statss['s2'] = ceil($statss['s2'] * (1 + 0.20 * ($round)));
+ $statss['s3'] = ceil($statss['s3'] * (1 + 0.20 * ($round)));
+ $statss['s4'] = ceil($statss['s4'] * (1 + 0.20 * ($round)));
+
+ $statss['hpAll'] = ceil($statss['hpAll'] * (1 + 0.20 * ($round)));
+ $statss['mpAll'] = ceil($statss['mpAll'] * (1 + 0.20 * ($round)));
+
+ $statss['m1'] = ceil($statss['m1'] * (1 + 0.20 * ($round)));
+ $statss['m2'] = ceil($statss['m2'] * (1 + 0.20 * ($round)));
+ $statss['m3'] = ceil($statss['m3'] * (1 + 0.20 * ($round)));
+ $statss['m4'] = ceil($statss['m4'] * (1 + 0.20 * ($round)));
+ $statss['m5'] = ceil($statss['m5'] * (1 + 0.20 * ($round)));
+ $statss['za'] = ceil($statss['za'] * (1 + 0.20 * ($round)));
+ $statss['zm'] = ceil($statss['zm'] * (1 + 0.20 * ($round)));
+ $bot['stats'] = Conversion::arrayToDataString($statss);
+ unset($statss);
}
- return $ret;
- } else {
- return false;
+
+ Db::sql('insert into stats (id, stats, hpNow, upLevel, bot) values (?,?,1000000,?,1)', [$uid, $bot['stats'], $bot['upLevel']]);
+
+ $bot['id'] = $uid;
+ $bot['logins_bot'] = $logins_bot;
+
+ //Выдаем предметы
+ $iu = explode(',', $bot['itemsUse']);
+
+ $i = 0;
+ $w3b = 0;
+
+ foreach ($iu as $item) {
+ $iditem = ItemsModel::addItem($item, $bot['id']);
+ $inslot = Db::getValue('select inslot from items_main where id = ?', [$item]) ?? 2000;
+ if ($inslot === 3) {
+ if ($w3b === 1) {
+ $inslot = 14;
+ } else {
+ $w3b = 1;
+ }
+ }
+ Db::sql('update items_users set inOdet = ? where id = ?', [$inslot, $iditem]);
+ }
+
+ return $bot;
}
}
}
@@ -2363,11 +2267,13 @@ class User
$col = $this->itemsX($iid);
if ($col > 1) {
$UpItems = mysql_query(
- 'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `inGroup` = `inGroup`+1000, `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="' . $i2['item_id'] . '" AND `uid`="' . $i2['uid'] . '" AND `inGroup` = "' . $i2['inGroup'] . '" LIMIT ' . $col . ''
+ 'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `inGroup` = `inGroup`+1000, `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time(
+ ) . '", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="' . $i2['item_id'] . '" AND `uid`="' . $i2['uid'] . '" AND `inGroup` = "' . $i2['inGroup'] . '" LIMIT ' . $col . ''
);
} else {
$UpItems = mysql_query(
- 'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1'
+ 'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time(
+ ) . '", `inShop` = 0 WHERE `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1'
);
}
//Вставляем функцию передачи кредитов владельцу предмета
@@ -2444,11 +2350,11 @@ class User
* @param $type
* @param $uid
* @param $txt
- * @param @deprecated $tm
- * @param @deprecated $ct
+ * @param @deprecated $tm
+ * @param @deprecated $ct
* @param $frm
* @param $mo
- * @param @deprecated $mi
+ * @param @deprecated $mi
* @param $vvv
* @return bool
* @deprecated использовать Delo::add().
@@ -4413,7 +4319,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if ($po['sudba'] == '0') {
$is2 .= ' ';
} elseif ($po['sudba'] == '1') {
- $is2 .= ' ';
+ $is2 .= ' ';
} else {
$is2 .= ' ';
}
@@ -4597,7 +4504,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$tr .= '
• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
}
if (isset($po['mf_mib']) && $po['mf_mib'] > 0) {
- $tr .= ' ';
+ $tr .= ' ';
}
}
$i++;
@@ -4741,7 +4649,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if (isset($po['free_stats']) && $po['free_stats'] > 0) {
$is2 .= '
Распределение статов:';
- $is2 .= '
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |
"' . $pl['name'] . '" Использовать сейчас? |