fix hero training time

This commit is contained in:
unknown
2012-04-01 01:18:57 +03:00
parent 10f0256506
commit 92fb8468c4
4 changed files with 58 additions and 91 deletions
+56 -12
View File
@@ -25,25 +25,68 @@
<?php
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";
}
$name1 = $hero_info['name'];
if($hero_info['trainingtime'] > time()) {
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
?>
<table id="distribution" cellpadding="1" cellspacing="1">
<thead>
<tr>
<?php echo "<tr class='next'><th>Hero will be ready in <span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
</tr>
</thead>
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."");
}
}
}
<tr>
<?php
echo "<tr>
<td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u1\" src=\"img/x.gif\" alt=\"Legionnaire\" title=\"Legionnaire\" />
Legionnaire ($name1)
</div>"
?>
</tr>
</table>
<?php }else{
if(isset($_GET['land'])) {
include("37_land.tpl");
} else {
if(mysql_num_rows($hero) == 0){
include("37_train.tpl");
}
if(mysql_num_rows($hero) != 0 AND $hero_info['trainingtime'] > 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"); ?>
</div>