@@ -288,30 +288,30 @@ $output.="
6|
".
$generator->getTimeFormat(round($u12['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u12['wood'] OR $village->aclay < $u12['clay'] OR $village->airon < $u12['iron'] OR $village->acrop < $u12['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u12'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u12['wood'] OR $village->aclay < $u12['clay'] OR $village->airon < $u12['iron'] OR $village->acrop < $u12['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u12'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
+ }
-
- if($database->checkIfResearched($village->wid, 't13') != 0){
+
+ if($database->checkIfResearched($village->wid, 't13') != 0){
$output.="
@@ -338,18 +338,18 @@ $output.="
| ";
- if($village->awood < $u13['wood'] OR $village->aclay < $u13['clay'] OR $village->airon < $u13['iron'] OR $village->acrop < $u13['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u13'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u13['wood'] OR $village->aclay < $u13['clay'] OR $village->airon < $u13['iron'] OR $village->acrop < $u13['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u13'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
-
- if($database->checkIfResearched($village->wid, 't15') != 0){
+ }
+
+ if($database->checkIfResearched($village->wid, 't15') != 0){
$output.="
@@ -364,30 +364,30 @@ $output.="
6|
".
$generator->getTimeFormat(round($u15['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u15['wood'] OR $village->aclay < $u15['clay'] OR $village->airon < $u15['iron'] OR $village->acrop < $u15['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u15'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u15['wood'] OR $village->aclay < $u15['clay'] OR $village->airon < $u15['iron'] OR $village->acrop < $u15['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u15'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
-
-
- if($database->checkIfResearched($village->wid, 't16') != 0){
+ }
+
+
+ if($database->checkIfResearched($village->wid, 't16') != 0){
$output.="
@@ -402,27 +402,27 @@ $output.="
6|
".
$generator->getTimeFormat(round($u16['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u16['wood'] OR $village->aclay < $u16['clay'] OR $village->airon < $u16['iron'] OR $village->acrop < $u16['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u16'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u16['wood'] OR $village->aclay < $u16['clay'] OR $village->airon < $u16['iron'] OR $village->acrop < $u16['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u16'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
+ }
}
@@ -442,29 +442,29 @@ $output.="
6|
".
$generator->getTimeFormat(round($u21['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u21['wood'] OR $village->aclay < $u21['clay'] OR $village->airon < $u21['iron'] OR $village->acrop < $u21['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u21'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u21['wood'] OR $village->aclay < $u21['clay'] OR $village->airon < $u21['iron'] OR $village->acrop < $u21['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u21'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
-
-
- if($database->checkIfResearched($village->wid, 't22') != 0){
+
+
+ if($database->checkIfResearched($village->wid, 't22') != 0){
$output.="
@@ -479,30 +479,30 @@ $output.="
6|
".
$generator->getTimeFormat(round($u22['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u22['wood'] OR $village->aclay < $u22['clay'] OR $village->airon < $u22['iron'] OR $village->acrop < $u22['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u22'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u22['wood'] OR $village->aclay < $u22['clay'] OR $village->airon < $u22['iron'] OR $village->acrop < $u22['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u22'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
+ }
-
- if($database->checkIfResearched($village->wid, 't24') != 0){
+
+ if($database->checkIfResearched($village->wid, 't24') != 0){
$output.="
@@ -517,29 +517,29 @@ $output.="
6|
".
$generator->getTimeFormat(round($u24['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u24['wood'] OR $village->aclay < $u24['clay'] OR $village->airon < $u24['iron'] OR $village->acrop < $u24['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u24'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u24['wood'] OR $village->aclay < $u24['clay'] OR $village->airon < $u24['iron'] OR $village->acrop < $u24['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u24'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
-
- if($database->checkIfResearched($village->wid, 't25') != 0){
+ }
+
+ if($database->checkIfResearched($village->wid, 't25') != 0){
$output.="
@@ -554,30 +554,30 @@ $output.="
6|
".
$generator->getTimeFormat(round($u25['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u25['wood'] OR $village->aclay < $u25['clay'] OR $village->airon < $u25['iron'] OR $village->acrop < $u25['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u25'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u25['wood'] OR $village->aclay < $u25['clay'] OR $village->airon < $u25['iron'] OR $village->acrop < $u25['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u25'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
-
-
- if($database->checkIfResearched($village->wid, 't26') != 0){
+ }
+
+
+ if($database->checkIfResearched($village->wid, 't26') != 0){
$output.="
@@ -592,27 +592,27 @@ $output.="
6|
".
$generator->getTimeFormat(round($u26['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
-
+
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "| ";
}
-
+
$output .= "
";
- if($village->awood < $u26['wood'] OR $village->aclay < $u26['clay'] OR $village->airon < $u26['iron'] OR $village->acrop < $u26['crop']) {
- $output.= "".NOT."".ENOUGH_RESOURCES."";
- }else if($units['u26'] == 0){
- $output.= "".NOT_UNITS."";
+ if($village->awood < $u26['wood'] OR $village->aclay < $u26['clay'] OR $village->airon < $u26['iron'] OR $village->acrop < $u26['crop']) {
+ $output.= "".NOT."".ENOUGH_RESOURCES."";
+ }else if($units['u26'] == 0){
+ $output.= "".NOT_UNITS."";
}else {
$output.= "".TRAIN."";
- }
+ }
$output.=" |
";
- }
+ }
}
@@ -624,10 +624,15 @@ $output.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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.="
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;
}
?>
| | | | | | | |