mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-03 11:04:24 +00:00
General fixes
+Fixed a bug that didn't delete artifacts when a player deleted his account +Added "(artifact)" if a village has an artifact in the village overview +Added the artifact section in the multihunter panel (return to natars doesn't work yet) NOTE: To play this version of the game, you have to run this query first (where "s1_" is the prefix of your server): ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER `lastupdate`; ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX `active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
include_once("../GameEngine/Artifacts.php");
|
||||
|
||||
$artifact = reset($database->getOwnArtefactInfo($_GET['did']));
|
||||
$artifactOfTheFool = !empty($artifact) && $artifact['type'] == 8;
|
||||
$artifactInfo = Artifacts::getArtifactInfo($artifact);
|
||||
?>
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="8">Artifact</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ra"></td>
|
||||
<td class="ra"></td>
|
||||
<td colspan="1">Name</td>
|
||||
<td colspan="1">Bonus</td>
|
||||
<td colspan="1">Area of effect</td>
|
||||
<td colspan="1">Time of conquer</td>
|
||||
<td colspan="1">Time of activation</td>
|
||||
<?php if($artifactOfTheFool){?>
|
||||
<td colspan="1">Next activation</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(empty($artifact)){
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="8"><div style="text-align: center"><?php echo NO_ARTIFACTS; ?></div></td>
|
||||
</tr>
|
||||
<?php }else{ ?>
|
||||
<tr>
|
||||
<td><a href="?action=delArtifact&artid=<?php echo $artifact['id']; ?>" onClick="return del('arti', <?php echo $artifact['id']; ?>)"><img src="../img/admin/del.gif"></a></td>
|
||||
<td class="icon"><img class="artefact_icon_<?php echo $artifact['type']; ?>" src="../img/x.gif"></td>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo $artifact['name']; ?></div></td>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['bonus']; ?></div></td>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['effectInfluence']; ?></div></td>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo date("d.m.Y H:i:s", $artifact['conquered']); ?></div></td>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['active']; ?></div></td>
|
||||
<?php if($artifactOfTheFool){?>
|
||||
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['nextEffect']; ?></div></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
if($village['owner'] != 3) echo '<a href="admin.php?p=returnArtifact&artid='.$artifact['id'].'">Return to Natars</a>';
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
<?php
|
||||
if($_SESSION['access'] < MULTIHUNTER) die("Access Denied: You are not Admin!");
|
||||
?>
|
||||
<table id="member">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -15,50 +12,34 @@ if($_SESSION['access'] < MULTIHUNTER) die("Access Denied: You are not Admin!");
|
||||
<tr>
|
||||
<?php
|
||||
$tribe = $user['tribe'];
|
||||
if($tribe ==1){ $img = ""; }
|
||||
if($tribe ==2){ $img = "1";}
|
||||
if($tribe ==3){ $img = "2";}
|
||||
if($tribe ==4){ $img = "3";}
|
||||
if($tribe ==5){ $img = "4";}
|
||||
if($tribe ==6){ $img = "5";}
|
||||
$img = $tribe == 1 ? "" : $tribe - 1;
|
||||
|
||||
for($i=1; $i<9; $i++)
|
||||
{
|
||||
echo '<td><center><img src="../img/un/u/'.$img.''.$i.'.gif"></center></td>';
|
||||
}
|
||||
for($i=1; $i<9; $i++)
|
||||
{
|
||||
echo '<td><center><img src="../img/un/u/'.$img.''.$i.'.gif"></center></td>';
|
||||
}
|
||||
for($i = 1; $i < 9; $i++) echo '<td><center><img src="../img/un/u/'.$img.''.$i.'.gif"></center></td>';
|
||||
for($i = 1; $i < 9; $i++) echo '<td><center><img src="../img/un/u/'.$img.''.$i.'.gif"></center></td>';
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php
|
||||
##A
|
||||
for($i=1; $i<9; $i++)
|
||||
{
|
||||
//Armoury
|
||||
for($i = 1; $i < 9; $i++){
|
||||
if($tribe==5) { $abtech['a'.$i]="<font color=\"grey\">?</font>"; $abtech['b'.$i]="<font color=\"grey\">?</font>";}
|
||||
echo '<td><center>'.$abtech['a'.$i].'</center></td>';
|
||||
} ##B
|
||||
for($i=1; $i<9; $i++)
|
||||
{
|
||||
echo '<td><center>'.$abtech['b'.$i].'</center></td>';
|
||||
}
|
||||
|
||||
//Blacksmith
|
||||
for($i = 1; $i < 9; $i++) echo '<td><center>'.$abtech['b'.$i].'</center></td>';
|
||||
?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php
|
||||
if($_SESSION['access'] == ADMIN)
|
||||
{
|
||||
if($tribe==5) { echo '<span class="none">Upgrades Troops</span>';}
|
||||
else { echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a><a href="admin.php?p=techlog&did='.$_GET['did'].'" style="float: right">Research Log</a>';}
|
||||
}
|
||||
if(isset($_GET['ab'])){
|
||||
echo '<div align="right"><font color="Red"><b>AB Tech Troops upgrades</font></b></div>';
|
||||
}
|
||||
|
||||
if($tribe == 5) echo '<span class="none">Upgrades Troops</span>';
|
||||
else echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a><a href="admin.php?p=techlog&did='.$_GET['did'].'" style="float: right">Research Log</a>';
|
||||
|
||||
if(isset($_GET['ab'])) echo '<div align="right"><font color="Red"><b>AB Tech Troops upgrades</font></b></div>';
|
||||
?>
|
||||
|
||||
|
||||
+23
-26
@@ -10,7 +10,7 @@
|
||||
## Copyright: TravianZ (c) 2010-2014. All rights reserved. ##
|
||||
## Improved: aggenkeech ##
|
||||
#################################################################################
|
||||
if($_SESSION['access'] < 8) die("Access Denied: You are not Admin!");
|
||||
include_once("../GameEngine/Generator.php");
|
||||
|
||||
$id = $_GET['did'];
|
||||
if(isset($id)){
|
||||
@@ -21,26 +21,29 @@ if(isset($id)){
|
||||
$fdata = $database->getResourceLevel($village['wref']);
|
||||
$units = $database->getUnit($village['wref']);
|
||||
$abtech = $database->getABTech($id); // Armory/blacksmith level
|
||||
if($type == 1){ $typ = array(3,3,3,9); }
|
||||
elseif($type == 2){ $typ = array(3,4,5,6); }
|
||||
elseif($type == 3){ $typ = array(4,4,4,6); }
|
||||
elseif($type == 4){ $typ = array(4,5,3,6); }
|
||||
elseif($type == 5){ $typ = array(5,3,4,6); }
|
||||
elseif($type == 6){ $typ = array(1,1,1,15); }
|
||||
elseif($type == 7){ $typ = array(4,4,3,7); }
|
||||
elseif($type == 8){ $typ = array(3,4,4,7); }
|
||||
elseif($type == 9){ $typ = array(4,3,4,7); }
|
||||
elseif($type == 10){ $typ = array(3,5,4,6); }
|
||||
elseif($type == 11){ $typ = array(4,5,3,6); }
|
||||
elseif($type == 12){ $typ = array(5,4,3,6); }
|
||||
|
||||
switch($type){
|
||||
case 1: $typ = [3, 3, 3, 9]; break;
|
||||
case 2: $typ = [3, 4, 5, 6]; break;
|
||||
case 3: $typ = [4, 4, 4, 6]; break;
|
||||
case 4: $typ = [4, 5, 3, 6]; break;
|
||||
case 5: $typ = [5, 3, 4, 6]; break;
|
||||
case 6: $typ = [1, 1, 1, 15]; break;
|
||||
case 7: $typ = [4, 4, 3, 7]; break;
|
||||
case 8: $typ = [3, 4, 4, 7]; break;
|
||||
case 9: $typ = [4, 3, 4, 7]; break;
|
||||
case 10: $typ = [3, 5, 4, 6]; break;
|
||||
case 11: $typ = [4, 5, 3, 6]; break;
|
||||
case 12: $typ = [5, 4, 3, 6]; break;
|
||||
}
|
||||
|
||||
$ocounter = [];
|
||||
$wood = $clay = $iron =$crop = 0;
|
||||
$q = "SELECT o.*, w.x, w.y FROM ".TB_PREFIX."odata AS o LEFT JOIN ".TB_PREFIX."wdata AS w ON o.wref=w.id WHERE conqured = ".(int) $village['wref'];
|
||||
$result = $database->query_return($q);
|
||||
if(!empty($result) > 0){
|
||||
if(!empty($result)){
|
||||
$newResult = [];
|
||||
foreach($result as $row)
|
||||
{
|
||||
foreach($result as $row){
|
||||
$type = $row['type'];
|
||||
if ( $type == 1 ) {
|
||||
$row['type'] = '<img src="../img/admin/r/1.gif"> + 25%';
|
||||
@@ -91,15 +94,6 @@ if(isset($id)){
|
||||
$refreshiconfrm = "../img/admin/refresh.png";
|
||||
$refreshicon = "<img src=\"".$refreshiconfrm."\">";
|
||||
|
||||
class MyGenerator
|
||||
{
|
||||
public function getMapCheck($wref)
|
||||
{
|
||||
return substr(md5($wref), 5, 2);
|
||||
}
|
||||
};
|
||||
$generator = new MyGenerator;
|
||||
|
||||
if($village && $user){
|
||||
include("search2.tpl"); ?>
|
||||
<style>
|
||||
@@ -280,7 +274,10 @@ if(isset($id)){
|
||||
include('troopUpgrades.tpl');
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
include('artifact.tpl');
|
||||
?>
|
||||
|
||||
<a href="admin.php?p=editVillage&did=<?php echo $_GET['did']; ?>" title="Edit Village">
|
||||
<div id="content" class="village1" style="min-height: 264px;">
|
||||
<div id="village_map" class="f<?php echo $database->getVillageType($village['wref']); ?>" style="float: left;">
|
||||
|
||||
+326
-224
@@ -1,236 +1,338 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## ##
|
||||
## -= YOU MUST NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 05.03.2014 ##
|
||||
## Filename: Admin/function.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## Edited by: Shadow and ronix ##
|
||||
## License: Creative Commons BY-NC-SA 3.0 ##
|
||||
## Copyright: TravianZ (c) 2014 - All rights reserved ##
|
||||
## URLs: http://travian.shadowss/ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
class funct {
|
||||
// ################################################################################
|
||||
// # ##
|
||||
// # -= YOU MUST NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
// # ##
|
||||
// # --------------------------------------------------------------------------- ##
|
||||
// # ##
|
||||
// # Project: TravianZ ##
|
||||
// # Version: 05.03.2014 ##
|
||||
// # Filename: Admin/function.php ##
|
||||
// # Developed by: Dzoki ##
|
||||
// # Edited by: Shadow and ronix ##
|
||||
// # License: Creative Commons BY-NC-SA 3.0 ##
|
||||
// # Copyright: TravianZ (c) 2014 - All rights reserved ##
|
||||
// # URLs: http://travian.shadowss/ro ##
|
||||
// # Source code: https://github.com/Shadowss/TravianZ ##
|
||||
// # ##
|
||||
// ################################################################################
|
||||
class funct
|
||||
{
|
||||
|
||||
function CheckLogin(){
|
||||
if(isset($_SESSION['access']) && $_SESSION['access'] >= MULTIHUNTER and $_SESSION['id']){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function Act($get){
|
||||
global $admin,$database;
|
||||
|
||||
switch($get['action']){
|
||||
case "recountPop":
|
||||
$admin->recountPop($get['did']);
|
||||
$admin->recountCP($get['did']);
|
||||
break;
|
||||
case "recountPopUsr":
|
||||
$admin->recountPopUser($get['uid']);
|
||||
break;
|
||||
case "StopDel":
|
||||
//stop deleting
|
||||
break;
|
||||
case "delVil":
|
||||
if($get['mode'] != 1){
|
||||
$admin->DelVillage($get['did']);
|
||||
}else{
|
||||
$admin->DelVillage($get['did'], 1);
|
||||
}
|
||||
break;
|
||||
case "delBan":
|
||||
$admin->DelBan($get['uid'],$get['id']);
|
||||
//remove ban
|
||||
break;
|
||||
case "addBan":
|
||||
if($get['time']){$end = time()+$get['time']; }else{$end = '';}
|
||||
|
||||
if(is_numeric($get['uid'])){
|
||||
$get['uid'] = $get['uid'];
|
||||
}else{
|
||||
$get['uid'] = $database->getUserField(addslashes($get['uid']),'id',1);
|
||||
}
|
||||
|
||||
$admin->AddBan($get['uid'],$end,$get['reason']);
|
||||
//add ban
|
||||
break;
|
||||
case "delOas":
|
||||
$database->query('UPDATE '.TB_PREFIX.'odata SET conqured = 0, owner = 2, name = "Unoccupied Oasis" WHERE wref = '.$get['oid']);
|
||||
//oaza
|
||||
break;
|
||||
case "logout":
|
||||
$this->LogOut();
|
||||
break;
|
||||
case "killHero":
|
||||
$varray = $database->getProfileVillages($get['uid']);
|
||||
$killhero=false;
|
||||
$error="";
|
||||
for ($i = 0; $i <= count($varray)-1; $i++) {
|
||||
$killhero=$database->FindHeroInVil($varray[$i]['wref']);
|
||||
if ($killhero) break;
|
||||
$killhero=$database->FindHeroInDef($varray[$i]['wref']);
|
||||
if ($killhero) break;
|
||||
$killhero=$database->FindHeroInMovement($varray[$i]['wref']);
|
||||
if ($killhero) break;
|
||||
}
|
||||
if (!$killhero){
|
||||
$killhero=$database->FindHeroInOasis($get['uid']);
|
||||
}
|
||||
|
||||
$database->KillMyHero($get['uid']);
|
||||
$error="&kc=1";
|
||||
|
||||
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 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);
|
||||
$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");
|
||||
exit;
|
||||
case "addHero":
|
||||
$user = $database->getUserArray($get['uid'],1);
|
||||
$vilarray=$database->getVrefCapital($get['uid']);
|
||||
if (!$vilarray) {
|
||||
return;
|
||||
}
|
||||
|
||||
$database->query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`,
|
||||
`experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`,
|
||||
`intraining`) VALUES (".(int) $get['uid'].", " . (int) $vilarray['wref'] . ", '0', ".(int) $get['u'].", '".addslashes($user['username'])."',
|
||||
'0', '5', '0', '0', '100', '0', '0', '0', '0', '".time()."', '50', '0')");
|
||||
|
||||
$database->query("UPDATE ".TB_PREFIX."units SET hero = 1 WHERE vref = ".(int) $vilarray['wref']);
|
||||
|
||||
header("Location: admin.php?p=player&uid=".$get['uid']."&ac=1");
|
||||
exit;
|
||||
}
|
||||
if($get['action'] == 'logout'){
|
||||
header("Location: admin.php");
|
||||
}else{
|
||||
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||
function CheckLogin()
|
||||
{
|
||||
return isset($_SESSION['access']) && $_SESSION['access'] >= MULTIHUNTER && $_SESSION['id'];
|
||||
}
|
||||
}
|
||||
|
||||
function Act2($post){
|
||||
global $admin,$database;
|
||||
switch($post['action']){
|
||||
case "DelPlayer":
|
||||
if ($admin->DelPlayer($post['uid'],$post['pass'])) {
|
||||
header("Location: ?p=search&msg=ursdel");
|
||||
} else {
|
||||
die('Invalid Admin password, cannot delete player. Please go back and retry.');
|
||||
}
|
||||
break;
|
||||
case "punish":
|
||||
$admin->Punish($post);
|
||||
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||
break;
|
||||
case "addVillage":
|
||||
$admin->AddVillage($post);
|
||||
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
function Act($get)
|
||||
{
|
||||
global $admin, $database;
|
||||
|
||||
switch ($get['action']) {
|
||||
case "recountPop":
|
||||
$admin->recountPop($get['did']);
|
||||
$admin->recountCP($get['did']);
|
||||
break;
|
||||
case "recountPopUsr":
|
||||
$admin->recountPopUser($get['uid']);
|
||||
break;
|
||||
case "StopDel":
|
||||
// stop deleting
|
||||
break;
|
||||
case "delVil":
|
||||
if ($get['mode'] != 1) {
|
||||
$admin->DelVillage($get['did']);
|
||||
} else {
|
||||
$admin->DelVillage($get['did'], 1);
|
||||
}
|
||||
break;
|
||||
case "delBan":
|
||||
$admin->DelBan($get['uid'], $get['id']);
|
||||
// remove ban
|
||||
break;
|
||||
case "addBan":
|
||||
if ($get['time']) {
|
||||
$end = time() + $get['time'];
|
||||
} else {
|
||||
$end = '';
|
||||
}
|
||||
|
||||
if (is_numeric($get['uid'])) {
|
||||
$get['uid'] = $get['uid'];
|
||||
} else {
|
||||
$get['uid'] = $database->getUserField(addslashes($get['uid']), 'id', 1);
|
||||
}
|
||||
|
||||
$admin->AddBan($get['uid'], $end, $get['reason']);
|
||||
// add ban
|
||||
break;
|
||||
case "delOas":
|
||||
$database->query('UPDATE ' . TB_PREFIX . 'odata SET conqured = 0, owner = 2, name = "Unoccupied Oasis" WHERE wref = ' . $get['oid']);
|
||||
// oaza
|
||||
break;
|
||||
case "logout":
|
||||
$this->LogOut();
|
||||
break;
|
||||
case "delArtifact":
|
||||
if(isset($_GET['artid']) && is_numeric($_GET['artid'])) $database->deleteArtifact($_GET['artid']);
|
||||
break;
|
||||
case "returnArtifact":
|
||||
|
||||
break;
|
||||
case "killHero":
|
||||
$varray = $database->getProfileVillages($get['uid']);
|
||||
$killhero = false;
|
||||
$error = "";
|
||||
for ($i = 0; $i <= count($varray) - 1; $i ++) {
|
||||
$killhero = $database->FindHeroInVil($varray[$i]['wref']);
|
||||
if ($killhero)
|
||||
break;
|
||||
$killhero = $database->FindHeroInDef($varray[$i]['wref']);
|
||||
if ($killhero)
|
||||
break;
|
||||
$killhero = $database->FindHeroInMovement($varray[$i]['wref']);
|
||||
if ($killhero)
|
||||
break;
|
||||
}
|
||||
if (! $killhero) {
|
||||
$killhero = $database->FindHeroInOasis($get['uid']);
|
||||
}
|
||||
|
||||
$database->KillMyHero($get['uid']);
|
||||
$error = "&kc=1";
|
||||
|
||||
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 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);
|
||||
$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");
|
||||
exit();
|
||||
case "addHero":
|
||||
$user = $database->getUserArray($get['uid'], 1);
|
||||
$vilarray = $database->getVrefCapital($get['uid']);
|
||||
if (! $vilarray) {
|
||||
return;
|
||||
}
|
||||
|
||||
$database->query("INSERT INTO " . TB_PREFIX . "hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`,
|
||||
`experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`,
|
||||
`intraining`) VALUES (" . (int) $get['uid'] . ", " . (int) $vilarray['wref'] . ", '0', " . (int) $get['u'] . ", '" . addslashes($user['username']) . "',
|
||||
'0', '5', '0', '0', '100', '0', '0', '0', '0', '" . time() . "', '50', '0')");
|
||||
|
||||
$database->query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = " . (int) $vilarray['wref']);
|
||||
|
||||
header("Location: admin.php?p=player&uid=" . $get['uid'] . "&ac=1");
|
||||
exit();
|
||||
}
|
||||
if ($get['action'] == 'logout') {
|
||||
header("Location: admin.php");
|
||||
} else {
|
||||
header("Location: " . $_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
}
|
||||
|
||||
function LogIN($username,$password){
|
||||
global $admin,$database;
|
||||
if($admin->Login($username,$password)){
|
||||
$_SESSION['admin_username'] = $username;
|
||||
$_SESSION['access'] = $database->getUserField($username,'access',1);
|
||||
$_SESSION['id'] = $database->getUserField($username,'id',1);
|
||||
header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||
//header("Location: admin.php");
|
||||
}else{
|
||||
echo "Error";
|
||||
}
|
||||
}
|
||||
function Act2($post)
|
||||
{
|
||||
global $admin, $database;
|
||||
switch ($post['action']) {
|
||||
case "DelPlayer":
|
||||
if ($admin->DelPlayer($post['uid'], $post['pass'])) {
|
||||
header("Location: ?p=search&msg=ursdel");
|
||||
} else {
|
||||
die('Invalid Admin password, cannot delete player. Please go back and retry.');
|
||||
}
|
||||
break;
|
||||
case "punish":
|
||||
$admin->Punish($post);
|
||||
header("Location: " . $_SERVER['HTTP_REFERER']);
|
||||
break;
|
||||
case "addVillage":
|
||||
$admin->AddVillage($post);
|
||||
header("Location: " . $_SERVER['HTTP_REFERER']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function LogOut(){
|
||||
$_SESSION['access'] = '';
|
||||
$_SESSION['id'] = '';
|
||||
}
|
||||
function LogIN($username, $password)
|
||||
{
|
||||
global $admin, $database;
|
||||
if ($admin->Login($username, $password)) {
|
||||
$_SESSION['admin_username'] = $username;
|
||||
$_SESSION['access'] = $database->getUserField($username, 'access', 1);
|
||||
$_SESSION['id'] = $database->getUserField($username, 'id', 1);
|
||||
header("Location: " . $_SERVER['HTTP_REFERER']);
|
||||
// header("Location: admin.php");
|
||||
} else {
|
||||
echo "Error";
|
||||
}
|
||||
}
|
||||
|
||||
public function procResType($ref) {
|
||||
global $session;
|
||||
switch($ref) {
|
||||
case 1: $build = "Woodcutter"; break;
|
||||
case 2: $build = "Clay Pit"; break;
|
||||
case 3: $build = "Iron Mine"; break;
|
||||
case 4: $build = "Cropland"; break;
|
||||
case 5: $build = "Sawmill"; break;
|
||||
case 6: $build = "Brickyard"; break;
|
||||
case 7: $build = "Iron Foundry"; break;
|
||||
case 8: $build = "Grain Mill"; break;
|
||||
case 9: $build = "Bakery"; break;
|
||||
case 10: $build = "Warehouse"; break;
|
||||
case 11: $build = "Granary"; break;
|
||||
case 12: $build = "Blacksmith"; break;
|
||||
case 13: $build = "Armoury"; break;
|
||||
case 14: $build = "Tournament Square"; break;
|
||||
case 15: $build = "Main Building"; break;
|
||||
case 16: $build = "Rally Point"; break;
|
||||
case 17: $build = "Marketplace"; break;
|
||||
case 18: $build = "Embassy"; break;
|
||||
case 19: $build = "Barracks"; break;
|
||||
case 20: $build = "Stable"; break;
|
||||
case 21: $build = "Workshop"; break;
|
||||
case 22: $build = "Academy"; break;
|
||||
case 23: $build = "Cranny"; break;
|
||||
case 24: $build = "Town Hall"; break;
|
||||
case 25: $build = "Residence"; break;
|
||||
case 26: $build = "Palace"; break;
|
||||
case 27: $build = "Treasury"; break;
|
||||
case 28: $build = "Trade Office"; break;
|
||||
case 29: $build = "Great Barracks"; break;
|
||||
case 30: $build = "Great Stable"; break;
|
||||
case 31: $build = "City Wall"; break;
|
||||
case 32: $build = "Earth Wall"; break;
|
||||
case 33: $build = "Palisade"; break;
|
||||
case 34: $build = "Stonemason's Lodge"; break;
|
||||
case 35: $build = "Brewery"; break;
|
||||
case 36: $build = "Trapper"; break;
|
||||
case 37: $build = "Hero's Mansion"; break;
|
||||
case 38: $build = "Great Warehouse"; break;
|
||||
case 39: $build = "Great Granary"; break;
|
||||
case 40: $build = "Wonder of the World"; break;
|
||||
case 41: $build = "Horse Drinking Trough"; break;
|
||||
case 42: $build = "Great Workshop"; break;
|
||||
default: $build = "Error"; break;
|
||||
}
|
||||
return $build;
|
||||
}
|
||||
function LogOut()
|
||||
{
|
||||
$_SESSION['access'] = '';
|
||||
$_SESSION['id'] = '';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$funct = new funct;
|
||||
if($funct->CheckLogin()){
|
||||
if(isset($_GET['action']) && $_GET['action']){
|
||||
$funct->Act($_GET);
|
||||
}
|
||||
if(isset($_POST['action']) && $_POST['action']){
|
||||
$funct->Act2($_POST);
|
||||
}
|
||||
public function procResType($ref)
|
||||
{
|
||||
global $session;
|
||||
switch ($ref) {
|
||||
case 1:
|
||||
$build = "Woodcutter";
|
||||
break;
|
||||
case 2:
|
||||
$build = "Clay Pit";
|
||||
break;
|
||||
case 3:
|
||||
$build = "Iron Mine";
|
||||
break;
|
||||
case 4:
|
||||
$build = "Cropland";
|
||||
break;
|
||||
case 5:
|
||||
$build = "Sawmill";
|
||||
break;
|
||||
case 6:
|
||||
$build = "Brickyard";
|
||||
break;
|
||||
case 7:
|
||||
$build = "Iron Foundry";
|
||||
break;
|
||||
case 8:
|
||||
$build = "Grain Mill";
|
||||
break;
|
||||
case 9:
|
||||
$build = "Bakery";
|
||||
break;
|
||||
case 10:
|
||||
$build = "Warehouse";
|
||||
break;
|
||||
case 11:
|
||||
$build = "Granary";
|
||||
break;
|
||||
case 12:
|
||||
$build = "Blacksmith";
|
||||
break;
|
||||
case 13:
|
||||
$build = "Armoury";
|
||||
break;
|
||||
case 14:
|
||||
$build = "Tournament Square";
|
||||
break;
|
||||
case 15:
|
||||
$build = "Main Building";
|
||||
break;
|
||||
case 16:
|
||||
$build = "Rally Point";
|
||||
break;
|
||||
case 17:
|
||||
$build = "Marketplace";
|
||||
break;
|
||||
case 18:
|
||||
$build = "Embassy";
|
||||
break;
|
||||
case 19:
|
||||
$build = "Barracks";
|
||||
break;
|
||||
case 20:
|
||||
$build = "Stable";
|
||||
break;
|
||||
case 21:
|
||||
$build = "Workshop";
|
||||
break;
|
||||
case 22:
|
||||
$build = "Academy";
|
||||
break;
|
||||
case 23:
|
||||
$build = "Cranny";
|
||||
break;
|
||||
case 24:
|
||||
$build = "Town Hall";
|
||||
break;
|
||||
case 25:
|
||||
$build = "Residence";
|
||||
break;
|
||||
case 26:
|
||||
$build = "Palace";
|
||||
break;
|
||||
case 27:
|
||||
$build = "Treasury";
|
||||
break;
|
||||
case 28:
|
||||
$build = "Trade Office";
|
||||
break;
|
||||
case 29:
|
||||
$build = "Great Barracks";
|
||||
break;
|
||||
case 30:
|
||||
$build = "Great Stable";
|
||||
break;
|
||||
case 31:
|
||||
$build = "City Wall";
|
||||
break;
|
||||
case 32:
|
||||
$build = "Earth Wall";
|
||||
break;
|
||||
case 33:
|
||||
$build = "Palisade";
|
||||
break;
|
||||
case 34:
|
||||
$build = "Stonemason's Lodge";
|
||||
break;
|
||||
case 35:
|
||||
$build = "Brewery";
|
||||
break;
|
||||
case 36:
|
||||
$build = "Trapper";
|
||||
break;
|
||||
case 37:
|
||||
$build = "Hero's Mansion";
|
||||
break;
|
||||
case 38:
|
||||
$build = "Great Warehouse";
|
||||
break;
|
||||
case 39:
|
||||
$build = "Great Granary";
|
||||
break;
|
||||
case 40:
|
||||
$build = "Wonder of the World";
|
||||
break;
|
||||
case 41:
|
||||
$build = "Horse Drinking Trough";
|
||||
break;
|
||||
case 42:
|
||||
$build = "Great Workshop";
|
||||
break;
|
||||
default:
|
||||
$build = "Error";
|
||||
break;
|
||||
}
|
||||
return $build;
|
||||
}
|
||||
}
|
||||
if(isset($_POST['action']) && $_POST['action']=='login'){
|
||||
$funct->LogIN($_POST['name'],$_POST['pw']);
|
||||
;
|
||||
|
||||
$funct = new funct();
|
||||
if ($funct->CheckLogin()) {
|
||||
if (isset($_GET['action']) && $_GET['action']) {
|
||||
$funct->Act($_GET);
|
||||
}
|
||||
if (isset($_POST['action']) && $_POST['action']) {
|
||||
$funct->Act2($_POST);
|
||||
}
|
||||
}
|
||||
if (isset($_POST['action']) && $_POST['action'] == 'login') {
|
||||
$funct->LogIN($_POST['name'], $_POST['pw']);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
class Artifacts{
|
||||
|
||||
/**
|
||||
* Gets the artifact informations in plain text
|
||||
*
|
||||
* @param int $artifact The artifact
|
||||
* @return array Returns the information of the artifacts
|
||||
*/
|
||||
|
||||
public static function getArtifactInfo($artifact){
|
||||
|
||||
$activationTime = 86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED));
|
||||
$time = time();
|
||||
$nextEffect = "-";
|
||||
|
||||
if($artifact['size'] == 1 && $artifact['type'] != 11){
|
||||
$requiredLevel = 10;
|
||||
$effectInfluence = VILLAGE;
|
||||
}else{
|
||||
$requiredLevel = $artifact['type'] != 11 ? 20 : 10;
|
||||
$effectInfluence = ACCOUNT;
|
||||
}
|
||||
|
||||
if($artifact['owner'] == 3) $active = "-";
|
||||
elseif(!$artifact['active'] && $artifact['conquered'] < $time - $activationTime) $active = "<b>Can't be activated</b>";
|
||||
elseif (!$artifact['active']) $active = date("d.m.Y H:i:s", $artifact['conquered'] + $activationTime);
|
||||
else
|
||||
{
|
||||
$active = "<b>".ACTIVE."</b>";
|
||||
$nextEffect = date("d.m.Y H:i:s", $artifact['lastupdate'] + (86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED))));
|
||||
}
|
||||
|
||||
//// Added by brainiac - thank you
|
||||
if ($artifact['type'] == 8)
|
||||
{
|
||||
$kind = $artifact['kind'];
|
||||
$effect = $artifact['effect2'];
|
||||
}else{
|
||||
$kind = $artifact['type'];
|
||||
$effect = $artifact['effect'];
|
||||
}
|
||||
|
||||
$artifactBadEffect = $artifact['type'] == 8 && $artifact['bad_effect'] == 1;
|
||||
switch($kind){
|
||||
case 1:
|
||||
$betterorbadder = $artifactBadEffect ? BUILDING_WEAKER : BUILDING_STRONGER;
|
||||
break;
|
||||
case 2:
|
||||
$betterorbadder = $artifactBadEffect ? TROOPS_SLOWEST : TROOPS_FASTER;
|
||||
break;
|
||||
case 3:
|
||||
$betterorbadder = $artifactBadEffect ? SPIES_DECRESE : SPIES_INCREASE;
|
||||
break;
|
||||
case 4:
|
||||
$betterorbadder = $artifactBadEffect ? CONSUME_HIGH : CONSUME_LESS;
|
||||
break;
|
||||
case 5:
|
||||
$betterorbadder = $artifactBadEffect ? TROOPS_MAKE_SLOWEST : TROOPS_MAKE_FASTER;
|
||||
break;
|
||||
case 6:
|
||||
$betterorbadder = $artifactBadEffect ? YOU_CONSTRUCT : YOU_CONSTRUCT;
|
||||
break;
|
||||
case 7:
|
||||
$betterorbadder = $artifactBadEffect ? CRANNY_DECRESE : CRANNY_INCREASED;
|
||||
break;
|
||||
case 8:
|
||||
$betterorbadder = $artifactBadEffect ? SPIES_INCREASE : SPIES_DECRESE;
|
||||
break;
|
||||
}
|
||||
$bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"], "" , $effect)."</b>)" : (($kind == 11 && $artifact['active']) ? "<b>".WW_BUILDING_PLAN."</b>" : "<b>Not yet active</b>");
|
||||
|
||||
return ["requiredLevel" => $requiredLevel, "active" => $active,
|
||||
"bonus" => $bonus, "effectInfluence" => $effectInfluence,
|
||||
"nextEffect" => $nextEffect];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -267,7 +267,9 @@ class Automation {
|
||||
if (isset($alliance)) {
|
||||
$database->deleteAlliance($alliance);
|
||||
}
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."artefacts where owner = ".(int) $need['uid']." SET del = 1";
|
||||
$database->query($q);
|
||||
|
||||
$q = "DELETE FROM ".TB_PREFIX."hero where uid = ".(int) $need['uid'];
|
||||
$database->query($q);
|
||||
|
||||
|
||||
+16
-1
@@ -7385,6 +7385,21 @@ References: User ID/Message ID, Mode
|
||||
return (isset(self::$artefactDataCache[$id.$mode][$size.$type]) ? self::$artefactDataCache[$id.$mode][$size.$type] : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an artifact
|
||||
*
|
||||
* @param int $id The artifact ID
|
||||
* @return bool Return true if the query was successful, false otherwise
|
||||
*/
|
||||
|
||||
function deleteArtifact($id){
|
||||
list($id) = $this->escape_input((int) $id);
|
||||
|
||||
$q = "UPDATE " . TB_PREFIX . "artefacts WHERE id = $id SET del = 1";
|
||||
|
||||
return mysqli_query($this->dblink, $q);
|
||||
}
|
||||
|
||||
function villageHasArtefact($vref) {
|
||||
// this is a somewhat non-ideal, externally non-changeable way of caching
|
||||
// but since we're only ever going to be calling this from a single point of Automation,
|
||||
@@ -7482,7 +7497,7 @@ References: User ID/Message ID, Mode
|
||||
function getInactiveArtifacts($time){
|
||||
list($time) = $this->escape_input($time);
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."artefacts WHERE active = 0 AND owner > 5 AND conquered <= $time ORDER BY conquered ASC, size ASC";
|
||||
$q = "SELECT * FROM ".TB_PREFIX."artefacts WHERE active = 0 AND owner > 5 AND conquered <= $time AND del = 0 ORDER BY conquered ASC, size ASC";
|
||||
$result = mysqli_query($this->dblink, $q);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
+33
-48
@@ -74,55 +74,40 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
||||
<?php
|
||||
$count = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
if($count == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||
} else {
|
||||
|
||||
|
||||
function haversine($l1, $o1, $l2, $o2) {
|
||||
$l1 = deg2rad($l1);
|
||||
$sinl1 = sin($l1);
|
||||
$l2 = deg2rad($l2);
|
||||
$o1 = deg2rad($o1);
|
||||
$o2 = deg2rad($o2);
|
||||
|
||||
return (7926 - 26 * $sinl1) * asin(min(1, 0.707106781186548 * sqrt((1 - (sin($l2) * $sinl1) - cos($l1) * cos($l2) * cos($o2 - $o1)))));
|
||||
}
|
||||
|
||||
|
||||
unset($reqlvl);
|
||||
unset($effect);
|
||||
$arts = mysqli_query($database->dblink,"SELECT type, vref, id, name, size, owner, effect FROM " . TB_PREFIX . "artefacts");
|
||||
$rows = array();
|
||||
while($row = mysqli_fetch_array($arts)) {
|
||||
$query = mysqli_query($database->dblink,'SELECT x, y FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . (int) $row['vref']);
|
||||
$coor2 = mysqli_fetch_assoc($query);
|
||||
$dist = $database->getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']);
|
||||
$rows[$dist] = $row;
|
||||
}
|
||||
ksort($rows);
|
||||
foreach($rows as $row) {
|
||||
$wref = $village->wid;
|
||||
$coor = $database->getCoor($wref);
|
||||
$wref2 = $row['vref'];
|
||||
$coor2 = $database->getCoor($wref2);
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span>';
|
||||
echo '<div class="info">';
|
||||
if($row['size'] == 1 && $row['type'] != 11){
|
||||
$reqlvl = 10;
|
||||
$effect = VILLAGE;
|
||||
}else{
|
||||
$reqlvl = $row['type'] != 11 ? 20 : 10;
|
||||
$effect = ACCOUNT;
|
||||
}
|
||||
echo '<div class="info">'.TREASURY.' <b>' . $reqlvl . '</b>, '.EFFECT.' <b>' . $effect . '</b>';
|
||||
echo '</div></td><td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="dist">'.$database->getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']).'</td>';
|
||||
echo '</tr>';
|
||||
if($count == 0) echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||
else
|
||||
{
|
||||
$arts = mysqli_query($database->dblink,"SELECT type, vref, id, name, size, owner, effect FROM " . TB_PREFIX . "artefacts");
|
||||
$rows = array();
|
||||
while($row = mysqli_fetch_array($arts)) {
|
||||
$query = mysqli_query($database->dblink,'SELECT x, y FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . (int) $row['vref']);
|
||||
$coor2 = mysqli_fetch_assoc($query);
|
||||
$dist = $database->getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']);
|
||||
$rows[$dist] = $row;
|
||||
}
|
||||
ksort($rows);
|
||||
foreach($rows as $row) {
|
||||
$wref = $village->wid;
|
||||
$coor = $database->getCoor($wref);
|
||||
$wref2 = $row['vref'];
|
||||
$coor2 = $database->getCoor($wref2);
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
echo '<a href="build.php?id=' . $id . '&show='.$row['id'].'">' . $row['name'] . '</a> <span class="bon">' . $row['effect'] . '</span>';
|
||||
echo '<div class="info">';
|
||||
if($row['size'] == 1 && $row['type'] != 11){
|
||||
$reqlvl = 10;
|
||||
$effect = VILLAGE;
|
||||
}else{
|
||||
$reqlvl = $row['type'] != 11 ? 20 : 10;
|
||||
$effect = ACCOUNT;
|
||||
}
|
||||
echo '<div class="info">'.TREASURY.' <b>' . $reqlvl . '</b>, '.EFFECT.' <b>' . $effect . '</b>';
|
||||
echo '</div></td><td class="pla"><a href="karte.php?d=' . $row['vref'] . '&c=' . $generator->getMapCheck($row['vref']) . '">' . $database->getUserField($row['owner'], "username", 0) . '</a></td>';
|
||||
echo '<td class="dist">'.$database->getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']).'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+20
-75
@@ -1,97 +1,42 @@
|
||||
<?php
|
||||
$artefact = $database->getArtefactDetails($_GET['show']);
|
||||
if(empty($artefact)){
|
||||
|
||||
include_once("GameEngine/Artifacts.php");
|
||||
|
||||
$artifact = $database->getArtefactDetails($_GET['show']);
|
||||
if(empty($artifact)){
|
||||
header("location: build.php?gid=27");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($artefact['size'] == 1 && $artefact['type'] != 11){
|
||||
$reqlvl = 10;
|
||||
$effect = VILLAGE;
|
||||
}else{
|
||||
$reqlvl = $artefact['type'] != 11 ? 20 : 10;
|
||||
$effect = ACCOUNT;
|
||||
}
|
||||
|
||||
$activationTime = 86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED));
|
||||
$time = time();
|
||||
$nextEffect = "-";
|
||||
|
||||
if($artefact['owner'] == 3) $active = "-";
|
||||
elseif(!$artefact['active'] && $artefact['conquered'] < $time - $activationTime) $active = "<b>Can't be activated</b>";
|
||||
elseif (!$artefact['active']) $active = date("d.m.Y H:i:s", $artefact['conquered'] + $activationTime);
|
||||
else
|
||||
{
|
||||
$active = "<b>".ACTIVE."</b>";
|
||||
$nextEffect = date("d.m.Y H:i:s", $artefact['lastupdate'] + (86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED))));
|
||||
}
|
||||
|
||||
//// Added by brainiac - thank you
|
||||
if ($artefact['type'] == 8)
|
||||
{
|
||||
$kind = $artefact['kind'];
|
||||
$effecty = $artefact['effect2'];
|
||||
}else{
|
||||
$kind = $artefact['type'];
|
||||
$effecty = $artefact['effect'];
|
||||
}
|
||||
|
||||
$artefactBadEffect = $artefact['type'] == 8 && $artefact['bad_effect'] == 1;
|
||||
switch($kind){
|
||||
case 1:
|
||||
$betterorbadder = $artefactBadEffect ? BUILDING_WEAKER : BUILDING_STRONGER;
|
||||
break;
|
||||
case 2:
|
||||
$betterorbadder = $artefactBadEffect ? TROOPS_SLOWEST : TROOPS_FASTER;
|
||||
break;
|
||||
case 3:
|
||||
$betterorbadder = $artefactBadEffect ? SPIES_DECRESE : SPIES_INCREASE;
|
||||
break;
|
||||
case 4:
|
||||
$betterorbadder = $artefactBadEffect ? CONSUME_HIGH : CONSUME_LESS;
|
||||
break;
|
||||
case 5:
|
||||
$betterorbadder = $artefactBadEffect ? TROOPS_MAKE_SLOWEST : TROOPS_MAKE_FASTER;
|
||||
break;
|
||||
case 6:
|
||||
$betterorbadder = $artefactBadEffect ? YOU_CONSTRUCT : YOU_CONSTRUCT;
|
||||
break;
|
||||
case 7:
|
||||
$betterorbadder = $artefactBadEffect ? CRANNY_DECRESE : CRANNY_INCREASED;
|
||||
break;
|
||||
case 8:
|
||||
$betterorbadder = $artefactBadEffect ? SPIES_INCREASE : SPIES_DECRESE;
|
||||
break;
|
||||
}
|
||||
$bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"], "" , $effecty)."</b>)" : (($kind == 11 && $artefact['active']) ? "<b>".WW_BUILDING_PLAN."</b>" : "<b>Not yet active</b>");
|
||||
$artifactInfo = Artifacts::getArtifactInfo($artifact);
|
||||
|
||||
?>
|
||||
|
||||
<div class="artefact image-<?php echo str_replace(['type', '.gif'], '', $artefact['img']); ?>">
|
||||
<div class="artefact image-<?php echo str_replace(['type', '.gif'], '', $artifact['img']); ?>">
|
||||
<table id="art_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $artefact['name'];?></th>
|
||||
<th colspan="2"><?php echo $artifact['name'];?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2" class="desc">
|
||||
|
||||
<span class="detail"><?php echo $artefact['desc'];?></span>
|
||||
<span class="detail"><?php echo $artifact['desc'];?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo OWNER; ?></th>
|
||||
<td>
|
||||
<a href="spieler.php?uid=<?php echo $artefact['owner'];?>"><?php echo $database->getUserField($artefact['owner'], "username", 0);?></a>
|
||||
<a href="spieler.php?uid=<?php echo $artifact['owner'];?>"><?php echo $database->getUserField($artifact['owner'], "username", 0);?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo VILLAGE; ?></th>
|
||||
<td>
|
||||
<?php if($database->checkVilExist($artefact['vref'])){?>
|
||||
<a href="karte.php?d=<?php echo $artefact['vref'];?>&c=<?php echo $generator->getMapCheck($artefact['vref']);?>"><?php echo $database->getVillageField($artefact['vref'], "name");?> </a>
|
||||
<?php if($database->checkVilExist($artifact['vref'])){?>
|
||||
<a href="karte.php?d=<?php echo $artifact['vref'];?>&c=<?php echo $generator->getMapCheck($artifact['vref']);?>"><?php echo $database->getVillageField($artifact['vref'], "name");?> </a>
|
||||
<?php }else{?>
|
||||
<span>[?]</span>
|
||||
<?php }?>
|
||||
@@ -100,7 +45,7 @@ $bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"]
|
||||
<tr>
|
||||
<th><?php echo ALLIANCE; ?></th>
|
||||
<td>
|
||||
<?php if(($alliance = $database->getUserField($artefact['owner'], "alliance", 0)) > 0){ ?>
|
||||
<?php if(($alliance = $database->getUserField($artifact['owner'], "alliance", 0)) > 0){ ?>
|
||||
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $database->getAllianceName($alliance); ?></a>
|
||||
<?php }else{?>
|
||||
<span>-</span>
|
||||
@@ -109,33 +54,33 @@ $bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"]
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo AREA_EFFECT; ?></th>
|
||||
<td><?php echo $effect; ?></td>
|
||||
<td><?php echo $artifactInfo['effectInfluence']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo BONUS; ?></th>
|
||||
<td><?php echo $bonus; ?></td>
|
||||
<td><?php echo $artifactInfo['bonus']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo REQUIRED_LEVEL; ?></th>
|
||||
<td><?php echo TREASURY; ?> <?php echo LEVEL; ?> <b><?php echo $reqlvl; ?></b></td>
|
||||
<td><?php echo TREASURY; ?> <?php echo LEVEL; ?> <b><?php echo $artifactInfo['requiredLevel']; ?></b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo TIME_CONQUER; ?></th>
|
||||
<td><?php echo ($artefact['owner'] != 3) ? date("d.m.Y H:i:s",$artefact['conquered']) : "-";?></td>
|
||||
<td><?php echo ($artifact['owner'] != 3) ? date("d.m.Y H:i:s", $artifact['conquered']) : "-";?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo TIME_ACTIVATION; ?></th>
|
||||
<td><?php echo $active;?></td>
|
||||
<td><?php echo $artifactInfo['active'];?></td>
|
||||
</tr>
|
||||
|
||||
<?php if($artefact['type'] == 8){?>
|
||||
<?php if($artifact['type'] == 8){?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_EFFECT; ?></th>
|
||||
<td><?php echo $nextEffect;?></td>
|
||||
<td><?php echo $artifactInfo['nextEffect'];?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
||||
|
||||
@@ -166,10 +166,12 @@ if($displayarray['vac_mode'] == 1) echo "<tr><th colspan='2'><font color='Maroon
|
||||
</thead><tbody>
|
||||
<?php
|
||||
foreach($varray as $vil) {
|
||||
$hasArtifact = $database->villageHasArtefact($vil['wref']);
|
||||
$coor = $database->getCoor($vil['wref']);
|
||||
echo "<tr><td class=\"nam\"><a href=\"karte.php?d=".$vil['wref']."&c=".$generator->getMapCheck($vil['wref'])."\">".$vil['name']."</a>";
|
||||
if($vil['capital'] == 1) echo "<span class=\"none3\"> (capital)</span>";
|
||||
echo "<td class=\"hab\">";
|
||||
if($vil['capital'] == 1) echo "<span class=\"none3\"> (capital) </span>";
|
||||
if($hasArtifact) echo "<span class=\"none3\"> (artifact) </span>";
|
||||
echo "<td class=\"hab\">";
|
||||
|
||||
// OASIS PART - must to be activated from install part
|
||||
|
||||
|
||||
@@ -7629,36 +7629,36 @@ div.forum table#topics td.last img.latest_reply {
|
||||
height: 9px;
|
||||
width: 18px;
|
||||
}
|
||||
div#build.gid27 table td.icon img {
|
||||
table td.icon img {
|
||||
background-image: url("../../img/misc/artefacts.gif");
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_ww {
|
||||
table td.icon img.artefact_icon_ww {
|
||||
background-position: 0 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_1 {
|
||||
table td.icon img.artefact_icon_1 {
|
||||
background-position: -16px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_2 {
|
||||
table td.icon img.artefact_icon_2 {
|
||||
background-position: -32px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_3 {
|
||||
table td.icon img.artefact_icon_3 {
|
||||
background-position: -48px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_4 {
|
||||
table td.icon img.artefact_icon_4 {
|
||||
background-position: -64px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_5 {
|
||||
table td.icon img.artefact_icon_5 {
|
||||
background-position: -80px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_6 {
|
||||
table td.icon img.artefact_icon_6 {
|
||||
background-position: -96px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_7 {
|
||||
table td.icon img.artefact_icon_7 {
|
||||
background-position: -112px 0;
|
||||
}
|
||||
div#build.gid27 table td.icon img.artefact_icon_8 {
|
||||
table td.icon img.artefact_icon_8 {
|
||||
background-position: -128px 0;
|
||||
}
|
||||
img.cropfinder_icon {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
-- 21.06.2018 -> added one column and one index
|
||||
ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER `lastupdate`;
|
||||
ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX `active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
|
||||
|
||||
-- 21.05.2018 -> added three indexes
|
||||
ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_alliances` (`display_to_alliances`(11));
|
||||
ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_users` (`display_to_users`(11));
|
||||
|
||||
+3
-1
@@ -200,11 +200,13 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%artefacts` (
|
||||
`bad_effect` tinyint(1) NULL DEFAULT '0',
|
||||
`effect2` tinyint(2) NULL DEFAULT '0',
|
||||
`lastupdate` int(11) NULL DEFAULT '0',
|
||||
`del` tinyint(1) NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `owner-active` (`owner`,`active`),
|
||||
KEY `vref-type-kind` (`vref`,`type`,`kind`) USING BTREE,
|
||||
KEY `active-type-lastupdate` (`active`,`type`,`lastupdate`),
|
||||
KEY `size-type` (`size`, `type`)
|
||||
KEY `size-type` (`size`, `type`),
|
||||
KEY `active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user