Переезд impstats и additem..

This commit is contained in:
Ivor Barhansky 2023-04-16 02:54:34 +03:00
parent 3dc4cf7284
commit 2bc67ce543
127 changed files with 584 additions and 612 deletions

View File

@ -1663,7 +1663,7 @@ class Battle
$i01 = 1;
while ($i01 <= (($this->info['izlomObr'] - $this->info['izlomObrNow'])) * 7) {
$u->addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']);
$i01++;
}
mysql_query(
@ -2182,18 +2182,18 @@ class Battle
if (isset($pld['id'])) {
if ($this->users[$i]['battle_yron'] >= 500) {
$u->addItem(4754, $pld['id'], '');
$u->addItem(4754, $pld['id'], '');
$u->addItem(4754, $pld['id'], '');
$u->addItem(4754, $pld['id'], '');
$u->addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
$pld['battle_text'] .= ' За Героическое Сражение вы получаете <strong>Реликвия Ангела (x5)</strong>. ';
mysql_query(
'UPDATE `users_achiv` SET `pg`= `pg`+1 WHERE `id` = "' . $pld['id'] . '" LIMIT 1'
);
if ($this->users[$i]['team'] == $this->info['team_win'] && rand(1, 100) <= 5) {
$u->addItem(10020, $pld['id'], '');
\User\ItemsModel::addItem(10020, $pld['id'], '');
$pld['battle_text'] .= ' и <strong>Жетон Успеха</strong>. ';
}
} else {
@ -3153,7 +3153,7 @@ class Battle
}
$tmoni = 1;
while ($tmoni <= floor($tmon / 2)) {
$u->addItem(4754, $this->users[$i]['id'], ''); //
\User\ItemsModel::addItem(4754, $this->users[$i]['id'], ''); //
$tmoni++;
}
$this->users[$i]['battle_text'] .= ' За призовой хаот вы получаете <strong>Призовой Жетон (x' . floor(
@ -3313,7 +3313,7 @@ class Battle
}
while ($tmoni >= 1) {
if ($u->info['ang_g'] < $limitg) {
$u->addItem(4754, $this->users[$i]['id'], '');
\User\ItemsModel::addItem(4754, $this->users[$i]['id'], '');
mysql_query(
'UPDATE `users` SET `ang_g`=`ang_g`+1 WHERE `id` =' . $this->users[$i]['id'] . ''
);
@ -3334,7 +3334,7 @@ class Battle
if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)) {
//Хэллоуин 4504
$this->users[$i]['battle_text'] .= ' Вы получаете <strong>Тыква (x1)</strong>.';
$u->addItem(4504, $this->users[$i]['id'], '|sudba=1');
\User\ItemsModel::addItem(4504, $this->users[$i]['id'], '|sudba=1');
}
}
@ -4144,7 +4144,7 @@ class Battle
if ($itm_e[0] > 0) {
$j = 0;
while ($j < $itm_e[1]) {
$u->addItem($itm_e[0], $uid, '|' . $itm_e[2]);
\User\ItemsModel::addItem($itm_e[0], $uid, '|' . $itm_e[2]);
$j++;
}
if (!isset($this->ainm[$itm_e[0]])) {

View File

@ -123,7 +123,7 @@ class BotLogic
$cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "' . self::$bot['id'] . '" AND `delete` = "0" LIMIT 1'));
if (!isset($cr['id'])) {
//Покупаем кристалл
$u->addItem(1204, self::$bot['id']);
\User\ItemsModel::addItem(1204, self::$bot['id']);
}
}
//Переходим в комнату для сражений
@ -194,7 +194,7 @@ class BotLogic
while ($i <= 20) {
if ($com['e' . $i] > 0) {
//Выдаем и надеваем предмет
//$it = $u->addItem($com['e'.$i],self::$bot['id']);
//$it = \User\ItemsModel::addItem($com['e'.$i],self::$bot['id']);
$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $com['e' . $i] . '" LIMIT 1'));
mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . self::$bot['id'] . '","' . $eff['mname'] . '","' . (time() + 9640000) . '","' . $eff['mdata'] . '","' . $eff['noAce'] . '")');
}
@ -205,7 +205,7 @@ class BotLogic
while ($i <= 20) {
if ($com['w' . $i] > 0) {
//Выдаем и надеваем предмет
$it = $u->addItem($com['w' . $i], self::$bot['id']);
$it = \User\ItemsModel::addItem($com['w' . $i], self::$bot['id']);
$eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `item_id` = "' . $com['w' . $i] . '" LIMIT 1'));
if ($it > 0) {
mysql_query('UPDATE `items_users` SET `inOdet` = "' . $i . '",`delete` = "0", `1price` = "' . $eff1['price_1'] . '" WHERE `uid` = "' . self::$bot['id'] . '" AND `id` = "' . $it . '" LIMIT 1');
@ -314,7 +314,7 @@ class BotLogic
while ($i <= 20) {
if ($com['e' . $i] > 0) {
//Выдаем и надеваем предмет
//$it = $u->addItem($com['e'.$i],self::$bot['id']);
//$it = \User\ItemsModel::addItem($com['e'.$i],self::$bot['id']);
$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $com['e' . $i] . '" LIMIT 1'));
mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . self::$bot['id'] . '","' . $eff['mname'] . '","' . (time() + 86400 * 7) . '","' . $eff['mdata'] . '","' . $eff['noAce'] . '")');
}
@ -1007,7 +1007,7 @@ class BotLogic
if (self::$bot['level'] <= 5 && self::$bot['exp'] >= 12499) {
$cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "' . self::$bot['id'] . '" AND `delete` = "0" LIMIT 1'));
if (!isset($cr['id'])) {
$u->addItem(1204, self::$bot['id']);
\User\ItemsModel::addItem(1204, self::$bot['id']);
self::$bot['exp'] = 12500;
}
}

View File

@ -208,7 +208,7 @@ class Dialog
//Выдаем предмет для квеста
$itmb = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $act1[8] . '" LIMIT 1'));
if (isset($itmb['id'])) {
$u->addItem($act1[8], $u->info['id'], '|nodelete=1');
\User\ItemsModel::addItem($act1[8], $u->info['id'], '|nodelete=1');
$txt .= '<br><b><font color=red>Вы получили предмет &quot;' . $itmb['name'] . '&quot;</font></b>';
}
}
@ -234,7 +234,7 @@ class Dialog
}
$txt .= '</font></b>';
$u->addItem($itmb['id'], $u->info['id'], $act1dt);
\User\ItemsModel::addItem($itmb['id'], $u->info['id'], $act1dt);
$pg = $act1[4];
}
} else {
@ -263,7 +263,7 @@ class Dialog
}
$ic2 = 1;
while ($ic2 <= $act3[2]) {
$u->addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]);
\User\ItemsModel::addItem($itmqs['id'], $u->info['id'], '|quest_item=1', ['del' => $act3[3]]);
$ic2++;
}
}
@ -393,7 +393,7 @@ class Dialog
if ($upd) {
if ($itik > 0) {
//Выдаем предметы
$u->addItem($itik, $u->info['id'], '|nosale=1|srok=' . (7 * 86400) . '', null, 1);
\User\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 = 'Вы получили предмет &quot;' . $itm_nm['name'] . '&quot;';
} else {
@ -413,7 +413,7 @@ class Dialog
}
$arts_1 = $arts_1[rand(0, count($arts_1) - 1)];
if ($arts_1 > 0) {
$u->addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100);
\User\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 +433,7 @@ class Dialog
}
$arts_1 = $arts_1[rand(0, count($arts_1) - 1)];
if ($arts_1 > 0) {
$u->addItem($arts_1, $u->info['id'], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . (86400 / 2) . '', null, 100);
\User\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 +523,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i]['add'][0], $u->info['id'], $data);
\User\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] . '<br>';
@ -569,7 +569,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i]['add'][0], $u->info['id'], $data);
\User\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] . '<br>';
@ -615,7 +615,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i]['add'][0], $u->info['id'], $data);
\User\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] . '<br>';
@ -647,7 +647,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'];
$u->addItem(2555, $u->info['id'], $data);
\User\ItemsModel::addItem(2555, $u->info['id'], $data);
$txt = 'Вы успешно получили &quot;Пирамидальный ключ&quot;';
}
@ -690,7 +690,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data);
\User\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 +746,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data);
\User\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 +802,7 @@ class Dialog
$data = '|frompisher=' . $d->info['id2'];
$e = 1;
while ($e <= $t[0]) {
$u->addItem($cn[$i][$j]['add'][0], $u->info['id'], $data);
\User\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] . '<br>';
@ -957,7 +957,7 @@ class Dialog
$qsw = 0;
while ($qsw < $item['colvo']) {
$txt .= '<br/>Вы получили предмет';
$u->addItem($item['item_id'], $u->info['id']);
\User\ItemsModel::addItem($item['item_id'], $u->info['id']);
$qsw++;
}
}
@ -1215,7 +1215,7 @@ class Dialog
$val = 4799;
}
}
$u->addItem($val, $u->info['id'], $data_itm);
\User\ItemsModel::addItem($val, $u->info['id'], $data_itm);
$i1++;
}
} elseif ($var == 'up') {

View File

@ -1309,7 +1309,7 @@ class Dungeon
}
$data = str_replace('|sudba=-1', '|sudba=' . $u->info['login'] . '', $data);
$idl = $u->addItem($obj['item_id'], $u->info['id'], $data, $obj);
$idl = \User\ItemsModel::addItem($obj['item_id'], $u->info['id'], $data, $obj);
if ($obj['del'] > 0) {
mysql_query(
'UPDATE `items_users` SET `dn_delete` = 1 WHERE `id` = "' . $idl . '" LIMIT 1'

View File

@ -20,7 +20,7 @@ class DungeonEditor
$this->bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "' . $u->info['city'] . '" AND `id` = "' . $this->info['bsid'] . '" AND `time_start` = "' . $this->info['time_start'] . '" LIMIT 1'));
//Если БС закончена
if (isset($this->bs['id']) && $this->bs['users'] - $this->bs['users_finish'] < 2) {
$u->bsfinish($this->bs, false, null);
\Location\DeathTower::finish($this->bs, false, null);
}
}

View File

@ -341,10 +341,10 @@ class FightRequest
Db::sql('delete from stats where id = ?', [$user['id']]);
Db::sql('delete from items_users where uid = ?', [$user['id']]);
Db::sql('delete from eff_users where uid = ?', [$user['id']]);
$this->u->addItem(4754, $user['id']);
\Core\ConversionHelper::dataStringToArray(4754, $user['id']);
}
} else {
$this->u->addItem(4754, $user['id']);
\Core\ConversionHelper::dataStringToArray(4754, $user['id']);
}
}
return [
@ -1605,7 +1605,7 @@ class FightRequest
$items = $classItems[$sellclass];
foreach ($items as $slot => $itemId) {
$re = $this->u->addItem($itemId, $uidb);
$re = \Core\ConversionHelper::dataStringToArray($itemId, $uidb);
$stmt1->execute([$slot, $re]);
$stmt2->execute([$itemId, $re]);
}

View File

@ -0,0 +1,170 @@
<?php
namespace Location;
use Chat;
use ChatMessage;
use User;
class DeathTower
{
public static function finish($id, $bu, $di)
{
$user = User::start();
if ($bu) {
/* â ýòîì áîþ ïðîâåðÿåì þçåðîâ */
$i = 0;
while ($i < count($bu[$i])) {
if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) {
mysql_query(
'UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'
);
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(
'SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1'
)
);
if (isset($pls1['id'])) {
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'
);
$ins = '';
while ($pli = mysql_fetch_array($spi)) {
$ins .= '("' . $di['dn_id'] . '","' . $pli['item_id'] . '","' . time(
) . '","' . $di['x'] . '","' . $di['y'] . '"),';
}
$ins = rtrim($ins, ',');
mysql_query(
'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ' . $ins . ''
);
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1');
mysql_query(
'UPDATE `bs_zv` SET `finish` = "' . time(
) . '" WHERE `id` = "' . $pls1['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pls1['uid'] . '" LIMIT 1');
}
}
$id['users_finish']++;
}
$i++;
}
}
if ($id['users'] - $id['users_finish'] >= 2) {
return;
}
$win = [];
$sp = mysql_query(
'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = "0" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100'
);
while ($pl = mysql_fetch_array($sp)) {
$ur = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'
)
);
$ub = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'
)
);
if (isset($ur['id']) && isset($ub['id']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) {
$win = $ub;
$winr = $ur;
}
}
$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;
} elseif ($winr['level'] < 7) {
$bsep = 5000;
} elseif ($winr['level'] < 8) {
$bsep = 15000;
} elseif ($winr['level'] < 9) {
$bsep = 25000;
} else {
$bsep = 50000;
}
/* Âûäàåì ïðèç */
$mn = (round($id['money'] / 100 * 85));
mysql_query(
'UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'
);
/* ÷àò */
$cmsg->setTo($winr['login']);
$cmsg->setText(
"Ïîçäðàâëÿåì! Âû ïîáåäèëè â òóðíèðå &quot;Áàøíÿ Ñìåðòè&quot;! Ïîëó÷åíî îïûòà: $bsep, äåíüãè: $mn êð."
);
$cmsg->setType(6);
$chat->sendMsg($cmsg);
$cmsg->setTo('');
$cmsg->setIsAlert(true);
$cmsg->setText(
"Çàâåðøèëñÿ òóðíèð &quot;Áàøíÿ Ñìåðòè&quot;, ïîáåäèòåëü òóðíèðà: <strong>{$winr['login']}</strong>! Ïîçäðàâëÿåì!"
);
$cmsg->setType(5);
$chat->sendMsg($cmsg);
$user->addDelo(
1, $uid,
'&quot;<span style="color: #C65F00; ">WinTournament.' . $user->info['city'] . '</span>&quot; (Áàøíÿ Ñìåðòè): Ïîëó÷åíî &quot;<strong>' . $mn . '</strong> êð.&quot;',
time(), $user->info['city'], 'WinTournament.' . $user->info['city'], 0, 0
);
} else {
/* ÷àò */
$cmsg->setIsAlert(true);
$cmsg->setType(5);
$cmsg->setText('Çàâåðøèëñÿ òóðíèð «Áàøíÿ Ñìåðòè», ïîáåäèòåëü òóðíèðà: îòñóòñòâóåò.');
}
$sp = mysql_query(
'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100'
);
while ($pl = mysql_fetch_array($sp)) {
$ur = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'
)
);
$ub = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'
)
);
if (isset($ub['id'])) {
//del
mysql_query('DELETE FROM `users` WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `stats` WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500');
//upd
mysql_query(
'UPDATE `bs_zv` SET `finish` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pl['uid'] . '" LIMIT 1');
}
}
}
}

