Merge pull request 'dev-lopar-chat-fixes' (#43) from dev-lopar-chat-fixes into dev

Reviewed-on: new-combats.com/game#43
This commit is contained in:
Ivor Barhansky 2023-02-02 15:43:10 +00:00
commit 395153f291
14 changed files with 632 additions and 633 deletions

View File

@ -3728,11 +3728,13 @@ class Battle
); );
if (isset($a['id'])) { if (isset($a['id'])) {
if ($a['eda'] < 1) { if ($a['eda'] < 1) {
$u->send( $cmsg = new ChatMessage();
'', $this->users[$i]['room'], $this->users[$i]['city'], '', $cmsg->setRoom($this->users[$i]['room']);
$this->users[$i]['login'], '<strong>' . $a['name'] . '</strong> нуждается в еде...', $cmsg->setCity($this->users[$i]['city']);
time(), 6, 0, 0, 0, 1 $cmsg->setTo($this->users[$i]['login']);
); $cmsg->setText('<strong>' . $a['name'] . '</strong> нуждается в еде...');
$cmsg->setType(6);
$chat->sendMsg($cmsg);
} }
} }
} }

View File

@ -108,20 +108,17 @@ class Chat
text, text,
time, time,
type, type,
toChat,
spam, spam,
invis, invis,
da, da,
`delete`, `delete`,
global,
molch, molch,
nosee,
typeTime, typeTime,
dn, dn,
frv frv
) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';
$args = [ $args = [
$chatMessage->getNew(), 1,
$chatMessage->getSound(), $chatMessage->getSound(),
$chatMessage->getColor(), $chatMessage->getColor(),
$chatMessage->getCity(), $chatMessage->getCity(),
@ -131,14 +128,11 @@ class Chat
$chatMessage->getText(), $chatMessage->getText(),
$chatMessage->getTime(), $chatMessage->getTime(),
$chatMessage->getType(), $chatMessage->getType(),
$chatMessage->getToChat(),
$chatMessage->getSpam(), $chatMessage->getSpam(),
$chatMessage->getInvis(), $chatMessage->getInvis(),
$chatMessage->getDa(), $chatMessage->getDa(),
$chatMessage->getDelete(), $chatMessage->getDelete(),
$chatMessage->getGlobal(),
$chatMessage->getMolch(), $chatMessage->getMolch(),
$chatMessage->getNosee(),
$chatMessage->getTypeTime(), $chatMessage->getTypeTime(),
$chatMessage->getDn(), $chatMessage->getDn(),
$chatMessage->getFireworks(), $chatMessage->getFireworks(),

View File

@ -1,11 +1,10 @@
<?php <?php
#todo êàæåòñÿ ÷àñòü ïîëåé âðîäå city, room, color, invis íàïðÿìèê çàâèñèò îò login (îòïðàâèòåëü) #todo кажется часть полей вроде city, room, color, invis напрямик зависит от login (отправитель)
#todo åñëè ýòî òàê, ÷àñòüþ ñåòòåðîâ ìîæíî áóäåò ïîæåðòâîâàòü. #todo если это так, частью сеттеров можно будет пожертвовать.
class ChatMessage class ChatMessage
{ {
private int $new = 1;
private string $city = 'capitalcity'; private string $city = 'capitalcity';
private int $room = 0; private int $room = 0;
private string $login = ''; private string $login = '';
@ -13,7 +12,6 @@ class ChatMessage
private string $text; private string $text;
private int $time = 0; private int $time = 0;
private int $type = 0; private int $type = 0;
private int $toChat = 0;
private int $typeTime = 0; private int $typeTime = 0;
private string $color = '#000'; private string $color = '#000';
private int $sound = 0; private int $sound = 0;
@ -21,13 +19,11 @@ class ChatMessage
private bool $isAlert = false; private bool $isAlert = false;
private int $invis = 0; private int $invis = 0;
private int $da = 0; private int $da = 0;
private int $nosee = 0;
private int $delete = 0; private int $delete = 0;
private int $molch = 0; private int $molch = 0;
private int $global = 0;
private int $dn = 0; private int $dn = 0;
/** /**
* Ôååðâåðêè, ÷¸ðò ïîäåðè! * Феерверки, чёрт подери!
* _incl_data\class\magic\feerverks.php * _incl_data\class\magic\feerverks.php
* @var string|null * @var string|null
*/ */
@ -49,22 +45,6 @@ class ChatMessage
$this->dn = $dn; $this->dn = $dn;
} }
/**
* @return int
*/
public function getGlobal(): int
{
return $this->global;
}
/**
* @param int $global
*/
public function setGlobal(int $global): void
{
$this->global = $global;
}
/** /**
* @return int * @return int
*/ */
@ -97,22 +77,6 @@ class ChatMessage
$this->molch = $molch; $this->molch = $molch;
} }
/**
* @return int
*/
public function getNosee(): int
{
return $this->nosee;
}
/**
* @param int $nosee
*/
public function setNosee(int $nosee): void
{
$this->nosee = $nosee;
}
/** /**
* @return int * @return int
*/ */
@ -178,14 +142,6 @@ class ChatMessage
$this->sound = $sound; $this->sound = $sound;
} }
/**
* @return int
*/
public function getNew(): int
{
return $this->new;
}
/** /**
* @return string * @return string
*/ */
@ -224,7 +180,7 @@ class ChatMessage
public function getText(): string public function getText(): string
{ {
if ($this->isAlert) { if ($this->isAlert) {
return '<span style="color: red">Âíèìàíèå!</span>&nbsp;' . $this->text; return '<span style="color: red">Внимание!</span>&nbsp;' . $this->text;
} }
return $this->text; return $this->text;
} }
@ -248,14 +204,6 @@ class ChatMessage
return $this->type; return $this->type;
} }
/**
* @return int
*/
public function getToChat(): int
{
return $this->toChat;
}
/** /**
* @return int * @return int
*/ */
@ -271,16 +219,6 @@ class ChatMessage
return $this->color; return $this->color;
} }
/**
* @param int $new
*/
public function setNew(int $new): void
{
if ($new !== 1) {
$this->new = $new;
}
}
/** /**
* @param string $city * @param string $city
*/ */
@ -337,14 +275,6 @@ class ChatMessage
$this->type = $type; $this->type = $type;
} }
/**
* @param int $toChat
*/
public function setToChat(int $toChat): void
{
$this->toChat = $toChat;
}
/** /**
* @param int $typeTime * @param int $typeTime
*/ */
@ -362,7 +292,7 @@ class ChatMessage
} }
/** /**
* Äîáàâëÿåò ê ñîîáùåíèþ êðàñíûé ïðåôèêñ "Âíèìàíèå!". * Добавляет к сообщению красный префикс "Внимание!".
* @param bool $isAlert * @param bool $isAlert
*/ */
public function setIsAlert(bool $isAlert): void public function setIsAlert(bool $isAlert): void
@ -387,7 +317,7 @@ class ChatMessage
} }
/** /**
* Çàãëóøêà äëÿ îïöèîíàëüíîé ïåðåäà÷è ïàðàìåòðîâ. * Заглушка для опциональной передачи параметров.
* @param string $json * @param string $json
* @return void * @return void
*/ */
@ -395,8 +325,9 @@ class ChatMessage
{ {
$params = json_decode($json, true); $params = json_decode($json, true);
foreach ($params as $param => $value) { foreach ($params as $param => $value) {
if (property_exists($this, $param)) { $method = 'set' . ucfirst($param);
$this->$param = $value; if (method_exists(self::class, $method)) {
$this->$method($value);
} }
} }
} }

