75 lines
3.4 KiB
PHP
75 lines
3.4 KiB
PHP
<?php /**@var $this priems*/
|
||
if (!defined('GAME')) {
|
||
die();
|
||
}
|
||
/*
|
||
Прием: Заряд: Собрать
|
||
*/
|
||
$pvr = array();
|
||
$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'])) {
|
||
echo '<b style="color: red">На персонаже нет Статики</b>';
|
||
$cup = true;
|
||
} else {
|
||
$pvr['data'] = \Core\ConversionHelper::dataStringToArray($pvr['mg']['data']);
|
||
//
|
||
/**/
|
||
if ($pvr['data']['add_mg2static_points'] < 1) {
|
||
echo '<b style="color: red">Статика не собрала достаточного количества зарядов</b>';
|
||
$cup = true;
|
||
} else {
|
||
$prv['text'] = $btl->addlt(1, 21, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL);
|
||
|
||
//Цвет приемаы
|
||
$prv['color'] = $this->logColor[$this::AIR];
|
||
|
||
//Хиляем ману
|
||
$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']);
|
||
|
||
//Удаляем 1 негативный эффект
|
||
$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);
|
||
}
|
||
|
||
$prv['text2'] = '{tm1} ' . $prv['text'] . ' через {u2}. <font Color=' . $prv['color'] . '><b>' . $pvr['mpSee'] . '</b></font> [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] (мана)';
|
||
|
||
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], '<font color^^^^#' . $prv['color'] . '>Заряд: Собрать</font>', $prv['text2'], ($btl->hodID + 1));
|
||
|
||
$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']);
|
||
}
|
||
}
|
||
unset($pvr);
|