2023-03-31 18:42:06 +00:00
|
|
|
|
<?php
|
2022-06-06 21:30:34 +00:00
|
|
|
|
if(!defined('GAME'))
|
|
|
|
|
{
|
|
|
|
|
die();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($e['bm_a1']=='wpchrr54' && $end > 0)
|
|
|
|
|
{
|
|
|
|
|
$hpmin = $this->atacks[$end]['uid_'.$uid1.'_t1']+$this->atacks[$end]['uid_'.$uid1.'_t2']+$this->atacks[$end]['uid_'.$uid1.'_t4']+$this->atacks[$end]['uid_'.$uid1.'_t5'];
|
|
|
|
|
if( rand(0,10000)< 1000 && $hpmin > 0) //500
|
|
|
|
|
{
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//наносим урон магическим кольцом
|
2022-06-06 21:30:34 +00:00
|
|
|
|
$mpmin = ceil($this->stats[$this->uids[$uid2]]['mpNow']/10);
|
|
|
|
|
if ( $mpmin < ceil($this->stats[$this->uids[$uid2]]['mpAll']/25) && $mpmin !=0 )
|
|
|
|
|
{
|
|
|
|
|
$mpmin = ceil($this->stats[$this->uids[$uid2]]['mpAll']/25);
|
|
|
|
|
if ($mpmin > $this->stats[$this->uids[$uid2]]['mpNow'])
|
|
|
|
|
{
|
|
|
|
|
$mpmin = ceil($this->stats[$this->uids[$uid2]]['mpNow']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$hpmin = ceil($mpmin * 0.5);
|
|
|
|
|
if($mpmin < 0) { $mpmin = 0; }
|
|
|
|
|
$hp1 = $this->stats[$this->uids[$uid1]]['hpNow'];
|
|
|
|
|
$mp2 = $this->stats[$this->uids[$uid2]]['mpNow'];
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//расчет урона стихий
|
2022-06-06 21:30:34 +00:00
|
|
|
|
if ($hp1>0){
|
|
|
|
|
$hp1 = $this->stats[$this->uids[$uid1]]['hpNow'] + $hpmin;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$hp1 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($mp2>0){
|
|
|
|
|
$mp2 = $this->stats[$this->uids[$uid2]]['mpNow'] - $mpmin;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$mp2 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($hp1>$this->stats[$this->uids[$uid1]]['hpAll'])
|
|
|
|
|
{
|
|
|
|
|
$hp1 = $this->stats[$this->uids[$uid1]]['hpAll'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//$this->takeExp($u->info['id'],$hpmin,$uid1,$uid2);
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//отнимаем НР
|
2022-06-06 21:30:34 +00:00
|
|
|
|
$this->users[$this->uids[$uid2]]['mpNow'] = $mp2;
|
|
|
|
|
$this->stats[$this->uids[$uid2]]['mpNow'] = $mp2;
|
|
|
|
|
mysql_query('UPDATE `stats` SET `mpNow` = '.$mp2.' WHERE `id` = "'.$uid2.'" LIMIT 1');
|
|
|
|
|
//$this->priemYronSave($this->users[$this->uids[$uid1]]['id'],$this->users[$this->uids[$uid2]]['id'],$hpmin,0);
|
|
|
|
|
|
|
|
|
|
$this->users[$this->uids[$uid1]]['hpNow'] = $hp1;
|
|
|
|
|
$this->stats[$this->uids[$uid1]]['hpNow'] = $hp1;
|
|
|
|
|
mysql_query('UPDATE `stats` SET `hpNow` = '.$hp1.' WHERE `id` = "'.$uid1.'" LIMIT 1');
|
|
|
|
|
$this->priemYronSave($this->users[$this->uids[$uid2]]['id'],$this->users[$this->uids[$uid1]]['id'],-1*$hpmin,1);
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//заносим в лог боя
|
2022-06-06 21:30:34 +00:00
|
|
|
|
$vLog = 'time1='.time().'||s1='.$this->users[$this->uids[$uid1]]['sex'].'||t1='.$this->users[$this->uids[$uid1]]['team'].'||login1='.$this->users[$this->uids[$uid1]]['login'].'||s2='.$this->users[$this->uids[$uid2]]['sex'].'||t2='.$this->users[$this->uids[$uid2]]['team'].'||login2='.$this->users[$this->uids[$uid2]]['login'].'';
|
|
|
|
|
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>($this->hodID),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
|
|
|
|
if($hpmin>0)
|
|
|
|
|
{
|
|
|
|
|
$hpmin1 = '+'.$hpmin;
|
|
|
|
|
$mpmin = '-'.$mpmin;
|
|
|
|
|
}else{
|
|
|
|
|
$hpmin1 = '--';
|
|
|
|
|
$mpmin = '--';
|
|
|
|
|
}
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$mas1['text'] = '{tm1} {u1} востановил здоровье от {u2} при помощи "<b>'.$itm['name'].'</b> (Пожирание магии)". <b title=Тип урона: тьма ><font color=Purple>'.$mpmin.'</font></b> ['.ceil($mp2).'/'.$this->stats[$this->uids[$uid2]]['mpAll'].'] / <b title=Тип урона: тьма ><font color=green>'.$hpmin1.'</font></b> ['.ceil($hp1).'/'.$this->stats[$this->uids[$uid1]]['hpAll'].']';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
$this->add_log($mas1);
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
// спасение
|
2022-06-06 21:30:34 +00:00
|
|
|
|
// $this->spaCheck($this->stats[$this->uids[$uid2]]['id']);
|
2023-01-10 16:29:32 +00:00
|
|
|
|
// спасение
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|