View File

@ -211,7 +211,6 @@ class GameDealer
$chatDto->setTo($user['login']); $chatDto->setTo($user['login']);
$chatDto->setText($r); $chatDto->setText($r);
$chatDto->setType(5); $chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
} else { } else {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'У пользователя отсутствует банк'], ['id', $this->c['id']]]]]; $this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'У пользователя отсутствует банк'], ['id', $this->c['id']]]]];

View File

@ -2506,10 +2506,13 @@ class Magic
} }
} else { } else {
$u->send( $cmsg = new ChatMessage();
'', $u->info['room'], $u->info['city'], '', $u->info['login'], $cmsg->setRoom($u->info['room']);
'<b>' . $a['name'] . '</b> нуждается в еде...', time(), 6, 0, 0, 0, 1 $cmsg->setCity($u->info['city']);
); $cmsg->setTo($u->info['login']);
$cmsg->setText('<strong>' . $a['name'] . '</strong> нуждается в еде...');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
} }
} }
} }

View File

@ -880,7 +880,6 @@ class Quests
$chatDto->setTo($u->info['login']); $chatDto->setTo($u->info['login']);
$chatDto->setText($r); $chatDto->setText($r);
$chatDto->setType(5); $chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
return $r; return $r;
@ -1003,7 +1002,6 @@ class Quests
$chatDto->setTo($u->info['login']); $chatDto->setTo($u->info['login']);
$chatDto->setText($r); $chatDto->setText($r);
$chatDto->setType(5); $chatDto->setType(5);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
} }
} }

View File