View File

@ -1828,7 +1828,7 @@ class Magic
$trnt .= $pl['login'] . ' Комната : ' . $rrm['name'] . ', ';
}
$trnt = rtrim($trnt, ', ');
$it_ = $u->addItem(
$it_ = \User\ItemsModel::addItem(
2435, $u->info['id'], 'noodet=1|noremont=1|sudba=' . $u->info['login'] . ''
);
mysql_query(

View File

@ -1,5 +1,6 @@
<?php
use Core\ConversionHelper;
use Core\Db;
use DarksLight2\Training\TrainingManager;
use Insallah\Math;
@ -113,7 +114,7 @@ class Priems
}
$x++;
$data['add_mg2static_points'] = $x;
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
Db::sql(
'update eff_users set x = ?, data = ? where uid = ? and `delete` = 0 and v2 = 260 and user_use = ?',
[$x, $data, $uid, $this->u->info['id']]
@ -415,40 +416,6 @@ class Priems
return $r;
}
/** Превращает строку data ('a=1|b=2|c=3') из БД в массив [a=>1, b=>2, c=>3].
* @param $m
* @return array
*/
public function lookStatsArray($m)
{
$arr = json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $m . '}'), true);
return $arr ?: [];
}
/** Превращает массив [a=>1, b=>2, c=>3] в строку data ('a=1|b=2|c=3') для БД.
* @param array $m
* @return string
*/
private function impStats(array $m)
{
$str = json_encode($m);
return $str ? str_replace(['":', ',"', '{"', '}'], ['=', '|'], $str) : '';
}
/**
* @param $data
* @param array $values
* @return string
*/
private function changeStatsData($data, array $values)
{
$arr = $this->lookStatsArray($data);
foreach ($values as $key => $value) {
$arr[$key] = $value;
}
return $this->impStats($arr);
}
public function magicRegen($ue, $hpmin, $tmp, $pl, $eff, $rp = 0, $dp = 0, $krituet = true, $dopyrn = 0)
{
global $btl;
@ -533,7 +500,7 @@ class Priems
mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1')
);
if (isset($pl2['priem']['id'])) {
$dt1 = $this->lookStatsArray($pl2['priem']['date2']);
$dt1 = ConversionHelper::dataStringToArray($pl2['priem']['date2']);
if (isset($dt1['yron_u2'])) {
$minu = $this->getdr(
@ -1041,7 +1008,7 @@ class Priems
mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1')
);
if (isset($pl2['priem']['id'])) {
$dt1 = $this->lookStatsArray($pl2['priem']['date2']);
$dt1 = ConversionHelper::dataStringToArray($pl2['priem']['date2']);
if (isset($dt1['yron_u2'])) {
$minu = $this->getdr(
$dt1['yron_u2'], [0 => 'lvl1', 1 => 'yr1', 2 => 'ts5', 3 => 'ts6'],
@ -1661,8 +1628,8 @@ class Priems
public function plusData($d1, $d2)
{
global $u;
$j1 = $this->lookStatsArray($d1);
$j2 = $this->lookStatsArray($this->redate($d2, $this->u->info['id']));
$j1 = ConversionHelper::dataStringToArray($d1);
$j2 = ConversionHelper::dataStringToArray($this->redate($d2, $this->u->info['id']));
$v = $this->u->lookKeys($this->redate($d2, $this->u->info['id']), 0); // ключи 2
//добавляем данные друг к другу
$i = 0;
@ -1680,7 +1647,7 @@ class Priems
$i++;
}
$inf = rtrim($inf, ', ');
$j1 = $this->u->impStats($j1);
$j1 = ConversionHelper::arrayToDataString($j1);
return $j1;
}
@ -1688,7 +1655,7 @@ class Priems
{
global $u, $btl;
$rcu = false;
$j = $this->lookStatsArray($pl['date2']);
$j = ConversionHelper::dataStringToArray($pl['date2']);
$mpr = false;
$addch = 0;
$uid = $this->u->info['id'];
@ -1790,8 +1757,8 @@ class Priems
}
} elseif ($j['onlyOne'] > 1) {
if ($mpr['x'] < $j['onlyOne'] && isset($j['date3Plus'])) {
$j1 = $this->lookStatsArray($mpr['data']);
$j2 = $this->lookStatsArray($this->redate($pl['date3'], $this->u->info['id']));
$j1 = ConversionHelper::dataStringToArray($mpr['data']);
$j2 = ConversionHelper::dataStringToArray($this->redate($pl['date3'], $this->u->info['id']));
$v = $this->u->lookKeys($this->redate($pl['date3'], $this->u->info['id']), 0); // ключи 2
//добавляем данные друг к другу
$i = 0;
@ -1809,7 +1776,7 @@ class Priems
$i++;
}
$inf = rtrim($inf, ', ');
$j1 = $this->u->impStats($j1);
$j1 = ConversionHelper::arrayToDataString($j1);
$pld[0] = ' x' . ($mpr['x'] + 1);
if ($j['refHod'] == 1) {
$mpr['hod'] = $pl['limit'];
@ -1982,7 +1949,7 @@ class Priems
$this->u->info['priems_z'] = $pz;
$btl->users[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz;
$btl->stats[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz;
$tr = $this->lookStatsArray($pl['tr']);
$tr = ConversionHelper::dataStringToArray($pl['tr']);
if (isset($tr['tr_mpNow'])) {
$tr['tr_mpNow'] = round($tr['tr_mpNow'] / 100 * (100 - $this->u->stats['min_use_mp']));
$btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] -= $tr['tr_mpNow'];
@ -2167,8 +2134,8 @@ class Priems
public function testpriem($pl, $t = 1, $o = 0)
{
global $c, $u, $code, $btl;
$tr = $this->lookStatsArray($pl['tr']);
$d2 = $this->lookStatsArray($pl['date2']);
$tr = ConversionHelper::dataStringToArray($pl['tr']);
$d2 = ConversionHelper::dataStringToArray($pl['date2']);
$x = 1;
$notr = 0;
@ -2342,7 +2309,7 @@ class Priems
{
global $u, $c, $code, $btl;
$pz = explode('|', $this->u->info['priems_z']);
$tr = $this->lookStatsArray($pl['tr']);
$tr = ConversionHelper::dataStringToArray($pl['tr']);
$trs = '';
$x = 0;
$notr = 0;
@ -2586,7 +2553,7 @@ class Priems
);
$leveledDamage = $baseDamage[$level] + 40 / 100 * (5 * $magicTargetTier);
list($damage, $isCrit, $isMiss) = $this->magicAttack(
[$damage, $isCrit, $isMiss] = $this->magicAttack(
$btl, $this->u->info['id'], $this->ue['id'], $leveledDamage, self::FIRE, 1
);
//Используем проверку на урон приемов
@ -2668,7 +2635,7 @@ class Priems
) : $pl['date3'];
// Костыль. Будет работать, пока приём изменяет ОДИН параметр.
$effect = "Защита от магии {$data[$element][1]}: " . current($this->lookStatsArray($dataStr));
$effect = "Защита от магии {$data[$element][1]}: " . current(ConversionHelper::dataStringToArray($dataStr));
$color = $this->logColor[$element];
$name = "Цель {$data[$element][1]}";
@ -2715,7 +2682,7 @@ class Priems
}//Проверяем эффект
$prv['j_priem'] = $btl->stats[$btl->uids[$u1]]['u_priem'][$j_id][0];
$pvr['data'] = $this->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pName = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['name'];
$pvr['hp'] = $pvr['data']['atgm'];
@ -2763,7 +2730,7 @@ class Priems
private function devouringFlameInit($id, array $pl, Battle $btl)
{
$baseDamage = [6 => 53, 7 => 63, 8 => 77, 9 => 91, 10 => 110, 11 => 133,];
list($damage, , $isMiss) = $this->magicAttack(
[$damage, , $isMiss] = $this->magicAttack(
$btl, $this->u->info['id'], $this->ue['id'], $baseDamage[$pl['level']], self::FIRE
);
if ($isMiss || $damage <= 0) {
@ -2777,7 +2744,7 @@ class Priems
$logText, $btl->hodID + 1
);
$data = $this->impStats(['atgm' => max(floor($damage / 5), 1)]);
$data = ConversionHelper::arrayToDataString(['atgm' => max(floor($damage / 5), 1)]);
$this->addPriem(
$this->ue['id'], $pl['id'], $data, 0, 77, 5, $this->u->info['id'], 1, 'пожирающеепламя', 0, 0, 1
@ -2801,7 +2768,7 @@ class Priems
$datas = Db::getColumn($q, array_fill(0, 3, $this->ue['id']));
$stats = array_fill_keys(['s1', 's2', 's3', 's5', 's6'], 0);
foreach ($datas as $data) {
$data = $this->lookStatsArray($data);
$data = ConversionHelper::dataStringToArray($data);
print_r($data);
foreach (array_keys($stats) as $stat) {
if (isset($data[$stat])) {

View File

@ -4,6 +4,7 @@ use Core\Config;
use Core\ConversionHelper;
use Core\Database;
use Core\Db;
use User\ItemsModel;
class User
{
@ -911,6 +912,9 @@ class User
return $e;
}
/** Singletone.
* @return User
*/
public static function start(): User
{
if (!isset(self::$flag_one)) {
@ -931,188 +935,6 @@ class User
return $r;
}
public function bsfinish($id, $bu, $di)
{
if ($bu) {
/* в этом бою проверяем юзеров */
$i = 0;
while ($i < count($bu[$i])) {
if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) {
mysql_query(
'UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'
);
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(
'SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1'
)
);
if (isset($pls1['id'])) {
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'
);
$ins = '';
while ($pli = mysql_fetch_array($spi)) {
$ins .= '("' . $di['dn_id'] . '","' . $pli['item_id'] . '","' . time(
) . '","' . $di['x'] . '","' . $di['y'] . '"),';
}
$ins = rtrim($ins, ',');
mysql_query(
'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ' . $ins . ''
);
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pls1['inBot'] . '" LIMIT 1');
mysql_query(
'UPDATE `bs_zv` SET `finish` = "' . time(
) . '" WHERE `id` = "' . $pls1['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pls1['uid'] . '" LIMIT 1');
}
}
$id['users_finish']++;
}
$i++;
}
}
if ($id['users'] - $id['users_finish'] >= 2) {
return;
}
$win = [];
$sp = mysql_query(
'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = "0" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100'
);
while ($pl = mysql_fetch_array($sp)) {
$ur = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'
)
);
$ub = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'
)
);
if (isset($ur['id']) && isset($ub['id']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) {
$win = $ub;
$winr = $ur;
}
}
$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;
} elseif ($winr['level'] < 7) {
$bsep = 5000;
} elseif ($winr['level'] < 8) {
$bsep = 15000;
} elseif ($winr['level'] < 9) {
$bsep = 25000;
} else {
$bsep = 50000;
}
/* Выдаем приз */
$mn = (round($id['money'] / 100 * 85));
mysql_query(
'UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'
);
/* чат */
$cmsg->setTo($winr['login']);
$cmsg->setText(
"Поздравляем! Вы победили в турнире &quot;Башня Смерти&quot;! Получено опыта: $bsep, деньги: $mn кр."
);
$cmsg->setType(6);
$chat->sendMsg($cmsg);
$cmsg->setTo('');
$cmsg->setIsAlert(true);
$cmsg->setText(
"Завершился турнир &quot;Башня Смерти&quot;, победитель турнира: <strong>{$winr['login']}</strong>! Поздравляем!"
);
$cmsg->setType(5);
$chat->sendMsg($cmsg);
$this->addDelo(
1, $uid,
'&quot;<span style="color: #C65F00; ">WinTournament.' . $this->info['city'] . '</span>&quot; (Башня Смерти): Получено &quot;<strong>' . $mn . '</strong> кр.&quot;',
time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0
);
} else {
/* чат */
$cmsg->setIsAlert(true);
$cmsg->setType(5);
$cmsg->setText('Завершился турнир «Башня Смерти», победитель турнира: отсутствует.');
}
$sp = mysql_query(
'SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100'
);
while ($pl = mysql_fetch_array($sp)) {
$ur = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'
)
);
$ub = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'
)
);
if (isset($ub['id'])) {
//del
mysql_query('DELETE FROM `users` WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `stats` WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $ub['id'] . '" LIMIT 500');
//upd
mysql_query(
'UPDATE `bs_zv` SET `finish` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "' . $pl['uid'] . '" LIMIT 1');
}
}
}
//вес предметов у юзера
public function ves($u): array
{
$r = ['now' => 0, 'max' => 0];
if ($u == null) {
//текущий персонаж
$r['now'] = mysql_fetch_array(
mysql_query(
'SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'
)
);
$r['now'] = 0 + $r['now'][0];
$r['max'] = 40 + ($this->stats['os7'] * 10) + $this->stats['s4'] + $this->stats['maxves'] + $this->stats['s1'] * 4;
$r['items'] = mysql_fetch_array(
mysql_query(
'SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'
)
);
$r['items'] = $r['items'][0];
}
return $r;
}
//Переплавка вещей \ рун
public function plavka($id, $type): string
{
@ -1626,75 +1448,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
return $r;
}
/** Для совместимости. Поиск по файлам $this->additem выдаёт сотни отсылок с видимо подключаемымим файлами
* в которых невозможно отследить зависимость и сделать полноценную замену.
* @param $id
* @param $uid
* @param $md
* @param $dn
* @param $mxiznos
* @param $nosudba
* @param $plavka
* @return int|mixed|string
*/
public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null)
{
$rt = -1;
$i = Db::getRow('select * from items_main where id = ?', [$id]);
if (isset($i['id'])) {
$d = Db::getRow('select id, items_id, data from items_main_data where items_id = ?', [$i['id']]);
//новая дата
$data = $d['data'];
if ($i['ts'] > 0 && $nosudba == null) {
$ui = Db::getValue('select login from users where id = ?', [$uid]);
$data .= '|sudba=' . $ui;
}
if ($md != null) {
$data .= $md;
$data = ConversionHelper::dataStringToArray($data); // Если в функции имеются две одинаковых константы SROK?
$data = $this->impStats($data);
}
//предмет с настройками из подземелья
if ($dn != null && $dn['dn_delete'] > 0) {
$i['dn_delete'] = 1;
}
if ($mxiznos > 0) {
$i['iznosMAXi'] = $mxiznos;
}
if ($this->info['dnow'] > 0) {
$room = $this->room['city'];
} else {
$room = $this->info['city'];
}
$args = [
$i['overTypei'],
$i['id'],
$uid,
$data,
$i['iznosMAXi'],
$i['geni'],
$i['magic_inci'],
$room,
$i['dn_delete'] ?? 0,
];
Db::sql(
'insert into items_users (overType, item_id, uid, data, iznosMAX, geniration, magic_inc, maidin, lastUPD, time_create, dn_delete) values (?,?,?,?,?,?,?,?,unix_timestamp(),unix_timestamp(),?)',
$args
);
$rt = Db::lastInsertId() ?? 0;
if ($rt !== 0) {
Db::sql('update items_users set dn_delete = 1 where id = ? and data like ?', [$rt, '%dn_delete=%']);
if ($uid == $this->info['id']) {
$this->stack($rt);
}
$ads = '';
if ($plavka != null) {
$ads = 'Расплавлен предмет : [' . $plavka . ']';
}
//Записываем в личное дело что предмет получен
$this->addDelo(
1,
$uid,
'&quot;AddItems.' . $this->info['city'] . '&quot;: Получен предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads . '',
time(),
$this->info['city'],
'AddItems.' . $this->info['city'] . '',
0,
0
);
}
}
return $rt;
return ItemsModel::addItem($id, $uid, $md, $dn, $mxiznos, $nosudba, $plavka);
}
public function getNum($v)
@ -2683,7 +2450,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$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'] = $this->impStats($statss);
$clon['stats'] = ConversionHelper::arrayToDataString($statss);
unset($statss);
}
if ($luser && $clon['level'] < 8) {
@ -2696,7 +2463,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$statss['m5'] = ceil($statss['m5'] * 0.75);
$statss['za'] = ceil($statss['za'] * 0.25);
$clon['stats'] = $this->impStats($statss);
$clon['stats'] = ConversionHelper::arrayToDataString($statss);
unset($statss);
}
$uid = mysql_insert_id();
@ -2807,7 +2574,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$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'] = $this->impStats($statss);
$bot['stats'] = ConversionHelper::arrayToDataString($statss);
unset($statss);
}
$ins2 = mysql_query(
@ -3650,8 +3417,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
}
$data = $this->impStats($data);
$c_itm_data = $this->impStats($c_itm_data_a);
$data = ConversionHelper::arrayToDataString($data);
$c_itm_data = ConversionHelper::arrayToDataString($c_itm_data_a);
$data .= '|' . $c_itm_data;
}
@ -4982,7 +4749,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
}
//сохраняем данные
$st = $this->impStats($st);
$st = ConversionHelper::arrayToDataString($st);
$upd = mysql_query(
'UPDATE `stats` SET `wipe`="0",`stats`="' . $st . '",`ability`="' . $n1 . '",`skills`="' . $n2 . '",`sskills`="' . $n3 . '",`nskills`="' . $n4 . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
@ -5045,7 +4812,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$po['mf_stats'] -= 1;
$po['add_' . $_GET['mf']] += 1;
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
);
@ -5056,7 +4823,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$po['mf_mod'] -= 1;
$po['add_' . $_GET['mf']] += 1;
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
);
@ -5075,7 +4842,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$po['add_mib' . $s] += 1;
}
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
);
@ -5104,7 +4871,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$po['add_s' . $s] += 1;
}
}
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
}
@ -5189,7 +4956,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
}
}
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $po . '",`so` = "' . $itm['so'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
);
@ -5311,7 +5078,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
}
$po = $this->impStats($po);
$po = ConversionHelper::arrayToDataString($po);
mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
unset($mx1, $mx2, $mx3, $po);
@ -5493,7 +5260,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$i++;
}
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
@ -5593,7 +5360,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
//
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
unset($srune, $irun, $nrune, $ntrune, $addrune, $addrunes);
$tid = mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -5668,7 +5435,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$imposed['sudba'] = 1;
$data = array_merge($data, $imposed);
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -5810,7 +5577,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if (!isset($this->is[$rnda]) && isset($imposed)) {
$data = array_merge($data, $imposed);
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -5862,7 +5629,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
} else {
unset($data['spell_st_val_hp']);
}
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
$this->is['mab1'] = 'Броня головы';
$this->is['mab2'] = 'Броня корпуса';
@ -5944,7 +5711,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
unset($data['sleep_moroz']);
}
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -6012,7 +5779,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
time(), $this->info['city'], 'System.remont.upatack', 0, 0
);
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -6065,7 +5832,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
time(), $this->info['city'], 'System.remont.upatack', 0, 0
);
$this->error = 'Заточка &quot;' . $id['name'] . '&quot; прошла успешно! Колка:' . $data['tya1'] . ' Руб:' . $data['tya2'] . ' Дробь:' . $data['tya3'] . ' Реж:' . $data['tya4'] . ' ';
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
@ -6124,7 +5891,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$data['open'] = 1;
$data = $this->impStats($data);
$data = ConversionHelper::arrayToDataString($data);
mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
@ -6159,7 +5926,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$add['item_inbox'] = $id['id'];
$add['open'] = 1;
$add['nosale'] = 1;
$add = $this->impStats($add);
$add = ConversionHelper::arrayToDataString($add);
//
mysql_query(
'UPDATE `items_users` SET `inGroup` = 0,`data` = "' . $add . '" WHERE `id` = "' . $rune['id'] . '" LIMIT 1'
@ -7030,7 +6797,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$pl['inOdet'] = 0;
$pl['uid'] = $plpo['id'];
unset($po['toclan1'], $po['toclan']);
$pl['data'] = $this->impStats($po);
$pl['data'] = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . mysql_real_escape_string(
$pl['data']
@ -7734,10 +7501,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
while ($pl = mysql_fetch_array($sp)) {
$pl['data'] = ConversionHelper::dataStringToArray($pl['data']);
unset($pl['data']['frompisher']);
$pl['data'] = $this->impStats($pl['data']);
$pl['data'] = ConversionHelper::arrayToDataString($pl['data']);
$itm['data'] = ConversionHelper::dataStringToArray($itm['data']);
unset($itm['data']['frompisher']);
$itm['data'] = $this->impStats($itm['data']);
$itm['data'] = ConversionHelper::arrayToDataString($itm['data']);
if ($pl['data'] == $itm['data'] && $pl['name'] == $itm['name'] && $itm['iznosMAX'] == $pl['iznosMAX'] && $pl['iznosNOW'] == 0 && ($pl['timeOver'] == 0 || $pl['timeOver'] > time(
)) && $pl['gift'] == $itm['gift']) {
$upd = mysql_query(
@ -7891,7 +7658,7 @@ LIMIT 1'
}
if (isset($po['sudba']) && $po['sudba'] == 1) {
$po['sudba'] = $u['login'];
$itm['data'] = $this->impStats($po);
$itm['data'] = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1'
);
@ -7899,7 +7666,7 @@ LIMIT 1'
if (isset($po['zazuby']) && !isset($po['srok']) && ($itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34)) {
//Предметы за зубы со сроком годности
$po['srok'] = 86400 * 7;
$itm['data'] = $this->impStats($po);
$itm['data'] = ConversionHelper::arrayToDataString($po);
mysql_query(
'UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1'
);
@ -9120,24 +8887,6 @@ LIMIT 1'
return $upd ? 1 : 0;
}
public function impStats($m): string
{
$i = 0;
if (array_keys($m)) {
$k = array_keys($m);
} else {
$k = 0;
}
$d = '';
while ($i <= count($k)) {
if ($k[$i] != '') {
$d .= $k[$i] . '=' . $m[$k[$i]] . '|';
}
$i++;
}
return rtrim($d, '|');
}
public function odetItem(int $id, int $uid)
{
if ($uid != 0) {
@ -9197,7 +8946,7 @@ LIMIT 1'
$notr++;
} elseif ($tr['sudba'] == '0') {
$tr['sudba'] = $this->info['login'];
$itm['data'] = $this->impStats($tr);
$itm['data'] = ConversionHelper::arrayToDataString($tr);
$msb = ',`data`="' . $itm['data'] . '"';
}
}
@ -11468,7 +11217,7 @@ LIMIT 1'
$tst = ConversionHelper::dataStringToArray($this->info['stats']);
$tst['s4'] += $lvl['vinos'];
$tst['s7'] += $lvl['duh'];
$this->info['stats'] = $this->impStats($tst);
$this->info['stats'] = ConversionHelper::arrayToDataString($tst);
$this->info['level'] = $lvl['nextLevel'];
$this->stats['levels'] = $lvln;
@ -11709,7 +11458,7 @@ LIMIT 1'
$r = 'Не удалось';
} elseif (!isset($po['toclan'])) {
$po['toclan'] = $user['clan'] . '#' . $user['id'];
$item_['data'] = $this->impStats($po);
$item_['data'] = ConversionHelper::arrayToDataString($po);
if (mysql_query(
'UPDATE `items_users` SET `lastUPD` = "' . time(
) . '", `uid` = "-21' . $user['clan'] . '", `data` = "' . $item_['data'] . '" WHERE `id` = "' . $id . '" LIMIT 1'
@ -11842,7 +11591,7 @@ LIMIT 1'
}
}
unset($po['toclan']);
$pl['data'] = $this->impStats($po);
$pl['data'] = ConversionHelper::arrayToDataString($po);
$col = $this->itemsX(((int)$pl['id']));
$it_n = mysql_fetch_array(
mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"')

View File

@ -2,6 +2,7 @@
namespace User;
use Core\ConversionHelper;
use Core\Db;
use User;
@ -60,4 +61,89 @@ class ItemsModel
[$id, User::start()->info['id'], $coldel]
);
}
//вес предметов у юзера
public static function inventoryWeightAndItemQuantity(): array
{
$uid = User::start()->info['id'];
$stats = User::start()->stats;
return [
'now' => Db::getValue('select sum(massa) from items_users left join items_main on item_id = items_main.id where uid = ? and (`delete` = 0 or (`delete` = 1000 and inGroup > 0)) and inShop = 0 and inOdet = 0', [$uid]),
'max' => 40 + ($stats['os7'] * 10) + $stats['s4'] + $stats['maxves'] + $stats['s1'] * 4,
'items' => Db::getValue('select count(*) from items_users where uid = ? and `delete` = 0 and inShop = 0 and inOdet = 0', [$uid]),
];
}
public static function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null)
{
$user = User::start();
$rt = -1;
$i = Db::getRow('select * from items_main where id = ?', [$id]);
if (isset($i['id'])) {
$d = Db::getRow('select id, items_id, data from items_main_data where items_id = ?', [$i['id']]);
//новая дата
$data = $d['data'];
if ($i['ts'] > 0 && $nosudba == null) {
$ui = Db::getValue('select login from users where id = ?', [$uid]);
$data .= '|sudba=' . $ui;
}
if ($md != null) {
$data .= $md;
$data = ConversionHelper::dataStringToArray($data); // Если в функции имеются две одинаковых константы SROK?
$data = ConversionHelper::arrayToDataString($data);
}
//предмет с настройками из подземелья
if ($dn != null && $dn['dn_delete'] > 0) {
$i['dn_delete'] = 1;
}
if ($mxiznos > 0) {
$i['iznosMAXi'] = $mxiznos;
}
if ($user->info['dnow'] > 0) {
$room = $user->room['city'];
} else {
$room = $user->info['city'];
}
$args = [
$i['overTypei'],
$i['id'],
$uid,
$data,
$i['iznosMAXi'],
$i['geni'],
$i['magic_inci'],
$room,
$i['dn_delete'] ?? 0,
];
Db::sql(
'insert into items_users (overType, item_id, uid, data, iznosMAX, geniration, magic_inc, maidin, lastUPD, time_create, dn_delete) values (?,?,?,?,?,?,?,?,unix_timestamp(),unix_timestamp(),?)',
$args
);
$rt = Db::lastInsertId() ?? 0;
if ($rt !== 0) {
Db::sql('update items_users set dn_delete = 1 where id = ? and data like ?', [$rt, '%dn_delete=%']);
if ($uid == $user->info['id']) {
$user->stack($rt);
}
$ads = '';
if ($plavka != null) {
$ads = 'Расплавлен предмет : [' . $plavka . ']';
}
//Записываем в личное дело что предмет получен
$user->addDelo(
1,
$uid,
'&quot;AddItems.' . $user->info['city'] . '&quot;: Получен предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads,
time(),
$user->info['city'],
'AddItems.' . $user->info['city'],
0,
0
);
}
}
return $rt;
}
}

View File

@ -200,7 +200,7 @@ class Register
);
foreach ($this->classBonuses[$this->class]['items'] as $item) {
$itemId = $u->addItem($item, $uid);
$itemId = \User\ItemsModel::addItem($item, $uid);
Db::sql(
'update items_users
set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1)

View File

@ -171,7 +171,7 @@ if (isset($s[1]) && $s[1] == '101/laba1') {
) . '","obj_act' . $obj['id'] . '_lab","' . $obj['x'] . '","' . $obj['y'] . '"
)'
);
$u->addItem($vad['itm']['id'], $u->info['id'], '|frompisher=101');
\User\ItemsModel::addItem($vad['itm']['id'], $u->info['id'], '|frompisher=101');
$r = 'Вы создали предмет &quot;' . $vad['itm']['name'] . '&quot;! Расплавив ресурсы ...';
if ($u->info['sex'] == 0) {
$vad['text'] = '<b>' . $u->info['login'] . '</b> создал предмет &quot;' . $vad['itm']['name'] . '&quot; при помощи &quot;' . $obj['name'] . '&quot;.';

View File

@ -34,7 +34,7 @@ if(isset($s[1]) && $s[1] == '108/fontan2') {
"'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'")');
$r = 'Опустив пустую бутылку в фонтан вы наполнили её.';
$u->deleteItem(intval($vad['bt']['id']),$u->info['id'],1);
$u->addItem(round(2417),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 3);
\User\ItemsModel::addItem(round(2417),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 3);
}
unset($vad);

