Utf8 convert
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
if(!defined('GAME'))die();
|
||||
|
||||
// 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
|
||||
|
||||
if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] > 0 */ ) {
|
||||
|
||||
@@ -28,27 +28,27 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
$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 = 'Îáúåêò ñòðîèòåëüñòâà áûë ïîâðåæäåí òåìíîé ìàãèåé...';
|
||||
$txt = 'Объект строительства был поврежден темной магией...';
|
||||
}else{
|
||||
if( $obj['x'] == $u->info['x'] && $obj['y'] == $u->info['y'] ) {
|
||||
$txt = 'Îáúåêò óæå áûë ïîñòðîåí ðàíåå! Âåðíèòåñü íà êëåòêó íàçàä äëÿ èñïîëüçîâàíèÿ îáúåêòà!';
|
||||
$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);
|
||||
$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){
|
||||
@@ -59,15 +59,15 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
$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'].'øò.';
|
||||
$d->error = 'Вы пожертвовали на строительство ['.$item['name'].'] в количестве '.$help['count'].'шт.';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,14 +81,14 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
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>';
|
||||
<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'));
|
||||
@@ -103,7 +103,7 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
$actions['resource'][$key]['img'] = $current['img'];
|
||||
} else {
|
||||
$actions['resource'][$key]['current'] = 0;
|
||||
$actions['resource'][$key]['name'] = "Íåèçâåñòíûé ïðåäìåò";
|
||||
$actions['resource'][$key]['name'] = "Неизвестный предмет";
|
||||
$actions['resource'][$key]['img'] = "";
|
||||
}
|
||||
}
|
||||
@@ -112,13 +112,13 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
|
||||
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; // Ñêîëüêî ìîæåì âíåñòè
|
||||
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>';
|
||||
$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>';
|
||||
@@ -127,7 +127,7 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
}
|
||||
|
||||
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 .= '<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>';
|
||||
@@ -136,10 +136,10 @@ if(isset($file) && $file[0]=='dungeons/building.php' /* && $u->info['admin'] >
|
||||
|
||||
/*
|
||||
* <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 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'].'", íî íàì íåõâàòàåò ðåñóðñîâ, ïîìîãè äîáðûé ñòðàííèê.
|
||||
# Идет строительство "'.$actions['name'].'", но нам нехватает ресурсов, помоги добрый странник.
|
||||
$d->information = '<br/>'.$r;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user