2022-08-25 11:23:36 +00:00
< ? php
class Dialog
{
2023-04-01 11:47:32 +00:00
private array $info ;
public string $dText = '' ;
public string $aText = '' ;
public string $youInfo = '' ;
public string $botInfo = '' ;
public string $title = '' ;
public int $p = 1 ;
public int $pg = 1 ;
2022-08-25 11:23:36 +00:00
2023-04-01 11:47:32 +00:00
public function trnObj ( $x , $j ) : array
2022-08-25 11:23:36 +00:00
{
$i = floor ( $x / $j );
return [ 0 => $i , 1 => $x - ( $i * $j )];
}
public function objLevel ( $t , $l )
{
$i = 1 ;
$r = 0 ;
while ( $i <= $l ) {
if ( isset ( $t [ $i ])) {
$r = $t [ $i ];
}
$i ++ ;
}
return $r ;
}
public function start ( $id )
{
global $u , $q , $c , $d , $code ;
$this -> info = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_dialog` WHERE `id` = "' . mysql_real_escape_string (( int ) $id ) . '" LIMIT 1' ));
if ( isset ( $this -> info [ 'id' ])) {
$pg = 1 ;
$go = 1 ;
$txt = '' ;
2023-01-10 16:29:32 +00:00
//Переход по страницам
2022-08-25 11:23:36 +00:00
if ( isset ( $_GET [ 'act' ])) {
$ta = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_dlg` WHERE `type` = "0" AND `id` = "' . mysql_real_escape_string (( int ) $_GET [ 'act' ]) . '" AND `id_dg` = "' . $this -> info [ 'id' ] . '" LIMIT 1' ));
if ( isset ( $ta [ 'id' ])) {
$ta [ 'action' ] = $this -> ltr ( $ta [ 'action' ]);
$act = explode ( '|' , $ta [ 'action' ]);
$go1 = 1 ;
$needRep = [];
if ( $ta [ 'tr' ] != '' ) {
$i = 0 ;
$x = explode ( '|' , $ta [ 'tr' ]);
while ( $i < count ( $x )) {
2023-01-10 16:29:32 +00:00
//Требования
2022-08-25 11:23:36 +00:00
$k = explode ( '=' , $x [ $i ]);
if ( $k [ 0 ] == 'data' ) {
$date = explode ( '-' , $k [ 1 ]);
$dd1 = $date [ 0 ];
$mm1 = $date [ 1 ];
$dd2 = $date [ 2 ];
$mm2 = $date [ 3 ];
$date1 = strtotime ( $dd1 . '-' . $mm1 . '-' . date ( 'Y' ));
$date2 = strtotime ( $dd2 . '-' . $mm2 . '-' . date ( 'Y' ));
if ( $date1 > time () || $date2 < time ()) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'diact' ) {
2023-01-10 16:29:32 +00:00
//Действия
2022-08-25 11:23:36 +00:00
//user_id # all # all # lukaqst1 # -1
if ( $this -> quest_act ( $k [ 1 ]) == false ) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'quest_end' ) {
2023-01-10 16:29:32 +00:00
//Квест можно выполнять несколько раз в текущей пещере
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && $qlst [ 'vals' ] != 'win' && $qlst [ 'vals' ] != 'end' && $qlst [ 'vals' ] != 'bad' ) {
$go1 = 0 ;
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Что-то не так, Вы уже взяли данное задание...</font>' ;
2022-08-25 11:23:36 +00:00
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'quest_only_one' ) {
2023-01-10 16:29:32 +00:00
//Квест можно выполнять только один раз
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && ( $qlst [ 'vals' ] == 'win' || $qlst [ 'vals' ] == 'bad' )) {
$go1 = 0 ;
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Что-то не так, Вы уже выполняли данное задание...</font>' ;
2022-08-25 11:23:36 +00:00
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'quest_now' ) {
2023-01-10 16:29:32 +00:00
//Квест должен быть взят
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && $qlst [ 'vals' ] != 'win' && $qlst [ 'vals' ] != 'end' && $qlst [ 'vals' ] != 'bad' ) {
} else {
$go1 = 0 ;
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Что-то не так, требуется взять задание...</font>' ;
2022-08-25 11:23:36 +00:00
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'tr_itm' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT COUNT(`id`) FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $k [ 1 ] . '" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( $qlst [ 0 ] < $k [ 2 ]) {
$go1 = 0 ;
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $k [ 1 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Требуется предмет "' . $itmqs [ 'name' ] . '" (x' . $k [ 2 ] . ').</font>' ;
2022-08-25 11:23:36 +00:00
}
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'tr_itmodet' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( ! isset ( $qlst [ 'id' ])) {
$go1 = 0 ;
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $k [ 1 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Требуется предмет "' . $itmqs [ 'name' ] . '".</font>' ;
2022-08-25 11:23:36 +00:00
}
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'tr_noitmodet' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( isset ( $qlst [ 'id' ])) {
$go1 = 0 ;
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $k [ 1 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>У вас уже есть требуемый предмет "' . $itmqs [ 'name' ] . '".</font>' ;
2022-08-25 11:23:36 +00:00
}
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'tr_noitm' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( isset ( $qlst [ 'id' ])) {
$go1 = 0 ;
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $k [ 1 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>У вас уже есть требуемый предмет "' . $itmqs [ 'name' ] . '".</font>' ;
2022-08-25 11:23:36 +00:00
}
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'del_itm' ) {
2023-01-10 16:29:32 +00:00
//Квест удаляет предмет
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $k [ 1 ] . '" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( isset ( $qlst [ 'id' ])) {
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $k [ 1 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
if ( mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `id` = "' . $qlst [ 'id' ] . '" LIMIT 1' )) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Вы отдали "' . $itmqs [ 'name' ] . '"</font>' ;
2022-08-25 11:23:36 +00:00
}
}
$pg = $ta [ 'page' ];
}
} elseif ( $k [ 0 ] == 'needRep' ) {
2023-01-10 16:29:32 +00:00
// разговор требует репутации в пещере.
2022-08-25 11:23:36 +00:00
$temp = explode ( ',' , $k [ 1 ]);
$needRep = [ 'city' => $temp [ 0 ], 'rep' => ( int ) $temp [ 1 ]];
2023-01-10 16:29:32 +00:00
if ( isset ( $needRep )) { # Проверяем репутацию.
2022-08-25 11:23:36 +00:00
if ( $u -> rep [ 'rep' . $needRep [ 'city' ]] < $needRep [ 'rep' ]) {
$swapActStatus = 0 ;
$go1 = 0 ;
2023-01-10 16:29:32 +00:00
$txt = '<font color=red>Я тебя раньше здесь не видел, уходи прочь негодник!</font>' ;
2022-08-25 11:23:36 +00:00
$pg = $ta [ 'page' ];
}
}
}
$i ++ ;
}
}
if ( isset ( $act [ 1 ]) && $go1 == 1 ) {
$act1 = explode ( '=' , $act [ 1 ]);
$act0 = explode ( '=' , $act [ 0 ]);
if ( $act0 [ 0 ] == 'fileqst' ) {
if ( file_exists ( '_incl_data/class/quest/' . htmlspecialchars ( $act0 [ 1 ]) . '.php' )) {
require_once ( '_incl_data/class/quest/' . htmlspecialchars ( $act0 [ 1 ]) . '.php' );
} else {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Квест не найден в списках NPS...</b></font>' ;
2022-08-25 11:23:36 +00:00
}
$pg = $act [ 1 ];
} elseif ( $act [ 0 ] == 'dialog_act_update' ) {
$act33 = $this -> dialog_act_update ( $act [ 2 ]);
if ( $act33 [ 0 ] == false ) {
if ( $act33 [ 1 ] == '' ) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Что-то пошло не так...</b></font>' ;
2022-08-25 11:23:36 +00:00
} else {
$txt .= '<br><b><font color=red>' . $act33 [ 1 ] . '</font></b>' ;
}
} else {
$txt .= '<br><b><font color=red>' . $act33 [ 1 ] . '</font></b>' ;
}
$pg = $act [ 1 ];
} elseif ( $act [ 0 ] == 'quest_act' ) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Вы получили новое задание.</b></font>' ;
2022-08-25 11:23:36 +00:00
mysql_query ( ' INSERT INTO `dialog_act` (
`uid` , `city` , `time` , `var` , `val` , `btl_bot` , `itms` , `now` , `max` , `info`
) VALUES (
" ' . $u->info ['id'] . ' " , " ' . $u->info ['city'] . ' " , " ' . time() . ' " , " ' . mysql_real_escape_string( $act1[0] ) . ' " , " ' . mysql_real_escape_string( $act1[1] ) . ' "
, " ' . mysql_real_escape_string( $act1[3] ) . ' " , " ' . mysql_real_escape_string( $act1[4] ) . ' " , " ' . mysql_real_escape_string( $act1[5] ) . ' " , " ' . mysql_real_escape_string( $act1[6] ) . ' " , " ' . mysql_real_escape_string( $act1[7] ) . ' "
) ' );
$pg = $act1 [ 2 ];
if ( $act1 [ 8 ] != 0 ) {
2023-01-10 16:29:32 +00:00
//Выдаем предмет для квеста
2022-08-25 11:23:36 +00:00
$itmb = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $act1 [ 8 ] . '" LIMIT 1' ));
if ( isset ( $itmb [ 'id' ])) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $act1 [ 8 ], $u -> info [ 'id' ], '|nodelete=1' );
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Вы получили предмет "' . $itmb [ 'name' ] . '"</font></b>' ;
2022-08-25 11:23:36 +00:00
}
}
} elseif ( $act [ 0 ] == 'buyitm' ) {
$itmb = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $act1 [ 0 ] . '" LIMIT 1' ));
if ( isset ( $itmb [ 'id' ])) {
if ( $u -> info [ 'money' ] < $act1 [ 1 ]) {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Вам не хватает денег для покупки "' . $itmb [ 'name' ] . '", требуется ' . $act1 [ 1 ] . ' кр.' ;
2022-08-25 11:23:36 +00:00
} else {
$act1dt = '' ;
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Вы успешно приобрели "' . $itmb [ 'name' ] . '"' ;
2022-08-25 11:23:36 +00:00
if ( $act1 [ 1 ] > 0 ) {
2023-01-10 16:29:32 +00:00
$txt .= ' за ' . $act1 [ 1 ] . ' кр.' ;
2022-08-25 11:23:36 +00:00
$u -> info [ 'money' ] -= $act1 [ 1 ];
mysql_query ( 'UPDATE `users` SET `money` = "' . $u -> info [ 'money' ] . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
}
if ( $act1 [ 2 ] > 0 ) {
2023-01-10 16:29:32 +00:00
$txt .= ' за ' . $act1 [ 2 ] . ' екр.' ;
2022-08-25 11:23:36 +00:00
}
if ( $act1 [ 3 ] > 0 ) {
2023-01-10 16:29:32 +00:00
$txt .= ' на срок ' . $u -> timeOut ( $act1 [ 3 ]) . '' ;
2022-08-25 11:23:36 +00:00
$act1dt .= '|srok=' . $act1 [ 3 ] . '' ;
}
$txt .= '</font></b>' ;
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $itmb [ 'id' ], $u -> info [ 'id' ], $act1dt );
2022-08-25 11:23:36 +00:00
$pg = $act1 [ 4 ];
}
} else {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Неудалось приобрести предмет...</font></b>' ;
2022-08-25 11:23:36 +00:00
$pg = 1 ;
}
} elseif ( $act1 [ 0 ] == 'quest' ) {
$pg = $act1 [ 1 ];
$act2 = explode ( '=' , $act [ 1 ]);
if ( $act2 [ 0 ] > 0 && $q -> testGood ( $act2 [ 0 ]) == 1 ) {
2023-01-10 16:29:32 +00:00
//выдаем квест
2022-08-25 11:23:36 +00:00
if ( $act2 [ 1 ] != '0' ) {
2023-01-10 16:29:32 +00:00
//Выдача предмета
2022-08-25 11:23:36 +00:00
$ic1 = 0 ;
$act21 = explode ( ',' , $act2 [ 1 ]);
while ( $ic1 < count ( $act21 )) {
$act3 = explode ( '-' , $act21 [ $ic1 ]);
$itmqs = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $act3 [ 0 ] . '" LIMIT 1' ));
if ( isset ( $itmqs [ 'id' ])) {
if ( $act3 [ 2 ] > 1 ) {
2023-01-10 16:29:32 +00:00
//несколько
$txt .= '<br><b><font color=red>Вы получили предмет "' . $itmqs [ 'name' ] . '" (x' . $act3 [ 2 ] . ' шт.).</font></b>' ;
2022-08-25 11:23:36 +00:00
} else {
2023-01-10 16:29:32 +00:00
//один
$txt .= '<br><b><font color=red>Вы получили квестовый предмет "' . $itmqs [ 'name' ] . '".</font></b>' ;
2022-08-25 11:23:36 +00:00
}
$ic2 = 1 ;
while ( $ic2 <= $act3 [ 2 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $itmqs [ 'id' ], $u -> info [ 'id' ], '|quest_item=1' , [ 'del' => $act3 [ 3 ]]);
2022-08-25 11:23:36 +00:00
$ic2 ++ ;
}
}
$ic1 ++ ;
}
}
$q -> startq ( $act2 [ 0 ]);
$txt .= '<br><b><font color=red>' . $u -> error . '.</font></b>' ;
$u -> error = '' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= '<br><b><font color=red>Н е удалось получить задание, не соответствуют условия получения...</font></b>' ;
2022-08-25 11:23:36 +00:00
}
} elseif ( $act [ 0 ] == 'go' && $go1 == 1 ) {
$pg = $act [ 1 ];
} elseif ( $act [ 0 ] == 'atackbot' && $go1 == 1 ) {
2023-01-10 16:29:32 +00:00
//Нападение на монстра
2022-08-25 11:23:36 +00:00
if ( round (( int ) $act [ 1 ]) > 0 ) {
$btl_id = 0 ;
//$expB = -77.77;
$expB = 0 ;
$btl = [ 'players' => '' , 'timeout' => 180 , 'type' => 0 , 'invis' => 0 , 'noinc' => 0 , 'travmChance' => 0 , 'typeBattle' => 0 , 'addExp' => $expB , 'money' => 0 ];
$ins = mysql_query ( ' INSERT INTO `battle` ( `dungeon` , `dn_id` , `x` , `y` , `city` , `time_start` , `players` , `timeout` , `type` , `invis` , `noinc` , `travmChance` , `typeBattle` , `addExp` , `money` ) VALUES (
" ' . $d->info ['id2'] . ' " ,
" ' . $d->info ['id'] . ' " ,
" ' . $u->info ['x'] . ' " ,
" ' . $u->info ['y'] . ' " ,
" ' . $u->info ['city'] . ' " ,
" ' . time() . ' " ,
" ' . $btl['players'] . ' " ,
" ' . $btl['timeout'] . ' " ,
" ' . $btl['type'] . ' " ,
" ' . $btl['invis'] . ' " ,
" ' . $btl['noinc'] . ' " ,
" ' . $btl['travmChance'] . ' " ,
" ' . $btl['typeBattle'] . ' " ,
" ' . $btl['addExp'] . ' " ,
" ' . $btl['money'] . ' " ) ' );
$btl_id = mysql_insert_id ();
if ( $btl_id > 0 ) {
2023-01-10 16:29:32 +00:00
//Добавляем ботов
2022-08-25 11:23:36 +00:00
$k = $u -> addNewbot ( round (( int ) $act [ 1 ]), null , null , []);
mysql_query ( 'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $k [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `stats` SET `x`="' . $u -> info [ 'x' ] . '",`y`="' . $u -> info [ 'y' ] . '",`team` = "2" WHERE `id` = "' . $k [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
}
header ( 'location: main.php' );
} else {
2023-01-10 16:29:32 +00:00
echo '<b><font title="' . $act [ 1 ] . '" color=red>Поединок почему-то не начался...</font></b>' ;
2022-08-25 11:23:36 +00:00
}
die ();
} elseif ( $act [ 0 ] == 'goroom' && $go1 == 1 ) {
$u -> info [ 'room' ] = $act [ 1 ];
mysql_query ( 'UPDATE `users` SET `room` = "' . $u -> info [ 'room' ] . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
header ( 'location: main.php' );
die ();
} elseif ( $act [ 0 ] == 'transfer2' && $go1 == 1 ) {
2023-01-10 16:29:32 +00:00
//Обменник тыквоголового
2022-08-25 11:23:36 +00:00
$txt = '' ;
2023-01-10 16:29:32 +00:00
$xtik = 0 ; //Требуется тыкв
2022-08-25 11:23:36 +00:00
if ( $act [ 1 ] == 1 && true == false ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 1...' ;
2022-08-25 11:23:36 +00:00
$xtik = 10 ;
$itik = 4465 ;
} elseif ( $act [ 1 ] == 2 ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 2...' ;
2022-08-25 11:23:36 +00:00
$xtik = 15 ;
$itik = 2143 ;
} elseif ( $act [ 1 ] == 3 ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 3...' ;
2022-08-25 11:23:36 +00:00
$xtik = 15 ;
$itik = 2144 ;
} elseif ( $act [ 1 ] == 4 && true == false ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 4...' ;
2022-08-25 11:23:36 +00:00
$xtik = 6 ;
2023-01-10 16:29:32 +00:00
//арт воина
2022-08-25 11:23:36 +00:00
$itik = - 1 ;
} elseif ( $act [ 1 ] == 5 && true == false ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 5...' ;
2022-08-25 11:23:36 +00:00
$xtik = 6 ;
2023-01-10 16:29:32 +00:00
//арт мага
2022-08-25 11:23:36 +00:00
$itik = - 2 ;
} elseif ( $act [ 1 ] == 6 ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 6...' ;
2022-08-25 11:23:36 +00:00
$xtik = 50 ;
2023-01-10 16:29:32 +00:00
//значок 1
2022-08-25 11:23:36 +00:00
$itik = - 3 ;
} elseif ( $act [ 1 ] == 7 ) {
2023-01-10 16:29:32 +00:00
$txt .= 'Обмен 7...' ;
2022-08-25 11:23:36 +00:00
$xtik = 70 ;
2023-01-10 16:29:32 +00:00
//значок 2
2022-08-25 11:23:36 +00:00
$itik = - 4 ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Тыквоголовый не меняет этот хлам...' ;
2022-08-25 11:23:36 +00:00
}
2023-01-10 16:29:32 +00:00
$txt = 'Обменник начнет свою работу 3 ноября' ;
2022-08-25 11:23:36 +00:00
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 100' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
$t = $this -> trnObj ( $itms [ 4504 ], $xtik );
if ( $t [ 0 ] > 0 ) {
2023-01-10 16:29:32 +00:00
// $t[0] - сколько предметов награды даем, $cn[$i]['add'][0] - item_id предмета награды
//удаляем ингридиенты
2022-08-25 11:23:36 +00:00
$gdtik = 1 ;
if ( $gdtik == 1 ) {
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `inGroup` ASC LIMIT ' . $xtik . '' );
//echo 'UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.$t[0].'';
if ( $upd ) {
if ( $itik > 0 ) {
2023-01-10 16:29:32 +00:00
//Выдаем предметы
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $itik , $u -> info [ 'id' ], '|nosale=1|srok=' . ( 7 * 86400 ) . '' , null , 1 );
2022-08-25 11:23:36 +00:00
$itm_nm = mysql_fetch_array ( mysql_query ( 'SELECT `name` FROM `items_main` WHERE `id` = "' . $itik . '" LIMIT 1' ));
2023-01-10 16:29:32 +00:00
$txt = 'Вы получили предмет "' . $itm_nm [ 'name' ] . '"' ;
2022-08-25 11:23:36 +00:00
} else {
2023-01-10 16:29:32 +00:00
//Что-то уникальное
2022-08-25 11:23:36 +00:00
if ( $itik == - 1 ) {
2023-01-10 16:29:32 +00:00
//Артефакт воин
2022-08-25 11:23:36 +00:00
$arts_1 = [];
$arts_lvl = $u -> info [ 'level' ];
if ( $arts_lvl < 4 ) {
$arts_lvl = 4 ;
} elseif ( $arts_lvl > 10 ) {
$arts_lvl = 10 ;
}
$sp1 = mysql_query ( 'SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl=' . $arts_lvl . '%" AND `data` NOT LIKE "%|tr_s5=%" AND `data` NOT LIKE "%|add_s6=%" AND `data` NOT LIKE "%|tr_s6=%"' );
while ( $pl1 = mysql_fetch_array ( $sp1 )) {
$arts_1 [] = $pl1 [ 'items_id' ];
}
$arts_1 = $arts_1 [ rand ( 0 , count ( $arts_1 ) - 1 )];
if ( $arts_1 > 0 ) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $arts_1 , $u -> info [ 'id' ], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . ( 86400 / 2 ) . '' , null , 100 );
2022-08-25 11:23:36 +00:00
}
$itm_nm = mysql_fetch_array ( mysql_query ( 'SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1' ));
2023-01-10 16:29:32 +00:00
$txt = 'Вы получили артефакт для воина "' . $itm_nm [ 'name' ] . '" на срок 12 часов.' ;
2022-08-25 11:23:36 +00:00
} elseif ( $itik == - 2 ) {
2023-01-10 16:29:32 +00:00
//Артефакт мага
2022-08-25 11:23:36 +00:00
$arts_1 = [];
$arts_lvl = $u -> info [ 'level' ];
if ( $arts_lvl < 4 ) {
$arts_lvl = 4 ;
} elseif ( $arts_lvl > 10 ) {
$arts_lvl = 10 ;
}
$sp1 = mysql_query ( 'SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl=' . $arts_lvl . '%" AND ( `data` LIKE "%|tr_s6=%" OR `data` LIKE "%|add_s6=%")' );
while ( $pl1 = mysql_fetch_array ( $sp1 )) {
$arts_1 [] = $pl1 [ 'items_id' ];
}
$arts_1 = $arts_1 [ rand ( 0 , count ( $arts_1 ) - 1 )];
if ( $arts_1 > 0 ) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $arts_1 , $u -> info [ 'id' ], '|sroknext=1|nosale=1|sleep_moroz=1|srok=' . ( 86400 / 2 ) . '' , null , 100 );
2022-08-25 11:23:36 +00:00
}
$itm_nm = mysql_fetch_array ( mysql_query ( 'SELECT `name` FROM `items_main` WHERE `id` = "' . $arts_1 . '" LIMIT 1' ));
2023-01-10 16:29:32 +00:00
$txt = 'Вы получили артефакт для мага "' . $itm_nm [ 'name' ] . '" на срок 12 часов.' ;
2022-08-25 11:23:36 +00:00
} elseif ( $itik == - 3 ) {
2023-01-10 16:29:32 +00:00
//Значок +1
2022-08-25 11:23:36 +00:00
mysql_query ( 'DELETE FROM `users_ico` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`img` = "helloween_2014m1.gif" OR `img` = "helloween_2014m2.gif")' );
mysql_query ( ' INSERT INTO `users_ico` ( `uid` , `time` , `text` , `img` , `endTime` , `bonus` , `type` , `x` ) VALUES (
" ' . $u->info ['id'] . ' " ,
" ' . time() . ' " ,
2023-01-10 16:29:32 +00:00
" <b>Хэллоуин</b>`' . date('Y') . '<br>Обыкновенный собиратель тыкв! " ,
2022-08-25 11:23:36 +00:00
" helloween_2014m1.gif " ,
" ' . (time() + 86400 * 365) . ' " ,
" add_m10=15|add_m11=15 " ,
" 1 " ,
" 1 "
) ' );
2023-01-10 16:29:32 +00:00
$txt = 'Вы получили значок "Хэллоуин`' . date ( 'Y' ) . ' Обыкновенный"' ;
2022-08-25 11:23:36 +00:00
} elseif ( $itik == - 4 ) {
2023-01-10 16:29:32 +00:00
//Значок +5
2022-08-25 11:23:36 +00:00
mysql_query ( 'DELETE FROM `users_ico` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`img` = "helloween_2014m1.gif" OR `img` = "helloween_2014m2.gif")' );
mysql_query ( ' INSERT INTO `users_ico` ( `uid` , `time` , `text` , `img` , `endTime` , `bonus` , `type` , `x` ) VALUES (
" ' . $u->info ['id'] . ' " ,
" ' . time() . ' " ,
2023-01-10 16:29:32 +00:00
" <b>Хэллоуин</b>`' . date('Y') . '<br>Лучший собиратель тыкв! " ,
2022-08-25 11:23:36 +00:00
" helloween_2014m2.gif " ,
" ' . (time() + 86400 * 365) . ' " ,
" add_m10=15|add_m11=15 " ,
" 1 " ,
" 1 "
) ' );
2023-01-10 16:29:32 +00:00
$txt = 'Вы получили значок "Хэллоуин`' . date ( 'Y' ) . ' Лучший"' ;
2022-08-25 11:23:36 +00:00
}
}
}
} else {
2023-01-10 16:29:32 +00:00
$txt = 'Неудалось совершить обмен...' ;
2022-08-25 11:23:36 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$txt = 'Недостаточно тыкв для обмена...' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
$pg = 3 ;
} elseif ( $act [ 0 ] == 'transfer1' && $go1 == 1 ) {
2023-01-10 16:29:32 +00:00
//Меняем гайки и прочий мусор из канализации на жетоны
//ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ!
2022-08-25 11:23:36 +00:00
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "1002" OR `item_id` = "1003" OR `item_id` = "1004" OR `item_id` = "1005" OR (`item_id` >= "1009" AND`item_id` <= "1014")) AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 3 , //кол-во классификаций
1 => [ //гайка
1 => [ 'n' => 'Гайка' , 0 => 1002 , 1 => 3 , 7 => 9 , 8 => 15 ], //болт
2 => [ 'n' => 'Болт' , 0 => 1003 , 1 => 1 , 7 => 3 , 8 => 5 ], //вентиль
3 => [ 'n' => 'Вентиль' , 0 => 1005 , 1 => ( 1 / 3 ), 7 => 1 , 8 => 2 ], 'add' => [ 0 => 1006 , 1 => 'Жетон' ] //предмет вознаграждения, бронзовый жетон
], //бронза
2 => [ //гайка
1 => [ 'n' => 'Чистая гайка' , 0 => 1009 , 1 => 3 , 7 => 9 , 8 => 15 ], //болт
2 => [ 'n' => 'Длинный Болт' , 0 => 1010 , 1 => 1 , 7 => 3 , 8 => 5 ], //вентиль
3 => [ 'n' => 'Чистый вентиль' , 0 => 1011 , 1 => ( 1 / 3 ), 7 => 1 , 8 => 2 ], 'add' => [ 0 => 1007 , 1 => 'Серебряный жетон' ] //предмет вознаграждения, бронзовый жетон
], //с е р е б р о
3 => [ //гайка
1 => [ 'n' => 'Гайка с Резьбой' , 0 => 1012 , 1 => 3 , 7 => 9 , 8 => 15 ], //болт
2 => [ 'n' => 'Нужный болт' , 0 => 1013 , 1 => 1 , 7 => 3 , 8 => 5 ], //вентиль
3 => [ 'n' => 'Рабочий вентиль' , 0 => 1014 , 1 => ( 1 / 3 ), 7 => 1 , 8 => 2 ], 'add' => [ 0 => 1008 , 1 => 'Золотой жетон' ] //предмет вознаграждения, бронзовый жетон
] //золото
2022-08-25 11:23:36 +00:00
];
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j < count ( $cn [ $i ][ $j ])) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ]));
if ( $t [ 0 ] > 0 ) {
2023-01-10 16:29:32 +00:00
// $t[0] - сколько предметов награды даем, $cn[$i]['add'][0] - item_id предмета награды
//удаляем ингридиенты
2022-08-25 11:23:36 +00:00
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
}
$j ++ ;
}
$i ++ ;
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transfer3' && $go1 == 1 ) {
2023-01-10 16:29:32 +00:00
//ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ!
//С е р е б р о на золото, 3 к 1
2022-08-25 11:23:36 +00:00
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "1007" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 1 , //кол-во классификаций
1 => [ //гайка
1 => [ 'n' => 'Серебряный жетон' , 0 => 1007 , 1 => 3 , 7 => 3 , 8 => 3 ], 'add' => [ 0 => 1008 , 1 => 'Золотой жетон' ] //предмет вознаграждения, бронзовый жетон
2022-08-25 11:23:36 +00:00
]];
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j < count ( $cn [ $i ][ $j ])) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ]));
if ( $t [ 0 ] > 0 ) {
2023-01-10 16:29:32 +00:00
// $t[0] - сколько предметов награды даем, $cn[$i]['add'][0] - item_id предмета награды
//удаляем ингридиенты
2022-08-25 11:23:36 +00:00
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
}
$j ++ ;
}
$i ++ ;
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transfer4' && $go1 == 1 ) {
2023-01-10 16:29:32 +00:00
//ИХ больше у тебя нету... Неси еще, мне нужно больше ИХ!
//Засоры к золоту, 20 к 1
2022-08-25 11:23:36 +00:00
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "4728" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 1 , //кол-во классификаций
1 => [ //гайка
1 => [ 'n' => 'Засоры' , 0 => 4728 , 1 => 20 , 7 => 20 , 8 => 20 ], 'add' => [ 0 => 1008 , 1 => 'Золотой жетон' ] //предмет вознаграждения, бронзовый жетон
2022-08-25 11:23:36 +00:00
]];
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j < count ( $cn [ $i ][ $j ])) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ]));
if ( $t [ 0 ] > 0 ) {
2023-01-10 16:29:32 +00:00
// $t[0] - сколько предметов награды даем, $cn[$i]['add'][0] - item_id предмета награды
//удаляем ингридиенты
2022-08-25 11:23:36 +00:00
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
}
$j ++ ;
}
$i ++ ;
}
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$txt = 'Необходимо минимум 20 засоров для обмена.' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transferSpells30' && $go1 == 1 ) {
//2553 2554
$keypr1 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = 0 AND `item_id` = "2553" LIMIT 1' ));
$keypr2 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = 0 AND `item_id` = "2554" LIMIT 1' ));
$txt = '' ;
if ( isset ( $keypr1 [ 'id' ], $keypr2 [ 'id' ])) {
mysql_query ( 'DELETE FROM `items_users` WHERE `id` = "' . $keypr1 [ 'id' ] . '" OR `id` = "' . $keypr2 [ 'id' ] . '" LIMIT 2' );
$data = '|frompisher=' . $d -> info [ 'id2' ];
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( 2555 , $u -> info [ 'id' ], $data );
2023-01-10 16:29:32 +00:00
$txt = 'Вы успешно получили "Пирамидальный ключ"' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$txt = 'Необходимо принести два разных осколка...' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transferSpells31' && $go1 == 1 ) {
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "2560" OR `item_id` = "2564" OR `item_id` = "2568" OR `item_id` = "2572" OR `item_id` = "2576") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
$keypr = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1' ));
if ( ! isset ( $keypr [ 'id' ])) {
$itms = [];
2023-01-10 16:29:32 +00:00
$txt = 'Необходим "Пирамидальный ключ", у вас е г о нет...' ;
2022-08-25 11:23:36 +00:00
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 5 , //кол-во классификаций
1 => [ 1 => [ 'n' => 'Зачаровать Украшение [0]' , 0 => 2560 , 8 => 3 , 'add' => [ 2561 , 'Зачаровать Украшение [1]' ]], 2 => [ 'n' => 'Зачаровать Оружие [0]' , 0 => 2564 , 8 => 3 , 'add' => [ 2565 , 'Зачаровать Оружие [1]' ]], 3 => [ 'n' => 'Зачаровать Броню [0]' , 0 => 2568 , 8 => 3 , 'add' => [ 2569 , 'Зачаровать Броню [1]' ]], 4 => [ 'n' => 'Зачаровать Перчатки [0]' , 0 => 2572 , 8 => 3 , 'add' => [ 2573 , 'Зачаровать Перчатки [1]' ]], 5 => [ 'n' => 'Зачаровать Шлем [0]' , 0 => 2576 , 8 => 3 , 'add' => [ 2577 , 'Зачаровать Шлем [1]' ]]]];
2022-08-25 11:23:36 +00:00
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j <= $cn [ 0 ]) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], 8 ));
if ( $t [ 0 ] > 0 ) {
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ $j ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
mysql_query ( 'DELETE FROM `items_users` WHERE `id` = "' . $keypr [ 'id' ] . '" LIMIT 1' );
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ $j ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
$i = $cn [ 0 ];
$j = count ( $cn [ $i ][ $j ]);
}
$j ++ ;
}
$i ++ ;
}
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$txt = 'У вас не хватило необходимых предметов...' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transferSpells32' && $go1 == 1 ) {
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "2561" OR `item_id` = "2565" OR `item_id` = "2569" OR `item_id` = "2573" OR `item_id` = "2577") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
$keypr = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1' ));
if ( ! isset ( $keypr [ 'id' ])) {
$itms = [];
2023-01-10 16:29:32 +00:00
$txt = 'Необходим "Пирамидальный ключ", у вас е г о нет...' ;
2022-08-25 11:23:36 +00:00
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 5 , //кол-во классификаций
1 => [ 1 => [ 'n' => 'Зачаровать Украшение [1]' , 0 => 2561 , 8 => 3 , 'add' => [ 2562 , 'Зачаровать Украшение [2]' ]], 2 => [ 'n' => 'Зачаровать Оружие [1]' , 0 => 2565 , 8 => 3 , 'add' => [ 2566 , 'Зачаровать Оружие [2]' ]], 3 => [ 'n' => 'Зачаровать Броню [1]' , 0 => 2569 , 8 => 3 , 'add' => [ 2570 , 'Зачаровать Броню [2]' ]], 4 => [ 'n' => 'Зачаровать Перчатки [0]' , 0 => 2573 , 8 => 3 , 'add' => [ 2574 , 'Зачаровать Перчатки [2]' ]], 5 => [ 'n' => 'Зачаровать Шлем [1]' , 0 => 2577 , 8 => 3 , 'add' => [ 2578 , 'Зачаровать Шлем [2]' ]]]];
2022-08-25 11:23:36 +00:00
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j <= $cn [ 0 ]) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], 8 ));
if ( $t [ 0 ] > 0 ) {
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ $j ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
mysql_query ( 'DELETE FROM `items_users` WHERE `id` = "' . $keypr [ 'id' ] . '" LIMIT 1' );
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ $j ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
$i = $cn [ 0 ];
$j = count ( $cn [ $i ][ $j ]);
}
$j ++ ;
}
$i ++ ;
}
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$txt = 'У вас не хватило необходимых предметов...' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
} elseif ( $act [ 0 ] == 'transferSpells33' && $go1 == 1 ) {
$pg = $act [ 1 ];
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "2562" OR `item_id` = "2566" OR `item_id` = "2570" OR `item_id` = "2574" OR `item_id` = "2578") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
$keypr = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1' ));
if ( ! isset ( $keypr [ 'id' ])) {
$itms = [];
2023-01-10 16:29:32 +00:00
$txt = 'Необходим "Пирамидальный ключ", у вас е г о нет...' ;
2022-08-25 11:23:36 +00:00
}
2023-01-10 16:29:32 +00:00
//Предметы
$cn = [ 0 => 5 , //кол-во классификаций
1 => [ 1 => [ 'n' => 'Зачаровать Украшение [0]' , 0 => 2562 , 8 => 3 , 'add' => [ 2563 , 'Зачаровать Украшение [3]' ]], 2 => [ 'n' => 'Зачаровать Оружие [0]' , 0 => 2566 , 8 => 3 , 'add' => [ 2567 , 'Зачаровать Оружие [3]' ]], 3 => [ 'n' => 'Зачаровать Броню [0]' , 0 => 2570 , 8 => 3 , 'add' => [ 2571 , 'Зачаровать Броню [3]' ]], 4 => [ 'n' => 'Зачаровать Перчатки [0]' , 0 => 2574 , 8 => 3 , 'add' => [ 2575 , 'Зачаровать Перчатки [3]' ]], 5 => [ 'n' => 'Зачаровать Шлем [0]' , 0 => 2578 , 8 => 3 , 'add' => [ 2579 , 'Зачаровать Шлем [3]' ]]]];
2022-08-25 11:23:36 +00:00
$i = 1 ;
while ( $i <= $cn [ 0 ]) {
$j = 1 ;
while ( $j <= $cn [ 0 ]) {
$t = $cn [ $i ][ $j ];
$t = $this -> trnObj ( $itms [ $cn [ $i ][ $j ][ 0 ]], $this -> objLevel ( $cn [ $i ][ $j ], 8 ));
if ( $t [ 0 ] > 0 ) {
$upd = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $cn [ $i ][ $j ][ 0 ] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT ' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . '' );
if ( $upd ) {
$data = '|frompisher=' . $d -> info [ 'id2' ];
$e = 1 ;
while ( $e <= $t [ 0 ]) {
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $cn [ $i ][ $j ][ 'add' ][ 0 ], $u -> info [ 'id' ], $data );
2022-08-25 11:23:36 +00:00
$e ++ ;
}
$txt .= $cn [ $i ][ $j ][ 'n' ] . ' x' . ( $t [ 0 ] * $this -> objLevel ( $cn [ $i ][ $j ], $u -> info [ 'level' ])) . ' = ' . $cn [ $i ][ $j ][ 'add' ][ 1 ] . ' x' . $t [ 0 ] . '<br>' ;
mysql_query ( 'DELETE FROM `items_users` WHERE `id` = "' . $keypr [ 'id' ] . '" LIMIT 1' );
} else {
2023-01-10 16:29:32 +00:00
$txt .= 'Н е удалось обменять предмет "' . $cn [ $i ][ $j ][ 'n' ] . '", что-то не так ...<br>' ;
2022-08-25 11:23:36 +00:00
}
$i = $cn [ 0 ];
$j = count ( $cn [ $i ][ $j ]);
}
$j ++ ;
}
$i ++ ;
}
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$txt = 'У вас не хватило необходимых предметов...' ;
2022-08-25 11:23:36 +00:00
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
2023-01-10 16:29:32 +00:00
} elseif ( $act [ 0 ] == 'GoHrumpShop' && $go1 == 1 ) { //отправляемся в магазин Рульфа Хрумпта (пещеры мглы)
2022-08-25 11:23:36 +00:00
mysql_query ( 'UPDATE `stats` SET `x` = "6",`y` = "73" WHERE `id` = "' . $u -> info [ 'id' ] . '" AND `dnow` = "' . $u -> info [ 'dnow' ] . '" LIMIT 1' );
header ( 'location: main.php' );
die ();
} elseif ( $act [ 0 ] == 'swapItem' && $go1 == 1 ) {
$txt = '' ;
$swapItem = $act [ 1 ];
$swapError = $act [ 2 ];
$swapTrue = $act [ 3 ];
2023-01-10 16:29:32 +00:00
# Обмениваем предметы у Забытого (Мастерская Забытых)
if ( ! isset ( $swapActStatus )) $swapActStatus = 1 ; # В с е окей, проблем нет!
$swapAct = []; # Собираем данные о б обмене.
2022-08-25 11:23:36 +00:00
$temp = explode ( " \\ " , $swapItem );
foreach ( $temp as $t ) {
$t = explode ( '=' , $t );
2023-01-10 16:29:32 +00:00
if ( $t [ 0 ] == 'tr' ) { // Нужны для обмена
2022-08-25 11:23:36 +00:00
$temp2 = explode ( ',' , $t [ 1 ]);
$tr_items = [];
foreach ( $temp2 as $t2 ) {
$temp3 = explode ( 'x' , $t2 );
2023-01-10 16:29:32 +00:00
if ( ! isset ( $temp3 [ 1 ])) $temp3 [ 1 ] = 1 ; // Если количество не задано, задаем 1е д.
if ( isset ( $temp3 [ 2 ]) && $temp3 [ 2 ] == 'del' ) $temp3 [ 2 ] = true ; else $temp3 [ 2 ] = false ; // Удаляем даже при неудачной попытке совершить обмен!
2022-08-25 11:23:36 +00:00
$tr_items [] = [ 'item_id' => $temp3 [ 0 ], 'colvo' => ( int ) $temp3 [ 1 ], 'delete' => $temp3 [ 2 ]];
}
$swapAct [ 'tr' ] = $tr_items ;
2023-01-10 16:29:32 +00:00
} elseif ( $t [ 0 ] == 'needQuest' ) { // Если нужен какой-то квест для приобретения.
2022-08-25 11:23:36 +00:00
2023-01-10 16:29:32 +00:00
} elseif ( $t [ 0 ] == 'needRep' ) { // Если нужна репутация в подземельи
2022-08-25 11:23:36 +00:00
$temp2 = explode ( ',' , $t [ 1 ]);
$need_rep = [];
$need_rep [] = [ 'city' => $temp2 [ 0 ], 'rep' => ( int ) $temp2 [ 1 ]];
$swapAct [ 'need_rep' ] = $need_rep ;
2023-01-10 16:29:32 +00:00
} elseif ( $t [ 0 ] == 'add' ) { // Какие предметы даем.
2022-08-25 11:23:36 +00:00
$temp2 = explode ( ',' , $t [ 1 ]);
$add_items = [];
foreach ( $temp2 as $t2 ) {
$temp3 = explode ( 'x' , $t2 );
2023-01-10 16:29:32 +00:00
if ( ! isset ( $temp3 [ 1 ])) $temp3 [ 1 ] = 1 ; // Если количество не задано, задаем 1е д.
2022-08-25 11:23:36 +00:00
$add_items [] = [ 'item_id' => $temp3 [ 0 ], 'colvo' => ( int ) $temp3 [ 1 ]];
}
$swapAct [ 'add' ] = $add_items ;
2023-01-10 16:29:32 +00:00
} elseif ( $t [ 0 ] == 'uses' ) { // Если нужна репутация в подземельи
2022-08-25 11:23:36 +00:00
$swapAct [ 'uses' ] = $t [ 1 ];
}
2023-01-10 16:29:32 +00:00
} // Цикл обработки данных разговора.
2022-08-25 11:23:36 +00:00
unset ( $temp , $temp2 , $temp3 , $t2 , $tr_items , $add_items );
if ( $swapActStatus == 0 ) {
2023-01-10 16:29:32 +00:00
$txt = 'Я тебя раньше здесь не видел, уходи прочь негодник!' ;
2022-08-25 11:23:36 +00:00
$pg = $swapError ;
2023-01-10 16:29:32 +00:00
} elseif ( isset ( $swapAct [ 'need_rep' ])) { # Проверяем репутацию.
foreach ( $swapAct [ 'need_rep' ] as $rep ) { # Если несколько репутаций
2022-08-25 11:23:36 +00:00
if ( $u -> rep [ 'rep' . $rep [ 'city' ]] < $rep [ 'rep' ]) {
$swapActStatus = 0 ;
2023-01-10 16:29:32 +00:00
$txt = 'Я тебя раньше здесь не видел, уходи прочь негодник!' ;
2022-08-25 11:23:36 +00:00
$pg = $swapError ;
}
}
}
2023-01-10 16:29:32 +00:00
if ( isset ( $swapAct [ 'uses' ])) { # Проверяем количество раз использований.
2022-08-25 11:23:36 +00:00
#$swapAct['uses'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `room` = "'.$u->info['room'].'" AND `vals` = "masteryUses'.$u->info['dnow'].'" ORDER BY `id` DESC LIMIT '.$swapAct['uses'] .''));
if ( isset ( $swapAct [ 'uses' ][ 'id' ])) {
$swapActStatus = 0 ;
2023-01-10 16:29:32 +00:00
$txt = 'Кто-то уже побывал здесь и испортил кузницу, ничего не получится...' ;
2022-08-25 11:23:36 +00:00
$pg = 0 ;
}
}
2023-01-10 16:29:32 +00:00
if ( isset ( $swapAct [ 'tr' ]) and $swapActStatus == 1 ) { # Проверяем необходимые предметы.
foreach ( $swapAct [ 'tr' ] as $item ) { # Если несколько предметов.
2022-08-25 11:23:36 +00:00
$item_info = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $item [ 'item_id' ] . '" LIMIT 1' ));
if ( isset ( $item_info [ 'id' ])) {
$query = mysql_query ( 'SELECT * FROM `items_users` WHERE `item_id` = "' . $item [ 'item_id' ] . '" AND `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = "0" AND `inShop` = "0" AND `inOdet` = "0" LIMIT ' . $item [ 'colvo' ] . '' );
$j = 0 ;
while ( $t = mysql_fetch_array ( $query )) {
$j ++ ;
}
if ( $j < $item [ 'colvo' ]) {
2023-01-10 16:29:32 +00:00
$txt .= 'У вас недостаточно предметов "' . $item_info [ 'name' ] . '"! (' . $item [ 'item_id' ] . ')<br/>' ;
2022-08-25 11:23:36 +00:00
$swapActStatus = 3 ;
$pg = $swapError ;
} elseif ( $swapActStatus != 3 ) {
$swapActStatus = 2 ;
}
}
}
}
2023-01-10 16:29:32 +00:00
if ( isset ( $swapAct [ 'tr' ]) and $swapActStatus == 3 ) { # Забираем предметы del==true.
$mess = 'Израсходованы ресурсы: ' ;
2022-08-25 11:23:36 +00:00
$qsw = 0 ;
2023-01-10 16:29:32 +00:00
foreach ( $swapAct [ 'tr' ] as $item ) { # Если несколько предметов.
2022-08-25 11:23:36 +00:00
if ( $item [ 'delete' ] == true ) {
$query = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `item_id` = "' . $item [ 'item_id' ] . '" AND `uid` = "' . $u -> info [ 'id' ] . '" AND `delete` = "0" AND `inShop` = "0" AND `inOdet` = "0" ORDER BY inGroup DESC LIMIT ' . $item [ 'colvo' ] . '' );
if ( $query ) {
$item_info = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $item [ 'item_id' ] . '" LIMIT 1' ));
if ( $qsw > 0 ) $mess .= ', ' ;
$mess .= '"' . $item_info [ 'name' ] . '"' ;
2023-01-10 16:29:32 +00:00
if ( $item [ 'colvo' ] > 1 ) $mess .= '(' . $item [ 'item_id' ] . 'шт)' ;
2022-08-25 11:23:36 +00:00
$qsw ++ ;
}
}
}
$mess .= '.<br/>' ;
if ( $qsw > 0 ) $txt .= $mess ;
2023-01-10 16:29:32 +00:00
} elseif ( isset ( $swapAct [ 'tr' ]) and $swapActStatus == 2 ) { # Забираем предметы все.
$mess = 'Израсходованы ресурсы: ' ;
2022-08-25 11:23:36 +00:00
$qsw = 0 ;
foreach ( $swapAct [ 'tr' ] as $item ) {
$query = mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `item_id` = "' . $item [ 'item_id' ] . '" AND `uid` = "' . $u -> info [ 'id' ] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY inGroup DESC LIMIT ' . $item [ 'colvo' ] . '' );
if ( $query ) {
$item_info = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $item [ 'item_id' ] . '" LIMIT 1' ));
if ( $qsw > 0 ) $mess .= ', ' ;
$mess .= '"' . $item_info [ 'name' ] . '"' ;
2023-01-10 16:29:32 +00:00
if ( $item [ 'colvo' ] > 1 ) $mess .= '(' . $item [ 'item_id' ] . 'шт)' ;
2022-08-25 11:23:36 +00:00
$qsw ++ ;
}
}
$mess .= '.<br/>' ;
if ( $qsw > 0 ) $txt .= $mess ;
}
2023-01-10 16:29:32 +00:00
if ( isset ( $swapAct [ 'add' ]) and $swapActStatus == 2 ) { # Выдаем предметы.
2022-08-25 11:23:36 +00:00
foreach ( $swapAct [ 'add' ] as $item ) {
$qsw = 0 ;
while ( $qsw < $item [ 'colvo' ]) {
2023-01-10 16:29:32 +00:00
$txt .= '<br/>Вы получили предмет' ;
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $item [ 'item_id' ], $u -> info [ 'id' ]);
2022-08-25 11:23:36 +00:00
$qsw ++ ;
}
}
mysql_query ( 'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $u -> info [ 'id' ] . '","' . time () . '","' . $u -> info [ 'city' ] . '","' . $u -> info [ 'room' ] . '", "","' . mysql_real_escape_string ( $_SERVER [ 'HTTP_X_REAL_IP' ]) . '", "masteryUses' . $u -> info [ 'dnow' ] . '")' );
$pg = $swapTrue ;
}
if ( $txt != '' ) {
$txt = '<br><font color="red">' . $txt . '</font>' ;
}
}
}
}
}
if ( $this -> info [ 'tr_room' ] != 0 && $this -> info [ 'tr_room' ] != $u -> info [ 'room' ]) {
$go = 0 ;
}
if ( $this -> info [ 'tr_dn' ] != 0 ) {
2023-01-10 16:29:32 +00:00
//требует пещеру
2022-08-25 11:23:36 +00:00
global $d ;
if ( $this -> info [ 'tr_dn' ] != $d -> info [ 'id2' ]) {
$go = 0 ;
} elseif ( $this -> info [ 'x' ] != 0 || $this -> info [ 'y' ] != 0 ) {
if ( $d -> testLike ( $u -> info [ 'x' ], $u -> info [ 'y' ], $this -> info [ 'x' ], $this -> info [ 'y' ]) != 1 ) {
$go = 0 ;
}
2023-01-10 16:29:32 +00:00
//если бот погиб
2022-08-25 11:23:36 +00:00
$dbot = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_bots` WHERE `dn` = "' . $u -> info [ 'dnow' ] . '" AND `x` = "' . $this -> info [ 'x' ] . '" AND `y` = "' . $this -> info [ 'y' ] . '" LIMIT 1' ));
if ( ! isset ( $dbot [ 'id2' ])) {
$go = 0 ;
}
}
}
if ( $go == 1 ) {
//dlg_nps:=:3=7
2023-01-10 16:29:32 +00:00
//квест (с наградой)
2022-08-25 11:23:36 +00:00
$qs_sp = mysql_query ( 'SELECT `id`,`act_date` FROM `quests` WHERE `act_date` LIKE "%dlg_nps:=:' . $this -> info [ 'id' ] . '=' . $pg . '=1=e%" LIMIT 1' );
while ( $qs_pl = mysql_fetch_array ( $qs_sp )) {
$q -> endq ( $qs_pl [ 'id' ], 'win' );
$gsex = explode ( '=e' . $this -> info [ 'id' ] . $pg . '=' , $qs_pl [ 'act_date' ]);
if ( $gsex [ 1 ] > 0 ) {
2023-01-10 16:29:32 +00:00
//выдаем добавочный квест
2022-08-25 11:23:36 +00:00
$q -> startq ( $gsex [ 1 ]);
2023-01-10 16:29:32 +00:00
$txt .= '<br><font color="red"><b>Задание изменилось</b></font>' ;
2022-08-25 11:23:36 +00:00
}
}
2023-01-10 16:29:32 +00:00
//квест (без наградой)
2022-08-25 11:23:36 +00:00
$qs_sp = mysql_query ( 'SELECT `id`,`act_date` FROM `quests` WHERE `act_date` LIKE "%dlg_nps:=:' . $this -> info [ 'id' ] . '=' . $pg . '=0=e%" LIMIT 1' );
while ( $qs_pl = mysql_fetch_array ( $qs_sp )) {
$q -> endq ( $qs_pl [ 'id' ], 'end' );
$gsex = explode ( '=e' . $this -> info [ 'id' ] . $pg . '=' , $qs_pl [ 'act_date' ]);
if ( $gsex [ 1 ] > 0 ) {
2023-01-10 16:29:32 +00:00
//выдаем добавочный квест $gsex[1]
2022-08-25 11:23:36 +00:00
$q -> startq ( $gsex [ 1 ]);
2023-01-10 16:29:32 +00:00
$txt .= '<br><font color="red"><b>Задание изменилось</b></font>' ;
2022-08-25 11:23:36 +00:00
}
}
$this -> title = $this -> info [ 'text' ];
$this -> youInfo = $u -> getInfoPers ( $u -> info [ 'id' ], 1 );
$this -> youInfo = $this -> youInfo [ 0 ];
$this -> botInfo = $this -> infoBot ( $this -> info [ 'bot_id' ]);
2023-01-10 16:29:32 +00:00
//Диалог
2022-08-25 11:23:36 +00:00
$qpl = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dungeon_dlg` WHERE `type` = "1" AND `qid` = "0" AND `id_dg` = "' . $this -> info [ 'id' ] . '" AND `page` = "' . (( int ) $pg ) . '" LIMIT 1' ));
if ( ! isset ( $qpl [ 'id' ])) {
if ( $txt == '' ) {
2023-01-10 16:29:32 +00:00
$qpl [ 'text' ] = 'Диалог не найден ...' ;
2022-08-25 11:23:36 +00:00
} else {
2023-01-10 16:29:32 +00:00
$qpl [ 'text' ] = $txt . ' (<a href="main.php?rnd=' . $code . '">уйти</a>)' ;
2022-08-25 11:23:36 +00:00
$txt = '' ;
}
} else {
$this -> pg = $qpl [ 'id' ];
}
if ( $u -> info [ 'admin' ] > 0 ) {
if ( isset ( $_GET [ 'add_new_qid' ])) {
2023-01-10 16:29:32 +00:00
mysql_query ( 'INSERT INTO `dungeon_dlg` (`type`,`qid`,`id_dg`,`text`) VALUES ("0","' . $qpl [ 'id' ] . '","' . $this -> info [ 'id' ] . '","<i>Новый вариант ответа</i>")' );
2022-08-25 11:23:36 +00:00
}
}
2023-01-10 16:29:32 +00:00
//Варианты ответа
2022-08-25 11:23:36 +00:00
$a = '' ;
$sp = mysql_query ( 'SELECT * FROM `dungeon_dlg` WHERE `type` = "0" AND `qid` = "' . $qpl [ 'id' ] . '" AND `id_dg` = "' . $this -> info [ 'id' ] . '" ORDER BY `sort` DESC LIMIT 25' );
while ( $pl = mysql_fetch_array ( $sp )) {
$pl [ 'action' ] = $this -> ltr ( $pl [ 'action' ]);
$act = explode ( '|' , $pl [ 'action' ]);
if ( isset ( $act [ 1 ])) {
$pl [ 'action' ] = 'main.php?talk=' . $this -> info [ 'id' ] . '&act=' . $pl [ 'id' ] . '&rnd=' . $code ;
}
$go1 = '' ;
if ( $pl [ 'tr' ] != '' ) {
$i = 0 ;
$x = explode ( '|' , $pl [ 'tr' ]);
while ( $i < count ( $x )) {
2023-01-10 16:29:32 +00:00
//Требования
2022-08-25 11:23:36 +00:00
$k = explode ( '=' , $x [ $i ]);
if ( $k [ 0 ] == 'data' ) {
$date = explode ( '-' , $k [ 1 ]);
$dd1 = $date [ 0 ];
$mm1 = $date [ 1 ];
$dd2 = $date [ 2 ];
$mm2 = $date [ 3 ];
$date1 = strtotime ( $dd1 . '-' . $mm1 . '-' . date ( 'Y' ));
$date2 = strtotime ( $dd2 . '-' . $mm2 . '-' . date ( 'Y' ));
if ( $date1 > time () || $date2 < time ()) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'diact' ) {
2023-01-10 16:29:32 +00:00
//Действия
2022-08-25 11:23:36 +00:00
//user_id # all # all # lukaqst1 # -1
if ( $this -> quest_act ( $k [ 1 ]) == false ) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'quest_end' ) {
2023-01-10 16:29:32 +00:00
//Квест можно выполнять несколько раз в текущей пещере
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && $qlst [ 'vals' ] != 'win' && $qlst [ 'vals' ] != 'end' && $qlst [ 'vals' ] != 'bad' ) {
2023-01-10 16:29:32 +00:00
//$go1 .= "Вы уже взяли данное задание\n";
2022-08-25 11:23:36 +00:00
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'quest_only_one' ) {
2023-01-10 16:29:32 +00:00
//Квест можно выполнять только один раз
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && ( $qlst [ 'vals' ] == 'win' || $qlst [ 'vals' ] == 'bad' )) {
2023-01-10 16:29:32 +00:00
//$go1 .= "Вы уже взяли данное задание\n";
2022-08-25 11:23:36 +00:00
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'quest_now' ) {
2023-01-10 16:29:32 +00:00
//Квест должен быть взят
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `vars` = "start_quest' . $k [ 1 ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $qlst [ 'id' ]) && $qlst [ 'vals' ] != 'win' && $qlst [ 'vals' ] != 'end' && $qlst [ 'vals' ] != 'bad' ) {
} else {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'tr_itm' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT COUNT(`id`) FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . $k [ 1 ] . '" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( $qlst [ 0 ] < $k [ 2 ]) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'tr_itmodet' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( ! isset ( $qlst [ 'id' ])) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'tr_noitmodet' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inTransfer` = 0 AND `inOdet` > 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( isset ( $qlst [ 'id' ])) {
$go1 = 'delete' ;
$i = count ( $x );
}
} elseif ( $k [ 0 ] == 'tr_noitm' ) {
2023-01-10 16:29:32 +00:00
//Квест требует предмет
2022-08-25 11:23:36 +00:00
$k [ 1 ] = str_replace ( ',' , '" OR `item_id` = "' , $k [ 1 ]);
$qlst = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND (`item_id` = "' . $k [ 1 ] . '") AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1' ));
if ( isset ( $qlst [ 'id' ])) {
$go1 = 'delete' ;
$i = count ( $x );
}
}
$i ++ ;
}
}
if ( $u -> info [ 'admin' ] > 0 ) {
2023-03-31 18:30:14 +00:00
$a .= '<small>(<a href="javascript:window.open(\'/quest_dlg_edit.php?pid=' . $pl [ 'id' ] . '\',\'winEdi1\',\'width=850,height=400,top=400,left=500,resizable=no,scrollbars=yes,status=no\');" title="Редактировать вариант ответа">ред.</a>)</small> ' ;
2022-08-25 11:23:36 +00:00
}
if ( $go1 == '' ) {
$a .= '• <a href="' . $pl [ 'action' ] . '">' . $pl [ 'text' ] . '</a><br>' ;
} elseif ( $go1 == 'delete' ) {
if ( $u -> info [ 'admin' ] > 0 ) {
$a .= '• <a style="color:#aeaeae" href="' . $pl [ 'action' ] . '">' . $pl [ 'text' ] . '</a><br>' ;
}
} else {
$a .= '<font color="#9A9A9A">• <b>' . $pl [ 'text' ] . '</b></font> <small title="' . $go1 . '"> <b style="cursor:help"><font color=red>[?]</font></b></small><br>' ;
}
}
if ( $u -> info [ 'admin' ] > 0 ) {
2023-01-10 16:29:32 +00:00
$a .= '<small style="border-top:1px solid #BABABA;padding-top:5px;display:block;margin-top:5px;"><a href="main.php?talk=' . (( int ) $_GET [ 'talk' ]) . '&act=' . (( int ) $_GET [ 'act' ]) . '&add_new_qid=1">Добавить вариант ответа</a></small>' ;
2022-08-25 11:23:36 +00:00
}
$this -> dText = $qpl [ 'text' ] . '<br>' . $txt ;
$this -> aText = $a ;
} else {
2023-01-10 16:29:32 +00:00
$this -> aText = '<center>Диалог не доступен, вернуться <a href="main.php?rnd=' . $code . '">назад</a><br></center>' ;
2022-08-25 11:23:36 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$this -> aText = '<center>Диалог не найден, вернуться <a href="main.php?rnd=' . $code . '">назад</a><br><font color="white">' . (( int ) $id ) . '</font></center>' ;
2022-08-25 11:23:36 +00:00
}
}
public function dialog_act_update ( $data )
{
global $u ;
$r = [ false , '' ];
$x = explode ( '#' , $data );
$i = 0 ;
while ( $i < count ( $x )) {
$k = explode ( '=' , $x [ $i ]);
$var = $k [ 0 ];
$val = $k [ 1 ];
if ( $var == 'take_item' ) {
2023-01-10 16:29:32 +00:00
//Забираем предмет
2022-08-25 11:23:36 +00:00
$itms = [];
$sp = mysql_query ( 'SELECT * FROM `items_users` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `item_id` = "' . mysql_real_escape_string ( $val ) . '" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 100' );
while ( $pl = mysql_fetch_array ( $sp )) {
$itms [ $pl [ 'item_id' ]] ++ ;
}
if ( $itms [ $val ] >= $k [ 2 ]) {
//$u->deleteItemID($val,$u->info['id'],$k[2]);
mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `item_id` = "' . mysql_real_escape_string ( $val ) . '" AND `uid` = "' . $u -> info [ 'id' ] . '" AND `inShop` = 0 AND `inTransfer` = 0 AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = 0 LIMIT ' . round ( $k [ 2 ]));
} else {
$i = count ( $x );
$r [ 0 ] = false ;
$itm = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $val . '" LIMIT 1' ));
2023-01-10 16:29:32 +00:00
$r [ 1 ] = 'У вас нет нужного предмета! Требуется "' . $itm [ 'name' ] . '"' ;
2022-08-25 11:23:36 +00:00
if ( $k [ 2 ] > 1 ) {
2023-01-10 16:29:32 +00:00
$r [ 1 ] .= ' (' . $k [ 2 ] . ' шт.)' ;
2022-08-25 11:23:36 +00:00
}
}
//
} elseif ( $var == 'add_item' ) {
$data_itm = '|frompisher=1' ;
$i1 = 0 ;
while ( $i1 < $k [ 2 ]) {
if ( $val == 4797 ) {
2023-01-10 16:29:32 +00:00
//Повестка
2022-08-25 11:23:36 +00:00
if ( $u -> info [ 'level' ] >= 4 && $u -> info [ 'level' ] <= 7 ) {
$val = 4797 ;
} elseif ( $u -> info [ 'level' ] >= 8 && $u -> info [ 'level' ] <= 9 ) {
$val = 4798 ;
} else {
$val = 4799 ;
}
}
2023-04-15 23:54:34 +00:00
\User\ItemsModel :: addItem ( $val , $u -> info [ 'id' ], $data_itm );
2022-08-25 11:23:36 +00:00
$i1 ++ ;
}
} elseif ( $var == 'up' ) {
$tqst = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dialog_act` WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `var` = "' . mysql_real_escape_string ( $val ) . '" ORDER BY `id` DESC LIMIT 1' ));
if ( ! isset ( $tqst [ 'id' ])) {
mysql_query ( ' INSERT INTO `dialog_act` (
`uid` , `city` , `time` , `var` , `val`
) VALUES (
" ' . $u->info ['id'] . ' " , " ' . $u->info ['city'] . ' " , " ' . time() . ' " , " ' . mysql_real_escape_string( $val ) . ' " , " ' . mysql_real_escape_string( $k[2] ) . ' "
) ' );
} else {
mysql_query ( 'UPDATE `dialog_act` SET `val` = "' . mysql_real_escape_string ( $k [ 2 ]) . '" WHERE `uid` = "' . $u -> info [ 'id' ] . '" AND `var` = "' . mysql_real_escape_string ( $val ) . '" ORDER BY `id` DESC LIMIT 1' );
}
} elseif ( $var == 'finish' ) {
$r [ 0 ] = true ;
$r [ 1 ] = $val ;
}
$i ++ ;
}
return $r ;
}
public function quest_act ( $data )
{
global $u ;
$r = true ;
$f = explode ( '#' , $data );
$ql = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `dialog_act` WHERE `var` = "' . mysql_real_escape_string ( $f [ 3 ]) . '" AND `uid` = "' . $u -> info [ 'id' ] . '" ORDER BY `id` DESC LIMIT 1' ));
if ( isset ( $ql [ 'id' ])) {
//user_id # all # all # lukaqst1 # -1
if ( $f [ 0 ] == 'user_id' ) {
$f [ 0 ] = $u -> info [ 'id' ];
}
//
if (
$f [ 0 ] != $ql [ 'uid' ] && $f [ 0 ] != 'all' ||
$f [ 1 ] != $ql [ 'city' ] && $f [ 1 ] != 'all' ||
$f [ 2 ] != $ql [ 'time' ] && $f [ 2 ] != 'all' ||
$f [ 3 ] != $ql [ 'var' ] && $f [ 3 ] != 'all' ||
$f [ 4 ] == - 1 ||
$f [ 4 ] != $ql [ 'val' ] ||
$f [ 5 ] == 1 && $ql [ 'now' ] < $ql [ 'max' ]
) {
$r = false ;
}
} elseif ( $f [ 4 ] != - 1 ) {
$r = false ;
}
return $r ;
}
public function ltr ( $v )
{
return $v ;
}
public function infoBot ( $id )
{
global $c , $code ;
$r = '' ;
$bot = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `test_bot` WHERE `id` = "' . (( int ) $id ) . '" LIMIT 1' ));
if ( isset ( $bot [ 'id' ])) {
2023-01-10 16:29:32 +00:00
//Характеристики от предметов и их изображение
2022-08-25 11:23:36 +00:00
$witm = [];
2023-03-31 18:30:14 +00:00
$witm [ 1 ] = '<img width="60" height="60" style="display:block;" title="Пустой слот шлем" src="//img.new-combats.tech/i/items/w/w9.gif">' ;
$witm [ 2 ] = '<img width="60" height="40" style="display:block;" title="Пустой слот наручи" src="//img.new-combats.tech/i/items/w/w13.gif">' ;
$witm [ 3 ] = '<img width="60" height="60" style="display:block;" title="Пустой слот оружие" src="//img.new-combats.tech/i/items/w/w3.gif">' ;
$witm [ 4 ] = '<img width="60" height="80" style="display:block;" title="Пустой слот броня" src="//img.new-combats.tech/i/items/w/w4.gif">' ;
$witm [ 7 ] = '<img width="60" height="40" style="display:block;" title="Пустой слот пояс" src="//img.new-combats.tech/i/items/w/w5.gif">' ;
$witm [ 8 ] = '<img width="60" height="20" style="display:block;" title="Пустой слот серьги" src="//img.new-combats.tech/i/items/w/w1.gif">' ;
$witm [ 9 ] = '<img width="60" height="20" style="display:block;" title="Пустой слот ожерелье" src="//img.new-combats.tech/i/items/w/w2.gif">' ;
$witm [ 10 ] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="//img.new-combats.tech/i/items/w/w6.gif">' ;
$witm [ 11 ] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="//img.new-combats.tech/i/items/w/w6.gif">' ;
$witm [ 12 ] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="//img.new-combats.tech/i/items/w/w6.gif">' ;
$witm [ 13 ] = '<img width="60" height="40" style="display:block;" title="Пустой слот перчатки" src="//img.new-combats.tech/i/items/w/w11.gif">' ;
$witm [ 14 ] = '<img width="60" height="60" style="display:block;" title="Пустой слот щит" src="//img.new-combats.tech/i/items/w/w10.gif">' ;
$witm [ 16 ] = '<img width="60" height="80" style="display:block;" title="Пустой слот поножи" src="//img.new-combats.tech/i/items/w/w19.gif">' ;
$witm [ 17 ] = '<img width="60" height="40" style="display:block;" title="Пустой слот обувь" src="//img.new-combats.tech/i/items/w/w12.gif">' ;
2023-01-10 16:29:32 +00:00
//40-52 слот под магию
2023-03-31 18:30:14 +00:00
$witm [ 53 ] = '<img style="display:block;" title="Пустой слот правый карман" src="//img.new-combats.tech/i/items/w/w15.gif">' ;
$witm [ 54 ] = '<img style="display:block;" title="Пустой слот левый карман" src="//img.new-combats.tech/i/items/w/w15.gif">' ;
$witm [ 55 ] = '<img style="display:block;" title="Пустой слот центральный карман" src="//img.new-combats.tech/i/items/w/w15.gif">' ;
$witm [ 56 ] = '<img style="display:block;" title="Пустой слот смена" src="//img.new-combats.tech/i/items/w/w20.gif">' ;
$witm [ 57 ] = '<img style="display:block;" title="Пустой слот смена" src="//img.new-combats.tech/i/items/w/w20.gif">' ;
$witm [ 58 ] = '<img style="display:block;" title="Пустой слот смена" src="//img.new-combats.tech/i/items/w/w20.gif">' ;
2022-08-25 11:23:36 +00:00
$pb = '' ;
$hpmp = '?? ' ;
$eff = '' ;
$anml = '' ;
$oi = '' ;
2023-03-31 18:30:14 +00:00
$msl = '<img width="120" height="40" style="display:block" src="//img.new-combats.tech/i/slot_bottom.gif">' ;
2022-08-25 11:23:36 +00:00
$witmg = '' ;
if ( $bot [ 'level' ] < 0 ) {
$bot [ 'level' ] = '??' ;
}
2023-03-31 18:30:14 +00:00
$r = '<div style="width:246px; padding:2px;" align="center"><b>' . $bot [ 'login' ] . '</b> [' . $bot [ 'level' ] . ' ] < img src = " //img.new-combats.tech/i/inf_.gif " ></ div >
2022-08-25 11:23:36 +00:00
< div style = " width:240px; padding:2px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF; " >
< div align = " center " ><!-- blocked --> ' . $pb . ' </ div >
< table width = " 240 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td width = " 60 " valign = " top " >
< table width = " 60 " height = " 280 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td height = " 60 " > ' . $witm[1] . ' </ td >
</ tr >
< tr >
< td height = " 40 " > ' . $witm[2] . ' </ td >
</ tr >
< tr >
< td height = " 60 " > ' . $witm[3] . ' </ td >
</ tr >
< tr >
< td height = " 80 " > ' . $witm[4] . ' </ td >
</ tr >
< tr >
< td height = " 40 " > ' . $witm[7] . ' </ td >
</ tr >
</ table >
</ td >
< td height = " 280 " valign = " top " >
< table width = " 120 " height = " 280 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td height = " 20 " valign = " top " >
<!-- HP and MP -->
' . $hpmp . '
<!-- -->
</ td >
</ tr >
< tr >
< td valign = " top " >
< div style = " position:relative;height:220px; " >
2023-01-10 16:29:32 +00:00
<!-- образ -->
2023-03-31 18:30:14 +00:00
< div style = " position:absolute; width:120px; height:220px; z-index:1; " >< a href = " #obraz_pers " >< img width = " 120 " height = " 220 " src = " //img.new-combats.tech/i/obraz/' . $bot['sex'] . '/' . $bot['obraz'] . ' " ' . $oi . ' ></ a ></ div >
2022-08-25 11:23:36 +00:00
< div style = " position:absolute; width:120px; height:220px; z-index:3; " align = " left " > ' . $eff . ' </ div > ' . $anml . '
</ div >
</ td >
</ tr >
< tr >
< td height = " 40 " >< div align = " center " > ' . $msl . ' </ div ></ td >
</ tr >
</ table >
</ td >
< td width = " 60 " valign = " top " >
< table width = " 60 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td height = " 20 " > ' . $witm[8] . ' </ td >
</ tr >
< tr >
< td height = " 20 " > ' . $witm[9] . ' </ td >
</ tr >
< tr >
< td height = " 20 " >< table width = " 60 " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td width = " 20 " height = " 20 " > ' . $witm[10] . ' </ td >
< td width = " 20 " > ' . $witm[11] . ' </ td >
< td width = " 20 " > ' . $witm[12] . ' </ td >
</ tr >
</ table ></ td >
</ tr >
< tr >
< td height = " 40 " > ' . $witm[13] . ' </ td >
</ tr >
< tr >
< td height = " 60 " > ' . $witm[14] . ' </ td >
</ tr >
< tr >
< td height = " 80 " > ' . $witm[16] . ' </ td >
</ tr >
< tr >
< td height = " 40 " > ' . $witm[17] . ' </ td >
</ tr >
</ table >
</ td >
</ tr >
</ table > ' . $witmg . '
</ div > ' ;
} else {
$r = 'No information' ;
}
return $r ;
}
}