Убрано дублирование классов. Helpers уехали из Core. Классы во внешних директориях переехали к остальным.
This commit is contained in:
+459
-536
File diff suppressed because it is too large
Load Diff
@@ -1,65 +1,63 @@
|
||||
<?php
|
||||
if(!defined('GAME'))
|
||||
{
|
||||
die();
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
|
||||
if($st['usefromfile']=='bloodring2' && $u->info['battle'] > 0 && $u->info['hpNow'] >= 1)
|
||||
{
|
||||
if($btl->info['team_win'] != -1 ) {
|
||||
$u->error = 'Использовать кольцо возможно только во время боя';
|
||||
}elseif($btl->info['razdel'] != 5) {
|
||||
$u->error = 'Использование кольца возможно только в хаотичных поединках!';
|
||||
}elseif(ceil($u->info['tactic6']) < 5) {
|
||||
$u->error = 'Не хватает '.(5-ceil($u->info['tactic6'])).' <img width=8 height=8 src=//img.new-combats.tech/i/micro/hp.gif> для "Поглотить Кровь"';
|
||||
}else{
|
||||
if($st['td_cast_data'] != date('d.m.Y')) {
|
||||
$st['td_cast_data'] = date('d.m.Y');
|
||||
$st['td_cast'] = 0;
|
||||
}
|
||||
|
||||
if($st['td_cast'] > 5) {
|
||||
$u->error = 'Использование кольца возможно не более 6 раз в сутки!';
|
||||
}else{
|
||||
$bu = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "priem" AND `v2` = "229" AND `delete` = "0" LIMIT 1'));
|
||||
|
||||
$st['td_cast']++;
|
||||
|
||||
$stimp = \Core\ConversionHelper::arrayToDataString($st);
|
||||
mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($stimp).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
|
||||
|
||||
mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
||||
$u->info['tactic6'] -= 5;
|
||||
|
||||
//\User\ItemsModel::addItem(3136,$u->info['id'],'|sudba='.$u->info['login']);
|
||||
|
||||
//Если эффект есть, тогда добавляем к нему +1 каст (Максимум 6)
|
||||
if(isset($bu['id'])) {
|
||||
if($bu['x'] < 6) {
|
||||
mysql_query('UPDATE `eff_users` SET `x` = `x` + 1 WHERE `id` = "'.$bu['id'].'" LIMIT 1');
|
||||
}
|
||||
}else{
|
||||
$ins = mysql_query('INSERT INTO `eff_users` (`file_finish`,`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`) VALUES
|
||||
("bloodring2_end","-1",229,"invoke_create_bloodstone.gif",22,"'.$u->info['id'].'","Поглотить Кровь","","30","77","priem")');
|
||||
}
|
||||
|
||||
$u->error = 'Вы успешно использовали заклинание "Поглотить Кровь"<br>В случаи победы Вы получите "Кровавый Рубин"';
|
||||
|
||||
//Лог боя
|
||||
$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
|
||||
$id_hod = $lastHOD['id_hod'];
|
||||
if($lastHOD['type']!=6) {
|
||||
$id_hod++;
|
||||
}
|
||||
$txt = '<font color=#006699>'.$txt.'</font>';
|
||||
if($u->info['sex']==1) {
|
||||
$txt = '{u1} применила заклинание "<b>Поглотить Кровь</b>".';
|
||||
}else{
|
||||
$txt = '{u1} применил заклинание "<b>Поглотить Кровь</b>".';
|
||||
}
|
||||
mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||time1='.time().'","","","","","6")');
|
||||
}
|
||||
}
|
||||
if ($st['usefromfile'] == 'bloodring2' && $u->info['battle'] > 0 && $u->info['hpNow'] >= 1) {
|
||||
if ($btl->info['team_win'] != -1) {
|
||||
$u->error = 'Использовать кольцо возможно только во время боя';
|
||||
} elseif ($btl->info['razdel'] != 5) {
|
||||
$u->error = 'Использование кольца возможно только в хаотичных поединках!';
|
||||
} elseif (ceil($u->info['tactic6']) < 5) {
|
||||
$u->error = 'Не хватает ' . (5 - ceil($u->info['tactic6'])) . ' <img width=8 height=8 src=//img.new-combats.tech/i/micro/hp.gif> для "Поглотить Кровь"';
|
||||
} else {
|
||||
if ($st['td_cast_data'] != date('d.m.Y')) {
|
||||
$st['td_cast_data'] = date('d.m.Y');
|
||||
$st['td_cast'] = 0;
|
||||
}
|
||||
|
||||
if ($st['td_cast'] > 5) {
|
||||
$u->error = 'Использование кольца возможно не более 6 раз в сутки!';
|
||||
} else {
|
||||
$bu = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "priem" AND `v2` = "229" AND `delete` = "0" LIMIT 1'));
|
||||
|
||||
$st['td_cast']++;
|
||||
|
||||
$stimp = Helper\Conversion::arrayToDataString($st);
|
||||
mysql_query('UPDATE `items_users` SET `data` = "' . mysql_real_escape_string($stimp) . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
|
||||
|
||||
mysql_query('UPDATE `stats` SET `tactic6` = `tactic6` - 5 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
$u->info['tactic6'] -= 5;
|
||||
|
||||
//\User\ItemsModel::addItem(3136,$u->info['id'],'|sudba='.$u->info['login']);
|
||||
|
||||
//Если эффект есть, тогда добавляем к нему +1 каст (Максимум 6)
|
||||
if (isset($bu['id'])) {
|
||||
if ($bu['x'] < 6) {
|
||||
mysql_query('UPDATE `eff_users` SET `x` = `x` + 1 WHERE `id` = "' . $bu['id'] . '" LIMIT 1');
|
||||
}
|
||||
} else {
|
||||
$ins = mysql_query('INSERT INTO `eff_users` (`file_finish`,`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`) VALUES
|
||||
("bloodring2_end","-1",229,"invoke_create_bloodstone.gif",22,"' . $u->info['id'] . '","Поглотить Кровь","","30","77","priem")');
|
||||
}
|
||||
|
||||
$u->error = 'Вы успешно использовали заклинание "Поглотить Кровь"<br>В случаи победы Вы получите "Кровавый Рубин"';
|
||||
|
||||
//Лог боя
|
||||
$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
|
||||
$id_hod = $lastHOD['id_hod'];
|
||||
if ($lastHOD['type'] != 6) {
|
||||
$id_hod++;
|
||||
}
|
||||
$txt = '<font color=#006699>' . $txt . '</font>';
|
||||
if ($u->info['sex'] == 1) {
|
||||
$txt = '{u1} применила заклинание "<b>Поглотить Кровь</b>".';
|
||||
} else {
|
||||
$txt = '{u1} применил заклинание "<b>Поглотить Кровь</b>".';
|
||||
}
|
||||
mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||time1=' . time() . '","","","","","6")');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+1355
-1427
File diff suppressed because it is too large
Load Diff
+402
-431
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
if(!defined('GAME'))
|
||||
{
|
||||
die();
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
|
||||
function getdr($s, $v, $d)
|
||||
@@ -17,438 +16,410 @@ function getdr($s, $v, $d)
|
||||
return floor($s);
|
||||
}
|
||||
|
||||
if($pl['id'] == 189) {
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['enemy'].'" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//Ошеломить
|
||||
if($imun){
|
||||
echo '<font color=red><b>У персонажа иммунитет к ошеломляющим приемам еше '.$imun['hod'].' ход.</b></font>';
|
||||
$cup = true;
|
||||
}elseif($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow']>=1)
|
||||
{
|
||||
//
|
||||
$re = $this->addPriem($u->info['enemy'],230,'',0,77,2,$u->info['id'],2,'ошеломить');
|
||||
$re = $this->addPriem($u->info['enemy'],191,'',0,77,6,$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'];
|
||||
$p_id = $btl->users[$btl->uids[$u->info['enemy']]]['priems'];
|
||||
$pz = explode('|',$pz);
|
||||
$p_id = explode('|',$p_id);
|
||||
$i = 0;
|
||||
while($i<=30)
|
||||
{
|
||||
if($p_id[$i]>=195 and $p_id[$i]<=198){
|
||||
$pz[$i]=$pz[$i];
|
||||
}else{
|
||||
$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;
|
||||
}
|
||||
}elseif($pl['id'] == 227) {
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['enemy'].'" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//Контузия
|
||||
if($imun){
|
||||
echo '<font color=red><b>У персонажа иммунитет к ошеломляющим приемам еше '.$imun['hod'].' ход.</b></font>';
|
||||
$cup = true;
|
||||
}elseif($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow']>=1)
|
||||
{
|
||||
//
|
||||
$re = $this->addPriem($u->info['enemy'],$pl['id'],'',0,77,4,$u->info['id'],1,'контузия');
|
||||
$re = $this->addPriem($u->info['enemy'],191,'',0,77,6,$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');
|
||||
|
||||
$hp = $u->info['level']*2-$u->info['level'];
|
||||
|
||||
if($hp < 0) {
|
||||
$hp = 0;
|
||||
}
|
||||
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp;
|
||||
$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp;
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] = -$hp;
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'].'",`last_hp` = "'.$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'].'" WHERE `id` = "'.$u->info['enemy'].'" LIMIT 1');
|
||||
|
||||
if($hp < 1) {
|
||||
$hp = '--';
|
||||
}else{
|
||||
$hp = -$hp;
|
||||
}
|
||||
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" и ошеломил'.$sx.' щитом персонажа {u2} на один ход. <b><font color=#006699>'.$hp.'</font></b> ['.floor($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow']).'/'.$btl->stats[$btl->uids[$u->info['enemy']]]['hpAll'].']';
|
||||
$pz = $btl->users[$btl->uids[$u->info['enemy']]]['priems_z'];
|
||||
$p_id = $btl->users[$btl->uids[$u->info['enemy']]]['priems'];
|
||||
$pz = explode('|',$pz);
|
||||
$p_id = explode('|',$p_id);
|
||||
$i = 0;
|
||||
while($i<=30)
|
||||
{
|
||||
if($p_id[$i]>=195 and $p_id[$i]<=198){
|
||||
$pz[$i]=$pz[$i];
|
||||
}else{
|
||||
$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;
|
||||
}
|
||||
}elseif($pl['priem']['id'] == 226) {
|
||||
//Возмездие
|
||||
$hp = 6*$u1['level'];
|
||||
if($hp > 0) {
|
||||
$this->users[$this->uids[$u2['id']]]['last_hp'] = -$hp;
|
||||
$this->stats[$this->uids[$u2['id']]]['hpNow'] -= $hp;
|
||||
$s2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$p2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$this->users[$this->uids[$u2['id']]]['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats[$this->uids[$u2['id']]]['hpNow'].'",`last_hp` = "'.$this->users[$this->uids[$u2['id']]]['last_hp'].'" WHERE `id` = "'.$u2['id'].'" LIMIT 1');
|
||||
$this->stats[$this->uids[$u2['uid']]] = $u->getStats($u2['uid'],0);
|
||||
$hp = -$hp;
|
||||
}else{
|
||||
$hp = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u2} утратил здоровье от приема "<b>'.$pl['name'].'</b>". <b><font color=#006699>'.$hp.'</font></b> ['.floor($this->stats[$this->uids[$u2['id']]]['hpNow']).'/'.$this->stats[$this->uids[$u2['id']]]['hpAll'].']';
|
||||
}elseif($pl['id'] == 224) {
|
||||
if($btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] > 0) {
|
||||
$btl->stats[$btl->uids[$this->ue['id']]]['tactic6']++;
|
||||
$btl->users[$btl->uids[$this->ue['id']]]['tactic6']++;
|
||||
if($btl->users[$btl->uids[$this->ue['id']]]['id'] == $u->info['id']) {
|
||||
$u->info['tactic6']++;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `tactic6` = "'.$btl->users[$btl->uids[$this->ue['id']]]['tactic6'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
|
||||
$vLog = 'time1='.time().'||s1='.$btl->users[$btl->uids[$u->info['id']]]['sex'].'||t1='.$btl->users[$btl->uids[$u->info['id']]]['team'].'||login1='.$btl->users[$btl->uids[$u->info['id']]]['login'].'||s2='.$btl->users[$btl->uids[$this->ue['id']]]['sex'].'||t2='.$btl->users[$btl->uids[$this->ue['id']]]['team'].'||login2='.$btl->users[$btl->uids[$this->ue['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>($btl->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" на персонажа {u2}.';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
unset($vLog,$mas1);
|
||||
}
|
||||
}elseif($pl['priem']['id'] == 222) {
|
||||
//Последний удар
|
||||
if(!isset($this->del_val['eff'][$pl['priem']['id']])) {
|
||||
$hp = floor($this->stats[$this->uids[$pl['uid']]]['hpNow']);
|
||||
$this->stats[$this->uids[$pl['uid']]]['last_hp'] = -$hp;
|
||||
|
||||
if($hp < 1) {
|
||||
$hp = '--';
|
||||
}else{
|
||||
$hp = -$hp;
|
||||
}
|
||||
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1='.time().'||s1='.$this->users[$this->uids[$pl['uid']]]['sex'].'||t1='.$this->users[$this->uids[$pl['uid']]]['team'].'||login1='.$this->users[$this->uids[$pl['uid']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>($this->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>".'; // <b><font color=#006699>'.$hp.'</font></b> [0/'.$this->stats[$this->uids[$u1['id']]]['hpAll'].']';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
unset($vLog,$mas1);
|
||||
}
|
||||
}elseif($pl['id'] == 232) {
|
||||
//Выжить
|
||||
$hp = $btl->users[$btl->uids[$u->info['id']]]['tactic1']+$btl->users[$btl->uids[$u->info['id']]]['tactic2']+$btl->users[$btl->uids[$u->info['id']]]['tactic3']+$btl->users[$btl->uids[$u->info['id']]]['tactic4']+$btl->users[$btl->uids[$u->info['id']]]['tactic5']+$btl->users[$btl->uids[$u->info['id']]]['tactic6']*0.5;
|
||||
if($hp > 25) {
|
||||
$hp = 25;
|
||||
}
|
||||
$hp = floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll']/100*$hp);
|
||||
|
||||
if(floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll']-$btl->stats[$btl->uids[$u->info['id']]]['hpNow']) < $hp) {
|
||||
$hp = floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll']-$btl->stats[$btl->uids[$u->info['id']]]['hpNow']);
|
||||
}
|
||||
|
||||
$i03 = 1;
|
||||
while($i03 <= 6) {
|
||||
$btl->users[$btl->uids[$u->info['id']]]['tactic'.$i03] = 0;
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['tactic'.$i03] = 0;
|
||||
$u->info['tactic'.$i03] = 0;
|
||||
$u->stats['tactic'.$i03] = 0;
|
||||
$rstb = 1;
|
||||
$i03++;
|
||||
}
|
||||
unset($i03);
|
||||
|
||||
$hp = -$hp;
|
||||
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] -= $hp;
|
||||
|
||||
if($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] < 0)
|
||||
{
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = 0;
|
||||
}elseif($btl->stats[$btl->uids[$u->info['id']]]['hpNow']>$btl->stats[$btl->uids[$u->info['id']]]['hpAll'])
|
||||
{
|
||||
$hp = ceil($hp-($btl->stats[$btl->uids[$u->info['id']]]['hpNow']-$btl->stats[$btl->uids[$u->info['id']]]['hpAll']));
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpAll'];
|
||||
}
|
||||
|
||||
if($hp < 0)
|
||||
{
|
||||
$hp = '+'.(-$hp);
|
||||
}elseif($hp == 0){
|
||||
$hp = '--';
|
||||
}else{
|
||||
$hp = '-'.$hp;
|
||||
}
|
||||
|
||||
$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+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>". <b><font color=#006699>'.$hp.'</font></b> ['.floor($btl->stats[$btl->uids[$u->info['id']]]['hpNow']).'/'.$btl->stats[$btl->uids[$u->info['id']]]['hpAll'].']';
|
||||
$btl->add_log($mas1);
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
$u->info['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$u->info['id']]]['hpNow'].'",`tactic1` ="0",`tactic2` ="0",`tactic3` ="0",`tactic4` ="0",`tactic5` ="0",`tactic6` ="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
||||
|
||||
unset($hp021);
|
||||
}elseif($pl['id'] == 221) {
|
||||
//Отменить
|
||||
$hp = $btl->users[$btl->uids[$u->info['id']]]['last_hp'];
|
||||
if ($pl['id'] == 189) {
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u->info['enemy'] . '" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//Ошеломить
|
||||
if ($imun) {
|
||||
echo '<font color=red><b>У персонажа иммунитет к ошеломляющим приемам еше ' . $imun['hod'] . ' ход.</b></font>';
|
||||
$cup = true;
|
||||
} elseif ($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] >= 1) {
|
||||
//
|
||||
$re = $this->addPriem($u->info['enemy'], 230, '', 0, 77, 2, $u->info['id'], 2, 'ошеломить');
|
||||
$re = $this->addPriem($u->info['enemy'], 191, '', 0, 77, 6, $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 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => $btl->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] -= $hp;
|
||||
|
||||
if($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] < 0)
|
||||
{
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = 0;
|
||||
}elseif($btl->stats[$btl->uids[$u->info['id']]]['hpNow']>$btl->stats[$btl->uids[$u->info['id']]]['hpAll'])
|
||||
{
|
||||
$hp = ceil($hp-($btl->stats[$btl->uids[$u->info['id']]]['hpNow']-$btl->stats[$btl->uids[$u->info['id']]]['hpAll']));
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpAll'];
|
||||
}
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['last_hp'] = 0;
|
||||
|
||||
if($hp < 0)
|
||||
{
|
||||
$hp = '+'.(-$hp);
|
||||
}elseif($hp == 0){
|
||||
$hp = '--';
|
||||
}else{
|
||||
$hp = '-'.$hp;
|
||||
}
|
||||
|
||||
$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+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>". <b><font color=#006699>'.$hp.'</font></b> ['.floor($btl->stats[$btl->uids[$u->info['id']]]['hpNow']).'/'.$btl->stats[$btl->uids[$u->info['id']]]['hpAll'].']';
|
||||
$btl->add_log($mas1);
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
$u->info['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$u->info['id']]]['hpNow'].'",`last_hp` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
||||
|
||||
unset($hp021);
|
||||
}elseif($pl['priem']['id'] == 220) {
|
||||
//Ставка на опережение
|
||||
if(!isset($this->del_val['eff'][$pl['id']])) {
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$u2['sex'].'||t2='.$u2['team'].'||login2='.$u2['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>($this->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" на персонажа {u2} и украл все активные приемы.';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$pl['delete'] = time();
|
||||
$sp031 = mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "'.$u2['id'].'" AND `delete` = 0 AND `v1` = "priem" LIMIT 20');
|
||||
$pr78 = 0;
|
||||
while($pl031 = mysql_fetch_array($sp031)) {
|
||||
if(mysql_query('UPDATE `eff_users` SET `uid` = "'.$u1['id'].'" WHERE `id` = "'.$pl031['id'].'" LIMIT 1')) {
|
||||
//$mas1['text'] = '{tm1} {u1} Украл активный прием "<b>'.$pl031['name'].'</b>" у {u2}';
|
||||
//$this->add_log($mas1);
|
||||
$pr78++;
|
||||
}
|
||||
}
|
||||
if($pr78 > 0) {
|
||||
$this->stats[$this->uids[$u1['id']]] = $u->getStats($u1['id'],0);
|
||||
$this->stats[$this->uids[$u2['id']]] = $u->getStats($u2['id'],0);
|
||||
$this->re_pd['restart'] = true;
|
||||
}
|
||||
unset($pr78,$vLog,$mas1,$pl031,$sp031);
|
||||
}
|
||||
}elseif($pl['priem']['id'] == 217) {
|
||||
//разгадать тактику
|
||||
if(!isset($this->del_val['eff'][$pl['id']])) {
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$u2['sex'].'||t2='.$u2['team'].'||login2='.$u2['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>($this->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" на персонажа {u2}.';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$pl['delete'] = time();
|
||||
$sp031 = mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "'.$u2['id'].'" AND `delete` = 0 AND `v1` = "priem" AND `v2` != 201 AND `v2` != 211 LIMIT 20');
|
||||
$pr78 = 0;
|
||||
while($pl031 = mysql_fetch_array($sp031)) {
|
||||
if(mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'",`uid` = "0" WHERE `id` = "'.$pl031['id'].'" LIMIT 1')) {
|
||||
$mas1['text'] = '{tm1} Закончилось действие приема "<b>'.$pl031['name'].'</b>" для {u2}.';
|
||||
$this->pr_not_use[$pl031['id']] = 1;
|
||||
$this->add_log($mas1);
|
||||
$pr78++;
|
||||
}
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и ошеломил' . $sx . ' персонажа {u2} на два хода.';
|
||||
$pz = $btl->users[$btl->uids[$u->info['enemy']]]['priems_z'];
|
||||
$p_id = $btl->users[$btl->uids[$u->info['enemy']]]['priems'];
|
||||
$pz = explode('|', $pz);
|
||||
$p_id = explode('|', $p_id);
|
||||
$i = 0;
|
||||
while ($i <= 30) {
|
||||
if ($p_id[$i] >= 195 and $p_id[$i] <= 198) {
|
||||
$pz[$i] = $pz[$i];
|
||||
} else {
|
||||
$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;
|
||||
}
|
||||
} elseif ($pl['id'] == 227) {
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u->info['enemy'] . '" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//Контузия
|
||||
if ($imun) {
|
||||
echo '<font color=red><b>У персонажа иммунитет к ошеломляющим приемам еше ' . $imun['hod'] . ' ход.</b></font>';
|
||||
$cup = true;
|
||||
} elseif ($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] >= 1) {
|
||||
//
|
||||
$re = $this->addPriem($u->info['enemy'], $pl['id'], '', 0, 77, 4, $u->info['id'], 1, 'контузия');
|
||||
$re = $this->addPriem($u->info['enemy'], 191, '', 0, 77, 6, $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 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => $btl->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
|
||||
unset($pr78,$vLog,$mas1,$pl031,$sp031);
|
||||
}
|
||||
}elseif($pl['id']==12)
|
||||
{
|
||||
//прием подлый удар
|
||||
$hpmin = $u->info['level']*5;
|
||||
}elseif($pl['id']==271)
|
||||
{
|
||||
//прием Прорыв 1\3 урона оружием
|
||||
$tp_atk = $btl->weaponTx($btl->stats[$btl->uids[$u->info['id']]]['items'][$btl->stats[$btl->uids[$u->info['id']]]['wp3id']]);
|
||||
//$tp_atk = 0;
|
||||
$yi_atk = $btl->weaponAt22($btl->stats[$btl->uids[$u->info['id']]]['items'][$btl->stats[$btl->uids[$u->info['id']]]['wp3id']],$btl->stats[$btl->uids[$u->info['id']]],$tp_atk);
|
||||
$hpmin = $btl->yrn($btl->stats[$btl->uids[$u->info['id']]],$btl->stats[$btl->uids[$u->info['enemy']]],$btl->users[$btl->uids[$u->info['id']]],$btl->users[$btl->uids[$u->info['enemy']]],$btl->stats[$btl->uids[$u->info['id']]]['lvl'],$btl->stats[$btl->uids[$u->info['enemy']]]['lvl'],$tp_atk,$yi_atk[0],$yi_atk[1],0,0,0,0,$btl->stats[$btl->uids[$u->info['id']]]['m3'],0,0,0);
|
||||
$hpmin = rand($hpmin['min'],$hpmin['max']);
|
||||
}elseif($pl['id'] == 212) {
|
||||
//Ограниченный маневр
|
||||
$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+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" на персонажа {u2}';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
mysql_query('UPDATE `stats` SET `smena` = "-1" WHERE `id` = "'.$u->info['enemy'].'" LIMIT 1');
|
||||
}elseif($pl['id']==46)
|
||||
{
|
||||
//заносим в лог боя
|
||||
if(isset($this->ue['id'],$btl->users[$btl->uids[$this->ue['id']]]) && ($btl->users[$btl->uids[$this->ue['id']]]['team']!=$u->info['team'] && $btl->stats[$btl->uids[$this->ue['id']]]['hpNow']>=1))
|
||||
{
|
||||
$vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'||s2='.$btl->users[$btl->uids[$this->ue['id']]]['sex'].'||t2='.$btl->users[$btl->uids[$this->ue['id']]]['team'].'||login2='.$btl->users[$btl->uids[$this->ue['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>($btl->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>". (Новая цель: {u2})';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$u->info['enemy'] = $this->ue['id'];
|
||||
mysql_query('UPDATE `stats` SET `enemy` = "'.$u->info['enemy'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
||||
}
|
||||
}elseif($pl['priem']['id']==49)
|
||||
{
|
||||
//восстанавливаем 5НР за каждый лвл противника
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] += $this->users[$this->uids[$pl['uid']]]['level']*5;
|
||||
$hp = $u2['level']*5;
|
||||
if($this->stats[$this->uids[$pl['uid']]]['hpNow'] < 0)
|
||||
{
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] = 0;
|
||||
}elseif($this->stats[$this->uids[$pl['uid']]]['hpNow']>$this->stats[$this->uids[$pl['uid']]]['hpAll'])
|
||||
{
|
||||
$hp = ceil($hp-($this->stats[$this->uids[$pl['uid']]]['hpNow']-$this->stats[$this->uids[$pl['uid']]]['hpAll']));
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpAll'];
|
||||
}
|
||||
|
||||
if($hp > 0) {
|
||||
$btl->users[$btl->uids[$pl['uid']]]['last_hp'] = $hp;
|
||||
}
|
||||
|
||||
if($hp>0)
|
||||
{
|
||||
$hp = '+'.$hp;
|
||||
}else{
|
||||
$hp = '--';
|
||||
}
|
||||
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>". <b><font color=#006699>'.$hp.'</font></b> ['.floor($this->stats[$this->uids[$pl['uid']]]['hpNow']).'/'.$this->stats[$this->uids[$pl['uid']]]['hpAll'].']';
|
||||
|
||||
$this->users[$this->uids[$pl['uid']]]['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpNow'];
|
||||
if($pl['uid']==$u->info['id'])
|
||||
{
|
||||
$u->info['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpNow'];
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats[$this->uids[$pl['uid']]]['hpNow'].'",`last_hp` = "'.$btl->users[$btl->uids[$pl['uid']]]['last_hp'].'" WHERE `id` = "'.$pl['uid'].'" LIMIT 1');
|
||||
}elseif($pl['priem']['id'] == 211) {
|
||||
//Агрессивная защита
|
||||
$hp = 3*$u1['level'];
|
||||
if($hp > 0) {
|
||||
$this->users[$this->uids[$u2['id']]]['last_hp'] = -$hp;
|
||||
$this->stats[$this->uids[$u2['id']]]['hpNow'] -= $hp;
|
||||
$s2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$p2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$this->users[$this->uids[$u2['id']]]['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats[$this->uids[$u2['id']]]['hpNow'].'",`last_hp` = "'.$this->users[$this->uids[$u2['id']]]['last_hp'].'" WHERE `id` = "'.$u2['id'].'" LIMIT 1');
|
||||
$this->stats[$this->uids[$u2['uid']]] = $u->getStats($u2['uid'],0);
|
||||
$hp = -$hp;
|
||||
}else{
|
||||
$hp = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u2} утратил здоровье от приема "<b>'.$pl['name'].'</b>". <b><font color=#006699>'.$hp.'</font></b> ['.floor($this->stats[$this->uids[$u2['id']]]['hpNow']).'/'.$this->stats[$this->uids[$u2['id']]]['hpAll'].']';
|
||||
$hp = $u->info['level'] * 2 - $u->info['level'];
|
||||
|
||||
if ($hp < 0) {
|
||||
$hp = 0;
|
||||
}
|
||||
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp;
|
||||
$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp;
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] = -$hp;
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] . '",`last_hp` = "' . $btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] . '" WHERE `id` = "' . $u->info['enemy'] . '" LIMIT 1');
|
||||
|
||||
if ($hp < 1) {
|
||||
$hp = '--';
|
||||
} else {
|
||||
$hp = -$hp;
|
||||
}
|
||||
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и ошеломил' . $sx . ' щитом персонажа {u2} на один ход. <b><font color=#006699>' . $hp . '</font></b> [' . floor($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow']) . '/' . $btl->stats[$btl->uids[$u->info['enemy']]]['hpAll'] . ']';
|
||||
$pz = $btl->users[$btl->uids[$u->info['enemy']]]['priems_z'];
|
||||
$p_id = $btl->users[$btl->uids[$u->info['enemy']]]['priems'];
|
||||
$pz = explode('|', $pz);
|
||||
$p_id = explode('|', $p_id);
|
||||
$i = 0;
|
||||
while ($i <= 30) {
|
||||
if ($p_id[$i] >= 195 and $p_id[$i] <= 198) {
|
||||
$pz[$i] = $pz[$i];
|
||||
} else {
|
||||
$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;
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 226) {
|
||||
//Возмездие
|
||||
$hp = 6 * $u1['level'];
|
||||
if ($hp > 0) {
|
||||
$this->users[$this->uids[$u2['id']]]['last_hp'] = -$hp;
|
||||
$this->stats[$this->uids[$u2['id']]]['hpNow'] -= $hp;
|
||||
$s2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$p2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$this->users[$this->uids[$u2['id']]]['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$this->uids[$u2['id']]]['hpNow'] . '",`last_hp` = "' . $this->users[$this->uids[$u2['id']]]['last_hp'] . '" WHERE `id` = "' . $u2['id'] . '" LIMIT 1');
|
||||
$this->stats[$this->uids[$u2['uid']]] = $u->getStats($u2['uid'], 0);
|
||||
$hp = -$hp;
|
||||
} else {
|
||||
$hp = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u2} утратил здоровье от приема "<b>' . $pl['name'] . '</b>". <b><font color=#006699>' . $hp . '</font></b> [' . floor($this->stats[$this->uids[$u2['id']]]['hpNow']) . '/' . $this->stats[$this->uids[$u2['id']]]['hpAll'] . ']';
|
||||
} elseif ($pl['id'] == 224) {
|
||||
if ($btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] > 0) {
|
||||
$btl->stats[$btl->uids[$this->ue['id']]]['tactic6']++;
|
||||
$btl->users[$btl->uids[$this->ue['id']]]['tactic6']++;
|
||||
if ($btl->users[$btl->uids[$this->ue['id']]]['id'] == $u->info['id']) {
|
||||
$u->info['tactic6']++;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `tactic6` = "' . $btl->users[$btl->uids[$this->ue['id']]]['tactic6'] . '" WHERE `id` = "' . $this->ue['id'] . '" LIMIT 1');
|
||||
$vLog = 'time1=' . time() . '||s1=' . $btl->users[$btl->uids[$u->info['id']]]['sex'] . '||t1=' . $btl->users[$btl->uids[$u->info['id']]]['team'] . '||login1=' . $btl->users[$btl->uids[$u->info['id']]]['login'] . '||s2=' . $btl->users[$btl->uids[$this->ue['id']]]['sex'] . '||t2=' . $btl->users[$btl->uids[$this->ue['id']]]['team'] . '||login2=' . $btl->users[$btl->uids[$this->ue['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" на персонажа {u2}.';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
unset($vLog, $mas1);
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 222) {
|
||||
//Последний удар
|
||||
if (!isset($this->del_val['eff'][$pl['priem']['id']])) {
|
||||
$hp = floor($this->stats[$this->uids[$pl['uid']]]['hpNow']);
|
||||
$this->stats[$this->uids[$pl['uid']]]['last_hp'] = -$hp;
|
||||
|
||||
if ($hp < 1) {
|
||||
$hp = '--';
|
||||
} else {
|
||||
$hp = -$hp;
|
||||
}
|
||||
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1=' . time() . '||s1=' . $this->users[$this->uids[$pl['uid']]]['sex'] . '||t1=' . $this->users[$this->uids[$pl['uid']]]['team'] . '||login1=' . $this->users[$this->uids[$pl['uid']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => ($this->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>".'; // <b><font color=#006699>'.$hp.'</font></b> [0/'.$this->stats[$this->uids[$u1['id']]]['hpAll'].']';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
unset($vLog, $mas1);
|
||||
}
|
||||
} elseif ($pl['id'] == 232) {
|
||||
//Выжить
|
||||
$hp = $btl->users[$btl->uids[$u->info['id']]]['tactic1'] + $btl->users[$btl->uids[$u->info['id']]]['tactic2'] + $btl->users[$btl->uids[$u->info['id']]]['tactic3'] + $btl->users[$btl->uids[$u->info['id']]]['tactic4'] + $btl->users[$btl->uids[$u->info['id']]]['tactic5'] + $btl->users[$btl->uids[$u->info['id']]]['tactic6'] * 0.5;
|
||||
if ($hp > 25) {
|
||||
$hp = 25;
|
||||
}
|
||||
$hp = floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll'] / 100 * $hp);
|
||||
|
||||
if (floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll'] - $btl->stats[$btl->uids[$u->info['id']]]['hpNow']) < $hp) {
|
||||
$hp = floor($btl->stats[$btl->uids[$u->info['id']]]['hpAll'] - $btl->stats[$btl->uids[$u->info['id']]]['hpNow']);
|
||||
}
|
||||
|
||||
$i03 = 1;
|
||||
while ($i03 <= 6) {
|
||||
$btl->users[$btl->uids[$u->info['id']]]['tactic' . $i03] = 0;
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['tactic' . $i03] = 0;
|
||||
$u->info['tactic' . $i03] = 0;
|
||||
$u->stats['tactic' . $i03] = 0;
|
||||
$rstb = 1;
|
||||
$i03++;
|
||||
}
|
||||
unset($i03);
|
||||
|
||||
$hp = -$hp;
|
||||
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] -= $hp;
|
||||
|
||||
if ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] < 0) {
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = 0;
|
||||
} elseif ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] > $btl->stats[$btl->uids[$u->info['id']]]['hpAll']) {
|
||||
$hp = ceil($hp - ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] - $btl->stats[$btl->uids[$u->info['id']]]['hpAll']));
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpAll'];
|
||||
}
|
||||
|
||||
if ($hp < 0) {
|
||||
$hp = '+' . (-$hp);
|
||||
} elseif ($hp == 0) {
|
||||
$hp = '--';
|
||||
} else {
|
||||
$hp = '-' . $hp;
|
||||
}
|
||||
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u->info['sex'] . '||t1=' . $u->info['team'] . '||login1=' . $u->info['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>". <b><font color=#006699>' . $hp . '</font></b> [' . floor($btl->stats[$btl->uids[$u->info['id']]]['hpNow']) . '/' . $btl->stats[$btl->uids[$u->info['id']]]['hpAll'] . ']';
|
||||
$btl->add_log($mas1);
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
$u->info['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $btl->stats[$btl->uids[$u->info['id']]]['hpNow'] . '",`tactic1` ="0",`tactic2` ="0",`tactic3` ="0",`tactic4` ="0",`tactic5` ="0",`tactic6` ="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
|
||||
unset($hp021);
|
||||
} elseif ($pl['id'] == 221) {
|
||||
//Отменить
|
||||
$hp = $btl->users[$btl->uids[$u->info['id']]]['last_hp'];
|
||||
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] -= $hp;
|
||||
|
||||
if ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] < 0) {
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = 0;
|
||||
} elseif ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] > $btl->stats[$btl->uids[$u->info['id']]]['hpAll']) {
|
||||
$hp = ceil($hp - ($btl->stats[$btl->uids[$u->info['id']]]['hpNow'] - $btl->stats[$btl->uids[$u->info['id']]]['hpAll']));
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpAll'];
|
||||
}
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['last_hp'] = 0;
|
||||
|
||||
if ($hp < 0) {
|
||||
$hp = '+' . (-$hp);
|
||||
} elseif ($hp == 0) {
|
||||
$hp = '--';
|
||||
} else {
|
||||
$hp = '-' . $hp;
|
||||
}
|
||||
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u->info['sex'] . '||t1=' . $u->info['team'] . '||login1=' . $u->info['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>". <b><font color=#006699>' . $hp . '</font></b> [' . floor($btl->stats[$btl->uids[$u->info['id']]]['hpNow']) . '/' . $btl->stats[$btl->uids[$u->info['id']]]['hpAll'] . ']';
|
||||
$btl->add_log($mas1);
|
||||
|
||||
$btl->users[$btl->uids[$u->info['id']]]['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
$u->info['hpNow'] = $btl->stats[$btl->uids[$u->info['id']]]['hpNow'];
|
||||
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $btl->stats[$btl->uids[$u->info['id']]]['hpNow'] . '",`last_hp` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
|
||||
unset($hp021);
|
||||
} elseif ($pl['priem']['id'] == 220) {
|
||||
//Ставка на опережение
|
||||
if (!isset($this->del_val['eff'][$pl['id']])) {
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $u2['sex'] . '||t2=' . $u2['team'] . '||login2=' . $u2['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => ($this->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" на персонажа {u2} и украл все активные приемы.';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$pl['delete'] = time();
|
||||
$sp031 = mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "' . $u2['id'] . '" AND `delete` = 0 AND `v1` = "priem" LIMIT 20');
|
||||
$pr78 = 0;
|
||||
while ($pl031 = mysql_fetch_array($sp031)) {
|
||||
if (mysql_query('UPDATE `eff_users` SET `uid` = "' . $u1['id'] . '" WHERE `id` = "' . $pl031['id'] . '" LIMIT 1')) {
|
||||
//$mas1['text'] = '{tm1} {u1} Украл активный прием "<b>'.$pl031['name'].'</b>" у {u2}';
|
||||
//$this->add_log($mas1);
|
||||
$pr78++;
|
||||
}
|
||||
}
|
||||
if ($pr78 > 0) {
|
||||
$this->stats[$this->uids[$u1['id']]] = $u->getStats($u1['id'], 0);
|
||||
$this->stats[$this->uids[$u2['id']]] = $u->getStats($u2['id'], 0);
|
||||
$this->re_pd['restart'] = true;
|
||||
}
|
||||
unset($pr78, $vLog, $mas1, $pl031, $sp031);
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 217) {
|
||||
//разгадать тактику
|
||||
if (!isset($this->del_val['eff'][$pl['id']])) {
|
||||
$this->del_val['eff'][$pl['id']] = true;
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $u2['sex'] . '||t2=' . $u2['team'] . '||login2=' . $u2['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => ($this->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" на персонажа {u2}.';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$pl['delete'] = time();
|
||||
$sp031 = mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "' . $u2['id'] . '" AND `delete` = 0 AND `v1` = "priem" AND `v2` != 201 AND `v2` != 211 LIMIT 20');
|
||||
$pr78 = 0;
|
||||
while ($pl031 = mysql_fetch_array($sp031)) {
|
||||
if (mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '",`uid` = "0" WHERE `id` = "' . $pl031['id'] . '" LIMIT 1')) {
|
||||
$mas1['text'] = '{tm1} Закончилось действие приема "<b>' . $pl031['name'] . '</b>" для {u2}.';
|
||||
$this->pr_not_use[$pl031['id']] = 1;
|
||||
$this->add_log($mas1);
|
||||
$pr78++;
|
||||
}
|
||||
}
|
||||
|
||||
unset($pr78, $vLog, $mas1, $pl031, $sp031);
|
||||
}
|
||||
} elseif ($pl['id'] == 12) {
|
||||
//прием подлый удар
|
||||
$hpmin = $u->info['level'] * 5;
|
||||
} elseif ($pl['id'] == 271) {
|
||||
//прием Прорыв 1\3 урона оружием
|
||||
$tp_atk = $btl->weaponTx($btl->stats[$btl->uids[$u->info['id']]]['items'][$btl->stats[$btl->uids[$u->info['id']]]['wp3id']]);
|
||||
//$tp_atk = 0;
|
||||
$yi_atk = $btl->weaponAt22($btl->stats[$btl->uids[$u->info['id']]]['items'][$btl->stats[$btl->uids[$u->info['id']]]['wp3id']], $btl->stats[$btl->uids[$u->info['id']]], $tp_atk);
|
||||
$hpmin = $btl->yrn($btl->stats[$btl->uids[$u->info['id']]], $btl->stats[$btl->uids[$u->info['enemy']]], $btl->users[$btl->uids[$u->info['id']]], $btl->users[$btl->uids[$u->info['enemy']]], $btl->stats[$btl->uids[$u->info['id']]]['lvl'], $btl->stats[$btl->uids[$u->info['enemy']]]['lvl'], $tp_atk, $yi_atk[0], $yi_atk[1], 0, 0, 0, 0, $btl->stats[$btl->uids[$u->info['id']]]['m3'], 0, 0, 0);
|
||||
$hpmin = rand($hpmin['min'], $hpmin['max']);
|
||||
} elseif ($pl['id'] == 212) {
|
||||
//Ограниченный маневр
|
||||
$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 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" на персонажа {u2}';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
mysql_query('UPDATE `stats` SET `smena` = "-1" WHERE `id` = "' . $u->info['enemy'] . '" LIMIT 1');
|
||||
} elseif ($pl['id'] == 46) {
|
||||
//заносим в лог боя
|
||||
if (isset($this->ue['id'], $btl->users[$btl->uids[$this->ue['id']]]) && ($btl->users[$btl->uids[$this->ue['id']]]['team'] != $u->info['team'] && $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] >= 1)) {
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u->info['sex'] . '||t1=' . $u->info['team'] . '||login1=' . $u->info['login'] . '||s2=' . $btl->users[$btl->uids[$this->ue['id']]]['sex'] . '||t2=' . $btl->users[$btl->uids[$this->ue['id']]]['team'] . '||login2=' . $btl->users[$btl->uids[$this->ue['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>". (Новая цель: {u2})';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
$u->info['enemy'] = $this->ue['id'];
|
||||
mysql_query('UPDATE `stats` SET `enemy` = "' . $u->info['enemy'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 49) {
|
||||
//восстанавливаем 5НР за каждый лвл противника
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] += $this->users[$this->uids[$pl['uid']]]['level'] * 5;
|
||||
$hp = $u2['level'] * 5;
|
||||
if ($this->stats[$this->uids[$pl['uid']]]['hpNow'] < 0) {
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] = 0;
|
||||
} elseif ($this->stats[$this->uids[$pl['uid']]]['hpNow'] > $this->stats[$this->uids[$pl['uid']]]['hpAll']) {
|
||||
$hp = ceil($hp - ($this->stats[$this->uids[$pl['uid']]]['hpNow'] - $this->stats[$this->uids[$pl['uid']]]['hpAll']));
|
||||
$this->stats[$this->uids[$pl['uid']]]['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpAll'];
|
||||
}
|
||||
|
||||
if ($hp > 0) {
|
||||
$btl->users[$btl->uids[$pl['uid']]]['last_hp'] = $hp;
|
||||
}
|
||||
|
||||
if ($hp > 0) {
|
||||
$hp = '+' . $hp;
|
||||
} else {
|
||||
$hp = '--';
|
||||
}
|
||||
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>". <b><font color=#006699>' . $hp . '</font></b> [' . floor($this->stats[$this->uids[$pl['uid']]]['hpNow']) . '/' . $this->stats[$this->uids[$pl['uid']]]['hpAll'] . ']';
|
||||
|
||||
$this->users[$this->uids[$pl['uid']]]['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpNow'];
|
||||
if ($pl['uid'] == $u->info['id']) {
|
||||
$u->info['hpNow'] = $this->stats[$this->uids[$pl['uid']]]['hpNow'];
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$this->uids[$pl['uid']]]['hpNow'] . '",`last_hp` = "' . $btl->users[$btl->uids[$pl['uid']]]['last_hp'] . '" WHERE `id` = "' . $pl['uid'] . '" LIMIT 1');
|
||||
} elseif ($pl['priem']['id'] == 211) {
|
||||
//Агрессивная защита
|
||||
$hp = 3 * $u1['level'];
|
||||
if ($hp > 0) {
|
||||
$this->users[$this->uids[$u2['id']]]['last_hp'] = -$hp;
|
||||
$this->stats[$this->uids[$u2['id']]]['hpNow'] -= $hp;
|
||||
$s2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$p2['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
$this->users[$this->uids[$u2['id']]]['hpNow'] = $this->stats[$this->uids[$u2['id']]]['hpNow'];
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$this->uids[$u2['id']]]['hpNow'] . '",`last_hp` = "' . $this->users[$this->uids[$u2['id']]]['last_hp'] . '" WHERE `id` = "' . $u2['id'] . '" LIMIT 1');
|
||||
$this->stats[$this->uids[$u2['uid']]] = $u->getStats($u2['uid'], 0);
|
||||
$hp = -$hp;
|
||||
} else {
|
||||
$hp = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u2} утратил здоровье от приема "<b>' . $pl['name'] . '</b>". <b><font color=#006699>' . $hp . '</font></b> [' . floor($this->stats[$this->uids[$u2['id']]]['hpNow']) . '/' . $this->stats[$this->uids[$u2['id']]]['hpAll'] . ']';
|
||||
}
|
||||
|
||||
//отнимаем НР у противника
|
||||
if(isset($hpmin) && $hpmin>0 && $u->info['enemy']>0)
|
||||
{
|
||||
$hp2 = floor($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] - $hpmin);
|
||||
|
||||
/* проверяем приемы защиты */
|
||||
//получаем массив с приемами противника
|
||||
$miny = 0; //на сколько едениц урон буде меньше (защита приема)
|
||||
$minu = 0;
|
||||
$sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "'.$u->info['enemy'].'" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25');
|
||||
while($pl2 = mysql_fetch_array($sp1))
|
||||
{
|
||||
$pl2['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$pl2['v2'].'" LIMIT 1'));
|
||||
if(isset($pl2['priem']['id']))
|
||||
{
|
||||
$dt1 = \Core\ConversionHelper::dataStringToArray($pl2['priem']['date2']);
|
||||
if(isset($dt1['yron_u2']))
|
||||
{
|
||||
$minu = getdr($dt1['yron_u2'],array(0=>'lvl1',1=>'yr1'),array(0=>$u->info['level'],1=>$hpmin));
|
||||
$miny -= $minu;
|
||||
$hpmin += $minu;
|
||||
$btl->delPriem($pl2,$btl->users[$btl->uids[$u->info['enemy']]]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* проверяем приемы ослабления */
|
||||
|
||||
//отнимаем НР
|
||||
if($hpmin > 0) {
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] = -$hpmin;
|
||||
}
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['hpNow'] = $hp2;
|
||||
$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] = $hp2;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = '.$hp2.',`last_hp` = "'.$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'].'" WHERE `id` = "'.$u->info['enemy'].'" LIMIT 1');
|
||||
|
||||
//заносим в лог боя
|
||||
$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+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
if($hpmin>0)
|
||||
{
|
||||
$hpmin = '-'.$hpmin;
|
||||
}else{
|
||||
$hpmin = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" и {1x5x1} по {u2}. <b><font color=#006699>'.$hpmin.'</font></b> ['.ceil($hp2).'/'.$btl->stats[$btl->uids[$u->info['enemy']]]['hpAll'].']';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
if (isset($hpmin) && $hpmin > 0 && $u->info['enemy'] > 0) {
|
||||
$hp2 = floor($btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] - $hpmin);
|
||||
|
||||
/* проверяем приемы защиты */
|
||||
//получаем массив с приемами противника
|
||||
$miny = 0; //на сколько едениц урон буде меньше (защита приема)
|
||||
$minu = 0;
|
||||
$sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "' . $u->info['enemy'] . '" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25');
|
||||
while ($pl2 = mysql_fetch_array($sp1)) {
|
||||
$pl2['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1'));
|
||||
if (isset($pl2['priem']['id'])) {
|
||||
$dt1 = Helper\Conversion::dataStringToArray($pl2['priem']['date2']);
|
||||
if (isset($dt1['yron_u2'])) {
|
||||
$minu = getdr($dt1['yron_u2'], [0 => 'lvl1', 1 => 'yr1'], [0 => $u->info['level'], 1 => $hpmin]);
|
||||
$miny -= $minu;
|
||||
$hpmin += $minu;
|
||||
$btl->delPriem($pl2, $btl->users[$btl->uids[$u->info['enemy']]]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* проверяем приемы ослабления */
|
||||
|
||||
//отнимаем НР
|
||||
if ($hpmin > 0) {
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] = -$hpmin;
|
||||
}
|
||||
$btl->users[$btl->uids[$u->info['enemy']]]['hpNow'] = $hp2;
|
||||
$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] = $hp2;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`last_hp` = "' . $btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] . '" WHERE `id` = "' . $u->info['enemy'] . '" LIMIT 1');
|
||||
|
||||
//заносим в лог боя
|
||||
$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 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => ($btl->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
if ($hpmin > 0) {
|
||||
$hpmin = '-' . $hpmin;
|
||||
} else {
|
||||
$hpmin = '--';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и {1x5x1} по {u2}. <b><font color=#006699>' . $hpmin . '</font></b> [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$u->info['enemy']]]['hpAll'] . ']';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}
|
||||
?>
|
||||
+375
-412
@@ -1,423 +1,386 @@
|
||||
<?php
|
||||
if(!defined('GAME'))
|
||||
{
|
||||
die();
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
$hpadd_pr_color = '';
|
||||
|
||||
if(isset($hod)) {
|
||||
/*ПРИЕМЫ КАЖДЫЙ ХОД*/
|
||||
$krituetli = 0;
|
||||
|
||||
if($pr['id']==231 && isset($hod))
|
||||
{
|
||||
//Глухая защита (восстанавливаем НР)
|
||||
$hpadd_pr = floor(round($u->stats['hpAll']/100*15)/6);
|
||||
$hpadd_pr_color = 'green';
|
||||
$trduh = 1;
|
||||
$btl->users[$btl->uids[$ue['id']]]['tactic7'] -= round((1.5/6),2);
|
||||
if($btl->users[$btl->uids[$ue['id']]]['tactic7'] < 0) {
|
||||
$btl->users[$btl->uids[$ue['id']]]['tactic7'] = 0;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `tactic7` = "'.$btl->users[$btl->uids[$ue['id']]]['tactic7'].'" WHERE `id` = "'.$ue['id'].'" LIMIT 1');
|
||||
}
|
||||
|
||||
if($hpadd > 0)
|
||||
{
|
||||
$pl['name'] = $pr['name'];
|
||||
}
|
||||
|
||||
/*ПРИЕМЫ КАЖДЫЙ ХОД*/
|
||||
}elseif($pl['id']==231) {
|
||||
//Глухая защита
|
||||
$re = $this->addPriem($u->info['id'],$pl['id'],-1,0,77,6,$u->info['id'],1,'глухаязащита',0,1);
|
||||
}elseif($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['priem']['id']==189)
|
||||
{
|
||||
//Ошеломить
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u2['id'].'" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//echo $u2['id'];
|
||||
if($imun){
|
||||
$cup = true;
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$this->users[$this->uids[$u2['id']]]['sex'].'||t2='.$this->users[$this->uids[$u2['id']]]['team'].'||login2='.$this->users[$this->uids[$u2['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>$this->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>", но у {u2} иммунитет к ошеломлению.';
|
||||
}elseif($this->stats[$this->uids[$u2['id']]]['hpNow']>=1) {
|
||||
//ошеломить
|
||||
$re = $priem->addPriem($u2['id'],230,'add_m10=-100|add_m11=-100',0,77,2,$u1['id'],2,'ошеломить');
|
||||
$re = $priem->addPriem($u2['id'],191,'',0,77,6,$u1['id'],5,'иммунитеткошеломить');
|
||||
if($re==false)
|
||||
{
|
||||
echo '[Er::Ошеломить[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if($u1['sex']==1)
|
||||
{
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$this->users[$this->uids[$u2['id']]]['sex'].'||t2='.$this->users[$this->uids[$u2['id']]]['team'].'||login2='.$this->users[$this->uids[$u2['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>$this->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" и ошеломил'.$sx.' {u2} на два хода.';
|
||||
$pz = $this->users[$this->uids[$u2['id']]]['priems_z'];
|
||||
$p_id = $this->users[$this->uids[$u2['id']]]['priems'];
|
||||
$pz = explode('|',$pz);
|
||||
$p_id = explode('|',$p_id);
|
||||
$i = 0;
|
||||
while($i<=30)
|
||||
{
|
||||
if($p_id[$i]>=195 and $p_id[$i]<=198){
|
||||
$pz[$i]=$pz[$i];
|
||||
}else{
|
||||
$pz[$i] += 2;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pz = implode('|',$pz);
|
||||
$this->users[$this->uids[$u2['id']]]['priems_z'] = $pz;
|
||||
unset($pz);
|
||||
mysql_query('UPDATE `stats` SET `priems_z` = "'.$this->users[$this->uids[$u2['id']]]['priems_z'].'" WHERE `id` = "'.$u2['id'].'" LIMIT 1');
|
||||
//$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}
|
||||
}elseif($pl['priem']['id']==235)
|
||||
{
|
||||
//Шокирующий удар
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u2['id'].'" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//echo $u2['id'];
|
||||
if($imun){
|
||||
$cup = true;
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$this->users[$this->uids[$u2['id']]]['sex'].'||t2='.$this->users[$this->uids[$u2['id']]]['team'].'||login2='.$this->users[$this->uids[$u2['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>$this->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>", но у {u2} иммунитет к ошеломлению.';
|
||||
}elseif($this->stats[$this->uids[$u2['id']]]['hpNow']>=1) {
|
||||
//ошеломить
|
||||
$re = $priem->addPriem($u2['id'],236,'add_notactic=1',0,77,2,$u1['id'],2,'шокирующийудар');
|
||||
$re = $priem->addPriem($u2['id'],191,'',0,77,6,$u1['id'],5,'иммунитеткошеломить');
|
||||
if($re==false)
|
||||
{
|
||||
echo '[Er::ШокирующийУдар[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if($u1['sex']==1)
|
||||
{
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$this->users[$this->uids[$u2['id']]]['sex'].'||t2='.$this->users[$this->uids[$u2['id']]]['team'].'||login2='.$this->users[$this->uids[$u2['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>$this->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" и ошеломил'.$sx.' {u2} на два хода.';
|
||||
$pz = $this->users[$this->uids[$u2['id']]]['priems_z'];
|
||||
$p_id = $this->users[$this->uids[$u2['id']]]['priems'];
|
||||
$pz = explode('|',$pz);
|
||||
$p_id = explode('|',$p_id);
|
||||
$i = 0;
|
||||
while($i<=30)
|
||||
{
|
||||
if($p_id[$i]>=195 and $p_id[$i]<=198){
|
||||
$pz[$i]=$pz[$i];
|
||||
}else{
|
||||
$pz[$i] += 2;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pz = implode('|',$pz);
|
||||
$this->users[$this->uids[$u2['id']]]['priems_z'] = $pz;
|
||||
unset($pz);
|
||||
mysql_query('UPDATE `stats` SET `priems_z` = "'.$this->users[$this->uids[$u2['id']]]['priems_z'].'" WHERE `id` = "'.$u2['id'].'" LIMIT 1');
|
||||
//$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}
|
||||
}elseif($pl['priem']['id']==237)
|
||||
{
|
||||
//Разведка боем
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "'.$u2['id'].'" and `v2`="237" and `delete`="0" LIMIT 1'));
|
||||
if(isset($imun['id'])) {
|
||||
mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$imun['id'].'" LIMIT 1');
|
||||
}
|
||||
//Разведка боем
|
||||
$re = $priem->addPriem($u2['id'],238,'add_notactic=1',0,77,4,$u1['id'],5,'разведкабоем');
|
||||
if($re==false)
|
||||
{
|
||||
echo '[Er::РазведкаБоем[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if($u1['sex']==1)
|
||||
{
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1='.time().'||s1='.$u1['sex'].'||t1='.$u1['team'].'||login1='.$u1['login'].'||s2='.$this->users[$this->uids[$u2['id']]]['sex'].'||t2='.$this->users[$this->uids[$u2['id']]]['team'].'||login2='.$this->users[$this->uids[$u2['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>$this->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pl['name'].'</b>" и раскрыл'.$sx.' тактику {u2} на пять ходов.';
|
||||
}elseif($pl['priem']['id']==239)
|
||||
{
|
||||
//Поступь смерти
|
||||
$pl['data_re'] = \Core\ConversionHelper::dataStringToArray($pl['data']);
|
||||
if($pl['data_re']['step'] < 10) {
|
||||
$pl['data_re']['add_maxAtack'] += $this->users[$this->uids[$pl['uid']]]['level'];
|
||||
$pl['data_re']['step']++;
|
||||
}
|
||||
$pl['data'] = 'add_maxAtack='.$pl['data_re']['add_maxAtack'].'|step='.$pl['data_re']['step'].'';
|
||||
$pl['hod'] = 2;
|
||||
$this->rehodeff[$pl['id']] = $pl['hod'];
|
||||
mysql_query('UPDATE `eff_users` SET `hod` = "'.$pl['hod'].'",`data` = "'.$pl['data'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
|
||||
unset($pl['data_re']);
|
||||
|
||||
}elseif($pl['priem']['id']==240)
|
||||
{
|
||||
//Хлебнуть Крови
|
||||
$pl['data_re'] = \Core\ConversionHelper::dataStringToArray($pl['data']);
|
||||
if(isset($pl['data_re']['step']) || $pl['data_re']['step'] == 0) {
|
||||
//Добавляем силу
|
||||
if($this->users[$this->uids[$u2['id']]]['level'] == 7) {
|
||||
$pl['data_re']['add_s1'] = 10;
|
||||
}elseif($this->users[$this->uids[$u2['id']]]['level'] == 8) {
|
||||
$pl['data_re']['add_s1'] = 13;
|
||||
}elseif($this->users[$this->uids[$u2['id']]]['level'] >= 9) {
|
||||
$pl['data_re']['add_s1'] = 14;
|
||||
}
|
||||
}
|
||||
$pl['data_re']['step']++;
|
||||
if($pl['data_re']['add_s1'] > 0) {
|
||||
$pl['data'] = 'add_s1='.$pl['data_re']['add_s1'].'|atck_krit_to_atck=1|step='.$pl['data_re']['step'].'';
|
||||
}else{
|
||||
$pl['data'] = 'atck_krit_to_atck=1|step='.$pl['data_re']['step'];
|
||||
}
|
||||
|
||||
if($pl['hod'] == -1) {
|
||||
$pl['hod'] = 4;
|
||||
$this->rehodeff[$pl['id']] = $pl['hod'];
|
||||
//Хиляемся
|
||||
$hpadd_pl = $yrn*0.679;
|
||||
$pl['data_re']['step']++;
|
||||
}elseif($pl['data_re']['step'] == 2 || $pl['data_re']['step'] == 3) {
|
||||
//Хиляемся еще 2 хода от любых ударов
|
||||
$hpadd_pl = $yrn*0.573;
|
||||
$pl['data_re']['step']++;
|
||||
}else{
|
||||
//$hpadd_pl = $yrn;
|
||||
}
|
||||
|
||||
if($hpadd_pl > 0) {
|
||||
if($this->users[$this->uids[$u2['id']]]['level'] <= 8) {
|
||||
if($hpadd_pl > 107) {
|
||||
$hpadd_pl = 107;
|
||||
}
|
||||
}elseif($this->users[$this->uids[$u2['id']]]['level'] == 9) {
|
||||
if($hpadd_pl > 128) {
|
||||
$hpadd_pl = 128;
|
||||
}
|
||||
}elseif($this->users[$this->uids[$u2['id']]]['level'] >= 10) {
|
||||
if($hpadd_pl > 154) {
|
||||
$hpadd_pl = 154;
|
||||
}
|
||||
}
|
||||
$plname = $pl['name'];
|
||||
$hid = $u1['id'];
|
||||
}
|
||||
|
||||
$this->pr_reset['data'][$pl['id']] = $pl['data'];
|
||||
|
||||
mysql_query('UPDATE `eff_users` SET `hod` = "'.$pl['hod'].'",`data` = "'.$pl['data'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
unset($pl['data_re']);
|
||||
|
||||
}elseif($pl['id']==192){
|
||||
if (isset($hod)) {
|
||||
/*ПРИЕМЫ КАЖДЫЙ ХОД*/
|
||||
$krituetli = 0;
|
||||
|
||||
$i=0;
|
||||
$add_where='';
|
||||
while($i<count($btl->users)){
|
||||
if($btl->users[$i]['team']==$btl->users[$btl->uids[$u->info['id']]]['team']){
|
||||
$add_where.=' AND `user_use`!="'.$btl->users[$i]['id'].'"';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($pr['id'] == 231 && isset($hod)) {
|
||||
//Глухая защита (восстанавливаем НР)
|
||||
$hpadd_pr = floor(round($u->stats['hpAll'] / 100 * 15) / 6);
|
||||
$hpadd_pr_color = 'green';
|
||||
$trduh = 1;
|
||||
$btl->users[$btl->uids[$ue['id']]]['tactic7'] -= round((1.5 / 6), 2);
|
||||
if ($btl->users[$btl->uids[$ue['id']]]['tactic7'] < 0) {
|
||||
$btl->users[$btl->uids[$ue['id']]]['tactic7'] = 0;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `tactic7` = "' . $btl->users[$btl->uids[$ue['id']]]['tactic7'] . '" WHERE `id` = "' . $ue['id'] . '" LIMIT 1');
|
||||
}
|
||||
|
||||
//Ограничиваем конкретными приемами
|
||||
/*
|
||||
приёмом "Очиститься кровью" можно снять: пожирающее пламя, переохлаждение, ядовитое облако, кристаллизация, отравление, цель огня, цель воды, цель воздуха и цель земли.
|
||||
*/
|
||||
$add_where .= ' AND (`name` LIKE "Цель Воды%" OR `name` LIKE "Цель Огня%" OR `name` LIKE "Цель Воздуха%" OR `name` LIKE "Цель Земли%"
|
||||
if ($hpadd > 0) {
|
||||
$pl['name'] = $pr['name'];
|
||||
}
|
||||
|
||||
/*ПРИЕМЫ КАЖДЫЙ ХОД*/
|
||||
} elseif ($pl['id'] == 231) {
|
||||
//Глухая защита
|
||||
$re = $this->addPriem($u->info['id'], $pl['id'], -1, 0, 77, 6, $u->info['id'], 1, 'глухаязащита', 0, 1);
|
||||
} elseif ($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['priem']['id'] == 189) {
|
||||
//Ошеломить
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u2['id'] . '" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//echo $u2['id'];
|
||||
if ($imun) {
|
||||
$cup = true;
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $this->users[$this->uids[$u2['id']]]['sex'] . '||t2=' . $this->users[$this->uids[$u2['id']]]['team'] . '||login2=' . $this->users[$this->uids[$u2['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => $this->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>", но у {u2} иммунитет к ошеломлению.';
|
||||
} elseif ($this->stats[$this->uids[$u2['id']]]['hpNow'] >= 1) {
|
||||
//ошеломить
|
||||
$re = $priem->addPriem($u2['id'], 230, 'add_m10=-100|add_m11=-100', 0, 77, 2, $u1['id'], 2, 'ошеломить');
|
||||
$re = $priem->addPriem($u2['id'], 191, '', 0, 77, 6, $u1['id'], 5, 'иммунитеткошеломить');
|
||||
if ($re == false) {
|
||||
echo '[Er::Ошеломить[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if ($u1['sex'] == 1) {
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $this->users[$this->uids[$u2['id']]]['sex'] . '||t2=' . $this->users[$this->uids[$u2['id']]]['team'] . '||login2=' . $this->users[$this->uids[$u2['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => $this->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и ошеломил' . $sx . ' {u2} на два хода.';
|
||||
$pz = $this->users[$this->uids[$u2['id']]]['priems_z'];
|
||||
$p_id = $this->users[$this->uids[$u2['id']]]['priems'];
|
||||
$pz = explode('|', $pz);
|
||||
$p_id = explode('|', $p_id);
|
||||
$i = 0;
|
||||
while ($i <= 30) {
|
||||
if ($p_id[$i] >= 195 and $p_id[$i] <= 198) {
|
||||
$pz[$i] = $pz[$i];
|
||||
} else {
|
||||
$pz[$i] += 2;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pz = implode('|', $pz);
|
||||
$this->users[$this->uids[$u2['id']]]['priems_z'] = $pz;
|
||||
unset($pz);
|
||||
mysql_query('UPDATE `stats` SET `priems_z` = "' . $this->users[$this->uids[$u2['id']]]['priems_z'] . '" WHERE `id` = "' . $u2['id'] . '" LIMIT 1');
|
||||
//$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 235) {
|
||||
//Шокирующий удар
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u2['id'] . '" and `v2`="191" and `delete`="0" LIMIT 1'));
|
||||
//echo $u2['id'];
|
||||
if ($imun) {
|
||||
$cup = true;
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $this->users[$this->uids[$u2['id']]]['sex'] . '||t2=' . $this->users[$this->uids[$u2['id']]]['team'] . '||login2=' . $this->users[$this->uids[$u2['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => $this->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>", но у {u2} иммунитет к ошеломлению.';
|
||||
} elseif ($this->stats[$this->uids[$u2['id']]]['hpNow'] >= 1) {
|
||||
//ошеломить
|
||||
$re = $priem->addPriem($u2['id'], 236, 'add_notactic=1', 0, 77, 2, $u1['id'], 2, 'шокирующийудар');
|
||||
$re = $priem->addPriem($u2['id'], 191, '', 0, 77, 6, $u1['id'], 5, 'иммунитеткошеломить');
|
||||
if ($re == false) {
|
||||
echo '[Er::ШокирующийУдар[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if ($u1['sex'] == 1) {
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $this->users[$this->uids[$u2['id']]]['sex'] . '||t2=' . $this->users[$this->uids[$u2['id']]]['team'] . '||login2=' . $this->users[$this->uids[$u2['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => $this->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и ошеломил' . $sx . ' {u2} на два хода.';
|
||||
$pz = $this->users[$this->uids[$u2['id']]]['priems_z'];
|
||||
$p_id = $this->users[$this->uids[$u2['id']]]['priems'];
|
||||
$pz = explode('|', $pz);
|
||||
$p_id = explode('|', $p_id);
|
||||
$i = 0;
|
||||
while ($i <= 30) {
|
||||
if ($p_id[$i] >= 195 and $p_id[$i] <= 198) {
|
||||
$pz[$i] = $pz[$i];
|
||||
} else {
|
||||
$pz[$i] += 2;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pz = implode('|', $pz);
|
||||
$this->users[$this->uids[$u2['id']]]['priems_z'] = $pz;
|
||||
unset($pz);
|
||||
mysql_query('UPDATE `stats` SET `priems_z` = "' . $this->users[$this->uids[$u2['id']]]['priems_z'] . '" WHERE `id` = "' . $u2['id'] . '" LIMIT 1');
|
||||
//$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}
|
||||
} elseif ($pl['priem']['id'] == 237) {
|
||||
//Разведка боем
|
||||
$imun = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "' . $u2['id'] . '" and `v2`="237" and `delete`="0" LIMIT 1'));
|
||||
if (isset($imun['id'])) {
|
||||
mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $imun['id'] . '" LIMIT 1');
|
||||
}
|
||||
//Разведка боем
|
||||
$re = $priem->addPriem($u2['id'], 238, 'add_notactic=1', 0, 77, 4, $u1['id'], 5, 'разведкабоем');
|
||||
if ($re == false) {
|
||||
echo '[Er::РазведкаБоем[xX]]';
|
||||
}
|
||||
$sx = '';
|
||||
if ($u1['sex'] == 1) {
|
||||
$sx = 'а';
|
||||
}
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . '||s2=' . $this->users[$this->uids[$u2['id']]]['sex'] . '||t2=' . $this->users[$this->uids[$u2['id']]]['team'] . '||login2=' . $this->users[$this->uids[$u2['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => $this->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pl['name'] . '</b>" и раскрыл' . $sx . ' тактику {u2} на пять ходов.';
|
||||
} elseif ($pl['priem']['id'] == 239) {
|
||||
//Поступь смерти
|
||||
$pl['data_re'] = Helper\Conversion::dataStringToArray($pl['data']);
|
||||
if ($pl['data_re']['step'] < 10) {
|
||||
$pl['data_re']['add_maxAtack'] += $this->users[$this->uids[$pl['uid']]]['level'];
|
||||
$pl['data_re']['step']++;
|
||||
}
|
||||
$pl['data'] = 'add_maxAtack=' . $pl['data_re']['add_maxAtack'] . '|step=' . $pl['data_re']['step'] . '';
|
||||
$pl['hod'] = 2;
|
||||
$this->rehodeff[$pl['id']] = $pl['hod'];
|
||||
mysql_query('UPDATE `eff_users` SET `hod` = "' . $pl['hod'] . '",`data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
|
||||
unset($pl['data_re']);
|
||||
|
||||
} elseif ($pl['priem']['id'] == 240) {
|
||||
//Хлебнуть Крови
|
||||
$pl['data_re'] = Helper\Conversion::dataStringToArray($pl['data']);
|
||||
if (isset($pl['data_re']['step']) || $pl['data_re']['step'] == 0) {
|
||||
//Добавляем силу
|
||||
if ($this->users[$this->uids[$u2['id']]]['level'] == 7) {
|
||||
$pl['data_re']['add_s1'] = 10;
|
||||
} elseif ($this->users[$this->uids[$u2['id']]]['level'] == 8) {
|
||||
$pl['data_re']['add_s1'] = 13;
|
||||
} elseif ($this->users[$this->uids[$u2['id']]]['level'] >= 9) {
|
||||
$pl['data_re']['add_s1'] = 14;
|
||||
}
|
||||
}
|
||||
$pl['data_re']['step']++;
|
||||
if ($pl['data_re']['add_s1'] > 0) {
|
||||
$pl['data'] = 'add_s1=' . $pl['data_re']['add_s1'] . '|atck_krit_to_atck=1|step=' . $pl['data_re']['step'] . '';
|
||||
} else {
|
||||
$pl['data'] = 'atck_krit_to_atck=1|step=' . $pl['data_re']['step'];
|
||||
}
|
||||
|
||||
if ($pl['hod'] == -1) {
|
||||
$pl['hod'] = 4;
|
||||
$this->rehodeff[$pl['id']] = $pl['hod'];
|
||||
//Хиляемся
|
||||
$hpadd_pl = $yrn * 0.679;
|
||||
$pl['data_re']['step']++;
|
||||
} elseif ($pl['data_re']['step'] == 2 || $pl['data_re']['step'] == 3) {
|
||||
//Хиляемся еще 2 хода от любых ударов
|
||||
$hpadd_pl = $yrn * 0.573;
|
||||
$pl['data_re']['step']++;
|
||||
} else {
|
||||
//$hpadd_pl = $yrn;
|
||||
}
|
||||
|
||||
if ($hpadd_pl > 0) {
|
||||
if ($this->users[$this->uids[$u2['id']]]['level'] <= 8) {
|
||||
if ($hpadd_pl > 107) {
|
||||
$hpadd_pl = 107;
|
||||
}
|
||||
} elseif ($this->users[$this->uids[$u2['id']]]['level'] == 9) {
|
||||
if ($hpadd_pl > 128) {
|
||||
$hpadd_pl = 128;
|
||||
}
|
||||
} elseif ($this->users[$this->uids[$u2['id']]]['level'] >= 10) {
|
||||
if ($hpadd_pl > 154) {
|
||||
$hpadd_pl = 154;
|
||||
}
|
||||
}
|
||||
$plname = $pl['name'];
|
||||
$hid = $u1['id'];
|
||||
}
|
||||
|
||||
$this->pr_reset['data'][$pl['id']] = $pl['data'];
|
||||
|
||||
mysql_query('UPDATE `eff_users` SET `hod` = "' . $pl['hod'] . '",`data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
unset($pl['data_re']);
|
||||
|
||||
} elseif ($pl['id'] == 192) {
|
||||
|
||||
$i = 0;
|
||||
$add_where = '';
|
||||
while ($i < count($btl->users)) {
|
||||
if ($btl->users[$i]['team'] == $btl->users[$btl->uids[$u->info['id']]]['team']) {
|
||||
$add_where .= ' AND `user_use`!="' . $btl->users[$i]['id'] . '"';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
//Ограничиваем конкретными приемами
|
||||
/*
|
||||
приёмом "Очиститься кровью" можно снять: пожирающее пламя, переохлаждение, ядовитое облако, кристаллизация, отравление, цель огня, цель воды, цель воздуха и цель земли.
|
||||
*/
|
||||
$add_where .= ' AND (`name` LIKE "Цель Воды%" OR `name` LIKE "Цель Огня%" OR `name` LIKE "Цель Воздуха%" OR `name` LIKE "Цель Земли%"
|
||||
OR `name` LIKE "Пожирающее Пламя%" OR `name` LIKE "Переохлаждение%" OR `name` LIKE "Ядовитое Облако%" OR `name` LIKE "Кристаллизация%" OR `name` LIKE "%Отравление%" OR `name` LIKE "Искалечить%" OR `name` LIKE "Пришпилить%" ) ';
|
||||
|
||||
$dell = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `user_use`!= "" and `delete`="0" and `uid`="'.$u->info['id'].'" and `v1`="priem" '.$add_where.' LIMIT 1'));
|
||||
|
||||
if($dell){
|
||||
$dell['priem']['id']=$dell['id'];
|
||||
if($dell['x']==1){
|
||||
$btl->delPriem($dell,$u->info,99);
|
||||
}else{
|
||||
$i=0;
|
||||
$e = explode('|',$dell['data']);
|
||||
while($i<count($e)){
|
||||
$f = explode('=',$e[$i]);
|
||||
$stack=$f[1]/$dell['x'];//вычисляем влятельность заряда на х-ки
|
||||
$f[1]-=$stack;// отнимаем заряд
|
||||
$e[$i] = implode('=',$f);
|
||||
$i++;
|
||||
}
|
||||
$dell['data'] = implode('|',$e);
|
||||
$dell['x']--;
|
||||
|
||||
mysql_query('UPDATE `eff_users` SET `data` = "'.$dell['data'].'", `x`="'.$dell['x'].'" WHERE `id` = "'.$dell['id'].'"');
|
||||
$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');
|
||||
$mas1['text'] = '{u1} Ослабил эфект "<b>'.$dell['name'].'</b>" с помощью <b>Очиститься Кровью</b> .';
|
||||
$btl->add_log($mas1);
|
||||
}
|
||||
}
|
||||
$dell = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `user_use`!= "" and `delete`="0" and `uid`="' . $u->info['id'] . '" and `v1`="priem" ' . $add_where . ' LIMIT 1'));
|
||||
|
||||
if ($dell) {
|
||||
$dell['priem']['id'] = $dell['id'];
|
||||
if ($dell['x'] == 1) {
|
||||
$btl->delPriem($dell, $u->info, 99);
|
||||
} else {
|
||||
$i = 0;
|
||||
$e = explode('|', $dell['data']);
|
||||
while ($i < count($e)) {
|
||||
$f = explode('=', $e[$i]);
|
||||
$stack = $f[1] / $dell['x'];//вычисляем влятельность заряда на х-ки
|
||||
$f[1] -= $stack;// отнимаем заряд
|
||||
$e[$i] = implode('=', $f);
|
||||
$i++;
|
||||
}
|
||||
$dell['data'] = implode('|', $e);
|
||||
$dell['x']--;
|
||||
|
||||
mysql_query('UPDATE `eff_users` SET `data` = "' . $dell['data'] . '", `x`="' . $dell['x'] . '" WHERE `id` = "' . $dell['id'] . '"');
|
||||
$vLog = 'time1=' . time() . '||s1=' . $u->info['sex'] . '||t1=' . $u->info['team'] . '||login1=' . $u->info['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => $btl->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
$mas1['text'] = '{u1} Ослабил эфект "<b>' . $dell['name'] . '</b>" с помощью <b>Очиститься Кровью</b> .';
|
||||
$btl->add_log($mas1);
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'])) {
|
||||
if($btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'] > 100) {
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd = round($hpadd/100*(100+$btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
$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);
|
||||
}elseif(isset($hpadd_pr))
|
||||
{
|
||||
if($btl->stats[$btl->uids[$ue['id']]]['hpNow']+$hpadd_pr > $btl->stats[$btl->uids[$ue['id']]]['hpAll'])
|
||||
{
|
||||
$hpadd_pr = $btl->stats[$btl->uids[$ue['id']]]['hpAll']-$btl->stats[$btl->uids[$ue['id']]]['hpNow'];
|
||||
}
|
||||
if($trduh==1)
|
||||
{
|
||||
if($btl->users[$btl->uids[$ue['id']]]['tactic7']<=0)
|
||||
{
|
||||
$hpadd_pr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'])) {
|
||||
if($btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'] > 100) {
|
||||
$btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd_pr = round($hpadd_pr/100*(100+$btl->stats[$btl->uids[$ue['id']]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
if($u->info['id'] == $btl->users[$btl->uids[$ue['id']]]['id']) {
|
||||
$u->info['hpNow'] += $hpadd;
|
||||
$u->stats['hpNow'] += $hpadd;
|
||||
}
|
||||
$btl->users[$btl->uids[$ue['id']]]['hpNow'] += $hpadd_pr;
|
||||
$btl->stats[$btl->uids[$ue['id']]]['hpNow'] += $hpadd_pr;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = '.$btl->stats[$btl->uids[$ue['id']]]['hpNow'].' WHERE `id` = "'.$btl->users[$btl->uids[$ue['id']]]['id'].'" LIMIT 1');
|
||||
if($upd)
|
||||
{
|
||||
$vLog = 'time1='.time().'||s1='.$btl->users[$btl->uids[$ue['id']]]['sex'].'||t1='.$btl->users[$btl->uids[$ue['id']]]['team'].'||login1='.$btl->users[$btl->uids[$ue['id']]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>$btl->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
if($hpadd_pr>0)
|
||||
{
|
||||
$hpadd_pr = '+'.ceil($hpadd_pr);
|
||||
}else{
|
||||
$hpadd_pr = '--';
|
||||
}
|
||||
if($hpadd_pr_color == '') {
|
||||
$hpaa_pr_color = '#006699';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$pr['name'].'</b>" и {1x17x0} здоровье. <b><font color='.$hpaa_pr_color.'>'.$hpadd_pr.'</font></b> ['.ceil($btl->stats[$btl->uids[$ue['id']]]['hpNow']).'/'.$btl->stats[$btl->uids[$ue['id']]]['hpAll'].']';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}else{
|
||||
echo 'Can`t update table `user`';
|
||||
}
|
||||
unset($hpadd_pr,$mas1,$trduh);
|
||||
}elseif(isset($hpadd_pl))
|
||||
{
|
||||
if($this->stats[$this->uids[$hid]]['hpNow']+$hpadd_pl > $this->stats[$this->uids[$hid]]['hpAll'])
|
||||
{
|
||||
$hpadd_pr = $this->stats[$this->uids[$hid]]['hpAll']-$this->stats[$this->uids[$hid]]['hpNow'];
|
||||
}
|
||||
if($trduh==1)
|
||||
{
|
||||
if($this->users[$this->uids[$hid]]['tactic7']<=0)
|
||||
{
|
||||
$hpadd_pl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($this->stats[$this->uids[$hid]]['min_heal_proc'])) {
|
||||
if($this->stats[$this->uids[$hid]]['min_heal_proc'] > 100) {
|
||||
$this->stats[$this->uids[$hid]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd_pl = round($hpadd_pl/100*(100+$this->stats[$this->uids[$hid]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
if($u->info['id'] == $this->users[$this->uids[$hid]]['id']) {
|
||||
$u->info['hpNow'] += $hpadd_pl;
|
||||
$u->stats['hpNow'] += $hpadd_pl;
|
||||
}
|
||||
$this->users[$this->uids[$hid]]['hpNow'] += $hpadd_pl;
|
||||
$this->stats[$this->uids[$hid]]['hpNow'] += $hpadd_pl;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = '.$this->stats[$this->uids[$hid]]['hpNow'].' WHERE `id` = "'.$this->users[$this->uids[$hid]]['id'].'" LIMIT 1');
|
||||
if($upd)
|
||||
{
|
||||
$vLog = 'time1='.time().'||s1='.$this->users[$this->uids[$hid]]['sex'].'||t1='.$this->users[$this->uids[$hid]]['team'].'||login1='.$this->users[$this->uids[$hid]]['login'].'';
|
||||
$mas1 = array('time'=>time(),'battle'=>$this->info['id'],'id_hod'=>($this->hodID+1),'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
|
||||
if($hpadd_pl>0)
|
||||
{
|
||||
$hpadd_pl = '+'.ceil($hpadd_pl);
|
||||
}else{
|
||||
$hpadd_pl = '--';
|
||||
}
|
||||
if($hpadd_pr_color == '') {
|
||||
$hpaa_pr_color = '#006699';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>'.$plname.'</b>" и {1x17x0} здоровье. <b><font color='.$hpaa_pr_color.'>'.$hpadd_pl.'</font></b> ['.ceil($this->stats[$this->uids[$hid]]['hpNow']).'/'.$this->stats[$this->uids[$hid]]['hpAll'].']';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
}else{
|
||||
echo 'Can`t update table `user`';
|
||||
}
|
||||
unset($hpadd_pl,$mas1,$trduh);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'])) {
|
||||
if ($btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'] > 100) {
|
||||
$btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd = round($hpadd / 100 * (100 + $btl->stats[$btl->uids[$u->info['id']]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
$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 = ['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);
|
||||
} elseif (isset($hpadd_pr)) {
|
||||
if ($btl->stats[$btl->uids[$ue['id']]]['hpNow'] + $hpadd_pr > $btl->stats[$btl->uids[$ue['id']]]['hpAll']) {
|
||||
$hpadd_pr = $btl->stats[$btl->uids[$ue['id']]]['hpAll'] - $btl->stats[$btl->uids[$ue['id']]]['hpNow'];
|
||||
}
|
||||
if ($trduh == 1) {
|
||||
if ($btl->users[$btl->uids[$ue['id']]]['tactic7'] <= 0) {
|
||||
$hpadd_pr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'])) {
|
||||
if ($btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'] > 100) {
|
||||
$btl->stats[$btl->uids[$ue['id']]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd_pr = round($hpadd_pr / 100 * (100 + $btl->stats[$btl->uids[$ue['id']]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
if ($u->info['id'] == $btl->users[$btl->uids[$ue['id']]]['id']) {
|
||||
$u->info['hpNow'] += $hpadd;
|
||||
$u->stats['hpNow'] += $hpadd;
|
||||
}
|
||||
$btl->users[$btl->uids[$ue['id']]]['hpNow'] += $hpadd_pr;
|
||||
$btl->stats[$btl->uids[$ue['id']]]['hpNow'] += $hpadd_pr;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = ' . $btl->stats[$btl->uids[$ue['id']]]['hpNow'] . ' WHERE `id` = "' . $btl->users[$btl->uids[$ue['id']]]['id'] . '" LIMIT 1');
|
||||
if ($upd) {
|
||||
$vLog = 'time1=' . time() . '||s1=' . $btl->users[$btl->uids[$ue['id']]]['sex'] . '||t1=' . $btl->users[$btl->uids[$ue['id']]]['team'] . '||login1=' . $btl->users[$btl->uids[$ue['id']]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $btl->info['id'], 'id_hod' => $btl->hodID, 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
if ($hpadd_pr > 0) {
|
||||
$hpadd_pr = '+' . ceil($hpadd_pr);
|
||||
} else {
|
||||
$hpadd_pr = '--';
|
||||
}
|
||||
if ($hpadd_pr_color == '') {
|
||||
$hpaa_pr_color = '#006699';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $pr['name'] . '</b>" и {1x17x0} здоровье. <b><font color=' . $hpaa_pr_color . '>' . $hpadd_pr . '</font></b> [' . ceil($btl->stats[$btl->uids[$ue['id']]]['hpNow']) . '/' . $btl->stats[$btl->uids[$ue['id']]]['hpAll'] . ']';
|
||||
$btl->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
} else {
|
||||
echo 'Can`t update table `user`';
|
||||
}
|
||||
unset($hpadd_pr, $mas1, $trduh);
|
||||
} elseif (isset($hpadd_pl)) {
|
||||
if ($this->stats[$this->uids[$hid]]['hpNow'] + $hpadd_pl > $this->stats[$this->uids[$hid]]['hpAll']) {
|
||||
$hpadd_pr = $this->stats[$this->uids[$hid]]['hpAll'] - $this->stats[$this->uids[$hid]]['hpNow'];
|
||||
}
|
||||
if ($trduh == 1) {
|
||||
if ($this->users[$this->uids[$hid]]['tactic7'] <= 0) {
|
||||
$hpadd_pl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->stats[$this->uids[$hid]]['min_heal_proc'])) {
|
||||
if ($this->stats[$this->uids[$hid]]['min_heal_proc'] > 100) {
|
||||
$this->stats[$this->uids[$hid]]['min_heal_proc'] = 100;
|
||||
}
|
||||
$hpadd_pl = round($hpadd_pl / 100 * (100 + $this->stats[$this->uids[$hid]]['min_heal_proc']));
|
||||
}
|
||||
|
||||
if ($u->info['id'] == $this->users[$this->uids[$hid]]['id']) {
|
||||
$u->info['hpNow'] += $hpadd_pl;
|
||||
$u->stats['hpNow'] += $hpadd_pl;
|
||||
}
|
||||
$this->users[$this->uids[$hid]]['hpNow'] += $hpadd_pl;
|
||||
$this->stats[$this->uids[$hid]]['hpNow'] += $hpadd_pl;
|
||||
$upd = mysql_query('UPDATE `stats` SET `hpNow` = ' . $this->stats[$this->uids[$hid]]['hpNow'] . ' WHERE `id` = "' . $this->users[$this->uids[$hid]]['id'] . '" LIMIT 1');
|
||||
if ($upd) {
|
||||
$vLog = 'time1=' . time() . '||s1=' . $this->users[$this->uids[$hid]]['sex'] . '||t1=' . $this->users[$this->uids[$hid]]['team'] . '||login1=' . $this->users[$this->uids[$hid]]['login'] . '';
|
||||
$mas1 = ['time' => time(), 'battle' => $this->info['id'], 'id_hod' => ($this->hodID + 1), 'text' => '', 'vars' => $vLog, 'zona1' => '', 'zonb1' => '', 'zona2' => '', 'zonb2' => '', 'type' => '1'];
|
||||
if ($hpadd_pl > 0) {
|
||||
$hpadd_pl = '+' . ceil($hpadd_pl);
|
||||
} else {
|
||||
$hpadd_pl = '--';
|
||||
}
|
||||
if ($hpadd_pr_color == '') {
|
||||
$hpaa_pr_color = '#006699';
|
||||
}
|
||||
$mas1['text'] = '{tm1} {u1} {1x16x0} прием "<b>' . $plname . '</b>" и {1x17x0} здоровье. <b><font color=' . $hpaa_pr_color . '>' . $hpadd_pl . '</font></b> [' . ceil($this->stats[$this->uids[$hid]]['hpNow']) . '/' . $this->stats[$this->uids[$hid]]['hpAll'] . ']';
|
||||
$this->add_log($mas1);
|
||||
$pz[(int)$id] = 1;
|
||||
} else {
|
||||
echo 'Can`t update table `user`';
|
||||
}
|
||||
unset($hpadd_pl, $mas1, $trduh);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user