game/_incl_data/class/priem/263.php

75 lines
3.4 KiB
PHP
Raw Normal View History

<?php /**@var $this priems */
2022-12-19 18:26:14 +00:00
if (!defined('GAME')) {
die();
2022-06-06 21:30:34 +00:00
}
/*
2023-01-10 16:29:32 +00:00
Прием: Заряд: Собрать
2022-06-06 21:30:34 +00:00
*/
$pvr = [];
2022-12-19 18:26:14 +00:00
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . ' AND `v2` = 260 ORDER BY `id` DESC LIMIT 1'));
if (!isset($pvr['mg']['id'])) {
2023-01-10 16:29:32 +00:00
echo '<b style="color: red">На персонаже нет Статики</b>';
2022-12-19 18:26:14 +00:00
$cup = true;
} else {
$pvr['data'] = Helper\Conversion::dataStringToArray($pvr['mg']['data']);
2022-12-19 18:26:14 +00:00
//
/**/
if ($pvr['data']['add_mg2static_points'] < 1) {
2023-01-10 16:29:32 +00:00
echo '<b style="color: red">Статика не собрала достаточного количества зарядов</b>';
2022-12-19 18:26:14 +00:00
$cup = true;
} else {
$prv['text'] = $btl->addlt(1, 21, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], null);
2022-12-19 18:26:14 +00:00
2023-01-10 16:29:32 +00:00
//Цвет приемаы
2022-12-19 18:26:14 +00:00
$prv['color'] = $this->logColor[$this::AIR];
2023-01-10 16:29:32 +00:00
//Хиляем ману
2022-12-19 18:26:14 +00:00
$pvr['mp'] = $pvr['data']['add_mg2static_points'] * (3 * $this->u->info['level']);
//
$pvr['mpSee'] = '';
$pvr['mpNow'] = floor($btl->stats[$btl->uids[$this->u->info['id']]]['mpNow']);
$pvr['mpAll'] = $btl->stats[$btl->uids[$this->u->info['id']]]['mpAll'];
$pvr['mpTr'] = $pvr['mpNow'] + $pvr['mp'];
if ($pvr['mpTr'] > $pvr['mpAll']) {
$pvr['mp'] = $pvr['mp'] - ($pvr['mpTr'] - $pvr['mpAll']);
}
$pvr['mpNow'] = floor($pvr['mpNow'] + $pvr['mp']);
if ($pvr['mp'] > 0) {
$pvr['mpSee'] = '+' . $pvr['mp'];
} else {
$pvr['mpSee'] = $pvr['mp'];
}
if (empty($pvr['mpSee'])) {
$pvr['mpSee'] = '--';
}
$this->u->stats['mpNow'] = $pvr['mpNow'];
$this->u->info['mpNow'] = $pvr['mpNow'];
$btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow'];
$btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow'];
mysql_query('UPDATE `stats` SET `mpNow` = ' . $this->u->stats['mpNow'] . ' WHERE `id` = ' . $this->u->info['id']);
2023-01-10 16:29:32 +00:00
//Удаляем 1 негативный эффект
2022-12-19 18:26:14 +00:00
$pvr['sp'] = mysql_query('select * from eff_users left join priems on priems.id = v2 where `delete` = 0 and neg > 0 and v1 = \'priem\' and v2 != 201 and uid = ' . $this->u->info['id']);
$pvr['pl'] = mysql_fetch_array($pvr['sp']);
shuffle($pvr['pl']);
$pvr['pl'] = $pvr['pl'][0];
$pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . $pvr['pl']['v2']));
if (isset($pvr['pl']['priem'])) {
$btl->delPriem($pvr['pl'], $btl->users[$btl->uids[$this->u->info['id']]], 100);
}
2023-01-10 16:29:32 +00:00
$prv['text2'] = '{tm1} ' . $prv['text'] . ' через {u2}. <font Color=' . $prv['color'] . '><b>' . $pvr['mpSee'] . '</b></font> [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] (мана)';
2022-12-19 18:26:14 +00:00
2023-01-10 16:29:32 +00:00
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], '<font color^^^^#' . $prv['color'] . '>Заряд: Собрать</font>', $prv['text2'], ($btl->hodID + 1));
2022-12-19 18:26:14 +00:00
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
$pvr['edt'] = $this->changeStatsData($pvr['mg']['data'], ['add_mg2static_points' => 0]);
mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "' . $pvr['edt'] . '" WHERE `id` = ' . $pvr['mg']['id']);
}
2022-06-06 21:30:34 +00:00
}
unset($pvr);