Пещеры заселились живностью.
This commit is contained in:
parent
3b4bbf3a6a
commit
eb971fbc65
@ -28,6 +28,18 @@ class Dungeon
|
|||||||
4 => [1 => 4, 2 => 1, 3 => 2, 4 => 3],
|
4 => [1 => 4, 2 => 1, 3 => 2, 4 => 3],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1-9: передняя стенка, в 2-х шагах;<br>
|
||||||
|
* 10-23: растояние: 1 шаг;<br>
|
||||||
|
* 24: стена прямо слева от персонажа;<br>
|
||||||
|
* 25: стена прямо справа от персонажа;<br>
|
||||||
|
* 26: стена прямо перед персонажем;<br>
|
||||||
|
* 27: стена слева от персонажа;<br>
|
||||||
|
* 28: стена справа от персонажа;
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public readonly array $walls;
|
||||||
|
|
||||||
public function __construct(User $user = null)
|
public function __construct(User $user = null)
|
||||||
{
|
{
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
@ -1522,7 +1534,7 @@ class Dungeon
|
|||||||
|
|
||||||
//Розыгрыш предмета
|
//Розыгрыш предмета
|
||||||
|
|
||||||
public function genMatix()
|
public function genMatix(): array
|
||||||
{
|
{
|
||||||
$r = [];
|
$r = [];
|
||||||
if ($this->gs == 1) {
|
if ($this->gs == 1) {
|
||||||
@ -1619,101 +1631,109 @@ class Dungeon
|
|||||||
global $u;
|
global $u;
|
||||||
$this->cord['x']++;
|
$this->cord['x']++;
|
||||||
$this->cord[($u->info['y'] + $y) . '_' . ($u->info['x'] + $x)] = $this->cord['x'];
|
$this->cord[($u->info['y'] + $y) . '_' . ($u->info['x'] + $x)] = $this->cord['x'];
|
||||||
return $this->map[0][($u->info['y'] + $y) . '_' . ($u->info['x'] + $x)];
|
return $this->map[0][($u->info['y'] + $y) . '_' . ($u->info['x'] + $x)] ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lookDungeon()
|
private function lookDungeon()
|
||||||
{
|
{
|
||||||
global $u, $c, $code, $pd;
|
$pd = array_fill(1, 28, 0);
|
||||||
/* Генерируем изображение карты */ /* LEVEL 1 */
|
|
||||||
|
|
||||||
// Исправления от 29/10/2014 относительно D5, 2 этаж, ПТП. Покрутиться и все гуд. и от 22/11/2014 для обратных стен. Если стена к нам задницей, мы её не видим.
|
global $pd;
|
||||||
if ($this->testSt(2, 4) > 0 /* || $this->testSt(3,2)>0 */) {
|
/* Генерируем изображение карты */
|
||||||
|
|
||||||
|
/* LEVEL 1 */
|
||||||
|
if ($this->testSt(2, 4)) {
|
||||||
$pd[28] = 1;
|
$pd[28] = 1;
|
||||||
}
|
}
|
||||||
if (/*$this->testSt(1,4)>0 ||*/ $this->testSt(2, 2) > 0) {
|
if ($this->testSt(2, 2)) {
|
||||||
$pd[27] = 1;
|
$pd[27] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(2, 1) > 0 /*|| $this->testSt(5,3)>0*/) {
|
if ($this->testSt(2, 1)) {
|
||||||
$pd[26] = 1;
|
$pd[26] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(3, 1) > 0/* || $this->testSt(6,3)>0*/) {
|
if ($this->testSt(3, 1)) {
|
||||||
$pd[25] = 1;
|
$pd[25] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(1, 1) > 0 /*|| $this->testSt(4,3)>0*/) {
|
if ($this->testSt(1, 1)) {
|
||||||
$pd[24] = 1;
|
$pd[24] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LEVEL 2 */
|
/* LEVEL 2 */
|
||||||
if ($this->testSt(5, 4) > 0 /*|| $this->testSt(6,2)>0*/) {
|
if ($this->testSt(5, 4)) {
|
||||||
$pd[23] = 1;
|
$pd[23] = 1;
|
||||||
}
|
}
|
||||||
if (/*$this->testSt(4,4)>0 || */ $this->testSt(5, 2) > 0) {
|
if ($this->testSt(5, 2)) {
|
||||||
$pd[22] = 1;
|
$pd[22] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(5, 1) > 0 /*|| $this->testSt(8,3)>0*/) {
|
if ($this->testSt(5, 1)) {
|
||||||
$pd[21] = 1;
|
$pd[21] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(6, 1) > 0 /*|| $this->testSt(7,3)>0*/) {
|
if ($this->testSt(6, 1)) {
|
||||||
$pd[20] = 1;
|
$pd[20] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(4, 1) > 0/* || $this->testSt(9,3)>0*/) {
|
if ($this->testSt(4, 1)) {
|
||||||
$pd[19] = 1;
|
$pd[19] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LEVEL 3 */
|
/* LEVEL 3 */
|
||||||
if ($this->testSt(8, 4) > 0 /*|| $this->testSt(7,2)>0*/) {
|
if ($this->testSt(8, 4)) {
|
||||||
$pd[18] = 1;
|
$pd[18] = 1;
|
||||||
}
|
}
|
||||||
if (/*$this->testSt(9,4)>0 || */ $this->testSt(8, 2) > 0) {
|
if ($this->testSt(8, 2)) {
|
||||||
$pd[17] = 1;
|
$pd[17] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(8, 1) > 0 /* || $this->testSt(12,3)>0*/) {
|
if ($this->testSt(8, 1)) {
|
||||||
$pd[16] = 1;
|
$pd[16] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(7, 1) > 0 /* || $this->testSt(13,3)>0*/) {
|
if ($this->testSt(7, 1)) {
|
||||||
$pd[15] = 1;
|
$pd[15] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(9, 1) > 0 /*|| $this->testSt(11,3)>0*/) {
|
if ($this->testSt(9, 1)) {
|
||||||
$pd[14] = 1;
|
$pd[14] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LEVEL 4 */
|
/* LEVEL 4 */
|
||||||
|
if ($this->testSt(12, 4) || $this->testSt(13, 2)) {
|
||||||
if ($this->testSt(12, 4) > 0 || $this->testSt(13, 2) > 0) {
|
|
||||||
$pd[13] = 1;
|
$pd[13] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(12, 2) > 0 || $this->testSt(11, 4) > 0) {
|
if ($this->testSt(12, 2) || $this->testSt(11, 4)) {
|
||||||
$pd[12] = 1;
|
$pd[12] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(13, 1) > 0 || $this->testSt(17, 3) > 0) {
|
if ($this->testSt(13, 1) || $this->testSt(17, 3)) {
|
||||||
$pd[11] = 1;
|
$pd[11] = 1;
|
||||||
} //8
|
} //8
|
||||||
if ($this->testSt(11, 1) > 0 || $this->testSt(16, 3) > 0) {
|
if ($this->testSt(11, 1) || $this->testSt(16, 3)) {
|
||||||
$pd[10] = 1;
|
$pd[10] = 1;
|
||||||
} //7
|
} //7
|
||||||
if ($this->testSt(12, 1) > 0/* || $this->testSt(15,3)>0*/) {
|
if ($this->testSt(12, 1)) {
|
||||||
$pd[9] = 1;
|
$pd[9] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(14, 1) > 0 || $this->testSt(18, 3) > 0) {
|
if ($this->testSt(14, 1) || $this->testSt(18, 3)) {
|
||||||
$pd[6] = 1;
|
$pd[6] = 1;
|
||||||
} //2
|
} //2
|
||||||
if ($this->testSt(10, 1) > 0 || $this->testSt(19, 3) > 0) {
|
if ($this->testSt(10, 1) || $this->testSt(19, 3)) {
|
||||||
$pd[5] = 1;
|
$pd[5] = 1;
|
||||||
} //1
|
} //1
|
||||||
if ($this->testSt(16, 4) > 0 || $this->testSt(15, 2) > 0) {
|
if ($this->testSt(16, 4) || $this->testSt(15, 2)) {
|
||||||
$pd[4] = 1;
|
$pd[4] = 1;
|
||||||
}
|
}
|
||||||
if ($this->testSt(15, 4) > 0 || $this->testSt(17, 2) > 0) {
|
if ($this->testSt(15, 4) || $this->testSt(17, 2)) {
|
||||||
$pd[3] = 1;
|
$pd[3] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->walls = $pd;
|
||||||
/* Генерируем предметы на карте */
|
/* Генерируем предметы на карте */
|
||||||
|
|
||||||
/* Генерируем персонажей и ботов на карте */
|
/* Генерируем персонажей и ботов на карте */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSt($id, $s)
|
/** Видим ли мы стену?
|
||||||
|
* @param int $id
|
||||||
|
* @param int $s в какую сторону смотрим
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function testSt(int $id, int $s): bool
|
||||||
{
|
{
|
||||||
$r = 0;
|
$r = 0;
|
||||||
//заменяем отображение стен в зависимости от угла обзора
|
//заменяем отображение стен в зависимости от угла обзора
|
||||||
@ -1721,7 +1741,7 @@ class Dungeon
|
|||||||
if (isset($this->map[1][$id]['id'])) {
|
if (isset($this->map[1][$id]['id'])) {
|
||||||
$r = $this->map[1][$id]['st'][($s - 1)];
|
$r = $this->map[1][$id]['st'][($s - 1)];
|
||||||
}
|
}
|
||||||
return $r;
|
return $r > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initPoint(int $x, int $y): void
|
public function initPoint(int $x, int $y): void
|
||||||
@ -1740,8 +1760,6 @@ class Dungeon
|
|||||||
}
|
}
|
||||||
$tou = 0; //какому юзеру предназначено
|
$tou = 0; //какому юзеру предназначено
|
||||||
/* выделяем случайного юзера из команды */
|
/* выделяем случайного юзера из команды */
|
||||||
$itmnm = mysql_fetch_assoc(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itm . '" LIMIT 1'));
|
|
||||||
$itmnm = $itmnm['name'];
|
|
||||||
$asex = '';
|
$asex = '';
|
||||||
if ($u->info['sex'] == 1) {
|
if ($u->info['sex'] == 1) {
|
||||||
$asex = 'а';
|
$asex = 'а';
|
||||||
@ -1773,17 +1791,11 @@ class Dungeon
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function n_lead($who, $lead)
|
public function n_lead(string $who, int $lead): void
|
||||||
{
|
{
|
||||||
global $u, $c, $code;
|
global $u;
|
||||||
|
|
||||||
$to = mysql_fetch_assoc(
|
$to = Db::getRow('select stats.id, dnow from users left join stats on users.id = stats.id where login = ?', [$who]);
|
||||||
mysql_query(
|
|
||||||
'SELECT `u`.`id`, `u`.`login`, `st`.`id`, `st`.`dnow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`login` = "' . mysql_real_escape_string(
|
|
||||||
$who
|
|
||||||
) . '" LIMIT 1'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($this->info['uid'] != $lead) {
|
if ($this->info['uid'] != $lead) {
|
||||||
$this->error = '<b>Вы не лидер...</b>';
|
$this->error = '<b>Вы не лидер...</b>';
|
||||||
@ -1799,29 +1811,23 @@ class Dungeon
|
|||||||
);
|
);
|
||||||
if ($u->info['sex'] == 0) {
|
if ($u->info['sex'] == 0) {
|
||||||
$this->sys_chat(
|
$this->sys_chat(
|
||||||
'<b>' . $u->info['login'] . '</b> передал лидерство в группе персонажу <b>' . $to['login'] . '</b>'
|
'<b>' . $u->info['login'] . '</b> передал лидерство в группе персонажу <b>' . $who . '</b>'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->sys_chat(
|
$this->sys_chat(
|
||||||
'<b>' . $u->info['login'] . '</b> передала лидерство в группе персонажу <b>' . $to['login'] . '</b>'
|
'<b>' . $u->info['login'] . '</b> передала лидерство в группе персонажу <b>' . $who . '</b>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//header('Location: main.php');
|
|
||||||
die('<script>top.frames[\'main\'].location = "main.php";</script>');
|
exit("<script>top.frames['main'].location = 'main.php'</script>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function go_to_hell($who, $lead)
|
public function go_to_hell(string $who, int $lead): void
|
||||||
{
|
{
|
||||||
global $u, $c, $code;
|
global $u;
|
||||||
|
|
||||||
$to = mysql_fetch_assoc(
|
$to = Db::getRow('select stats.id, dnow from users left join stats on users.id = stats.id where login = ?', [$who]);
|
||||||
mysql_query(
|
|
||||||
'SELECT `u`.`id`, `u`.`login`, `st`.`id`, `st`.`dnow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`login` = "' . mysql_real_escape_string(
|
|
||||||
$who
|
|
||||||
) . '" LIMIT 1'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($this->info['uid'] != $lead) {
|
if ($this->info['uid'] != $lead) {
|
||||||
$this->error = '<b>Вы не лидер...</b>';
|
$this->error = '<b>Вы не лидер...</b>';
|
||||||
@ -1837,8 +1843,6 @@ class Dungeon
|
|||||||
$rb = 209; // Вход в ледяную пещеру
|
$rb = 209; // Вход в ледяную пещеру
|
||||||
} elseif ($u->info['room'] == 396) {
|
} elseif ($u->info['room'] == 396) {
|
||||||
$rb = 395; // Канализация (Ангелс)
|
$rb = 395; // Канализация (Ангелс)
|
||||||
} elseif ($u->info['room'] == 398) {
|
|
||||||
$rb = 321; // Все пещеры
|
|
||||||
} elseif ($this->info['id2'] == 3) {
|
} elseif ($this->info['id2'] == 3) {
|
||||||
$rb = 293; // Вход в Катакомбы
|
$rb = 293; // Вход в Катакомбы
|
||||||
} elseif ($this->info['id2'] == 1) {
|
} elseif ($this->info['id2'] == 1) {
|
||||||
@ -1847,15 +1851,9 @@ class Dungeon
|
|||||||
$rb = 275; // Гора Легиона
|
$rb = 275; // Гора Легиона
|
||||||
} elseif ($this->info['id2'] == 12) {
|
} elseif ($this->info['id2'] == 12) {
|
||||||
$rb = 372; // Вход в Пещеру Тысячи Проклятий
|
$rb = 372; // Вход в Пещеру Тысячи Проклятий
|
||||||
} elseif ($this->info['id2'] == 444) {
|
|
||||||
$rb = 321; // Вход в пещеру инкв
|
|
||||||
} elseif ($this->info['id2'] == 31) {
|
|
||||||
$rb = 321; // Вход в пещеру инкв
|
|
||||||
} elseif ($this->info['id2'] == 101) {
|
|
||||||
$rb = 321; // Вход в Бездну
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50');
|
$sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50');
|
||||||
while ($pl = mysql_fetch_assoc($sp)) {
|
while ($pl = mysql_fetch_assoc($sp)) {
|
||||||
$cn = mysql_fetch_assoc(
|
$cn = mysql_fetch_assoc(
|
||||||
@ -1891,14 +1889,15 @@ class Dungeon
|
|||||||
|
|
||||||
if ($u->info['sex'] == 0) {
|
if ($u->info['sex'] == 0) {
|
||||||
$this->sys_chat(
|
$this->sys_chat(
|
||||||
'<b>' . $u->info['login'] . '</b> выгнал из похода персонажа <b>' . $to['login'] . '</b>'
|
'<b>' . $u->info['login'] . '</b> выгнал из похода персонажа <b>' . $who . '</b>'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->sys_chat(
|
$this->sys_chat(
|
||||||
'<b>' . $u->info['login'] . '</b> выгнала из похода персонажа <b>' . $to['login'] . '</b>'
|
'<b>' . $u->info['login'] . '</b> выгнала из похода персонажа <b>' . $who . '</b>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
header('Location: /main.php');
|
|
||||||
|
exit("<script>top.frames['main'].location = 'main.php'</script>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2067,7 +2066,7 @@ class Dungeon
|
|||||||
|
|
||||||
public function genObjects()
|
public function genObjects()
|
||||||
{
|
{
|
||||||
global $u, $c, $code;
|
global $u;
|
||||||
////i:{id,name,mapPoint,action,img,type},
|
////i:{id,name,mapPoint,action,img,type},
|
||||||
//'count':1,0:{0:1234,1:'Сундук',2:5,3:'',4:'test.gif',5:0,6:position,7:width,8:heigh,9:left,10:top},
|
//'count':1,0:{0:1234,1:'Сундук',2:5,3:'',4:'test.gif',5:0,6:position,7:width,8:heigh,9:left,10:top},
|
||||||
//psition 0 - по центру , 1- сверху, 2- слева, 3- снизу, 4- справа
|
//psition 0 - по центру , 1- сверху, 2- слева, 3- снизу, 4- справа
|
||||||
@ -2083,15 +2082,40 @@ class Dungeon
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$pos = [];
|
$pos = [];
|
||||||
while ($pl = mysql_fetch_assoc($sp)) {
|
while ($pl = mysql_fetch_assoc($sp)) {
|
||||||
if ($pl['fix_x_y'] == 0 || ($pl['fix_x_y'] == 1 && $pl['x'] == $u->info['x']) || ($pl['fix_x_y'] == 2 && $pl['y'] == $u->info['y']) || ($pl['fix_x_y'] == 3 && $pl['x'] == $u->info['x'] && $pl['y'] == $u->info['y'])) {
|
if (!isset($this->cord[$pl['y'] . '_' . $pl['x']])) {
|
||||||
if (($pl['os1'] == 0 && $pl['os2'] == 0 && $pl['os3'] == 0 && $pl['os4'] == 0) || ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'])) {
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
$pl['fix_x_y'] != 0 &&
|
||||||
|
($pl['fix_x_y'] != 1 || $pl['x'] != $u->info['x']) &&
|
||||||
|
($pl['fix_x_y'] != 2 || $pl['y'] != $u->info['y']) &&
|
||||||
|
($pl['fix_x_y'] != 3 || $pl['x'] != $u->info['x'] || $pl['y'] != $u->info['y'])
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
($pl['os1'] == 0 && $pl['os2'] == 0 && $pl['os3'] == 0 && $pl['os4'] == 0) ||
|
||||||
|
(
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4']
|
||||||
|
)
|
||||||
|
) {
|
||||||
$i++;
|
$i++;
|
||||||
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
|
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
|
||||||
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
|
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
|
||||||
}
|
}
|
||||||
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
|
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
|
||||||
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'action\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'action\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
||||||
} elseif ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] - 1) {
|
} elseif (
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] - 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] - 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] - 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] - 1
|
||||||
|
) {
|
||||||
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
|
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
|
||||||
$da = [];
|
$da = [];
|
||||||
$is = 0;
|
$is = 0;
|
||||||
@ -2121,7 +2145,12 @@ class Dungeon
|
|||||||
}
|
}
|
||||||
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
|
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
|
||||||
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
||||||
} elseif ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] + 1) {
|
} elseif (
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] + 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] + 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] + 1 ||
|
||||||
|
$this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] + 1
|
||||||
|
) {
|
||||||
|
|
||||||
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
|
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
|
||||||
$da = [];
|
$da = [];
|
||||||
@ -2152,21 +2181,29 @@ class Dungeon
|
|||||||
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
$r .= ',' . ($i - 1) . ':{0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 'count:' . $i . $r;
|
return 'count:' . $i . $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function genUsers()
|
public function genUsers()
|
||||||
{
|
{
|
||||||
global $u, $c, $code;
|
global $u;
|
||||||
////i:{id,login,mapPoint,sex,obraz,type,users_p},
|
////i:{id,login,mapPoint,sex,obraz,type,users_p},
|
||||||
//'count':1,0:{0:1015,1:'Test1',2:5,3:0,4:'1',5:'user',6:1},
|
//'count':1,0:{0:1015,1:'Test1',2:5,3:0,4:'1',5:'user',6:1},
|
||||||
$r = '';
|
$r = '';
|
||||||
$whr = [1 => ' ((`u`.`x` <= ' . ($u->info['x'] + 2) . ' && `u`.`x` >= ' . ($u->info['x'] - 2) . ') && (`u`.`y` >= ' . $u->info['y'] . ' && `u`.`y` <= ' . ($u->info['y'] + 4) . ')) ', //прямо
|
$whr = [
|
||||||
3 => ' ((`u`.`x` <= ' . ($u->info['x'] + 2) . ' && `u`.`x` >= ' . ($u->info['x'] - 2) . ') && (`u`.`y` <= ' . $u->info['y'] . ' && `u`.`y` >= ' . ($u->info['y'] - 4) . ')) ', //вниз
|
1 => ' ((x <= ' . ($u->info['x'] + 2) . ' && x >= ' . ($u->info['x'] - 2) . ') && (y >= ' . $u->info['y'] . ' && y <= ' . ($u->info['y'] + 4) . ')) ', //прямо
|
||||||
2 => ' ((`u`.`x` <= ' . $u->info['x'] . ' && `u`.`x` >= ' . ($u->info['x'] - 4) . ') && (`u`.`y` <= ' . ($u->info['y'] + 2) . ' && `u`.`y` >= ' . ($u->info['y'] - 2) . ')) ', //лево
|
2 => ' ((x <= ' . $u->info['x'] . ' && x >= ' . ($u->info['x'] - 4) . ') && (y <= ' . ($u->info['y'] + 2) . ' && y >= ' . ($u->info['y'] - 2) . ')) ', //лево
|
||||||
4 => ' ((`u`.`x` >= ' . $u->info['x'] . ' && `u`.`x` <= ' . ($u->info['x'] + 4) . ') && (`u`.`y` <= ' . ($u->info['y'] + 2) . ' && `u`.`y` >= ' . ($u->info['y'] - 2) . ')) ', //право
|
3 => ' ((x <= ' . ($u->info['x'] + 2) . ' && x >= ' . ($u->info['x'] - 2) . ') && (y <= ' . $u->info['y'] . ' && y >= ' . ($u->info['y'] - 4) . ')) ', //вниз
|
||||||
|
4 => ' ((x >= ' . $u->info['x'] . ' && x <= ' . ($u->info['x'] + 4) . ') && (y <= ' . ($u->info['y'] + 2) . ' && y >= ' . ($u->info['y'] - 2) . ')) ', //право
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$whrVals = [ // x <= ? && x >= ? && y <= ? && y >= ?
|
||||||
|
1 => [$u->info['x'] + 2, $u->info['x'] - 2, $u->info['y'] + 4, $u->info['y'],], // прямо x< x> y< y>
|
||||||
|
2 => [$u->info['x'], $u->info['x'] - 4, $u->info['y'] + 2, $u->info['y'] - 2,], // лево x< x> y< y>
|
||||||
|
3 => [$u->info['x'] + 2, $u->info['x'] - 2, $u->info['y'], $u->info['y'] - 4,], // низ x< x> y< y>
|
||||||
|
4 => [$u->info['x'] + 4, $u->info['x'], $u->info['y'] + 2, $u->info['y'] - 2,], // право x< x> y< y>
|
||||||
|
];
|
||||||
|
|
||||||
//
|
//
|
||||||
$tmsu = mysql_fetch_assoc(
|
$tmsu = mysql_fetch_assoc(
|
||||||
mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1')
|
mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1')
|
||||||
@ -2266,10 +2303,19 @@ class Dungeon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sp = mysql_query(
|
|
||||||
'SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "' . $u->info['dnow'] . '" AND ' . $whr[$this->gs] . ' AND `u`.`delete` = "0" LIMIT 50'
|
$botsArr = Db::getRows('select * from dungeon_bots left join test_bot on dungeon_bots.id_bot = test_bot.id where dn = ? and x <= ? and x >= ? and y <= ? and y >= ? limit 50',[
|
||||||
);
|
$u->info['dnow'], $whrVals[$this->gs][0], $whrVals[$this->gs][1], $whrVals[$this->gs][2], $whrVals[$this->gs][3],
|
||||||
while ($pl = mysql_fetch_assoc($sp)) {
|
]);
|
||||||
|
|
||||||
|
foreach ($botsArr as $pl) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// $sp = mysql_query(
|
||||||
|
// 'SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "' . $u->info['dnow'] . '" AND ' . $whr[$this->gs] . ' AND `u`.`delete` = "0" LIMIT 50'
|
||||||
|
// );
|
||||||
|
// while ($pl = mysql_fetch_assoc($sp)) {
|
||||||
$i++;
|
$i++;
|
||||||
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
|
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
|
||||||
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
|
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
|
||||||
|
@ -1,48 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Core\Config;
|
||||||
use Core\Db;
|
use Core\Db;
|
||||||
|
|
||||||
echo "
|
echo "<script>document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));</script>";
|
||||||
<script>
|
|
||||||
let elem = document.getElementById('se-pre-con');
|
|
||||||
elem.parentNode.removeChild(elem);
|
|
||||||
</script>
|
|
||||||
";
|
|
||||||
if (!defined('GAME')) {
|
if (!defined('GAME')) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($u->room['file'] != 'dungeon') {
|
if ($u->room['file'] != 'dungeon') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$pd = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, //передняя стенка, в 2-х шагах
|
|
||||||
10 => 0, 11 => 0, 12 => 0, 13 => 0, 14 => 0, 15 => 0, 16 => 0, 17 => 0, 18 => 0, 19 => 0, 20 => 0, 21 => 0, 22 => 0, 23 => 0, /* Растояние: 1 шаг */
|
|
||||||
24 => 0, //стена прямо слева от персонажа (1)
|
|
||||||
25 => 0, //стена прямо справа от персонажа (1)
|
|
||||||
26 => 0, //стена прямо перед персонажем (1)
|
|
||||||
27 => 0, //стена слева от персонажа (1)
|
|
||||||
28 => 0, //стена справа от персонажа (1)
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isset($_POST['go_to_admin']) && $u->info['admin'] == 1 && $u->info['login'] == 'Crowley') {
|
|
||||||
mysql_query('UPDATE `stats` SET `x` = "' . round((int)$_POST['g__x']) . '", `y` = "' . round((int)$_POST['g__y']) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
|
||||||
if ($_POST['g__restorebot']) {
|
|
||||||
mysql_query('UPDATE `dungeon_bots` SET `delete` = "0" WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = 1 LIMIT 50');
|
|
||||||
}
|
|
||||||
header('Location: /main.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['back'])) {
|
if (isset($_GET['back'])) {
|
||||||
$dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "' . $u->info['dnow'] . '" LIMIT 1'));
|
$dp = Db::getValue('select file from dungeon_map where id_dng = (select id2 from dungeon_now where id = ?) and x = ? and y = ?', [$u->info['dnow'], $u->info['x'], $u->info['y']]);
|
||||||
$dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $dp['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1'));
|
if ($dp != '0') {
|
||||||
if ($dp['file'] != '0') {
|
|
||||||
$file = explode('=', $dp['file']);
|
$file = explode('=', $dp['file']);
|
||||||
if (isset($file[1])) {
|
if (isset($file[1])) {
|
||||||
if ($file[3] < 1 || $file[3] > 4) {
|
if ($file[3] < 1 || $file[3] > 4) {
|
||||||
$file[3] = 1;
|
$file[3] = 1;
|
||||||
}
|
}
|
||||||
mysql_query('UPDATE `stats` SET `x` = "' . $file[1] . '",`y` = "' . $file[2] . '",`s` = "' . $file[3] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
Db::sql('update stats set x = ?, y = ?, s = ? where id = ?', [$file[1], $file[2], $file[3], $u->info['id']]);
|
||||||
$u->info['x'] = $file[1];
|
$u->info['x'] = $file[1];
|
||||||
$u->info['y'] = $file[2];
|
$u->info['y'] = $file[2];
|
||||||
$u->info['s'] = $file[3];
|
$u->info['s'] = $file[3];
|
||||||
@ -57,8 +36,7 @@ if (!isset($d->info['id'])) {
|
|||||||
$_GET['exitd'] = true;
|
$_GET['exitd'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "die" LIMIT 1'));
|
$dies = Db::getValue('select count(id) from dungeon_actions where uid = ? and dn = ? and vars = ?', [$u->info['id'], $u->info['dnow'], 'die']);
|
||||||
$dies = $dies[0];
|
|
||||||
|
|
||||||
if ($dies >= 3) {
|
if ($dies >= 3) {
|
||||||
$_GET['exitd'] = true;
|
$_GET['exitd'] = true;
|
||||||
@ -71,11 +49,11 @@ if (!isset($d->point['id'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['new_leader'])) {
|
if (isset($_GET['new_leader'])) {
|
||||||
echo $d->n_lead($_GET['new_leader'], $u->info['id']);
|
$d->n_lead($_GET['new_leader'], $u->info['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['go_from_psh'])) {
|
if (isset($_GET['go_from_psh'])) {
|
||||||
echo $d->go_to_hell($_GET['go_from_psh'], $u->info['id']);
|
$d->go_to_hell($_GET['go_from_psh'], $u->info['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -209,7 +187,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
bott = 0;
|
bott = 0;
|
||||||
if (stor == 1) {
|
if (stor == 1) {
|
||||||
<?php
|
<?php
|
||||||
$bottem = mysql_fetch_assoc(mysql_query('SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x']) . '" AND `y` = "' . ($u->info['y'] + 1) . '" LIMIT 1'));
|
$bottem = mysql_fetch_assoc(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x']) . '" AND `y` = "' . ($u->info['y'] + 1) . '" LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($bottem['id2']))
|
if (isset($bottem['id2']))
|
||||||
{
|
{
|
||||||
?> bott = <?= $bottem['id2'];?>;<?php
|
?> bott = <?= $bottem['id2'];?>;<?php
|
||||||
@ -217,7 +199,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
?>
|
?>
|
||||||
} else if (stor == 2) {
|
} else if (stor == 2) {
|
||||||
<?php
|
<?php
|
||||||
$bottem = mysql_fetch_assoc(mysql_query('SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x'] - 1) . '" AND `y` = "' . ($u->info['y']) . '" LIMIT 1'));
|
$bottem = mysql_fetch_assoc(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x'] - 1) . '" AND `y` = "' . ($u->info['y']) . '" LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($bottem['id2']))
|
if (isset($bottem['id2']))
|
||||||
{
|
{
|
||||||
?> bott = <?= $bottem['id2'];?>;<?php
|
?> bott = <?= $bottem['id2'];?>;<?php
|
||||||
@ -225,7 +211,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
?>
|
?>
|
||||||
} else if (stor == 3) {
|
} else if (stor == 3) {
|
||||||
<?php
|
<?php
|
||||||
$bottem = mysql_fetch_assoc(mysql_query('SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x']) . '" AND `y` = "' . ($u->info['y'] - 1) . '" LIMIT 1'));
|
$bottem = mysql_fetch_assoc(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x']) . '" AND `y` = "' . ($u->info['y'] - 1) . '" LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($bottem['id2']))
|
if (isset($bottem['id2']))
|
||||||
{
|
{
|
||||||
?> bott = <?= $bottem['id2'];?>;<?php
|
?> bott = <?= $bottem['id2'];?>;<?php
|
||||||
@ -233,7 +223,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
?>
|
?>
|
||||||
} else if (stor == 4) {
|
} else if (stor == 4) {
|
||||||
<?php
|
<?php
|
||||||
$bottem = mysql_fetch_assoc(mysql_query('SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x'] + 1) . '" AND `y` = "' . ($u->info['y']) . '" LIMIT 1'));
|
$bottem = mysql_fetch_assoc(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `id2` FROM `dungeon_bots` WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = "0" AND `x` = "' . ($u->info['x'] + 1) . '" AND `y` = "' . ($u->info['y']) . '" LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($bottem['id2']))
|
if (isset($bottem['id2']))
|
||||||
{
|
{
|
||||||
?> bott = <?= $bottem['id2'];?>;<?php
|
?> bott = <?= $bottem['id2'];?>;<?php
|
||||||
@ -246,7 +240,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
}
|
}
|
||||||
} else if (event.which == 32 || event.which == 90) {
|
} else if (event.which == 32 || event.which == 90) {
|
||||||
itemtake = 0;
|
itemtake = 0;
|
||||||
<?php $sp = mysql_fetch_assoc(mysql_query('SELECT `ish`.* FROM `dungeon_items` AS `ish` WHERE `ish`.`dn` = "' . $u->info['dnow'] . '" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND ( `ish`.`onlyfor` = "0" OR `ish`.`onlyfor` = "' . $u->info['id'] . '" ) AND `ish`.`x` = "' . $u->info['x'] . '" AND `ish`.`y` = "' . $u->info['y'] . '" LIMIT 1'));
|
<?php $sp = mysql_fetch_assoc(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `ish`.* FROM `dungeon_items` AS `ish` WHERE `ish`.`dn` = "' . $u->info['dnow'] . '" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND ( `ish`.`onlyfor` = "0" OR `ish`.`onlyfor` = "' . $u->info['id'] . '" ) AND `ish`.`x` = "' . $u->info['x'] . '" AND `ish`.`y` = "' . $u->info['y'] . '" LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($sp['id']))
|
if (isset($sp['id']))
|
||||||
{ ?>
|
{ ?>
|
||||||
itemtake = <?= $sp['id'];?>;
|
itemtake = <?= $sp['id'];?>;
|
||||||
@ -330,21 +328,21 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
|
|
||||||
var objects = {};
|
var objects = {};
|
||||||
//i:{id,login,mapPoint,sex,obraz,type,users_p},
|
//i:{id,login,mapPoint,sex,obraz,type,users_p},
|
||||||
var users = {<?= $d->genUsers(); ?>};
|
const users = {<?= $d->genUsers(); ?>};
|
||||||
var objs = {<?= $d->genObjects(); ?>};
|
var objs = {<?= $d->genObjects(); ?>};
|
||||||
var items = {};
|
var items = {};
|
||||||
var actions = {};
|
var actions = {};
|
||||||
var dsee = <?= 0 + $d->gs; ?>;
|
var dsee = <?= 0 + $d->gs; ?>;
|
||||||
var mapp = {
|
var mapp = {
|
||||||
1: '0_0f', 2: '0_0f', 3: '0_0f', 4: '1_1f', 5: '1_1f', 6: '1_1f'
|
1: '0_0f', 2: '0_0f', 3: '0_0f', 4: '1_1f',
|
||||||
, 7: '2_1f', 8: '2_1f', 9: '2_1f'
|
5: '1_1f', 6: '1_1f', 7: '2_1f', 8: '2_1f',
|
||||||
, 11: '3_1l', 12: '3_1f', 13: '3_1r'
|
9: '2_1f', 11: '3_1l', 12: '3_1f', 13: '3_1r'
|
||||||
}
|
}
|
||||||
var zmap = {5: 894, 8: 0, 12: 0}
|
var zmap = {5: 894, 8: 0, 12: 0}
|
||||||
var zfloor0 = {1: '', 2: '', 3: '', 4: '', 5: ''};
|
var zfloor0 = {1: '', 2: '', 3: '', 4: '', 5: ''};
|
||||||
|
|
||||||
function genMap() {
|
function genMap() {
|
||||||
var i = 0, m = false, mz = false;
|
let i = 0, m = false, mz = false;
|
||||||
while (i < users['count']) {
|
while (i < users['count']) {
|
||||||
if (users[i] != undefined) {
|
if (users[i] != undefined) {
|
||||||
mz = mapp[users[i][2]];
|
mz = mapp[users[i][2]];
|
||||||
@ -355,7 +353,10 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
var i = 0, m = false, mz = false;
|
|
||||||
|
i = 0;
|
||||||
|
m = false;
|
||||||
|
mz = false;
|
||||||
while (i < objs['count']) {
|
while (i < objs['count']) {
|
||||||
if (objs[i] != undefined) {
|
if (objs[i] != undefined) {
|
||||||
mz = mapp[objs[i][2]];
|
mz = mapp[objs[i][2]];
|
||||||
@ -369,7 +370,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
var i = 5;
|
i = 5;
|
||||||
while (i >= 1) {
|
while (i >= 1) {
|
||||||
if (zfloor0[i] != '') {
|
if (zfloor0[i] != '') {
|
||||||
document.getElementById('Floor0').innerHTML += zfloor0[i];
|
document.getElementById('Floor0').innerHTML += zfloor0[i];
|
||||||
@ -691,51 +692,16 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
$tmGol = $u->info['timeGo'] - $u->info['timeGoL']; //сколько секунд идти всего
|
$tmGol = $u->info['timeGo'] - $u->info['timeGoL']; //сколько секунд идти всего
|
||||||
echo 'var tgo = ' . ($tmGo * 10) . '; var tgol = ' . ($tmGol * 10) . ';'; ?>
|
echo 'var tgo = ' . ($tmGo * 10) . '; var tgol = ' . ($tmGol * 10) . ';'; ?>
|
||||||
</script>
|
</script>
|
||||||
<link href="//img.new-combats.tech/css/dungeon_<?= $d->point['css']; ?>.css" rel="stylesheet"
|
<link rel="stylesheet" href="<?= Config::img() ?>/css/dungeon.css">
|
||||||
type="text/css"/>
|
<link rel="stylesheet" href="<?= Config::img() ?>/css/dungeon_<?= $d->point['css']; ?>.css">
|
||||||
<style>
|
|
||||||
.hintDm {
|
|
||||||
position: absolute;
|
|
||||||
background-color: #E4E4E4;
|
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid #999;
|
|
||||||
z-index: 1;
|
|
||||||
width: 70px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dUser {
|
|
||||||
max-height: 220px;
|
|
||||||
max-width: 120px;
|
|
||||||
min-width: 30px;
|
|
||||||
min-height: 55px;
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dObj {
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.test1 {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pline1 {
|
|
||||||
background-image: url(//img.new-combats.tech/wait3.gif);
|
|
||||||
height: 9px;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div id="deMenu" class="hintDm" style="display:none;z-index:5000;"></div>
|
<div id="deMenu" class="hintDm" style="display:none;z-index:5000;"></div>
|
||||||
<div style="margin-right:1px;">
|
<div style="margin-right:1px;">
|
||||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="float:left;"> <?php if (isset($d->error)) {
|
<p style="float:left; color: red;"> <?php if (isset($d->error)) {
|
||||||
echo '<font color="red">' . $d->error . '</font><br>';
|
echo $d->error . '<br>';
|
||||||
} ?></p>
|
} ?></p>
|
||||||
<?php if ($d->info['bsid'] == 0 && $d->info['id2'] != 106) { ?><p style="float:right;"><a
|
<?php if ($d->info['bsid'] == 0 && $d->info['id2'] != 106) { ?><p style="float:right;"><a
|
||||||
onClick="if(confirm('Выйти из пещеры?')){ location.href = '/main.php?exitd=<?= $code; ?>'; }"
|
onClick="if(confirm('Выйти из пещеры?')){ location.href = '/main.php?exitd=<?= $code; ?>'; }"
|
||||||
@ -777,7 +743,13 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
$dungeon_enter = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "' . $u->info['room'] . '" LIMIT 1'));
|
$dungeon_enter = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "' . $u->info['room'] . '" LIMIT 1'));
|
||||||
$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 1000');
|
$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 1000');
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
while ($pl = mysql_fetch_array($sp)) {
|
||||||
$pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" AND (`tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '" OR `tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '|%" OR `tr_date` NOT LIKE "%tr_dn:=:%") LIMIT 1'));
|
$pq = mysql_fetch_array(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT * FROM `quests` WHERE `id` = "' . str_replace(
|
||||||
|
'start_quest', '', $pl['vars']
|
||||||
|
) . '" AND (`tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '" OR `tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '|%" OR `tr_date` NOT LIKE "%tr_dn:=:%") LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($pq['id'])) {
|
if (isset($pq['id'])) {
|
||||||
$qsee .= '<small>Задание: ' . $pq['name'] . ' ' . $q->infoDng($pq) . '</small><br>';
|
$qsee .= '<small>Задание: ' . $pq['name'] . ' ' . $q->infoDng($pq) . '</small><br>';
|
||||||
$qx++;
|
$qx++;
|
||||||
@ -814,7 +786,7 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
<div style="position:relative;">
|
<div style="position:relative;">
|
||||||
|
|
||||||
<div style="position:absolute;z-index:1;left:397px;top:0px;">
|
<div style="position:absolute;z-index:1;left:397px;top:0px;">
|
||||||
<div id="pline1" style="width:1px;"></div>
|
<div id="pline1"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:absolute; z-index:50; left: 374px; top: 110px;">
|
<div style="position:absolute; z-index:50; left: 374px; top: 110px;">
|
||||||
<img src="//img.new-combats.tech/podzem-map.png"/>
|
<img src="//img.new-combats.tech/podzem-map.png"/>
|
||||||
@ -884,7 +856,9 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$uxy = [];
|
$uxy = [];
|
||||||
if ($u->room['name'] != 'Башня Смерти') {
|
if ($u->room['name'] != 'Башня Смерти') {
|
||||||
$sp = mysql_query('SELECT `u`.`login`,`u`.`id`,`s`.`x`,`s`.`y`,`s`.`s` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $u->info['dnow'] . '" AND `u`.`id` != "' . $u->info['id'] . '" LIMIT 10');
|
$sp = mysql_query(
|
||||||
|
'SELECT `u`.`login`,`u`.`id`,`s`.`x`,`s`.`y`,`s`.`s` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $u->info['dnow'] . '" AND `u`.`id` != "' . $u->info['id'] . '" LIMIT 10'
|
||||||
|
);
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
while ($pl = mysql_fetch_array($sp)) {
|
||||||
$uxy[$pl['x'] . '_' . $pl['y']] = $pl;
|
$uxy[$pl['x'] . '_' . $pl['y']] = $pl;
|
||||||
}
|
}
|
||||||
@ -892,18 +866,22 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
if ($u->info['admin'] > 0 || $d->id_dng == 106) {
|
if ($u->info['admin'] > 0 || $d->id_dng == 106) {
|
||||||
$bxy = [];
|
$bxy = [];
|
||||||
if ($u->room['name'] != 'Башня Смерти') {
|
if ($u->room['name'] != 'Башня Смерти') {
|
||||||
$sp = mysql_query('SELECT `db`.*, `tb`.`login`, `tb`.`obraz`, `tb`.`sex` FROM `dungeon_bots` as `db` LEFT JOIN `test_bot` as `tb` ON `tb`.`id`=`db`.`id_bot`
|
$sp = mysql_query(
|
||||||
|
'SELECT `db`.*, `tb`.`login`, `tb`.`obraz`, `tb`.`sex` FROM `dungeon_bots` as `db` LEFT JOIN `test_bot` as `tb` ON `tb`.`id`=`db`.`id_bot`
|
||||||
WHERE `db`.`dn` = "' . $u->info['dnow'] . '" AND `db`.`delete`=0 AND
|
WHERE `db`.`dn` = "' . $u->info['dnow'] . '" AND `db`.`delete`=0 AND
|
||||||
(`db`.`x` >= ' . ($u->info['x'] - 5) . ' AND `db`.`x` <= ' . ($u->info['x'] + 5) . ') AND
|
(`db`.`x` >= ' . ($u->info['x'] - 5) . ' AND `db`.`x` <= ' . ($u->info['x'] + 5) . ') AND
|
||||||
(`db`.`y` >= ' . ($u->info['y'] - 5) . ' AND `db`.`y` <= ' . ($u->info['y'] + 5) . ')
|
(`db`.`y` >= ' . ($u->info['y'] - 5) . ' AND `db`.`y` <= ' . ($u->info['y'] + 5) . ')
|
||||||
LIMIT 100');
|
LIMIT 100'
|
||||||
|
);
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
while ($pl = mysql_fetch_array($sp)) {
|
||||||
$bxy[$pl['x'] . '_' . $pl['y']] = $pl;
|
$bxy[$pl['x'] . '_' . $pl['y']] = $pl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d->id_dng . '" AND (`x` >= ' . ($u->info['x'] - 5) . ' AND `x` <= ' . ($u->info['x'] + 5) . ') AND (`y` >= ' . ($u->info['y'] - 5) . ' AND `y` <= ' . ($u->info['y'] + 5) . ') ORDER BY `y` ASC , `x` ASC LIMIT 100');
|
$sp = mysql_query(
|
||||||
|
'SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d->id_dng . '" AND (`x` >= ' . ($u->info['x'] - 5) . ' AND `x` <= ' . ($u->info['x'] + 5) . ') AND (`y` >= ' . ($u->info['y'] - 5) . ' AND `y` <= ' . ($u->info['y'] + 5) . ') ORDER BY `y` ASC , `x` ASC LIMIT 100'
|
||||||
|
);
|
||||||
|
|
||||||
$rzn = [0 => 'top', 3 => 'right', 2 => 'bottom', 1 => 'left'];
|
$rzn = [0 => 'top', 3 => 'right', 2 => 'bottom', 1 => 'left'];
|
||||||
|
|
||||||
@ -946,7 +924,11 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
} elseif ($tm['team'] == 2) {
|
} elseif ($tm['team'] == 2) {
|
||||||
$tmbth = 2;
|
$tmbth = 2;
|
||||||
}
|
}
|
||||||
$tbshin = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $uxy[$pl['x'] . '_' . $pl['y']]['id'] . '" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'));
|
$tbshin = mysql_fetch_array(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT `id` FROM `items_users` WHERE `uid` = "' . $uxy[$pl['x'] . '_' . $pl['y']]['id'] . '" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($tbshin['id'])) {
|
if (isset($tbshin['id'])) {
|
||||||
echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/shb.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
|
echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/shb.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
|
||||||
} else {
|
} else {
|
||||||
@ -976,190 +958,105 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:absolute; z-index:50; left: 374px; top: 110px;">
|
<div style="position:absolute; z-index:50; left: 374px; top: 110px;">
|
||||||
<img src="//img.new-combats.tech/podzem-map2.png"/>
|
<img src="//img.new-combats.tech/podzem-map2.png" alt=""/>
|
||||||
</div>
|
</div>
|
||||||
<img src="//img.new-combats.tech/g1.jpg"
|
<img src="//img.new-combats.tech/g1.jpg" title="Обновить, X:<?= $u->info['x'] ?> ,Y:<?= $u->info['y'] ?>" width="31" height="18" id="g1" style="position: absolute; cursor:pointer; left: 435px; top: 53px;" alt=""/>
|
||||||
title="Обновить, X:<?= $u->info['x'] ?> ,Y:<?= $u->info['y'] ?>"
|
|
||||||
width="31" height="18" id="g1"
|
|
||||||
style="position: absolute; cursor:pointer; left: 435px; top: 53px;"/>
|
|
||||||
<?php if ($d->testGone(3) > 0) { ?>
|
<?php if ($d->testGone(3) > 0) { ?>
|
||||||
<img src="//img.new-combats.tech/g2.jpg"
|
<img src="//img.new-combats.tech/g2.jpg" onclick="goToLoca(3,'направо');" width="27" height="48" id="g2" style="position:absolute;cursor:pointer; left: 492px; top: 40px;" alt=""/>
|
||||||
onclick="goToLoca(3,'направо');" width="27" height="48"
|
|
||||||
id="g2"
|
|
||||||
style="position:absolute;cursor:pointer; left: 492px; top: 40px;"/>
|
|
||||||
<?php }
|
<?php }
|
||||||
if ($d->testGone(4) > 0) { ?>
|
if ($d->testGone(4) > 0) { ?>
|
||||||
<img src="//img.new-combats.tech/g3.jpg"
|
<img src="//img.new-combats.tech/g3.jpg" onclick="goToLoca(4,'налево');" width="28" height="46" id="g3" style="position:absolute;cursor:pointer; left: 382px; top: 40px;" alt=""/>
|
||||||
onclick="goToLoca(4,'налево');" width="28" height="46"
|
|
||||||
id="g3"
|
|
||||||
style="position:absolute;cursor:pointer; left: 382px; top: 40px;"/>
|
|
||||||
<?php }
|
<?php }
|
||||||
if ($d->testGone(2) > 0) { ?>
|
if ($d->testGone(2) > 0) { ?>
|
||||||
<img src="//img.new-combats.tech/g4.jpg"
|
<img src="//img.new-combats.tech/g4.jpg" onclick="goToLoca(2,'назад');" width="45" height="25" id="g4" style="position:absolute;cursor:pointer; left: 428px; top: 72px;" alt=""/>
|
||||||
onclick="goToLoca(2,'назад');" width="45" height="25"
|
|
||||||
id="g4"
|
|
||||||
style="position:absolute;cursor:pointer; left: 428px; top: 72px;"/>
|
|
||||||
<?php }
|
<?php }
|
||||||
if ($d->testGone(1) > 0) { ?>
|
if ($d->testGone(1) > 0) { ?>
|
||||||
<img src="//img.new-combats.tech/g5.jpg"
|
<img src="//img.new-combats.tech/g5.jpg" onclick="goToLoca(1,'вперед');" width="46" height="26" id="g5" style="position:absolute;cursor:pointer; left: 428px; top: 26px;" alt=""/>
|
||||||
onclick="goToLoca(1,'вперед');" width="46" height="26"
|
|
||||||
id="g5"
|
|
||||||
style="position:absolute;cursor:pointer; left: 428px; top: 26px;"/>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<img src="//img.new-combats.tech/g6.jpg" width="30" height="19"
|
<img src="//img.new-combats.tech/g6.jpg" width="30" height="19" id="g6" style="position:absolute;cursor:pointer; left: 399px; top: 28px;" alt=""/>
|
||||||
id="g6"
|
<img src="//img.new-combats.tech/g7.jpg" width="24" height="19" id="g7" style="position:absolute;cursor:pointer; left: 476px; top: 28px;" alt=""/>
|
||||||
style="position:absolute;cursor:pointer; left: 399px; top: 28px;"/>
|
<div id="Dungeon" class="Dungeon" style="width:352px;height:240px;padding:0;margin:10px;text-align:center;">
|
||||||
<img src="//img.new-combats.tech/g7.jpg" width="24" height="19"
|
|
||||||
id="g7"
|
|
||||||
style="position:absolute;cursor:pointer; left: 476px; top: 28px;"/>
|
|
||||||
<div id="Dungeon" class="Dungeon" align="center"
|
|
||||||
style="width:352px;height:240px;padding:0px;margin:10px;">
|
|
||||||
<!-- / MAP \ -->
|
<!-- / MAP \ -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$mapIDs = [ // к этой хереборе вяжется javascript
|
||||||
|
3 => '4_0r',
|
||||||
|
4 => '4_0l',
|
||||||
|
5 => '3_2l',
|
||||||
|
6 => '3_2r',
|
||||||
|
9 => '3_1f',
|
||||||
|
10 => '3_1l',
|
||||||
|
11 => '3_1r',
|
||||||
|
13 => '3_0l',
|
||||||
|
14 => '2_1l',
|
||||||
|
15 => '2_1r',
|
||||||
|
16 => '2_1f',
|
||||||
|
18 => '2_0l',
|
||||||
|
19 => '1_1l',
|
||||||
|
20 => '1_1r',
|
||||||
|
21 => '1_1f',
|
||||||
|
23 => '1_0l',
|
||||||
|
24 => '0_1l',
|
||||||
|
25 => '0_1r',
|
||||||
|
26 => '0_0f',
|
||||||
|
28 => '0_0l',
|
||||||
|
];
|
||||||
|
$map = [
|
||||||
|
1 => 'LeftSide4_1',
|
||||||
|
2 => 'RightSide4_1',
|
||||||
|
3 => 'RightSide4_0',
|
||||||
|
4 => 'LeftSide4_0',
|
||||||
|
5 => 'LeftFront3_2',
|
||||||
|
6 => 'RightFront3_2',
|
||||||
|
7 => 'LeftFront3_1',
|
||||||
|
8 => 'RightFront3_1',
|
||||||
|
9 => 'LeftFront3_0',
|
||||||
|
10 => 'LeftFront3_1',
|
||||||
|
11 => 'RightFront3_1',
|
||||||
|
12 => 'LeftSide3_0',
|
||||||
|
13 => 'RightSide3_0',
|
||||||
|
14 => 'LeftFront2_1',
|
||||||
|
15 => 'RightFront2_1',
|
||||||
|
16 => 'LeftFront2_0',
|
||||||
|
17 => 'LeftSide2_0',
|
||||||
|
18 => 'RightSide2_0',
|
||||||
|
19 => 'LeftFront1_1',
|
||||||
|
20 => 'RightFront1_1',
|
||||||
|
21 => 'LeftFront1_0',
|
||||||
|
22 => 'LeftSide1_0',
|
||||||
|
23 => 'RightSide1_0',
|
||||||
|
24 => 'LeftFront0_1',
|
||||||
|
25 => 'RightFront0_1',
|
||||||
|
26 => 'LeftFront0_0',
|
||||||
|
27 => 'LeftSide0_0',
|
||||||
|
28 => 'RightSide0_0',
|
||||||
|
];
|
||||||
|
foreach ($map as $k => $v) {
|
||||||
|
if ($d->walls[$k] === 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$map[$k] = '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<div id="Floor0" class="Floor0">
|
<div id="Floor0" class="Floor0">
|
||||||
<div class="Floor1">
|
<div class="Floor1">
|
||||||
<div class="<?php if ($pd[1] == 1) {
|
|
||||||
echo 'LeftSide4_1';
|
<?php
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[2] == 1) {
|
foreach ($map as $key => $layer) {
|
||||||
echo 'RightSide4_1';
|
if (!$layer) {
|
||||||
} ?>">
|
continue;
|
||||||
<div id="4_0r" class="<?php if ($pd[3] == 1) {
|
}
|
||||||
echo 'RightSide4_0';
|
$id = !empty($mapIDs[$key]) ? " id='" . $mapIDs[$key] . "'" : '';
|
||||||
} ?>">
|
echo "<div class='$layer'$id></div>";
|
||||||
<div id="4_0l" class="<?php if ($pd[4] == 1) {
|
}
|
||||||
echo 'LeftSide4_0';
|
?>
|
||||||
} ?>">
|
|
||||||
<div id="3_2l"
|
|
||||||
class="<?php if ($pd[5] == 1) {
|
|
||||||
echo 'LeftFront3_2';
|
|
||||||
} ?>">
|
|
||||||
<div id="3_2r"
|
|
||||||
class="<?php if ($pd[6] == 1) {
|
|
||||||
echo 'RightFront3_2';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[7] == 1) {
|
|
||||||
echo 'LeftFront3_1';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[8] == 1) {
|
|
||||||
echo 'RightFront3_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="3_1l"
|
|
||||||
class="<?php if ($pd[10] == 1) {
|
|
||||||
echo 'LeftFront3_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="3_1f"
|
|
||||||
class="<?php if ($pd[9] == 1) {
|
|
||||||
echo 'LeftFront3_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="3_1r"
|
|
||||||
class="<?php if ($pd[11] == 1) {
|
|
||||||
echo 'RightFront3_1';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[12] == 1) {
|
|
||||||
echo 'LeftSide3_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="3_0l"
|
|
||||||
class="<?php if ($pd[13] == 1) {
|
|
||||||
echo 'RightSide3_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="2_1l"
|
|
||||||
class="<?php if ($pd[14] == 1) {
|
|
||||||
echo 'LeftFront2_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="2_1r"
|
|
||||||
class="<?php if ($pd[15] == 1) {
|
|
||||||
echo 'RightFront2_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="2_1f"
|
|
||||||
class="<?php if ($pd[16] == 1) {
|
|
||||||
echo 'LeftFront2_0';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[17] == 1) {
|
|
||||||
echo 'LeftSide2_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="2_0l"
|
|
||||||
class="<?php if ($pd[18] == 1) {
|
|
||||||
echo 'RightSide2_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="1_1l"
|
|
||||||
class="<?php if ($pd[19] == 1) {
|
|
||||||
echo 'LeftFront1_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="1_1r"
|
|
||||||
class="<?php if ($pd[20] == 1) {
|
|
||||||
echo 'RightFront1_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="1_1f"
|
|
||||||
class="<?php if ($pd[21] == 1) {
|
|
||||||
echo 'LeftFront1_0';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[22] == 1) {
|
|
||||||
echo 'LeftSide1_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="1_0l"
|
|
||||||
class="<?php if ($pd[23] == 1) {
|
|
||||||
echo 'RightSide1_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="0_1l"
|
|
||||||
class="<?php if ($pd[24] == 1) {
|
|
||||||
echo 'LeftFront0_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="0_1r"
|
|
||||||
class="<?php if ($pd[25] == 1) {
|
|
||||||
echo 'RightFront0_1';
|
|
||||||
} ?>">
|
|
||||||
<div id="0_0f"
|
|
||||||
class="<?php if ($pd[26] == 1) {
|
|
||||||
echo 'LeftFront0_0';
|
|
||||||
} ?>">
|
|
||||||
<div class="<?php if ($pd[27] == 1) {
|
|
||||||
echo 'LeftSide0_0';
|
|
||||||
} ?>">
|
|
||||||
<div id="0_0l"
|
|
||||||
class="<?php if ($pd[28] == 1) {
|
|
||||||
echo 'RightSide0_0';
|
|
||||||
} ?>">
|
|
||||||
<?php if ($u->info['admin'] == 0){ ?>
|
|
||||||
<div id="divWindowImg">
|
|
||||||
<img src="//img.new-combats.tech/i/1x1.gif"
|
|
||||||
usemap="#ObjectsMap"
|
|
||||||
border="0"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- / MAP \ -->
|
<!-- / MAP \ -->
|
||||||
<span class="<?php if ($pd[28] == 1) {
|
<span class="<?= $map[28] ?>">
|
||||||
echo 'RightSide0_0';
|
|
||||||
} ?>">
|
|
||||||
<?php } ?>
|
|
||||||
</span></div>
|
</span></div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -1178,46 +1075,22 @@ if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] !
|
|||||||
locGoLineDng();
|
locGoLineDng();
|
||||||
|
|
||||||
$("document").ready(function () {
|
$("document").ready(function () {
|
||||||
|
|
||||||
$('#g1').click(function () {
|
$('#g1').click(function () {
|
||||||
/* $.ajax({
|
|
||||||
url: "main.php?ajax=1",
|
|
||||||
cache: false,
|
|
||||||
success: function(html) {
|
|
||||||
$("body").html(html);
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
location.href = "/main.php";
|
location.href = "/main.php";
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#g6').click(function () {
|
$('#g6').click(function () {
|
||||||
/* $.ajax({
|
location.href = "/main.php?look=1&rnd=<?=$code?>";
|
||||||
url: "main.php?look=1&rnd=<?=$code;?>&ajax=1",
|
|
||||||
cache: false,
|
|
||||||
success: function(html) {
|
|
||||||
$("body").html(html);
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
location.href = "/main.php?look=1&rnd=<?=$code;?>";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#g7').click(function () {
|
$('#g7').click(function () {
|
||||||
/*$.ajax({
|
location.href = "/main.php?look=2&rnd=<?=$code?>";
|
||||||
url: "main.php?look=2&rnd=<?=$code;?>&ajax=1",
|
|
||||||
cache: false,
|
|
||||||
success: function(html) {
|
|
||||||
$("body").html(html);
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
location.href = "/main.php?look=2&rnd=<?=$code;?>";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<?php
|
<?php
|
||||||
if ($u->info['admin'] == 1) {
|
if ($u->isAdmin()) {
|
||||||
echo '<form method="POST">X - <input type="text" name="g__x" autocomplete="off" value="' . $u->info['x'] . '" size="4" /> Y - <input type="text" name="g__y" autocomplete="off" value="' . $u->info['y'] . '" size="4" /> <input type="submit" value="Перейти" name="go_to_admin" /><br/><input id="restorbot" type="checkbox" name="g__restorebot" autocomplete="off" /> <label for="restorbot">Восстановить павших ботов </label></form><br>
|
echo 'S:' . $u->info['s'];
|
||||||
S:' . $u->info['s'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Core\Config;
|
use Core\Config;
|
||||||
|
use Core\Db;
|
||||||
|
use Helper\Conversion;
|
||||||
use User\StatsModel;
|
use User\StatsModel;
|
||||||
|
|
||||||
if (!defined('GAME')) {
|
if (!defined('GAME')) {
|
||||||
@ -13,11 +15,8 @@ if ($u->room['file'] != 'dungeon_enter_all') {
|
|||||||
$error = ''; // Собираем ошибки.
|
$error = ''; // Собираем ошибки.
|
||||||
$dungeonGroupList = ''; // Сюда помещаем список Групп.
|
$dungeonGroupList = ''; // Сюда помещаем список Групп.
|
||||||
$dungeonGo = 1; // По умолчанию, мы идем в пещеру.
|
$dungeonGo = 1; // По умолчанию, мы идем в пещеру.
|
||||||
$dungeon = mysql_fetch_assoc(mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1'));
|
$dungeon = Db::getRow('select id as room, city, dungeon_room as d_room, shop, dungeon_id as id, dungeon_name as name from dungeon_room where id = ?', [$u->room['id']]);
|
||||||
|
$zv = [];
|
||||||
//
|
|
||||||
$dungeon['quest'] = 1;
|
|
||||||
//
|
|
||||||
|
|
||||||
$dunname = [
|
$dunname = [
|
||||||
12 => ['capitalcity', 'Пещера Тысячи Проклятий'],
|
12 => ['capitalcity', 'Пещера Тысячи Проклятий'],
|
||||||
@ -37,19 +36,16 @@ if ($u->isAdmin()) {
|
|||||||
$dunname[999] = ['capitalcity', 'Тестовая локация'];
|
$dunname[999] = ['capitalcity', 'Тестовая локация'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$roomSection = isset($_GET['rz']) && $dungeon['quest'] == 1 ? 1 : 0;
|
$roomSection = isset($_GET['rz']) ? 1 : 0;
|
||||||
// Собираем группу для похода
|
// Собираем группу для похода
|
||||||
|
|
||||||
$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
|
// Для названий репутаций в переменных $u->rep[rp_*]...
|
||||||
while ($t = mysql_fetch_array($all_dungeon)) {
|
$dungeon['list'] = Db::getColumn('select city from dungeon_room where city is not null and active = 1');
|
||||||
$dungeon['list'][] = $t['city'];
|
|
||||||
}
|
|
||||||
unset($all_dungeon);
|
|
||||||
|
|
||||||
if ($u->info['dn'] > 0) {
|
if ($u->info['dn'] > 0) {
|
||||||
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
|
$zv = Db::getRow('select dungeon_zv.*, dungeon_room.dungeon_name from dungeon_zv left join dungeon_room on dungeon_room.dungeon_id = dun where dungeon_zv.id = ?', [$u->info['dn']]);
|
||||||
if (!isset($zv['id'])) {
|
if (empty($zv['id'])) {
|
||||||
mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
Db::sql('update stats set dn = 0 where id = ?', [$u->info['id']]);
|
||||||
$u->info['dn'] = 0;
|
$u->info['dn'] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,49 +55,41 @@ $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` =
|
|||||||
if ($u->isAdmin()) {
|
if ($u->isAdmin()) {
|
||||||
unset($dungeon_timeout);
|
unset($dungeon_timeout);
|
||||||
} // $dungeon_timeout - задержка на посещение пещеры.
|
} // $dungeon_timeout - задержка на посещение пещеры.
|
||||||
if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
|
if (isset($dungeon_timeout['id'])) { // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
|
||||||
{
|
|
||||||
$dungeonGo = 0;
|
$dungeonGo = 0;
|
||||||
if (isset($_GET['start'])) {
|
if (isset($_GET['start'])) {
|
||||||
$error = 'До следующего похода осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']);
|
$error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
|
if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
|
||||||
$ig = 1;
|
//перемещаем игроков в пещеру
|
||||||
if ($ig > 0) { //перемещаем игроков в пещеру
|
|
||||||
|
|
||||||
$dungeon['room'] = 321;
|
$dungeon['room'] = 321;
|
||||||
$dungeon['id'] = $zv['dun'];
|
$dungeon['id'] = $zv['dun'];
|
||||||
//
|
//
|
||||||
$ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
|
Db::sql('insert into dungeon_now (uid, id2, name, time_start) values (?,?,?,unix_timestamp())', [$zv['uid'], $zv['dun'], $zv['dungeon_name']]);
|
||||||
VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $zv['dun'] . '","' . $dunname[$zv['dun']][1] . '","' . time() . '")');
|
$zid = Db::lastInsertId();
|
||||||
if ($ins) {
|
|
||||||
$zid = mysql_insert_id();
|
Db::sql('delete from dungeon_zv where id = ?', [$zv['id']]);
|
||||||
mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
|
||||||
//обновляем пользователей
|
//обновляем пользователей
|
||||||
$su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/');
|
$uids = Db::getColumn('select id from stats where dn = ?', [$zv['id']]);
|
||||||
$ids = '';
|
|
||||||
|
|
||||||
$map_locs = [];
|
$map_locs = [];
|
||||||
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"');
|
|
||||||
while ($plm2 = mysql_fetch_array($spm2)) {
|
foreach (Db::getRows('select x, y from dungeon_map where id_dng = ?', [$zv['dun']]) as $pos) {
|
||||||
$map_locs[] = [$plm2['x'], $plm2['y']];
|
$map_locs[] = [$pos['x'], $pos['y']];
|
||||||
}
|
}
|
||||||
unset($spm2, $plm2);
|
|
||||||
|
|
||||||
$pxd = 0;
|
$pxd = 0;
|
||||||
while ($pu = mysql_fetch_array($su)) {
|
foreach ($uids as $uid) {
|
||||||
$pxd++;
|
$pxd++;
|
||||||
$ids .= ' `id` = "' . $pu['id'] . '" OR';
|
|
||||||
if ($u->stats['silver'] >= 3) {
|
$u->addAction(time(), 'psh0', $uid, $uid);
|
||||||
$u->addAction((time() - ((60 * 60 * 2) / 100 * 30)), 'psh0', $pu['id'], $pu['id']);
|
|
||||||
} else {
|
|
||||||
$u->addAction(time(), 'psh0', $pu['id'], $pu['id']);
|
|
||||||
}
|
|
||||||
if (date('w') == 0 || date('w') == 6 || date('w') == 1) {
|
if (date('w') == 0 || date('w') == 6 || date('w') == 1) {
|
||||||
StatsModel::addRepexpById($pu['id'], 5); //Репутация +5
|
StatsModel::addRepexpById($uid, 5); //Репутация +5
|
||||||
}
|
}
|
||||||
|
|
||||||
//Добавляем квестовые обьекты для персонажей
|
//Добавляем квестовые обьекты для персонажей
|
||||||
$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
|
$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
|
||||||
while ($pl2 = mysql_fetch_array($sp)) {
|
while ($pl2 = mysql_fetch_array($sp)) {
|
||||||
@ -126,196 +114,83 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
|
|||||||
$ml_arr = [];
|
$ml_arr = [];
|
||||||
foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
|
foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
|
||||||
if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) {
|
if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) {
|
||||||
if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
|
if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1] || !isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) {
|
||||||
elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
|
$ml_arr[] = $ml;
|
||||||
} else $ml_arr[] = $ml;
|
}
|
||||||
|
} else {
|
||||||
|
$ml_arr[] = $ml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($ml_arr)) {
|
||||||
|
$ml_arr = $map_locs;
|
||||||
}
|
}
|
||||||
if (isset($ml_arr) && count($ml_arr) == 0) $ml_arr = $map_locs;
|
|
||||||
//Добавляем обьект для юзера
|
//Добавляем обьект для юзера
|
||||||
$j = 0;
|
$j = 0;
|
||||||
while ($j < $xr2[1]) {
|
while ($j < $xr2[1]) {
|
||||||
$cord = $ml_arr[rand(0, count($ml_arr) - 1)];
|
$cord = $ml_arr[rand(0, count($ml_arr) - 1)];
|
||||||
if ($cord[0] != 0 || $cord[1] != 0) {
|
if ($cord[0] != 0 || $cord[1] != 0) {
|
||||||
mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
|
mysql_query(
|
||||||
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
|
'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
|
||||||
)');
|
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time(
|
||||||
|
) . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
|
||||||
|
)'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Предмет находится в конкретном месте
|
//Предмет находится в конкретном месте
|
||||||
mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
|
mysql_query(
|
||||||
|
'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
|
||||||
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
|
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
|
||||||
)');
|
)'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$ids = rtrim($ids, 'OR');
|
|
||||||
$snew = 1;
|
Db::sql('update stats left join users on users.id = stats.id set s = 1, dnow = ?, room = 405 where users.id in (?) limit ?', [$zid, implode(',', $uids), $zv['team_max'] + 1]);
|
||||||
$upd1 = mysql_query('UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
|
|
||||||
if ($upd1) {
|
|
||||||
$upd2 = mysql_query('UPDATE `users` SET `room` = "405" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
|
|
||||||
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
|
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
|
||||||
//Добавляем ботов
|
//Добавляем ботов
|
||||||
$vls = '';
|
$botarray = [];
|
||||||
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $zv['dun'] . '"');
|
$dbots = Db::getRows('select * from dungeon_bots where for_dn = ?', [$zv['dun']]);
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
foreach ($dbots as $bot) {
|
||||||
if ($pl['id_bot'] == 0 && $pl['bot_group'] != '') {
|
if ($bot['id_bot'] == 0 && $bot['bot_group'] != '') {
|
||||||
$bots = explode(',', $pl['bot_group']);
|
$bots = explode(',', $bot['bot_group']);
|
||||||
$pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
|
$bot['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
|
||||||
}
|
}
|
||||||
if ($pl['id_bot'] > 0) {
|
if ($bot['id_bot'] > 0) {
|
||||||
$vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),';
|
$botarray[] = [$zid, $bot['id_bot'], $bot['colvo'], $bot['items'], $bot['x'], $bot['y'], $bot['dialog'], intval($bot['items']), $bot['go_bot'], $bot['noatack']];
|
||||||
}
|
}
|
||||||
unset($bots);
|
|
||||||
}
|
}
|
||||||
$vls = rtrim($vls, ',');
|
|
||||||
//var_dump($vls);
|
$addbots = Db::prepare('insert into dungeon_bots (dn, id_bot, colvo, items, x, y, dialog, atack, go_bot, noatack) values (?,?,?,?,?,?,?,?,?,?)');
|
||||||
$ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . '');
|
foreach ($botarray as $b) {
|
||||||
|
$addbots->execute($b);
|
||||||
|
}
|
||||||
|
|
||||||
//Добавляем обьекты
|
//Добавляем обьекты
|
||||||
$vls = '';
|
$objarray = [];
|
||||||
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $zv['dun'] . '"');
|
$dobjects = Db::getRows('select * from dungeon_obj where for_dn = ?', [$zv['dun']]);
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
|
||||||
$vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
|
foreach ($dobjects as $object) {
|
||||||
|
$objarray[] = [$zid, $object['name'], $object['img'], $object['x'], $object['y'], $object['action'], $object['type'], $object['w'], $object['h'], $object['s'], $object['s2'],
|
||||||
|
$object['os1'], $object['os2'], $object['os3'], $object['os4'], $object['type2'], $object['top'], $object['left'], $object['date']];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Добавление обьектов (день святого валентина)
|
$addobjects = Db::prepare('insert into dungeon_obj (dn, name, img, x, y, action, type, w, h, s, s2, os1, os2, os3, os4, type2, top, `left`, date) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
|
||||||
if (floor(date('m')) == 2 && floor(date('d')) >= 7 && floor(date('d')) <= 20) {
|
|
||||||
if (floor(date('m')) == 2 && floor(date('d')) >= 14 && floor(date('d')) <= 20) {
|
foreach ($objarray as $o) {
|
||||||
//Появляются мобы которые принимают цветы
|
$addobjects->execute($o);
|
||||||
$vlsbts = '';
|
|
||||||
$ins1bts = null;
|
|
||||||
if ($zv['dun'] == 1) {
|
|
||||||
//4 уровня (КАНАЛИЗАЦИЯ)
|
|
||||||
$vlsbts .= '("' . $zid . '","410","1","","-5","3","8","0","0"),';
|
|
||||||
//4-7 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","413","1","","8","46","9","0","0"),';
|
|
||||||
} elseif ($zv['dun'] == 12) {
|
|
||||||
//(ПТП)
|
|
||||||
//4-7 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","413","1","","-3","18","9","0","0"),';
|
|
||||||
//4-9 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","414","1","","-2","29","10","0","0"),';
|
|
||||||
} elseif ($zv['dun'] == 3) {
|
|
||||||
//(КАТАКОМБЫ)
|
|
||||||
//4-7 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","413","1","","15","8","9","0","0"),';
|
|
||||||
//4-9 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","414","1","","3","35","10","0","0"),';
|
|
||||||
} elseif ($zv['dun'] == 101) {
|
|
||||||
//(бездна)
|
|
||||||
//4-7 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","413","1","","-2","21","9","0","0"),';
|
|
||||||
//4-9 уровня
|
|
||||||
$vlsbts .= '("' . $zid . '","414","1","","2","43","10","0","0"),';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($vlsbts != '') {
|
exit('<script>location="main.php?rnd=' . PassGen::intCode() . '";</script>');
|
||||||
$vlsbts = rtrim($vlsbts, ',');
|
|
||||||
$ins1bts = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`) VALUES ' . $vlsbts . '');
|
|
||||||
}
|
|
||||||
unset($vlsbts, $ins1bts);
|
|
||||||
}
|
|
||||||
//Раскидываем предметы по пещере (Блёклый подземник)
|
|
||||||
$dcords = [];
|
|
||||||
$c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $zv['dun'] . '"');
|
|
||||||
while ($c_pl = mysql_fetch_array($c_sp)) {
|
|
||||||
$dcords[] = [$c_pl['x'], $c_pl['y']];
|
|
||||||
}
|
|
||||||
$fcords = [];
|
|
||||||
$i = 1;
|
|
||||||
while ($i <= $pxd) {
|
|
||||||
$j = rand(1, 10);
|
|
||||||
while ($j >= 0) {
|
|
||||||
$rndxy = rand(0, count($dcords) - 1);
|
|
||||||
$rndx = $dcords[$rndxy][0];
|
|
||||||
$rndy = $dcords[$rndxy][1];
|
|
||||||
$fcords[$rndx][$rndy] = true;
|
|
||||||
unset($dcords[$rndxy]);
|
|
||||||
$vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
|
|
||||||
$j--;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
//Раскидываем предметы по пещере (Черепичный подземник)
|
|
||||||
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $zv['dun'] . '"');
|
|
||||||
$test = [];
|
|
||||||
$dcords2 = [];
|
|
||||||
$dcords3 = [];
|
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
|
||||||
if (!isset($test[$pl['id_bot']])) {
|
|
||||||
$test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1'));
|
|
||||||
}
|
|
||||||
if (isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2) {
|
|
||||||
if ($test[$pl['id_bot']]['level'] > 6) {
|
|
||||||
$dcords2[] = [$pl['x'], $pl['y']];
|
|
||||||
}
|
|
||||||
if ($test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9) {
|
|
||||||
$dcords3[] = [$pl['x'], $pl['y']];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$test[$pl['id_bot']] = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$i = 1;
|
|
||||||
while ($i <= $pxd) {
|
|
||||||
$j = rand(1, 5);
|
|
||||||
while ($j >= 0) {
|
|
||||||
$rndxy = rand(0, count($dcords2) - 1);
|
|
||||||
$rndx = $dcords2[$rndxy][0];
|
|
||||||
$rndy = $dcords2[$rndxy][1];
|
|
||||||
if (!isset($fcords[$rndx][$rndy]) && isset($dcords2[$rndxy][0])) {
|
|
||||||
$fcords[$rndx][$rndy] = true;
|
|
||||||
unset($dcords2[$rndxy]);
|
|
||||||
$vls .= '("' . $zid . '","Черепичный подземник","vbig2.gif","' . $rndx . '","' . $rndy . '","fileact:vbig2","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
|
|
||||||
}
|
|
||||||
$j--;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
$i = 1;
|
|
||||||
while ($i <= $pxd) {
|
|
||||||
$j = rand(1, 2);
|
|
||||||
while ($j >= 0) {
|
|
||||||
$rndxy = rand(0, count($dcords3) - 1);
|
|
||||||
$rndx = $dcords3[$rndxy][0];
|
|
||||||
$rndy = $dcords3[$rndxy][1];
|
|
||||||
if (!isset($fcords[$rndx][$rndy]) && isset($dcords3[$rndxy][0])) {
|
|
||||||
$fcords[$rndx][$rndy] = true;
|
|
||||||
unset($dcords3[$rndxy]);
|
|
||||||
$vls .= '("' . $zid . '","Кровавый подземник","vbig3.gif","' . $rndx . '","' . $rndy . '","fileact:vbig3","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
|
|
||||||
}
|
|
||||||
$j--;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
unset($test);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
$vls = rtrim($vls, ',');
|
|
||||||
if ($vls != '') {
|
|
||||||
$ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '');
|
|
||||||
} else {
|
|
||||||
$ins2 = true;
|
|
||||||
}
|
|
||||||
if ($upd2 && $ins1 && $ins2) {
|
|
||||||
die('<script>location="main.php?rnd=' . $code . '";</script>');
|
|
||||||
} else {
|
|
||||||
var_dump($upd2, $ins1, $ins2);
|
|
||||||
$error = 'Ошибка перехода в подземелье... a1';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$error = 'Ошибка перехода в подземелье... a2';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$error = 'Ошибка перехода в подземелье... a3';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) {
|
} elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) {
|
||||||
if (!isset($zv['id'])) {
|
if (!isset($zv['id'])) {
|
||||||
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1'));
|
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1'));
|
||||||
@ -459,14 +334,16 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
|
|||||||
$dun5 = 12; //ПТП
|
$dun5 = 12; //ПТП
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
$ins = mysql_query('INSERT INTO `dungeon_zv`
|
$ins = mysql_query(
|
||||||
|
'INSERT INTO `dungeon_zv`
|
||||||
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
|
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
|
||||||
("all","' . time() . '","' . $u->info['id'] . '","' . $dun5 . '",
|
("all","' . time() . '","' . $u->info['id'] . '","' . $dun5 . '",
|
||||||
"' . mysql_real_escape_string($_POST['pass']) . '",
|
"' . mysql_real_escape_string($_POST['pass']) . '",
|
||||||
"' . mysql_real_escape_string($_POST['text']) . '",
|
"' . mysql_real_escape_string($_POST['text']) . '",
|
||||||
"8",
|
"8",
|
||||||
"21",
|
"21",
|
||||||
"5")');
|
"5")'
|
||||||
|
);
|
||||||
if ($ins) {
|
if ($ins) {
|
||||||
$u->info['dn'] = mysql_insert_id();
|
$u->info['dn'] = mysql_insert_id();
|
||||||
$zv['id'] = $u->info['dn'];
|
$zv['id'] = $u->info['dn'];
|
||||||
@ -485,13 +362,17 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
|
|||||||
$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
|
$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
|
||||||
while ($pl = mysql_fetch_array($sp)) {
|
while ($pl = mysql_fetch_array($sp)) {
|
||||||
$dungeonGroupList .= '<div style="padding:2px;">';
|
$dungeonGroupList .= '<div style="padding:2px;">';
|
||||||
if ($u->info['dn'] == 0) $dungeonGroupList .= '<input type="radio" name="goid" id="goid" value="' . $pl['id'] . '" />';
|
if ($u->info['dn'] == 0) {
|
||||||
|
$dungeonGroupList .= '<input type="radio" name="goid" id="goid" value="' . $pl['id'] . '" />';
|
||||||
|
}
|
||||||
$dungeonGroupList .= '<span class="date">' . date('H:i', $pl['time']) . '</span> ';
|
$dungeonGroupList .= '<span class="date">' . date('H:i', $pl['time']) . '</span> ';
|
||||||
|
|
||||||
$dungeonGroupList .= '<span><img title="' . $dunname[$pl['dun']][1] . '" style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/' . $dunname[$pl['dun']][0] . '.gif" /></span> ';
|
$dungeonGroupList .= '<span><img title="' . $dunname[$pl['dun']][1] . '" style="vertical-align:bottom" src="//img.new-combats.tech/i/city_ico2/' . $dunname[$pl['dun']][0] . '.gif" /></span> ';
|
||||||
|
|
||||||
$pus = ''; //группа
|
$pus = ''; //группа
|
||||||
$su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '');
|
$su = mysql_query(
|
||||||
|
'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
|
||||||
|
);
|
||||||
while ($pu = mysql_fetch_array($su)) {
|
while ($pu = mysql_fetch_array($su)) {
|
||||||
$pus .= '<b>' . $pu['login'] . '</b> [' . $pu['level'] . ']<a href="info/' . $pu['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_' . $pu['city'] . '.gif" title="Инф. о ' . $pu['login'] . '"></a>';
|
$pus .= '<b>' . $pu['login'] . '</b> [' . $pu['level'] . ']<a href="info/' . $pu['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_' . $pu['city'] . '.gif" title="Инф. о ' . $pu['login'] . '"></a>';
|
||||||
$pus .= ', ';
|
$pus .= ', ';
|
||||||
@ -501,7 +382,9 @@ while ($pl = mysql_fetch_array($sp)) {
|
|||||||
$dungeonGroupList .= $pus;
|
$dungeonGroupList .= $pus;
|
||||||
unset($pus);
|
unset($pus);
|
||||||
|
|
||||||
if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>';
|
if ($pl['pass'] != '' && $u->info['dn'] == 0) {
|
||||||
|
$dungeonGroupList .= ' <small><input type="password" name="pass_com" value=""></small>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($pl['com'] != '') {
|
if ($pl['com'] != '') {
|
||||||
$dl = '';
|
$dl = '';
|
||||||
@ -628,7 +511,9 @@ if ($roomSection == 1) {
|
|||||||
<form autocomplete="off" action='/main.php' method="post" name="F1" id="F1">
|
<form autocomplete="off" action='/main.php' method="post" name="F1" id="F1">
|
||||||
<?php
|
<?php
|
||||||
$qsee = '';
|
$qsee = '';
|
||||||
$hgo = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1);
|
$hgo = $u->testAction(
|
||||||
|
'`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1
|
||||||
|
);
|
||||||
$qc = 0; // Quest Count
|
$qc = 0; // Quest Count
|
||||||
$qcc = [];
|
$qcc = [];
|
||||||
//Генерируем список текущих квестов
|
//Генерируем список текущих квестов
|
||||||
@ -684,7 +569,11 @@ if ($roomSection == 1) {
|
|||||||
$dun5 = 12; //ПТП
|
$dun5 = 12; //ПТП
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
$hgo = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . mysql_real_escape_string($qst_city) . '" LIMIT 1', 1);
|
$hgo = $u->testAction(
|
||||||
|
'`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . mysql_real_escape_string(
|
||||||
|
$qst_city
|
||||||
|
) . '" LIMIT 1', 1
|
||||||
|
);
|
||||||
//$qcc
|
//$qcc
|
||||||
if ($qcc[$dun5] > 0) {
|
if ($qcc[$dun5] > 0) {
|
||||||
echo '<font color="red"><b>У Вас уже есть задание, завершите его или отмените для получения нового.</b></font><br>';
|
echo '<font color="red"><b>У Вас уже есть задание, завершите его или отмените для получения нового.</b></font><br>';
|
||||||
@ -755,7 +644,9 @@ if ($roomSection == 1) {
|
|||||||
$hgo3 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_suncity" LIMIT 1', 1);
|
$hgo3 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_suncity" LIMIT 1', 1);
|
||||||
$hgo4 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_demonscity" LIMIT 1', 1);
|
$hgo4 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_demonscity" LIMIT 1', 1);
|
||||||
$hgo5 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_dreamscity" LIMIT 1', 1);
|
$hgo5 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_dreamscity" LIMIT 1', 1);
|
||||||
$hgo6 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_abandonedplain" LIMIT 1', 1);
|
$hgo6 = $u->testAction(
|
||||||
|
'`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_abandonedplain" LIMIT 1', 1
|
||||||
|
);
|
||||||
$hgo7 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_izlom16" LIMIT 1', 1);
|
$hgo7 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_izlom16" LIMIT 1', 1);
|
||||||
$hgo8 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_sandcity" LIMIT 1', 1);
|
$hgo8 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_sandcity" LIMIT 1', 1);
|
||||||
$hgo9 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_emeraldscity" LIMIT 1', 1);
|
$hgo9 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_emeraldscity" LIMIT 1', 1);
|
||||||
@ -860,7 +751,9 @@ if ($roomSection == 1) {
|
|||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
}
|
}
|
||||||
} else echo 'Недостаточно репутации.';
|
} else {
|
||||||
|
echo 'Недостаточно репутации.';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
}
|
}
|
||||||
@ -945,7 +838,11 @@ if ($roomSection == 1) {
|
|||||||
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
|
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
|
||||||
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
|
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
|
||||||
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||||
if ($r) $rt = 1; else $rt = 0;
|
if ($r) {
|
||||||
|
$rt = 1;
|
||||||
|
} else {
|
||||||
|
$rt = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($rt == 1) {
|
if ($rt == 1) {
|
||||||
@ -957,7 +854,9 @@ if ($roomSection == 1) {
|
|||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
}
|
}
|
||||||
} else echo 'Недостаточно репутации.';
|
} else {
|
||||||
|
echo 'Недостаточно репутации.';
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
@ -982,7 +881,11 @@ if ($roomSection == 1) {
|
|||||||
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
|
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
|
||||||
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
|
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
|
||||||
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||||
if ($r) $rt = 1; else $rt = 0;
|
if ($r) {
|
||||||
|
$rt = 1;
|
||||||
|
} else {
|
||||||
|
$rt = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($rt == 1) {
|
if ($rt == 1) {
|
||||||
@ -997,7 +900,9 @@ if ($roomSection == 1) {
|
|||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
}
|
}
|
||||||
} else echo 'Недостаточно репутации.';
|
} else {
|
||||||
|
echo 'Недостаточно репутации.';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
echo '<font color="red"><b>Ничего не получилось...</b></font><br>';
|
||||||
}
|
}
|
||||||
@ -1049,13 +954,19 @@ if ($roomSection == 1) {
|
|||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
$chk = mysql_fetch_array(mysql_query('SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'));
|
$chk = mysql_fetch_array(
|
||||||
|
mysql_query(
|
||||||
|
'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (isset($_GET['buy777']) && $chk[0] > 0) {
|
if (isset($_GET['buy777']) && $chk[0] > 0) {
|
||||||
?>
|
?>
|
||||||
<fieldset style='margin-top:15px;'>
|
<fieldset style='margin-top:15px;'>
|
||||||
<p><span style="padding-left: 10px">
|
<p><span style="padding-left: 10px">
|
||||||
<?php
|
<?php
|
||||||
$chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000');
|
$chk_cl = mysql_query(
|
||||||
|
'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
|
||||||
|
);
|
||||||
while ($chk_pl = mysql_fetch_array($chk_cl)) {
|
while ($chk_pl = mysql_fetch_array($chk_cl)) {
|
||||||
if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
|
if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
|
||||||
$x++;
|
$x++;
|
||||||
@ -1167,7 +1078,9 @@ if ($roomSection == 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . '<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)</small>';
|
echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(
|
||||||
|
60 * 60 * 2 - time() + $dungeon_timeout['time']
|
||||||
|
) . '<br><small style="color:grey">Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;)</small>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user