@ -11198,61 +11198,6 @@ LIMIT 1'
return $rt; return $rt;
} }
/**
* Уродец, дублирующий Chat то тут то там.
* Сидишь, никого не трогаешь, правишь и вдруг класс User тебя с размаху мордой в грязь!
* Привет пачка вызовов буквально отовсюду, потому что класс User это же так удобно, класс User он же везде...
* @param string $color
* @param int $room
* @param string $city
* @param string $from
* @param string $to
* @param string $text
* @param int $time
* @param int $type
* @param int $toChat
* @param int $spam
* @param int $sound
* @param int $new
* @param int $typeTime
* @param int $global
* @deprecated
* @todo убрать нахуй заменив нативными вызовами.
*/
public function send(
string $color,
int $room,
string $city,
string $from,
string $to,
string $text,
int $time,
int $type,
int $toChat,
int $spam,
int $sound,
int $new = 1,
int $typeTime = 0,
int $global = 0
) {
$cmsg = new ChatMessage();
$cmsg->setColor($color);
$cmsg->setCity($city);
$cmsg->setRoom($room);
$cmsg->setLogin($from);
$cmsg->setTo($to);
$cmsg->setText($text);
$cmsg->setTime($time);
$cmsg->setType($type);
$cmsg->setToChat($toChat);
$cmsg->setSpam($spam);
$cmsg->setSound($sound);
$cmsg->setNew($new);
$cmsg->setTypeTime($typeTime);
$cmsg->setGlobal($global);
(new Chat())->sendMsg($cmsg);
}
//получаем уровень //получаем уровень
public function testLevel() public function testLevel()
{ {
@ -11322,6 +11267,12 @@ LIMIT 1'
} }
$i = 0; $i = 0;
$ult = 0; $ult = 0;
$sex1 = '';
if ($this->info['sex'] == 1) {
$sex1 = 'ла';
}
while ($i != 1) { while ($i != 1) {
if (Config::get('nolevel') && $this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) { if (Config::get('nolevel') && $this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
$tlus = mysql_fetch_array( $tlus = mysql_fetch_array(
@ -11338,7 +11289,9 @@ LIMIT 1'
); );
} }
} }
if ($this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) { if ($this->info['exp'] < $lvl['exp'] || !isset($lvln['upLevel'])) {
$i = 1;
} else {
if ($lvl['nextLevel'] > $this->info['level']) { if ($lvl['nextLevel'] > $this->info['level']) {
//повышаем выносливость //повышаем выносливость
$a4 = 1; $a4 = 1;
@ -11353,11 +11306,6 @@ LIMIT 1'
} }
$this->stats['s4'] += $a4; $this->stats['s4'] += $a4;
$sex1 = '';
if ($this->info['sex'] == 1) {
$sex1 = 'ла';
}
$ult = 1; $ult = 1;
//Рефералы //Рефералы
@ -11404,6 +11352,12 @@ LIMIT 1'
} }
} }
$cmsg = new ChatMessage();
$cmsg->setRoom($this->info['room']);
$cmsg->setCity($this->info['city']);
$cmsg->setTo($rlog['login']);
$cmsg->setType(6);
if (($rtg || !isset($mtest['id'])) && isset($rlog['id'])) { if (($rtg || !isset($mtest['id'])) && isset($rlog['id'])) {
$rfs['data'] = explode('|', $rlogs['ref_data']); $rfs['data'] = explode('|', $rlogs['ref_data']);
$ekr = '0.00'; $ekr = '0.00';
@ -11420,23 +11374,22 @@ LIMIT 1'
$rlog['id'] $rlog['id']
) . '" LIMIT 1' ) . '" LIMIT 1'
); );
if ($up) { if ($up) {
//Реферал 1-го уровня //Реферал 1-го уровня
$krtxt = ''; $krtxt = '';
if ($kr > 0) { if ($kr > 0) {
$krtxt .= '' . $kr . ' КР'; $krtxt .= "$kr КР";
if ($ekr > 0) {
$krtxt .= ', ';
}
} }
if ($ekr > 0) { if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР'; $krtxt .= ", $ekr ЕКР";
} }
$this->send(
'', $this->info['room'], $this->info['city'], '', $rlog['login'], $cmsg->setText(
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
-1, 6, 0, 0, 0, 1
); );
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank']; $rlog['catch'] += $bn['add_bank'];
mysql_query( mysql_query(
'UPDATE `users` SET `catch` = "' . $rlog['catch'] . '" WHERE `id` = "' . $rlog['id'] . '" LIMIT 1' 'UPDATE `users` SET `catch` = "' . $rlog['catch'] . '" WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11455,20 +11408,17 @@ LIMIT 1'
if (isset($rlog['id'])) { if (isset($rlog['id'])) {
$krtxt = ''; $krtxt = '';
if ($kr > 0) { if ($kr > 0) {
$krtxt .= '' . $kr . ' КР'; $krtxt .= "$kr КР";
if ($ekr > 0) {
$krtxt .= ', ';
}
} }
if ($ekr > 0) { if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР'; $krtxt .= ", $ekr ЕКР";
} }
$this->send(
'', $this->info['room'], $this->info['city'], '', $cmsg->setText(
$rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> (2-го уровня от &quot;' . $llogin . '&quot; ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (2-го уровня от &quot;' . $llogin . '&quot; ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt,
-1, 6, 0, 0, 0, 1
); );
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank']; $rlog['catch'] += $bn['add_bank'];
mysql_query( mysql_query(
'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1' 'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11487,20 +11437,17 @@ LIMIT 1'
if (isset($rlog['id'])) { if (isset($rlog['id'])) {
$krtxt = ''; $krtxt = '';
if ($kr > 0) { if ($kr > 0) {
$krtxt .= '' . $kr . ' КР'; $krtxt .= "$kr КР";
if ($ekr > 0) {
$krtxt .= ', ';
}
} }
if ($ekr > 0) { if ($ekr > 0) {
$krtxt .= '' . $ekr . ' ЕКР'; $krtxt .= ", $ekr ЕКР";
} }
$this->send(
'', $this->info['room'], $this->info['city'], '', $cmsg->setText(
$rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> (3-го уровня от &quot;' . $llogin2 . '&quot; (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt
'Ваш реферал <strong>' . $this->info['login'] . '</strong> (3-го уровня от &quot;' . $llogin2 . '&quot; (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt,
-1, 6, 0, 0, 0, 1
); );
(new Chat())->sendMsg($cmsg);
$rlog['catch'] += $bn['add_bank']; $rlog['catch'] += $bn['add_bank'];
mysql_query( mysql_query(
'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1' 'UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'
@ -11512,11 +11459,10 @@ LIMIT 1'
} }
} }
} else { } else {
$this->send( $cmsg->setText(
'', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.'
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.',
-1, 6, 0, 0, 0, 1
); );
(new Chat())->sendMsg($cmsg);
} }
} }
// //
@ -11527,11 +11473,10 @@ LIMIT 1'
); );
// //
} elseif (isset($rlog['id'])) { } elseif (isset($rlog['id'])) {
$this->send( $cmsg->setText(
'', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small style="color: red">(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</small>'
'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small><font color=red>(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</font></small>',
-1, 6, 0, 0, 0, 1
); );
(new Chat())->sendMsg($cmsg);
} }
} }
} }
@ -11559,27 +11504,28 @@ LIMIT 1'
); );
$this->info['upLevel'] += 1; $this->info['upLevel'] += 1;
$rt++; $rt++;
} else {
$i = 1;
} }
} }
if ($ult == 1) { if ($ult == 1) {
$chat = new Chat();
$cmsg = new ChatMessage();
$cmsg->setRoom($this->info['room']);
$cmsg->setCity($this->info['city']);
$cmsg->setType(6);
if ($this->info['level'] == 4 || $this->info['level'] == 8) { if ($this->info['level'] == 4 || $this->info['level'] == 8) {
//Убрать задержки на пещеры //Убрать задержки на пещеры
mysql_query( mysql_query(
'DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"' 'DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"'
); );
$this->send( $cmsg->setTo($this->info['login']);
'', $this->info['room'], $this->info['city'], '', $this->info['login'], $cmsg->setText('Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.');
'Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.', -1, 6, 0, 0, $chat->sendMsg($cmsg);
0, 1
);
} }
$this->send(
'', $this->info['room'], $this->info['city'], '', '', $cmsg->setTypeTime(2);
'<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!', $cmsg->setText('<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!');
time(), 6, 0, 0, 0, 1, 2 $chat->sendMsg($cmsg);
); // Наверно тут
} }
if ($rt > 0) { if ($rt > 0) {
$this->info['stopexp'] = 0; $this->info['stopexp'] = 0;
@ -11650,11 +11596,13 @@ LIMIT 1'
) )
); );
$a['stats'] = $a['stats']['stats']; $a['stats'] = $a['stats']['stats'];
$this->send( $cmsg = new ChatMessage();
'', $this->info['room'], $this->info['city'], '', $this->info['login'], $cmsg->setRoom($this->info['room']);
'<strong>' . $a['name'] . '</strong> достиг ' . $a['level'] . ' уровня!', time(), 6, 0, $cmsg->setCity($this->info['city']);
0, 0, 1 $cmsg->setTo($this->info['login']);
); $cmsg->setText('<strong>' . $a['name'] . '</strong> достиг ' . $a['level'] . ' уровня!');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
mysql_query( mysql_query(
'UPDATE `users_animal` SET `stats` = "' . $a['stats'] . '",`level`="' . $a['level'] . '",`max_exp`="' . $a['max_exp'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1' 'UPDATE `users_animal` SET `stats` = "' . $a['stats'] . '",`level`="' . $a['level'] . '",`max_exp`="' . $a['max_exp'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'
); );

View File

@ -1,51 +1,65 @@
<? <?php
if (isset($s[1]) && $s[1] == '106/door3') { if (isset($s[1]) && $s[1] == '106/door3') {
/* /*
Сундук: Кровавый подземник (4561) Сундук: Кровавый подземник (4561)
*/ */
//Все переменные сохранять в массиве $vad ! //Все переменные сохранять в массиве $vad !
$vad = array( $vad = [
'go' => true 'go' => true,
];
mysql_query(
'INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES (
"' . $u->info['dnow'] . '","' . time(
) . '","' . $obj['x'] . '","' . $obj['y'] . '","' . $u->info['id'] . '","obj_act' . $obj['id'] . '","' . $vad['bad'] . '"
)'
);
$vad['qst'] = mysql_fetch_array(
mysql_query(
'SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `var` = "noobqst1" AND `val` = 1 LIMIT 1'
)
); );
if( $vad['go'] == true ) { $vad['itm'] = mysql_fetch_array(
mysql_query('INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES ( mysql_query(
"'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'" 'SELECT * FROM `items_users` WHERE `uid` = "' . $u->info['id'] . '" AND (`item_id` = 724 OR `item_id` = 4704) LIMIT 1'
)'); )
$vad['qst'] = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `var` = "noobqst1" AND `val` = 1 LIMIT 1')); );
$vad['itm'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = 724 OR `item_id` = 4704) LIMIT 1'));
if (!isset($vad['qst']['id']) || !isset($vad['itm']['id'])) { if (!isset($vad['qst']['id']) || !isset($vad['itm']['id'])) {
$r = 'Дверь закрыта. Сначала выполните задания Учителя и купите Футболку с Эликсиром.'; $r = 'Дверь закрыта. Сначала выполните задания Учителя и купите Футболку с Эликсиром.';
} else { } else {
//Начало обучения //Начало обучения
$humor = array( $humor = [
0 => array( 0 => [
':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!', ':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!',
':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!', ':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!',':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!' ':friday: Не долго думав он начал искать собутыльника!', ':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!',
), ],
1 => array( 1 => [
':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!', ':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!',
':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!', ':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...' ':angel2: Ангел сошел с небес...',
) ],
); ];
$humor = $humor[$u->info['sex']]; $humor = $humor[$u->info['sex']];
//$u->info['fnq'] = 1;
//mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//Отправляем сообщение в чат о новичке //Отправляем сообщение в чат о новичке
mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4703'); mysql_query(
'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 AND `item_id` = 4703'
);
mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); mysql_query(
$u->send('','','','','','В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0); 'UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
//mysql_query('UPDATE `stats` SET `x` = 0,`y` = 5 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); );
array_shift($humor);
$cmsg = new ChatMessage();
$cmsg->setText('В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! ' . $humor[0]);
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
header('location: main.php'); header('location: main.php');
die(); die();
} }
}
unset($vad); unset($vad);
} }
?>

View File

