Artifacts fixes part 2

+Artifacts are now activated after a certain amount of time (based on
the official Travian Rules and the server speed) and not immediately
after the conquer
+Artifacts are now activated based on official Travian Rules, you can
only have 1 unique/account active artifacts

Changes in 27_show.tpl:
+Added the text "Can't be activated" to not-activable artifacts

Changes in Automation.php:
+Added a new method which activate activable artifacts

Changes in Database.php:
+Added some methods to support the new artifacts activation system
This commit is contained in:
iopietro
2018-04-25 15:13:24 +02:00
parent 26cb03cdb6
commit 0011d2abcb
4 changed files with 162 additions and 15 deletions
+3 -3
View File
@@ -93,15 +93,15 @@ class funct {
header("Location: admin.php?p=player&uid=".$get['uid'].$error);
exit;
case "reviveHero":
$livingHeroesCount = mysqli_fetch_array($database->query("SELECT Count(*) as Total FROM ".TB_PREFIX."hero WHERE uid=".(int) $get['uid']." AND (dead = 0 OR inrevive = 1)"), MYSQLI_ASSOC);
$livingHeroesCount = mysqli_fetch_array($database->query("SELECT Count(*) as Total FROM ".TB_PREFIX."hero WHERE uid=".(int) $get['uid']." AND (dead = 0 OR inrevive = 1 OR intraining = 1)"), MYSQLI_ASSOC);
if ($livingHeroesCount['Total'] > 0) {
header("Location: admin.php?p=player&uid=".$get['uid']."&re=1");
exit;
}
$result=$database->query("SELECT * FROM ".TB_PREFIX."hero WHERE heroid = ".(int) $get['hid']." AND uid=".(int) $get['uid']);
$hdata=mysqli_fetch_array($result);
$result = $database->query("SELECT * FROM ".TB_PREFIX."hero WHERE heroid = ".(int) $get['hid']." AND uid=".(int) $get['uid']);
$hdata = mysqli_fetch_array($result);
$database->query("UPDATE ".TB_PREFIX."units SET hero = 1 WHERE vref = ".(int) $hdata['wref']);
$database->query("UPDATE ".TB_PREFIX."hero SET `dead` = '0', `inrevive` = '0', `health` = '100', `lastupdate` = ".time()." WHERE `heroid` = ".(int) $get['hid']." AND `uid` = ".(int) $get['uid']);
header("Location: admin.php?p=player&uid=".$get['uid']."&rc=1");