2022-08-11 10:38:38 +00:00
< ? php
use Insallah\Db ;
use Insallah\Math ;
2022-06-06 21:30:34 +00:00
/*
- <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> $btl -> users [][ 'eff' ] <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1 <EFBFBD> <EFBFBD> <EFBFBD>
*/
2022-08-25 11:23:36 +00:00
class Priems
2022-08-11 10:38:38 +00:00
{
private $btl ;
private $u ;
const FIRE = 'fire' ;
const WATER = 'water' ;
const AIR = 'air' ;
const EARTH = 'earth' ;
private $mname = [
'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' => 1 ,
'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' => 2 ,
'<27> <> <EFBFBD> <EFBFBD> ' => 3 ,
'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' => 4 ,
'<27> <> <EFBFBD> <EFBFBD> ' => 5 ,
'<27> <> <EFBFBD> <EFBFBD> ' => 6 ,
2022-08-25 11:23:36 +00:00
'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' => 7 ,
2022-08-11 10:38:38 +00:00
];
public $ue = [];
private $logColor = [
'crit' => '#f00' ,
'miss' => '#888' ,
self :: FIRE => '#a00' ,
self :: WATER => '#00a' ,
self :: EARTH => '#0a0' ,
self :: AIR => '#0af' ,
];
public function __construct ()
{
global $btl ;
$this -> btl = $btl ;
2022-08-25 11:23:36 +00:00
$this -> u = User :: start ();
}
/**@deprecated try to use getDynamicInfo()*/
private function getdr ( $s , $v , $d )
{
$i = 0 ;
while ( $i < count ( $v )) {
if ( isset ( $v [ $i ])) {
$s = str_replace ( '{' . $v [ $i ] . '}' , $d [ $i ], $s );
}
$i ++ ;
}
$s = eval ( " return ( " . $s . " ); " );
return floor ( $s );
}
/**
* @ param $match
* @ return false | float
*/
private function getDynamicInfo ( $match )
{
$tmpl = [
'lvl1' => $this -> u -> info [ 'level' ],
'ts5' => $this -> u -> stats [ 's5' ],
'mpAll' => $this -> u -> stats [ 'mpAll' ],
];
foreach ( $tmpl as $k => $v ) {
$match = str_ireplace ( '{' . $k . '}' , $v , $match );
}
$p = $match [ 2 ];
if ( preg_match ( '/(\d+)(?:\s*)([+\-*\/])(?:\s*)(\d+)/' , $match [ 2 ], $matches ) !== false ) {
$operator = $matches [ 2 ];
switch ( $operator ) {
case '+' :
$p = $matches [ 1 ] + $matches [ 3 ];
break ;
case '-' :
$p = $matches [ 1 ] - $matches [ 3 ];
break ;
case '*' :
$p = $matches [ 1 ] * $matches [ 3 ];
break ;
case '/' :
$p = $matches [ 1 ] / $matches [ 3 ];
break ;
default :
}
}
return floor ( $p );
2022-08-11 10:38:38 +00:00
}
2022-08-25 11:23:36 +00:00
2022-08-11 10:38:38 +00:00
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param int $uid <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0 , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> id <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* @ return void
*/
public function addAirStaticPoints ( $uid = 0 )
{
if ( $uid == 0 ) {
$uid = $this -> ue [ 'id' ];
}
2022-08-25 11:23:36 +00:00
$x = Db :: getValue (
'select x from eff_users where uid = ? and `delete` = 0 and v2 = 260 and user_use = ? order by id desc limit 1' ,
[ $uid , $this -> u -> info [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
if ( empty ( $x ) || $x >= 5 ) {
return ;
}
$x ++ ;
$data [ 'add_mg2static_points' ] = $x ;
$data = $this -> impStats ( $data );
2022-08-25 11:23:36 +00:00
Db :: sql (
'update eff_users set x = ?, data = ? where uid = ? and `delete` = 0 and v2 = 260 and user_use = ?' ,
[ $x , $data , $uid , $this -> u -> info [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param $uid
* @ param $mp
* @ param $tp [ not used ]
* @ return bool
*/
public function minMana ( $uid , $mp , $tp = null )
{
global $btl ;
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> $mp > 0 */
//<2F> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ss
$mp -= round ( $mp / 100 * $btl -> stats [ $btl -> uids [ $uid ]][ 'min_use_mp' ]);
$btl -> stats [ $btl -> uids [ $uid ]][ 'mpNow' ] -= $mp ;
$mpNow = $this -> zeromax ( $btl -> stats [ $btl -> uids [ $uid ]][ 'mpNow' ], $btl -> stats [ $btl -> uids [ $uid ]][ 'mpAll' ]);
if ( $mpNow > 0 ) {
2022-08-25 11:23:36 +00:00
Db :: sql (
'update stats set mpNow = ? where id = ?' ,
[ $btl -> stats [ $btl -> uids [ $uid ]][ 'mpNow' ], $uid ]
);
2022-08-11 10:38:38 +00:00
}
return $mpNow > 0 ;
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param $l2
* @ param $t
* @ return int
*/
public function magKrit ( $l2 , $t )
{
$r = $l2 * 2 - 7 ;
if ( $r > $t ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> 2 <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ) 6%
//250 <20> <> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 1% <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
//$r = -1; , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> --
$r = 0 ;
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 3% <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$r = ceil ( $t * 0.75 );
if ( $r > 30 ) {
$r = 30 ;
}
if ( rand ( 0 , 10000 ) < $r * 100 ) {
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
$r = 1 ;
} else {
$r = 0 ;
}
}
return $r ;
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param $eff
* @ param $pr
* @ return bool
*/
public function hodUsePriem ( $eff , $pr )
{
global $btl ;
$return_main = true ;
2022-08-25 11:23:36 +00:00
$ue = Db :: getRow (
'select * from users left join stats on (users.id = stats.id) where users.id = ? and battle = ? and hpNow > 0' ,
[ $eff [ 'uid' ], $btl -> info [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
if ( ! empty ( $pr [ 'file' ])) {
if ( file_exists ( '../../_incl_data/class/priems/' . $pr [ 'file' ] . '.php' )) {
$hod = $eff [ 'hod' ];
require_once 'priems/' . $pr [ 'file' ] . '.php' ;
}
} elseif ( ! empty ( $pr [ 'file3' ])) {
if ( file_exists ( '../../_incl_data/class/priems/' . $pr [ 'file3' ] . '.php' )) {
$hod = $eff [ 'hod' ];
require_once 'priems/' . $pr [ 'file3' ] . '.php' ;
}
}
return $return_main ;
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data c <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> add_m11 = 2 * { lvl1 } <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* < br > <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : < br > lvl1 = $uid [ level ] < br > ts5 = $uid [ s5 ] < br > mpAll = $uid [ mpAll ]
2022-08-25 11:23:36 +00:00
* @ param string $pl <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data
* @ param int $uid <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
2022-08-11 10:38:38 +00:00
* @ return string <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
*/
public function redate ( $pl , $uid )
{
global $btl ;
$i = 0 ;
if ( $pl != '' ) {
$e = explode ( '|' , $pl );
while ( $i < count ( $e )) {
$f = explode ( '=' , $e [ $i ]);
2022-08-25 11:23:36 +00:00
// $f[1] = $this->getdr(
// $f[1], [0 => 'lvl1', 1 => 'ts5', 2 => 'mpAll'], [
// 0 => $btl->users[$btl->uids[$uid]]['level'],
// 1 => $btl->stats[$btl->uids[$uid]]['s5'],
// 2 => $btl->stats[$btl->uids[$uid]]['mpAll'],
// ]
// );
$f [ 1 ] = $this -> getDynamicInfo ( $f [ 1 ]);
2022-08-11 10:38:38 +00:00
if ( $f [ 0 ] != '' && $f [ 1 ] != '' ) {
$e [ $i ] = implode ( '=' , $f );
}
$i ++ ;
}
$pl = implode ( '|' , $e );
}
return $pl ;
}
2022-08-25 11:23:36 +00:00
private function cancelEffects ( $effects_ids , $uid , Battle $btl )
2022-08-11 10:38:38 +00:00
{
$arr = explode ( ',' , $effects_ids );
if ( ! is_array ( $arr ) || empty ( $arr )) {
return ;
}
foreach ( $arr as $eid ) {
if ( $eid <= 0 ) {
continue ;
}
2022-08-25 11:23:36 +00:00
$p = Db :: getRow (
'select * from eff_users where uid = ? and v1 = ? and v2 = ? and `delete` = 0' , [ $uid , 'priem' , $eid ]
);
2022-08-11 10:38:38 +00:00
if ( ! $p [ 'id' ]) {
continue ;
}
$p [ 'priem' ] = Db :: getRow ( 'select * from priems where id = ?' , [ $eid ]);
$btl -> delPriem ( $p , $btl -> users [ $btl -> uids [ $uid ]], 2 );
}
}
/* uid - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-06-06 21:30:34 +00:00
pr - id <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
data - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - 1 , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3
d2 - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3
tm - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , 77 - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
h - <EFBFBD> <EFBFBD> <EFBFBD> - <EFBFBD> <EFBFBD> " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
uu - id <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
tp - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
*/
2022-08-11 10:38:38 +00:00
/**
2022-08-25 11:23:36 +00:00
* @ param int $uid <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param int $pr id <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-11 10:38:38 +00:00
* @ param int | string $data <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - 1 , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3
2022-08-25 11:23:36 +00:00
* @ param int $d2
* @ param $tm
* @ param int $h <EFBFBD> <EFBFBD> <EFBFBD>
* @ param int $uu id <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param $max
* @ param $bj
* @ param $tp
* @ param $ch
* @ param $rdt
* @ param $tr_life_user
* @ param $noupdatebtl
* @ param $noplus
* @ param $pname
2022-08-11 10:38:38 +00:00
* @ return bool
*/
public function addPriem (
$uid ,
$pr ,
$data ,
$d2 ,
$tm ,
$h ,
$uu ,
$max ,
$bj ,
$tp = 0 ,
$ch = 0 ,
$rdt = 0 ,
$tr_life_user = 0 ,
$noupdatebtl = 0 ,
$noplus = 0 ,
$pname = null
) {
global $btl ;
//$pl = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . (int)$pr));
$pl = Db :: getRow ( 'select * from priems where id = ?' , [ $pr ]);
$r = false ;
if ( ! $pl [ 'id' ]) {
return false ;
}
if ( $data == - 1 ) {
$data = $this -> redate ( $pl [ 'date3' ], $this -> u -> info [ 'id' ]);
} elseif ( $d2 == 1 ) {
$data .= '|' . $this -> redate ( $pl [ 'date3' ], $this -> u -> info [ 'id' ]);
}
$this -> cancelEffects ( $pl [ 'cancel_eff2' ], $uid , $btl );
if ( $max <= 0 ) {
return false ;
}
if ( $noplus == 0 ) {
if ( $pl [ 'zmu' ] == 1 ) {
2022-08-25 11:23:36 +00:00
$num = Db :: getRow (
'select * from eff_users where bj = ? and user_use = ? and uid = ? and `delete` = 0' ,
[ $bj , $this -> u -> info [ 'id' ], $uid ]
);
2022-08-11 10:38:38 +00:00
} else {
2022-08-25 11:23:36 +00:00
$num = Db :: getRow (
'select * from eff_users where bj = ? and uid = ? and `delete` = 0' ,
[ $bj , $uid ]
);
2022-08-11 10:38:38 +00:00
}
}
if ( isset ( $num [ 'id' ]) && ( $num [ 'user_use' ] != $this -> u -> info [ 'id' ] && $pl [ 'zmu' ] != 2 )) {
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
Db :: sql (
'update eff_users set `delete` = unix_timestamp() where id = ?' ,
[ $num [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
$i = 0 ;
while ( $i < count ( $btl -> stats [ $btl -> uids [ $uid ]][ 'effects' ])) {
if ( $btl -> stats [ $btl -> uids [ $uid ]][ 'effects' ][ $i ][ 'id' ] == $num [ 'id' ]) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$btl -> stats [ $btl -> uids [ $uid ]][ 'effects' ][ $i ][ 'delete' ] = time ();
}
$i ++ ;
}
unset ( $num );
}
if ( ! isset ( $num [ 'id' ])) {
$q = 'insert into eff_users (tr_life_user, bj, user_use, hod, v2, img2, id_eff, uid, name, data, overType, timeUse, v1) values (?,?,?,?,?,?,?,?,?,?,?,?,?)' ;
$image = ! empty ( $pl [ 'img' ]) ? $pl [ 'img' ] : $pl [ 'id' ];
$name = ! empty ( $pname ) ? $pname : $pl [ 'name' ];
$image .= '.gif' ;
2022-08-25 11:23:36 +00:00
Db :: sql (
$q , [ floor ( $tr_life_user ), $bj , $uu , $h , $pl [ 'id' ], $image , 22 , $uid , $name , $data , 0 , $tm , 'priem' ]
);
2022-08-11 10:38:38 +00:00
$lid = Db :: lastInsertId ();
if ( $lid ) {
$r = true ;
}
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> $btl->eff */
if ( $noupdatebtl == 0 ) {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $uid , 0 );
}
} elseif ( $num [ 'x' ] < $max ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$num [ 'x' ] ++ ;
$num [ 'hod' ] = $h ;
if ( $data != - 1 && $data != '' && $d2 == 2 ) {
$num [ 'data' ] .= '|' . $data ;
2022-08-25 11:23:36 +00:00
Db :: sql (
'update eff_users set x = x + 1, hod = ?, data = ? where id = ?' ,
[ $h , $num [ 'data' ], $num [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
} else {
2022-08-25 11:23:36 +00:00
Db :: sql (
'update eff_users set x = x + 1, hod = ? where id = ?' ,
[ $h , $num [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
}
$r = true ;
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$num [ 'hod' ] = $h ;
if ( $data != - 1 && $data != '' && $d2 == 2 ) {
$num [ 'data' ] .= '|' . $data ;
Db :: sql ( " update eff_users set hod = ?, data = ? where id = ? " , [ $h , $num [ 'data' ], $num [ 'id' ]]);
} else {
2022-08-25 11:23:36 +00:00
Db :: sql (
'update eff_users set hod = ? where id = ?' ,
[ $h , $num [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
}
$r = true ;
}
if ( isset ( $num [ 'id' ])) {
foreach ( $btl -> stats [ $btl -> uids [ $uid ]][ 'effects' ] as $effect ) {
if ( $effect [ 'id' ] != $num [ 'id' ]) {
continue ;
}
$effect [ 'data' ] = $num [ 'data' ];
$effect [ 'hod' ] = $num [ 'hod' ];
$effect [ 'x' ] = $num [ 'x' ];
}
}
return $r ;
}
2022-08-25 11:23:36 +00:00
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data ( 'a=1|b=2|c=3' ) <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ a => 1 , b => 2 , c => 3 ] .
2022-08-11 10:38:38 +00:00
* @ param $m
* @ return array
*/
public function lookStatsArray ( $m )
{
$arr = json_decode ( str_replace ([ '=' , '|' ], [ '":' , ',"' ], '{"' . $m . '}' ), true );
return $arr ? : [];
}
2022-08-25 11:23:36 +00:00
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ a => 1 , b => 2 , c => 3 ] <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> data ( 'a=1|b=2|c=3' ) <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
2022-08-11 10:38:38 +00:00
* @ param array $m
* @ return string
*/
private function impStats ( array $m )
{
$str = json_encode ( $m );
return $str ? str_replace ([ '":' , ',"' , '{"' , '}' ], [ '=' , '|' ], $str ) : '' ;
}
/**
2022-08-25 11:23:36 +00:00
* @ param $data
2022-08-11 10:38:38 +00:00
* @ param array $values
* @ return string
*/
private function changeStatsData ( $data , array $values )
{
$arr = $this -> lookStatsArray ( $data );
foreach ( $values as $key => $value ) {
$arr [ $key ] = $value ;
}
return $this -> impStats ( $arr );
}
public function magicRegen ( $ue , $hpmin , $tmp , $pl , $eff , $rp = 0 , $dp = 0 , $krituet = true , $dopyrn = 0 )
{
global $btl ;
$rr = [];
$uen = $ue [ 'id' ];
$usu = $eff [ 'user_use' ];
if ( $eff [ 'user_use' ] < 1 ) {
$usu = $this -> u -> info [ 'id' ];
}
$k = $this -> magKrit ( $ue [ 'level' ], $btl -> stats [ $btl -> uids [ $usu ]][ 'mg' . $tmp ]);
if ( ! $krituet ) {
$k = 0 ;
}
$hpmin = $this -> testPower ( $btl -> stats [ $btl -> uids [ $usu ]], $btl -> stats [ $btl -> uids [ $uen ]], $hpmin , $tmp , 2 );
$hpmin = round ( $hpmin );
$dopyrn = $this -> testPower ( $btl -> stats [ $btl -> uids [ $usu ]], $btl -> stats [ $btl -> uids [ $uen ]], $dopyrn , $tmp , 2 );
$dopyrn = round ( $dopyrn );
if ( $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] <= 0 && $dp == 0 ) {
$hpmin = 0 ;
$k = - 1 ;
$dopyrn = 0 ;
}
if ( $k == 1 && $hpmin != 0 && $krituet ) {
//<2F> <> <EFBFBD> <EFBFBD>
$hpmin = $hpmin * 2 ;
} elseif ( $k == - 1 && $hpmin != 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$hpmin = $hpmin / 2 ;
$dopyrn = $dopyrn / 2 ;
}
if ( $hpmin < 1 ) {
$hpmin = 0 ;
} else {
$hpmin = rand (( $hpmin * 0.97 ), $hpmin );
}
$hpmin += floor ( $dopyrn );
if ( isset ( $btl -> stats [ $btl -> uids [ $uen ]][ 'min_heal_proc' ])) {
if ( $btl -> stats [ $btl -> uids [ $uen ]][ 'min_heal_proc' ] > 100 ) {
$btl -> stats [ $btl -> uids [ $uen ]][ 'min_heal_proc' ] = 100 ;
}
$hpmin = round ( $hpmin / 100 * ( 100 + $btl -> stats [ $btl -> uids [ $uen ]][ 'min_heal_proc' ]));
}
if ( $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] > 0 && $dp == 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] -= $hpmin / $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ];
$btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] = round ( $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ], 2 );
$btl -> stats [ $btl -> uids [ $uen ]][ 'tactic7' ] = $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ];
if ( $uen == $this -> u -> info [ 'id' ]) {
$this -> u -> info [ 'tactic7' ] = $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ];
$this -> u -> stats [ 'tactic7' ] = $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ];
}
if ( $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] < 0 ) {
$btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] = 0 ;
}
}
$hp2 = floor ( $btl -> stats [ $btl -> uids [ $uen ]][ 'hpNow' ] + $hpmin );
if ( $hp2 > $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ]) {
$hpmin = floor ( $hp2 - $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ]);
$hp2 = $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ];
} elseif ( $hp2 < 0 ) {
$hp2 = 0 ;
}
$rr [ 0 ] = $hpmin ; //<2F> <> <EFBFBD> <EFBFBD>
$rr [ 1 ] = $k ; //<2F> <> <EFBFBD>
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> */
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$miny = 0 ; //<2F> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
$minu = 0 ;
2022-08-25 11:23:36 +00:00
$sp1 = mysql_query (
'SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "' . $uen . '" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25'
);
2022-08-11 10:38:38 +00:00
while ( $pl2 = mysql_fetch_assoc ( $sp1 )) {
2022-08-25 11:23:36 +00:00
$pl2 [ 'priem' ] = mysql_fetch_assoc (
mysql_query ( 'SELECT * FROM `priems` WHERE `id` = "' . $pl2 [ 'v2' ] . '" LIMIT 1' )
);
2022-08-11 10:38:38 +00:00
if ( isset ( $pl2 [ 'priem' ][ 'id' ])) {
$dt1 = $this -> lookStatsArray ( $pl2 [ 'priem' ][ 'date2' ]);
if ( isset ( $dt1 [ 'yron_u2' ])) {
2022-08-25 11:23:36 +00:00
$minu = $this -> getdr (
$dt1 [ 'yron_u2' ], [ 0 => 'lvl1' , 1 => 'yr1' , 2 => 'ts5' , 3 => 'ts6' ],
[ 0 => $btl -> users [ $btl -> uids [ $level ]], 1 => $hpmin , 2 => 0 , 3 => 0 ]
);
2022-08-11 10:38:38 +00:00
$miny -= $minu ;
$hpmin += $minu ;
$btl -> delPriem ( $pl2 , $btl -> users [ $btl -> uids [ $uen ]]);
}
}
}
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> */
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <>
$btl -> users [ $btl -> uids [ $uen ]][ 'hpNow' ] = $hp2 ;
$btl -> stats [ $btl -> uids [ $uen ]][ 'hpNow' ] = $hp2 ;
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`tactic7` = ' . $btl -> users [ $btl -> uids [ $uen ]][ 'tactic7' ] . ' WHERE `id` = "' . $uen . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD>
$vLog =
'time1=' . time () .
'||s1=' . $this -> u -> info [ 'sex' ] .
'||t1=' . $this -> u -> info [ 'team' ] .
'||login1=' . $this -> u -> info [ 'login' ] .
'||s2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'sex' ] .
'||t2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'team' ] .
'||login2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'login' ];
$mas1 = [
'time' => time (),
'battle' => $btl -> info [ 'id' ],
'id_hod' => ( $btl -> hodID + 1 ),
'text' => '' ,
'vars' => $vLog ,
'zona1' => '' ,
'zonb1' => '' ,
'zona2' => '' ,
'zonb2' => '' ,
'type' => '1' ,
];
if ( $rp == 1 ) {
$mas1 [ 'id_hod' ] -- ;
}
$btl -> takeExp ( $this -> u -> info [ 'id' ], ( $hpmin * 0.33 ), $this -> u -> info [ 'id' ], $uen , true );
if ( $hpmin > 0 ) {
$hpmin = '+' . ceil ( $hpmin );
} else {
$hpmin = '--' ;
}
$tco = [ 1 => '006699' , 2 => '006699' , 3 => '006699' , 4 => '006699' ]; //<2F> <> <20> <> <EFBFBD> <EFBFBD>
$tcl = [ 1 => 'A00000' , 2 => '008080' , 3 => '0000FF' , 4 => 'A52A2A' ]; //<2F> <> <20> <> <EFBFBD> <EFBFBD>
$tco = $tco [ $tmp ];
$tcl = $tcl [ $tmp ];
if ( $k == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD>
$tco = 'FF0000' ;
$tcl = 'FF0000' ;
} elseif ( $k == - 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$tco = '979797' ;
$tcl = '979797' ;
}
$nmz = [
1 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
2 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
3 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
4 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
];
$nmz = $nmz [ $tmp ];
if ( $rp == 1 ) {
$sx = [ 0 => '' , 1 => '<27> ' ];
2022-08-25 11:23:36 +00:00
$mas1 [ 'text' ] = '{tm1} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "<b><font color=#' . $tcl . '>' . $pl [ 'name' ] . '</font></b>" <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> {u2}. <b><font title=<3D> <> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $nmz [ 1 ] . ' color=#' . $tco . '>' . $hpmin . '</font></b> [' . ceil (
$hp2
) . '/' . $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ] . ']' ;
2022-08-11 10:38:38 +00:00
} else {
2022-08-25 11:23:36 +00:00
$mas1 [ 'text' ] = '{tm1} {u1} {1x16x0} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "<b><font color=#' . $tcl . '>' . $pl [ 'name' ] . '</font></b>" <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> {u2} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' . $nmz [ 0 ] . '. <b><font title=<3D> <> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $nmz [ 1 ] . ' color=#' . $tco . '>' . $hpmin . '</font></b> [' . ceil (
$hp2
) . '/' . $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ] . ']' ;
2022-08-11 10:38:38 +00:00
}
$btl -> add_log ( $mas1 );
$pz [( int ) $id ] = 1 ;
return $rr ;
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> magicAttack
* @ return array
*/
private function hasGhostDefence ( $uid )
{
$def = [
'all' => false ,
self :: FIRE => false ,
self :: AIR => false ,
self :: EARTH => false ,
self :: WATER => false ,
];
$priems = Db :: getRows ( 'select v2 from eff_users where uid = ? and v2 in (141, 142, 144, 145, 146)' , [ $uid ]);
foreach ( $priems as $priem ) {
if ( $priem [ 'v2' ] == 141 ) {
$def [ 'all' ] = true ;
}
if ( $priem [ 'v2' ] == 142 ) {
$def [ self :: FIRE ] = true ;
}
if ( $priem [ 'v2' ] == 144 ) {
$def [ self :: AIR ] = true ;
}
if ( $priem [ 'v2' ] == 145 ) {
$def [ self :: WATER ] = true ;
}
if ( $priem [ 'v2' ] == 146 ) {
$def [ self :: EARTH ] = true ;
}
}
return $def ;
}
/**
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ priem ] .
2022-08-25 11:23:36 +00:00
* @ param int $attackerId <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param int $defenderId <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param float $damage <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
* @ param string $damageType <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ( <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ? ) <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* @ param bool $hasCritical <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-11 10:38:38 +00:00
* @ return array [ 0 | damage ] int <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , [ 1 | crit ] bool <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , [ 2 | miss ] bool <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , [ 3 | miss_type ] int <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ( <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> = 2 ) .
* @ author Insallah
*/
2022-08-25 11:23:36 +00:00
public function magicAttack ( Battle $btl , $attackerId , $defenderId , $damage , $damageType , $hasCritical = false )
2022-08-11 10:38:38 +00:00
{
// <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> .
$dmgRuNames = [
self :: FIRE => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
self :: WATER => '<27> <> <EFBFBD> <EFBFBD> ' ,
self :: AIR => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
self :: EARTH => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
];
if ( in_array ( $damageType , array_keys ( $dmgRuNames ))) {
$damageType = $dmgRuNames [ $damageType ];
}
// <20> <> <EFBFBD> <EFBFBD> .
// pm# = <20> <> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
// m11 = <20> <> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// m11a = <20> <> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [pm# = m11 + m11a] <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> !
$power = $btl -> stats [ $btl -> uids [ $attackerId ]][ 'pm' . $this -> mname [ $damageType ]];
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$suppression = 0 ;
$suppression += $btl -> stats [ $btl -> uids [ $attackerId ]][ 'pzm' ];
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 250.
$suppression += $btl -> stats [ $btl -> uids [ $attackerId ]][ 'yzm' ];
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$skills = $btl -> stats [ $btl -> uids [ $attackerId ]][ 'mg' . $this -> mname [ $damageType ]];
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// zm# = <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
// zm = <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// zma = <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [zm# = zm + zma] <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> !
$defence = $btl -> stats [ $btl -> uids [ $defenderId ]][ 'zm' . $this -> mname [ $damageType ]];
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> 100% <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
// <20> 8 <20> <> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 20, <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> : 8 <20> <> <EFBFBD> <EFBFBD> 10 <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$requiredSkills = $btl -> users [ $btl -> uids [ $defenderId ]][ 'level' ] * 2 ;
// <> <D7B8> <EFBFBD> <EFBFBD> <EFBFBD> "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ".
$isGarantCrit = $btl -> stats [ $btl -> uids [ $attackerId ]][ 'acestar' ] > 0 ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$supressedDefence = Math :: addPercent ( $defence , - min ( $suppression , 100 ));
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$damage *= $skills - $requiredSkills ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> > 0.
$poweredDamage = $damage > 0 ? $damage + $power : 0 ;
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$isCritical = $hasCritical && $skills >= mt_rand ( 0 , 100 );
if ( $isGarantCrit ) {
$isCritical = true ;
2022-08-25 11:23:36 +00:00
Db :: sql (
'delete from eff_users where uid = ? and `delete` = 0 and data like ?' ,
[ $attackerId , '%add_acestar%' ]
);
2022-08-11 10:38:38 +00:00
unset ( $q );
}
if ( $skills >= $requiredSkills || $isCritical ) {
$isHit = true ;
} else {
$isCritical = false ;
$missChance = 3 * ( $requiredSkills - $skills );
$isHit = mt_rand ( 0 , 100 ) > $missChance ;
}
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$pType = 0 ;
if ( $isHit ) {
// <20> <> <EFBFBD> <EFBFBD> = <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> .
//$finalDamage = max(round(Math::addPercent($poweredDamage, -$supressedDefence)), 0);
$finalDamage = $poweredDamage - $supressedDefence ;
if ( $isCritical ) {
$finalDamage *= 2 ;
}
} else {
$finalDamage = 0 ;
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$pType = 2 ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$ghostDefences = $this -> hasGhostDefence ( $defenderId );
if ( $ghostDefences [ 'all' ]) {
$finalDamage /= 4 ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> .
if ( in_array ( $damageType , $dmgRuNames )) {
$damageType = array_search ( $damageType , $dmgRuNames );
}
if ( $ghostDefences [ $damageType ]) {
$finalDamage /= 2 ;
}
$finalDamage = max ( round ( $finalDamage ), 0 );
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
if ( $btl -> users [ $btl -> uids [ $attackerId ]][ 'admin' ] > 0 ) {
$s = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : $suppression %, <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> : $power , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : $skills ,
< br > <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : damage x ( $skills - $requiredSkills ) < br > $damageType
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ( $defence - $suppression % ) = $supressedDefence |
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ( $damage + $power ) = $poweredDamage < br >
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ( $poweredDamage - $supressedDefence ) = $finalDamage " ;
$s .= $isCritical ? ' (<28> <> <EFBFBD> <EFBFBD> *2)' : '' ;
echo " <div style='background-color: #C5C5C5; border: 1px solid coral; margin-top: 15px;'> $s </div> " ;
}
// !isHit <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
// pType <20> <> <20> <> <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , = 0 <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> = 2 <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
// -damage <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> .
return [
( int ) $finalDamage ,
$isCritical ,
! $isHit ,
$pType , // <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
'damage' => ( int ) $finalDamage ,
'crit' => $isCritical ,
'miss' => ! $isHit ,
'miss_type' => $pType ,
];
}
/** <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> . */
public function magatack ( $u1 , $u2 , $yron , $type , $krit )
{
global $btl ;
return $this -> magicAttack ( $btl , $u1 , $u2 , $yron , $type , $krit );
}
public function magatackfiz ( $u1 , $u2 , $yron , $type , $krit , $ymelki )
{
global $btl ;
$cof_mag = [
2022-08-25 11:23:36 +00:00
0 => 250 ,
1 => 250 ,
2 => 250 ,
3 => 250 ,
4 => 250 ,
5 => 250 ,
6 => 250 ,
7 => 250 ,
8 => 250 ,
9 => 300 ,
10 => 360 ,
11 => 475 ,
12 => 520 ,
13 => 625 ,
14 => 750 ,
15 => 895 ,
16 => 1075 ,
17 => 1290 ,
18 => 1550 ,
19 => 1860 ,
20 => 2230 ,
21 => 2675 ,
];
2022-08-11 10:38:38 +00:00
$r = $yron ;
//
if ( ! isset ( $ymelki ) || $ymelki == '0' ) {
$ymelki = $type ;
}
//
$prm = [
'ym' => $btl -> stats [ $btl -> uids [ $u1 ]][ 'mg' . $this -> mname [ $ymelki ]], //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
'y' => $btl -> stats [ $btl -> uids [ $u1 ]][ 'a' . $this -> mname [ $ymelki ]], //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
'yv' => 0 , //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> .
'max_krit' => 0 //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
];
//
// (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> )*2 - 7 - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/*
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> / <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> * 2 <EFBFBD> 9
2022-06-06 21:30:34 +00:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3 %. <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 30 %
*/
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/*
2022-06-06 21:30:34 +00:00
b - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
z - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ <EFBFBD> <EFBFBD> . ]
p - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ <EFBFBD> <EFBFBD> . ]
k - <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ; k = 250 <EFBFBD> <EFBFBD> <EFBFBD> 8 <EFBFBD> <EFBFBD> , k = 300 <EFBFBD> <EFBFBD> <EFBFBD> 9 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <EFBFBD> . + 20 % <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
*/
2022-08-11 10:38:38 +00:00
$prm [ 'b' ] = $r ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
$prm [ 'm' ] = $btl -> stats [ $btl -> uids [ $u1 ]][ 'pa' . $this -> mname [ $type ]]; //<2F> <> <EFBFBD> <EFBFBD>
$prm [ 'z' ] = $btl -> stats [ $btl -> uids [ $u2 ]][ 'za' . $this -> mname [ $type ]]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> (<28> <> .)
$prm [ 'p' ] = $btl -> stats [ $btl -> uids [ $u1 ]][ 'pza' . $this -> mname [ $type ]]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> .)
$prm [ 'k' ] = $cof_mag [ $btl -> users [ $btl -> uids [ $u1 ]][ 'level' ]]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//
if ( $prm [ 'p' ] * 10 > $prm [ 'k' ]) {
$prm [ 'p' ] = floor ( $prm [ 'k' ] / 10 );
}
//
$r = $prm [ 'b' ] * ( 1 + $prm [ 'm' ] / 100 ) * pow ( 2 , (( $prm [ 'p' ] * 10 - $prm [ 'z' ]) / $prm [ 'k' ]));
if ( $r < floor ( $prm [ 'b' ] * 0.2 )) {
$r = floor ( $prm [ 'b' ] * 0.2 );
} elseif ( $r > floor ( $prm [ 'b' ] * 10 )) {
$r = floor ( $prm [ 'b' ] * 10 );
}
//
//$prm['y'] -= 5;
if ( $type < $this -> mname [ $type ]) {
$prm [ 'yv' ] = ( $btl -> users [ $btl -> uids [ $u2 ]][ 'level' ] * 2 - 7 );
} else {
$prm [ 'yv' ] = ( $btl -> users [ $btl -> uids [ $u2 ]][ 'level' ] * 2 - 9 );
}
//
if ( $prm [ 'y' ] >= $prm [ 'yv' ] || ( isset ( $this -> mname [ $ymelki ]) && $prm [ 'ym' ] >= $prm [ 'yv' ])) {
if ( $krit == 1 ) {
if ( isset ( $this -> mname [ $ymelki ])) {
$prm [ 'max_krit' ] = 3 * ( $prm [ 'ym' ] - $prm [ 'yv' ]);
} else {
$prm [ 'max_krit' ] = 3 * ( $prm [ 'y' ] - $prm [ 'yv' ]);
}
//echo '[Magical crit: '.$prm['max_krit'].'%]';
if ( $prm [ 'max_krit' ] < 0 ) {
$prm [ 'max_krit' ] = 0 ;
} elseif ( $prm [ 'max_krit' ] > 30 ) {
$prm [ 'max_krit' ] = 30 ;
}
//$prm['max_krit'] = round($prm['max_krit']/2);
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( rand ( 0 , 100 ) <= $prm [ 'max_krit' ]) {
$krit = true ;
} else {
$krit = false ;
}
} else {
$krit = false ;
}
$promah = false ;
} else {
$krit = false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$prm [ 'promah' ] = 3 * ( $prm [ 'yv' ] - $prm [ 'ym' ]);
if ( $prm [ 'promah' ] < 0 ) {
$prm [ 'promah' ] = 0 ;
} elseif ( $prm [ 'promah' ] > 30 ) {
$prm [ 'promah' ] = 30 ;
}
if ( rand ( 0 , 100 ) <= $prm [ 'promah' ]) {
$promah = true ;
} else {
$promah = false ;
}
}
//
if ( $krit ) {
$r = $r * 2 ;
$promah_type = 0 ;
} elseif ( $promah ) {
$r = rand ( 1 , floor ( $r / 4 ));
$promah_type = 1 ;
if ( rand ( 0 , 100 ) < 50 ) {
$r = 0 ;
$promah_type = 2 ;
}
}
//
unset ( $prm );
//
return [ floor ( $r ), $krit , $promah , $promah_type ];
}
//<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> priems
public function magicAtack (
$ue ,
$hpmin ,
$tmp ,
$pl ,
$eff ,
$rp = 0 ,
$mxx = 0 ,
$fiz = 0 ,
$nomf = 0 ,
$krituet = true ,
$heal = 0 ,
$namenew = null
) {
$trawm_off = false ;
global $btl ;
if ( $namenew != null ) {
$pl [ 'name' ] = $namenew ;
}
$rr = [];
$nhpmin = $hpmin ;
$uen = $ue [ 'id' ];
$usu = $eff [ 'user_use' ];
if ( $eff [ 'user_use' ] < 1 ) {
$usu = $this -> u -> info [ 'id' ];
}
if ( $nomf == 0 ) {
$k = $this -> magKrit ( $ue [ 'level' ], $btl -> stats [ $btl -> uids [ $usu ]][ 'mg' . $tmp ]);
if ( ! $krituet ) {
$k = 0 ;
}
if ( $fiz == 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$hpmin = $this -> testPower (
$btl -> stats [ $btl -> uids [ $usu ]], $btl -> stats [ $btl -> uids [ $uen ]], $hpmin , $tmp ,
2
);
2022-08-11 10:38:38 +00:00
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
$wAp = $btl -> stats [ $btl -> uids [ $usu ]][ 'pa' . $tmp . '' ];
$wAp += $btl -> stats [ $btl -> uids [ $usu ]][ 'm10' ];
$wAp -= $btl -> stats [ $btl -> uids [ $uen ]][ 'antpa' . $tmp . '' ] * 1.75 ;
$wAp -= $btl -> stats [ $btl -> uids [ $uen ]][ 'antm10' ] * 1.75 ;
$hpmin += ceil (( 0.01 + $hpmin / 100 ) * ( 0.01 + 0.98 * $wAp )) - 1 ;
2022-08-25 11:23:36 +00:00
$hpmin -= round (
$hpmin / 100 * ( 35 * ( $btl -> stats [ $btl -> uids [ $uen ]][ 'za' ] + $btl -> stats [ $btl -> uids [ $uen ]][ 'za' . $tmp ]) / 1200 )
);
2022-08-11 10:38:38 +00:00
$hpmin = round ( $hpmin );
if ( isset ( $btl -> stats [ $btl -> uids [ $uen ]][ 'zaproc' ]) || isset ( $btl -> stats [ $btl -> uids [ $uen ]][ 'za' . $fiz . 'proc' ])) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
{
2022-08-25 11:23:36 +00:00
$hpmin = floor (
$hpmin / 100 * ( 100 - $btl -> stats [ $btl -> uids [ $uen ]][ 'zaproc' ] - $btl -> stats [ $btl -> uids [ $uen ]][ 'za' . $fiz . 'proc' ])
);
2022-08-11 10:38:38 +00:00
if ( $hpmin < 0 ) {
$hpmin = 0 ;
}
}
}
}
$hpmin = round ( $hpmin );
if ( $k == 1 and $krituet ) {
//<2F> <> <EFBFBD> <EFBFBD>
$hpmin = $hpmin * 2 ;
} elseif ( $k == - 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$hpmin = $hpmin / 2 ;
}
if ( $hpmin < $nhpmin * 0.2 ) {
$hpmin = $nhpmin * 0.2 ;
}
if ( $hpmin < 1 ) {
$hpmin = 0 ;
} else {
if ( $nomf == 0 ) {
$hpmin = rand (( $hpmin * 0.97 ), $hpmin );
}
}
if ( $mxx > 0 && $hpmin > $mxx ) {
if ( $k == 0 ) {
$hpmin = $mxx ;
} elseif ( $k == 1 && $hpmin / 2 > $mxx ) {
$hpmin = $mxx * 2 ;
}
}
$rr [ 0 ] = $hpmin ; //<2F> <> <EFBFBD> <EFBFBD>
$rr [ 1 ] = $k ; //<2F> <> <EFBFBD>
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> */
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$miny = 0 ; //<2F> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
2022-08-25 11:23:36 +00:00
$sp1 = mysql_query (
'SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "' . $uen . '" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25'
);
2022-08-11 10:38:38 +00:00
while ( $pl2 = mysql_fetch_assoc ( $sp1 )) {
2022-08-25 11:23:36 +00:00
$pl2 [ 'priem' ] = mysql_fetch_assoc (
mysql_query ( 'SELECT * FROM `priems` WHERE `id` = "' . $pl2 [ 'v2' ] . '" LIMIT 1' )
);
2022-08-11 10:38:38 +00:00
if ( isset ( $pl2 [ 'priem' ][ 'id' ])) {
$dt1 = $this -> lookStatsArray ( $pl2 [ 'priem' ][ 'date2' ]);
if ( isset ( $dt1 [ 'yron_u2' ])) {
2022-08-25 11:23:36 +00:00
$minu = $this -> getdr (
$dt1 [ 'yron_u2' ], [ 0 => 'lvl1' , 1 => 'yr1' , 2 => 'ts5' , 3 => 'ts6' ],
[ 0 => $btl -> users [ $btl -> uids [ $level ]], 1 => $hpmin , 2 => 1 , 3 => 0 ]
);
2022-08-11 10:38:38 +00:00
$miny -= $minu ;
$hpmin += $minu ;
if ( isset ( $dt1 [ 'rzEndMg' ]) && $dt1 [ 'rzEndMg' ] == 1 ) {
$btl -> delPriem ( $pl2 , $btl -> users [ $btl -> uids [ $uen ]]);
}
} elseif ( isset ( $dt1 [ 'rzEndMg' ]) && $dt1 [ 'rzEndMg' ] == 1 ) {
$btl -> delPriem ( $pl2 , $btl -> users [ $btl -> uids [ $uen ]]);
}
}
}
$hpmin = $btl -> testPogB ( $uen , $hpmin );
$hp2 = floor ( $btl -> stats [ $btl -> uids [ $uen ]][ 'hpNow' ] - $hpmin );
if ( $btl -> stats [ $btl -> uids [ $usu ]][ 'yrnhealmpprocmg' . $tmp ] > 0 && $fiz == 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$btl -> stats [ $btl -> uids [ $usu ]][ 'mpNow' ] += round (
$hpmin / 100 * $btl -> stats [ $btl -> uids [ $usu ]][ 'yrnhealmpprocmg' . $tmp ]
);
2022-08-11 10:38:38 +00:00
//if($btl->stats[$btl->uids[$usu]]['mpNow'] > $btl->stats[$btl->uids[$usu]]['mpAll']) {
//$btl->stats[$btl->uids[$usu]]['mpNow'] = $btl->stats[$btl->uids[$usu]]['mpAll'];
//}
$btl -> users [ $btl -> uids [ $usu ]][ 'mpNow' ] = $btl -> stats [ $btl -> uids [ $usu ]][ 'mpNow' ];
if ( $usu == $this -> u -> info [ 'id' ]) {
$this -> u -> info [ 'mpNow' ] = $btl -> stats [ $btl -> uids [ $usu ]][ 'mpNow' ];
$this -> u -> stats [ 'mpNow' ] = $btl -> stats [ $btl -> uids [ $usu ]][ 'mpNow' ];
}
}
if ( $hp2 < 0 ) {
$hp2 = 0 ;
} elseif ( $hp2 > $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ]) {
$hp2 = $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ];
}
$btl -> stats [ $btl -> uids [ $uen ]][ 'last_hp' ] = - floor ( $hpmin );
if ( $heal != 0 ) {
if ( $heal == - 1 ) {
//<2F> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <>
$btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] += $hpmin ;
if ( $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] < 0 ) {
$btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] = 0 ;
} elseif ( $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] > $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpAll' ]) {
$btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] = $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpAll' ];
}
if ( $eff [ 'user_use' ] == $this -> u -> info [ 'id' ]) {
$this -> u -> stats [ 'hpNow' ] = $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ];
}
$btl -> users [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] = $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ];
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `stats` SET `hpNow` = "' . $btl -> stats [ $btl -> uids [ $eff [ 'user_use' ]]][ 'hpNow' ] . '" WHERE `id` = "' . $eff [ 'user_use' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
} else {
//<2F> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
}
}
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> */
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <>
$btl -> users [ $btl -> uids [ $uen ]][ 'hpNow' ] = $hp2 ;
$btl -> stats [ $btl -> uids [ $uen ]][ 'hpNow' ] = $hp2 ;
if ( $uen == $this -> u -> info [ 'id' ]) {
$this -> u -> stats [ 'hpNow' ] = $hp2 ;
}
// <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $btl -> info [ 'type' ] == 99 and $hp2 == 0 and ! $trawm_off ) {
//$eff['user_use']
//$sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "'.$uen.'" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25');
$trawm_off = true ;
//$at[2][$i]['ttravm']='<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <font color=red><b><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> </b></font>.';
$btl -> addTravm ( $btl -> users [ $btl -> uids [ $uen ]][ 'id' ], 3 , $btl -> users [ $btl -> uids [ $eff [ 'user_use' ]]][ 'level' ]);
}
2022-08-25 11:23:36 +00:00
$upd = mysql_query (
'UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`last_hp` = "' . $btl -> stats [ $btl -> uids [ $uen ]][ 'last_hp' ] . '" WHERE `id` = "' . $uen . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <EFBFBD>
2022-08-25 11:23:36 +00:00
$vLog = 'time1=' . time (
) . '||s1=' . $btl -> users [ $btl -> uids [ $usu ]][ 'sex' ] . '||t1=' . $btl -> users [ $btl -> uids [ $usu ]][ 'team' ] . '||login1=' . $btl -> users [ $btl -> uids [ $usu ]][ 'login' ] . '||s2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'sex' ] . '||t2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'team' ] . '||login2=' . $btl -> users [ $btl -> uids [ $uen ]][ 'login' ] . '' ;
2022-08-11 10:38:38 +00:00
$mas1 = [
'time' => time (),
'battle' => $btl -> info [ 'id' ],
'id_hod' => ( $btl -> hodID + 1 ),
'text' => '' ,
'vars' => $vLog ,
'zona1' => '' ,
'zonb1' => '' ,
'zona2' => '' ,
'zonb2' => '' ,
'type' => '1' ,
];
if ( $rp > 0 ) {
$mas1 [ 'id_hod' ] -- ;
}
$hpminkrit = 0 ;
if ( $k == 1 ) {
$hpminkrit = $hpmin ;
}
2022-08-25 11:23:36 +00:00
$btl -> addNewStat (
[
'battle' => $this -> u -> info [ 'battle' ],
'uid1' => $this -> u -> info [ 'id' ],
'uid2' => $uen ,
'time' => time (),
'type' => 0 ,
'a' => '10000' ,
'b' => 0 ,
'type_a' => 1 ,
'type_b' => 0 ,
'ma' => 1 ,
'mb' => 1 ,
'yrn' => $hpmin ,
'yrn_krit' => $hpminkrit ,
'tm1' => $this -> u -> info [ 'team' ],
'tm2' => $btl -> users [ $btl -> uid [ $uen ]][ 'team' ],
]
);
2022-08-11 10:38:38 +00:00
$btl -> takeExp ( $this -> u -> info [ 'id' ], $hpmin , $usu , $uen );
if ( $hpmin > 0 ) {
$hpmin = '-' . ceil ( $hpmin );
} else {
$hpmin = '--' ;
}
$tco = [
1 => '006699' ,
2 => '006699' ,
3 => '006699' ,
4 => '006699' ,
5 => '006699' ,
6 => '006699' ,
7 => '006699' ,
]; //<2F> <> <20> <> <EFBFBD> <EFBFBD>
$tcl = [
1 => 'A00000' ,
2 => '008080' ,
3 => '0000FF' ,
4 => 'A52A2A' ,
5 => '006699' ,
6 => '006699' ,
7 => '006699' ,
]; //<2F> <> <20> <> <EFBFBD> <EFBFBD>
$tco = $tco [ $tmp ];
$tcl = $tcl [ $tmp ];
if ( $k == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD>
$tco = 'FF0000' ;
$tcl = 'FF0000' ;
} elseif ( $k == - 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$tco = 'CCCCCC' ;
$tcl = 'CCCCCC' ;
}
$nmz = [
1 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
2 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
3 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
4 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
5 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> ' ],
6 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> ' ],
7 => [ 0 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
];
$nmz = $nmz [ $tmp ];
if ( $fiz > 0 ) {
$nmz = [
1 => [ 0 => ', <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
2 => [ 0 => ', <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
3 => [ 0 => ', <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
4 => [ 0 => ', <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , ' , 1 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
];
$nmz = $nmz [ $fiz ];
}
if ( $rp == 1 ) {
if ( $k == 0 ) {
$tcl = '000000' ;
$tco = '008000' ;
}
$sx = [ 0 => '' , 1 => '<27> ' ];
2022-08-25 11:23:36 +00:00
$mas1 [ 'text' ] = '{tm1} {u2} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' . $sx [ $btl -> users [ $btl -> uids [ $uen ]][ 'sex' ]] . ' <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> "<b><font color=#' . $tcl . '>' . $pl [ 'name' ] . '</font></b>". <b><font title=<3D> <> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $nmz [ 1 ] . ' color=#' . $tco . '>' . $hpmin . '</font></b> [' . ceil (
$hp2
) . '/' . $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ] . ']' ;
2022-08-11 10:38:38 +00:00
} else {
if ( $fiz == 1 ) {
2022-08-25 11:23:36 +00:00
$mas1 [ 'text' ] = '{tm1} {u1} {1x16x0} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> "<b><font color=#' . $tcl . '>' . $pl [ 'name' ] . '</font></b>" <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> {u2}. <b><font title=<3D> <> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $nmz [ 1 ] . ' color=#' . $tco . '>' . $hpmin . '</font></b> [' . ceil (
$hp2
) . '/' . $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ] . ']' ;
2022-08-11 10:38:38 +00:00
} else {
2022-08-25 11:23:36 +00:00
$mas1 [ 'text' ] = '{tm1} {u1} {1x16x0} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "<b><font color=#' . $tcl . '>' . $pl [ 'name' ] . '</font></b>" <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' . $nmz [ 0 ] . ' {u2}. <b><font title=<3D> <> <EFBFBD> <3B> <> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $nmz [ 1 ] . ' color=#' . $tco . '>' . $hpmin . '</font></b> [' . ceil (
$hp2
) . '/' . $btl -> stats [ $btl -> uids [ $uen ]][ 'hpAll' ] . ']' ;
2022-08-11 10:38:38 +00:00
}
}
$btl -> add_log ( $mas1 );
$pz [( int ) $id ] = 1 ;
return $rr ;
}
private function testActiv ( $id )
{
$r = 0 ;
if (
$this -> u -> info [ 'admin' ] > 0 ||
$this -> u -> info [ 'nadmin' ] > 0 ||
2022-08-25 11:23:36 +00:00
$this -> u -> info [ 'id' ] > 0 ) {
2022-08-11 10:38:38 +00:00
$r = 1 ;
} else {
2022-08-25 11:23:36 +00:00
$tst = $this -> u -> testAction (
'`uid` = "' . $this -> u -> info [ 'id' ] . '" AND `time` < ' . time (
) . ' AND `vars` = "read" AND `vals` = "' . $id . '" LIMIT 1' ,
1
);
2022-08-11 10:38:38 +00:00
if ( isset ( $tst [ 'id' ])) {
$r = 1 ;
}
}
return $r ;
}
private function testRazmenOldUser ( $u2 , $u1 , $plid )
{
global $btl , $u ;
$r = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> -
if ( $btl -> users [ $btl -> uids [ $u2 ]][ 'id' ] != $this -> u -> info [ 'id' ]) {
if ( $btl -> users [ $btl -> uids [ $u1 ]][ 'level' ] < $btl -> users [ $btl -> uids [ $u2 ]][ 'level' ]) {
$r = 1 ;
echo '<div style="color: red; font-weight: bold; text-align: center;"><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> </div>' ;
} elseif ( $btl -> users [ $btl -> uids [ $u1 ]][ 'bot' ] > 0 && $btl -> users [ $btl -> uids [ $u2 ]][ 'bot' ] == 0 ) {
echo '<div style="color: red; font-weight: bold; text-align: center;"><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> </div>' ;
$r = 1 ;
} elseif (
$btl -> users [ $btl -> uids [ $u1 ]][ 'id' ] != $btl -> users [ $btl -> uids [ $u2 ]][ 'id' ] &&
! in_array ( $plid , [ 35 , 63 , 64 , 65 , 66 , 85 , 86 , 87 , 88 , 89 , 90 , 104 , 105 , 106 , 107 , 134 , 135 , 136 , 137 ])
) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 90,89,88,87,86,85,35
{
2022-08-25 11:23:36 +00:00
$this -> addPriem (
$this -> u -> info [ 'id' ], '344' , 'add_m11=-' . round ( $this -> u -> stats [ 'm11' ] * 75 / 100 ), 1 , 77 , 1 ,
$this -> u -> stats [ 'id' ], 3 , '<27> <> <EFBFBD> <EFBFBD> ' , 0 , 0 , 1
); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-11 10:38:38 +00:00
}
}
return $r ;
}
public function testDie ( $u1 )
{
global $btl ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
$btl -> spaCheck ( $btl -> stats [ $btl -> uids [ $u1 ]][ 'id' ]);
}
public function pruse ( $id )
{
global $u , $c , $code , $btl , $ue ;
if ( $id == 100500 && $this -> u -> info [ 'animal' ] > 0 ) {
2022-08-25 11:23:36 +00:00
$use_lst = $this -> u -> testAction (
'`uid` = "' . $this -> u -> info [ 'id' ] . '" AND `vars` = "animal_use' . $btl -> info [ 'id' ] . '" LIMIT 1' ,
1
);
2022-08-11 10:38:38 +00:00
if ( ! isset ( $use_lst [ 'id' ])) {
2022-08-25 11:23:36 +00:00
$a = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `users_animal` WHERE `uid` = "' . $this -> u -> info [ 'id' ] . '" AND `id` = "' . $this -> u -> info [ 'animal' ] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( $this -> u -> stats [ 'hpNow' ] < 1 ) {
echo '<27> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> ' ;
} elseif ( isset ( $a [ 'id' ]) && $a [ 'eda' ] < 1 ) {
echo '<27> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ...' ;
} elseif ( isset ( $a [ 'id' ])) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD>
$tp = [
1 => '<27> <> <EFBFBD> ' ,
2 => '<27> <> <EFBFBD> <EFBFBD> ' ,
3 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
4 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
5 => '<27> <> <EFBFBD> ' ,
6 => '<27> <> <EFBFBD> <EFBFBD> ' ,
7 => '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ,
];
2022-08-25 11:23:36 +00:00
$id = mysql_fetch_assoc (
mysql_query (
'SELECT `id` FROM `test_bot` WHERE `login` = "' . $tp [ $a [ 'type' ]] . ' [' . $a [ 'level' ] . ']" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $id [ 'id' ]) && $btl -> info [ 'type' ] != 500 ) {
$b = $this -> u -> addNewbot ( $id [ 'id' ], null , null );
if ( $b > 0 && $b != false ) {
$a [ 'eda' ] -= 4 ;
if ( $a [ 'eda' ] < 0 ) {
$a [ 'eda' ] = 0 ;
}
2022-08-25 11:23:36 +00:00
$vLog = 'time1=' . time (
) . '||s1=' . $this -> u -> info [ 'sex' ] . '||t1=' . $this -> u -> info [ 'team' ] . '||login1=' . $this -> u -> info [ 'login' ] . '' ;
2022-08-11 10:38:38 +00:00
$mas1 = [
'time' => time (),
'battle' => $btl -> info [ 'id' ],
'id_hod' => $btl -> hodID ,
'vars' => $vLog ,
'zona1' => '' ,
'zonb1' => '' ,
'zona2' => '' ,
'zonb2' => '' ,
'type' => '1' ,
];
$sex = $this -> u -> info [ 'sex' ] === 1 ? 'a' : '' ;
$mas1 [ 'text' ] = " { tm1} { u1} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> $sex <20> <> <EFBFBD> <EFBFBD> <EFBFBD> "<b> " . $a [ 'name' ] . '"</b>' ;
$btl -> add_log ( $mas1 );
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `users` SET `login` = "' . $a [ 'name' ] . ' (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> ' . $this -> u -> info [ 'login' ] . ')",`obraz` = "' . $a [ 'obraz' ] . '.gif",`battle` = "' . $btl -> info [ 'id' ] . '" WHERE `id` = "' . $b [ 'id' ] . '" LIMIT 1'
);
mysql_query (
'UPDATE `stats` SET `team` = "' . $this -> u -> info [ 'team' ] . '" WHERE `id` = "' . $b [ 'id' ] . '" LIMIT 1'
);
mysql_query (
'UPDATE `users_animal` SET `eda` = "' . $a [ 'eda' ] . '" WHERE `id` = "' . $a [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
$this -> u -> addAction ( time (), 'animal_use' . $btl -> info [ 'id' ], $a [ 'level' ]);
} else {
echo '<27> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ...' ;
}
} else {
//<2F> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
echo '<br><3E> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ...' ;
}
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
echo '<27> <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ...' ;
}
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
echo '<27> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ...' ;
}
} else {
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
$pz = explode ( '|' , $this -> u -> info [ 'priems_z' ]);
if ( $p [( int ) $id ] > 0 && $pz [( int ) $id ] <= 0 && $this -> u -> info [ 'hpNow' ] >= 1 ) {
2022-08-25 11:23:36 +00:00
$pl = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `priems` WHERE `level`<=' . $this -> u -> info [ 'level' ] . ' AND `id` = ' . $p [( int ) $id ]
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $pl [ 'id' ]) && $pl [ 'activ' ] != 1 ) {
if ( $pl [ 'activ' ] == 0 ) {
unset ( $pl );
} elseif ( $pl [ 'activ' ] > 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $this -> testActiv ( $pl [ 'activ' ]) == 0 ) {
unset ( $pl );
}
}
}
if ( isset ( $pl [ 'id' ])) {
$notr = 0 ;
$pl [ 'useon_user' ] = $this -> u -> info [ 'enemy' ];
if ( isset ( $_POST [ 'useon' ]) && $_POST [ 'useon' ] != '' && $_POST [ 'useon' ] != 'none' ) {
$_POST [ 'useon' ] = iconv ( 'UTF-8' , 'windows-1251' , $_POST [ 'useon' ]);
2022-08-25 11:23:36 +00:00
$this -> ue = mysql_fetch_assoc (
mysql_query (
' SELECT
2022-06-06 21:30:34 +00:00
`u` . `id` , `u` . `login` , `u` . `login2` , `u` . `online` , `u` . `admin` , `u` . `city` , `u` . `cityreg` , `u` . `align` , `u` . `clan` ,
`u` . `level` , `u` . `money` , `u` . `money3` , `u` . `money4` , `u` . `battle` , `u` . `sex` , `u` . `obraz` , `u` . `win` , `u` . `win_t` ,
`u` . `lose` , `u` . `lose_t` , `u` . `nich` , `u` . `timeMain` , `u` . `invis` , `u` . `bot_id` , `u` . `animal` , `u` . `type_pers` ,
`u` . `notrhod` , `u` . `bot_room` , `u` . `inUser` , `u` . `inTurnir` , `u` . `inTurnirnew` , `u` . `activ` , `u` . `stopexp` , `u` . `real` ,
`st` .*
2022-08-11 10:38:38 +00:00
FROM `users` AS `u`
LEFT JOIN `stats` AS `st` ON ( `u` . `id` = `st` . `id` )
WHERE (
`u` . `login` = " ' . mysql_real_escape_string( $_POST['useon'] ) . ' " OR
(
`u` . `login2` = " ' . mysql_real_escape_string( $_POST['useon'] ) . ' " AND
`u` . `login2` != " " )
) AND
(
`u` . `inUser` > 0 OR
(
`u` . `battle` = " ' . $btl->info ['id'] . ' " AND
`st` . `hpNow` > 0
)
2022-08-25 11:23:36 +00:00
) ORDER BY `u` . `id` DESC LIMIT 1 '
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $this -> ue [ 'id' ]) && $this -> ue [ 'inUser' ] > 0 ) {
2022-08-25 11:23:36 +00:00
$this -> ue = mysql_fetch_assoc (
mysql_query (
' SELECT
2022-06-06 21:30:34 +00:00
`u` . `id` , `u` . `login` , `u` . `login2` , `u` . `online` , `u` . `admin` , `u` . `city` , `u` . `cityreg` , `u` . `align` , `u` . `clan` ,
`u` . `level` , `u` . `money` , `u` . `money3` , `u` . `money4` , `u` . `battle` , `u` . `sex` , `u` . `obraz` , `u` . `win` , `u` . `win_t` ,
`u` . `lose` , `u` . `lose_t` , `u` . `nich` , `u` . `timeMain` , `u` . `invis` , `u` . `bot_id` , `u` . `animal` , `u` . `type_pers` ,
`u` . `notrhod` , `u` . `bot_room` , `u` . `inUser` , `u` . `inTurnir` , `u` . `inTurnirnew` , `u` . `activ` , `u` . `stopexp` , `u` . `real` ,
`st` .*
2022-08-11 10:38:38 +00:00
FROM `users` AS `u`
LEFT JOIN `stats` AS `st` ON ( `u` . `id` = `st` . `id` )
WHERE
`u` . `battle` = " ' . $btl->info ['id'] . ' " AND
`st` . `hpNow` > 0 ) AND
2022-08-25 11:23:36 +00:00
`u` . `id` = " ' . $this->ue ['inUser'] . ' " ORDER BY `u` . `id` ASC LIMIT 1 '
)
);
2022-08-11 10:38:38 +00:00
}
if ( ! isset ( $this -> ue [ 'id' ]) && $pl [ 'trUser' ] > 0 ) {
$notr ++ ;
}
if ( $pl [ 'team' ] == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD>
if ( $this -> u -> info [ 'team' ] != $this -> ue [ 'team' ]) {
$notr ++ ;
}
} elseif ( $pl [ 'team' ] == 2 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $this -> u -> info [ 'team' ] == $this -> ue [ 'team' ]) {
$notr ++ ;
}
} elseif ( $pl [ 'team' ] == 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
} else {
2022-08-25 11:23:36 +00:00
$ga = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl -> info [ 'id' ] . '" AND `uid1` = "' . $this -> u -> info [ 'id' ] . '" AND `uid2` = "' . $this -> u -> info [ 'enemy' ] . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if (( $this -> u -> info [ 'enemy' ] == 0 || isset ( $ga [ 'id' ])) && ( $pl [ 'tr_hod' ] > 0 || $pl [ 'trUser' ] > 0 )) {
$notr ++ ;
}
}
$notr += $this -> testpriem ( $pl , 1 , $this -> ue [ 'id' ]);
if ( $this -> ue [ 'id' ] > 0 ) {
$notr += $this -> testRazmenOldUser ( $this -> ue [ 'id' ], $this -> u -> info [ 'enemy' ], $pl [ 'id' ]);
}
if ( $notr == 0 ) {
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `stats` SET `last_pr` = "' . $pl [ 'id' ] . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $this -> ue [ 'id' ] > 0 ) {
$btl -> priemsRazmen ([ $this -> u -> info [ 'id' ], $this -> ue [ 'id' ]], 'fast' );
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this -> ue [ 'id' ] . '" AND `delete` = 0'
);
2022-08-11 10:38:38 +00:00
} else {
$btl -> priemsRazmen ([ $this -> u -> info [ 'id' ], $this -> u -> info [ 'enemy' ]], 'fast' );
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this -> u -> info [ 'enemy' ] . '" AND `delete` = 0'
);
2022-08-11 10:38:38 +00:00
}
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this -> u -> info [ 'id' ] . '" AND `delete` = 0'
);
2022-08-11 10:38:38 +00:00
if ( file_exists ( '../../_incl_data/class/priem/' . $pl [ 'id' ] . '.php' )) {
require ( '../../_incl_data/class/priem/' . $pl [ 'id' ] . '.php' );
$this -> testDie ( $this -> ue [ 'id' ]);
} else {
echo 'useSkill' . $pl [ 'id' ];
}
if ( ! isset ( $cup )) {
$this -> uppz ( $pl , $id );
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//$this->mintr($pl);
if ( $pl [ 'tr_hod' ] > 0 ) {
$this -> trhod ( $pl );
}
if ( $pl [ 'id' ] != 258 ) {
if ( $pl [ 'cancel_eff' ] == '' ) {
$pl [ 'cancel_eff' ] = '258' ;
} else {
$pl [ 'cancel_eff' ] .= ',258' ;
}
}
if ( $pl [ 'cancel_eff' ] != '' ) {
$i = 0 ;
$e = explode ( ',' , $pl [ 'cancel_eff' ]);
while ( $i < count ( $e )) {
if ( $e [ $i ] > 0 ) {
if ( $e [ $i ] == 258 ) {
2022-08-25 11:23:36 +00:00
$nem = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `eff_users` WHERE `uid` = "' . $this -> u -> info [ 'id' ] . '" AND `v1` = "priem" AND `v2` = "' . $e [ $i ] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
} else {
2022-08-25 11:23:36 +00:00
$nem = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `eff_users` WHERE `uid` = "' . $this -> ue [ 'id' ] . '" AND `v1` = "priem" AND `v2` = "' . $e [ $i ] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
}
if ( isset ( $nem [ 'id' ])) {
2022-08-25 11:23:36 +00:00
$nem [ 'priem' ] = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `priems` WHERE `id` = "' . $e [ $i ] . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $nem [ 'id' ])) {
$btl -> delPriem ( $nem , $btl -> users [ $btl -> uids [ $this -> ue [ 'id' ]]], 500 );
}
}
}
$i ++ ;
}
}
}
}
}
}
}
}
private function rezadEff ( $uid , $mg )
{
global $u , $btl , $c , $code ;
//$this->rezadEff($this->u->info['id'],'wis_fire_');
$md = '' ;
$md2 = '' ;
$ex = explode ( '|' , $btl -> users [ $btl -> uids [ $uid ]][ 'priems' ]);
$ex2 = explode ( '|' , $btl -> users [ $btl -> uids [ $uid ]][ 'priems_z' ]);
$i = 0 ;
$ty = [];
while ( $i < count ( $ex )) {
if ( $ex [ $i ] > 0 ) {
$md .= '`id` = "' . (( int ) $ex [ $i ]) . '" OR ' ;
$ty [ $ex [ $i ]] = $i ;
}
$i ++ ;
}
$md = rtrim ( $md , ' OR ' );
if ( $md != '' ) {
$md = '( ' . $md . ' ) AND ' ;
}
$sp = mysql_query ( 'SELECT * FROM `priems` WHERE ' . $md . ' `img` LIKE "%' . $mg . '%"' );
while ( $pl = mysql_fetch_assoc ( $sp )) {
$ex2 [ $ty [ $pl [ 'id' ]]] = 0 ;
}
$md2 = implode ( '|' , $ex2 );
$btl -> users [ $btl -> uids [ $uid ]][ 'priems_z' ] = $md2 ;
$this -> u -> info [ 'priems_z' ] = $md2 ;
$upd = mysql_query ( 'UPDATE `stats` SET `priems_z` = "' . $md2 . '" WHERE `id` = "' . (( int ) $uid ) . '" LIMIT 1' );
unset ( $md , $md2 , $ty );
return $upd ;
}
private function trhod ( $pl )
{
global $u , $btl ;
if ( $this -> u -> info [ 'notrhod' ] == - 1 ) {
$this -> u -> info [ 'notrhod' ] = 0 ;
if ( $this -> u -> stats [ 'magic_cast' ] > 0 ) {
$this -> u -> info [ 'notrhod' ] = $this -> u -> stats [ 'magic_cast' ];
}
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `users` SET `notrhod` = "' . $this -> u -> info [ 'notrhod' ] . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
}
if ( $this -> u -> info [ 'notrhod' ] > 0 ) {
if ( $pl [ 'tr_hod' ] > 0 ) {
$this -> u -> info [ 'notrhod' ] -- ;
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `users` SET `notrhod` = "' . $this -> u -> info [ 'notrhod' ] . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
}
} else {
2022-08-25 11:23:36 +00:00
$a1 = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl -> info [ 'id' ] . '" AND `uid2` = "' . $this -> u -> info [ 'id' ] . '" AND `uid1` = "' . $this -> u -> info [ 'enemy' ] . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $a1 [ 'id' ])) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 2 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `battle_act` SET `out2` = "1",`tpo2` = "2" WHERE `id` = "' . $a1 [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
$a1 [ 'out2' ] = 1 ;
$a1 [ 'tpo2' ] = 2 ;
$btl -> atacks [ $a1 [ 'id' ]] = $a1 ;
$btl -> users [ $this -> u -> info [ 'id' ]][ 'priems_z' ] = $this -> u -> info [ 'priems_z' ];
$btl -> startAtack ( $a1 [ 'id' ]);
} else {
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
mysql_query (
'INSERT INTO `battle_act` (`battle`,`uid1`,`uid2`,`time`,`out1`,`type`,`tpo1`) VALUES ("' . $btl -> info [ 'id' ] . '","' . $this -> u -> info [ 'id' ] . '","' . $this -> u -> info [ 'enemy' ] . '","' . time (
) . '","1","1","2")'
);
2022-08-11 10:38:38 +00:00
}
}
}
public function plusData ( $d1 , $d2 )
{
global $u ;
$j1 = $this -> lookStatsArray ( $d1 );
$j2 = $this -> lookStatsArray ( $this -> redate ( $d2 , $this -> u -> info [ 'id' ]));
$v = $this -> u -> lookKeys ( $this -> redate ( $d2 , $this -> u -> info [ 'id' ]), 0 ); // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 2
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$i = 0 ;
$inf = '' ;
while ( $i < count ( $v )) {
$j1 [ $v [ $i ]] += $j2 [ $v [ $i ]];
$vi = str_replace ( 'add_' , '' , $v [ $i ]);
if ( $this -> u -> is [ $vi ] != '' ) {
if ( $j2 [ $v [ $i ]] > 0 ) {
$inf .= $this -> u -> is [ $vi ] . ': +' . ( $j2 [ $v [ $i ]] * ( 1 + $mpr [ 'x' ])) . ', ' ;
} elseif ( $j2 [ $v [ $i ]] < 0 ) {
$inf .= $this -> u -> is [ $vi ] . ': ' . ( $j2 [ $v [ $i ]] * ( 1 + $mpr [ 'x' ])) . ', ' ;
}
}
$i ++ ;
}
$inf = rtrim ( $inf , ', ' );
$j1 = $this -> u -> impStats ( $j1 );
return $j1 ;
}
private function addEffPr ( $pl , $id )
{
global $u , $btl ;
$rcu = false ;
$j = $this -> lookStatsArray ( $pl [ 'date2' ]);
$mpr = false ;
$addch = 0 ;
$uid = $this -> u -> info [ 'id' ];
if ( isset ( $this -> ue [ 'id' ])) {
$uid = $this -> ue [ 'id' ];
}
if ( isset ( $j [ 'onlyOne' ])) {
2022-08-25 11:23:36 +00:00
$mpr = Db :: getRow (
'select * from eff_users where v2 = ? and uid = ? and `delete` = 0 and mark = 1' ,
[ $pl [ 'id' ], $uid ]
);
2022-08-11 10:38:38 +00:00
//$mpr = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `v2` = "' . $pl['id'] . '" AND `uid` = "' . $uid . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1'));
}
2022-08-25 11:23:36 +00:00
// if ($pl['cancel_eff2'] != '') {
// $i = 0;
// $e = explode(',', $pl['cancel_eff2']);
// while ($i < count($e)) {
// if ($e[$i] > 0) {
// $nem = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $uid . '" AND `v1` = "priem" AND `v2` = "' . $e[$i] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1'));
// if (isset($nem['id'])) {
// $nem['priem'] = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $e[$i] . '" LIMIT 1'));
// if (isset($nem['id'])) {
// $btl->delPriem($nem, $btl->users[$btl->uids[$uid]], 2);
// if ($nem['id'] == $mpr['id']) {
// unset($mpr);
// }
// }
// }
// }
// $i++;
// }
// }
2022-08-11 10:38:38 +00:00
if ( ! empty ( $pl [ 'cancel_eff2' ])) {
$this -> cancelEffects ( $pl [ 'cancel_eff2' ], $uid , $btl );
}
$pld = [ 0 => '' ];
$nc = 0 ;
if ( isset ( $mpr [ 'id' ]) && $j [ 'onlyOne' ] == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$addch = 1 ;
$this -> mintr ( $pl );
$this -> uppz ( $pl , $id );
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( isset ( $this -> ue [ 'id' ])) {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> ue , 0 );
} else {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> u -> info , 0 );
}
$nc = 1 ;
} elseif ( ! isset ( $mpr [ 'id' ])) {
$data = '' ;
if ( isset ( $j [ 'date3Plus' ])) {
$data = $this -> redate ( $pl [ 'date3' ], $this -> u -> info [ 'id' ]);
}
$hd1 = - 1 ;
if ( $pl [ 'limit' ] > 0 ) {
$tm = 77 ;
$hd1 = $pl [ 'limit' ];
} else {
$tm = 77 ;
}
if ( $pl [ 'limit' ] == - 2 ) {
$hd1 = $pl [ 'limit' ];
}
if ( $pl [ 'id' ] == 239 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <>
{
2022-08-25 11:23:36 +00:00
$btl -> priemAddLogFast (
$uid , 0 , $pl [ 'name' ],
'{tm' . $this -> u -> info [ 'team' ] . '} ' . $btl -> addlt (
1 , 17 , $btl -> users [ $btl -> uids [ $uid ]][ 'sex' ],
null
) . '' ,
1 , time ()
);
2022-08-11 10:38:38 +00:00
}
2022-08-25 11:23:36 +00:00
2022-08-11 10:38:38 +00:00
$uu = $pl [ 'id' ] === 260 ? '' : $this -> u -> info [ 'id' ];
2022-08-25 11:23:36 +00:00
Db :: sql (
'insert into eff_users (hod, v1, v2, img2, id_eff, uid, name, data, overType, timeUse, user_use) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' ,
[ $hd1 , 'priem' , $pl [ 'id' ], $pl [ 'img' ] . '.gif' , 22 , $uid , $pl [ 'name' ], $data , 0 , $tm , $uu ]
);
2022-08-11 10:38:38 +00:00
unset ( $hd1 , $uu );
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$addch = 1 ;
$rcu = true ;
$nc = 1 ;
$this -> mintr ( $pl );
//$this->uppz($pl,$id);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( isset ( $this -> ue [ 'id' ])) {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> ue , 0 );
} else {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> u -> info , 0 );
}
} elseif ( $j [ 'onlyOne' ] > 1 ) {
if ( $mpr [ 'x' ] < $j [ 'onlyOne' ] && isset ( $j [ 'date3Plus' ])) {
$j1 = $this -> lookStatsArray ( $mpr [ 'data' ]);
$j2 = $this -> lookStatsArray ( $this -> redate ( $pl [ 'date3' ], $this -> u -> info [ 'id' ]));
$v = $this -> u -> lookKeys ( $this -> redate ( $pl [ 'date3' ], $this -> u -> info [ 'id' ]), 0 ); // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 2
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$i = 0 ;
$inf = '' ;
while ( $i < count ( $v )) {
$j1 [ $v [ $i ]] += $j2 [ $v [ $i ]];
$vi = str_replace ( 'add_' , '' , $v [ $i ]);
if ( $this -> u -> is [ $vi ] != '' ) {
if ( $j2 [ $v [ $i ]] > 0 ) {
$inf .= $this -> u -> is [ $vi ] . ': +' . ( $j2 [ $v [ $i ]] * ( 1 + $mpr [ 'x' ])) . ', ' ;
} elseif ( $j2 [ $v [ $i ]] < 0 ) {
$inf .= $this -> u -> is [ $vi ] . ': ' . ( $j2 [ $v [ $i ]] * ( 1 + $mpr [ 'x' ])) . ', ' ;
}
}
$i ++ ;
}
$inf = rtrim ( $inf , ', ' );
$j1 = $this -> u -> impStats ( $j1 );
$pld [ 0 ] = ' x' . ( $mpr [ 'x' ] + 1 );
if ( $j [ 'refHod' ] == 1 ) {
$mpr [ 'hod' ] = $pl [ 'limit' ];
}
2022-08-25 11:23:36 +00:00
$upd = mysql_query (
'UPDATE `eff_users` SET `hod` = "' . $mpr [ 'hod' ] . '",`data` = "' . $j1 . '",`x` = `x`+1 WHERE `id` = "' . $mpr [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
if ( $upd ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$this -> mintr ( $pl );
$this -> uppz ( $pl , $id );
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( isset ( $this -> ue [ 'id' ])) {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> ue , 0 );
} else {
$btl -> stats [ $btl -> uids [ $uid ]] = $this -> u -> getStats ( $this -> u -> info , 0 );
}
$addch = 1 ;
$rcu = true ;
$nc = 1 ;
}
}
}
/* <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> */
if ( $nc == 1 && $pl [ 'tr_hod' ] > 0 ) {
$this -> trhod ( $pl );
}
//return $rcu;
}
public function mintr ( $pl )
{
global $u , $btl ;
$x = 1 ;
$rt = '' ;
while ( $x <= 7 ) {
if ( $pl [ 'ndt' . $x ] == 0 ) {
$this -> u -> info [ 'tactic' . $x ] -= $pl [ 'tt' . $x ];
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] -= $pl [ 'tt' . $x ];
}
if ( $this -> u -> info [ 'tactic' . $x ] < 0 ) {
$this -> u -> info [ 'tactic' . $x ] = 0 ;
}
if ( $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] < 0 ) {
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] = 0 ;
}
//$rt .= ',`tactic'.$x.'`="'.$this->u->info['tactic'.$x].'"';
$rt .= ',`tactic' . $x . '`="' . $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] . '"' ;
$x ++ ;
}
if ( $pl [ 'xuse' ] > 0 ) {
$this -> u -> addAction ( time (), 'use_priem_' . $btl -> info [ 'id' ] . '_' . $this -> u -> info [ 'id' ], $pl [ 'id' ]);
}
$rt = ltrim ( $rt , ',' );
mysql_query ( 'UPDATE `stats` SET ' . $rt . ' WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1' );
}
public function maxtr ( $x , $val )
{
global $u , $btl ;
$this -> u -> info [ 'tactic' . $x ] += $val ;
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] += $val ;
if ( $this -> u -> info [ 'tactic' . $x ] < 0 ) {
$this -> u -> info [ 'tactic' . $x ] = 0 ;
}
if ( $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] < 0 ) {
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] = 0 ;
}
$rt = '`tactic' . $x . '`="' . $this -> u -> info [ 'tactic' . $x ] . '"' ;
mysql_query ( 'UPDATE `stats` SET ' . $rt . ' WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1' );
}
private function actpridMax ( $pl )
{
global $u , $btl ;
if ( $pl [ 'actprid2' ] > 0 || $pl [ 'actprid3' ] > 0 ) {
$i = 0 ;
$pe = explode ( '|' , $this -> u -> info [ 'priems' ]);
$piz = [];
while ( $i < count ( $pe )) {
if ( $pl [ 'sbr' ] == 0 ) {
//<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$psp = mysql_fetch_assoc (
mysql_query ( 'SELECT * FROM `priems` WHERE `id` = "' . (( int ) $pe [ $i ]) . '" LIMIT 1' )
);
2022-08-11 10:38:38 +00:00
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$imgnm = '' ;
$nm = explode ( '_' , $pl [ 'img' ]);
if ( $nm [ 0 ] == 'wis' ) { //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
$imgnm = $nm [ 0 ] . '_' . $nm [ 1 ] . '%' ;
} else {
$imgnm = $nm [ 0 ] . '%' ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$psp = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `priems` WHERE `id` = "' . (( int ) $pe [ $i ]) . '" AND `img` LIKE "' . $imgnm . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
}
if ( $pl [ 'noprid' ] == 0 && isset ( $psp [ 'id' ]) && $psp [ 'tr_hod' ] == 0 && $psp [ 'type_pr' ] == 1 && $psp [ 'noprid' ] == 0 ) {
if ( $pl [ 'actprid2' ] > 0 ) {
$piz [ $pe [ $i ]] = ( int ) $pl [ 'actprid2' ];
} elseif ( $pl [ 'actprid3' ] > 0 ) {
$piz [ $pe [ $i ]] = $psp [ 'zad' ];
}
}
$i ++ ;
}
$pz = explode ( '|' , $this -> u -> info [ 'priems_z' ]);
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
$i = 0 ;
while ( $i < count ( $p )) {
if ( $p [ $i ] > 0 && isset ( $piz [ $p [ $i ]]) && $pz [ $i ] == 0 ) {
$pz [ $i ] = $piz [ $p [ $i ]];
}
$i ++ ;
}
$pz = implode ( '|' , $pz );
$this -> u -> info [ 'priems_z' ] = $pz ;
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'priems_z' ] = $pz ;
$btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'priems_z' ] = $pz ;
}
}
public function uppz ( $pl , $id )
{
global $u , $btl ;
$this -> actpridMax ( $pl );
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
$pz = explode ( '|' , $this -> u -> info [ 'priems_z' ]);
$pz [( int ) $id ] = $pl [ 'zad' ];
$i = 0 ;
$pe = explode ( ',' , $pl [ 'actprid' ]);
$piz = [];
while ( $i < count ( $pe )) {
$piz [ $pe [ $i ]] = 1 ;
$i ++ ;
}
$i = 0 ;
$pe = explode ( ',' , $pl [ 'actprid_one' ]);
$piz2 = [];
while ( $i < count ( $pe )) {
$piz2 [ $pe [ $i ]] = 1 ;
$i ++ ;
}
$i = 0 ;
while ( $i < count ( $p )) {
if ( $p [ $i ] > 0 ) {
if ( isset ( $piz [ $p [ $i ]])) {
if ( $pl [ 'id' ] == 281 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> + <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 5 <20> <> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $p [ $i ] == 246 || $p [ $i ] == 186 ) {
$pz [ $i ] = 5 ;
} else {
$pz [ $i ] = $pl [ 'zad' ];
}
} else {
$pz [ $i ] = $pl [ 'zad' ];
}
}
if ( isset ( $piz2 [ $p [ $i ]]) && $pz [ $i ] == 0 ) {
$pz [ $i ] = 1 ;
}
}
$i ++ ;
}
$pz = implode ( '|' , $pz );
$this -> u -> info [ 'priems_z' ] = $pz ;
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'priems_z' ] = $pz ;
$btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'priems_z' ] = $pz ;
$tr = $this -> lookStatsArray ( $pl [ 'tr' ]);
if ( isset ( $tr [ 'tr_mpNow' ])) {
$tr [ 'tr_mpNow' ] = round ( $tr [ 'tr_mpNow' ] / 100 * ( 100 - $this -> u -> stats [ 'min_use_mp' ]));
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] -= $tr [ 'tr_mpNow' ];
$btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] -= $tr [ 'tr_mpNow' ];
if ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] < $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ]) {
$btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] = $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ];
}
}
$this -> u -> info [ 'mpNow' ] = $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ];
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `stats` SET `mpNow` = "' . $this -> u -> info [ 'mpNow' ] . '",`priems_z` = "' . $pz . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
}
public function reuns ( $id )
{
global $u , $c , $code ;
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
if ( $p [( int ) $id ] > 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$p [( int ) $id ] = 0 ;
$p = implode ( '|' , $p );
2022-08-25 11:23:36 +00:00
mysql_query (
'UPDATE `stats` SET `priems` = "' . mysql_real_escape_string (
$p
) . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
$this -> u -> info [ 'priems' ] = $p ;
}
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
* @ param $id
* @ return void
*/
public function uns ( $id )
{
global $u , $c , $code ;
2022-08-25 11:23:36 +00:00
$pl = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `priems` WHERE `level`<="' . $this -> u -> info [ 'level' ] . '" AND `activ` > "0" AND `id` = "' . $id . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( ! isset ( $pl [ 'id' ]) || $this -> testpriem ( $pl , 1 ) != 0 ) {
return ;
}
$yes = - 1 ;
$non = - 1 ;
$i = 0 ;
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
while ( $i < $this -> u -> info [ 'priemslot' ]) {
if ( $non == - 1 && $p [ $i ] == 0 ) {
$non = $i ;
}
if ( $p [ $i ] == $pl [ 'id' ]) {
$yes = $i ;
}
$i ++ ;
}
if ( $yes != - 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return ;
}
if ( $non != - 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
$p [ $non ] = $pl [ 'id' ];
$p = implode ( '|' , $p );
2022-08-25 11:23:36 +00:00
$upd = mysql_query (
'UPDATE `stats` SET `priems` = "' . $p . '" WHERE `id` = "' . $this -> u -> info [ 'id' ] . '" LIMIT 1'
);
2022-08-11 10:38:38 +00:00
if ( $upd ) {
$this -> u -> info [ 'priems' ] = $p ;
}
} else {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
echo '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ...' ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> $id - 1 (<28> <> <EFBFBD> <20> <> <EFBFBD> ), 2 - <20> <20> <> <EFBFBD>
public function seeMy ( $t )
{
global $u , $c , $code , $btl ;
$i = 0 ;
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
$lvar = '' ;
$pr = '' ;
while ( $i < $this -> u -> info [ 'priemslot' ]) {
if ( $p [ $i ] > 0 ) {
2022-08-25 11:23:36 +00:00
$pl = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `priems` WHERE `level`<="' . $this -> u -> info [ 'level' ] . '" AND `activ` > "0" AND `id` = "' . mysql_real_escape_string (
$p [ $i ]
) . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
$lvar = $this -> priemInfo ( $pl , $t , $i );
$pz = $lvar [ 1 ];
$lvar = $lvar [ 0 ];
if ( $t == 1 ) {
if ( isset ( $_GET [ 'inv' ])) {
$cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . (( int ) $_GET [ 'all' ]) . '&skills=1&rz=4&p_raz=all\'"' ;
} else {
$cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . (( int ) $_GET [ 'all' ]) . '&skills=1&unuse_priem=' . $i . '&rz=4&p_raz=\' + p_raz"' ;
}
} else {
if ( $pl [ 'type' ] == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( $pl [ 'onUser' ] == 1 ) {
$oninuser = '' ;
if ( $pl [ 'team' ] == 1 ) {
if ( $this -> u -> info [ 'login2' ] != '' ) {
$oninuser = $this -> u -> info [ 'login2' ];
} else {
$oninuser = $this -> u -> info [ 'login' ];
}
} else {
if ( $btl -> users [ $btl -> uids [ $this -> u -> info [ 'enemy' ]]][ 'login2' ] != '' ) {
$oninuser = $btl -> users [ $btl -> uids [ $this -> u -> info [ 'enemy' ]]][ 'login2' ];
} else {
$oninuser = $btl -> users [ $btl -> uids [ $this -> u -> info [ 'enemy' ]]][ 'login' ];
}
}
$cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl [ 'name' ] . '\',\'' . $oninuser . '\',\'' . $pl [ 'img' ] . '\');"' ;
unset ( $oninuser );
} else {
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl [ 'img' ] . '\');"' ;
}
} elseif ( $pl [ 'type' ] == 2 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl [ 'img' ] . '\');"' ;
} elseif ( $pl [ 'type' ] == 3 ) {
$cl = 'href="javascript:void(0);" onClick="alert(\'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?\');"' ;
}
}
$notr = $this -> testpriem ( $pl , $t );
$cl2 = '' ;
$cli2 = '' ;
if ((( $pz [ $i ] > 0 || $notr > 0 ) && $t == 2 ) || ( isset ( $this -> u -> stats [ 'nopriems' ]) && $pl [ 'nosh' ] == 0 ) || $this -> u -> stats [ 'notuse_last_pr' ] == $pl [ 'id' ]) {
$cli2 = ' class="nopriemuse" ' ;
}
$pr .= '<a onMouseOver="top.hi(this,\'<b>' . $pl [ 'name' ] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" ' . $cl . '><img ' . $cli2 . ' style="margin-top:3px; ' . $cl2 . ' margin-left:4px;" src="https://img.new-combats.com/i/eff/' . $pl [ 'img' ] . '.gif" width="40" height="25" /></a>' ;
} else {
2022-08-25 11:23:36 +00:00
2022-08-11 10:38:38 +00:00
if ( isset ( $_GET [ 'inv' ])) {
$pr .= '<a title="<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " href="javascript:void(0)" onclick="location.href=\'main.php?all=' . (( int ) $_GET [ 'all' ]) . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="40" height="25" /></a>' ;
} else {
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="40" height="25" />' ;
}
2022-08-25 11:23:36 +00:00
2022-08-11 10:38:38 +00:00
}
$i ++ ;
}
if ( $this -> u -> info [ 'animal' ] > 0 && $t == 2 ) {
2022-08-25 11:23:36 +00:00
$use_lst = $this -> u -> testAction (
'`uid` = "' . $this -> u -> info [ 'id' ] . '" AND `vars` = "animal_use' . $btl -> info [ 'id' ] . '" LIMIT 1' ,
1
);
2022-08-11 10:38:38 +00:00
if ( ! isset ( $use_lst [ 'id' ])) {
$cl2 = '' ;
$pr .= '<a onMouseOver="top.hi(this,\'<b><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> </b><Br><3E> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> .\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" href="javascript:void(0);" onClick="usepriem(100500,1,\'\');"><img style="margin-top:1px; ' . $cl2 . ' margin-left:3px;" src="https://img.new-combats.com/i/eff/pet_unleash.gif" width="40" height="25" /></a>' ;
} else {
$cl2 = '" class="nopriemuse' ;
$pr .= '<img onMouseOver="top.hi(this,\'<b><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> </b><Br><3E> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> .\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:1px; margin-left:2px;' . $cl2 . '" src="https://img.new-combats.com/i/eff/pet_unleash.gif" width="40" height="25" />' ;
}
}
if ( $t == 1 ) {
echo '<div style="width:230px;">' . $pr . '</div>' ;
} elseif ( $t == 2 ) {
return str_replace ( '"' , '\\"' , $pr );
}
}
public function testpriem ( $pl , $t = 1 , $o = 0 )
{
global $c , $u , $code , $btl ;
$tr = $this -> lookStatsArray ( $pl [ 'tr' ]);
$d2 = $this -> lookStatsArray ( $pl [ 'date2' ]);
$x = 1 ;
$notr = 0 ;
if ( $t == 2 && $pl [ 'id' ] == 181 ) {
2022-08-25 11:23:36 +00:00
$imun = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `eff_users` WHERE `uid` = "' . $this -> u -> info [ 'enemy' ] . '" and `v2`="191" and `delete`="0" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( $imun ) {
$notr ++ ;
}
}
if ( isset ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'nousepriem' ]) && $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'nousepriem' ] > 0 && $pl [ 'nosh' ] == 0 ) {
2022-08-25 11:23:36 +00:00
if ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'noshock_voda' ] > 0 && substr (
$pl [ 'img' ], 0 ,
10
) == 'wis_water_' ) {
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD>
} else {
$notr ++ ;
}
}
if ( $pl [ 'id' ] == $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'notuse_last_pr' ]) {
$notr ++ ;
}
while ( $x <= 7 ) {
if ( isset ( $btl -> uids [ $this -> u -> info [ 'id' ]], $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]])) {
if ( $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] < $pl [ 'tt' . $x ] && $x != 7 && $pl [ 'tt' . $x ] > 0 ) {
$notr ++ ;
} elseif ( $x == 7 ) {
if ( $pl [ 'tt' . $x ] > 0 && $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'tactic' . $x ] <= 0 ) {
$notr ++ ;
}
}
}
$x ++ ;
}
if ( $pl [ 'xuse' ] > 0 ) {
2022-08-25 11:23:36 +00:00
$xu = $this -> u -> testAction (
'`vars` = "use_priem_' . $btl -> info [ 'id' ] . '_' . $this -> u -> info [ 'id' ] . '" AND `vals` = "' . $pl [ 'id' ] . '" LIMIT ' . $pl [ 'xuse' ] . '' ,
2
);
2022-08-11 10:38:38 +00:00
if ( $xu [ 0 ] >= $pl [ 'xuse' ]) {
$notr ++ ;
}
}
$x = 0 ;
$t = $this -> u -> items [ 'tr' ];
while ( $x < count ( $t )) {
$n = $t [ $x ];
if ( isset ( $tr [ 'tr_' . $n ])) {
if ( $n == 'lvl' ) {
if ( $tr [ 'tr_' . $n ] > $this -> u -> info [ 'level' ]) {
$notr ++ ;
}
} elseif ( $tr [ 'tr_' . $n ] > $this -> u -> stats [ $n ]) {
$notr ++ ;
}
}
$x ++ ;
}
if ( $pl [ 'activ' ] == 0 || ( $this -> testActiv ( $pl [ 'activ' ]) == 0 && $pl [ 'activ' ] > 1 )) {
$notr ++ ;
}
//if($t==2)
//{
if ( isset ( $d2 [ 'onlyOne' ]) || isset ( $d2 [ 'onlyOneX1' ])) {
if ( isset ( $d2 [ 'onlyOneX1' ])) {
if ( $d2 [ 'onlyOneX1' ] == 1 ) {
2022-08-25 11:23:36 +00:00
$pru = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `eff_users` WHERE `uid` = "' . $this -> u -> info [ 'id' ] . '" AND `v2` = "' . $pl [ 'id' ] . '" AND `delete` = "0" AND `x` >= 1 LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $pru [ 'id' ]) && $pru [ 'x' ] >= $d2 [ 'onlyOne' ]) {
$notr ++ ;
}
}
} elseif ( isset ( $d2 [ 'onlyOne' ])) {
if ( $d2 [ 'onlyOne' ] > 1 ) {
2022-08-25 11:23:36 +00:00
$pru = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `eff_users` WHERE `uid` = "' . $this -> u -> info [ 'id' ] . '" AND `v2` = "' . $pl [ 'id' ] . '" AND `delete` = "0" AND `x` > 1 LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $pru [ 'id' ]) && $pru [ 'x' ] >= $d2 [ 'onlyOne' ]) {
$notr ++ ;
}
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD>
if ( isset ( $tr [ 'tr_nousepriem' ])) {
$x = 0 ;
$nouse = explode ( ',' , $tr [ 'tr_nousepriem' ]);
while ( $x < count ( $nouse )) {
$nousev = explode ( '.' , $nouse [ $x ]);
if ( isset ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'prsu' ][ $nousev [ 0 ]]) && $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'prsu' ][ $nousev [ 0 ]] >= 0 ) {
if ( $nousev [ 2 ] > 1 ) {
if ( $nousev [ 2 ] <= $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'prsu' ][ $nousev [ 0 ]]) {
$notr ++ ;
}
} else {
$notr ++ ;
}
}
$x ++ ;
}
unset ( $nouse , $nousev );
}
if ( isset ( $tr [ 'tr_type_itm1' ])) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$itmt = mysql_fetch_assoc (
mysql_query (
'SELECT `u`.`id` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `u`.`item_id` WHERE `m`.`type` = "' . $tr [ 'tr_type_itm1' ] . '" AND `u`.`inOdet` > 0 AND `u`.`uid` = "' . $this -> u -> info [ 'id' ] . '" AND `u`.`delete` = "0" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( ! isset ( $itmt [ 'id' ])) {
$notr ++ ;
}
}
if ( isset ( $tr [ 'tr_mpNow' ])) {
if ( isset ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]])) {
2022-08-25 11:23:36 +00:00
if ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] < round (
$tr [ 'tr_mpNow' ] / 100 * ( 100 - $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'min_use_mp' ])
)) {
2022-08-11 10:38:38 +00:00
$notr ++ ;
}
} elseif ( $this -> u -> info [ 'mpNow' ] < $tr [ 'tr_mpNow' ]) {
$notr ++ ;
}
}
if ( isset ( $btl -> uids [ $this -> u -> info [ 'id' ]], $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]])) {
if ( $pl [ 'trUser' ] == 1 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
if ( isset ( $btl -> ga [ $this -> u -> info [ 'id' ]][ $this -> u -> info [ 'enemy' ]])) {
$notr ++ ;
}
} elseif ( $pl [ 'trUser' ] == 2 && $o > 0 ) {
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> -<2D> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
2022-08-25 11:23:36 +00:00
$ga = mysql_fetch_assoc (
mysql_query (
'SELECT * FROM `battle_act` WHERE `battle` = "' . $btl -> info [ 'id' ] . '" AND `uid1` = "' . $this -> u -> info [ 'id' ] . '" AND `uid2` = "' . $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'enemy' ] . '" LIMIT 1'
)
);
2022-08-11 10:38:38 +00:00
if ( isset ( $ga [ 'id' ])) {
$notr ++ ;
}
}
}
return $notr ;
}
public function priemInfo ( $pl , $t , $id = false )
{
global $u , $c , $code , $btl ;
$pz = explode ( '|' , $this -> u -> info [ 'priems_z' ]);
$tr = $this -> lookStatsArray ( $pl [ 'tr' ]);
$trs = '' ;
$x = 0 ;
$notr = 0 ;
$t = $this -> u -> items [ 'tr' ];
while ( $x < count ( $t )) {
$n = $t [ $x ];
if ( isset ( $tr [ 'tr_' . $n ])) {
if ( $tr [ 'tr_' . $n ] > $this -> u -> stats [ $n ]) {
$trs .= '<font color=red>' ;
$notr ++ ;
}
$trs .= '<br><3E> ' ;
$trs .= $this -> u -> is [ $n ] . ': ' . $tr [ 'tr_' . $n ];
if ( $tr [ 'tr_' . $n ] > $this -> u -> stats [ $n ]) {
$trs .= '</font>' ;
}
}
$x ++ ;
}
$lvar = '' ;
$j = 1 ;
$nm = [ 1 => 'hit' , 2 => 'krit' , 3 => 'counter' , 4 => 'block' , 5 => 'parry' , 6 => 'hp' , 7 => 'spirit' ];
while ( $j <= 6 ) {
if ( $pl [ 'tt' . $j ] > 0 ) {
2022-08-25 11:23:36 +00:00
$lvar .= '<img src=https://img.new-combats.com/i/micro/' . $nm [ $j ] . '.gif width=8 height=8 /> ' . round (
$pl [ 'tt' . $j ],
2
) . ' ' ;
2022-08-11 10:38:38 +00:00
}
$j ++ ;
}
if ( $pl [ 'tt7' ] > 0 ) {
if ( $lvar != '' ) {
$lvar .= '<br>' ;
}
$lvar .= '<27> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> : ' . round ( $pl [ 'tt' . $j ], 2 ) . '<br>' ;
}
$lvar .= '<br>' ;
if ( $pl [ 'zad' ] > 0 ) {
$lvar .= '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : ' . $pl [ 'zad' ];
if ( $pz [ $id ] > 0 ) {
$lvar .= ' (<28> <> <EFBFBD> ' . $pz [ $id ] . ')' ;
}
$lvar .= '<br>' ;
}
if ( isset ( $tr [ 'tr_mpNow' ]) && $tr [ 'tr_mpNow' ] > 0 ) {
$tr [ 'tr_mpNow' ] -= round ( $tr [ 'tr_mpNow' ] / 100 * $this -> u -> stats [ 'min_use_mp' ]);
if ( $this -> u -> info [ 'mpNow' ] < $tr [ 'tr_mpNow' ] || ( isset ( $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]]) && $btl -> stats [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'mpNow' ] < $tr [ 'tr_mpNow' ])) {
$lvar .= '<font color=red><3E> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> : ' . $tr [ 'tr_mpNow' ] . '</font><br>' ;
} else {
$lvar .= '<27> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> : ' . $tr [ 'tr_mpNow' ] . '<br>' ;
}
}
if ( $pl [ 'tr_hod' ] > 0 ) {
$lvar .= '<27> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <br>' ;
}
if ( $trs != '' ) {
$lvar .= '<b><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :</b>' . $trs . '<br><br>' ;
} else {
$lvar .= '<br>' ;
}
2022-08-25 11:23:36 +00:00
$pl [ 'info' ] = preg_replace_callback ( " !(#)(.*?)(#)!is " , [ $this , 'getDynamicInfo' ], $pl [ 'info' ]);
2022-08-11 10:38:38 +00:00
$lvar .= $pl [ 'info' ];
2022-08-25 11:23:36 +00:00
return [ 0 => $lvar , 1 => $pz ];
2022-08-11 10:38:38 +00:00
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> / <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> / <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> .<2E> .
public function testPower ( $s1 , $s2 , $y , $t , $t2 )
{
global $u , $btl ;
$r = 0 ;
if ( $t2 == 2 ) {
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$pm = [ 0 => 0 , 1 => 0 , 2 => 0 , 3 => 0 ];
if ( $t < 5 ) {
$pm [ 0 ] = $s1 [ 'm11' ];
$pm [ 1 ] = $s2 [ 'zm' ];
$pm [ 2 ] = $s2 [ 'antm11' ];
}
if ( isset ( $btl -> info [ 'id' ])) {
$pm [ 3 ] = $btl -> zmgo ( $s2 [ 'zm' . $t ]);
$pm [ 3 ] = round ( $pm [ 3 ]);
}
//<2F> <> <EFBFBD> <EFBFBD> = b*(1+m/100)*2^((p*10-z)/k)
$fx_vl = [
250 ,
250 ,
250 ,
250 ,
250 ,
250 ,
250 ,
250 ,
250 ,
350 ,
400 ,
450 ,
500 ,
550 ,
600 ,
650 ,
700 ,
750 ,
800 ,
850 ,
900 ,
950 ,
];
$fx = [
'b' => $y , //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
'm' => round ( $s1 [ 'pm' . $t ] * 1 - $s2 [ 'antpm' . $t ]), //<2F> <> <EFBFBD> <EFBFBD>
'z' => round ( $s2 [ 'zm' . $t ]), //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> .
'p' => round (( $s1 [ 'pzm' ] + $s1 [ 'pzm' . $t ])), //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
'k' => $fx_vl [( 0 + $s1 [ 'lvl' ])] //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ; k=250 <20> <> <EFBFBD> 8<> <38> , k=300 <20> <> <EFBFBD> 9<> <39> <20> <20> .<2E> . +20% <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
];
if (( $fx [ 'z' ] + 250 ) - $fx [ 'p' ] * 10 < 0 ) { //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> 250 <20> <> .
$fx [ 'p' ] = ( $fx [ 'z' ] + 250 ) / 10 ;
}
$fx [ 'p' ] = 0 ;
//
$p = $fx [ 'b' ] * ( 1 + $fx [ 'm' ] / 100 ) * pow ( 2 , (( $fx [ 'z' ] - $fx [ 'p' ] * 10 ) / $fx [ 'k' ]));
//$p += $p/100*10;
$p -= $p / 100 * $pm [ 3 ];
//$p += floor($s1['s5']*0.25);
if ( $p < round ( $y * 0.1 )) {
$p = round ( $y * 0.1 );
} elseif ( $p > round ( $y * 10 )) {
$p = $y * 10 ;
}
if ( isset ( $s2 [ 'zm' . $t . 'proc' ])) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
{
$p = floor ( $p / 100 * ( 100 - $s2 [ 'zm' . $t . 'proc' ]));
if ( $p < 0 ) {
$p = 0 ;
}
}
if ( isset ( $s2 [ 'zmproc' ])) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
{
if ( $s2 [ 'zmproc' ] >= 75 ) {
$p = floor ( $p / 100 * ( 100 - 75 ));
} else {
$p = floor ( $p / 100 * ( 100 - $s2 [ 'zmproc' ]));
if ( $p < 0 ) {
$p = 0 ;
}
}
}
$r = $p ;
}
return round ( $r / 100 * 70 );
}
private function pyes ( $id )
{
global $u ;
$p = explode ( '|' , $this -> u -> info [ 'priems' ]);
$r = false ;
$i = 0 ;
while ( $i < count ( $p )) {
if ( $p [ $i ] == $id ) {
$r = true ;
}
$i ++ ;
}
return $r ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - 1, <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - 2
public function seePriems ( $mt )
{
global $u , $c , $code ;
$t = $this -> u -> items [ 'tr' ];
$nm = [ 1 => 'hit' , 2 => 'krit' , 3 => 'counter' , 4 => 'block' , 5 => 'parry' , 6 => 'hp' , 7 => 'spirit' ];
$lvlfe = $this -> u -> info [ 'level' ];
if ( isset ( $_GET [ 'all' ])) {
$lvlfe = 21 ;
}
2022-08-25 11:23:36 +00:00
$sp = mysql_query (
'SELECT * FROM `priems` WHERE `level`<="' . $lvlfe . '" AND `activ` > "0" ORDER BY `img`,`level` ASC'
);
2022-08-11 10:38:38 +00:00
$this -> u -> info [ 'lvl' ] = $this -> u -> info [ 'level' ];
$lvar = '' ;
while ( $pl = mysql_fetch_assoc ( $sp )) {
$noaki = 0 ;
if ( $pl [ 'activ' ] == 1 || $this -> testActiv ( $pl [ 'activ' ]) == 1 ) {
$lvar = $this -> priemInfo ( $pl , 1 );
$lvar = $lvar [ 0 ];
$cl = '' ;
$a1 = '<a href="javascript:void(0)" onclick="location.href=\'main.php?skills=1&all=' . (( int ) $_GET [ 'all' ]) . '&rz=4&use_priem=' . $pl [ 'id' ] . '&rnd=' . $code . '&p_raz=\' + p_raz;">' ;
$a2 = '</a>' ;
if ( $this -> pyes ( $pl [ 'id' ]) || $this -> testpriem ( $pl , 1 ) > 0 ) {
if (( isset ( $_GET [ 'all' ]) && $_GET [ 'all' ] == 1 ) || $this -> pyes ( $pl [ 'id' ])) {
$cl = 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;' ;
$a1 = '' ;
$a2 = '' ;
} else {
$noaki = 1 ;
}
}
if ( $noaki == 0 ) {
$mtnu = explode ( '_' , $pl [ 'img' ]);
if ( $mtnu [ 0 ] != 'wis' ) {
$mtnu = $mtnu [ 0 ];
} else {
$mtnu = 'wis_' . $mtnu [ 1 ];
}
echo $a1 . '<img class="pwq' . $mtnu . ' pwqall" onMouseOver="top.hi(this,\'(#' . $pl [ 'id' ] . ') <b>' . $pl [ 'name' ] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:2px; ' . $cl . ' margin-left:1px;" src="https://img.new-combats.com/i/eff/' . $pl [ 'img' ] . '.gif" width="40" height="25" />' . $a2 ;
}
}
}
}
private function zeromax ( $num , $max )
{
if ( $num <= 0 ) {
return 0 ;
}
if ( $num > $max ) {
$num = $max ;
}
return $num ;
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : 34 , 67 , 68 , 69.
2022-08-25 11:23:36 +00:00
* @ param $level
* @ param Battle $btl
* @ param $id
2022-08-11 10:38:38 +00:00
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> pruse () <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* @ return void
*/
2022-08-25 11:23:36 +00:00
private function fireFlash ( $level , Battle $btl , $id )
2022-08-11 10:38:38 +00:00
{
if ( empty ( $this -> ue ) || $this -> ue [ 'hpNow' ] <= 0 || $btl -> users [ $this -> ue [ 'id' ]][ 'team' ] == $this -> u -> info [ 'team' ]) {
return ;
}
$baseDamage = [ 8 => 40 , 9 => 45 , 10 => 50 , 11 => 60 ];
$pvr = [];
2022-08-25 11:23:36 +00:00
$magicTargetTier = Db :: getValue (
'select x from eff_users where uid = ? and v2 = 26 and `delete` = 0' ,
[ $this -> ue [ 'id' ]]
);
2022-08-11 10:38:38 +00:00
$leveledDamage = $baseDamage [ $level ] + 40 / 100 * ( 5 * $magicTargetTier );
2022-08-25 11:23:36 +00:00
list ( $damage , $isCrit , $isMiss ) = $this -> magicAttack (
$btl , $this -> u -> info [ 'id' ], $this -> ue [ 'id' ], $leveledDamage , self :: FIRE , 1
);
2022-08-11 10:38:38 +00:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$damage = $btl -> testYronPriem (
$this -> u -> info [ 'id' ], $this -> ue [ 'id' ], 21 , $damage , 5 ,
true
);
2022-08-11 10:38:38 +00:00
$btl -> priemYronSave ( $this -> u -> info [ 'id' ], $this -> ue [ 'id' ], $damage , 0 );
$this -> ue [ 'hpNow' ] -= $damage ;
$this -> ue [ 'hpNow' ] = $this -> zeromax ( $this -> ue [ 'hpNow' ], $this -> ue [ 'hpAll' ]);
$btl -> stats [ $btl -> uids [ $this -> ue [ 'id' ]]][ 'hpNow' ] = $this -> ue [ 'hpNow' ];
Db :: sql ( 'update stats set hpNow = ? where id = ?' , [ $this -> ue [ 'hpNow' ], $this -> ue [ 'id' ]]);
if ( $isMiss ) {
$color = $this -> logColor [ 'miss' ];
} elseif ( $isCrit ) {
$color = $this -> logColor [ 'crit' ];
} else {
$color = $this -> logColor [ self :: FIRE ];
}
$btl -> priemAddLog (
$id ,
1 ,
2 ,
$this -> u -> info [ 'id' ],
$this -> ue [ 'id' ],
" <span style^^^^'color: $color '><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> [ $level ]</span> " ,
2022-08-25 11:23:36 +00:00
'{tm1}' . sprintf (
" %s <b style='color: %s'>%s</b> [%d/%d] " ,
2022-08-11 10:38:38 +00:00
$btl -> addlt ( 1 , 19 , $this -> u -> info [ 'sex' ], null ),
$pvr [ 'color' ],
$isMiss ? '--' : - $damage ,
( int ) $this -> ue [ 'hpNow' ],
( int ) $this -> ue [ 'hpAll' ]
),
2022-08-25 11:23:36 +00:00
$btl -> hodID + 1
);
2022-08-11 10:38:38 +00:00
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> { <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> }
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : 25 , 26 , 27 , 28.
2022-08-25 11:23:36 +00:00
* @ param $element
* @ param $pl
* @ param $id
* @ param Battle $btl
2022-08-11 10:38:38 +00:00
* @ return bool ( bool ) <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
*/
2022-08-25 11:23:36 +00:00
private function magicTarget ( $element , $pl , $id , Battle $btl )
2022-08-11 10:38:38 +00:00
{
$data = [
self :: WATER => [ 25 , '<27> <> <EFBFBD> <EFBFBD> ' ],
self :: FIRE => [ 26 , '<27> <> <EFBFBD> <EFBFBD> ' ],
self :: AIR => [ 27 , '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
self :: EARTH => [ 28 , '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ' ],
];
if ( ! in_array ( $element , array_keys ( $data )) || empty ( $this -> ue )) {
return false ;
}
2022-08-25 11:23:36 +00:00
$stacked = Db :: getRow (
'select id, x from eff_users where uid = ? and v2 = ? and `delete` = 0' ,
[ $this -> ue [ 'id' ], $data [ $element ][ 0 ]]
);
2022-08-11 10:38:38 +00:00
$stackNumStr = $stacked [ 'x' ] > 0 ? $stacked [ 'x' ] + 1 : '' ;
if ( $stacked [ 'x' ] >= 5 ) {
echo " <b style='color: { $this -> logColor [ 'crit' ] } ;'><3E> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> </b> " ;
return true ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$this -> addEffPr ( $pl , $id );
2022-08-25 11:23:36 +00:00
$dataStr = $stacked [ 'x' ] > 0 ? Db :: getValue (
'select data from eff_users where id = ?' ,
[ $stacked [ 'id' ]]
) : $pl [ 'date3' ];
2022-08-11 10:38:38 +00:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
$effect = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> { $data [ $element ][ 1 ] } : " . current ( $this -> lookStatsArray ( $dataStr ));
$color = $this -> logColor [ $element ];
$name = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> { $data [ $element ][ 1 ] } " ;
if ( $stacked [ 'x' ] > 0 ) {
$name .= " x( $stackNumStr ) " ;
}
$btl -> priemAddLog (
$id ,
1 ,
2 ,
$this -> u -> info [ 'id' ],
$this -> ue [ 'id' ],
" <span style^^^^'color: $color '> $name </span> " ,
2022-08-25 11:23:36 +00:00
'{tm1}' . sprintf (
" %s. <i>(%s)</i> " ,
$btl -> addlt ( 1 , 19 , $this -> u -> info [ 'sex' ], null ), $effect
),
$btl -> hodID
);
2022-08-11 10:38:38 +00:00
return false ;
}
2022-08-25 11:23:36 +00:00
public function devouringFlame ( $id , $uid , $j_id , Battle $btl )
2022-08-11 10:38:38 +00:00
{
$a = 0 ;
$u1 = 0 ;
$u2 = 0 ;
//
$uid1 = $btl -> atacks [ $id ][ 'uid1' ];
$uid2 = $btl -> atacks [ $id ][ 'uid2' ];
if ( $uid == $uid1 ) {
$a = 1 ;
$u1 = $uid1 ;
$u2 = $uid2 ;
} elseif ( $uid == $uid2 ) {
$a = 2 ;
$u1 = $uid2 ;
$u2 = $uid1 ;
}
if ( $a <= 0 ) {
return ;
} //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
$prv [ 'j_priem' ] = $btl -> stats [ $btl -> uids [ $u1 ]][ 'u_priem' ][ $j_id ][ 0 ];
$pvr [ 'data' ] = $this -> lookStatsArray ( $btl -> stats [ $btl -> uids [ $u1 ]][ 'effects' ][ $prv [ 'j_priem' ]][ 'data' ]);
$pName = $btl -> stats [ $btl -> uids [ $u1 ]][ 'effects' ][ $prv [ 'j_priem' ]][ 'name' ];
$pvr [ 'hp' ] = $pvr [ 'data' ][ 'atgm' ];
$pvr [ 'hpNow' ] = floor ( $btl -> stats [ $btl -> uids [ $u1 ]][ 'hpNow' ]);
$pvr [ 'hpAll' ] = $btl -> stats [ $btl -> uids [ $u1 ]][ 'hpAll' ];
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2022-08-25 11:23:36 +00:00
$pvr [ 'hp' ] = $btl -> testYronPriem (
$btl -> stats [ $btl -> uids [ $u1 ]][ 'effects' ][ $prv [ 'j_priem' ]][ 'user_use' ], $u1 , 12 , $pvr [ 'hp' ], 7 , true , false , 1
);
2022-08-11 10:38:38 +00:00
$pvr [ 'hpNow' ] -= $pvr [ 'hp' ];
$btl -> priemYronSave ( $btl -> stats [ $btl -> uids [ $u1 ]][ 'effects' ][ $prv [ 'j_priem' ]][ 'user_use' ], $u1 , $pvr [ 'hp' ], 0 );
2022-08-25 11:23:36 +00:00
$pvr [ 'hpNow' ] = $this -> zeromax ( $pvr [ 'hpNow' ], $pvr [ 'hpAll' ]);
2022-08-11 10:38:38 +00:00
$btl -> stats [ $btl -> uids [ $u1 ]][ 'hpNow' ] = $pvr [ 'hpNow' ];
2022-08-25 11:23:36 +00:00
Db :: sql ( 'update stats set hpNow = ? where id = ?' , [ $btl -> stats [ $btl -> uids [ $u1 ]][ 'hpNow' ], $u1 ]);
2022-08-11 10:38:38 +00:00
$color = $this -> logColor [ self :: FIRE ];
$prv [ 'text' ] = '{u2} <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> "{pr}" ' ;
if ( $pvr [ 'promah_type' ] == 2 ) {
$pvr [ 'hp' ] = '-' ;
}
2022-08-25 11:23:36 +00:00
$prv [ 'text' ] .= sprintf (
" <b style='color: %s'>%s</b> [%d/%d] " , $color , - $pvr [ 'hp' ], $pvr [ 'hpNow' ], $pvr [ 'hpAll' ]
);
2022-08-11 10:38:38 +00:00
2022-08-25 11:23:36 +00:00
$btl -> priemAddLog (
$id , 1 , 2 , $u2 , $u1 , " <span style='color: $color '> $pName </span> " , $prv [ 'text' ], ( $btl -> hodID )
);
2022-08-11 10:38:38 +00:00
}
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> damage <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ( atgm = ) .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : 33 , 56 , 57 , 58 , 59 , 60.
2022-08-25 11:23:36 +00:00
* @ param $id
* @ param array $pl <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> priems .
* @ param Battle $btl
2022-08-11 10:38:38 +00:00
* @ return void
*/
2022-08-25 11:23:36 +00:00
private function devouringFlameInit ( $id , array $pl , Battle $btl )
2022-08-11 10:38:38 +00:00
{
2022-08-25 11:23:36 +00:00
$baseDamage = [ 6 => 53 , 7 => 63 , 8 => 77 , 9 => 91 , 10 => 110 , 11 => 133 ,];
list ( $damage , , $isMiss ) = $this -> magicAttack (
$btl , $this -> u -> info [ 'id' ], $this -> ue [ 'id' ], $baseDamage [ $pl [ 'level' ]], self :: FIRE
);
2022-08-11 10:38:38 +00:00
if ( $isMiss || $damage <= 0 ) {
return ;
}
$color = $this -> logColor [ self :: FIRE ];
$logText = '{tm1}' . $btl -> addlt ( 1 , 19 , $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'sex' ], null ) . '.' ;
2022-08-25 11:23:36 +00:00
$btl -> priemAddLog (
$id , 1 , 2 , $this -> u -> info [ 'id' ], $this -> ue [ 'id' ], " <span style^^^^'color: $color '> { $pl [ 'name' ] } </span> " ,
$logText , $btl -> hodID + 1
);
2022-08-11 10:38:38 +00:00
$data = $this -> impStats ([ 'atgm' => max ( floor ( $damage / 5 ), 1 )]);
2022-08-25 11:23:36 +00:00
$this -> addPriem (
$this -> ue [ 'id' ], $pl [ 'id' ], $data , 0 , 77 , 5 , $this -> u -> info [ 'id' ], 1 , '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , 0 , 0 , 1
);
2022-08-11 10:38:38 +00:00
}
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
/** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> . <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ( <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ) 20 <EFBFBD> <EFBFBD> 3 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : 267 , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 268. <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
* @ param $id
* @ param array $pl
* @ param Battle $btl
* @ return void
*/
private function crystalize ( $id , array $pl , Battle $btl )
{
$q = ' select stats as data from stats where id = ?
union all select stats as data from test_bot where id = ?
union all select data from eff_users where `delete` = 0 and uid = ?
union all select data from items_users where inOdet > 0 and `delete` = 0 and uid = ? ' ;
$datas = Db :: getColumn ( $q , array_fill ( 0 , 3 , $this -> ue [ 'id' ]));
$stats = array_fill_keys ([ 's1' , 's2' , 's3' , 's5' , 's6' ], 0 );
foreach ( $datas as $data ) {
$data = $this -> lookStatsArray ( $data );
print_r ( $data );
foreach ( array_keys ( $stats ) as $stat ) {
if ( isset ( $data [ $stat ])) {
$stats [ $stat ] += $data [ $stat ];
}
if ( isset ( $data [ 'add_' . $stat ])) {
$stats [ $stat ] += $data [ 'add_' . $stat ];
}
}
}
$maxValue = max ( $stats );
$maxKeys = [];
foreach ( $stats as $k => $v ) {
if ( $maxValue == $v ) {
$maxKeys [] = $k ;
}
}
shuffle ( $maxKeys );
$datastr = " |add_ { $maxKeys [ 0 ] } =-20 " ;
$debuffstr = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " . mb_strtolower ( $this -> u -> is [ $maxKeys [ 0 ]]);
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
$color = $this -> logColor [ self :: WATER ];
$logText = '{tm1}' . $btl -> addlt ( 1 , 19 , $btl -> users [ $btl -> uids [ $this -> u -> info [ 'id' ]]][ 'sex' ], null ) . '.' ;
$btl -> priemAddLog (
$id , 1 , 2 , $this -> u -> info [ 'id' ], $this -> ue [ 'id' ],
" <span style^^^^'color: $color '> { $pl [ 'name' ] } :</span> $debuffstr " , $logText , $btl -> hodID + 1
);
$this -> addPriem ( $this -> ue [ 'id' ], 268 , $datastr , 2 , 77 , 3 , $this -> u -> info [ 'id' ], 3 , 0 , 0 , 1 );
}
}