@ -41,7 +41,6 @@ if ($u->info['login'] == $usr['login']) {
$chatDto->setTo($usr['login']); $chatDto->setTo($usr['login']);
$chatDto->setText("Персонаж <b>{$u->info['login']}</b> украл у вас эффект {$eff['name']}."); $chatDto->setText("Персонаж <b>{$u->info['login']}</b> украл у вас эффект {$eff['name']}.");
$chatDto->setType(6); $chatDto->setType(6);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
$chatDto = new ChatMessage(); $chatDto = new ChatMessage();

View File

@ -76,7 +76,6 @@ if ($needle == $sign) {
$chatDto->setRoom($user['room']); $chatDto->setRoom($user['room']);
$chatDto->setTo($user['login']); $chatDto->setTo($user['login']);
$chatDto->setText($r); $chatDto->setText($r);
$chatDto->setTime(-1);
$chatDto->setType(5); $chatDto->setType(5);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
@ -103,7 +102,6 @@ if ($needle == $sign) {
$chatDto->setRoom($referal['room']); $chatDto->setRoom($referal['room']);
$chatDto->setTo($referal['login']); $chatDto->setTo($referal['login']);
$chatDto->setText($r); $chatDto->setText($r);
$chatDto->setTime(-1);
$chatDto->setType(5); $chatDto->setType(5);
(new Chat())->sendMsg($chatDto); (new Chat())->sendMsg($chatDto);
} }

View File

@ -347,11 +347,13 @@ if (isset($_GET['usemod'])) {
} }
} }
if (isset($_POST['tologin'], $_POST['message'])) { if (isset($_POST['tologin'], $_POST['message'])) {
$u->send( $cmsg = new ChatMessage();
'', 1, $infcity, '', htmlspecialchars($_POST['tologin'], null), $cmsg->setRoom(1);
'<font color=darkblue>Сообщение телеграфом от </font> <b>' . $u->info['login'] . '</b>: ' . $_POST['message'] . '', $cmsg->setCity($infcity);
-1, 6, 0, 0, 0, 1 $cmsg->setTo($_POST['tologin']);
); $cmsg->setText('<span style="color: darkblue; ">Сообщение телеграфом от </span> <b>' . $u->info['login'] . '</b>: ' . $_POST['message']);
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
} }
?> ?>
<table> <table>

View File

