94 lines
3.0 KiB
PHP
94 lines
3.0 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
if($pl['id']==3)
|
|
{
|
|
//ïðèåì ñîáðàòü çóáû
|
|
$hpadd = rand(2,5); $trduh = 1;
|
|
}elseif($pl['id']==5)
|
|
{
|
|
//ïðèåì óòåðåòü ïîò
|
|
$hpadd = $u->info['level']*2;
|
|
}elseif($pl['id']==6)
|
|
{
|
|
//ïðèåì âîëÿ ê ïîáåäå
|
|
$hpadd = round($u->info['level']*5+7);
|
|
if($btl->stats[$btl->uids[$u->info['id']]]['hpNow']<($btl->stats[$btl->uids[$u->info['id']]]['hpAll']*0.33))
|
|
{
|
|
$hpadd += ceil($hpadd*0.25);
|
|
}
|
|
}elseif($pl['id']==189)
|
|
{
|
|
if($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow']>=1)
|
|
{
|
|
//îøåëîìèòü
|
|
$this->addPriem($u->info['enemy'],$pl['id'],'',0,77,2,$u->info['id'],5,'îøåëîìèòü');
|
|
$this->addPriem($u->info['enemy'],191,'',0,77,5,$u->info['id'],5,'èììóíòèòåîøåëîìèòü');
|
|
if($re==false)
|
|
{
|
|
echo '[Er::Îøåëîìèòü[xX]]';
|
|
}
|
|
$sx = '';
|
|
if($u->info['sex']==1)
|
|
{
|
|
$sx = 'à';
|
|
}
|
|
$vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'||s2='.$btl->users[$btl->uids[$u->info['enemy']]]['sex'].'||t2='.$btl->users[$btl->uids[$u->info['enemy']]]['team'].'||login2='.$btl->users[$btl->uids[$u->info['enemy']]]['login'].'';
|
|
$mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>$btl->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
|
$mas1['text'] = '{tm1} {u1} {1x16x0} ïðèåì "<b>'.$pl['name'].'</b>" è îøåëîìèë'.$sx.' {u2} íà äâà õîäà.';
|
|
$pz = $btl->users[$btl->uids[$u->info['enemy']]]['priems_z'];
|
|
$pz = explode('|',$pz);
|
|
$i = 0;
|
|
while($i<=30)
|
|
{
|
|
$pz[$i] += 2;
|
|
$i++;
|
|
}
|
|
$pz = implode('|',$pz);
|
|
$btl->users[$btl->uids[$u->info['enemy']]]['priems_z'] = $pz;
|
|
unset($pz);
|
|
mysql_query('UPDATE `stats` SET `priems_z` = "'.$btl->users[$btl->uids[$u->info['enemy']]]['priems_z'].'" WHERE `id` = "'.$u->info['enemy'].'" LIMIT 1');
|
|
$btl->add_log($mas1);
|
|
$pz[(int)$id] = 1;
|
|
}
|
|
}
|
|
if(isset($hpadd))
|
|
{
|
|
if($u->stats['hpNow']+$hpadd > $u->stats['hpAll'])
|
|
{
|
|
$hpadd = $u->stats['hpAll']-$u->stats['hpNow'];
|
|
}
|
|
if($trduh==1)
|
|
{
|
|
if($btl->users[$btl->uids[$u->info['id']]]['tactic7']<=0)
|
|
{
|
|
$hpadd = 0;
|
|
}
|
|
}
|
|
$u->info['hpNow'] += $hpadd;
|
|
$u->stats['hpNow'] += $hpadd;
|
|
$btl->users[$btl->uids[$u->info['id']]]['hpNow'] += $hpadd;
|
|
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] += $hpadd;
|
|
$upd = mysql_query('UPDATE `stats` SET `hpNow` = '.$u->info['hpNow'].' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
if($upd)
|
|
{
|
|
$vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'';
|
|
$mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>$btl->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
|
if($hpadd>0)
|
|
{
|
|
$hpadd = '+'.ceil($hpadd);
|
|
}else{
|
|
$hpadd = '--';
|
|
}
|
|
$mas1['text'] = '{tm1} {u1} {1x16x0} ïðèåì "<b>'.$pl['name'].'</b>" è {1x17x0} çäîðîâüå. <b><font color=#006699>'.$hpadd.'</font></b> ['.ceil($u->info['hpNow']).'/'.$btl->stats[$btl->uids[$u->info['id']]]['hpAll'].']';
|
|
$btl->add_log($mas1);
|
|
$pz[(int)$id] = 1;
|
|
}else{
|
|
echo 'Can`t update table `user`';
|
|
}
|
|
unset($hpadd,$mas1,$trduh);
|
|
}
|
|
?>
|