diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index 735dc5a7..b82217b8 100644
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -780,7 +780,7 @@ private function loyaltyRegeneration() {
--------------------------------*/
}else{
$Attacker['id'] = $database->getUserField($database->getVillageField($data['from'],"owner"),"id",0);
- $Defender['id'] = 3;
+ $Defender['id'] = 2;
$owntribe = $database->getUserField($database->getVillageField($data['from'],"owner"),"tribe",0);
$targettribe = 4;
@@ -1849,9 +1849,9 @@ private function loyaltyRegeneration() {
}
}
else {
- if($unitssend_def[1] == 0 and $unitssend_def[2] == 0 and $unitssend_def[3] == 0 and $unitssend_def[4] == 0 and $unitssend_def[5] == 0 and $unitssend_def[6] == 0){
+ if($unitssend_def[1] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[2] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[3] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[4] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[5] == '0,0,0,0,0,0,0,0,0,0'){
$database->addNotice($to['owner'],$to['wref'],$targetally,7,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
- }else if($totaldead_def == 0){
+ }else if($totaldead_def == '0,0,0,0,0,0,0,0,0,0'){
$database->addNotice($to['owner'],$to['wref'],$targetally,4,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
}else if($unitssend_def > $totaldead_def){
$database->addNotice($to['owner'],$to['wref'],$targetally,5,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php
index 08bf4e33..5a18407d 100644
--- a/GameEngine/Database/db_MYSQL.php
+++ b/GameEngine/Database/db_MYSQL.php
@@ -576,6 +576,11 @@
}
}
}
+
+ function removeOases($wref) {
+ $q = "UPDATE ".TB_PREFIX."odata SET conqured = 0, owner = 2, name = 'Unoccupied Oasis' WHERE wref = $wref";
+ return mysql_query($q, $this->connection);
+ }
/***************************
@@ -2471,9 +2476,63 @@
$q = 'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $id . ' ORDER BY `pos` ASC';
return mysql_query($q, $this->connection);
+ }
+
+ function removeLinks($id){
+ $q = "DELETE FROM " . TB_PREFIX . "links WHERE `id` = ".$id."";
+ return mysql_query($q, $this->connection);
+
}
- function getArrayMemberVillage($uid){
+ function getVilFarmlist($wref){
+ $q = 'SELECT * FROM ' . TB_PREFIX . 'farmlist WHERE wref = ' . $wref . ' ORDER BY wref ASC';
+ $result = mysql_query($q, $this->connection);
+ $dbarray = mysql_fetch_array($result);
+
+ if($dbarray['id']!=0) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
+ function getRaidList($id) {
+ $q = "SELECT * FROM " . TB_PREFIX . "raidlist WHERE id = ".$id."";
+ $result = mysql_query($q, $this->connection);
+ return mysql_fetch_array($result);
+ }
+
+ function delFarmList($id, $owner) {
+ $q = "DELETE FROM " . TB_PREFIX . "farmlist where id = $id and owner = $owner";
+ return mysql_query($q, $this->connection);
+ }
+
+
+ function delSlotFarm($id) {
+ $q = "DELETE FROM " . TB_PREFIX . "raidlist where id = $id";
+ return mysql_query($q, $this->connection);
+ }
+
+
+ function createFarmList($wref, $owner, $name) {
+ $q = "INSERT INTO " . TB_PREFIX . "farmlist (`wref`, `owner`, `name`) VALUES ('$wref', '$owner', '$name')";
+ return mysql_query($q, $this->connection);
+ }
+
+ function addSlotFarm($lid, $towref, $x, $y, $distance, $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10) {
+ $q = "INSERT INTO " . TB_PREFIX . "raidlist (`lid`, `towref`, `x`, `y`, `distance`, `t1`, `t2`, `t3`, `t4`, `t5`, `t6`, `t7`, `t8`, `t9`, `t10`) VALUES ('$lid', '$towref', '$x', '$y', '$distance', '$t1', '$t2', '$t3', '$t4', '$t5', '$t6', '$t7', '$t8', '$t9', '$t10')";
+ return mysql_query($q, $this->connection);
+ }
+
+ function editSlotFarm($eid, $lid, $wref, $x, $y, $dist, $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10) {
+
+ $q = "UPDATE " . TB_PREFIX . "raidlist set lid = '$lid', towref = '$wref', x = '$x', y = '$y', t1 = '$t1', t2 = '$t2', t3 = '$t3', t4 = '$t4', t5 = '$t5', t6 = '$t6', t7 = '$t7', t8 = '$t8', t9 = '$t9', t10 = '$t10' WHERE id = $eid";
+ return mysql_query($q, $this->connection);
+
+ }
+
+ function getArrayMemberVillage($uid){
$q = 'SELECT a.wref, a.name, b.x, b.y from '.TB_PREFIX.'vdata AS a left join '.TB_PREFIX.'wdata AS b ON b.id = a.wref where owner = '.$uid.' order by capital DESC,pop DESC';
$result = mysql_query($q, $this->connection);
diff --git a/Templates/Build/16.tpl b/Templates/Build/16.tpl
index b484f9ed..4cfc8f6a 100644
--- a/Templates/Build/16.tpl
+++ b/Templates/Build/16.tpl
@@ -7,8 +7,9 @@
-
+ Combat Simulator goldclub==1){ ?>|
+ Farmlist
+
getMovement("34",$village->wid,1);
diff --git a/Templates/Build/16_99.tpl b/Templates/Build/16_99.tpl
new file mode 100644
index 00000000..1c453108
--- /dev/null
+++ b/Templates/Build/16_99.tpl
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+لشکریان دهکدهی شما در این محل جمع می شوند. از اینجا شما قادر به ارسال آنها برای غارت، حمله، تسخیر و یا پشتیبانی دهکده های دیگر می باشید.
+
+
+
+
+ goldclub) { ?>
+
+
+
لیست فارم یکی از امکانات کلوپ طلایی می باشد و نیازی به پرداخت هزینۀ دیگری برای فعال سازی ان نیست.
+
+
+
+
+
عضو کلوپ طلایی شوید
+
+
+
+
+
diff --git a/Templates/Build/37_land.tpl b/Templates/Build/37_land.tpl
index ea27a276..9306ab5a 100644
--- a/Templates/Build/37_land.tpl
+++ b/Templates/Build/37_land.tpl
@@ -3,7 +3,10 @@
Copyright: Travianx Project */
$oasisarray = $database->getOasis($village->wid);
-
+if($_GET['gid']==37 && isset($_GET['del'])){
+ $database->removeOases($_GET['del']);
+ header("Location: build.php?id=".$id."&land");
+}
?>
@@ -24,7 +27,7 @@
?>
-
+
diff --git a/Templates/Profile/preference.tpl b/Templates/Profile/preference.tpl
index 5cedae9f..5a7021c2 100644
--- a/Templates/Profile/preference.tpl
+++ b/Templates/Profile/preference.tpl
@@ -1,4 +1,8 @@
removeLinks($_GET['del']);
+ header("Location: spieler.php?s=2");
+}
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
@@ -90,10 +94,10 @@ while($data = mysql_fetch_assoc($query)) {
diff --git a/Templates/goldClub/farmlist.tpl b/Templates/goldClub/farmlist.tpl
new file mode 100644
index 00000000..e2fa78a2
--- /dev/null
+++ b/Templates/goldClub/farmlist.tpl
@@ -0,0 +1,372 @@
+createFarmList($_POST['did'], $session->uid, $_POST['name']);
+}
+
+$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
+$query = mysql_num_rows($sql);
+while($row = mysql_fetch_array($sql)){
+ $lid = $row["id"];
+ $lname = $row["name"];
+ $lowner = $row["owner"];
+ $lwref = $row["wref"];
+ $lvname = $database->getVillageField($row["wref"], 'name');
+ if($lwref == $village->wid){
+?>
+
+
+
+
+
+
+ -
+
+
+
جزئیات
+
+
+
+
+
+
+
+getUnit($village->wid);
+
+if($session->tribe==1){
+ $unit1 = $getUnit['u1'];$unit2 = $getUnit['u2'];$unit3 = $getUnit['u3'];$unit4 = $getUnit['u4'];$unit5 = $getUnit['u5'];
+ $unit6 = $getUnit['u6'];$unit7 = $getUnit['u7'];$unit8 = $getUnit['u8'];$unit9 = $getUnit['u9'];$unit10 = $getUnit['u10'];
+}elseif($session->tribe==2){
+ $unit1 = $getUnit['u11'];$unit2 = $getUnit['u12'];$unit3 = $getUnit['u13'];$unit4 = $getUnit['u14'];$unit5 = $getUnit['u15'];
+ $unit6 = $getUnit['u16'];$unit7 = $getUnit['u17'];$unit8 = $getUnit['u18'];$unit9 = $getUnit['u19'];$unit10 = $getUnit['u20'];
+}elseif($session->tribe==3){
+ $unit1 = $getUnit['u21'];$unit2 = $getUnit['u22'];$unit3 = $getUnit['u23'];$unit4 = $getUnit['u24'];$unit5 = $getUnit['u25'];
+ $unit6 = $getUnit['u26'];$unit7 = $getUnit['u27'];$unit8 = $getUnit['u28'];$unit9 = $getUnit['u29'];$unit10 = $getUnit['u30'];
+}
+?>
+
+getVilFarmlist($village->wid)){
+?>
+
+
+
+
diff --git a/Templates/goldClub/farmlist_add.tpl b/Templates/goldClub/farmlist_add.tpl
new file mode 100644
index 00000000..d7361d65
--- /dev/null
+++ b/Templates/goldClub/farmlist_add.tpl
@@ -0,0 +1,40 @@
+
diff --git a/Templates/goldClub/farmlist_addraid.tpl b/Templates/goldClub/farmlist_addraid.tpl
new file mode 100644
index 00000000..409647e7
--- /dev/null
+++ b/Templates/goldClub/farmlist_addraid.tpl
@@ -0,0 +1,202 @@
+getVilWref($_POST['y'], $_POST['x']);
+ $type = $database->getVillageType2($Wref);
+ $oasistype = $type['oasistype'];
+ $vdata = $database->getVillage($Wref);
+ }
+ if(!$_POST['x'] && !$_POST['y']){
+ $errormsg .= "مختصات را وارد کنید.";
+ }elseif(!$_POST['x'] || !$_POST['y']){
+ $errormsg .= "مختصات را صحیح وارد کنید.";
+ }elseif($oasistype == 0 && $vdata == 0){
+ $errormsg .= "در این مختصات دهکده ای وجود ندارد.";
+ }elseif($troops == 0){
+ $errormsg .= "هیچ نیرویی انتخاب نشده.";
+ }else{
+
+ $Wref = $database->getVilWref($_POST['y'], $_POST['x']);
+ $coor = $database->getCoor($village->wid);
+
+ function getDistance($coorx1, $coory1, $coorx2, $coory2) {
+ $max = 2 * WORLD_MAX + 1;
+ $x1 = intval($coorx1);
+ $y1 = intval($coory1);
+ $x2 = intval($coorx2);
+ $y2 = intval($coory2);
+ $distanceX = min(abs($x2 - $x1), abs($max - abs($x2 - $x1)));
+ $distanceY = min(abs($y2 - $y1), abs($max - abs($y2 - $y1)));
+ $dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
+ return round($dist, 1);
+ }
+
+ $distance = getDistance($coor['x'], $coor['y'], $_POST['y'], $_POST['x']);
+
+ $database->addSlotFarm($_POST['lid'], $Wref, $_POST['x'], $_POST['y'], $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
+
+ header("Location: build.php?id=39&t=99");
+}
+}
+?>
+
+
+
+
+
افزودن غارت
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Templates/goldClub/farmlist_editraid.tpl b/Templates/goldClub/farmlist_editraid.tpl
new file mode 100644
index 00000000..a59ec11f
--- /dev/null
+++ b/Templates/goldClub/farmlist_editraid.tpl
@@ -0,0 +1,219 @@
+getRaidList($_GET['eid']);
+$x = $eiddata['x'];
+$y = $eiddata['y'];
+$t1 = $eiddata['t1'];$t2 = $eiddata['t2'];$t3 = $eiddata['t3'];$t4 = $eiddata['t4'];$t5 = $eiddata['t5'];$t6 = $eiddata['t6'];$t7 = $eiddata['t7'];$t8 = $eiddata['t8'];$t9 = $eiddata['t9'];$t10 = $eiddata['t10'];
+}
+
+if(isset($_POST['action']) == 'editSlot' && $_POST['eid']) {
+
+$Wref = $database->getVilWref($_POST['y'], $_POST['x']);
+$type = $database->getVillageType2($Wref);
+$oasistype = $type['oasistype'];
+$vdata = $database->getVillage($Wref);
+
+$troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10']."";
+
+ if(!$_POST['x'] && !$_POST['y']){
+ $errormsg .= "مختصات را وارد کنید.";
+ }elseif(!$_POST['x'] || !$_POST['y']){
+ $errormsg .= "مختصات را صحیح وارد کنید.";
+ }elseif($oasistype == 0 && $vdata == 0){
+ $errormsg .= "در این مختصات دهکده ای وجود ندارد.";
+ }elseif($troops == 0){
+ $errormsg .= "هیچ نیرویی انتخاب نشده.";
+ }else{
+
+ $Wref = $database->getVilWref($_POST['y'], $_POST['x']);
+ $coor = $database->getCoor($village->wid);
+
+ function getDistance($coorx1, $coory1, $coorx2, $coory2) {
+ $max = 2 * WORLD_MAX + 1;
+ $x1 = intval($coorx1);
+ $y1 = intval($coory1);
+ $x2 = intval($coorx2);
+ $y2 = intval($coory2);
+ $distanceX = min(abs($x2 - $x1), abs($max - abs($x2 - $x1)));
+ $distanceY = min(abs($y2 - $y1), abs($max - abs($y2 - $y1)));
+ $dist = sqrt(pow($distanceX, 2) + pow($distanceY, 2));
+ return round($dist, 1);
+ }
+ $distance = getDistance($coor['x'], $coor['y'], $_POST['y'], $_POST['x']);
+
+ $database->editSlotFarm($_GET['eid'], $_POST['lid'], $Wref, $_POST['x'], $_POST['y'], $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
+
+ header("Location: build.php?id=39&t=99");
+}
+}
+
+
+?>
+
+
+
+
+
افزودن غارت
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Templates/goldClub/trooplist.tpl b/Templates/goldClub/trooplist.tpl
new file mode 100644
index 00000000..1a091cb5
--- /dev/null
+++ b/Templates/goldClub/trooplist.tpl
@@ -0,0 +1,141 @@
+tribe == 1){
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tribe == 2){ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tribe == 3){ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Templates/goldClub/trooplist2.tpl b/Templates/goldClub/trooplist2.tpl
new file mode 100644
index 00000000..0fc8ad61
--- /dev/null
+++ b/Templates/goldClub/trooplist2.tpl
@@ -0,0 +1,141 @@
+tribe == 1){
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tribe == 2){ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tribe == 3){ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/install/data/sql.sql b/install/data/sql.sql
index fd506ca9..75798d01 100644
--- a/install/data/sql.sql
+++ b/install/data/sql.sql
@@ -557,6 +557,24 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%enforcement` (
-- Dumping data for table `%prefix%enforcement`
--
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `%prefix%farmlist`
+--
+
+CREATE TABLE IF NOT EXISTS `%PREFIX%farmlist` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `wref` int(10) unsigned NOT NULL,
+ `owner` int(10) unsigned NOT NULL,
+ `name` varchar(45) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+--
+-- Dumping data for table `%prefix%farmlist`
+--
+
-- --------------------------------------------------------
@@ -1009,6 +1027,36 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%online` (
-- Dumping data for table `%prefix%online`
--
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `%prefix%raidlist`
+--
+
+CREATE TABLE IF NOT EXISTS `%PREFIX%raidlist` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `lid` int(10) NOT NULL,
+ `towref` int(10) unsigned NOT NULL,
+ `x` int(11) NOT NULL,
+ `y` int(11) NOT NULL,
+ `distance` varchar(5) NOT NULL DEFAULT '0',
+ `t1` int(11) unsigned NOT NULL,
+ `t2` int(11) unsigned NOT NULL,
+ `t3` int(11) unsigned NOT NULL,
+ `t4` int(11) unsigned NOT NULL,
+ `t5` int(11) unsigned NOT NULL,
+ `t6` int(11) unsigned NOT NULL,
+ `t7` int(11) unsigned NOT NULL,
+ `t8` int(11) unsigned NOT NULL,
+ `t9` int(11) unsigned NOT NULL,
+ `t10` int(11) unsigned NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+--
+-- Dumping data for table `%prefix%raidlist`
+--
+
-- --------------------------------------------------------