dblink,"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid.""); $units_array = mysqli_fetch_array($result); $count_hero = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = " . $database->escape($session->uid) . ""), MYSQLI_ASSOC); $count_hero = $count_hero['Total']; if ($count_hero < 3) { $output=""; if($session->tribe == 1) { $output.=" "; if($database->checkIfResearched($village->wid, 't2') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't3') != 0){ $output.=" " ; } if($database->checkIfResearched($village->wid, 't5') != 0){ $output.= ""; } if($database->checkIfResearched($village->wid, 't6') != 0){ $output.=""; } } if($session->tribe == 2) { $output.=""; if($database->checkIfResearched($village->wid, 't12') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't13') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't15') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't16') != 0){ $output.=""; } } if($session->tribe == 3) { $output.=""; if($database->checkIfResearched($village->wid, 't22') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't24') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't25') != 0){ $output.=""; } if($database->checkIfResearched($village->wid, 't26') != 0){ $output.=""; } } //HERO TRAINING if (isset($_GET['train'])) { $validationArray = []; switch ($session->tribe) { case 1: $validationArray = [1, 2, 3, 5, 6]; break; case 2: $validationArray = [11, 12, 13, 15, 16]; break; case 3: $validationArray = [21, 22, 24, 25, 26]; break; } // check for a valid unit value if (in_array($_GET['train'], $validationArray)) { if($count_hero < 3){ $unitID = $_GET['train']; mysqli_query($database->dblink,"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, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)"); mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid); mysqli_query($database->dblink," UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) ${'u'.$unitID}['wood'].", `clay` = `clay` - ".(int) ${'u'.$unitID}['clay'].", `iron` = `iron` - ".(int) ${'u'.$unitID}['iron'].", `crop` = `crop` - ".(int) ${'u'.$unitID}['crop']." WHERE `wref` = " . (int) $village->wid); } header("Location: build.php?id=".$id.""); exit; } } echo $output; } ?>
".TRAIN_HERO."
\"".U1."\" ".U1."
\"Wood\"".$u1['wood']."| \"Clay\"".$u1['clay']."| \"Iron\"".$u1['iron']."| \"Crop\"".$u1['crop']."| \"Crop6| \"Duration\""; $output .= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5,$u1['time'] / SPEED)*3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u1['wood'] + $u1['clay'] + $u1['iron'] + $u1['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output.="
"; if($village->awood < $u1['wood'] || $village->aclay < $u1['clay'] || $village->airon < $u1['iron'] || $village->acrop < $u1['crop']) $output.="".NOT."".ENOUGH_RESOURCES.""; elseif( $units_array['u1'] == 0) $output.="".NOT_UNITS.""; else $output.="".TRAIN.""; $output.="
\"".U2."\" ".U2."
\"Wood\"".$u2['wood']."| \"Clay\"".$u2['clay']."| \"Iron\"".$u2['iron']."| \"Crop\"".$u2['crop']."| \"Crop6| \"Duration\""; $output.=$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u2['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u2['wood'] + $u2['clay'] + $u2['iron'] + $u2['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output.="
"; if($village->awood < $u2['wood'] OR $village->aclay < $u2['clay'] OR $village->airon < $u2['iron'] OR $village->acrop < $u2['crop']) $output.="".NOT."".ENOUGH_RESOURCES.""; elseif( $units_array['u2'] == 0) $output.="".NOT_UNITS.""; else $output.="".TRAIN.""; $output.="
\"".U3."\" ".U3."
\"Wood\"".$u3['wood']."| \"Clay\"".$u3['clay']."| \"Iron\"".$u3['iron']."| \"Crop\"".$u3['crop']."| \"Crop6| \"Duration\""; $output.= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u3['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u3['wood'] + $u3['clay'] + $u3['iron'] + $u3['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output.= "
"; if($village->awood < $u3['wood'] OR $village->aclay < $u3['clay'] OR $village->airon < $u3['iron'] OR $village->acrop < $u3['crop']) { $output.="".NOT."".ENOUGH_RESOURCES.""; }else if( $units_array['u3'] == 0){ $output.="".NOT_UNITS.""; }else { $output.="".TRAIN.""; } "
\"".U5."\" ".U5."
\"Wood\"".$u5['wood']."| \"Clay\"".$u5['clay']."| \"Iron\"".$u5['iron']."| \"Crop\"".$u5['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u5['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u5['wood'] + $u5['clay'] + $u5['iron'] + $u5['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output .= "
"; if($village->awood < $u5['wood'] OR $village->aclay < $u5['clay'] OR $village->airon < $u5['iron'] OR $village->acrop < $u5['crop']) { $output.= "".NOT."".ENOUGH_RESOURCES.""; }else if( $units_array['u5'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U6."\" ".U6."
\"Wood\"".$u6['wood']."| \"Clay\"".$u6['clay']."| \"Iron\"".$u6['iron']."| \"Crop\"".$u6['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u6['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u6['wood'] + $u6['clay'] + $u6['iron'] + $u6['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output .= "
"; if($village->awood < $u6['wood'] OR $village->aclay < $u6['clay'] OR $village->airon < $u6['iron'] OR $village->acrop < $u6['crop']) { $output.= "".NOT."".ENOUGH_RESOURCES.""; }else if( $units_array['u6'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U11."\" ".U11."
\"Wood\"".$u11['wood']."| \"Clay\"".$u11['clay']."| \"Iron\"".$u11['iron']."| \"Crop\"".$u11['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u11['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u11['wood'] + $u11['clay'] + $u11['iron'] + $u11['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $output .= "
"; if($village->awood < $u11['wood'] OR $village->aclay < $u11['clay'] OR $village->airon < $u11['iron'] OR $village->acrop < $u11['crop']) { $output.= "".NOT."".ENOUGH_RESOURCES.""; }else if( $units_array['u11'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U12."\" ".U12."
\"Wood\"".$u12['wood']."| \"Clay\"".$u12['clay']."| \"Iron\"".$u12['iron']."| \"Crop\"".$u12['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u12['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u12['wood'] + $u12['clay'] + $u12['iron'] + $u12['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u12'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U13."\" ".U13."
\"Wood\"".$u13['wood']."| \"Clay\"".$u13['clay']."| \"Iron\"".$u13['iron']."| \"Crop\"".$u13['crop']."| \"Crop6| \"Duration\""; $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u13['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u13['wood'] + $u13['clay'] + $u13['iron'] + $u13['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u13'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U15."\" ".U15."
\"Wood\"".$u15['wood']."| \"Clay\"".$u15['clay']."| \"Iron\"".$u15['iron']."| \"Crop\"".$u15['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u15['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u15['wood'] + $u15['clay'] + $u15['iron'] + $u15['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u15'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U16."\" ".U16."
\"Wood\"".$u16['wood']."| \"Clay\"".$u16['clay']."| \"Iron\"".$u16['iron']."| \"Crop\"".$u16['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u16['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u16['wood'] + $u16['clay'] + $u16['iron'] + $u16['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u16'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U21."\" ".U21."
\"Wood\"".$u21['wood']."| \"Clay\"".$u21['clay']."| \"Iron\"".$u21['iron']."| \"Crop\"".$u21['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u21['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u21['wood'] + $u21['clay'] + $u21['iron'] + $u21['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u21'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U22."\" ".U22."
\"Wood\"".$u22['wood']."| \"Clay\"".$u22['clay']."| \"Iron\"".$u22['iron']."| \"Crop\"".$u22['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u22['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u22['wood'] + $u22['clay'] + $u22['iron'] + $u22['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u22'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U24."\" ".U24."
\"Wood\"".$u24['wood']."| \"Clay\"".$u24['clay']."| \"Iron\"".$u24['iron']."| \"Crop\"".$u24['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u24['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u24['wood'] + $u24['clay'] + $u24['iron'] + $u24['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u24'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U25."\" ".U25."
\"Wood\"".$u25['wood']."| \"Clay\"".$u25['clay']."| \"Iron\"".$u25['iron']."| \"Crop\"".$u25['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u25['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u25['wood'] + $u25['clay'] + $u25['iron'] + $u25['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u25'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="
\"".U26."\" ".U26."
\"Wood\"".$u26['wood']."| \"Clay\"".$u26['clay']."| \"Iron\"".$u26['iron']."| \"Crop\"".$u26['crop']."| \"Crop6| \"Duration\"". $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u26['time'] / SPEED) * 3); //-- If available resources combined are not enough, remove NPC button $total_required = (int)($u26['wood'] + $u26['clay'] + $u26['iron'] + $u26['crop']); if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) { $output .= "|\"NPC"; } $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_array['u26'] == 0){ $output.= "".NOT_UNITS.""; }else { $output.= "".TRAIN.""; } $output.="