big update (trade routes, less hungry troops artefact, somethings in hero table, fix peace reports...)

This commit is contained in:
unknown
2012-06-07 22:15:27 +03:00
parent aede02f5f1
commit 7f1cf234b2
13 changed files with 460 additions and 36 deletions
+7 -1
View File
@@ -1,3 +1,4 @@
<?php if($session->gold > 2){ ?>
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
@@ -262,4 +263,9 @@ function testSum() {
</br></br>
<?php echo "You can't use NPC trade in WW village.";
}} ?>
</div>
</div>
<?php
}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+74
View File
@@ -0,0 +1,74 @@
<?php if($session->goldclub == 1 && $database->getProfileVillages($session->uid) > 1) { ?>
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
</p>
<?php include("17_menu.tpl");
if(isset($_GET['action'])){
$routeaccess = 1;
}
if(isset($_GET['create']) && $session->gold > 1){
$routeaccess = 1;
include("17_create.tpl");
}else if($_GET['action'] == 'editRoute' && isset($_GET['routeid']) && $_GET['routeid'] != ""){
$traderoute = $database->getTradeRouteUid($_GET['routeid']);
if($traderoute == $session->uid){
include("17_edit.tpl");
}
}else{
?>
<p>Trade route allows you to set up routes for your merchant that he will walk every day at a certain hour. <br /><br />
Standard this holds on for 7 days, but you can extend it with 7 days for the cost of <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2.</p>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th></th>
<th>description</th>
<th>start</th>
<th>Merchants</th>
<th>time left</th>
</tr></thead><tbody>
<?php
$routes = $database->getTradeRoute($session->uid);
if(count($routes) == 0) {
echo "<td colspan=\"5\" class=\"none\">No active trade route.</td></tr>";
}else{
foreach($routes as $route){
?>
<tr>
<th><label><input class="radio" type="radio" onclick="window.location.href = '?id=<?php echo $id; ?>&t=4&routeid=<?php echo $route['id']; ?>';" name="routeid" value="<?php echo $route['id']; ?>" <?php if($routeid == $route['id']) { echo "checked"; } ?>></label></th>
<th>
<?php
echo "Trade route to <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>"
?>
</th>
<th><?php if($route['start'] > 9){ echo $route['start'];}else{ echo "0".$route['start'];} echo ":00"; ?></th>
<th><?php echo $route['deliveries']."x".$route['merchant']; ?></th>
<th><?php echo ceil(($route['timeleft']-time())/86400); echo " days"; ?></th>
</tr>
<?php }} ?>
</tbody><tfoot><tr>
<th>
</th>
<th colspan="4">
<a href="build.php?action=extendRoute&routeid=<?php echo $routeid; ?>">extend</a>*
| <a href="build.php?id=<?php echo $id; ?>&t=4&action=editRoute&routeid=<?php echo $routeid; ?>">edit</a>
| <a href="build.php?action=delRoute&routeid=<?php echo $routeid; ?>">delete</a>
</th></tr></tfoot></table>
* Extend the trade route by 7 days for <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2
<br>
<div class="options">
<a class="arrow" href="build.php?gid=17&t=4&create">» Create new trade route</a>
</div>
</div>
<?php
}}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+78
View File
@@ -0,0 +1,78 @@
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="addRoute">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Create trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
target village: </th>
<td>
<select id="tvillage" name="tvillage">
<?php
if($session->villages[0] == $village->wid){
$firstvillage = 2;
}else{
$firstvillage = 1;
}
for($i=1;$i<=count($session->villages);$i++) {
if($i == $firstvillage){
$select = 'selected="selected"';
}else{
$select = '';
}
if($session->villages[$i-1] != $village->wid){
$coor = $database->getCoor($session->villages[$i-1]);
echo "<option value=\"".$session->villages[$i-1]."\" ".$select.">".$database->getVillageField($session->villages[$i-1],'name')." (".$coor['x']."|".$coor['y'].")</option>";
}
}
?> </select>
</td>
</tr>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="CLay"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><option value="0" selected="selected">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option></select>
</td>
</tr>
<tr>
<th>
costs: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold"> 2
</td>
</tr>
<tr>
<th>
Duration: </th>
<td>
7 days
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+40
View File
@@ -0,0 +1,40 @@
<?php $edited_route = $database->getTradeRoute2($_GET['routeid']); ?>
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="editRoute">
<input type="hidden" name="routeid" value="<?php echo $_GET['routeid']; ?>">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Edit trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="<?php echo $edited_route['wood']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="CLay"> <input class="text" type="text" name="r2" id="r2" value="<?php echo $edited_route['clay']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="<?php echo $edited_route['iron']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="<?php echo $edited_route['crop']; ?>" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><?php for($i=0;$i<=23;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['start']){echo "selected";} ?>><?php if($i > 9){echo $i;}else{echo "0".$i;}?></option><?php } ?></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><?php for($i=1;$i<=3;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['deliveries']){echo "selected";} ?>><?php echo $i; ?></option><?php } ?></select>
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+7 -1
View File
@@ -2,10 +2,16 @@
<a href="build.php?id=<?php echo $id; ?>"<?php if(!isset($_GET['t'])) { echo "class=\"selected\""; } ?>">Send Resouces</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=1" <?php if(isset($_GET['t']) && $_GET['t'] == 1) { echo "class=\"selected\""; } ?>>Buy</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=2" <?php if(isset($_GET['t']) && $_GET['t'] == 2) { echo "class=\"selected\""; } ?>>Offer</a>
<?php if($session->userinfo['gold'] > 3) {
<?php if($session->userinfo['gold'] > 2) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=3" <?php if(isset($_GET['t']) && $_GET['t'] == 3) { echo "class=\"selected\""; } ?>>NPC trading</a>
<?php
}
?>
<?php if($session->goldclub == 1 && $database->getProfileVillages($session->uid) > 1) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=4" <?php if(isset($_GET['t']) && $_GET['t'] == 4) { echo "class=\"selected\""; } ?>>trade routes</a>
<?php
}
?>
</div>
-1
View File
@@ -21,7 +21,6 @@ include_once("GameEngine/Data/hero_full.php");
?>
<?php if ($hero_info['experience'] >= 495000) {
mysql_query("UPDATE ".TB_PREFIX."hero SET `level` = 100 where `uid`='".$session->uid."'");
?>
<table id="distribution" cellpadding="1" cellspacing="1">
<thead><tr>