diff --git a/Templates/Build/37.tpl b/Templates/Build/37.tpl index 16d1139b..d26690ef 100644 --- a/Templates/Build/37.tpl +++ b/Templates/Build/37.tpl @@ -25,25 +25,68 @@ time()) { + $timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time()); + +?> + + + + "; ?> + + - if($hero_info['trainingtime'] <= time()) { - if($hero_info['trainingtime'] != 0) { - if($hero_info['dead'] == 0) { - mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE uid = " . $session->uid . ""); - mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid.""); - } - } - } - + + + +
Hero will be ready in " . $timeleft . "
+
+ \"Legionnaire\" + Legionnaire ($name1) +
" + ?> + +
+ time()){ - include("37_train2.tpl"); - } if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 1){ include("37_revive.tpl"); } @@ -51,6 +94,7 @@ include("37_hero.tpl"); } } + } include ("upgrade.tpl"); ?> diff --git a/Templates/Build/37_revive.tpl b/Templates/Build/37_revive.tpl index ce227193..03b56eba 100644 --- a/Templates/Build/37_revive.tpl +++ b/Templates/Build/37_revive.tpl @@ -132,13 +132,6 @@ header("Location: build.php?id=".$id.""); } - if($hero_info['trainingtime'] <= time()) { - if($hero_info['trainingtime'] != 0) { - if($hero_info['dead'] == 0) { - mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE uid = " . $session->uid . ""); - mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid.""); - } - } - } + include ("37_train.tpl"); ?> \ No newline at end of file diff --git a/Templates/Build/37_train2.tpl b/Templates/Build/37_train2.tpl deleted file mode 100644 index 28dfefd3..00000000 --- a/Templates/Build/37_train2.tpl +++ /dev/null @@ -1,70 +0,0 @@ - | -| Dzoki < dzoki.travian@gmail.com > | -| Copyright: TravianX Project All rights reserved | -\*-------------------------------------------------------*/ - - if($hero_info['unit'] == 1) { - $name = "Legionnaire"; - } else if($hero_info['unit'] == 2) { - $name = "Praetorian"; - } else if($hero_info['unit'] == 3) { - $name = "Imperian"; - } else if($hero_info['unit'] == 5) { - $name = "Equites Imperatoris"; - } else if($hero_info['unit'] == 6) { - $name = "Equites Caesaris"; - } else if($hero_info['unit'] == 11) { - $name = "Clubswinger"; - } else if($hero_info['unit'] == 12) { - $name = "Spearman"; - } else if($hero_info['unit'] == 13) { - $name = "Axeman"; - } else if($hero_info['unit'] == 15) { - $name = "Paladin"; - } else if($hero_info['unit'] == 16) { - $name = "Teutonic Knight"; - } else if($hero_info['unit'] == 21) { - $name = "Phalanx"; - } else if($hero_info['unit'] == 22) { - $name = "Swordsman"; - } else if($hero_info['unit'] == 24) { - $name = "Theutates Thunder"; - } else if($hero_info['unit'] == 25) { - $name = "Druidrider"; - } else if($hero_info['unit'] == 26) { - $name = "Haeduan"; - } - - if($hero_info['trainingtime'] <= time()) { - if($hero_info['trainingtime'] != 0) { - if($hero_info['dead'] == 0) { - mysql_query("UPDATE " . TB_PREFIX . "hero SET trainingtime = '0', dead = '0' WHERE uid = " . $session->uid . ""); - mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$village->wid.""); - } - } - } - - - if($hero_info['trainingtime'] > time()) { - $timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time()); - -?> - - - - "; ?> - - - - - - -
Hero will be ready in " . $timeleft . "
" . $hero_info['name'] . ") "; ?>
- - - \ No newline at end of file diff --git a/install/data/sql.sql b/install/data/sql.sql index 684fb935..f6698b0e 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -783,7 +783,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%hero` ( `defencebonus` tinyint(1) unsigned NOT NULL, `regeneration` tinyint(1) unsigned NOT NULL, `autoregen` int(2) NOT NULL, - `trainingtime` mediumint(3) unsigned NOT NULL, + `trainingtime` int(11) unsigned NOT NULL, PRIMARY KEY (`heroid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;