View File

@ -23,7 +23,7 @@ if(isset($s[1]) && $s[1] == '108/fontan3') {
mysql_query('INSERT INTO `dungeon_actions` (`dn`, `time`, `x`, `y`, `uid`, `vars`, `vals`) VALUES (
"'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'")');
//4041
$u->addItem(round(4041),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 1);
\User\ItemsModel::addItem(round(4041),$u->info['id'],'|musor=2|noremont=1|nosale=1',108, 1);
$r = 'Вы получили Снадобье Забытых Мастеров';
}
unset($vad);

View File

@ -22,7 +22,7 @@ if(isset($s[1]) && $s[1] == '12/fontan1') {
$r = 'Вы воспользовались &quot;Ключ №1&quot;. Опустив пустую бутылку в фонтан вы наполнили её.';
$u->deleteItem(intval($vad['key']['id']), $u->info['id'], 1);
$u->deleteItem(intval($vad['bottle']['id']), $u->info['id'], 1);
$u->addItem(round(4403), $u->info['id'], '|musor=2|noremont=1|nosale=1',12);
\User\ItemsModel::addItem(round(4403), $u->info['id'], '|musor=2|noremont=1|nosale=1',12);
}
unset($vad);
}

View File

@ -37,7 +37,7 @@ if( isset($s[1]) && $s[1] == '12/fontan2' ) {
mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( "'.$u->info['id'].'","'.$u->info['dnow'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'", "use_fontan","2" )'); // Выпили раз, вот и хватит с вас!
$r = 'Опустив пустую бутылку в фонтан вы наполнили её.';
$u->deleteItem(intval($vad['bt']['id']),$u->info['id'],1); // Удаляем Пустая Бутылка = 2.
$u->addItem(round(1186),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Стойкости 1186
\User\ItemsModel::addItem(round(1186),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Стойкости 1186
}
unset($vad);
}

View File

@ -51,7 +51,7 @@ if( isset($s[1]) && $s[1] == '12/fontan3' ) {
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['gems']['query'])).'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['bt']['id'])).'" LIMIT 1');
$u->addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Отрицания 1188
\User\ItemsModel::addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Отрицания 1188
}
unset($vad);
}

