mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-12 14:21:03 +00:00
@@ -105,7 +105,7 @@
|
||||
<?php echo "<tr class='next'><th>".HERO_READY." <span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
echo "<tr>
|
||||
@@ -115,7 +115,7 @@
|
||||
$name ($name1)
|
||||
</div>"
|
||||
?>
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<?php }else if (!$reviving) { if($hero_datarow['unit'] == 1 OR 11 OR 21){ ?>
|
||||
@@ -140,7 +140,7 @@
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
@@ -148,12 +148,12 @@
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1&hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
|
||||
}
|
||||
|
||||
|
||||
?></center></td>
|
||||
</tr>
|
||||
<?php }else { ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if($database->checkIfResearched($village->wid, 't'.$hero_datarow['unit']) != 0){ ?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
@@ -176,7 +176,7 @@
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
@@ -184,7 +184,7 @@
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1&hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</center></td>
|
||||
</tr>
|
||||
@@ -195,21 +195,26 @@
|
||||
if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $wood." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $clay." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $iron ." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $crop." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $wood.",
|
||||
`clay` = `clay` - ".(int) $clay.",
|
||||
`iron` = `iron` - ".(int) $iron .",
|
||||
`crop` = `crop` - ".(int) $crop."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
} else {
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
+307
-232
@@ -48,7 +48,7 @@ $output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
|
||||
<th colspan=2>".TRAIN_HERO."</th>
|
||||
</tr>
|
||||
</thead>";
|
||||
|
||||
|
||||
if($session->tribe == 1) {
|
||||
$output.=" <tr>
|
||||
<td class=\"desc\">
|
||||
@@ -72,20 +72,20 @@ if($session->tribe == 1) {
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
|
||||
if($village->awood < $u1['wood'] || $village->aclay < $u1['clay'] || $village->airon < $u1['iron'] || $village->acrop < $u1['crop'])
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
elseif($units['u1'] == 0)
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
|
||||
if($village->awood < $u1['wood'] || $village->aclay < $u1['clay'] || $village->airon < $u1['iron'] || $village->acrop < $u1['crop'])
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
elseif($units['u1'] == 0)
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
else $output.="<a href=\"build.php?id=".$id."&train=1\">".TRAIN."</a>";
|
||||
|
||||
|
||||
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't2') != 0){
|
||||
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't2') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -100,29 +100,29 @@ if($session->tribe == 1) {
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$output.=$generator->getTimeFormat(round($u2['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u2['wood']."&r2=".$u2['clay']."&r3=".$u2['iron']."&r4=".$u2['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output.="</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u2['wood'] OR $village->aclay < $u2['clay'] OR $village->airon < $u2['iron'] OR $village->acrop < $u2['crop'])
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
|
||||
if($village->awood < $u2['wood'] OR $village->aclay < $u2['clay'] OR $village->airon < $u2['iron'] OR $village->acrop < $u2['crop'])
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
elseif($units['u2'] == 0)
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
else
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
else
|
||||
$output.="<a href=\"build.php?id=".$id."&train=2\">".TRAIN."</a>";
|
||||
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't3') != 0){
|
||||
|
||||
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -136,30 +136,30 @@ if($session->tribe == 1) {
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u3['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
|
||||
|
||||
$output.= $generator->getTimeFormat(round($u3['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u3['wood']."&r2=".$u3['clay']."&r3=".$u3['iron']."&r4=".$u3['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output.= "</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u3['wood'] OR $village->aclay < $u3['clay'] OR $village->airon < $u3['iron'] OR $village->acrop < $u3['crop']) {
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u3'] == 0){
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
|
||||
if($village->awood < $u3['wood'] OR $village->aclay < $u3['clay'] OR $village->airon < $u3['iron'] OR $village->acrop < $u3['crop']) {
|
||||
$output.="<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u3'] == 0){
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.="<a href=\"build.php?id=".$id."&train=3\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
"</center></td>
|
||||
</tr> " ;
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't5') != 0){
|
||||
</tr> " ;
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't5') != 0){
|
||||
$output.= "<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -174,29 +174,29 @@ if($session->tribe == 1) {
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u5['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u5['wood']."&r2=".$u5['clay']."&r3=".$u5['iron']."&r4=".$u5['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u5['wood'] OR $village->aclay < $u5['clay'] OR $village->airon < $u5['iron'] OR $village->acrop < $u5['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u5'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
|
||||
if($village->awood < $u5['wood'] OR $village->aclay < $u5['clay'] OR $village->airon < $u5['iron'] OR $village->acrop < $u5['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u5'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=5\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't6') != 0){
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't6') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -211,29 +211,29 @@ if($session->tribe == 1) {
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u6['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u6['wood']."&r2=".$u6['clay']."&r3=".$u6['iron']."&r4=".$u6['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center> ";
|
||||
|
||||
if($village->awood < $u6['wood'] OR $village->aclay < $u6['clay'] OR $village->airon < $u6['iron'] OR $village->acrop < $u6['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u6'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
|
||||
if($village->awood < $u6['wood'] OR $village->aclay < $u6['clay'] OR $village->airon < $u6['iron'] OR $village->acrop < $u6['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u6'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=6\">".TRAIN."</a>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($session->tribe == 2) {
|
||||
|
||||
@@ -251,29 +251,29 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u11['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u11['wood']."&r2=".$u11['clay']."&r3=".$u11['iron']."&r4=".$u11['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u11['wood'] OR $village->aclay < $u11['clay'] OR $village->airon < $u11['iron'] OR $village->acrop < $u11['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u11'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u11['wood'] OR $village->aclay < $u11['clay'] OR $village->airon < $u11['iron'] OR $village->acrop < $u11['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u11'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=11\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't12') != 0){
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't12') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -288,30 +288,30 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u12['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u12['wood']."&r2=".$u12['clay']."&r3=".$u12['iron']."&r4=".$u12['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u12['wood'] OR $village->aclay < $u12['clay'] OR $village->airon < $u12['iron'] OR $village->acrop < $u12['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u12'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u12['wood'] OR $village->aclay < $u12['clay'] OR $village->airon < $u12['iron'] OR $village->acrop < $u12['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u12'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=12\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't13') != 0){
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't13') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -338,18 +338,18 @@ $output.="<tr>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u13['wood'] OR $village->aclay < $u13['clay'] OR $village->airon < $u13['iron'] OR $village->acrop < $u13['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u13'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u13['wood'] OR $village->aclay < $u13['clay'] OR $village->airon < $u13['iron'] OR $village->acrop < $u13['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u13'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=13\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't15') != 0){
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't15') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -364,30 +364,30 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u15['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u15['wood']."&r2=".$u15['clay']."&r3=".$u15['iron']."&r4=".$u15['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u15['wood'] OR $village->aclay < $u15['clay'] OR $village->airon < $u15['iron'] OR $village->acrop < $u15['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u15'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u15['wood'] OR $village->aclay < $u15['clay'] OR $village->airon < $u15['iron'] OR $village->acrop < $u15['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u15'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=15\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't16') != 0){
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't16') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -402,27 +402,27 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u16['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u16['wood']."&r2=".$u16['clay']."&r3=".$u16['iron']."&r4=".$u16['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u16['wood'] OR $village->aclay < $u16['clay'] OR $village->airon < $u16['iron'] OR $village->acrop < $u16['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u16'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u16['wood'] OR $village->aclay < $u16['clay'] OR $village->airon < $u16['iron'] OR $village->acrop < $u16['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u16'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=16\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -442,29 +442,29 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u21['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u21['wood']."&r2=".$u21['clay']."&r3=".$u21['iron']."&r4=".$u21['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u21['wood'] OR $village->aclay < $u21['clay'] OR $village->airon < $u21['iron'] OR $village->acrop < $u21['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u21'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u21['wood'] OR $village->aclay < $u21['clay'] OR $village->airon < $u21['iron'] OR $village->acrop < $u21['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u21'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=21\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't22') != 0){
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't22') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -479,30 +479,30 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u22['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u22['wood']."&r2=".$u22['clay']."&r3=".$u22['iron']."&r4=".$u22['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u22['wood'] OR $village->aclay < $u22['clay'] OR $village->airon < $u22['iron'] OR $village->acrop < $u22['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u22'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u22['wood'] OR $village->aclay < $u22['clay'] OR $village->airon < $u22['iron'] OR $village->acrop < $u22['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u22'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=22\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't24') != 0){
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't24') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -517,29 +517,29 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u24['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u24['wood']."&r2=".$u24['clay']."&r3=".$u24['iron']."&r4=".$u24['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u24['wood'] OR $village->aclay < $u24['clay'] OR $village->airon < $u24['iron'] OR $village->acrop < $u24['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u24'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u24['wood'] OR $village->aclay < $u24['clay'] OR $village->airon < $u24['iron'] OR $village->acrop < $u24['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u24'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=24\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't25') != 0){
|
||||
}
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't25') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -554,30 +554,30 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u25['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u25['wood']."&r2=".$u25['clay']."&r3=".$u25['iron']."&r4=".$u25['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u25['wood'] OR $village->aclay < $u25['clay'] OR $village->airon < $u25['iron'] OR $village->acrop < $u25['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u25'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u25['wood'] OR $village->aclay < $u25['clay'] OR $village->airon < $u25['iron'] OR $village->acrop < $u25['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u25'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=25\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't26') != 0){
|
||||
}
|
||||
|
||||
|
||||
if($database->checkIfResearched($village->wid, 't26') != 0){
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
@@ -592,27 +592,27 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u26['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u26['wood']."&r2=".$u26['clay']."&r3=".$u26['iron']."&r4=".$u26['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
|
||||
$output .= "
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class=\"val\" width=\"20%\"><center>";
|
||||
|
||||
if($village->awood < $u26['wood'] OR $village->aclay < $u26['clay'] OR $village->airon < $u26['iron'] OR $village->acrop < $u26['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u26'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
if($village->awood < $u26['wood'] OR $village->aclay < $u26['clay'] OR $village->airon < $u26['iron'] OR $village->acrop < $u26['crop']) {
|
||||
$output.= "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else if($units['u26'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=26\">".TRAIN."</a>";
|
||||
}
|
||||
}
|
||||
$output.="</center></td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -624,10 +624,15 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '1', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u1['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u1['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u1['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u1['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u1['wood'].",
|
||||
`clay` = `clay` - ".(int) $u1['clay'].",
|
||||
`iron` = `iron` - ".(int) $u1['iron'].",
|
||||
`crop` = `crop` - ".(int) $u1['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
@@ -641,31 +646,41 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '2', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u2['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u2['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u2['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u2['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u2['wood'].",
|
||||
`clay` = `clay` - ".(int) $u2['clay'].",
|
||||
`iron` = `iron` - ".(int) $u2['iron'].",
|
||||
`crop` = `crop` - ".(int) $u2['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 3){
|
||||
if($session->access != BANNED){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '3', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u3['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u3['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u3['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u3['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u3['wood'].",
|
||||
`clay` = `clay` - ".(int) $u3['clay'].",
|
||||
`iron` = `iron` - ".(int) $u3['iron'].",
|
||||
`crop` = `crop` - ".(int) $u3['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 5){
|
||||
@@ -673,16 +688,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '5', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u5['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u5['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u5['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u5['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u5['wood'].",
|
||||
`clay` = `clay` - ".(int) $u5['clay'].",
|
||||
`iron` = `iron` - ".(int) $u5['iron'].",
|
||||
`crop` = `crop` - ".(int) $u5['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 6){
|
||||
@@ -690,16 +710,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '6', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u6['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u6['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u6['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u6['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u6['wood'].",
|
||||
`clay` = `clay` - ".(int) $u6['clay'].",
|
||||
`iron` = `iron` - ".(int) $u6['iron'].",
|
||||
`crop` = `crop` - ".(int) $u6['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -709,16 +734,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '11', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u11['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u11['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u11['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u11['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u11['wood'].",
|
||||
`clay` = `clay` - ".(int) $u11['clay'].",
|
||||
`iron` = `iron` - ".(int) $u11['iron'].",
|
||||
`crop` = `crop` - ".(int) $u11['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 12){
|
||||
@@ -726,16 +756,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '12', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u12['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u12['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u12['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u12['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u12['wood'].",
|
||||
`clay` = `clay` - ".(int) $u12['clay'].",
|
||||
`iron` = `iron` - ".(int) $u12['iron'].",
|
||||
`crop` = `crop` - ".(int) $u12['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 13){
|
||||
@@ -743,16 +778,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '13', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u13['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u13['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u13['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u13['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u13['wood'].",
|
||||
`clay` = `clay` - ".(int) $u13['clay'].",
|
||||
`iron` = `iron` - ".(int) $u13['iron'].",
|
||||
`crop` = `crop` - ".(int) $u13['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 15){
|
||||
@@ -760,16 +800,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '15', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u15['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u15['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u15['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u15['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u15['wood'].",
|
||||
`clay` = `clay` - ".(int) $u15['clay'].",
|
||||
`iron` = `iron` - ".(int) $u15['iron'].",
|
||||
`crop` = `crop` - ".(int) $u15['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 16){
|
||||
@@ -777,16 +822,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '16', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u16['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u16['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u16['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u16['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u16['wood'].",
|
||||
`clay` = `clay` - ".(int) $u16['clay'].",
|
||||
`iron` = `iron` - ".(int) $u16['iron'].",
|
||||
`crop` = `crop` - ".(int) $u16['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -796,16 +846,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '21', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u21['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u21['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u21['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u21['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u21['wood'].",
|
||||
`clay` = `clay` - ".(int) $u21['clay'].",
|
||||
`iron` = `iron` - ".(int) $u21['iron'].",
|
||||
`crop` = `crop` - ".(int) $u21['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 22){
|
||||
@@ -813,16 +868,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '22', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u22['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u22['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u22['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u22['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u22['wood'].",
|
||||
`clay` = `clay` - ".(int) $u22['clay'].",
|
||||
`iron` = `iron` - ".(int) $u22['iron'].",
|
||||
`crop` = `crop` - ".(int) $u22['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 24){
|
||||
@@ -830,16 +890,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '24', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u24['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u24['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u24['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u24['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u24['wood'].",
|
||||
`clay` = `clay` - ".(int) $u24['clay'].",
|
||||
`iron` = `iron` - ".(int) $u24['iron'].",
|
||||
`crop` = `crop` - ".(int) $u24['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 25){
|
||||
@@ -847,16 +912,21 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '25', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u25['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u25['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u25['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u25['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u25['wood'].",
|
||||
`clay` = `clay` - ".(int) $u25['clay'].",
|
||||
`iron` = `iron` - ".(int) $u25['iron'].",
|
||||
`crop` = `crop` - ".(int) $u25['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if(isset($_GET['train']) && $_GET['train'] == 26){
|
||||
@@ -864,24 +934,29 @@ $output.="<tr>
|
||||
if($count_hero < 3){
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$database->escape($session->uid)."', '" . (int) $village->wid . "', '0', '26', '".$database->escape($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) $u26['wood']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".(int) $u26['clay']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".(int) $u26['iron']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".(int) $u26['crop']." WHERE `wref` = '" . (int) $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $u26['wood'].",
|
||||
`clay` = `clay` - ".(int) $u26['clay'].",
|
||||
`iron` = `iron` - ".(int) $u26['iron'].",
|
||||
`crop` = `crop` - ".(int) $u26['crop']."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
echo $output;
|
||||
|
||||
|
||||
|
||||
echo $output;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
@@ -178,8 +178,8 @@ $user = $session->uid;
|
||||
|
||||
|
||||
//loop search village user
|
||||
$query = mysqli_query($GLOBALS['link'],"SELECT wref FROM ".TB_PREFIX."vdata WHERE owner = ".(int) $user."");
|
||||
while($villaggi_array = mysqli_fetch_array($query)){
|
||||
$villages = $database->getProfileVillages($user);
|
||||
foreach ($villages as $villaggi_array){
|
||||
|
||||
//loop structure village
|
||||
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".(int) $villaggi_array['wref']."");
|
||||
@@ -189,7 +189,7 @@ while($villaggi_array = mysqli_fetch_array($query)){
|
||||
//search Castle in array structure village
|
||||
$test = in_array(26,$strutture);
|
||||
|
||||
if ($test){
|
||||
if ($test){
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -302,8 +302,8 @@ $user = $session->uid;
|
||||
//mysqli_select_db(SQL_DB);
|
||||
|
||||
//loop search village user
|
||||
$query = mysqli_query($GLOBALS['link'],"SELECT wref FROM ".TB_PREFIX."vdata WHERE owner = ".(int) $user."");
|
||||
while($villaggi_array = mysqli_fetch_array($query)){
|
||||
$villages = $database->getProfileVillages($user);
|
||||
foreach ($villages as $villaggi_array){
|
||||
|
||||
//loop structure village
|
||||
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".(int) $villaggi_array['wref']."");
|
||||
@@ -314,7 +314,7 @@ while($villaggi_array = mysqli_fetch_array($query)){
|
||||
$test = in_array(26,$strutture);
|
||||
else
|
||||
$test = in_array(26,[]);
|
||||
if ($test){
|
||||
if ($test){
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user