removed deprecated mysql_result().
This commit is contained in:
parent
afde0b1380
commit
e5e614d1d7
@ -1,58 +1,54 @@
|
||||
<?php
|
||||
|
||||
use User\ItemsModel;
|
||||
|
||||
if (isset($s[1]) && $s[1] == '12/fontan3') {
|
||||
//Все переменные сохранять в массиве $vad !
|
||||
$vad = array(
|
||||
'go' => false
|
||||
);
|
||||
$vad = [
|
||||
'go' => false,
|
||||
];
|
||||
|
||||
// Требуется добавить проверку Не больше 2 игроков из группы.
|
||||
|
||||
$vad['use_fontan'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "use_fontan" AND `vals` = "3" LIMIT 1')); // Проверка на использованее ранее.
|
||||
if(!isset($vad['use_fontan']['id'])) {
|
||||
if (isset($vad['use_fontan']['id'])) {
|
||||
$r = 'Мне кажется, что здесь я уже был' . ($u->info['sex'] == 1 ? 'а' : '') . '..';
|
||||
} else {
|
||||
$vad['all_uses'] = mysql_num_rows(mysql_query('SELECT * FROM `dungeon_actions` WHERE `dn` = "' . $u->info['dnow'] . '" AND `vars` = "use_fontan" AND `vals` = "3" LIMIT 5'));
|
||||
if ($vad['all_uses'] >= 2) {
|
||||
$r = 'Ничего не осталось, кто-то побывал здесь раньше.';
|
||||
} else {
|
||||
$vad['kill_monsters'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE ((`id_bot` = "370" && `x` = "-2" && `y` = "31") OR (`id_bot` = "374" && `x` = "-2" && `y` = "31") OR (`id_bot` = "375" && `x` = "-3" && `y` = "32") OR (`id_bot` = "375" && `x` = "-3" && `y` = "32") OR (`id_bot` = "373" && `x` = "-1" && `y` = "32") OR (`id_bot` = "373" && `x` = "-3" && `y` = "32") OR (`id_bot` = "373" && `x` = "-3" && `y` = "31")) AND `delete` = "0" AND `dn` = "' . $u->info['dnow'] . '" AND `for_dn` = "0" LIMIT 10')); //Проверяем убита ли группа монстров
|
||||
if( !isset($vad['kill_monsters']['0']['id2']) ) {
|
||||
if (isset($vad['kill_monsters']['0']['id2'])) {
|
||||
$r = 'Вы уверены что убили всю группу монстров?';
|
||||
} else {
|
||||
$vad['bt'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "2" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
|
||||
if( isset($vad['bt']['id']) ) {
|
||||
//if( $vad['bt']['inGroup'] > 0 ) {
|
||||
// $r = 'Предмет не должен находиться в группе';
|
||||
//}else{
|
||||
if (!isset($vad['bt']['id'])) {
|
||||
$r = 'У вас нет пустой бутылки.';
|
||||
} else {
|
||||
// Выбираем камни
|
||||
$vad['gems']['query'] = mysql_query('SELECT `id`,`inGroup` FROM `items_users` WHERE (`item_id` = "908" OR `item_id` = "906" OR `item_id` = "907" OR `item_id` = "881" OR `item_id` = "878" OR `item_id` = "888") AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 99');
|
||||
$vad['gems']['query'] = mysql_fetch_array(mysql_query('SELECT `id`,`inGroup` FROM `items_users` WHERE (`item_id` = "908" OR `item_id` = "906" OR `item_id` = "907" OR `item_id` = "881" OR `item_id` = "878" OR `item_id` = "888") AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" order by rand() limit 1'));
|
||||
// Выбираем рандомный камень из...
|
||||
$vad['gems']['query'] = mysql_result($vad['gems']['query'], (rand(0, (mysql_num_rows($vad['gems']['query'])-1))),0);
|
||||
$vad['gems']['query'] = $vad['gems']['query']['id'];
|
||||
|
||||
if ($vad['gems']['query'] != "") {
|
||||
$vad['go'] = true;
|
||||
} else {
|
||||
$r = 'Что-то пошло не так, необходим драгоценный камень...';
|
||||
}
|
||||
//}
|
||||
} else {
|
||||
$r = 'У вас нет пустой бутылки.';
|
||||
}
|
||||
} else {
|
||||
$r = 'Вы уверены что убили всю группу монстров?';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if($u->info['sex']==1)$a='а'; else $a='';
|
||||
$r = 'Мне кажется, что здесь я уже был'.$a.'..';
|
||||
}
|
||||
}
|
||||
|
||||
if( $vad['go'] == true ) {
|
||||
|
||||
if ($vad['go']) {
|
||||
mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( "' . $u->info['id'] . '","' . $u->info['dnow'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","' . time() . '", "use_fontan","3" )'); // Выпили раз, вот и хватит с вас!
|
||||
$r = 'Опустив пустую бутылку в фонтан вы наполнили её.';
|
||||
|
||||
mysql_query('DELETE FROM `items_users` WHERE `id` = "' . mysql_real_escape_string(intval($vad['gems']['query'])) . '" LIMIT 1');
|
||||
mysql_query('DELETE FROM `items_users` WHERE `id` = "' . mysql_real_escape_string(intval($vad['bt']['id'])) . '" LIMIT 1');
|
||||
|
||||
\User\ItemsModel::addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Великое зелье Отрицания 1188
|
||||
ItemsModel::addItem(round(1188), $u->info['id'], '|musor=2|noremont=1|nosale=1', 12, 3); // Великое зелье Отрицания 1188
|
||||
}
|
||||
unset($vad);
|
||||
}
|
||||
?>
|
@ -1,45 +1,42 @@
|
||||
<?php
|
||||
|
||||
use User\ItemsModel;
|
||||
|
||||
if (isset($s[1]) && $s[1] == '12/fontan4') {
|
||||
$vad = array('go' => false);
|
||||
$vad = ['go' => false];
|
||||
$vad['use_fontan'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "use_fontan" AND `vals` = "4" LIMIT 1'));
|
||||
if(!isset($vad['use_fontan']['id'])) {
|
||||
if (isset($vad['use_fontan']['id'])) {
|
||||
$r = 'Мне кажется, что здесь я уже был' . ($u->info['sex'] == 1 ? 'а' : '') . '..';
|
||||
} else {
|
||||
$vad['all_uses'] = mysql_num_rows(mysql_query('SELECT * FROM `dungeon_actions` WHERE `dn` = "' . $u->info['dnow'] . '" AND `vars` = "use_fontan" AND `vals` = "4" LIMIT 5'));
|
||||
if ($vad['all_uses'] >= 3) {
|
||||
$r = 'Ничего не осталось, кто-то побывал здесь раньше.';
|
||||
} else {
|
||||
$vad['kill_monsters'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE ((`id_bot` = "121" && `x` = "-5" && `y` = "30") OR (`id_bot` = "118" && `x` = "-6" && `y` = "30") OR (`id_bot` = "114" && `x` = "-5" && `y` = "29") OR (`id_bot` = "112" && `x` = "-7" && `y` = "29") OR (`id_bot` = "122" && `x` = "-7" && `y` = "30")) AND `delete` = "0" AND `dn` = "' . $u->info['dnow'] . '" AND `for_dn` = "0" LIMIT 10'));
|
||||
if(!isset($vad['kill_monsters']['id2'])) {
|
||||
$vad['bottle'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "2" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" ORDER BY `id` DESC LIMIT 1'));
|
||||
if(isset($vad['bottle']['id'])) {
|
||||
// if($vad['bottle']['inGroup'] > 0) {
|
||||
// $r = 'Пустая бутылка не должена находиться в группе...';
|
||||
// } else {
|
||||
$vad['gems']['query'] = mysql_query('SELECT `id`, `inGroup` FROM `items_users` WHERE (`item_id` = "908" OR `item_id` = "906" OR `item_id` = "907" OR `item_id` = "881" OR `item_id` = "878" OR `item_id` = "888") AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 99');
|
||||
$vad['gems']['query'] = mysql_result($vad['gems']['query'], (rand(0, (mysql_num_rows($vad['gems']['query'])-1))),0);
|
||||
if($vad['gems']['query'] != '') {
|
||||
$vad['go'] = true;
|
||||
} else {
|
||||
$r = 'У вас нет драгоценных камней...';
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
$r = 'У вас нет пустой бутылки.';
|
||||
}
|
||||
} else {
|
||||
if (isset($vad['kill_monsters']['id2'])) {
|
||||
$r = 'Вы уверены что убили всю группу монстров?';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if($u->info['sex'] == 1) { $a = 'а'; } else { $a = ''; }
|
||||
$r = 'Мне кажется, что здесь я уже был'.$a.'..';
|
||||
$vad['bottle'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "2" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" ORDER BY `id` DESC LIMIT 1'));
|
||||
if (!isset($vad['bottle']['id'])) {
|
||||
$r = 'У вас нет пустой бутылки.';
|
||||
} else {
|
||||
$vad['gems']['query'] = mysql_fetch_array(mysql_query('SELECT `id`, `inGroup` FROM `items_users` WHERE (`item_id` = "908" OR `item_id` = "906" OR `item_id` = "907" OR `item_id` = "881" OR `item_id` = "878" OR `item_id` = "888") AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" order by rand() limit 1'));
|
||||
$vad['gems']['query'] = $vad['gems']['query']['id'];
|
||||
if ($vad['gems']['query'] == '') {
|
||||
$r = 'У вас нет драгоценных камней...';
|
||||
} else {
|
||||
$vad['go'] = true;
|
||||
}
|
||||
if($vad['go'] == true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($vad['go']) {
|
||||
mysql_query('INSERT INTO `dungeon_actions` (`uid`, `dn`, `x`, `y`, `time`, `vars`, `vals`) VALUES ( "' . $u->info['id'] . '", "' . $u->info['dnow'] . '", "' . $u->info['x'] . '", "' . $u->info['y'] . '", "' . time() . '", "use_fontan", "4" )');
|
||||
$r = 'Опустив пустую бутылку в фонтан вы наполнили её.';
|
||||
$vad['drug'] = array(0 => 2588, 1 => 2590, 2 => 2589, 3 => 2145);
|
||||
$vad['drug'] = [0 => 2588, 1 => 2590, 2 => 2589, 3 => 2145];
|
||||
mysql_query('DELETE FROM `items_users` WHERE `id` = "' . mysql_real_escape_string(intval($vad['bottle']['id'])) . '" LIMIT 1');
|
||||
\User\ItemsModel::addItem(round($vad['drug'][rand(0,3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3);
|
||||
ItemsModel::addItem(round($vad['drug'][rand(0, 3)]), $u->info['id'], '|musor=2|nosale=1|noremont=1', 12, 3);
|
||||
}
|
||||
unset($vad);
|
||||
}
|
||||
?>
|
@ -151,24 +151,4 @@ if (!extension_loaded('mysql') && !function_exists('mysql_connect')) {
|
||||
return mysqli_insert_id(getLinkIdentifier($mysqli));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get result data
|
||||
*
|
||||
* @param $result
|
||||
* @param $row
|
||||
* @param int $field
|
||||
* @return mixed
|
||||
* @deprecated
|
||||
*/
|
||||
function mysql_result($result, $row, $field = 0)
|
||||
{
|
||||
$result->data_seek($row);
|
||||
$row = $result->fetch_array();
|
||||
if (!isset($row[$field])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $row[$field];
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user