75 lines
3.2 KiB
PHP
75 lines
3.2 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'] = $this->lookStatsArray($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);
|