@ -1,28 +1,34 @@
<? <?php
if (!defined('GAME')) { if (!defined('GAME')) {
die(); die();
} }
if ($u->room['file'] == 'an/bk') { if ($u->room['file'] == 'an/bk') {
$tst = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `var` = "noobqst1" LIMIT 1')); $tst = mysql_fetch_array(
mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `var` = "noobqst1" LIMIT 1')
);
if (!isset($tst['id'])) { if (!isset($tst['id'])) {
if (isset($_GET['noobgo'])) { if (isset($_GET['noobgo'])) {
if ($_GET['noobgo'] == 1) { if ($_GET['noobgo'] == 1) {
//Согласился (создаем пещеру и телепортируем туда //Согласился (создаем пещеру и телепортируем туда
$ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) $ins = mysql_query(
VALUES ("'.$u->info['city'].'","'.$u->info['id'].'","106","Академия Новичков","'.time().'")'); 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
VALUES ("' . $u->info['city'] . '","' . $u->info['id'] . '","106","Академия Новичков","' . time() . '")'
);
if ($ins) { if ($ins) {
$zid = mysql_insert_id(); $zid = mysql_insert_id();
//обновляем пользователей //обновляем пользователей
$su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`id`="'.$u->info['id'].'"'); $su = mysql_query(
'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`id`="' . $u->info['id'] . '"'
);
$ids = ''; $ids = '';
$map_locs = array(); $map_locs = [];
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "106"'); $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "106"');
while ($plm2 = mysql_fetch_array($spm2)) { while ($plm2 = mysql_fetch_array($spm2)) {
$map_locs[] = array($plm2['x'],$plm2['y']); $map_locs[] = [$plm2['x'], $plm2['y']];
} }
unset($spm2, $plm2); unset($spm2, $plm2);
@ -33,7 +39,9 @@ if($u->room['file']=='an/bk'){
} }
$ids = rtrim($ids, 'OR'); $ids = rtrim($ids, 'OR');
$snew = 0; $snew = 0;
$upd1 = mysql_query('UPDATE `stats` SET `s`="4",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.''); $upd1 = mysql_query(
'UPDATE `stats` SET `s`="4",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ''
);
if ($upd1) { if ($upd1) {
$upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE ' . $ids . ''); $upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE ' . $ids . '');
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
@ -45,22 +53,27 @@ if($u->room['file']=='an/bk'){
$bots = explode(',', $pl['bot_group']); $bots = explode(',', $pl['bot_group']);
$pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)]; $pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
} }
if( $pl['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'].'"),'; if ($pl['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'] . '"),';
}
unset($bots); unset($bots);
} }
$vls = rtrim($vls, ','); $vls = rtrim($vls, ',');
$ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES '.$vls.''); $ins1 = mysql_query(
'INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . ''
);
//Добавляем обьекты //Добавляем обьекты
$vls = ''; $vls = '';
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "106"'); $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "106"');
while($pl = mysql_fetch_array($sp)) 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'] . '"),'; $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'] . '"),';
} }
// //
$vls = rtrim($vls, ','); $vls = rtrim($vls, ',');
if ($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.''); $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 { } else {
$ins2 = true; $ins2 = true;
} }
@ -80,35 +93,34 @@ if($u->room['file']=='an/bk'){
die(); die();
} else { } else {
//Отказался (добавляем квест, системку и пошел нах) //Отказался (добавляем квест, системку и пошел нах)
mysql_query('INSERT INTO `dialog_act` ( mysql_query(
'INSERT INTO `dialog_act` (
`uid`,`var`,`time` `uid`,`var`,`time`
) VALUES ( ) VALUES (
"' . $u->info['id'] . '","noobqst1","' . time() . '" "' . $u->info['id'] . '","noobqst1","' . time() . '"
)'); )'
);
//Начало обучения //Начало обучения
$humor = array( $humor = [
0 => array( 0 => [
':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!', ':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!',
':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!', ':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!',
':friday: Не долго думав он начал искать собутыльника!',':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!' ':friday: Не долго думав он начал искать собутыльника!', ':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!',
), ],
1 => array( 1 => [
':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!', ':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!',
':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!', ':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!',
':angel2: Ангел сошел с небес...' ':angel2: Ангел сошел с небес...',
) ],
); ];
$humor = $humor[$u->info['sex']]; $humor = $humor[$u->info['sex']];
//$u->info['fnq'] = 1; array_shift($humor);
//mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); $cmsg = new ChatMessage();
//Отправляем сообщение в чат о новичке $cmsg->setText('В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! ' . $humor[0]);
//mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4703'); $cmsg->setType(6);
//mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); (new Chat())->sendMsg($cmsg);
//mysql_query('UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); echo '<div style="color: red; font-weight: bold;">Вы отказались от обучения, второй попытки больше не будет!</div>';
$u->send('','','','','','В нашем мире появился новый игрок &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
echo '<div><font color=red><b>Вы отказались от обучения, второй попытки больше не будет!</b></font></div>';
} }
} else { } else {
echo '<script> echo '<script>
@ -121,26 +133,38 @@ if($u->room['file']=='an/bk'){
} }
?>
?><script type="text/javascript" src="/js/jquery.locations.js"></script> <script type="text/javascript" src="/js/jquery.locations.js"></script>
<link href="/css/fightclub.css" rel="stylesheet" type="text/css"> <link href="/css/fightclub.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td width="250" valign="top"> <td width="250" valign="top">
<? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?> <?php $usee = $u->getInfoPers($u->info['id'], 0);
if ($usee != false) {
echo $usee[0];
} else {
echo 'information is lost.';
} ?>
</td> </td>
<td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td> <td width="230" valign="top"
<td valign="top"><div align="right"> style="padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td>
<? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?> <td valign="top">
<div align="right">
<?php if ($u->error != '') {
echo '<font color="red"><b>' . $u->error . '</b></font>';
} ?>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top"> <tr align="right" valign="top">
<td> <td>
<? if($re!=''){ echo '<font color="red"><b>'.$re.'</b></font>'; } ?> <?php if ($re != '') {
echo '<font color="red"><b>' . $re . '</b></font>';
} ?>
<table width="500" border="0" cellspacing="0" cellpadding="0"> <table width="500" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td id="ViewLocation"><?php <td id="ViewLocation"><?php
if (true == false) { if (true == false) {
?><script><?php ?>
<script><?php
require_once('modules_data/location/fight-club.database.php'); require_once('modules_data/location/fight-club.database.php');
?> ?>
var json = <?php echo json_encode($Response); ?>; var json = <?php echo json_encode($Response); ?>;
@ -150,57 +174,110 @@ if($u->room['file']=='an/bk'){
</script><?php </script><?php
}else{ }else{
?> ?>
<div style="position:relative; cursor: pointer; width: 500;" id="ione"><img src="https://img.new-combats.com/i/images/300x225/club/navig.jpg" id="img_ione" width="500" height="240" border="1"/> <div style="position:relative; cursor: pointer; width: 500;" id="ione">
<img src="https://img.new-combats.com/i/images/300x225/club/navig.jpg"
id="img_ione" width="500" height="240" border="1"/>
<div style="position:absolute; left:241px; top:128px; width:16px; height:18px; z-index:90;"><img src="https://img.new-combats.com/i/images/300x225/fl1.gif" width="16" height="18" title="Вы находитесь в '<? echo $u->room['name']; ?>'" /></div> <div style="position:absolute; left:241px; top:128px; width:16px; height:18px; z-index:90;">
<div style="position: absolute; left: 30px; top: 140px; width: 28px; height: 31px; z-index: 90;"><img onClick="alert('Проход через Зал воинов 1');" src="https://img.new-combats.com/i/images/300x225/zk_entrance.gif" width="28" height="63" title="" /></div> <img src="https://img.new-combats.com/i/images/300x225/fl1.gif"
width="16" height="18"
title="Вы находитесь в '<?php echo $u->room['name']; ?>'"/>
</div>
<div style="position: absolute; left: 30px; top: 140px; width: 28px; height: 31px; z-index: 90;">
<img onClick="alert('Проход через Зал воинов 1');"
src="https://img.new-combats.com/i/images/300x225/zk_entrance.gif"
width="28" height="63" title=""/></div>
<div style="position: absolute; left: 327px; top: 136px; width: 63px; height: 28px; z-index: 90;"><img onClick="alert('Проход через Зал воинов 2');" src="https://img.new-combats.com/city/zk_entrance2.gif" width="63" height="28" title="" /></div> <div style="position: absolute; left: 327px; top: 136px; width: 63px; height: 28px; z-index: 90;">
<img onClick="alert('Проход через Зал воинов 2');"
src="https://img.new-combats.com/city/zk_entrance2.gif"
width="63" height="28" title=""/></div>
<div style="position:absolute; left:184px; top:94px; width:120px; height:35px; z-index:90;"><img src="https://img.new-combats.com/i/images/300x225/map_bk.gif" width="120" height="35" title="" class="aFilter" /></div> <div style="position:absolute; left:184px; top:94px; width:120px; height:35px; z-index:90;">
<div style="position:absolute; left:66px; top:114px; width:56px; height:13px; z-index:90;"><img <? thisInfRm('2.180.0.240'); ?> onClick="location='main.php?loc=2.180.0.240';" src="https://img.new-combats.com/i/images/300x225/map_klub1.gif" width="56" height="13" class="aFilter" /></div> <img src="https://img.new-combats.com/i/images/300x225/map_bk.gif"
<div style="position:absolute; left:216px; top:41px; width:58px; height:49px; z-index:90;"><img <? thisInfRm('2.180.0.259'); ?> onClick="location='main.php?loc=2.180.0.259';" src="https://img.new-combats.com/i/images/300x225/map_klub2.gif" width="58" height="49" class="aFilter" /></div> width="120" height="35" title="" class="aFilter"/></div>
<div style="position:absolute; left:312px; top:168px; width:123px; height:31px; z-index:90;"><img <? thisInfRm('2.180.0.229'); ?> onClick="location='main.php?loc=2.180.0.229';" src="https://img.new-combats.com/i/images/300x225/map_klub3.gif" width="123" height="31" title="" class="aFilter" /></div> <div style="position:absolute; left:66px; top:114px; width:56px; height:13px; z-index:90;">
<div style="position:absolute; left:59px; top:169px; width:123px; height:31px; z-index:90;"><img <? thisInfRm('2.180.0.231'); ?> onClick="location='main.php?loc=2.180.0.231';" src="https://img.new-combats.com/i/images/300x225/map_klub4.gif" width="123" height="31" class="aFilter" /></div> <img <?php thisInfRm('2.180.0.240'); ?>
<div style="position:absolute; left:312px; top:48px; width:123px; height:30px; z-index:90;"><img <? thisInfRm('2.180.0.232'); ?> onClick="location='main.php?loc=2.180.0.232';" src="https://img.new-combats.com/i/images/300x225/map_klub5.gif" width="123" height="30" class="aFilter" /></div> onClick="location='main.php?loc=2.180.0.240';"
<div style="position:absolute; left:52px; top:47px; width:123px; height:30px; z-index:90;"><img <? thisInfRm('2.180.0.233'); ?> onClick="location='main.php?loc=2.180.0.233';" src="https://img.new-combats.com/i/images/300x225/map_klub6.gif" width="123" height="30" class="aFilter" /></div> src="https://img.new-combats.com/i/images/300x225/map_klub1.gif"
<div style="position:absolute; left:196px; top:148px; width:103px; height:47px; z-index:90;"><img <? thisInfRm('2.180.0.234'); ?> onClick="location='main.php?loc=2.180.0.234';" src="https://img.new-combats.com/i/images/300x225/map_klub7.gif" width="103" height="47" class="aFilter" /></div> width="56" height="13" class="aFilter"/></div>
<div style="position:absolute; left:216px; top:41px; width:58px; height:49px; z-index:90;">
<img <?php thisInfRm('2.180.0.259'); ?>
onClick="location='main.php?loc=2.180.0.259';"
src="https://img.new-combats.com/i/images/300x225/map_klub2.gif"
width="58" height="49" class="aFilter"/></div>
<div style="position:absolute; left:312px; top:168px; width:123px; height:31px; z-index:90;">
<img <?php thisInfRm('2.180.0.229'); ?>
onClick="location='main.php?loc=2.180.0.229';"
src="https://img.new-combats.com/i/images/300x225/map_klub3.gif"
width="123" height="31" title="" class="aFilter"/></div>
<div style="position:absolute; left:59px; top:169px; width:123px; height:31px; z-index:90;">
<img <?php thisInfRm('2.180.0.231'); ?>
onClick="location='main.php?loc=2.180.0.231';"
src="https://img.new-combats.com/i/images/300x225/map_klub4.gif"
width="123" height="31" class="aFilter"/></div>
<div style="position:absolute; left:312px; top:48px; width:123px; height:30px; z-index:90;">
<img <?php thisInfRm('2.180.0.232'); ?>
onClick="location='main.php?loc=2.180.0.232';"
src="https://img.new-combats.com/i/images/300x225/map_klub5.gif"
width="123" height="30" class="aFilter"/></div>
<div style="position:absolute; left:52px; top:47px; width:123px; height:30px; z-index:90;">
<img <?php thisInfRm('2.180.0.233'); ?>
onClick="location='main.php?loc=2.180.0.233';"
src="https://img.new-combats.com/i/images/300x225/map_klub6.gif"
width="123" height="30" class="aFilter"/></div>
<div style="position:absolute; left:196px; top:148px; width:103px; height:47px; z-index:90;">
<img <?php thisInfRm('2.180.0.234'); ?>
onClick="location='main.php?loc=2.180.0.234';"
src="https://img.new-combats.com/i/images/300x225/map_klub7.gif"
width="103" height="47" class="aFilter"/></div>
<div id="snow"></div> <div id="snow"></div>
<? echo $goline; ?> <?php echo $goline; ?>
</div> </div>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>
</table> </table>
<div style="display:none; height:0px " id="moveto"></div> <div style="display:none; height:0px " id="moveto"></div>
<div align="right" style="padding: 3px;"><small>&laquo;<? echo $c['title3']; ?>&raquo; приветствует Вас, <b><? echo $u->info['login']; ?></b>.<br /> <div align="right" style="padding: 3px;">
<small>&laquo;<?php echo $c['title3']; ?>&raquo; приветствует Вас,
<b><?php echo $u->info['login']; ?></b>.<br/>
<?php <?php
if($u->info['level']<6) if ($u->info['level'] < 6) {
{
echo ' echo '
Вам все время кажется что за вами следят? Чудится, что случайный попутчик мечтает всадить вам топор в спину? При совершении очередной покупки в гос. магазине мучает ощущение, что вас обманули? Кажется, что симпатичная девушка напротив смотрит на вас как на пищу? Успокойтесь, это не паранойя. Это реалии Capital city. Города Тьмы. Вам все время кажется что за вами следят? Чудится, что случайный попутчик мечтает всадить вам топор в спину? При совершении очередной покупки в гос. магазине мучает ощущение, что вас обманули? Кажется, что симпатичная девушка напротив смотрит на вас как на пищу? Успокойтесь, это не паранойя. Это реалии Capital city. Города Тьмы.
'; ';
} else { } else {
echo 'Возможно, вы ошиблись этажом - настоящие сражения проходят этажом выше.'; echo 'Возможно, вы ошиблись этажом - настоящие сражения проходят этажом выше.';
} ?> } ?>
</small></div></td> </small></div>
<td>
<!-- <br /><span class="menutop"><nobr>Комната для новичков</nobr></span>-->
</td> </td>
<td></td>
</tr> </tr>
</table> </table>
<small> <small>
<HR> <HR>
<? $hgo = $u->testHome(); if(!isset($hgo['id'])){ ?><INPUT onclick="location.href='main.php?homeworld=<? echo $code; ?>';" class="btn" value="Возврат" type="button" name="combats2"><? } unset($hgo); ?> <?php $hgo = $u->testHome();
<INPUT id="forum" class="btn" onclick="window.open('https://new-combats.com/forum/', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')" value="Форум" type="button" name="forum"> if (!isset($hgo['id'])) { ?><INPUT
<INPUT onclick="location.href='main.php?clubmap=<? echo $code; ?>';" class="btn" value="Карта клуба" type="button" name="combats2"> onclick="location.href='main.php?homeworld=<?php echo $code; ?>';"class="btn"value="Возврат"
type="button"name="combats2"><?php }
unset($hgo); ?>
<INPUT id="forum" class="btn"
onclick="window.open('https://new-combats.com/forum/', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')"
value="Форум" type="button" name="forum">
<INPUT onclick="location.href='main.php?clubmap=<?php echo $code; ?>';" class="btn"
value="Карта клуба" type="button" name="combats2">
<br/> <br/>
<strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего героя.<BR> <strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите
пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не
нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего
героя.<BR>
<em>Администрация.</em></small> <BR> <em>Администрация.</em></small> <BR>
<? echo $rowonmax; ?><BR> <?php echo $rowonmax; ?><BR>
</div></td> </div>
</td>
</tr> </tr>
</table> </table>
<?php <?php

View File

@ -1,5 +1,7 @@
<?php <?php
if(!defined('GAME'))die(); if (!defined('GAME')) {
die();
}
// dungeons/building.php // dungeons/building.php
// name:"Строительство портала"|resource:898x1000,891x500,877x250,900x400,899x400,890x200,876x100,889x100,1035x100 // name:"Строительство портала"|resource:898x1000,891x500,877x250,900x400,899x400,890x200,876x100,889x100,1035x100
@ -7,8 +9,8 @@ if(!defined('GAME'))die();
if (isset($file) && $file[0] == 'dungeons/building.php' /* && $u->info['admin'] > 0 */) { if (isset($file) && $file[0] == 'dungeons/building.php' /* && $u->info['admin'] > 0 */) {
$need_count = 0; $need_count = 0;
$actions = array(); $actions = [];
$resource = array(); $resource = [];
$action = explode('|', $file[1]); $action = explode('|', $file[1]);
foreach ($action as $value) { foreach ($action as $value) {
$temp = explode(':', $value); $temp = explode(':', $value);
@ -18,10 +20,10 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
$action = explode(',', $actions['resource']); $action = explode(',', $actions['resource']);
foreach ($action as $value) { foreach ($action as $value) {
$temp = explode('x', $value); $temp = explode('x', $value);
$resource[] = array( $resource[] = [
'item' => (int)$temp[0], 'item' => (int)$temp[0],
'count' => (int)$temp[1] 'count' => (int)$temp[1],
); ];
$need_count = $need_count + (int)$temp[1]; $need_count = $need_count + (int)$temp[1];
} }
} }
@ -31,7 +33,13 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
# Обьекты для строительства # Обьекты для строительства
if (isset($_GET['buildend'])) { if (isset($_GET['buildend'])) {
//identid //identid
$obj = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.mysql_real_escape_string($actions['identid']).'" LIMIT 1')); $obj = mysql_fetch_array(
mysql_query(
'SELECT * FROM `dungeon_obj` WHERE `id` = "' . mysql_real_escape_string(
$actions['identid']
) . '" LIMIT 1'
)
);
$txt = ''; $txt = '';
if (!isset($obj['id'])) { if (!isset($obj['id'])) {
$txt = 'Объект строительства был поврежден темной магией...'; $txt = 'Объект строительства был поврежден темной магией...';
@ -39,25 +47,48 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
if ($obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y']) { if ($obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y']) {
$txt = 'Объект уже был построен ранее! Вернитесь на клетку назад для использования объекта!'; $txt = 'Объект уже был построен ранее! Вернитесь на клетку назад для использования объекта!';
} else { } else {
mysql_query('UPDATE `dungeon_obj` SET `x` = "'.$u->info['x'].'", `y` = "'.$u->info['y'].'" WHERE `id` = "'.$obj['id'].'" LIMIT 1'); mysql_query(
mysql_query('UPDATE `dungeon_obj` SET `x` = "'.$u->info['x'].'", `y` = "'.$u->info['y'].'" WHERE `dn` > 0 AND `name` = "'.$obj['name'].'" AND `img` = "'.$obj['img'].'" AND `action` = "'.$obj['action'].'" AND `x` = "'.$obj['x'].'" AND `y` = "'.$obj['y'].'"'); 'UPDATE `dungeon_obj` SET `x` = "' . $u->info['x'] . '", `y` = "' . $u->info['y'] . '" WHERE `id` = "' . $obj['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `dungeon_obj` SET `x` = "' . $u->info['x'] . '", `y` = "' . $u->info['y'] . '" WHERE `dn` > 0 AND `name` = "' . $obj['name'] . '" AND `img` = "' . $obj['img'] . '" AND `action` = "' . $obj['action'] . '" AND `x` = "' . $obj['x'] . '" AND `y` = "' . $obj['y'] . '"'
);
$txt = 'Строительство &quot;' . $obj['name'] . '&quot; завершилось, вернитесь на клетку назад...'; $txt = 'Строительство &quot;' . $obj['name'] . '&quot; завершилось, вернитесь на клетку назад...';
$u->send('','','','','','Игрок &quot;<b>' . $u->info['login'] . '</b>&quot; завершил строительство объекта &quot;'.mysql_real_escape_string($actions['name']).'&quot;.',time(),6,0,0,0,1,0); $cmsg = new ChatMessage();
$cmsg->setText('Игрок &quot;<b>' . $u->info['login'] . '</b>&quot; завершил строительство объекта &quot;' . mysql_real_escape_string($actions['name']) . '&quot;.');
$cmsg->setType(6);
(new Chat())->sendMsg($cmsg);
} }
} }
echo '<div align="left"><font color="red"><b>'.$txt.'</b></font></div>'; echo '<div style="font-weight: bold; color: red">' . $txt . '</div>';
} }
# пожертвование # пожертвование
if (isset($_POST['itemid'], $_POST['action'])) { if (isset($_POST['itemid'], $_POST['action'])) {
$help = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) as count, item_id FROM `items_users` WHERE `item_id` = '.$_POST['itemid'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1')); $help = mysql_fetch_assoc(
mysql_query(
'SELECT COUNT(`id`) as count, item_id FROM `items_users` WHERE `item_id` = ' . $_POST['itemid'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'
)
);
if ($help) { if ($help) {
$item = mysql_fetch_assoc(mysql_query('SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = '.$help['item_id'].' LIMIT 1')); $item = mysql_fetch_assoc(
mysql_query(
'SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = ' . $help['item_id'] . ' LIMIT 1'
)
);
if (isset($item) && $item['name'] != '') { if (isset($item) && $item['name'] != '') {
foreach ($actions['resource'] as $key => $val) { foreach ($actions['resource'] as $key => $val) {
if ($_POST['itemid'] == $val['item']) { if ($_POST['itemid'] == $val['item']) {
$current = mysql_fetch_assoc(mysql_query('SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id WHERE b.`building` = "'.$actions['ident'].'" AND im.`id` = '.$val['item'].' LIMIT 1')); $current = mysql_fetch_assoc(
if($current['count']==NULL) $current['count']=0; else $current['count']=(int)$current['count']; mysql_query(
'SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id WHERE b.`building` = "' . $actions['ident'] . '" AND im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
if ($current['count'] == null) {
$current['count'] = 0;
} else {
$current['count'] = (int)$current['count'];
}
if ($current['count'] + (int)$help['count'] <= $val['count']) { if ($current['count'] + (int)$help['count'] <= $val['count']) {
# Если ваших ресурсов меньше чем требуется. # Если ваших ресурсов меньше чем требуется.
} else { } else {
@ -65,8 +96,13 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
$help['count'] = +($val['count'] - $current['count']); $help['count'] = +($val['count'] - $current['count']);
} }
if ($help['count'] > 0) { if ($help['count'] > 0) {
mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = '.$help['item_id'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `delete` DESC LIMIT '.$help['count'].''); mysql_query(
mysql_query('INSERT INTO building (id, building, uid, clan_id, item_id, count) VALUES (NULL, "'.$actions['ident'].'", '.$u->info['id'].', '.$u->info['clan'].', '.$help['item_id'].', '.$help['count'] .')'); 'UPDATE `items_users` SET `delete` = "' . time(
) . '" WHERE `item_id` = ' . $help['item_id'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `delete` DESC LIMIT ' . $help['count'] . ''
);
mysql_query(
'INSERT INTO building (id, building, uid, clan_id, item_id, count) VALUES (NULL, "' . $actions['ident'] . '", ' . $u->info['id'] . ', ' . $u->info['clan'] . ', ' . $help['item_id'] . ', ' . $help['count'] . ')'
);
$d->error = 'Вы пожертвовали на строительство [' . $item['name'] . '] в количестве ' . $help['count'] . 'шт.'; $d->error = 'Вы пожертвовали на строительство [' . $item['name'] . '] в количестве ' . $help['count'] . 'шт.';
} }
} }
@ -82,20 +118,38 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
# отображение # отображение
$count = mysql_fetch_array(mysql_query('SELECT SUM(count) as count FROM `building` WHERE `building` = "'.$actions['ident'].'" LIMIT 1')); $count = mysql_fetch_array(
if( isset($count[0]) and $count[0]!=NULL ) $count = $count[0]; else $count = 0; mysql_query('SELECT SUM(count) as count FROM `building` WHERE `building` = "' . $actions['ident'] . '" LIMIT 1')
);
if (isset($count[0]) and $count[0] != null) {
$count = $count[0];
} else {
$count = 0;
}
$r = '<table width="520" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr> $r = '<table width="520" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr>
<td colspan="2" style="border:1px solid gray;padding:3px 6px;border-right:0px;"><strong>Прогресс строительства %</strong></td> <td colspan="2" style="border:1px solid gray;padding:3px 6px;border-right:0px;"><strong>Прогресс строительства %</strong></td>
<td align="right" style="border:1px solid gray;padding:3px 6px;border-left:0px;"><table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-1234500000" title="Выполнение строительства" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.round($count/($need_count/100)).'/'.(100).'</div><div title="Выполнение строительства" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="Выполнение строительства" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-1234500000,'.round($count/($need_count/100)).','.( 100 ).',0,0,0,0,0,0,1);</script>'; <td align="right" style="border:1px solid gray;padding:3px 6px;border-left:0px;"><table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-1234500000" title="Выполнение строительства" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . round(
$count / ($need_count / 100)
) . '/' . (100) . '</div><div title="Выполнение строительства" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="Выполнение строительства" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-1234500000,' . round(
$count / ($need_count / 100)
) . ',' . (100) . ',0,0,0,0,0,0,1);</script>';
$r .= '</td></tr>'; $r .= '</td></tr>';
# Текущее состояние строительства. # Текущее состояние строительства.
foreach ($actions['resource'] as $key => $val) { foreach ($actions['resource'] as $key => $val) {
if ($count == 0) { if ($count == 0) {
$current = mysql_fetch_assoc(mysql_query('SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = '.$val['item'].' LIMIT 1')); $current = mysql_fetch_assoc(
mysql_query(
'SELECT im.`name`, im.`img` FROM `items_main` as im WHERE im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
$current['count'] = 0; $current['count'] = 0;
} else { } else {
$current = mysql_fetch_assoc(mysql_query('SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id $current = mysql_fetch_assoc(
WHERE b.`building` = "'.$actions['ident'].'" AND im.`id` = '.$val['item'].' LIMIT 1')); mysql_query(
'SELECT SUM(b.`count`) as count, im.`name`, im.`img` FROM `items_main` as im LEFT JOIN `building` as `b` ON b.item_id = im.id
WHERE b.`building` = "' . $actions['ident'] . '" AND im.`id` = ' . $val['item'] . ' LIMIT 1'
)
);
} }
if (isset($current) && $current['name'] != '') { if (isset($current) && $current['name'] != '') {
$actions['resource'][$key]['current'] = (int)$current['count']; $actions['resource'][$key]['current'] = (int)$current['count'];
@ -111,8 +165,14 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
unset($key, $val, $current); unset($key, $val, $current);
foreach ($actions['resource'] as $row) { foreach ($actions['resource'] as $row) {
$current_uid = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) as count FROM `items_users` WHERE `item_id` = '.$row['item'].' AND `uid` = '.$u->info['id'].' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1')); $current_uid = mysql_fetch_assoc(
if(isset($current_uid) && $current_uid['count'] == NULL) $current_uid['count'] = 0; // Сколько можем внести mysql_query(
'SELECT COUNT(`id`) as count FROM `items_users` WHERE `item_id` = ' . $row['item'] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 1'
)
);
if (isset($current_uid) && $current_uid['count'] == null) {
$current_uid['count'] = 0;
} // Сколько можем внести
$r .= '<tr><td style="padding:1px 2px 1px 6px;">[' . $row['name'] . ']</td>'; $r .= '<tr><td style="padding:1px 2px 1px 6px;">[' . $row['name'] . ']</td>';
if ($row['current'] >= $row['count']) { if ($row['current'] >= $row['count']) {
@ -121,7 +181,11 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
$input = '<form method="post" id="te' . $row['item'] . '"><input style="min-width:24px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:center;" type="hidden" name="itemid" value="' . $row['item'] . '"> <input style="min-width:90px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:left;" type="SUBMIT" name="action" title="У вас есть ' . $current_uid['count'] . 'шт" value="Пожертвовать"></form>'; $input = '<form method="post" id="te' . $row['item'] . '"><input style="min-width:24px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:center;" type="hidden" name="itemid" value="' . $row['item'] . '"> <input style="min-width:90px; border:0px; font-weight:bold; cursor:pointer;cursor:hand; text-align:left;" type="SUBMIT" name="action" title="У вас есть ' . $current_uid['count'] . 'шт" value="Пожертвовать"></form>';
} }
$r .= '<td style="padding:1px 3px 1px 3px; text-align:right;">' . $input . '</td><td width="125" style="padding:1px 6px 1px 2px; text-align:right;">'; $r .= '<td style="padding:1px 3px 1px 3px; text-align:right;">' . $input . '</td><td width="125" style="padding:1px 6px 1px 2px; text-align:right;">';
$r .='<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-123450'.$row['item'].'" title="'.$row['name'].'" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.round($row['current']/($row['count']/100)).'/'.(100).'</div><div title="'.$row['name'].'" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-123450'.$row['item'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="'.$row['name'].'" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-123450'.$row['item'].','.round($row['current']/($row['count']/100)).','.(100).',0,0,0,0,0,0,1);</script>'; $r .= '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px"><div style="position:relative;"><div id="vhp-123450' . $row['item'] . '" title="' . $row['name'] . '" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . round(
$row['current'] / ($row['count'] / 100)
) . '/' . (100) . '</div><div title="' . $row['name'] . '" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-123450' . $row['item'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div><div title="' . $row['name'] . '" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div></div></td></tr></table><br><script>top.startHpRegen("main",-123450' . $row['item'] . ',' . round(
$row['current'] / ($row['count'] / 100)
) . ',' . (100) . ',0,0,0,0,0,0,1);</script>';
$r .= '</td></tr>'; $r .= '</td></tr>';
unset($input, $current_uid); unset($input, $current_uid);
} }
@ -142,5 +206,4 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
# Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник. # Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник.
$d->information = '<br/>' . $r; $d->information = '<br/>' . $r;
} }

View File

@ -317,21 +317,14 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
} else { } else {
//Записываем данные //Записываем данные
$msg['time'] = time();
$msg['spam'] = 0; $msg['spam'] = 0;
$msg['type'] = 1; $msg['type'] = 1;
$msg['toChat'] = 0;
$msg['color'] = 'Black';
$msg['typeTime'] = 0;
$msg['sound'] = 0;
$msg['global'] = 0;
$msg['molch'] = 0; $msg['molch'] = 0;
$msg['login'] = $u->info['login'];
$msg['cancel'] = 0; $msg['cancel'] = 0;
$msg['delete'] = 0; $msg['delete'] = 0;
$msg['to'] = ''; $msg['to'] = '';
$msg['da'] = 0; $msg['da'] = 0;
$msg['color'] = $u->info['chatColor'];
//Нормируем типы сообщений //Нормируем типы сообщений
if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) { if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
@ -354,11 +347,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']); $_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']);
} }
if ($u->info['admin'] == 0) { //ТУТ SPAM if ($u->info['admin'] == 0) { //ТУТ SPAM
if ($msg['to'] != '' && !isset($admq['id'])) { if ($msg['to'] != '' && !isset($admq['id']) && $msg['type'] == 3) {
$admq = Db::getRow('select id, admin from users where login = ? and admin > 0', [$msg['to']]); $admq = Db::getRow('select id, admin from users where login = ? and admin > 0', [$msg['to']]);
if ($msg['type'] != 3) {
unset($admq);
}
} }
if (!isset($admq['id'])) { if (!isset($admq['id'])) {
$msg['fspam'] = $filter->spamFiltr(str_replace('точка', '.', str_replace('ру', 'ru', $_POST['msg']))); $msg['fspam'] = $filter->spamFiltr(str_replace('точка', '.', str_replace('ру', 'ru', $_POST['msg'])));
@ -415,10 +405,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
); );
} }
} }
unset($admq);
} else {
unset($admq);
} }
unset($admq);
} }
$qix = mysql_fetch_array( $qix = mysql_fetch_array(
@ -509,36 +497,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$i++; $i++;
} }
$msg['nosee'] = 0;
if ($u->info['level'] < 1) {
$msg['nosee'] = round($u->info['host_reg']);
if ($msg['nosee'] == 0) {
$msg['nosee'] = -1;
$r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small><b>В целях борьбы против рекламы, общение в чате доступно с 8-го уровня.</b> </small>","red","1","1","0"]);';
}
}
//todo: внимательно перебрать логику, возможно есть ненужные\дефолтные поля.
$cmsg = new ChatMessage(); $cmsg = new ChatMessage();
$cmsg->setNosee($msg['nosee']);
$cmsg->setInvis($u->info['invis']); $cmsg->setInvis($u->info['invis']);
$cmsg->setDa($msg['da']); $cmsg->setDa($msg['da']);
$cmsg->setDelete($msg['delete']); $cmsg->setDelete($msg['delete']);
$cmsg->setMolch($msg['molch']); $cmsg->setMolch($msg['molch']);
$cmsg->setLogin($msg['login']); $cmsg->setLogin($u->info['login']);
$cmsg->setTo($msg['to']); $cmsg->setTo($msg['to']);
$cmsg->setCity($u->info['city']); $cmsg->setCity($u->info['city']);
$cmsg->setRoom($u->info['room']); $cmsg->setRoom($u->info['room']);
$cmsg->setTime($msg['time']);
$cmsg->setType($msg['type']); $cmsg->setType($msg['type']);
$cmsg->setSpam($msg['spam']); $cmsg->setSpam($msg['spam']);
$cmsg->setText($_POST['msg']); $cmsg->setText($_POST['msg']);
$cmsg->setToChat($msg['toChat']); $cmsg->setColor($u->info['chatColor']);
$cmsg->setColor($msg['color']);
$cmsg->setTypeTime($msg['typeTime']);
$cmsg->setSound($msg['sound']);
$cmsg->setGlobal($msg['global']);
$chat->sendMsg($cmsg); $chat->sendMsg($cmsg);
} }