mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-05 04:14:22 +00:00
catching up (#4)
* fix: all languages added to installer * fix: all languages added to installer and Admin * fix: max crop/resources reset to level 1 value temporarily This happened when level 1 granary / warehouse was built because of a missing + sign in a formula. #374 * chore: some more badges and thanks to JetBrains :) * chore: one more badge :P * chore: cleanup * fix: Multihunter should have access to villages info * fix: troops duplicate for certain tribes via raid lists * fix: no need for WW Building Plan to start building a WW #337 * fix: natar WW villages created without units #392 * fix: sendunits.txt file could not be opened from Admin * fix: WW villages created via Admin do not have any units #392 * fix: WW building plans must be in player's village to start building WW #337 * fix: hero training and revival misbehaving * fix: spending hero points subtracts these from all player's heroes #341 * fix: 2nd row of catapults firing when not allowed #393 * fix: 2nd wave of catapults destroys targets and villages incorrectly #393 * fix: adding new village via Admin generates incorrect fields * chore: create default users with bcrypt enabled by default * fix: in-game Support login fails * fix: wrong password verify check allows for any login
This commit is contained in:
@@ -218,6 +218,8 @@ class Account {
|
||||
|
||||
if ( $activateData != "" ) {
|
||||
$form->addError( "activate", $_POST['user'] );
|
||||
} else {
|
||||
$form->addError("pw",LOGIN_PW_ERROR);
|
||||
}
|
||||
} else {
|
||||
$form->addError("pw",LOGIN_PW_ERROR);
|
||||
|
||||
@@ -181,7 +181,7 @@ class adm_DB {
|
||||
$username = $database->getUserArray($uid,1);
|
||||
$username = $username['username'];
|
||||
$database->addVillage($wid,$uid,$username,'0');
|
||||
$database->addResourceFields($wid,$database->getVillageType($wid));
|
||||
$database->addResourceFields($wid,$database->getVillageType($wid, false));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
|
||||
+56
-40
@@ -1090,8 +1090,8 @@ class Automation {
|
||||
}
|
||||
|
||||
// oasis cannot be destroyed
|
||||
$pop=$this->recountPop($data['to'], false);
|
||||
if ($isoasis == 0) {
|
||||
$pop=$this->recountPop($data['to'], false);
|
||||
if($pop==0 && $can_destroy==1){
|
||||
$village_destroyed = 1;
|
||||
// this will ensure the right $info_cat text
|
||||
@@ -2267,6 +2267,9 @@ class Automation {
|
||||
else
|
||||
{
|
||||
// village stands, let's do the damage
|
||||
/**
|
||||
* FIRST CATAPULTS ROW
|
||||
*/
|
||||
$basearray = $data['to'];
|
||||
$bdo = $database->getResourceLevel($basearray, false);
|
||||
$catapultTarget = $data['ctar1'];
|
||||
@@ -2277,15 +2280,12 @@ class Automation {
|
||||
$catapults2TargetRandom = ($catapults2WillNotShoot || $catapultTarget2 == 99);
|
||||
|
||||
// we're manually targetting 1st and/or 2nd row of catapults
|
||||
if (!$catapults1TargetRandom || !$catapults2TargetRandom)
|
||||
if (!$catapults1TargetRandom)
|
||||
{
|
||||
$_catapultsTarget1Levels=array();
|
||||
$__catapultsTarget1AltTargets=array();
|
||||
|
||||
$_catapultsTarget2Levels=array();
|
||||
$__catapultsTarget2AltTargets=array();
|
||||
|
||||
// calculate targets for 1st and 2nd rows of catapults
|
||||
// calculate targets for 1st rows of catapults
|
||||
$j=0;
|
||||
for ($i=1;$i<=41;$i++)
|
||||
{
|
||||
@@ -2298,13 +2298,6 @@ class Automation {
|
||||
$_catapultsTarget1Levels[$j]=$bdo['f'.$i];
|
||||
$__catapultsTarget1AltTargets[$j]=$i;
|
||||
}
|
||||
|
||||
// 2nd row of catapults pre-selected target calculations, if needed
|
||||
if (!$catapults2TargetRandom && !$catapults2WillNotShoot && $bdo['f'.$i.'t'] == $catapultTarget2 && $bdo['f'.$i] > 0 && $catapultTarget2 != 31 && $catapultTarget2 != 32 && $catapultTarget2 != 33)
|
||||
{
|
||||
$_catapultsTarget2Levels[$j]=$bdo['f'.$i];
|
||||
$__catapultsTarget2AltTargets[$j]=$i;
|
||||
}
|
||||
}
|
||||
|
||||
// if we couldn't find a suitable target for 1st row of catapults,
|
||||
@@ -2321,6 +2314,54 @@ class Automation {
|
||||
$catapults1TargetRandom = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 1st row of catapults set to target randomly
|
||||
if ($catapults1TargetRandom)
|
||||
{
|
||||
$list=array();
|
||||
for ($i=1;$i<=41;$i++)
|
||||
{
|
||||
if ($i==41) $i=99;
|
||||
if ($bdo['f'.$i] > 0 && $catapultTarget != 31 && $catapultTarget != 32 && $catapultTarget != 33)
|
||||
{
|
||||
$list[]=$i;
|
||||
}
|
||||
}
|
||||
$catapultTarget = $list[ rand(0, count($list) - 1) ];
|
||||
}
|
||||
|
||||
/**
|
||||
* resolve 1st row of catapults
|
||||
*/
|
||||
$village_destroyed = 0;
|
||||
$this->resolveCatapultsDestruction($bdo, $battlepart, $info_cat, $data, $catapultTarget, !$catapults2WillNotShoot, false, $catp_pic, $can_destroy, $isoasis, $village_destroyed);
|
||||
|
||||
/**
|
||||
* SECOND CATAPULTS ROW
|
||||
*/
|
||||
// reload resource levels, since they've changed now
|
||||
$bdo = $database->getResourceLevel($basearray, false);
|
||||
|
||||
// we're manually targetting 2nd row of catapults
|
||||
if (!$catapults2TargetRandom)
|
||||
{
|
||||
$_catapultsTarget2Levels=array();
|
||||
$__catapultsTarget2AltTargets=array();
|
||||
|
||||
// calculate targets for 2nd rows of catapults
|
||||
$j=0;
|
||||
for ($i=1;$i<=41;$i++)
|
||||
{
|
||||
if ($i==41) $i=99;
|
||||
|
||||
// 2nd row of catapults pre-selected target calculations, if needed
|
||||
if (!$catapults2TargetRandom && !$catapults2WillNotShoot && $bdo['f'.$i.'t'] == $catapultTarget2 && $bdo['f'.$i] > 0 && $catapultTarget2 != 31 && $catapultTarget2 != 32 && $catapultTarget2 != 33)
|
||||
{
|
||||
$_catapultsTarget2Levels[$j]=$bdo['f'.$i];
|
||||
$__catapultsTarget2AltTargets[$j]=$i;
|
||||
}
|
||||
}
|
||||
|
||||
// if we couldn't find a suitable target for 2nd row of catapults,
|
||||
// select a random target instead
|
||||
@@ -2338,46 +2379,21 @@ class Automation {
|
||||
}
|
||||
}
|
||||
|
||||
// 1st row of catapults set to target randomly
|
||||
if ($catapults1TargetRandom)
|
||||
{
|
||||
$list=array();
|
||||
$j = 1;
|
||||
for ($i=1;$i<=41;$i++)
|
||||
{
|
||||
if ($i==41) $i=99;
|
||||
if ($bdo['f'.$i] > 0 && $catapultTarget != 31 && $catapultTarget != 32 && $catapultTarget != 33)
|
||||
{
|
||||
$list[$j]=$i;
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
$catapultTarget = $list[ rand(1, $j - 1) ];
|
||||
}
|
||||
|
||||
// 2nd row of catapults set to target randomly
|
||||
if ($catapults2TargetRandom && !$catapults2WillNotShoot)
|
||||
{
|
||||
$list=array();
|
||||
$j=1;
|
||||
for ($i=1;$i<=41;$i++)
|
||||
{
|
||||
if ($i==41) $i=99;
|
||||
if ($bdo['f'.$i] > 0)
|
||||
{
|
||||
$j++;
|
||||
$list[$j]=$i;
|
||||
$list[]=$i;
|
||||
}
|
||||
}
|
||||
$catapultTarget2 = $list[ rand(1, $j - 1) ];
|
||||
$catapultTarget2 = $list[ rand(0, count($list) - 1) ];
|
||||
}
|
||||
|
||||
/**
|
||||
* resolve 1st row of catapults
|
||||
*/
|
||||
$village_destroyed = 0;
|
||||
$this->resolveCatapultsDestruction($bdo, $battlepart, $info_cat, $data, $catapultTarget, !$catapults2WillNotShoot, false, $catp_pic, $can_destroy, $isoasis, $village_destroyed);
|
||||
|
||||
/**
|
||||
* resolve 2nd row of catapults
|
||||
*/
|
||||
|
||||
@@ -5535,7 +5535,7 @@ References: User ID/Message ID, Mode
|
||||
$t11 = [$t11];
|
||||
$type = [$type];
|
||||
$ctar1 = [$ctar1];
|
||||
$ctar2 = [$ctar1];
|
||||
$ctar2 = [$ctar2];
|
||||
$spy = [$spy];
|
||||
$b1 = [$b1];
|
||||
$b2 = [$b2];
|
||||
|
||||
@@ -180,7 +180,7 @@ class Session {
|
||||
|
||||
if($user && ($admin || isset($_SESSION['sessid']))) {
|
||||
// check if this is not a support user, for who only messages and statistics are available
|
||||
if ($user == 1) {
|
||||
if ($user == 'Support') {
|
||||
$req_file = basename($_SERVER['PHP_SELF']);
|
||||
if (!in_array($req_file, ['nachrichten.php', 'logout.php', 'statistiken.php', 'rules.php', 'karte.php', 'karte2.php', 'spieler.php'])) {
|
||||
header('Location:nachrichten.php');
|
||||
@@ -269,7 +269,9 @@ class Session {
|
||||
if($this->userarray['b4'] > $this->time) {
|
||||
$this->bonus4 = 1;
|
||||
}
|
||||
$this->CheckHeroReal();
|
||||
if (!in_array($this->username, ['Support', 'Multihunter'])) {
|
||||
$this->CheckHeroReal();
|
||||
}
|
||||
}
|
||||
|
||||
private function SurfControl(){
|
||||
|
||||
+63
-41
@@ -8,7 +8,8 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
$hero_info = $units->Hero($session->uid, 0, true);
|
||||
$hero_info = $units->Hero($session->uid);
|
||||
$heroes = $units->Hero($session->uid, 1);
|
||||
$define['reset_level'] = 3; // Until which level you are able to reset your points
|
||||
|
||||
?>
|
||||
@@ -22,47 +23,70 @@
|
||||
<p class="build_desc"><?php echo HEROSMANSION_DESC; ?></p>
|
||||
|
||||
|
||||
<?php
|
||||
if($hero_info['unit'] == 1) {
|
||||
$name = U1;
|
||||
} else if($hero_info['unit'] == 2) {
|
||||
$name = U2;
|
||||
} else if($hero_info['unit'] == 3) {
|
||||
$name = U3;
|
||||
} else if($hero_info['unit'] == 5) {
|
||||
$name = U5;
|
||||
} else if($hero_info['unit'] == 6) {
|
||||
$name = U6;
|
||||
} else if($hero_info['unit'] == 11) {
|
||||
$name = U11;
|
||||
} else if($hero_info['unit'] == 12) {
|
||||
$name = U12;
|
||||
} else if($hero_info['unit'] == 13) {
|
||||
$name = U13;
|
||||
} else if($hero_info['unit'] == 15) {
|
||||
$name = U15;
|
||||
} else if($hero_info['unit'] == 16) {
|
||||
$name = U16;
|
||||
} else if($hero_info['unit'] == 21) {
|
||||
$name = U21;
|
||||
} else if($hero_info['unit'] == 22) {
|
||||
$name = U22;
|
||||
} else if($hero_info['unit'] == 24) {
|
||||
$name = U24;
|
||||
} else if($hero_info['unit'] == 25) {
|
||||
$name = U25;
|
||||
} else if($hero_info['unit'] == 26) {
|
||||
$name = U26;
|
||||
<?php
|
||||
if ($hero_info) {
|
||||
if ( $hero_info['unit'] == 1 ) {
|
||||
$name = U1;
|
||||
} else if ( $hero_info['unit'] == 2 ) {
|
||||
$name = U2;
|
||||
} else if ( $hero_info['unit'] == 3 ) {
|
||||
$name = U3;
|
||||
} else if ( $hero_info['unit'] == 5 ) {
|
||||
$name = U5;
|
||||
} else if ( $hero_info['unit'] == 6 ) {
|
||||
$name = U6;
|
||||
} else if ( $hero_info['unit'] == 11 ) {
|
||||
$name = U11;
|
||||
} else if ( $hero_info['unit'] == 12 ) {
|
||||
$name = U12;
|
||||
} else if ( $hero_info['unit'] == 13 ) {
|
||||
$name = U13;
|
||||
} else if ( $hero_info['unit'] == 15 ) {
|
||||
$name = U15;
|
||||
} else if ( $hero_info['unit'] == 16 ) {
|
||||
$name = U16;
|
||||
} else if ( $hero_info['unit'] == 21 ) {
|
||||
$name = U21;
|
||||
} else if ( $hero_info['unit'] == 22 ) {
|
||||
$name = U22;
|
||||
} else if ( $hero_info['unit'] == 24 ) {
|
||||
$name = U24;
|
||||
} else if ( $hero_info['unit'] == 25 ) {
|
||||
$name = U25;
|
||||
} else if ( $hero_info['unit'] == 26 ) {
|
||||
$name = U26;
|
||||
}
|
||||
$name1 = $hero_info['name'];
|
||||
} else {
|
||||
$name = 'Mr. Nobody';
|
||||
$name1 = 'unknown';
|
||||
}
|
||||
$name1 = $hero_info['name'];
|
||||
|
||||
if(isset($_GET['land'])) {
|
||||
include("37_land.tpl");
|
||||
include_once("37_land.tpl");
|
||||
} else {
|
||||
if($hero_info === false){
|
||||
include("37_train.tpl");
|
||||
}elseif($hero_info['intraining'] == 1){
|
||||
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
||||
$include_training = true;
|
||||
$include_revive = false;
|
||||
foreach ($heroes as $hdata) {
|
||||
if ($hdata['dead'] == 1) {
|
||||
$include_revive = true;
|
||||
}
|
||||
|
||||
if ($hdata['inrevive'] == 1) {
|
||||
$name1 = $hdata['name'];
|
||||
$include_training = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($hero_info === false && $include_revive){
|
||||
include_once("37_revive.tpl");
|
||||
}
|
||||
|
||||
if ($hero_info === false && $include_training) {
|
||||
include_once("37_train.tpl");
|
||||
} else if($hero_info['intraining'] == 1) {
|
||||
|
||||
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
||||
?>
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -85,9 +109,7 @@
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
if($hero_info !== false AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
|
||||
include("37_revive.tpl");
|
||||
}
|
||||
|
||||
if($hero_info !== false AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
|
||||
include("37_hero.tpl");
|
||||
}
|
||||
|
||||
+17
-18
@@ -16,8 +16,7 @@ if (isset($_POST['name'])) {
|
||||
$_POST['name'] = stripslashes($_POST['name']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($database->escape($_POST['name']))."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
|
||||
echo "".NAME_CHANGED."";
|
||||
}
|
||||
$hero_info = $units->Hero($session->uid);
|
||||
}
|
||||
?>
|
||||
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
@@ -172,12 +171,12 @@ if (isset($_POST['name'])) {
|
||||
if($_GET['add'] == "reset") {
|
||||
if($hero_info['level'] <= 3){
|
||||
if($hero_info['attack'] != 0 OR $hero_info['defence'] != 0 OR $hero_info['attackbonus'] != 0 OR $hero_info['defencebonus'] != 0 OR $hero_info['regeneration'] != 0){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
@@ -185,40 +184,40 @@ if (isset($_POST['name'])) {
|
||||
}
|
||||
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
| Dzoki < dzoki.travian@gmail.com > |
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
$heroes = $units->Hero($session->uid, 1);
|
||||
|
||||
// check if there is a hero in revive already
|
||||
$reviving = false;
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
//check if there is unit needed in the village
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
|
||||
$units = mysqli_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
|
||||
$units_array = mysqli_fetch_array($result);
|
||||
|
||||
$count_hero = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = " . $database->escape($session->uid) . ""), MYSQLI_ASSOC);
|
||||
$count_hero = $count_hero['Total'];
|
||||
@@ -75,7 +75,7 @@ if($session->tribe == 1) {
|
||||
|
||||
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)
|
||||
elseif( $units_array['u1'] == 0)
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
else $output.="<a href=\"build.php?id=".$id."&train=1\">".TRAIN."</a>";
|
||||
|
||||
@@ -112,7 +112,7 @@ if($session->tribe == 1) {
|
||||
|
||||
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)
|
||||
elseif( $units_array['u2'] == 0)
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
else
|
||||
$output.="<a href=\"build.php?id=".$id."&train=2\">".TRAIN."</a>";
|
||||
@@ -150,7 +150,7 @@ if($session->tribe == 1) {
|
||||
|
||||
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){
|
||||
}else if( $units_array['u3'] == 0){
|
||||
$output.="<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.="<a href=\"build.php?id=".$id."&train=3\">".TRAIN."</a>";
|
||||
@@ -187,7 +187,7 @@ if($session->tribe == 1) {
|
||||
|
||||
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){
|
||||
}else if( $units_array['u5'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=5\">".TRAIN."</a>";
|
||||
@@ -224,7 +224,7 @@ if($session->tribe == 1) {
|
||||
|
||||
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){
|
||||
}else if( $units_array['u6'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=6\">".TRAIN."</a>";
|
||||
@@ -264,7 +264,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u11'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=11\">".TRAIN."</a>";
|
||||
@@ -301,7 +301,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u12'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=12\">".TRAIN."</a>";
|
||||
@@ -340,7 +340,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u13'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=13\">".TRAIN."</a>";
|
||||
@@ -377,7 +377,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u15'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=15\">".TRAIN."</a>";
|
||||
@@ -415,7 +415,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u16'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=16\">".TRAIN."</a>";
|
||||
@@ -455,7 +455,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u21'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=21\">".TRAIN."</a>";
|
||||
@@ -492,7 +492,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u22'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=22\">".TRAIN."</a>";
|
||||
@@ -530,7 +530,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u24'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=24\">".TRAIN."</a>";
|
||||
@@ -567,7 +567,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u25'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=25\">".TRAIN."</a>";
|
||||
@@ -605,7 +605,7 @@ $output.="<tr>
|
||||
|
||||
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){
|
||||
}else if( $units_array['u26'] == 0){
|
||||
$output.= "<span class=\"none\">".NOT_UNITS."</span>";
|
||||
}else {
|
||||
$output.= "<a href=\"build.php?id=".$id."&train=26\">".TRAIN."</a>";
|
||||
|
||||
+5
-5
@@ -1605,11 +1605,11 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` (
|
||||
-- Dumping data for table `%prefix%users`
|
||||
--
|
||||
|
||||
INSERT INTO `%PREFIX%users` (`id`, `username`, `password`, `email`, `tribe`, `access`, `gold`, `gender`, `birthday`, `location`, `desc1`, `desc2`, `plus`, `b1`, `b2`, `b3`, `b4`, `sit1`, `sit2`, `alliance`, `sessid`, `act`, `timestamp`, `ap`, `apall`, `dp`, `dpall`, `protect`, `quest`, `gpack`, `cp`, `lastupdate`, `RR`, `Rc`, `ok`) VALUES
|
||||
(5, 'Multihunter', '', 'multihunter@travianz.game', 0, 9, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(1, 'Support', '', 'support@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(2, 'Nature', '', 'nature@travianz.game', 4, 2, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(4, 'Taskmaster', '', 'taskmaster@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0);
|
||||
INSERT INTO `%PREFIX%users` (`id`, `username`, `password`, `email`, `tribe`, `access`, `gold`, `gender`, `birthday`, `location`, `desc1`, `desc2`, `plus`, `b1`, `b2`, `b3`, `b4`, `sit1`, `sit2`, `alliance`, `sessid`, `act`, `timestamp`, `ap`, `apall`, `dp`, `dpall`, `protect`, `quest`, `gpack`, `cp`, `lastupdate`, `RR`, `Rc`, `ok`, `is_bcrypt`) VALUES
|
||||
(5, 'Multihunter', '', 'multihunter@travianz.game', 0, 9, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1),
|
||||
(1, 'Support', '', 'support@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1),
|
||||
(2, 'Nature', '', 'nature@travianz.game', 4, 2, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1),
|
||||
(4, 'Taskmaster', '', 'taskmaster@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0, 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user