game/_incl_data/class/Priem/333.php

80 lines
2.1 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if(!defined('GAME')) {
die();
}
/*
2023-01-10 16:29:32 +00:00
эффект волшебая вода
2022-06-06 21:30:34 +00:00
*/
$pvr = array();
//
if( isset($pr_used_this) && isset($pr_moment) ) {
$fx_priem = function( $id , $at , $uid, $j_id ) {
2023-01-10 16:29:32 +00:00
// -- начало приема
2022-06-06 21:30:34 +00:00
global $u, $btl;
//
2023-01-10 16:29:32 +00:00
//параметры приема
2022-06-06 21:30:34 +00:00
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid1 ) {
$a = 1;
$b = 2;
2023-11-05 02:46:07 +00:00
$u1 = $uid1;
$u2 = $uid2;
2022-06-06 21:30:34 +00:00
}elseif( $uid == $uid2 ) {
$a = 2;
$b = 1;
2023-11-05 02:46:07 +00:00
$u1 = $uid2;
$u2 = $uid1;
2022-06-06 21:30:34 +00:00
}
//
if( $a > 0 ) {
if( $pvr['used'] == 0 && !isset($at['p'][$a]['priems']['kill'][$u1][$j_id]) ) {
//
$pvr['hp'] = 100;
$pvr['hpSee'] = 0;
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];
$pvr['hpTr'] = $pvr['hpAll'] - $pvr['hpNow'];
$pvr['hp'] = $btl->hphe( $u1 , $pvr['hp'] , true );
if( $pvr['hpTr'] > 0 ) {
2023-01-10 16:29:32 +00:00
//требуется хилл
2022-06-06 21:30:34 +00:00
if( $pvr['hpTr'] < $pvr['hp'] ) {
$pvr['hp'] = $pvr['hpTr'];
}
$pvr['hpSee'] = '+'.$pvr['hp'];
$pvr['hpNow'] += $pvr['hp'];
}
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
}elseif( $pvr['hpNow'] < 0 ) {
$pvr['hpNow'] = 0;
}
//
$btl->users[$btl->uids[$u1]]['last_hp'] = $pvr['hp'];
//
$btl->stats[$btl->uids[$u1]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `last_hp` = "'.$btl->users[$btl->uids[$u1]]['last_hp'].'",`hpNow` = "'.$btl->stats[$btl->uids[$u1]]['hpNow'].'" WHERE `id` = "'.$u1.'" LIMIT 1');
//
if( $pvr['hpSee'] < 1 ) {
$pvr['hpSee'] = '--';
}
//
2023-01-10 16:29:32 +00:00
$btl->priemAddLogFast( $u1, 0, "Волшебный Эликсир",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$u1]]['sex'] , NULL).' на <font Color=green><b>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']',
2022-06-06 21:30:34 +00:00
1, time() );
//
}
}
2023-01-10 16:29:32 +00:00
// -- конец приема
2022-06-06 21:30:34 +00:00
return $at;
};
unset( $pr_used_this );
}
unset($pvr);
?>