2023-07-11 15:16:35 +00:00
< ? php
2022-06-11 11:32:31 +00:00
2023-08-14 15:15:05 +00:00
use Helper\Conversion ;
2023-07-31 17:06:51 +00:00
use User\ItemsModel ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( ! defined ( 'GAME' )) {
die ();
2022-06-06 21:30:34 +00:00
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $u -> room [ 'file' ] != 'remont' ) {
return ;
}
//Предметы которые можно подогнать (г о с )
$itm_podgon = [
784 ,
788 ,
1714 ,
1239 ,
2023-07-31 17:06:51 +00:00
1240 ,
2023-07-11 15:16:35 +00:00
];
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
//Комплекты подгона
$com_podgon = [
'Комплект Скорпиона' => true ,
'Комплект Забытых Времен' => true ,
'Комплект Утреннего Солнца' => true ,
'Комплект Паука' => true ,
'Комплект Злодеяний' => true ,
2023-07-31 17:06:51 +00:00
'Комплект Кровавой Луны' => true ,
2023-07-11 15:16:35 +00:00
];
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$r = 1 ;
if ( isset ( $_GET [ 'r' ])) {
$r = ( int ) $_GET [ 'r' ];
if ( $r != 1 && $r != 2 && $r != 3 && $r != 4 && $r != 5 && $r != 6 && $r != 7 && $r != 8 && $r != 9 ) {
$r = 1 ;
}
if ( $r == 6 || $r == 7 ) {
$r = 1 ;
}
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( isset ( $_GET [ 'upgrade' ]) && true == false ) {
//улучшение предмета
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'upgrade' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( $ir [ 'price1' ] > $ir [ '1price' ]) {
$ir [ '1price' ] = $ir [ 'price1' ];
}
$pcena = $ir [ '1price' ] / 2.37 ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $ir [ 'price2' ] > $ir [ '2price' ]) {
$ir [ '2price' ] = $ir [ 'price2' ];
}
$pcena2 = ( $ir [ '2price' ] / 2.37 ) * 30 ;
if ( $pcena2 > $pcena ) {
$pcena = $pcena2 ;
}
if ( ! isset ( $po [ 'add_s1' ]) && ! isset ( $po [ 'add_s2' ]) && ! isset ( $po [ 'add_s3' ]) && ! isset ( $po [ 'add_s5' ])) {
$pcena = $pcena / 2.37 ;
}
$pcena = round ( $pcena + $pcena / 100 * ( 37.795 * ( $po [ 'upgrade' ] + 1 )));
if ( $pcena == 0 ) {
$re = '<div align="left">Данный предмет не подходит...</div>' ;
} elseif ( $pcena <= $u -> info [ 'money' ]) {
if ( $po [ 'upgrade' ] < 5 ) {
2023-07-31 17:06:51 +00:00
$fadd = [ 0 , 0 , 0 , 0 ];
2023-07-11 15:16:35 +00:00
$faddp = 0 ;
if ( ! isset ( $po [ 'upgrade' ]) || $po [ 'upgrade' ] == 0 ) {
$ir [ '1price' ] += floor ( $ir [ '1price' ] / 100 * 20 );
$faddp = 6 ;
} elseif ( $po [ 'upgrade' ] == 1 ) {
$ir [ '1price' ] += floor ( $ir [ '1price' ] / 100 * 30 );
$faddp = 7 ;
} elseif ( $po [ 'upgrade' ] == 2 ) {
$ir [ '1price' ] += floor ( $ir [ '1price' ] / 100 * 40 );
$faddp = 8 ;
} elseif ( $po [ 'upgrade' ] == 3 ) {
$ir [ '1price' ] += floor ( $ir [ '1price' ] / 100 * 70 );
$faddp = 10 ;
} elseif ( $po [ 'upgrade' ] == 4 ) {
$ir [ '1price' ] += floor ( $ir [ '1price' ] / 100 * 10 );
$faddp = 16 ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$fadd [ 0 ] = $po [ 'add_s1' ] + $po [ 'add_s2' ] + $po [ 'add_s3' ] + $po [ 'add_s5' ] + $po [ 'mf_stats' ];
$fadd [ 1 ] = $po [ 'add_m1' ] + $po [ 'add_m2' ] + $po [ 'add_m4' ] + $po [ 'add_m5' ] + $po [ 'mf_mod' ];
$fadd [ 2 ] = round (( $po [ 'add_mab1' ] + $po [ 'add_mab2' ] + $po [ 'add_mab3' ] + $po [ 'add_mab4' ]) / 4 + $po [ 'mf_mib' ]);
$fadd [ 3 ] = $po [ 'add_hpAll' ];
2022-06-06 21:30:34 +00:00
2023-07-11 15:16:35 +00:00
if ( $po [ 'upgrade' ] <= 3 ) {
2023-07-31 17:06:51 +00:00
$fadd = [
2023-07-11 15:16:35 +00:00
round ( $fadd [ 0 ] / 100 * $faddp ), //статы
floor ( $fadd [ 1 ] / 100 * $faddp ), //мф.
floor ( $fadd [ 2 ] / 100 * $faddp ), //броня
2023-07-31 17:06:51 +00:00
ceil ( $fadd [ 3 ] / 100 * $faddp ), //Н Р
];
2023-07-11 15:16:35 +00:00
} else {
2023-07-31 17:06:51 +00:00
$fadd = [
2023-07-11 15:16:35 +00:00
ceil ( $fadd [ 0 ] / 100 * $faddp ), //статы
ceil ( $fadd [ 1 ] / 100 * $faddp ), //мф.
ceil ( $fadd [ 2 ] / 100 * $faddp ), //броня
2023-07-31 17:06:51 +00:00
ceil ( $fadd [ 3 ] / 100 * $faddp ), //Н Р
];
2023-07-11 15:16:35 +00:00
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$po [ 'mf_stats' ] += $fadd [ 0 ];
$po [ 'mf_mod' ] += $fadd [ 1 ];
$po [ 'mf_mib' ] += $fadd [ 2 ];
$po [ 'add_hpAll' ] += $fadd [ 3 ];
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$po [ 'upgrade' ] ++ ;
2023-12-01 21:05:11 +00:00
$re = '<div>Предмет "' . $ir [ 'name' ] . '" был успешно улучшен (' . $po [ 'upgrade' ] . '/5) за ' . $pcena . ' кр.</div>' ;
2022-06-11 11:32:31 +00:00
2023-12-01 21:05:11 +00:00
Delo :: add (
2 ,
'System.remont.itemUpgrade' ,
$u -> info [ 'id' ],
'"<span style="color: #4863A0; ">System.remont.itemUpgrade</span>": Предмет "' . $ir [ 'name' ] . '" [itm:' . $ir [ 'id' ] . '] был успешно улучшен (' . $po [ 'upgrade' ] . '/5) за ' . $pcena . ' кр..' ,
);
2022-06-11 11:32:31 +00:00
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '",`1price` = "' . $ir [ '1price' ] . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
$u -> info [ 'money' ] -= $pcena ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
} else {
$re = '<div align="left">Предмет улучшен до максимума</div>' ;
}
} else {
$re = '<div align="left">У вас не достаточно средств для модификации предмета</div>' ;
}
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'modif' ]) && true == false ) {
//модификация
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . ' " AND `iu`.`delete`= " 0 " AND `iu`.`inOdet`= " 0 " AND `iu`.`inShop`= " 0 " AND
2023-07-11 15:16:35 +00:00
`iu` . `data` NOT LIKE " %modif% " AND `im` . `type` > 0 AND `im` . `type` < 16 AND ( `iu` . `data` LIKE " %add_s1% " OR `iu` . `data` LIKE " %add_s2% " OR `iu` . `data` LIKE " %add_s3% " OR `iu` . `data` LIKE " %add_s5% " OR `iu` . `data` LIKE " %add_hpAll% " OR `iu` . `data` LIKE " %add_mib% " )
2023-12-01 21:05:11 +00:00
AND `iu` . `id` = " ' . mysql_real_escape_string((int) $_GET['modif'] ) . ' " LIMIT 1 '
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( $ir [ 'price1' ] > $ir [ '1price' ]) {
$ir [ '1price' ] = $ir [ 'price1' ];
}
$pcena = $ir [ '1price' ] / 2 ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $ir [ 'price2' ] > $ir [ '2price' ]) {
$ir [ '2price' ] = $ir [ 'price2' ];
}
$pcena2 = ( $ir [ '2price' ] / 2.37 ) * 30 ;
if ( $pcena2 > $pcena ) {
$pcena = $pcena2 ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( ! isset ( $po [ 'add_s1' ]) && ! isset ( $po [ 'add_s2' ]) && ! isset ( $po [ 'add_s3' ]) && ! isset ( $po [ 'add_s5' ])) {
$pcena = $pcena / 2 ;
}
$pcena = round ( $pcena );
if ( $pcena == 0 ) {
$re = '<div align="left">Данный предмет не подходит...</div>' ;
} elseif ( $pcena <= $u -> info [ 'money' ]) {
if ( $u -> stats [ 's5' ] > 24 ) {
2023-07-31 17:06:51 +00:00
$fadd = [ 0 , 0 , 0 ];
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
//добавляем статы
if ( isset ( $po [ 'add_s1' ]) || isset ( $po [ 'add_s2' ]) || isset ( $po [ 'add_s3' ]) || isset ( $po [ 'add_s5' ])) {
$rnd1 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd1 > 500 ) {
$rnd2 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd2 > 500 ) {
$rnd3 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd3 > 500 ) {
//3
$fadd [ 0 ] = rand ( 0 , 1 );
} else {
//1
$fadd [ 0 ] = 0 ;
}
} else {
//2
$fadd [ 0 ] = 0 ;
}
} else {
//1
$fadd [ 0 ] = 0 ;
}
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
//добавляем Н Р
if ( isset ( $po [ 'add_m1' ]) || isset ( $po [ 'add_m2' ]) || isset ( $po [ 'add_m4' ]) || isset ( $po [ 'add_m5' ])) {
$rnd1 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd1 > 500 ) {
$rnd2 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd2 > 500 ) {
$rnd3 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd3 > 500 ) {
//3
$fadd [ 1 ] = 10 ;
} else {
//1
$fadd [ 1 ] = 1 ;
}
} else {
//2
$fadd [ 1 ] = 7 ;
}
} else {
//1
$fadd [ 1 ] = 1 ;
}
$fadd [ 1 ] = rand ( $fadd [ 1 ], 20 );
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
//добавляем броню
if ( isset ( $po [ 'add_mib1' ]) || isset ( $po [ 'add_mib2' ]) || isset ( $po [ 'add_mib3' ]) || isset ( $po [ 'add_mib4' ])) {
$rnd1 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd1 > 500 ) {
$rnd2 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd2 > 500 ) {
$rnd3 = rand ( 0 , ( 1000 - $u -> stats [ 's5' ]));
if ( $rnd3 > 500 ) {
//3
$fadd [ 2 ] = 3 ;
} else {
//1
$fadd [ 2 ] = 1 ;
}
} else {
//2
$fadd [ 2 ] = 2 ;
}
} else {
//1
$fadd [ 2 ] = 1 ;
}
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $fadd [ 0 ] > 0 ) {
//статы
$po [ 'mf_stats' ] += $fadd [ 0 ];
}
if ( $fadd [ 1 ] > 0 ) {
//Н Р
$po [ 'add_hpAll' ] += $fadd [ 1 ];
}
if ( $fadd [ 2 ] > 0 ) {
//броня
$po [ 'mf_mib' ] += $fadd [ 2 ];
}
$po [ 'modif' ] = 1 ;
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '",`1price` = "' . $ir [ '1price' ] . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
$u -> info [ 'money' ] -= $pcena ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$re = '<div align="left">Предмет "' . $ir [ 'name' ] . '" был успешно модифицирован (Характеристики: +' . $fadd [ 0 ] . ', Здоровье: +' . $fadd [ 1 ] . ', Броня: +' . $fadd [ 2 ] . ') за ' . $pcena . ' кр.</div>' ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
} else {
$re = '<div align="left">Для модифицирования предмета требуется характеристика Интелект: 25</div>' ;
}
} else {
$re = '<div align="left">У вас не достаточно средств для модификации предмета</div>' ;
}
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'ubeff' ]) && true == false ) {
// Берем в переменную текущий предмет.
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'ubeff' ]
) . '" LIMIT 1'
)
);
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
// Предмет существует.
if ( isset ( $ir [ 'id' ])) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]); // Тут мы храним характеристики предмета.
2023-07-11 15:16:35 +00:00
if ( $po [ 'tr_lvl' ] > $ir [ 'level' ]) {
$pl [ 'level' ] = $po [ 'tr_lvl' ]; // Если уровень предмета, меньше чем уровень требований с характеристик, то идет обновление уровня предмета.
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$pcena = 5 * $pl [ 'level' ] + 35 ; // цена увеличивается, для продажи в г о с . маг.
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( isset ( $po [ 'rune_id' ])) { // Если в предмете существует Р У Н А , увеличиваем цену.
$pcena += 3 ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( isset ( $po [ 'upatack_id' ])) { // Если в предмете имеется Заточка, увеличиваем цену.
$pcena += 14 ;
}
if ( $po [ 'rune_id' ] > 0 ) { // Последовательность действий.
$re = '<div align="left">Для дезинтеграции сначала извлеките руну</div>' ;
2023-07-31 17:06:51 +00:00
} elseif ( $u -> info [ 'money' ] >= 2000 ) { // Проверка, хватает ли средств.
$pcena -= 14 ; // Уменьшаем цену после извлеченния заточки.
if ( isset ( $po [ 'upatack_id' ])) { // Добавляем заточку в инвентарь.
// Берем в переменную свиток заточки, который находится в предмете.
2023-12-01 21:05:11 +00:00
$upattack = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . mysql_real_escape_string (
( int ) $po [ " upatack " ]
) . '" LIMIT 1'
)
);
2023-07-31 17:06:51 +00:00
if ( isset ( $upattack ) && $upattack [ 'item_id' ] && $upattack [ 'delete' ] > 0 ) { // Если старый предмет не удален из базы, мы е г о восстанавливаем.
mysql_query ( 'UPDATE `items_users` SET `delete` = "' . mysql_real_escape_string ( 0 ) . '" WHERE `id` = "' . $po [ " upatack " ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `items_users` SET `data` = CONCAT(`data`,"noremont=1") WHERE `id` = "' . $po [ " upatack " ] . '" LIMIT 1' );
} else { // Если старый предмет не существует, создаем новый.
ItemsModel :: addItem ( $po [ 'upatack_id' ], $u -> info [ 'id' ], '|noremont=1' , null , null , true );
$irs .= ',' . $po [ 'upatack_name' ];
2023-07-11 15:16:35 +00:00
}
2023-07-31 17:06:51 +00:00
}
2022-06-11 11:32:31 +00:00
2023-07-31 17:06:51 +00:00
if ( ! isset ( $upattack [ 'data' ])) {
$upattack = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main_data` WHERE `items_id` = "' . mysql_real_escape_string (( int ) $po [ " upatack_id " ]) . '" LIMIT 1' ));
}
2022-06-11 11:32:31 +00:00
2023-07-31 17:06:51 +00:00
// Обнуляем инфу к стандартным данным - $ir['item_id']
$item_default = mysql_fetch_array ( mysql_query ( 'SELECT `data` FROM `items_main_data` WHERE `items_id` = "' . mysql_real_escape_string (( int ) $ir [ 'item_id' ]) . '" LIMIT 1' ));
2023-08-14 15:15:05 +00:00
$item_default = Conversion :: dataStringToArray ( $item_default [ 'data' ]);
$upattack = Conversion :: dataStringToArray ( $upattack [ 'data' ]);
2023-07-31 17:06:51 +00:00
if ( $upattack [ 'uptype' ] == 22 ) {
$po [ 'add_m11' ] -= $upattack [ 'upatack' ] * 2 ;
$po [ 'tr_lvl' ] = $item_default [ 'tr_lvl' ];
2023-12-01 21:05:11 +00:00
if ( isset ( $po [ 'add_m11' ]) && $po [ 'add_m11' ] == 0 ) {
unset ( $po [ 'add_m11' ]);
}
2023-07-11 15:16:35 +00:00
} else {
2023-07-31 17:06:51 +00:00
$po [ 'sv_yron_min' ] -= $upattack [ 'upatack' ];
$po [ 'sv_yron_max' ] -= $upattack [ 'upatack' ];
$po [ 'tr_lvl' ] = $item_default [ 'tr_lvl' ];
2023-07-11 15:16:35 +00:00
}
2023-07-31 17:06:51 +00:00
unset ( $po [ " upatack " ]);
unset ( $po [ " upatack_id " ]);
unset ( $po [ " upatack_name " ]);
unset ( $po [ " upatack_lvl " ]);
unset ( $item_default );
unset ( $upattack );
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2022-06-11 11:32:31 +00:00
2023-07-31 17:06:51 +00:00
var_info ( $po );
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
$u -> addKr ( - 100 );
} else {
$re = '<div align="left">У вас не достаточно средств для дезинтеграции</div>' ;
}
2023-07-11 15:16:35 +00:00
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'unrune' ])) {
require_once $_SERVER [ 'DOCUMENT_ROOT' ] . '/_incl_data/class/Insallah/Runes/Runes.php' ;
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%rune_id%" AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'unrune' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( $po [ 'tr_lvl' ] > $ir [ 'level' ]) {
$ir [ 'level' ] = $po [ 'tr_lvl' ];
}
2022-07-01 12:45:43 +00:00
2023-07-11 15:16:35 +00:00
$pcena = 50 ;
if ( $u -> stats [ 'repair_r' ] >= 1 ) {
$pcena = 0 ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $pcena <= $u -> info [ 'money' ]) {
/** Самое новое изъятие рун. ;)*/
2023-07-31 17:06:51 +00:00
$item_and_rune = Runes :: removeRuneData ( $po );
2023-07-11 15:16:35 +00:00
if ( ! empty ( $item_and_rune )) {
2023-12-01 21:05:11 +00:00
# Добавляем предмет без руны
2023-07-11 15:16:35 +00:00
mysql_query ( sprintf ( " update items_users set data = '%s' where id = %d " , $item_and_rune [ 'item' ], $ir [ 'id' ]));
2023-12-01 21:05:11 +00:00
# Отнимаем деньги
2023-07-11 15:16:35 +00:00
$u -> info [ 'money' ] -= $pcena ;
mysql_query ( sprintf ( " update users set money = money - %f where id = %d " , $pcena , $u -> info [ 'id' ]));
2023-12-01 21:05:11 +00:00
# Добавляем руну
2023-07-31 17:06:51 +00:00
ItemsModel :: addItem ( $item_and_rune [ 'rune_id' ], $u -> info [ 'id' ], $item_and_rune [ 'rune' ], null , null , true );
2023-07-11 15:16:35 +00:00
} else {
/** Если пытаемся извлечь любую руну кроме 6001, 6002, 6003. */
$re = 'Руна слилась с предметом и не извлекается...' ;
}
} else {
$re = '<div>У вас не достаточно средств для извлечения, цена извлечения руны ' . $pcena . '</div>' ;
}
} else {
$re = '<div>Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'ubeff' ])) {
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'ubeff' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( $po [ 'tr_lvl' ] > $ir [ 'level' ]) {
$ir [ 'level' ] = $po [ 'tr_lvl' ];
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$pcena = 1 ;
if ( $pcena <= $u -> info [ 'money' ]) {
if ( $u -> stats [ 'repair_z' ] >= 2500 ) {
$pcena = 0 ;
}
$iro = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main_data` WHERE `items_id` = "' . $po [ 'upatack_id' ] . '" LIMIT 1' ));
2023-08-14 15:15:05 +00:00
$ro = Conversion :: dataStringToArray ( $iro [ 'data' ]);
2023-07-31 17:06:51 +00:00
$restat = [];
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$i = 0 ;
while ( $i < count ( $u -> items [ 'add' ])) {
if ( isset ( $ro [ 'add_' . $u -> items [ 'add' ][ $i ]])) {
$po [ 'add_' . $u -> items [ 'add' ][ $i ]] -= $ro [ 'add_' . $u -> items [ 'add' ][ $i ]];
if ( $po [ 'add_' . $u -> items [ 'add' ][ $i ]] == 0 ) {
unset ( $po [ 'add_' . $u -> items [ 'add' ][ $i ]]);
2022-06-11 11:32:31 +00:00
}
2023-07-11 15:16:35 +00:00
}
if ( isset ( $ro [ 'sv_' . $u -> items [ 'add' ][ $i ]])) {
$po [ 'sv_' . $u -> items [ 'add' ][ $i ]] -= $ro [ 'sv_' . $u -> items [ 'add' ][ $i ]];
if ( $po [ 'sv_' . $u -> items [ 'add' ][ $i ]] == 0 ) {
unset ( $po [ 'sv_' . $u -> items [ 'add' ][ $i ]]);
}
}
$i ++ ;
}
2022-06-06 21:30:34 +00:00
2023-07-31 17:06:51 +00:00
ItemsModel :: addItem ( $po [ 'upatack_id' ], $u -> info [ 'id' ], null , null , null , 1 );
2023-12-01 21:05:11 +00:00
$re = '<div>Заточка "' . $po [ 'upatack_name' ] . '" была успешно извлечена из предмета "' . $ir [ 'name' ] . '" за ' . $pcena . ' кр.</div>' ;
Delo :: add (
2 ,
'System.remont.ubeff' ,
$u -> info [ 'id' ],
'"<span style="color: #4863A0; ">System.remont.ubeff</span>": Руна "' . $po [ 'upatack_name' ] . '" была успешно извлечена из предмета "' . $ir [ 'name' ] . '" [itm:' . $ir [ 'id' ] . '] за ' . $pcena . ' кр.' ,
);
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
unset ( $po [ 'upatack' ], $po [ 'upatack_id' ], $po [ 'upatack_name' ], $po [ 'upatack_lvl' ]);
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
$u -> info [ 'money' ] -= $pcena ;
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
} else {
2023-12-01 21:05:11 +00:00
$re = '<div>У вас не достаточно средств для извлечения, стоимость извлечения заточки ' . $pcena . ' кр</div>' ;
2023-07-11 15:16:35 +00:00
}
} else {
2023-12-01 21:05:11 +00:00
$re = '<div>Подходящий предмет не найден в инвентаре</div>' ;
2023-07-11 15:16:35 +00:00
}
} elseif ( isset ( $_GET [ 'un_grav' ])) {
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'un_grav' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
$pcena = 30 ;
if ( $ir [ 'type' ] == 22 ) {
$pcena = 35 ;
} elseif ( $ir [ 'type' ] == 18 ) {
$pcena = 15 ;
}
if ( $pcena <= $u -> info [ 'money' ]) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
$po [ 'gravi' ] = substr ( $_GET [ 'grav_text' ], 0 , 20 );
$po [ 'gravic' ] = $u -> info [ 'city' ];
$po [ 'gravi' ] = str_replace ( '=' , '' , $po [ 'gravi' ]);
$po [ 'gravi' ] = str_replace ( '|' , '' , $po [ 'gravi' ]);
$tst = str_replace ( ' ' , '' , $po [ 'gravi' ]);
$tst = str_replace ( ' ' , '' , $po [ 'gravi' ]);
$po [ 'gravi' ] = preg_replace ( " /[^a-zA-ZА -Яа-я0-9 \ s]/ " , " " , $po [ 'gravi' ]);
if ( $po [ 'gravi' ] != '' && $tst != '' ) {
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
$re = '<div align="left">Н а предмете "' . $ir [ 'name' ] . '" был успешно выгровирован текст за ' . $pcena . ' кр.</div>' ;
} else {
$re = '<div align="left">Пустой текст, либо состоит из символов которые нельзя использовать</div>' ;
}
} else {
$re = '<div align="left">У вас не достаточно средств для гравировки</div>' ;
}
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'grav' ])) {
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'grav' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
$pcena = 30 ;
if ( $ir [ 'type' ] == 22 ) {
$pcena = 35 ;
} elseif ( $ir [ 'type' ] == 18 ) {
$pcena = 15 ;
}
if ( $pcena <= $u -> info [ 'money' ]) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
$po [ 'gravi' ] = substr ( $_GET [ 'grav_text' ], 0 , 20 );
$po [ 'gravic' ] = $u -> info [ 'city' ];
$po [ 'gravi' ] = str_replace ( '=' , '' , $po [ 'gravi' ]);
$po [ 'gravi' ] = str_replace ( '|' , '' , $po [ 'gravi' ]);
$tst = str_replace ( ' ' , '' , $po [ 'gravi' ]);
$tst = str_replace ( ' ' , '' , $po [ 'gravi' ]);
$po [ 'gravi' ] = preg_replace ( " /[^a-zA-ZА -Яа-я0-9 \ s]/ " , " " , $po [ 'gravi' ]);
if ( $po [ 'gravi' ] != '' && $tst != '' ) {
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
$re = '<div align="left">Н а предмете "' . $ir [ 'name' ] . '" был успешно выгровирован текст за ' . $pcena . ' кр.</div>' ;
} else {
$re = '<div align="left">Пустой текст, либо состоит из символов которые нельзя использовать</div>' ;
}
} else {
$re = '<div align="left">У вас не достаточно средств для гравировки</div>' ;
}
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'podgon' ])) {
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = 5 AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'podgon' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
2023-07-31 17:06:51 +00:00
$po = [];
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( ! isset ( $po [ 'podgon' ])) {
if ( $po [ 'tr_lvl' ] > $ir [ 'level' ]) {
$ir [ 'level' ] = $po [ 'tr_lvl' ];
}
$pcena = 5 * $ir [ 'level' ] + 10 ;
if ( $pcena <= $u -> info [ 'money' ]) {
$prhp = 6 * $ir [ 'level' ] + 6 ;
$po [ 'podgon' ] = 1 ;
$po [ 'add_hpAll' ] += $prhp ;
$po [ 'sudba' ] = $u -> info [ 'login' ];
2023-08-14 15:15:05 +00:00
$po = Conversion :: arrayToDataString ( $po );
2023-07-11 15:16:35 +00:00
mysql_query ( 'UPDATE `users` SET `money` = `money` - "' . $pcena . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
$re = '<div align="left">Предмет "' . $ir [ 'name' ] . '" был успешно подогнан за ' . $pcena . ' кр. (Добавлено +' . $prhp . 'HP)</div>' ;
} else {
$re = '<div align="left">У вас не достаточно средств для подгонки</div>' ;
}
} else {
$re = '<div align="left">Предмет уже был подогнан</div>' ;
}
} else {
$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>' ;
}
} elseif ( isset ( $_GET [ 'remon' ])) {
$t = 1 ;
if ( $_GET [ 't' ] == 2 ) {
$t = 2 ;
} elseif ( $_GET [ 't' ] == 3 ) {
$t = 3 ;
}
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'remon' ]
) . '" LIMIT 1'
)
);
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
$rem_price = round ( $ir [ 'price1' ] * 0.1 / 100 , 2 ); //цена ремонта за 1е д поломки
$rem_all = round ( $ir [ 'price1' ] * $ir [ 'iznosNOW' ] * 0.1 / 100 , 2 ); //цена ремонта full
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $u -> stats [ 'repair_discount' ] >= 1 ) {
$rem_price = round ( $rem_price / 100 * 25 , 2 );
$rem_all = round ( $rem_all / 100 * 25 , 2 );
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $rem_price < 0.01 ) {
$rem_price = 0.01 ;
} //кэп поможет
if ( $rem_all < 0.01 ) {
$rem_all = 0.01 ;
} //кэп поможет
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
2023-08-14 15:15:05 +00:00
$po = Conversion :: dataStringToArray ( $ir [ 'data' ]);
2023-07-11 15:16:35 +00:00
if ( isset ( $po [ 'noremont' ])) {
$re2 = 'Предмет не подлежит ремонту в этой мастерской.' ;
} else {
if ( $t == 1 ) {
$rem_cell = $rem_price ;
$t = 0 ;
$rm = 1 ;
$re2 .= ' 1 ед.' ;
} elseif ( $t == 2 ) {
$t = 0 ;
$rm = 10 ;
$rem_cell = $rem_price * 10 ;
$re2 .= ' 10 ед.' ;
} elseif ( $t == 3 ) {
$rem_cell = $rem_all ;
$t = 0 ;
$rm = $ir [ 'iznosNOW' ];
$re2 .= $rm . ' ед.' ;
}
if ( $rem_cell > $u -> info [ 'money' ]) {
$re2 = 'У вас недостаточно средст для ремонта.' ;
} else {
if ( $rm > $ir [ 'iznosNOW' ]) {
$rm = $ir [ 'iznosNOW' ];
}
$ir [ 'iznosNOW' ] -= $rm ;
if ( $ir [ 'iznosNOW' ] < 0 ) {
$ir [ 'iznosNOW' ] = 0 ;
}
$u -> info [ 'money' ] -= $rem_cell ;
$upd = mysql_query ( 'UPDATE `users` SET `money` = "' . $u -> info [ 'money' ] . '" WHERE `id` = "' . $u -> info [ 'id' ] . '" LIMIT 1' );
if ( $upd ) {
$il = $ir [ 'iznosMAX' ];
if ( rand ( 0 , 100 ) < 25 ) {
$ir [ 'iznosMAX' ] -= 1 ;
}
if ( $ir [ 'iznosMAX' ] < 1 ) {
$ir [ 'iznosMAX' ] = 1 ;
}
mysql_query ( 'UPDATE `items_users` SET `iznosNOW` = "' . $ir [ 'iznosNOW' ] . '",`iznosMAX` = "' . $ir [ 'iznosMAX' ] . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1' );
$re2 = 'Удачно произведен ремонт ' . $re2 . ' предмета "' . $ir [ 'name' ] . '" за ' . $rem_cell . ' кр.' ;
$dop = 0 ;
if ( ceil ( $il ) > ceil ( $ir [ 'iznosMAX' ])) {
$re2 .= '<br>К сожалению, максимальная долговечность предмета из-за ремонта уменьшилась.' ;
$dop = 1 ;
}
2023-12-01 21:05:11 +00:00
Delo :: add (
2 ,
'System.remont' ,
$u -> info [ 'id' ],
'"<span style="color: grey; ">System.remont</span>": Предмет "' . $ir [ 'name' ] . '" [itm:' . $ir [ 'id' ] . '] был <b>отремонтирован</b>, максимальная долговечность уменьшилась: ' . $dop . ' (' . $rm . ' ед. за ' . $t . ' кр.).' ,
);
2023-07-11 15:16:35 +00:00
} else {
$re2 = 'Что-то здесь не так...' ;
}
}
2022-06-11 11:32:31 +00:00
}
2023-07-11 15:16:35 +00:00
} else {
$re2 = 'Предмет подходящий для ремонта не найден в инвентаре' ;
}
} elseif ( isset ( $_GET [ 'upgradelvl' ])) {
2023-12-01 21:05:11 +00:00
$ir = mysql_fetch_array (
mysql_query (
'SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . mysql_real_escape_string (
( int ) $_GET [ 'upgradelvl' ]
) . '" LIMIT 1'
)
);
2023-07-11 15:16:35 +00:00
if ( isset ( $ir [ 'id' ])) {
$ur = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_upgrade` WHERE `iid` = "' . $ir [ 'item_id' ] . '" LIMIT 1' ));
if ( isset ( $ur [ 'id' ])) {
if ( $ur [ 'price1' ] > 0 && $u -> info [ 'money' ] < $ur [ 'price1' ]) {
$re2 = 'Недостаточно кр. у персонажа' ;
} elseif ( $ur [ 'price2' ] > 0 && $u -> info [ 'money2' ] < $ur [ 'price2' ]) {
$re2 = 'Недостаточно екр. у персонажа' ;
} else {
$ui1 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $ur [ 'iup' ] . '" LIMIT 1' ));
$ui2 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main_data` WHERE `items_id` = "' . $ur [ 'iup' ] . '" LIMIT 1' ));
if ( isset ( $ui1 [ 'id' ], $ui2 [ 'id' ])) {
2023-12-01 21:05:11 +00:00
mysql_query (
'UPDATE `items_users` SET `item_id` = "' . $ui1 [ 'id' ] . '",`1price` = "' . $ui1 [ 'price1' ] . '",`2price` = "' . $ui1 [ 'price2' ] . '",`iznosMAX` = "' . $ui1 [ 'iznosMAXi' ] . '",`data` = "' . $ui2 [ 'data' ] . '" WHERE `id` = "' . $ir [ 'id' ] . '" LIMIT 1'
);
2023-07-11 15:16:35 +00:00
$re2 = 'Предмет "' . $ir [ 'name' ] . '" был успешно улучшен до следующего уровня за ' . $ur [ 'price2' ] . ' екр.' ;
$u -> info [ 'money2' ] -= $ur [ 'price2' ];
$u -> addEkr ( - $ur [ 'price2' ]);
} else {
$re2 = 'Неудалось улучшить данный предмет' ;
}
}
} else {
$re2 = 'Предмет подходящий для улучшения не найден' ;
2022-06-11 11:32:31 +00:00
}
2023-07-11 15:16:35 +00:00
} else {
$re2 = 'Предмет подходящий для улучшения не найден в инвентаре' ;
}
}
$see = '' ;
if ( $r == 1 ) {
//ремонт предметов
$see = $u -> genInv ( 4 , '`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 ORDER BY `lastUPD` DESC' );
$see = $see [ 2 ];
} elseif ( $r == 5 ) {
//подгонка брони
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
56 , '`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = "5" AND `iu`.`data` NOT LIKE "%podgon%" ORDER BY `lastUPD` DESC'
);
2023-07-11 15:16:35 +00:00
$see = $see [ 2 ];
} elseif ( $r == 2 ) {
//гравировка оружия
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
57 ,
'`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") ORDER BY `lastUPD` DESC'
);
2023-07-11 15:16:35 +00:00
$see = $see [ 2 ];
} elseif ( $r == 4 ) {
//вытаскивание рун
$see = $u -> genInv ( 58 , '`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%rune_id%" ORDER BY `lastUPD` DESC' );
$see = $see [ 2 ];
} elseif ( $r == 3 ) {
//дезинтеграция
$see = $u -> genInv ( 59 , '`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%upatack_id%") ORDER BY `lastUPD` DESC' );
$see = $see [ 2 ];
} elseif ( $r == 7 ) {
//модификация
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
60 , '`iu`.`uid`="' . $u -> info [ 'id' ] . ' " AND `iu`.`delete`= " 0 " AND `iu`.`inOdet`= " 0 " AND `iu`.`inShop`= " 0 " AND `iu`.`data` NOT LIKE " % modif % " AND `im`.`type` > 0 AND `im`.`type` < 16 AND
( `iu` . `data` LIKE " %add_s1% " OR `iu` . `data` LIKE " %add_s2% " OR `iu` . `data` LIKE " %add_s3% " OR `iu` . `data` LIKE " %add_s5% " OR `iu` . `data` LIKE " %add_hpAll% " OR `iu` . `data` LIKE " %add_mib% " ) ORDER BY `lastUPD` DESC '
);
2023-07-11 15:16:35 +00:00
$see = $see [ 2 ];
} elseif ( $r == 6 ) {
//Усиление
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
61 ,
'`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" ORDER BY `lastUPD` DESC'
);
2023-07-11 15:16:35 +00:00
$see = $see [ 2 ];
} elseif ( $r == 8 ) {
if ( $u -> info [ 'money2' ] > 0 ) {
//Улучшения
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
62 ,
'`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (SELECT `id` FROM `items_upgrade` WHERE `iid` = `iu`.`item_id` AND `activ` = 1 LIMIT 1) > 0 ORDER BY `lastUPD` DESC'
);
2022-06-11 11:32:31 +00:00
$see = $see [ 2 ];
}
2023-07-11 15:16:35 +00:00
} elseif ( $r == 9 ) {
$itmos = '' ;
$i = 0 ;
while ( $i < count ( $itm_podgon )) {
$itmos .= ' OR `iu`.`item_id` = "' . $itm_podgon [ $i ] . '"' ;
$i ++ ;
}
if ( $u -> info [ 'money2' ] > 0 && ! isset ( $_GET [ 'upgradelvlcom' ])) {
//Подгонка под комплект
$see = $u -> genInv ( 63 , '`iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" ' . $itmos . ')' );
} else {
//Подгонка под комплект
2023-12-01 21:05:11 +00:00
$see = $u -> genInv (
64 , '`iu`.`id` = "' . mysql_real_escape_string (
2023-12-05 01:01:04 +00:00
$_GET [ 'upgradelvlcom' ]
) . '" AND `iu`.`uid`="' . $u -> info [ 'id' ] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" ' . $itmos . ')'
2023-12-01 21:05:11 +00:00
);
2023-07-11 15:16:35 +00:00
}
$see = $see [ 2 ];
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
if ( $re != '' ) {
echo '<div align="right"><font color="red"><b>' . $re . '</b></font></div>' ;
} ?>
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
< style type = " text/css " >
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
. pH3 {
COLOR : #8f0000;
FONT - FAMILY : Arial ;
FONT - SIZE : 12 pt ;
FONT - WEIGHT : bold ;
}
2022-07-01 12:45:43 +00:00
2023-07-11 15:16:35 +00:00
. class_ {
font - weight : bold ;
color : #C5C5C5;
cursor : pointer ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
. class_st {
font - weight : bold ;
color : #659BA3;
cursor : pointer ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
. class__ {
font - weight : bold ;
color : #FFFFFF;
cursor : pointer ;
background - color : #659BA3;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
. class__st {
font - weight : bold ;
color : #FFFFFF;
cursor : pointer ;
background - color : #659BA3;
font - size : 10 px ;
}
2022-07-01 12:45:43 +00:00
2023-07-11 15:16:35 +00:00
. class_old {
font - weight : bold ;
color : #919191;
cursor : pointer ;
}
2022-06-11 11:32:31 +00:00
2023-07-11 15:16:35 +00:00
. class__old {
font - weight : bold ;
color : #FFFFFF;
cursor : pointer ;
background - color : #838383;
font - size : 10 px ;
}
td {
text - align : center ;
}
</ style >
< TABLE width = " 100% " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td valign = " top " >
< div align = " center " class = " pH3 " > Ремонтная мастерская </ div >
< ? php
echo '<b style="color:red">' . $error . '</b>' ;
?>
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td >
< table width = " 100% " border = " 0 " cellpadding = " 2 " cellspacing = " 0 " bgcolor = " d2d2d2 " >
< tr >
< td >< b >& nbsp ; & nbsp ; Залы :& nbsp ; </ b ></ td >
< td nowrap = " nowrap " align = " center " < ? php if ( $r == 1 ) {
echo 'bgcolor="#A5A5A5"' ;
} ?> > <?php if ($r == 1) {
echo '<b>Ремонт</b>' ;
} else {
echo '<a href="?r=1&rnd=' . $code . '">Ремонт</a>' ;
} ?>
</ td >
< td nowrap = " nowrap " align = " center " < ? php if ( $r == 2 ) {
echo 'bgcolor="#A5A5A5"' ;
} ?> > <?php if ($r == 2) {
echo '<b>Гравировка</b>' ;
} else {
echo '<a href="?r=2&rnd=' . $code . '">Гравировка</a>' ;
} ?>
</ td >
< td nowrap = " nowrap " align = " center " < ? php if ( $r == 3 ) {
echo 'bgcolor="#A5A5A5"' ;
} ?> > <?php if ($r == 3) {
echo '<b>Дезинтеграция</b>' ;
} else {
echo '<a href="?r=3&rnd=' . $code . '">Дезинтеграция</a>' ;
} ?>
</ td >
< td nowrap = " nowrap " align = " center " < ? php if ( $r == 4 ) {
echo 'bgcolor="#A5A5A5"' ;
} ?> > <?php if ($r == 4) {
echo '<b>Руны</b>' ;
} else {
echo '<a href="?r=4&rnd=' . $code . '">Руны</a>' ;
} ?>
</ td >
< td nowrap = " nowrap " align = " center " < ? php if ( $r == 5 ) {
echo 'bgcolor="#A5A5A5"' ;
} ?> > <?php if ($r == 5) {
echo '<b>Подгонка</b>' ;
} else {
echo '<a href="?r=5&rnd=' . $code . '">Подгонка</a>' ;
} ?>
</ td >
2023-12-05 01:01:04 +00:00
< td nowrap = " nowrap " style = " position: absolute; right: 290px; " >< ? = User :: getLogin ( $u -> info [ 'id' ]) ?> </td>
2023-07-11 15:16:35 +00:00
< td width = " 90% " >& nbsp ; </ td >
</ tr >
</ table >
2022-06-06 21:30:34 +00:00
</ td >
2023-07-11 15:16:35 +00:00
</ tr >
< tr >
< ? php
2023-07-31 17:06:51 +00:00
$rn = [
2023-07-11 15:16:35 +00:00
1 => 'Починка поврежденных предметов' ,
2 => 'Нанесение надписей на оружие (20 символов)' ,
3 => 'Разделение на состаные части улучшенных предметов' ,
4 => 'Извлечение рун' ,
5 => 'Подогнать броню' ,
6 => 'Улучшение модифицированных предметов' ,
7 => 'Модификация предметов' ,
8 => 'Улучшение уровня предмета' ,
2023-07-31 17:06:51 +00:00
9 => 'Подгонка предмета под комплект' ,
];
$rn2 = [
2023-07-11 15:16:35 +00:00
1 => 'У вас в рюкзаке нет поврежденных предметов' ,
2 => 'У вас в рюкзаке нет оружия, на которое можно нанести гравировку' ,
3 => 'У вас в рюкзаке нет улучшенных предметов' ,
4 => 'У вас в рюкзаке нет улучшенных предметов' ,
5 => 'У вас в рюкзаке нет подходящих предметов' ,
6 => 'У вас в рюкзаке нет подходящих предметов' ,
7 => 'У вас в рюкзаке нет подходящих предметов' ,
8 => 'У вас в рюкзаке нет подходящих предметов' ,
2023-07-31 17:06:51 +00:00
9 => 'У вас в рюкзаке нет подходящих предметов' ,
];
2023-07-11 15:16:35 +00:00
?>
< td bgcolor = " #A5A5A5 " >< small >< b >< ? = $rn [ $r ]; ?> </b></small></td>
</ tr >
< tr >
< td style = " border:1px solid #A5A5A5;padding:0px; " >
< ? php
2022-06-06 21:30:34 +00:00
2023-07-11 15:16:35 +00:00
if ( $r == 2 ) {
echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>Орден Света</b> предупреждает, что за нецензурные или оскорбительные надписи Вы будете наказаны.</i></div>' ;
} elseif ( $r == 8 ) {
echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>В с е усиления предмета (заточки, руны, чарки и т.д.) обнуляются без возможности возврата</i></div>' ;
} elseif ( $r == 5 ) {
echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>Внимание! Броня будет связана с вами общей судьбой!</i></div>' ;
} elseif ( $r == 3 ) {
echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>Внимание!</b> При дезинтеграция изымается свиток заточки, руны и зачарование сохраняется.</i></div>' ;
}
?>
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< ? php
if (( $r == 8 || $r == 9 ) && empty ( $u -> info [ 'money2' ])) {
//Улучшение предметов за кр.\екр.
echo 'Для улучшения некоторых предметов требуются екр.' ;
} else {
if ( $r == 9 && isset ( $_GET [ 'upgradelvlcom' ]) && $see != '' ) {
$itmu = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_users` WHERE `id` = "' . mysql_real_escape_string ( $_GET [ 'upgradelvlcom' ]) . '" LIMIT 1' ));
$itmm = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `items_main` WHERE `id` = "' . $itmu [ 'item_id' ] . '" LIMIT 1' ));
if ( $itmm [ 'price2' ] == 0 ) {
$itmm [ 'price2' ] = $itmm [ 'price1' ] / 5 ;
}
$sts = explode ( '|' , $itmu [ 'data' ]);
$i = 0 ;
$ste = '' ;
2023-07-31 17:06:51 +00:00
$sti = [];
2023-07-11 15:16:35 +00:00
while ( $i < count ( $sts )) {
$ste = explode ( '=' , $sts [ $i ]);
if ( isset ( $ste [ 1 ])) {
if ( ! isset ( $sti [ $ste [ 0 ]])) {
$sti [ $ste [ 0 ]] = 0 ;
}
$sti [ $ste [ 0 ]] += intval ( $ste [ 1 ]);
}
$i ++ ;
}
if ( isset ( $_POST [ 'com2' ], $_POST [ 'work2' ])) {
$epr = 0 ;
if ( $sti [ 'sudba' ] > 0 || $_POST [ 'work2' ] == '1' ) {
$wrk = 1 ;
$epr = round ( $itmm [ 'price2' ] * 0.2 , 2 );
} else {
$wrk = 2 ;
$epr = round ( $itmm [ 'price2' ] * 0.4 , 2 );
}
2023-07-31 17:06:51 +00:00
$sel = [];
2023-07-11 15:16:35 +00:00
$sp = mysql_query ( 'SELECT * FROM `complects`' );
while ( $pl = mysql_fetch_array ( $sp )) {
if ( ! isset ( $sel [ $pl [ 'com' ]]) && $com_podgon [ $pl [ 'name' ]] == true ) {
$sel [ $pl [ 'com' ]] = true ;
if ( $pl [ 'com' ] == $_POST [ 'com2' ]) {
$com2 = $pl ;
}
}
}
if ( $com2 [ 'com' ] > 0 && ( $sti [ 'complect' ] == $com2 [ 'com' ] || $sti [ 'complect2' ] == $com2 [ 'com' ])) {
$er2 = 'Предмет уже использует данный комплект.' ;
} elseif ( ! isset ( $com2 [ 'id' ])) {
$er2 = 'Вы не можете подогнать предмет под данный комплект.' ;
} elseif ( $epr > $u -> info [ 'money2' ]) {
$er2 = 'У вас недостаточно екр., требуется ' . $epr . ' екр.' ;
} else {
$sti [ 'complect2' ] = $com2 [ 'com' ];
if ( $wrk == 1 && ( $sti [ 'sudba' ] == '0' || ! isset ( $sti [ 'sudba' ]))) {
$sti [ 'sudba' ] = $u -> info [ 'login' ];
}
2023-08-14 15:15:05 +00:00
$sti_imp = Conversion :: arrayToDataString ( $sti );
2023-07-11 15:16:35 +00:00
$u -> addEkr ( - $epr );
mysql_query ( 'UPDATE `items_users` SET `data` = "' . mysql_real_escape_string ( $sti_imp ) . '" WHERE `id` = "' . $itmu [ 'id' ] . '" LIMIT 1' );
$er2 = 'Предмет "' . $itmm [ 'name' ] . '" успешно подогнан под "' . $com2 [ 'name' ] . '" за ' . $epr . ' екр.' ;
}
}
?>
< tr >
< td bgcolor = " #c4c4c4 " valign = " top " >
< table width = " 100% " border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >< ? = $see ?> </table>
</ td >
< td width = " 13 " valign = " middle " bgcolor = " #a4a6a4 " >< img src = " //img.new-combats.tech/imgr.jpg " width = " 13 " height = " 63 " ></ td >
< td width = " 300 " align = " left " valign = " middle " bgcolor = " #c4c4c4 " >
< div align = " left " style = " padding:10px; " >
< form method = " post " action = " main.php?r=9&upgradelvlcom=<?= $itmu['id'] ?> " >
< ? php
if ( isset ( $er2 )) {
echo '<font color=red>' . $er2 . '</font><hr>' ;
}
$html = '' ;
2023-07-31 17:06:51 +00:00
$sel = [];
2023-07-11 15:16:35 +00:00
$sp = mysql_query ( 'SELECT * FROM `complects`' );
while ( $pl = mysql_fetch_array ( $sp )) {
if ( ! isset ( $sel [ $pl [ 'com' ]]) && $com_podgon [ $pl [ 'name' ]] == true ) {
$sel [ $pl [ 'com' ]] = true ;
$html .= '<label><input type="radio" name="com2" value="' . $pl [ 'com' ] . '" />' . $pl [ 'name' ] . '</label><br>' ;
}
}
echo $html ;
?> <br/><br/>Тип работ:<br/>
< label >< input type = " radio " name = " work2 " value = " 1 " /> Личная < img src = " //img.new-combats.tech/i/desteny.gif "
title = " Предмет будет связан общей судьбой с вами " width = " 16 " height = " 18 " />
за < ? = round ( $itmm [ 'price2' ] * 0.2 , 2 ) ?> екр. </label><br>
< ? php if ( ! isset ( $sti [ 'sudba' ])) { ?>
< label >< input type = " radio " name = " work2 " value = " 2 " /> Общая за < ? = round ( $itmm [ 'price2' ] * 0.4 , 2 ) ?> екр. </label><br>
< ? php } ?>
< center >< br />< input type = " submit " value = " Подтвердить " class = " btnnew " /></ center >
</ form >
</ div >
</ td >
</ tr >
< ? php
} elseif ( $see == '' ) {
echo $rn2 [ $r ];
} else {
echo $see ;
}
}
?>
</ table >
</ td >
</ tr >
</ table >
< br />
< td width = " 280 " valign = " top " >
< TABLE cellspacing = " 0 " cellpadding = " 0 " >
< TD width = " 100% " >& nbsp ; </ TD >
< TD >
< table border = " 0 " cellpadding = " 0 " cellspacing = " 0 " >
< tr align = " right " valign = " top " >
< td >
<!-- -->
< ? = $goLis ; ?>
<!-- -->
< table border = " 0 " cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td nowrap = " nowrap " >
< table width = " 100% " border = " 0 " cellpadding = " 0 " cellspacing = " 1 " bgcolor = " #DEDEDE " >
< tr >
< td bgcolor = " #D3D3D3 " >< img src = " //img.new-combats.tech/i/move/links.gif " width = " 9 " height = " 7 " /></ td >
< td bgcolor = " #D3D3D3 " nowrap >< a href = " # " id = " greyText " class = " menutop " onclick = " location='main.php?loc=1.180.0.9&rnd=<?= $code ; ?>'; "
title = " <?php thisInfRm('1.180.0.9', 1); ?> " > Центральная Площадь </ a ></ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ td >
</ table >
</ td >
</ table >
< div >< br />
< div align = " right " >
< small >
М а с с а : < ? = $u -> aves [ 'now' ] ?> /<?= $u->aves['max'] ?> <br/>
У вас в наличии : < b style = " color:#339900; " >< ? = round ( $u -> info [ 'money' ], 2 ); ?> кр.</b> <br><br><br><br>
< b > < font color = red > Внимание ! </ font >< font color = darkgreen > Если у вас активирована бесплатная дезинтеграция " Рун " и " Заточек " , все равно при с е б е необходимо иметь сумму
стоимости дезинтеграции </ font ></ b >
</ small >
</ div >
< p >< small >
< ? php
if ( isset ( $re2 )) {
echo '<b style="color:red">' . $re2 . '</b>' ;
}
?>
</ small ></ p >
< p >
< br />< BR >
</ p >
</ div >
</ td >
</ table >
< br >
< div id = " textgo " style = " visibility:hidden; " ></ div >