diff --git a/_incl_data/class/Magic.php b/_incl_data/class/Magic.php index 60604f42..b65aba39 100644 --- a/_incl_data/class/Magic.php +++ b/_incl_data/class/Magic.php @@ -3,13 +3,14 @@ use Core\ConversionHelper; use Core\Db; use Insallah\Math; +use User\ItemsModel; class Magic { - public $youuse = 0; - public $c_magic = [4174, 4175, 4176, 4177, 4178, 4179, 4180]; - public $e_magic = [4185, 4186, 4187]; + public int $youuse = 0; + public array $cMagic = [4174, 4175, 4176, 4177, 4178, 4179, 4180]; + public array $eMagic = [4185, 4186, 4187]; public function __construct() { @@ -54,8 +55,8 @@ class Magic $itm['magic_chance'] = 99; } } - if (isset($bs_is['id']) && (in_array($itm['item_id'], $this->e_magic) || in_array( - $itm['item_id'], $this->c_magic + if (isset($bs_is['id']) && (in_array($itm['item_id'], $this->eMagic) || in_array( + $itm['item_id'], $this->cMagic ))) { $itm['magic_chance'] += $bs_is['users']; if ($itm['magic_chance'] >= 99) { @@ -155,14 +156,14 @@ class Magic if ($st['usefromfile'] == 1) { if ($u->info['battle'] > 0) { - if (file_exists('../../_incl_data/class/magic/' . $itm['magic_inci'] . '.php')) { - require('../../_incl_data/class/magic/' . $itm['magic_inci'] . '.php'); + if (file_exists('../../_incl_data/class/Magic/' . $itm['magic_inci'] . '.php')) { + require('../../_incl_data/class/Magic/' . $itm['magic_inci'] . '.php'); } else { $u->error = 'Не удалось использовать (' . $itm['magic_inci'] . '.b)'; } } else { - if (file_exists('_incl_data/class/magic/' . $itm['magic_inci'] . '.php')) { - require('_incl_data/class/magic/' . $itm['magic_inci'] . '.php'); + if (file_exists('_incl_data/class/Magic/' . $itm['magic_inci'] . '.php')) { + require('_incl_data/class/Magic/' . $itm['magic_inci'] . '.php'); } else { $u->error = 'Не удалось использовать (' . $itm['magic_inci'] . ')'; } @@ -271,8 +272,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd1 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' ); if ($upd1) { $goodUse = 1; @@ -282,8 +282,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd2 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' ); if ($upd1) { $goodUse = 1; @@ -501,9 +500,7 @@ class Magic $txt = 'Хитрый {u1} бросил кусок снега в {u2}. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']'; } mysql_query( - 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( - ) . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time( - ) . '","","","","","6")' + 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")' ); } @@ -693,8 +690,7 @@ class Magic mysql_query( 'INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ( - "' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time( - ) . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1" + "' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1" )' ); @@ -767,9 +763,7 @@ class Magic } } mysql_query( - 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( - ) . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time( - ) . '","","","","","6")' + 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")' ); } } @@ -854,8 +848,7 @@ class Magic mysql_query( 'INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ( - "' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time( - ) . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1" + "' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1" )' ); @@ -926,9 +919,7 @@ class Magic } } mysql_query( - 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( - ) . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time( - ) . '","","","","","6")' + 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")' ); } } @@ -1065,8 +1056,7 @@ class Magic $u->error = 'Вы уже один из лекарей'; } elseif ($lech_co >= $lech_aa[$type_lechenie]) { mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' ); $itm['iznosNOW']++; mysql_query( @@ -1090,8 +1080,7 @@ class Magic //mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1'); mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1' ); // сообщение в чат @@ -1121,8 +1110,7 @@ class Magic ( `id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x` ) VALUES ( - "335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time( - ) . '","' . $u->info['id'] . '","' . $type_lechenie . '","1" + "335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time() . '","' . $u->info['id'] . '","' . $type_lechenie . '","1" )' ); } @@ -1229,8 +1217,7 @@ class Magic $u->error = 'Вы уже один из лекарей'; } elseif ($lech_co >= $lech_aa[$type_lechenie]) { mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' ); $itm['iznosNOW']++; mysql_query( @@ -1243,8 +1230,7 @@ class Magic } mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1' ); // сообщение в чат @@ -1274,8 +1260,7 @@ class Magic ( `id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x` ) VALUES ( - "335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time( - ) . '","' . $u->info['id'] . '","' . $type_lechenie . '","1" + "335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time() . '","' . $u->info['id'] . '","' . $type_lechenie . '","1" )' ); } @@ -1376,8 +1361,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd1 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' ); if ($upd1) { $goodUse = 1; @@ -1387,8 +1371,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd2 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' ); if ($upd1) { $goodUse = 1; @@ -1513,8 +1496,7 @@ class Magic if ($itm['magic_inci'] == 'sanich2') { if ($u->info['battle'] == 0) { $sz = $u->testAction( - '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich2" AND `time` > ' . (time( - ) - 4 * 60 * 60) . ' LIMIT 1', 1 + '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich2" AND `time` > ' . (time() - 4 * 60 * 60) . ' LIMIT 1', 1 ); if (!isset($sz['id'])) { $slech = rand(0, 4); @@ -1592,8 +1574,7 @@ class Magic } elseif ($itm['magic_inci'] == 'sanich1' && $u->info['battle'] > 0) { $sz = $u->testAction( - '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich1" AND `time` > ' . (time( - ) - 6 * 60) . ' LIMIT 1', 1 + '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich1" AND `time` > ' . (time() - 6 * 60) . ' LIMIT 1', 1 ); if (!isset($sz['id'])) { $goodUse = 0; @@ -1628,8 +1609,7 @@ class Magic } elseif ($itm['magic_inci'] == 'sanich3' && $u->info['battle'] > 0) { $sz = $u->testAction( - '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich3" AND `time` > ' . (time( - ) - 3 * 60 * 60) . ' LIMIT 1', 1 + '`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich3" AND `time` > ' . (time() - 3 * 60 * 60) . ' LIMIT 1', 1 ); if (!isset($sz['id'])) { @@ -1688,8 +1668,7 @@ class Magic $u->error = 'У вас неизлечимая травма, вам помогут только боги или время.'; } elseif ($travm) { mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1' ); $itm['iznosNOW']++; mysql_query( @@ -1718,8 +1697,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd1 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"' ); if ($upd1) { $goodUse = 1; @@ -1729,8 +1707,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd2 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"' ); if ($upd1) { $goodUse = 1; @@ -1828,15 +1805,14 @@ class Magic $trnt .= $pl['login'] . ' Комната : ' . $rrm['name'] . ', '; } $trnt = rtrim($trnt, ', '); - $it_ = \User\ItemsModel::addItem( + $it_ = ItemsModel::addItem( 2435, $u->info['id'], 'noodet=1|noremont=1|sudba=' . $u->info['login'] . '' ); mysql_query( 'UPDATE `items_users` SET `use_text` = 500 WHERE `id` = "' . $it_ . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("' . $it_ . '","' . time( - ) . '","","' . mysql_real_escape_string( + 'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("' . $it_ . '","' . time() . '","","' . mysql_real_escape_string( $trnt ) . '","' . $u->info['city'] . '","1","1")' ); @@ -1860,8 +1836,7 @@ class Magic } else { // mysql_query( - 'INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time( - ) . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1")' + 'INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1")' ); // mysql_query( @@ -2023,8 +1998,7 @@ class Magic } if ($goodUse == 1) { mysql_query( - 'UPDATE `items_users` SET `lastUPD` = ' . time( - ) . ' WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1' + 'UPDATE `items_users` SET `lastUPD` = ' . time() . ' WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1' ); } } else { @@ -2055,8 +2029,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd1 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `id_eff` = "' . $eff['id2'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `id_eff` = "' . $eff['id2'] . '"' ); if ($upd1) { $goodUse = 1; @@ -2066,8 +2039,7 @@ class Magic //убираем прошлые эффекты $goodUse = 0; $upd2 = mysql_query( - 'UPDATE `eff_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `overType` = "' . $eff['overType'] . '"' + 'UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `overType` = "' . $eff['overType'] . '"' ); if ($upd2) { $goodUse = 1; @@ -2080,8 +2052,7 @@ class Magic $n = $eff['mname']; $d = $eff['mdata']; $ins = mysql_query( - 'INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time( - ) . '","' . $d . '","' . $eff['noAce'] . '")' + 'INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time() . '","' . $d . '","' . $eff['noAce'] . '")' ); if ($ins) { $g[0] = 1; @@ -2105,8 +2076,7 @@ class Magic ); $clan_test = mysql_fetch_array( mysql_query( - 'SELECT * FROM `clan_wars` WHERE ((`clan1`="' . $u->info['clan'] . '" AND `clan2`="' . $usr['clan'] . '") OR (`clan2`="' . $u->info['clan'] . '" AND `clan1`="' . $usr['clan'] . '")) AND `time_finish` > "' . time( - ) . '" LIMIT 1' + 'SELECT * FROM `clan_wars` WHERE ((`clan1`="' . $u->info['clan'] . '" AND `clan2`="' . $usr['clan'] . '") OR (`clan2`="' . $u->info['clan'] . '" AND `clan1`="' . $usr['clan'] . '")) AND `time_finish` > "' . time() . '" LIMIT 1' ) ); $good = 0; @@ -2174,8 +2144,7 @@ class Magic //effect ненападения if ($usr['no_ip'] == 'trupojor') { mysql_query( - 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time( - ) . '")' + 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time() . '")' ); } //тут клан вар @@ -2349,8 +2318,7 @@ class Magic $text = str_replace('{u2}', $usrreal, $text); mysql_query( 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "' . mysql_real_escape_string($text) . '", "' . time( - ) . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '", + "1", "' . mysql_real_escape_string($text) . '", "' . time() . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '", "' . round($bs['money'] * 0.85, 2) . '","' . $i . '")' ); unset($text, $usrreal, $mereal, $usr_real, $me_real); @@ -2371,8 +2339,7 @@ class Magic //effect ненападения if ($usr['no_ip'] == 'trupojor') { mysql_query( - 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time( - ) . '")' + 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time() . '")' ); } $upd = mysql_query('UPDATE `users` SET `battle`="' . $btl . '" WHERE `id` = "' . $uid1 . '" LIMIT 1'); @@ -2406,8 +2373,7 @@ class Magic //Духовность, спасение if ($uid1st['s7'] > 49) { mysql_query( - 'UPDATE `eff_users` SET `delete`="' . time( - ) . '" WHERE `uid` = "' . $uid1st['id'] . '" AND `overType` = 101 AND `delete` = 0' + 'UPDATE `eff_users` SET `delete`="' . time() . '" WHERE `uid` = "' . $uid1st['id'] . '" AND `overType` = 101 AND `delete` = 0' ); mysql_query( " @@ -2450,9 +2416,7 @@ class Magic $id_hod++; } mysql_query( - 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( - ) . '","' . $btl . '","' . ($id_hod) . '","{tm1} ' . $btxt . '","login1=' . $uid1st['login'] . '||t1=' . $uid1st['team'] . '||login2=' . $uid1st['login'] . '||t2=' . $uid1st['team'] . '||time1=' . time( - ) . '","","","","","6")' + 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $btl . '","' . ($id_hod) . '","{tm1} ' . $btxt . '","login1=' . $uid1st['login'] . '||t1=' . $uid1st['team'] . '||login2=' . $uid1st['login'] . '||t2=' . $uid1st['team'] . '||time1=' . time() . '","","","","","6")' ); } @@ -2477,8 +2441,7 @@ class Magic $tpa3 = [1 => 'Кошачья Ловкость', 2 => 'Интуиция Совы', 3 => 'Сила Стихий', 4 => 'Демоническая Сила', 5 => 'Друг', 6 => 'Полная Броня', 7 => 'Инферно']; mysql_query( - 'UPDATE `eff_users` SET `delete`="' . time( - ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `overType` = 100 AND `delete` = 0' + 'UPDATE `eff_users` SET `delete`="' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `overType` = 100 AND `delete` = 0' ); mysql_query( 'INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`,`user_use`) VALUES ("-1","201","summon_pet_' . $tpa[$a['type']] . '.gif",22,"' . $u->info['id'] . '","' . $tpa3[$a['type']] . ' [' . $a['level'] . ']","' . $anl . '","100","77","priem","' . $u->info['id'] . '")' @@ -2574,8 +2537,7 @@ class Magic $text = str_replace('{u2}', $usrreal, $text); mysql_query( 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "' . mysql_real_escape_string($text) . '", "' . time( - ) . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '", + "1", "' . mysql_real_escape_string($text) . '", "' . time() . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '", "' . round($bs['money'] * 0.85, 2) . '","' . $i . '")' ); unset($text, $usrreal, $mereal, $usr_real, $me_real); @@ -2587,7 +2549,7 @@ class Magic //Проверка травмы - private static function canAttack8Level($attacker, $target) + private static function canAttack8Level($attacker, $target): bool { $aSum = self::getDressedEkrTotalPrice($attacker); $tRange = Math::get20PercentRange(self::getDressedEkrTotalPrice($target)); @@ -2600,18 +2562,10 @@ class Magic return Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]); } - public function testTravma($uid, $vals) + public function testTravma(int $uid, $vals): bool { - $r = false; - $tr_pl = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $uid . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1' - ) - ); - if (isset($tr_pl['id']) && $tr_pl['v1'] >= $vals) { - $r = true; - } - return $r; + $v1 = Db::getValue('select v1 from eff_users where id_eff = 4 and uid = ? and `delete` = 0 and v1 >= ?', [$uid, $vals]); + return intval($v1) >= intval($vals); } //создаем нападение на персонажа @@ -2619,21 +2573,27 @@ class Magic public function inBattleLog($txt, $usr = null) { global $u; - $lastHOD = mysql_fetch_array( - mysql_query( - 'SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1' - ) - ); - if (isset($lastHOD['id'])) { - $id_hod = $lastHOD['id_hod']; - if ($lastHOD['type'] != 6) { - $id_hod++; - } - mysql_query( - 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( - ) . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time( - ) . '","","","","","6")' - ); + $lastHOD = Db::getRow('select id_hod, type from battle_logs where battle = ? order by id_hod desc limit 1', [$u->info['battle']]); + + if (!$lastHOD) { + return; } + + $idTurn = $lastHOD['id_hod']; + if ($lastHOD['type'] != 6) { + $idTurn++; + } + $sql = 'insert into battle_logs (time, battle, id_hod, text, vars, zona1, zonb1, zona2, zonb2, type) values (unix_timestamp(),?,?,?,?,?,?,?,?,6)'; + $args = [ + $u->info['battle'], + $idTurn, + $txt, + "login1={$u->info['login']}||t1={$u->info['team']}||login2={$usr['login']}||t2={$usr['team']}||time1=" . time(), + '', + '', + '', + '', + ]; + Db::sql($sql, $args); } } diff --git a/_incl_data/class/magic/396.php b/_incl_data/class/Magic/396.php similarity index 100% rename from _incl_data/class/magic/396.php rename to _incl_data/class/Magic/396.php diff --git a/_incl_data/class/magic/Elemental/Fire.php b/_incl_data/class/Magic/Elemental/Fire.php similarity index 99% rename from _incl_data/class/magic/Elemental/Fire.php rename to _incl_data/class/Magic/Elemental/Fire.php index 30532e0e..21205599 100644 --- a/_incl_data/class/magic/Elemental/Fire.php +++ b/_incl_data/class/Magic/Elemental/Fire.php @@ -11,6 +11,7 @@ class Fire private $color = '#a00'; private $colorCrit = '#f00'; private $colorMiss = '#909090'; + public function __construct(Battle $btl) { $this->btl = $btl; diff --git a/_incl_data/class/magic/addmoney.php b/_incl_data/class/Magic/addmoney.php similarity index 100% rename from _incl_data/class/magic/addmoney.php rename to _incl_data/class/Magic/addmoney.php diff --git a/_incl_data/class/magic/addrep.php b/_incl_data/class/Magic/addrep.php similarity index 100% rename from _incl_data/class/magic/addrep.php rename to _incl_data/class/Magic/addrep.php diff --git a/_incl_data/class/magic/addsnowball.php b/_incl_data/class/Magic/addsnowball.php similarity index 100% rename from _incl_data/class/magic/addsnowball.php rename to _incl_data/class/Magic/addsnowball.php diff --git a/_incl_data/class/magic/align0.php b/_incl_data/class/Magic/align0.php similarity index 100% rename from _incl_data/class/magic/align0.php rename to _incl_data/class/Magic/align0.php diff --git a/_incl_data/class/magic/align1.php b/_incl_data/class/Magic/align1.php similarity index 100% rename from _incl_data/class/magic/align1.php rename to _incl_data/class/Magic/align1.php diff --git a/_incl_data/class/magic/align3.php b/_incl_data/class/Magic/align3.php similarity index 100% rename from _incl_data/class/magic/align3.php rename to _incl_data/class/Magic/align3.php diff --git a/_incl_data/class/magic/align7.php b/_incl_data/class/Magic/align7.php similarity index 100% rename from _incl_data/class/magic/align7.php rename to _incl_data/class/Magic/align7.php diff --git a/_incl_data/class/magic/aniname.php b/_incl_data/class/Magic/aniname.php similarity index 100% rename from _incl_data/class/magic/aniname.php rename to _incl_data/class/Magic/aniname.php diff --git a/_incl_data/class/magic/anti_yad.php b/_incl_data/class/Magic/anti_yad.php similarity index 100% rename from _incl_data/class/magic/anti_yad.php rename to _incl_data/class/Magic/anti_yad.php diff --git a/_incl_data/class/magic/antidot.php b/_incl_data/class/Magic/antidot.php similarity index 100% rename from _incl_data/class/magic/antidot.php rename to _incl_data/class/Magic/antidot.php diff --git a/_incl_data/class/magic/antipropuskpsh.php b/_incl_data/class/Magic/antipropuskpsh.php similarity index 100% rename from _incl_data/class/magic/antipropuskpsh.php rename to _incl_data/class/Magic/antipropuskpsh.php diff --git a/_incl_data/class/magic/arhmoney.php b/_incl_data/class/Magic/arhmoney.php similarity index 100% rename from _incl_data/class/magic/arhmoney.php rename to _incl_data/class/Magic/arhmoney.php diff --git a/_incl_data/class/magic/berezka_tactic.php b/_incl_data/class/Magic/berezka_tactic.php similarity index 100% rename from _incl_data/class/magic/berezka_tactic.php rename to _incl_data/class/Magic/berezka_tactic.php diff --git a/_incl_data/class/magic/chains.php b/_incl_data/class/Magic/chains.php similarity index 100% rename from _incl_data/class/magic/chains.php rename to _incl_data/class/Magic/chains.php diff --git a/_incl_data/class/magic/clan_delay.php b/_incl_data/class/Magic/clan_delay.php similarity index 100% rename from _incl_data/class/magic/clan_delay.php rename to _incl_data/class/Magic/clan_delay.php diff --git a/_incl_data/class/magic/clan_exp1000.php b/_incl_data/class/Magic/clan_exp1000.php similarity index 100% rename from _incl_data/class/magic/clan_exp1000.php rename to _incl_data/class/Magic/clan_exp1000.php diff --git a/_incl_data/class/magic/clan_exp2500.php b/_incl_data/class/Magic/clan_exp2500.php similarity index 100% rename from _incl_data/class/magic/clan_exp2500.php rename to _incl_data/class/Magic/clan_exp2500.php diff --git a/_incl_data/class/magic/clan_exp500.php b/_incl_data/class/Magic/clan_exp500.php similarity index 100% rename from _incl_data/class/magic/clan_exp500.php rename to _incl_data/class/Magic/clan_exp500.php diff --git a/_incl_data/class/magic/clan_exp5000.php b/_incl_data/class/Magic/clan_exp5000.php similarity index 100% rename from _incl_data/class/magic/clan_exp5000.php rename to _incl_data/class/Magic/clan_exp5000.php diff --git a/_incl_data/class/magic/del_nas.php b/_incl_data/class/Magic/del_nas.php similarity index 100% rename from _incl_data/class/magic/del_nas.php rename to _incl_data/class/Magic/del_nas.php diff --git a/_incl_data/class/magic/dispell.php b/_incl_data/class/Magic/dispell.php similarity index 100% rename from _incl_data/class/magic/dispell.php rename to _incl_data/class/Magic/dispell.php diff --git a/_incl_data/class/magic/enternizin.php b/_incl_data/class/Magic/enternizin.php similarity index 100% rename from _incl_data/class/magic/enternizin.php rename to _incl_data/class/Magic/enternizin.php diff --git a/_incl_data/class/magic/esfer.php b/_incl_data/class/Magic/esfer.php similarity index 100% rename from _incl_data/class/magic/esfer.php rename to _incl_data/class/Magic/esfer.php diff --git a/_incl_data/class/magic/exitbtl.php b/_incl_data/class/Magic/exitbtl.php similarity index 100% rename from _incl_data/class/magic/exitbtl.php rename to _incl_data/class/Magic/exitbtl.php diff --git a/_incl_data/class/magic/feerverks.php b/_incl_data/class/Magic/feerverks.php similarity index 96% rename from _incl_data/class/magic/feerverks.php rename to _incl_data/class/Magic/feerverks.php index 49c34a9d..3d1459f9 100644 --- a/_incl_data/class/magic/feerverks.php +++ b/_incl_data/class/Magic/feerverks.php @@ -26,8 +26,7 @@ if ($u->room['id'] != '9') { $fid = $po['feerverk_eff']; } mysql_query( - 'INSERT INTO `feerverks` (`room`,`uid`,`time`,`fid`) VALUES ("' . $u->info['room'] . '","' . $u->info['id'] . '","' . time( - ) . '","' . $fid . '")' + 'INSERT INTO `feerverks` (`room`,`uid`,`time`,`fid`) VALUES ("' . $u->info['room'] . '","' . $u->info['id'] . '","' . time() . '","' . $fid . '")' ); // $a = $u->info['sex'] == 1 ? 'a' : ''; //окончание рода М\Ж в словах @@ -45,8 +44,7 @@ if ($u->room['id'] != '9') { // У персонажа легкая травма - "Ожог от фейерверка" еще 3 мин. 43 сек. // 22.02.14 21:14 лосенка пострадала от фейерверка! :fingal: $spf = mysql_query( - 'SELECT `id`,`login`,`sex` FROM `users` WHERE `online` > "' . (time( - ) - 120) . '" AND `invis` = 0 AND `battle` = 0 AND `room` = "' . $u->info['room'] . '" ORDER BY `online` DESC LIMIT 100' + 'SELECT `id`,`login`,`sex` FROM `users` WHERE `online` > "' . (time() - 120) . '" AND `invis` = 0 AND `battle` = 0 AND `room` = "' . $u->info['room'] . '" ORDER BY `online` DESC LIMIT 100' ); $fusr = []; while ($plf = mysql_fetch_array($spf)) { diff --git a/_incl_data/class/magic/hny2012.php b/_incl_data/class/Magic/hny2012.php similarity index 100% rename from _incl_data/class/magic/hny2012.php rename to _incl_data/class/Magic/hny2012.php diff --git a/_incl_data/class/magic/hny2014.php b/_incl_data/class/Magic/hny2014.php similarity index 100% rename from _incl_data/class/magic/hny2014.php rename to _incl_data/class/Magic/hny2014.php diff --git a/_incl_data/class/magic/imposed_spell_01.php b/_incl_data/class/Magic/imposed_spell_01.php similarity index 100% rename from _incl_data/class/magic/imposed_spell_01.php rename to _incl_data/class/Magic/imposed_spell_01.php diff --git a/_incl_data/class/magic/ironbad.php b/_incl_data/class/Magic/ironbad.php similarity index 100% rename from _incl_data/class/magic/ironbad.php rename to _incl_data/class/Magic/ironbad.php diff --git a/_incl_data/class/magic/irongod.php b/_incl_data/class/Magic/irongod.php similarity index 100% rename from _incl_data/class/magic/irongod.php rename to _incl_data/class/Magic/irongod.php diff --git a/_incl_data/class/magic/ironnorm.php b/_incl_data/class/Magic/ironnorm.php similarity index 100% rename from _incl_data/class/magic/ironnorm.php rename to _incl_data/class/Magic/ironnorm.php diff --git a/_incl_data/class/magic/metka.php b/_incl_data/class/Magic/metka.php similarity index 100% rename from _incl_data/class/magic/metka.php rename to _incl_data/class/Magic/metka.php diff --git a/_incl_data/class/magic/nextuplvl.php b/_incl_data/class/Magic/nextuplvl.php similarity index 100% rename from _incl_data/class/magic/nextuplvl.php rename to _incl_data/class/Magic/nextuplvl.php diff --git a/_incl_data/class/magic/noose.php b/_incl_data/class/Magic/noose.php similarity index 100% rename from _incl_data/class/magic/noose.php rename to _incl_data/class/Magic/noose.php diff --git a/_incl_data/class/magic/off_hpVinos.php b/_incl_data/class/Magic/off_hpVinos.php similarity index 100% rename from _incl_data/class/magic/off_hpVinos.php rename to _incl_data/class/Magic/off_hpVinos.php diff --git a/_incl_data/class/magic/off_is.php b/_incl_data/class/Magic/off_is.php similarity index 100% rename from _incl_data/class/magic/off_is.php rename to _incl_data/class/Magic/off_is.php diff --git a/_incl_data/class/magic/off_s1.php b/_incl_data/class/Magic/off_s1.php similarity index 100% rename from _incl_data/class/magic/off_s1.php rename to _incl_data/class/Magic/off_s1.php diff --git a/_incl_data/class/magic/off_s2.php b/_incl_data/class/Magic/off_s2.php similarity index 100% rename from _incl_data/class/magic/off_s2.php rename to _incl_data/class/Magic/off_s2.php diff --git a/_incl_data/class/magic/off_s3.php b/_incl_data/class/Magic/off_s3.php similarity index 100% rename from _incl_data/class/magic/off_s3.php rename to _incl_data/class/Magic/off_s3.php diff --git a/_incl_data/class/magic/off_s5.php b/_incl_data/class/Magic/off_s5.php similarity index 100% rename from _incl_data/class/magic/off_s5.php rename to _incl_data/class/Magic/off_s5.php diff --git a/_incl_data/class/magic/off_zs35.php b/_incl_data/class/Magic/off_zs35.php similarity index 100% rename from _incl_data/class/magic/off_zs35.php rename to _incl_data/class/Magic/off_zs35.php diff --git a/_incl_data/class/magic/p_gusenic.php b/_incl_data/class/Magic/p_gusenic.php similarity index 100% rename from _incl_data/class/magic/p_gusenic.php rename to _incl_data/class/Magic/p_gusenic.php diff --git a/_incl_data/class/magic/pandorax.php b/_incl_data/class/Magic/pandorax.php similarity index 100% rename from _incl_data/class/magic/pandorax.php rename to _incl_data/class/Magic/pandorax.php diff --git a/_incl_data/class/magic/pirogi2.php b/_incl_data/class/Magic/pirogi2.php similarity index 100% rename from _incl_data/class/magic/pirogi2.php rename to _incl_data/class/Magic/pirogi2.php diff --git a/_incl_data/class/magic/platie.php b/_incl_data/class/Magic/platie.php similarity index 100% rename from _incl_data/class/magic/platie.php rename to _incl_data/class/Magic/platie.php diff --git a/_incl_data/class/magic/podvig.php b/_incl_data/class/Magic/podvig.php similarity index 100% rename from _incl_data/class/magic/podvig.php rename to _incl_data/class/Magic/podvig.php diff --git a/_incl_data/class/magic/predl.php b/_incl_data/class/Magic/predl.php similarity index 100% rename from _incl_data/class/magic/predl.php rename to _incl_data/class/Magic/predl.php diff --git a/_incl_data/class/magic/propuskpsh.php b/_incl_data/class/Magic/propuskpsh.php similarity index 100% rename from _incl_data/class/magic/propuskpsh.php rename to _incl_data/class/Magic/propuskpsh.php diff --git a/_incl_data/class/magic/propuskpsh2.php b/_incl_data/class/Magic/propuskpsh2.php similarity index 100% rename from _incl_data/class/magic/propuskpsh2.php rename to _incl_data/class/Magic/propuskpsh2.php diff --git a/_incl_data/class/magic/ruletka.php b/_incl_data/class/Magic/ruletka.php similarity index 100% rename from _incl_data/class/magic/ruletka.php rename to _incl_data/class/Magic/ruletka.php diff --git a/_incl_data/class/magic/sanich.php b/_incl_data/class/Magic/sanich.php similarity index 100% rename from _incl_data/class/magic/sanich.php rename to _incl_data/class/Magic/sanich.php diff --git a/_incl_data/class/magic/secondshans.php b/_incl_data/class/Magic/secondshans.php similarity index 100% rename from _incl_data/class/magic/secondshans.php rename to _incl_data/class/Magic/secondshans.php diff --git a/_incl_data/class/magic/spell_hram100.php b/_incl_data/class/Magic/spell_hram100.php similarity index 100% rename from _incl_data/class/magic/spell_hram100.php rename to _incl_data/class/Magic/spell_hram100.php diff --git a/_incl_data/class/magic/sun_per_kr.php b/_incl_data/class/Magic/sun_per_kr.php similarity index 100% rename from _incl_data/class/magic/sun_per_kr.php rename to _incl_data/class/Magic/sun_per_kr.php diff --git a/_incl_data/class/magic/sun_per_kruv.php b/_incl_data/class/Magic/sun_per_kruv.php similarity index 100% rename from _incl_data/class/magic/sun_per_kruv.php rename to _incl_data/class/Magic/sun_per_kruv.php diff --git a/_incl_data/class/magic/sun_per_ogn.php b/_incl_data/class/Magic/sun_per_ogn.php similarity index 100% rename from _incl_data/class/magic/sun_per_ogn.php rename to _incl_data/class/Magic/sun_per_ogn.php diff --git a/_incl_data/class/magic/sun_per_tk.php b/_incl_data/class/Magic/sun_per_tk.php similarity index 100% rename from _incl_data/class/magic/sun_per_tk.php rename to _incl_data/class/Magic/sun_per_tk.php diff --git a/_incl_data/class/magic/sun_per_tp.php b/_incl_data/class/Magic/sun_per_tp.php similarity index 100% rename from _incl_data/class/magic/sun_per_tp.php rename to _incl_data/class/Magic/sun_per_tp.php diff --git a/_incl_data/class/magic/sun_per_uv.php b/_incl_data/class/Magic/sun_per_uv.php similarity index 100% rename from _incl_data/class/magic/sun_per_uv.php rename to _incl_data/class/Magic/sun_per_uv.php diff --git a/_incl_data/class/magic/sun_per_vod.php b/_incl_data/class/Magic/sun_per_vod.php similarity index 100% rename from _incl_data/class/magic/sun_per_vod.php rename to _incl_data/class/Magic/sun_per_vod.php diff --git a/_incl_data/class/magic/sun_per_voz.php b/_incl_data/class/Magic/sun_per_voz.php similarity index 100% rename from _incl_data/class/magic/sun_per_voz.php rename to _incl_data/class/Magic/sun_per_voz.php diff --git a/_incl_data/class/magic/sun_per_zem.php b/_incl_data/class/Magic/sun_per_zem.php similarity index 100% rename from _incl_data/class/magic/sun_per_zem.php rename to _incl_data/class/Magic/sun_per_zem.php diff --git a/_incl_data/class/magic/sunduk.php b/_incl_data/class/Magic/sunduk.php similarity index 100% rename from _incl_data/class/magic/sunduk.php rename to _incl_data/class/Magic/sunduk.php diff --git a/_incl_data/class/magic/sunduk_50.php b/_incl_data/class/Magic/sunduk_50.php similarity index 100% rename from _incl_data/class/magic/sunduk_50.php rename to _incl_data/class/Magic/sunduk_50.php diff --git a/_incl_data/class/magic/sunduk_78.php b/_incl_data/class/Magic/sunduk_78.php similarity index 100% rename from _incl_data/class/magic/sunduk_78.php rename to _incl_data/class/Magic/sunduk_78.php diff --git a/_incl_data/class/magic/sunduk_79.php b/_incl_data/class/Magic/sunduk_79.php similarity index 100% rename from _incl_data/class/magic/sunduk_79.php rename to _incl_data/class/Magic/sunduk_79.php diff --git a/_incl_data/class/magic/sunduk_80.php b/_incl_data/class/Magic/sunduk_80.php similarity index 100% rename from _incl_data/class/magic/sunduk_80.php rename to _incl_data/class/Magic/sunduk_80.php diff --git a/_incl_data/class/magic/sunduk_81.php b/_incl_data/class/Magic/sunduk_81.php similarity index 100% rename from _incl_data/class/magic/sunduk_81.php rename to _incl_data/class/Magic/sunduk_81.php diff --git a/_incl_data/class/magic/sunduk_82.php b/_incl_data/class/Magic/sunduk_82.php similarity index 100% rename from _incl_data/class/magic/sunduk_82.php rename to _incl_data/class/Magic/sunduk_82.php diff --git a/_incl_data/class/magic/sunduk_91.php b/_incl_data/class/Magic/sunduk_91.php similarity index 100% rename from _incl_data/class/magic/sunduk_91.php rename to _incl_data/class/Magic/sunduk_91.php diff --git a/_incl_data/class/magic/sunduk_92.php b/_incl_data/class/Magic/sunduk_92.php similarity index 100% rename from _incl_data/class/magic/sunduk_92.php rename to _incl_data/class/Magic/sunduk_92.php diff --git a/_incl_data/class/magic/sunduk_93.php b/_incl_data/class/Magic/sunduk_93.php similarity index 100% rename from _incl_data/class/magic/sunduk_93.php rename to _incl_data/class/Magic/sunduk_93.php diff --git a/_incl_data/class/magic/sunduk_bd.php b/_incl_data/class/Magic/sunduk_bd.php similarity index 100% rename from _incl_data/class/magic/sunduk_bd.php rename to _incl_data/class/Magic/sunduk_bd.php diff --git a/_incl_data/class/magic/sunduk_new.php b/_incl_data/class/Magic/sunduk_new.php similarity index 100% rename from _incl_data/class/magic/sunduk_new.php rename to _incl_data/class/Magic/sunduk_new.php diff --git a/_incl_data/class/magic/sunduk_ov.php b/_incl_data/class/Magic/sunduk_ov.php similarity index 100% rename from _incl_data/class/magic/sunduk_ov.php rename to _incl_data/class/Magic/sunduk_ov.php diff --git a/_incl_data/class/magic/sunduk_ov2.php b/_incl_data/class/Magic/sunduk_ov2.php similarity index 100% rename from _incl_data/class/magic/sunduk_ov2.php rename to _incl_data/class/Magic/sunduk_ov2.php diff --git a/_incl_data/class/magic/sunduk_ov3.php b/_incl_data/class/Magic/sunduk_ov3.php similarity index 100% rename from _incl_data/class/magic/sunduk_ov3.php rename to _incl_data/class/Magic/sunduk_ov3.php diff --git a/_incl_data/class/magic/svet_elik.php b/_incl_data/class/Magic/svet_elik.php similarity index 100% rename from _incl_data/class/magic/svet_elik.php rename to _incl_data/class/Magic/svet_elik.php diff --git a/_incl_data/class/magic/tankkom.php b/_incl_data/class/Magic/tankkom.php similarity index 100% rename from _incl_data/class/magic/tankkom.php rename to _incl_data/class/Magic/tankkom.php diff --git a/_incl_data/class/magic/toms.php b/_incl_data/class/Magic/toms.php similarity index 100% rename from _incl_data/class/magic/toms.php rename to _incl_data/class/Magic/toms.php diff --git a/_incl_data/class/magic/toporkom.php b/_incl_data/class/Magic/toporkom.php similarity index 100% rename from _incl_data/class/magic/toporkom.php rename to _incl_data/class/Magic/toporkom.php diff --git a/_incl_data/class/magic/trap.php b/_incl_data/class/Magic/trap.php similarity index 100% rename from _incl_data/class/magic/trap.php rename to _incl_data/class/Magic/trap.php diff --git a/_incl_data/class/magic/tznanie.php b/_incl_data/class/Magic/tznanie.php similarity index 100% rename from _incl_data/class/magic/tznanie.php rename to _incl_data/class/Magic/tznanie.php diff --git a/_incl_data/class/magic/un_metka.php b/_incl_data/class/Magic/un_metka.php similarity index 100% rename from _incl_data/class/magic/un_metka.php rename to _incl_data/class/Magic/un_metka.php diff --git a/_incl_data/class/magic/undie.php b/_incl_data/class/Magic/undie.php similarity index 100% rename from _incl_data/class/magic/undie.php rename to _incl_data/class/Magic/undie.php diff --git a/_incl_data/class/magic/upexp.php b/_incl_data/class/Magic/upexp.php similarity index 100% rename from _incl_data/class/magic/upexp.php rename to _incl_data/class/Magic/upexp.php diff --git a/_incl_data/class/magic/usevampir.php b/_incl_data/class/Magic/usevampir.php similarity index 100% rename from _incl_data/class/magic/usevampir.php rename to _incl_data/class/Magic/usevampir.php diff --git a/_incl_data/class/magic/uvortkom.php b/_incl_data/class/Magic/uvortkom.php similarity index 100% rename from _incl_data/class/magic/uvortkom.php rename to _incl_data/class/Magic/uvortkom.php diff --git a/_incl_data/class/magic/yarostzvezd.php b/_incl_data/class/Magic/yarostzvezd.php similarity index 100% rename from _incl_data/class/magic/yarostzvezd.php rename to _incl_data/class/Magic/yarostzvezd.php diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index 60550904..8fb77c92 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -2765,8 +2765,8 @@ class User if ($upd) { $po = ConversionHelper::dataStringToArray($e['data']); if (isset($po['finish_file'])) { - if (file_exists('_incl_data/class/magic/' . $po['finish_file'] . '.php')) { - require('_incl_data/class/magic/' . $po['finish_file'] . '.php'); + if (file_exists('_incl_data/class/Magic/' . $po['finish_file'] . '.php')) { + require('_incl_data/class/Magic/' . $po['finish_file'] . '.php'); } else { $this->error2 = '!File not exists "cgi-bin/magic.pl?use_' . $po['finish_file'] . '".'; } @@ -4641,7 +4641,6 @@ class User * @param $nosudba * @param $plavka * @return int|mixed|string - * @deprecated use ItemsModel::addItem() */ public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) { @@ -4658,6 +4657,7 @@ class User * @param $nosudba * @param $plavka * @return int|mixed|string + * @deprecated use ItemsModel::addItem() */ public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) { @@ -7464,7 +7464,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` return $r; } - public function shopSaleM($val, $itm): float + private function shopSaleM($val, $itm): float { $procs = [ 0, //0 @@ -7509,7 +7509,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` return round(($val / 100 * (100 - $proc)), 2); } - private function shopSaleM($val, $itm): float + public function shopSaleM($val, $itm): float { $procs = [ 0, //0 @@ -9080,8 +9080,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` 'UPDATE `items_users` SET `lastUPD` = "' . time() . '",`inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' ); } - if (file_exists('_incl_data/class/magic/' . $tr['items_in_file'] . '.php')) { - require('_incl_data/class/magic/' . $tr['items_in_file'] . '.php'); + if (file_exists('_incl_data/class/Magic/' . $tr['items_in_file'] . '.php')) { + require('_incl_data/class/Magic/' . $tr['items_in_file'] . '.php'); if (!isset($no_open_itm)) { $this->deleteItem($itm['id'], $this->info['id']); $this->error = 'Вы успешно открыли "' . $itm['name'] . '":
' . $io . '...'; @@ -9930,6 +9930,11 @@ LIMIT 1' //получаем уровень + public function addEkr($amount) + { + Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $this->info['id']]); + } + public function addEkr($amount, $uid = 0) { if ($uid === 0) { @@ -9938,11 +9943,6 @@ LIMIT 1' Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $uid]); } - public function addEkr($amount) - { - Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $this->info['id']]); - } - public function r2($v): string { return number_format($v, 2, '.', ' ');