Убрал send в чат из user::class. Убрал лишние вызовы.
This commit is contained in:
@@ -347,11 +347,13 @@ if (isset($_GET['usemod'])) {
|
||||
}
|
||||
}
|
||||
if (isset($_POST['tologin'], $_POST['message'])) {
|
||||
$u->send(
|
||||
'', 1, $infcity, '', htmlspecialchars($_POST['tologin'], null),
|
||||
'<font color=darkblue>Сообщение телеграфом от </font> <b>' . $u->info['login'] . '</b>: ' . $_POST['message'] . '',
|
||||
-1, 6, 0, 0, 0, 1
|
||||
);
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setRoom(1);
|
||||
$cmsg->setCity($infcity);
|
||||
$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>
|
||||
|
||||
@@ -1,207 +1,284 @@
|
||||
<?
|
||||
if(!defined('GAME')){
|
||||
die();
|
||||
<?php
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
|
||||
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'));
|
||||
if(!isset($tst['id'])) {
|
||||
if(isset($_GET['noobgo'])) {
|
||||
if($_GET['noobgo'] == 1) {
|
||||
//Согласился (создаем пещеру и телепортируем туда
|
||||
|
||||
$ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
|
||||
VALUES ("'.$u->info['city'].'","'.$u->info['id'].'","106","Академия Новичков","'.time().'")');
|
||||
if($ins){
|
||||
$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'].'"');
|
||||
$ids = '';
|
||||
|
||||
$map_locs = array();
|
||||
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "106"');
|
||||
while( $plm2 = mysql_fetch_array( $spm2 ) ) {
|
||||
$map_locs[] = array($plm2['x'],$plm2['y']);
|
||||
}
|
||||
unset( $spm2 , $plm2 );
|
||||
|
||||
$pxd = 0;
|
||||
while( $pu = mysql_fetch_array($su) ) {
|
||||
$pxd++;
|
||||
$ids .= ' `id` = "'.$pu['id'].'" OR';
|
||||
}
|
||||
$ids = rtrim($ids,'OR');
|
||||
$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.'');
|
||||
if( $upd1 ){
|
||||
$upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE '.$ids.'');
|
||||
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
|
||||
//Добавляем ботов
|
||||
$vls = '';
|
||||
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "106"');
|
||||
while( $pl = mysql_fetch_array( $sp ) ) {
|
||||
if( $pl['id_bot'] == 0 && $pl['bot_group'] !=''){
|
||||
$bots = explode( ',', $pl['bot_group'] );
|
||||
$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'].'"),';
|
||||
unset($bots);
|
||||
}
|
||||
$vls = rtrim($vls,',');
|
||||
$ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES '.$vls.'');
|
||||
//Добавляем обьекты
|
||||
$vls = '';
|
||||
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "106"');
|
||||
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 = 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 {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
} else {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
} else {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
//
|
||||
//header('location: main.php');
|
||||
die();
|
||||
}else{
|
||||
//Отказался (добавляем квест, системку и пошел нах)
|
||||
mysql_query('INSERT INTO `dialog_act` (
|
||||
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')
|
||||
);
|
||||
if (!isset($tst['id'])) {
|
||||
if (isset($_GET['noobgo'])) {
|
||||
if ($_GET['noobgo'] == 1) {
|
||||
//Согласился (создаем пещеру и телепортируем туда
|
||||
|
||||
$ins = mysql_query(
|
||||
'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
|
||||
VALUES ("' . $u->info['city'] . '","' . $u->info['id'] . '","106","Академия Новичков","' . time() . '")'
|
||||
);
|
||||
if ($ins) {
|
||||
$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'] . '"'
|
||||
);
|
||||
$ids = '';
|
||||
|
||||
$map_locs = [];
|
||||
$spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "106"');
|
||||
while ($plm2 = mysql_fetch_array($spm2)) {
|
||||
$map_locs[] = [$plm2['x'], $plm2['y']];
|
||||
}
|
||||
unset($spm2, $plm2);
|
||||
|
||||
$pxd = 0;
|
||||
while ($pu = mysql_fetch_array($su)) {
|
||||
$pxd++;
|
||||
$ids .= ' `id` = "' . $pu['id'] . '" OR';
|
||||
}
|
||||
$ids = rtrim($ids, 'OR');
|
||||
$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 . ''
|
||||
);
|
||||
if ($upd1) {
|
||||
$upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE ' . $ids . '');
|
||||
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
|
||||
//Добавляем ботов
|
||||
$vls = '';
|
||||
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "106"');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
if ($pl['id_bot'] == 0 && $pl['bot_group'] != '') {
|
||||
$bots = explode(',', $pl['bot_group']);
|
||||
$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'] . '"),';
|
||||
}
|
||||
unset($bots);
|
||||
}
|
||||
$vls = rtrim($vls, ',');
|
||||
$ins1 = mysql_query(
|
||||
'INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . ''
|
||||
);
|
||||
//Добавляем обьекты
|
||||
$vls = '';
|
||||
$sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "106"');
|
||||
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 = 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 {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
} else {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
} else {
|
||||
$error = 'Ошибка перехода в подземелье...';
|
||||
}
|
||||
//
|
||||
//header('location: main.php');
|
||||
die();
|
||||
} else {
|
||||
//Отказался (добавляем квест, системку и пошел нах)
|
||||
mysql_query(
|
||||
'INSERT INTO `dialog_act` (
|
||||
`uid`,`var`,`time`
|
||||
) VALUES (
|
||||
"'.$u->info['id'].'","noobqst1","'.time().'"
|
||||
)');
|
||||
|
||||
//Начало обучения
|
||||
$humor = array(
|
||||
0 => array(
|
||||
':maniac: Сильно не бейте ;)',':beggar: Будет попрошайничать - бейте!',':pal: Возможно светлый!',
|
||||
':vamp: Возможно темный!',':susel: Судя по здоровенному бицепсу - это мужик!',':duel: И сразу же кинулся в бой!',
|
||||
':friday: Не долго думав он начал искать собутыльника!',':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!'
|
||||
),
|
||||
1 => array(
|
||||
':maniac: Помните! Девочек не бьем ;)',':nail: Она красит ногти, не отвлекайте все сразу ;)',':pal: Возможно светлая!',
|
||||
':vamp: Возможно темная!',':rev: Судя по красивой одежде - это женщина!',':hug: И сразу же кинулась всех целовать!',
|
||||
':angel2: Ангел сошел с небес...'
|
||||
)
|
||||
);
|
||||
$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 `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');
|
||||
$u->send('','','','','','В нашем мире появился новый игрок "<b>' . $u->info['login'] . '</b>"! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
|
||||
"' . $u->info['id'] . '","noobqst1","' . time() . '"
|
||||
)'
|
||||
);
|
||||
|
||||
echo '<div><font color=red><b>Вы отказались от обучения, второй попытки больше не будет!</b></font></div>';
|
||||
}
|
||||
}else{
|
||||
echo '<script>
|
||||
//Начало обучения
|
||||
$humor = [
|
||||
0 => [
|
||||
':maniac: Сильно не бейте ;)', ':beggar: Будет попрошайничать - бейте!', ':pal: Возможно светлый!',
|
||||
':vamp: Возможно темный!', ':susel: Судя по здоровенному бицепсу - это мужик!', ':duel: И сразу же кинулся в бой!',
|
||||
':friday: Не долго думав он начал искать собутыльника!', ':doc: Лекарь: Новичок! Да, да! Ты! Если тебя сломают - у знахаря тебя соберут обратно!',
|
||||
],
|
||||
1 => [
|
||||
':maniac: Помните! Девочек не бьем ;)', ':nail: Она красит ногти, не отвлекайте все сразу ;)', ':pal: Возможно светлая!',
|
||||
':vamp: Возможно темная!', ':rev: Судя по красивой одежде - это женщина!', ':hug: И сразу же кинулась всех целовать!',
|
||||
':angel2: Ангел сошел с небес...',
|
||||
],
|
||||
];
|
||||
$humor = $humor[$u->info['sex']];
|
||||
array_shift($humor);
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setText('В нашем мире появился новый игрок "<b>' . $u->info['login'] . '</b>"! ' . $humor[0]);
|
||||
$cmsg->setType(6);
|
||||
(new Chat())->sendMsg($cmsg);
|
||||
echo '<div style="color: red; font-weight: bold;">Вы отказались от обучения, второй попытки больше не будет!</div>';
|
||||
}
|
||||
} else {
|
||||
echo '<script>
|
||||
function qstnoobsstart() {
|
||||
top.win.add(\'qstnoobsstart\',\'Вы хотите пройти обучение?\',\'\',{\'a1\':\'top.frames[\\\'main\\\'].location.href=\\\'main.php?noobgo=1\\\';\',\'a2\':\'top.frames[\\\'main\\\'].location.href=\\\'main.php?noobgo=2\\\';\',\'n\':\'<center><small>Отказавшись вы не получите награду!</small></center>\'},2,1,\'width:300px;\');
|
||||
}
|
||||
qstnoobsstart();
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?><script type="text/javascript" src="/js/jquery.locations.js"></script>
|
||||
<link href="/css/fightclub.css" rel="stylesheet" type="text/css">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="250" valign="top">
|
||||
<? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
|
||||
</td>
|
||||
<td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
|
||||
<td valign="top"><div align="right">
|
||||
<? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr align="right" valign="top">
|
||||
<td>
|
||||
<? if($re!=''){ echo '<font color="red"><b>'.$re.'</b></font>'; } ?>
|
||||
<table width="500" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td id="ViewLocation"><?php
|
||||
if(true == false){
|
||||
?><script><?php
|
||||
require_once('modules_data/location/fight-club.database.php');
|
||||
?>
|
||||
var json = <?php echo json_encode($Response); ?>;
|
||||
var tgo = <?php echo ($tmGo*10); ?>;
|
||||
var tgol = <?php echo ($tmGol*10); ?>;
|
||||
ViewLocation(json);
|
||||
</script><?php
|
||||
}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: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: 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>
|
||||
|
||||
?>
|
||||
<script type="text/javascript" src="/js/jquery.locations.js"></script>
|
||||
<link href="/css/fightclub.css" rel="stylesheet" type="text/css">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="250" valign="top">
|
||||
<?php $usee = $u->getInfoPers($u->info['id'], 0);
|
||||
if ($usee != false) {
|
||||
echo $usee[0];
|
||||
} else {
|
||||
echo 'information is lost.';
|
||||
} ?>
|
||||
</td>
|
||||
<td width="230" valign="top"
|
||||
style="padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td>
|
||||
<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">
|
||||
<tr align="right" valign="top">
|
||||
<td>
|
||||
<?php if ($re != '') {
|
||||
echo '<font color="red"><b>' . $re . '</b></font>';
|
||||
} ?>
|
||||
<table width="500" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td id="ViewLocation"><?php
|
||||
if (true == false) {
|
||||
?>
|
||||
<script><?php
|
||||
require_once('modules_data/location/fight-club.database.php');
|
||||
?>
|
||||
var json = <?php echo json_encode($Response); ?>;
|
||||
var tgo = <?php echo($tmGo * 10); ?>;
|
||||
var tgol = <?php echo($tmGol * 10); ?>;
|
||||
ViewLocation(json);
|
||||
</script><?php
|
||||
}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: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: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>
|
||||
<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>
|
||||
<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: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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<div id="snow"></div>
|
||||
<? echo $goline; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="display:none; height:0px " id="moveto"></div>
|
||||
<div align="right" style="padding: 3px;"><small>«<? echo $c['title3']; ?>» приветствует Вас, <b><? echo $u->info['login']; ?></b>.<br />
|
||||
<?php
|
||||
if($u->info['level']<6)
|
||||
{
|
||||
echo '
|
||||
<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="Вы находитесь в '<?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: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:66px; top:114px; width:56px; height:13px; z-index:90;">
|
||||
<img <?php 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>
|
||||
<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>
|
||||
<?php echo $goline; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="display:none; height:0px " id="moveto"></div>
|
||||
<div align="right" style="padding: 3px;">
|
||||
<small>«<?php echo $c['title3']; ?>» приветствует Вас,
|
||||
<b><?php echo $u->info['login']; ?></b>.<br/>
|
||||
<?php
|
||||
if ($u->info['level'] < 6) {
|
||||
echo '
|
||||
Вам все время кажется что за вами следят? Чудится, что случайный попутчик мечтает всадить вам топор в спину? При совершении очередной покупки в гос. магазине мучает ощущение, что вас обманули? Кажется, что симпатичная девушка напротив смотрит на вас как на пищу? Успокойтесь, это не паранойя. Это реалии Capital city. Города Тьмы.
|
||||
';
|
||||
}else{
|
||||
echo 'Возможно, вы ошиблись этажом - настоящие сражения проходят этажом выше.';
|
||||
} ?>
|
||||
</small></div></td>
|
||||
<td>
|
||||
<!-- <br /><span class="menutop"><nobr>Комната для новичков</nobr></span>-->
|
||||
</td>
|
||||
} else {
|
||||
echo 'Возможно, вы ошиблись этажом - настоящие сражения проходят этажом выше.';
|
||||
} ?>
|
||||
</small></div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<small>
|
||||
<HR>
|
||||
<?php $hgo = $u->testHome();
|
||||
if (!isset($hgo['id'])) { ?><INPUT
|
||||
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/>
|
||||
<strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите
|
||||
пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не
|
||||
нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего
|
||||
героя.<BR>
|
||||
<em>Администрация.</em></small> <BR>
|
||||
<?php echo $rowonmax; ?><BR>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<small>
|
||||
<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); ?>
|
||||
<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=<? echo $code; ?>';" class="btn" value="Карта клуба" type="button" name="combats2">
|
||||
<br />
|
||||
<strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите пароль на других сайтах, типа "новый город", "лотерея", "там, где все дают на халяву". Пароль не нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего героя.<BR>
|
||||
<em>Администрация.</em></small> <BR>
|
||||
<? echo $rowonmax; ?><BR>
|
||||
|
||||
</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -1,146 +1,209 @@
|
||||
<?php
|
||||
if(!defined('GAME'))die();
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
|
||||
// dungeons/building.php
|
||||
// name:"Строительство портала"|resource:898x1000,891x500,877x250,900x400,899x400,890x200,876x100,889x100,1035x100
|
||||
|
||||
if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] > 0 */ ) {
|
||||
|
||||
$need_count = 0;
|
||||
$actions = array();
|
||||
$resource = array();
|
||||
$action = explode('|',$file[1]);
|
||||
foreach( $action as $value ) {
|
||||
$temp = explode(':',$value);
|
||||
$actions[$temp[0]]= $temp[1];
|
||||
}
|
||||
if( isset($actions['resource']) ){
|
||||
$action = explode( ',',$actions['resource'] );
|
||||
foreach( $action as $value ) {
|
||||
$temp = explode( 'x', $value );
|
||||
$resource[] = array(
|
||||
'item' => (int)$temp[0],
|
||||
'count' => (int)$temp[1]
|
||||
);
|
||||
$need_count = $need_count+(int)$temp[1];
|
||||
}
|
||||
}
|
||||
$actions['resource'] = $resource;
|
||||
unset($action, $temp, $value, $resource);
|
||||
|
||||
# Обьекты для строительства
|
||||
if(isset($_GET['buildend'])) {
|
||||
//identid
|
||||
$obj = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.mysql_real_escape_string($actions['identid']).'" LIMIT 1'));
|
||||
$txt = '';
|
||||
if( !isset($obj['id']) ) {
|
||||
$txt = 'Объект строительства был поврежден темной магией...';
|
||||
}else{
|
||||
if( $obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y'] ) {
|
||||
$txt = 'Объект уже был построен ранее! Вернитесь на клетку назад для использования объекта!';
|
||||
}else{
|
||||
mysql_query('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 = 'Строительство "'.$obj['name'].'" завершилось, вернитесь на клетку назад...';
|
||||
$u->send('','','','','','Игрок "<b>' . $u->info['login'] . '</b>" завершил строительство объекта "'.mysql_real_escape_string($actions['name']).'".',time(),6,0,0,0,1,0);
|
||||
}
|
||||
}
|
||||
echo '<div align="left"><font color="red"><b>'.$txt.'</b></font></div>';
|
||||
}
|
||||
|
||||
# пожертвование
|
||||
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'));
|
||||
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'));
|
||||
if( isset($item) && $item['name'] != '' ) {
|
||||
foreach( $actions['resource'] as $key=>$val) {
|
||||
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'));
|
||||
if($current['count']==NULL) $current['count']=0; else $current['count']=(int)$current['count'];
|
||||
if($current['count']+(int)$help['count'] <= $val['count']) {
|
||||
# Если ваших ресурсов меньше чем требуется.
|
||||
} else {
|
||||
# Если ваших ресурсов больше чем требуется.
|
||||
$help['count'] = +($val['count']-$current['count']);
|
||||
}
|
||||
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('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'].'шт.';
|
||||
}
|
||||
}
|
||||
}
|
||||
#
|
||||
# mysql_query('INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES ("'.$u->info['dnow'].'","'.time().'","'.$u->info['x'].'","'.$u->info['y'].'","'.$u->info['id'].'","building_resource","count_'.$help.'")');
|
||||
#
|
||||
#("'.$u->info['dnow'].'","'.time().'","'.$u->info['x'].'","'.$u->info['y'].'","'.$u->info['id'].'","building_resource","count_'.$help.'")');
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($_POST,$help, $item);
|
||||
if (isset($file) && $file[0] == 'dungeons/building.php' /* && $u->info['admin'] > 0 */) {
|
||||
|
||||
|
||||
# отображение
|
||||
$count = mysql_fetch_array(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>
|
||||
$need_count = 0;
|
||||
$actions = [];
|
||||
$resource = [];
|
||||
$action = explode('|', $file[1]);
|
||||
foreach ($action as $value) {
|
||||
$temp = explode(':', $value);
|
||||
$actions[$temp[0]] = $temp[1];
|
||||
}
|
||||
if (isset($actions['resource'])) {
|
||||
$action = explode(',', $actions['resource']);
|
||||
foreach ($action as $value) {
|
||||
$temp = explode('x', $value);
|
||||
$resource[] = [
|
||||
'item' => (int)$temp[0],
|
||||
'count' => (int)$temp[1],
|
||||
];
|
||||
$need_count = $need_count + (int)$temp[1];
|
||||
}
|
||||
}
|
||||
$actions['resource'] = $resource;
|
||||
unset($action, $temp, $value, $resource);
|
||||
|
||||
# Обьекты для строительства
|
||||
if (isset($_GET['buildend'])) {
|
||||
//identid
|
||||
$obj = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `dungeon_obj` WHERE `id` = "' . mysql_real_escape_string(
|
||||
$actions['identid']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
$txt = '';
|
||||
if (!isset($obj['id'])) {
|
||||
$txt = 'Объект строительства был поврежден темной магией...';
|
||||
} else {
|
||||
if ($obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y']) {
|
||||
$txt = 'Объект уже был построен ранее! Вернитесь на клетку назад для использования объекта!';
|
||||
} else {
|
||||
mysql_query(
|
||||
'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 = 'Строительство "' . $obj['name'] . '" завершилось, вернитесь на клетку назад...';
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setText('Игрок "<b>' . $u->info['login'] . '</b>" завершил строительство объекта "' . mysql_real_escape_string($actions['name']) . '".');
|
||||
$cmsg->setType(6);
|
||||
(new Chat())->sendMsg($cmsg);
|
||||
}
|
||||
}
|
||||
echo '<div style="font-weight: bold; color: red">' . $txt . '</div>';
|
||||
}
|
||||
|
||||
# пожертвование
|
||||
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'
|
||||
)
|
||||
);
|
||||
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'
|
||||
)
|
||||
);
|
||||
if (isset($item) && $item['name'] != '') {
|
||||
foreach ($actions['resource'] as $key => $val) {
|
||||
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'
|
||||
)
|
||||
);
|
||||
if ($current['count'] == null) {
|
||||
$current['count'] = 0;
|
||||
} else {
|
||||
$current['count'] = (int)$current['count'];
|
||||
}
|
||||
if ($current['count'] + (int)$help['count'] <= $val['count']) {
|
||||
# Если ваших ресурсов меньше чем требуется.
|
||||
} else {
|
||||
# Если ваших ресурсов больше чем требуется.
|
||||
$help['count'] = +($val['count'] - $current['count']);
|
||||
}
|
||||
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(
|
||||
'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'] . 'шт.';
|
||||
}
|
||||
}
|
||||
}
|
||||
#
|
||||
# mysql_query('INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES ("'.$u->info['dnow'].'","'.time().'","'.$u->info['x'].'","'.$u->info['y'].'","'.$u->info['id'].'","building_resource","count_'.$help.'")');
|
||||
#
|
||||
#("'.$u->info['dnow'].'","'.time().'","'.$u->info['x'].'","'.$u->info['y'].'","'.$u->info['id'].'","building_resource","count_'.$help.'")');
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($_POST, $help, $item);
|
||||
|
||||
|
||||
# отображение
|
||||
$count = mysql_fetch_array(
|
||||
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>
|
||||
<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>';
|
||||
$r .= '</td></tr>';
|
||||
# Текущее состояние строительства.
|
||||
foreach( $actions['resource'] as $key=>$val) {
|
||||
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['count'] = 0;
|
||||
} 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
|
||||
WHERE b.`building` = "'.$actions['ident'].'" AND im.`id` = '.$val['item'].' LIMIT 1'));
|
||||
}
|
||||
if( isset($current) && $current['name'] != '' ) {
|
||||
$actions['resource'][$key]['current'] = (int)$current['count'];
|
||||
$actions['resource'][$key]['name'] = $current['name'];
|
||||
$actions['resource'][$key]['img'] = $current['img'];
|
||||
} else {
|
||||
$actions['resource'][$key]['current'] = 0;
|
||||
$actions['resource'][$key]['name'] = "Неизвестный предмет";
|
||||
$actions['resource'][$key]['img'] = "";
|
||||
}
|
||||
}
|
||||
|
||||
unset($key,$val,$current);
|
||||
|
||||
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'));
|
||||
if(isset($current_uid) && $current_uid['count'] == NULL) $current_uid['count'] = 0; // Сколько можем внести
|
||||
|
||||
$r .= '<tr><td style="padding:1px 2px 1px 6px;">['.$row['name'].']</td>';
|
||||
if($row['current'] >= $row['count']){
|
||||
$input = '';
|
||||
} else{
|
||||
$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 .='<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>';
|
||||
unset($input,$current_uid);
|
||||
}
|
||||
|
||||
if( round($count/($need_count/100)) >= 100 ) {
|
||||
$r .= '<tr><td style="padding:1px 3px 1px 3px; text-align:center;"><br><input style="margin-left:120px;" class="btnnew2" onclick="location.href=\'/main.php?buildend\';" value="Завершить строительство" type="button"></td></tr>';
|
||||
}
|
||||
|
||||
$r .= '</table>';
|
||||
unset($row);
|
||||
<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>';
|
||||
# Текущее состояние строительства.
|
||||
foreach ($actions['resource'] as $key => $val) {
|
||||
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['count'] = 0;
|
||||
} 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
|
||||
WHERE b.`building` = "' . $actions['ident'] . '" AND im.`id` = ' . $val['item'] . ' LIMIT 1'
|
||||
)
|
||||
);
|
||||
}
|
||||
if (isset($current) && $current['name'] != '') {
|
||||
$actions['resource'][$key]['current'] = (int)$current['count'];
|
||||
$actions['resource'][$key]['name'] = $current['name'];
|
||||
$actions['resource'][$key]['img'] = $current['img'];
|
||||
} else {
|
||||
$actions['resource'][$key]['current'] = 0;
|
||||
$actions['resource'][$key]['name'] = "Неизвестный предмет";
|
||||
$actions['resource'][$key]['img'] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* <table width="480" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr>
|
||||
<td 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;">
|
||||
*/
|
||||
# Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник.
|
||||
$d->information = '<br/>'.$r;
|
||||
|
||||
|
||||
}
|
||||
unset($key, $val, $current);
|
||||
|
||||
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'
|
||||
)
|
||||
);
|
||||
if (isset($current_uid) && $current_uid['count'] == null) {
|
||||
$current_uid['count'] = 0;
|
||||
} // Сколько можем внести
|
||||
|
||||
$r .= '<tr><td style="padding:1px 2px 1px 6px;">[' . $row['name'] . ']</td>';
|
||||
if ($row['current'] >= $row['count']) {
|
||||
$input = '';
|
||||
} else {
|
||||
$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 .= '<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>';
|
||||
unset($input, $current_uid);
|
||||
}
|
||||
|
||||
if (round($count / ($need_count / 100)) >= 100) {
|
||||
$r .= '<tr><td style="padding:1px 3px 1px 3px; text-align:center;"><br><input style="margin-left:120px;" class="btnnew2" onclick="location.href=\'/main.php?buildend\';" value="Завершить строительство" type="button"></td></tr>';
|
||||
}
|
||||
|
||||
$r .= '</table>';
|
||||
unset($row);
|
||||
|
||||
|
||||
/*
|
||||
* <table width="480" style="border:1px solid gray;padding:4px 4px;" cellpadding="0" cellspacing="0"><tr>
|
||||
<td 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;">
|
||||
*/
|
||||
# Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник.
|
||||
$d->information = '<br/>' . $r;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user