View File

@ -38,7 +38,7 @@ if(isset($s[1]) && $s[1] == '12/fontan4') {
$r = 'Опустив пустую бутылку в фонтан вы наполнили её.';
$vad['drug'] = array(0 => 2588, 1 => 2590, 2 => 2589, 3 => 2145);
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['bottle']['id'])).'" LIMIT 1');
$u->addItem(round($vad['drug'][rand(0,3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3);
\User\ItemsModel::addItem(round($vad['drug'][rand(0,3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3);
}
unset($vad);
}

View File

@ -15,7 +15,7 @@ if( isset($s[1]) && $s[1] == '15/shaiba' ) {
mysql_query('DELETE FROM `dungeon_obj` WHERE `id` = "'.$obj['id'].'" LIMIT 1');
//Добавляем шайбу в инвентарь игрока
$vad['itm'] = $u->addItem(4910,$u->info['id']);
$vad['itm'] = \User\ItemsModel::addItem(4910,$u->info['id']);
if($vad['itm'] > 0) {
mysql_query('UPDATE `items_users` SET `gift` = "Шайба" WHERE `id` = "'.$vad['itm'].'" LIMIT 1');
}

View File

@ -27,7 +27,7 @@ function combineItems(array $parts, int $result, string $data = '|frompisher=12'
$obj = Db::getRow('select * from items_main where id = ?', [$result]);
$checkItems = ItemsModel::hasNoItemsInInventory($parts);
if (empty($checkItems)) {
$u->addItem($result, $u->info['id'], $data, $obj);
\User\ItemsModel::addItem($result, $u->info['id'], $data, $obj);
foreach ($parts as $part) {
ItemsModel::deleteItemsById($part);
}

View File

@ -15,40 +15,40 @@ if(date('Y')==2013 || $u->info['id'] == 1) {
7. Новогодний Эликсир
*/
//Снежок 0/13 (x1)
$idit = $u->addItem(1000,$u->info['id']);
$idit = \User\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 = $u->addItem(997,$u->info['id']);
$idit = \User\ItemsModel::addItem(997,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1');
//Новогодний эликсир (x1)
$idit = $u->addItem(2870,$u->info['id']);
$idit = \User\ItemsModel::addItem(2870,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1');
//Звездное сияние (x1)
$idit = $u->addItem(1462,$u->info['id']);
$idit = \User\ItemsModel::addItem(1462,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "7" WHERE `id` = "'.$idit.'" LIMIT 1');
//Открытка (x1)
$idit = $u->addItem(996,$u->info['id']);
$idit = \User\ItemsModel::addItem(996,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2013, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1');
//Нападалка 0/13 (x1)
$idit = $u->addItem(874,$u->info['id']);
$idit = \User\ItemsModel::addItem(874,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "13" WHERE `id` = "'.$idit.'" LIMIT 1');
//Кольцо жизни (x1)
$idit = $u->addItem(2101,$u->info['id'],'|noremont=1|srok=1209600|sudba='.$u->info['login']);
$idit = \User\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 = $u->addItem(2710,$u->info['id']);
$idit = \User\ItemsModel::addItem(2710,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1');
$idit = $u->addItem(2710,$u->info['id']);
$idit = \User\ItemsModel::addItem(2710,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1');
$idit = $u->addItem(2710,$u->info['id']);
$idit = \User\ItemsModel::addItem(2710,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год" WHERE `id` = "'.$idit.'" LIMIT 1');
$u->error = 'Вы успешно использовали &quot;'.$itm['name'].'&quot;. В инвентарь добавлены подарки. С Новым, 2013, Годом!';

View File

@ -15,38 +15,38 @@ if(date('Y')==2023) {
7. Новогодний Эликсир
*/
//рыба (x1)
$idit = $u->addItem(5009,$u->info['id']);
$idit = \User\ItemsModel::addItem(5009,$u->info['id']);
if($idit > 0) {
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1');
//мастера
$idit = $u->addItem(4041,$u->info['id']);
$idit = \User\ItemsModel::addItem(4041,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1');
//искуства
$idit = $u->addItem(4948,$u->info['id']);
$idit = \User\ItemsModel::addItem(4948,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "3" WHERE `id` = "'.$idit.'" LIMIT 1');
//жж6
$idit = $u->addItem(3101,$u->info['id']);
$idit = \User\ItemsModel::addItem(3101,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "5" WHERE `id` = "'.$idit.'" LIMIT 1');
//Открытка (x1)
$idit = $u->addItem(996,$u->info['id']);
$idit = \User\ItemsModel::addItem(996,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Новый Год" , `gtxt1` = "Администрация проекта поздравляет Вас с Новым, 2023, Годом!" WHERE `id` = "'.$idit.'" LIMIT 1');
//точилка
$idit = $u->addItem(6457,$u->info['id']);
$idit = \User\ItemsModel::addItem(6457,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1');
//чек на 100 екров
$idit = $u->addItem(5023,$u->info['id']);
$idit = \User\ItemsModel::addItem(5023,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "1" WHERE `id` = "'.$idit.'" LIMIT 1');
//цепь защитника
$idit = $u->addItem(6459,$u->info['id']);
$idit = \User\ItemsModel::addItem(6459,$u->info['id']);
mysql_query('UPDATE `items_users` SET `gift` = "Старый Год",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1');

View File

@ -80,7 +80,7 @@ if(!defined('GAME'))
70 => '10036'
);
$idve=$idv[rand(0,count($idv)-1)];
$u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']);
\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'].'';

View File

@ -87,7 +87,7 @@ if(!defined('GAME'))
78 => '10035'
);
$idve=$idv[rand(0,count($idv)-1)];
$u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']);
\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'].'';

View File

@ -93,7 +93,7 @@ if(!defined('GAME'))
84 => '10037'
);
$idve=$idv[rand(0,count($idv)-1)];
$u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']);
\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'].'';

View File

@ -17,13 +17,13 @@ $rnd0['itm3'] = $rnd0[rand(0,count($rnd0))];
$rnd0['itm1'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm1']).'" LIMIT 1'));
$rnd0['itm2'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm2']).'" LIMIT 1'));
$u->addItem($rnd0['itm1']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']);
$u->addItem($rnd0['itm2']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']);
\User\ItemsModel::addItem($rnd0['itm1']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']);
\User\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{
$u->addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']);
\User\ItemsModel::addItem($rnd0['itm3']['id'],$u->info['id'],'|srok=1209600|sudba='.$u->info['login']);
}
$u->deleteItem($itm['id'],$u->info['id']);

View File

@ -98,7 +98,7 @@ $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
78 => '10035'
);
$idve=$idv[rand(0,count($idv)-1)];
$u->addItem($idve,$u->info['id'],'|frompisher=1|sudba='.$u->info['login']);
\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'].'';

View File

@ -5,15 +5,15 @@ if(!defined('GAME'))
}
//лечение легких травм
$ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$ov_item = \User\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');
//пропуск забытых
$ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].'');
$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');
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');

View File

@ -5,24 +5,24 @@ if(!defined('GAME'))
}
//лечение легких травм
$ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$ov_item = \User\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');
//пропуск забытых
$ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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');
//
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');

View File

@ -5,36 +5,36 @@ if(!defined('GAME'))
}
//лечение легких травм
$ov_item = $u->addItem(4412,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$ov_item = \User\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');
//пропуск забытых
$ov_item = $u->addItem(2412,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(3101,$u->info['id'],'|srok=3600|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(4413,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5035,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5039,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(4414,$u->info['id'],'|srok=43200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5036,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5037,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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 = $u->addItem(5038,$u->info['id'],'|srok=43200|battleUseZd=7200|sudba='.$u->info['login'].'');
$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');

View File

@ -49,7 +49,7 @@ if($goodkast == 1) {
);");
}
//
$u->addItem( 4752 , $u->info['id'] , '|sudba=1' );
\User\ItemsModel::addItem( 4752 , $u->info['id'] , '|sudba=1' );
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
//
}

View File

@ -16,7 +16,7 @@ if( $u->info['twink'] != 0 ) {
//Выдаем еще и кристалл
$test_itm = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 1204 AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
if( !isset($test_itm['id']) ) {
$u->addItem(1204,$u->info['id']);
\User\ItemsModel::addItem(1204,$u->info['id']);
}
}
*/

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -55,7 +55,7 @@ if( isset($pvr['pl']['priem']) && isset($pvr['pl']['id']) ) {
$pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
$pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']);
if( $pvr['pl']['priem']['id'] == 260 ) {
$prv['color2'] = '000000';

View File

@ -82,7 +82,7 @@ if( true == true ) {
$pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
$pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']);
if( $pvr['pl']['priem']['id'] == 260 ) {
$prv['color2'] = '000000';

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -18,7 +18,7 @@ else
if( isset($pvr['mg']['id']) ) {
//Действие при клике
$pvr['hp'] = 0;
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -18,7 +18,7 @@ if (
$cup = true;
} else {
//Действие при клике
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
$pvr['name'] = $pvr['mg']['name'];
// Урон = 150% оставшегося урона (урон за ход * количество ходов * 150/100).

View File

@ -106,7 +106,7 @@ if( isset($pr_momental_this)) {
$pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['pl']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
$pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']);
if( $pvr['pl']['priem']['id'] == 260 ) {
$prv['color2'] = '000000';

View File

@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['mp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -13,7 +13,7 @@ if( isset($pvr['mg']['id']) ) {
//$pvr['hp'] = floor(144/3*$pvr['mg']['x']);
/*$pvr['hp'] = 1;*/
//
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
//
/**/
if( $pvr['data']['add_mg2static_points'][0] < 1 ) {
@ -73,7 +73,7 @@ if( isset($pvr['mg']['id']) ) {
$pvr['edt'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
$pvr['edt'] = \Core\ConversionHelper::arrayToDataString($pvr['edt']);
mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "'.$pvr['edt'].'" WHERE `id` = "'.$pvr['mg']['id'].'" LIMIT 1');
//Отнимаем тактики

View File

@ -11,7 +11,7 @@ if (!isset($pvr['mg']['id'])) {
echo '<b style="color: red">На персонаже нет Статики</b>';
$cup = true;
} else {
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
//
/**/
if ($pvr['data']['add_mg2static_points'] < 1) {

View File

@ -35,7 +35,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
$prv['priem_th'] = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'];
//действия
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -74,7 +74,7 @@ if( isset($pr_momental_this)) {
$prv['priem_th'] = $btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['id'];
//
$pvr['hp'] = 1;
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u2]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
//
//$pvr['hp'] = floor($btl->stats[$btl->uids[$u2]]['hpAll']/50);

View File

@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
}
//
/*
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
}
//
/*
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
}
//
/*
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];
/*//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = rand(15,25);
/*//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -42,7 +42,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];
/*//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $uid , $pvr['hp'] );
//

View File

@ -40,7 +40,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -41,7 +41,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -36,7 +36,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -39,7 +39,7 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//действия
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -37,7 +37,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
//
$pvr['hp'] = 1;
//
$pvr['data'] = $priem->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']);
$pvr['hp'] = floor($pvr['data']['add_atgm'][0]);
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] );
//

View File

@ -12,7 +12,7 @@ function mg2static_points($uid,$st) {
$mg['data'] = \Core\ConversionHelper::dataStringToArray($mg['data']);
$mg['data']['add_mg2static_points']++;
$mg['data']['add_zm2proc']--;
$mg['data'] = $u->impStats($mg['data']);
$mg['data'] = \Core\ConversionHelper::arrayToDataString($mg['data']);
mysql_query('UPDATE `eff_users` SET `data` = "'.$mg['data'].'" WHERE `id` = "'.$mg['id'].'" LIMIT 1');
}
}
@ -114,7 +114,7 @@ if(isset($hod))
$mg['data']['add_mg2static_points'] = 0;
$mg['data']['add_zm2proc'] = 0;
$mg['data'] = $u->impStats($mg['data']);
$mg['data'] = \Core\ConversionHelper::arrayToDataString($mg['data']);
echo '<font color=red><b>Прием &quot;'.$pl['name'].'&quot; успешно использован.</b></font>';
mysql_query('UPDATE `eff_users` SET `data` = "'.$mg['data'].'" WHERE `id` = "'.$mg['id'].'" LIMIT 1');

View File

@ -19,7 +19,7 @@ if($st['usefromfile']=='bloodring' && $u->info['battle'] > 0 && $u->info['hpNow'
}else{
mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 15 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->info['tactic6'] -= 15;
$u->addItem(3134,$u->info['id'],'|sudba='.$u->info['login']);
\User\ItemsModel::addItem(3134,$u->info['id'],'|sudba='.$u->info['login']);
$ins = mysql_query('INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`) VALUES
("-1",228,"invoke_create_lesserbloodstone.gif",22,"'.$u->info['id'].'","Кровавый Сбор","","30","77","priem")');
$u->error = 'Вы успешно использовали заклинание &quot;Кровавый сбор&quot;';

View File

@ -25,13 +25,13 @@ if($st['usefromfile']=='bloodring2' && $u->info['battle'] > 0 && $u->info['hpNow
$st['td_cast']++;
$stimp = $u->impStats($st);
$stimp = \Core\ConversionHelper::arrayToDataString($st);
mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($stimp).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->info['tactic6'] -= 5;
//$u->addItem(3136,$u->info['id'],'|sudba='.$u->info['login']);
//\User\ItemsModel::addItem(3136,$u->info['id'],'|sudba='.$u->info['login']);
//Если эффект есть, тогда добавляем к нему +1 каст (Максимум 6)
if(isset($bu['id'])) {

View File

@ -9,7 +9,7 @@ if ($ple['file_finish'] == 'bloodring2_end' && $this->users[$i]['team'] == $this
$ple['x'] = 6;
}
while ($i1k < $ple['x']) {
$u->addItem(3136, $this->users[$i]['id'], '|sudba=' . $this->users[$i]['login']);
\User\ItemsModel::addItem(3136, $this->users[$i]['id'], '|sudba=' . $this->users[$i]['login']);
$i1k++;
}
if ($ple['x'] > 1) {

View File

@ -1420,7 +1420,7 @@ elseif($this->users[$this->uids[$uid1]]['bot_id'] == 254) {
$i56++;
}
$inf = rtrim($inf, ', ');
$j1 = $u->impStats($j1);
$j1 = \Core\ConversionHelper::arrayToDataString($j1);
$pld[0] = ' x'.($mpr['x']+1);
$upd = mysql_query('UPDATE `eff_users` SET `data` = "'.$j1.'", `x` = `x`+1 WHERE `id` = "'.$mpr['id'].'" LIMIT 1');
if($upd) {

View File

@ -46,7 +46,7 @@ if(isset($test['id'])) {
//все ок
if( rand(0,100) < $pvr['ch'] ) {
$txt .= '<br><b><font color=red>Вы получили &quot;Зеленый Том Знаний&quot;</b></font>';
$pvr['itm'] = $u->addItem(4740,$u->info['id']);
$pvr['itm'] = \User\ItemsModel::addItem(4740,$u->info['id']);
//
mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
//

View File

@ -46,7 +46,7 @@ if(isset($test['id'])) {
//все ок
if( rand(0,100) < $pvr['ch'] ) {
$txt .= '<br><b><font color=red>Вы получили &quot;Желтый Том Знаний&quot;</b></font>';
$pvr['itm'] = $u->addItem(4741,$u->info['id']);
$pvr['itm'] = \User\ItemsModel::addItem(4741,$u->info['id']);
//
mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
//

View File

@ -46,7 +46,7 @@ if(isset($test['id'])) {
//все ок
if( rand(0,100) < $pvr['ch'] ) {
$txt .= '<br><b><font color=red>Вы получили &quot;Красный Том Знаний&quot;</b></font>';
$pvr['itm'] = $u->addItem(4742,$u->info['id']);
$pvr['itm'] = \User\ItemsModel::addItem(4742,$u->info['id']);
//
mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
//

View File

@ -45,7 +45,7 @@ if(isset($test['id'])) {
//все ок
if( rand(0,100) < $pvr['ch'] ) {
$txt .= '<br><b><font color=red>Вы получили &quot;Синий Том Знаний&quot;</b></font>';
$pvr['itm'] = $u->addItem(4743,$u->info['id']);
$pvr['itm'] = \User\ItemsModel::addItem(4743,$u->info['id']);
//
mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
//

View File

@ -45,7 +45,7 @@ if(isset($test['id'])) {
//все ок
if( rand(0,100) < $pvr['ch'] ) {
$txt .= '<br><b><font color=red>Вы получили &quot;Белый Том Знаний&quot;</b></font>';
$pvr['itm'] = $u->addItem(4744,$u->info['id']);
$pvr['itm'] = \User\ItemsModel::addItem(4744,$u->info['id']);
//
mysql_query('UPDATE `items_users` SET `gift` = "Гильдия Алхимиков" WHERE `id` = "'.mysql_real_escape_string($pvr['itm']).'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
//

View File

@ -37,9 +37,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -62,9 +62,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -86,9 +86,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -104,9 +104,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -128,9 +128,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -152,9 +152,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20
@ -176,9 +176,9 @@ if (!isset($test['id'])) {
'UPDATE `actions` SET `vals`= 0 WHERE `uid` = "' . $u->info['id'] . '" AND `vars`= "day_quest"'
);
if ($u->info['level'] < 12) {
$u->addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(10020, $u->info['id'], '|sudba=' . $u->info['login']);
} else {
$u->addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
\User\ItemsModel::addItem(6470, $u->info['id'], '|sudba=' . $u->info['login']);
}
mysql_query('UPDATE `users_achiv` SET `zb`= `zb`+1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
StatsModel::addRepexpById($u->info['id'], 50); //Репутация +20

View File

@ -33,7 +33,7 @@ $itmm = mysql_fetch_array(mysql_query('SELECT COUNT(*) as total FROM `items_user
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;');
$u->addItem(6167,$u->info['id'],'|sudba='.$u->info['login']);
\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 .= '<br><i>Держи свиток сынок.</i><br>Спасибо за пыль но у тебя еще осталось: '.$itmm['total'].' шт.';
$u->addDelo(1,$u->info['id'],'&quot;<font color=green>Babka.'.$u->info['city'].'</font>&quot;: Поменял у бабки пыль на свиток!',time(),$u->info['city'],'Babka.'.$u->info['city'].'',1,0);

View File

@ -130,7 +130,7 @@ if (!isset($user) || $user['id'] != $u->info['id']) {
echo 'Error';
} else {
$idve = $droplist['idgame'];
$u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']);
\User\ItemsModel::addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']);
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1'));
$titm = mysql_query(
'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $user['id'] . '","' . time(

View File

@ -57,7 +57,7 @@ if (!isset($user) || $user['id'] != $u->info['id']) {
echo 'Error';
} else {
$idve = $droplist['idgame'];
$u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']);
\User\ItemsModel::addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']);
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1'));
$u->info['money2'] = $u->info['money2'] - 5;
mysql_query('UPDATE `users` SET `money2`= `money2` - 5 WHERE `id` = "' . $u->info['id'] . '"');

View File

@ -138,7 +138,7 @@ if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
$act = -2;
$act2 = 0;
$u->stats = $u->getStats($u->info['id'], 0);
$u->aves = $u->ves(null);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
if (!isset($u->stats['act'])) {
$u->stats['act'] = 0;
}
@ -365,7 +365,7 @@ if ($magic->youuse > 0) {
//Получение статов
if ($act != -2) {
$u->stats = $u->getStats($u->info['id'], 0, 1);
$u->aves = $u->ves(null);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
if (!isset($sleep['id'])) {
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
}
@ -532,11 +532,11 @@ foreach ($sp as $pl) {
//выдаем предмет
$glid = 1;
if ($pl['data'] == '0') {
$u->addItem(
\User\ItemsModel::addItem(
$pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room']
);
} else {
$u->addItem(
\User\ItemsModel::addItem(
$pl['item_id'], $u->info['id'],
'|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data']
);

View File

@ -153,7 +153,7 @@ if ($u->info['battle_text'] != '') {
$act = -2;
$act2 = 0;
$u->stats = $u->getStats($u->info['id'], 0);
$u->aves = $u->ves(null);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
if (!isset($u->stats['act'])) {
$u->stats['act'] = 0;
}
@ -221,7 +221,7 @@ if ($u->info['repass'] > 0 && $u->info['id'] != 5433446) {
//Получение статов
if ($act != -2) {
$u->stats = $u->getStats($u->info['id'], 0, 1);
$u->aves = $u->ves(null);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
if ($act2 != -2 && $act == -2) {
$act = $act2;

View File

@ -40,7 +40,7 @@ foreach ($item_light as $item) {
}
$vix = $vix[0];
if ($item[1] - $vix > 0 && $_GET['take_item_light_panel'] == $itm['id']) {
$nitm = $u->addItem($itm['id'], $u->info['id'], $item[5]);
$nitm = \User\ItemsModel::addItem($itm['id'], $u->info['id'], $item[5]);
$u->addAction(time(), 'dark_itm' . $itm['id'], '');
echo '<span style="color: red">Предмет &quot;<b>' . $itm['name'] . '</b>&quot; перемещен к Вам в инвентарь!</span><br><br>';
}

View File

@ -56,7 +56,7 @@ $vi = array(
}
if($item_dark[$dark_panel][$i][1]-$vix > 0) {
if(isset($_GET['take_item_dark_panel']) && $_GET['take_item_dark_panel'] == $itm['id']) {
$nitm = $u->addItem($itm['id'],$u->info['id'],$item_dark[$dark_panel][$i][5]);
$nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_dark[$dark_panel][$i][5]);
if($item_dark[$dark_panel][6]>0) {
}
$u->addAction(time(),'dark_itm'.$itm['id'],'');

View File

@ -56,7 +56,7 @@ $vi = array(
}
if($item_neytral[$neytral_panel][$i][1]-$vix > 0) {
if(isset($_GET['take_item_neytral_panel']) && $_GET['take_item_neytral_panel'] == $itm['id']) {
$nitm = $u->addItem($itm['id'],$u->info['id'],$item_neytral[$neytral_panel][$i][5]);
$nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_neytral[$neytral_panel][$i][5]);
if($item_neytral[$neytral_panel][6]>0) {
}
$u->addAction(time(),'dark_itm'.$itm['id'],'');

Some files were not shown because too many files have changed in this diff Show More