fix rat from questmaster, more fix for icon for reports, fix hero in type 3 of report, fix reinforcement from questmaster in rallypoint and now when hero lose 90% health or more in one battle he die

This commit is contained in:
unknown
2012-04-21 02:40:57 +03:00
parent 3a24e1d6e0
commit 47919ed84b
8 changed files with 113 additions and 22 deletions
+10 -2
View File
@@ -2086,8 +2086,16 @@ $crannyimg = "<img src=\"gpack/travian_default/img/g/g23.gif\" height=\"30\" wid
@fclose($ourFileHandle);
$q = "SELECT * FROM ".TB_PREFIX."movement, ".TB_PREFIX."attacks where ".TB_PREFIX."movement.ref = ".TB_PREFIX."attacks.id and ".TB_PREFIX."movement.proc = '0' and ".TB_PREFIX."movement.sort_type = '3' and ".TB_PREFIX."attacks.attack_type = '2' and endtime < $time";
$dataarray = $database->query_return($q);
foreach($dataarray as $data) {
if($data['from']==0){
$to = $database->getMInfo($data['to']);
$database->addEnforce($data);
$reinf = $database->getEnforce($data['to'],$data['from']);
$database->modifyEnforce($reinf['id'],31,1,1);
$data_fail = '0,0,4,1,0,0,0,0,0,0,0,0,0,0';
$database->addNotice($to['owner'],$to['wref'],$targetally,8,'village of the elders reinforcement '.addslashes($to['name']).'',$data_fail,$AttackArrivalTime);
$database->setMovementProc($data['moveid']);
}else{
//set base things
$owntribe = $database->getUserField($database->getVillageField($data['from'],"owner"),"tribe",0);
$targettribe = $database->getUserField($database->getVillageField($data['to'],"owner"),"tribe",0);
@@ -2133,7 +2141,7 @@ $crannyimg = "<img src=\"gpack/travian_default/img/g/g23.gif\" height=\"30\" wid
}
//update status
$database->setMovementProc($data['moveid']);
}
}
if(file_exists("GameEngine/Prevention/sendreinfunits.txt")) {
@unlink("GameEngine/Prevention/sendreinfunits.txt");
+1 -1
View File
@@ -508,7 +508,7 @@ class Battle {
$hero_health=$fdb['health'];
$damage_health=round(100*$result[1]);
//exit($damage_health."|".$hero_health."|".$atkhero['heroid']);
if ($hero_health<=$damage_health)
if ($hero_health<=$damage_health or $damage_health>90)
{
//hero die
$result['casualties_attacker']['11'] = 1;
+2 -1
View File
@@ -99,7 +99,8 @@ if (isset($qact)){
//Get 200 Crop
$database->modifyResource($session->villages[0],0,0,0,-200,1);
//Give Reward
$database->modifyUnit($session->villages[0],array(31),array(1),array(1));
$attack = $database->addAttack(0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0);
$database->addMovement(3,0,$session->villages[0],$attack,time(),time()+12600/INCREASE_SPEED);
} else{
$NoCrop="No Enough Crop!";
}
+35
View File
@@ -42,6 +42,7 @@ if($units_incoming >= 1){
if(count($village->enforcetome) > 0) {
foreach($village->enforcetome as $enforce) {
$colspan = 10+$enforce['hero'];
if($enforce['from']!=0){
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
@@ -74,6 +75,40 @@ if($units_incoming >= 1){
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>Taskmaster</a></td>
<td colspan=\"$colspan\">";
echo "<a> village of the elders troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}
}
}
if(count($village->enforcetoyou) > 0) {
+46
View File
@@ -19,6 +19,7 @@ if ($units[$y]['sort_type']==3){
}
if($units[$y]['attack_type'] != 1){
if($units[$y]['from'] != 0){
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$units[$y]['from']."&c=".$generator->getMapCheck($units[$y]['from'])."\">".$database->getVillageField($units[$y]['from'],"name")."</a></td>
<td colspan=\"10\">";
@@ -62,6 +63,51 @@ if ($units[$y]['sort_type']==3){
</tr>
</tbody>";
echo "</table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>village of the elders</a></td>
<td colspan=\"10\">";
echo "<a>Taskmaster's troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($end);$i++) {
$totalunits = $units[$y]['t1']+$units[$y]['t2']+$units[$y]['t3']+$units[$y]['t4']+$units[$y]['t5']+$units[$y]['t6']+$units[$y]['t7']+$units[$y]['t8']+$units[$y]['t9']+$units[$y]['t10']+$units[$y]['t11'];
if($totalunits > $building->getTypeLevel(16)){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}else{
echo "<td>?</td>";
}
}
}
echo "</tr></tbody>";
echo '
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="10">
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>
</div>
</td>
</tr>
</tbody>";
echo "</table>";
}
}
}else if ($units[$y]['sort_type']==4){
if ($units[$y]['attack_type']==1){
+7 -7
View File
@@ -5,7 +5,7 @@
## GIT HUB REV ##
############################################################
$dataarray = explode(",",$message->readingNotice['data']);
if($dataarray[147]!='' or $dataarray!=0){$colspan="11";}else{$colspan="10";}
if($dataarray[151]!='' or $dataarray!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -39,7 +39,7 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
if ($dataarray[151]!="" or $dataarray[151]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
@@ -51,8 +51,8 @@ for($i=3;$i<=12;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
echo "<td>$dataarray[147]</td>";
if ($dataarray[151]!="" or $dataarray[151]!=0){
echo "<td>$dataarray[151]</td>";
}
echo "<tr><th>Casualties</th>";
for($i=13;$i<=22;$i++) {
@@ -63,9 +63,9 @@ for($i=13;$i<=22;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
if ($dataarray[151]!="" or $dataarray[151]!=0){
if ($dataarray[152]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[152]</td>";
}
echo "</tr></tbody>"; ?>
</td></tr></tbody></table>
+7 -7
View File
@@ -8,7 +8,7 @@ $topic = $database->getNotice2($_GET['id'], 'topic');
$time = $database->getNotice2($_GET['id'], 'time');
$data = $database->getNotice2($_GET['id'], 'data');
$dataarray = explode(",",$data);
if($dataarray[147]!='' or $dataarray!=0){$colspan="11";}else{$colspan="10";}
if($dataarray[151]!='' or $dataarray!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -42,7 +42,7 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
if ($dataarray[151]!="" or $dataarray[151]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
@@ -54,8 +54,8 @@ for($i=3;$i<=12;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
echo "<td>$dataarray[147]</td>";
if ($dataarray[151]!="" or $dataarray[151]!=0){
echo "<td>$dataarray[151]</td>";
}
echo "<tr><th>Casualties</th>";
for($i=13;$i<=22;$i++) {
@@ -66,9 +66,9 @@ for($i=13;$i<=22;$i++) {
echo "<td>".$dataarray[$i]."</td>";
}
}
if ($dataarray[147]!="" or $dataarray[147]!=0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
if ($dataarray[151]!="" or $dataarray[151]!=0){
if ($dataarray[152]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[152]</td>";
}
echo "</tr></tbody>"; ?>
</td></tr></tbody></table>
+5 -4
View File
@@ -1,5 +1,6 @@
<?php
$dataarray = explode(",",$message->readingNotice['data']);
if($dataarray[13]!='' or $dataarray!=0){$colspan="11";}else{$colspan="10";}
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
<thead>
@@ -21,7 +22,7 @@ $dataarray = explode(",",$message->readingNotice['data']);
<table cellpadding="1" cellspacing="1" id="reinforcement">
<thead><tr>
<td class="role">sender</td><td colspan="11"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[1],"id",0); ?>"><?php echo ($dataarray[1] == 0)? "taskmaster" : $database->getUserField($dataarray[1],"username",0); ?></a> from the village <?php echo ($dataarray[0] == 0)? "village of the elders" : "<a href='karte.php?d=".$dataarray[0]."&amp;c=".$generator->getMapCheck($dataarray[0])."'>".$database->getVillageField($dataarray[0],name)."</a>"; ?></td></tr></thead>
<td class="role">sender</td><td colspan="<?php echo $colspan; ?>"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[1],"id",0); ?>"><?php echo ($dataarray[1] == 0)? "taskmaster" : $database->getUserField($dataarray[1],"username",0); ?></a> from the village <?php echo ($dataarray[0] == 0)? "village of the elders" : "<a href='karte.php?d=".$dataarray[0]."&amp;c=".$generator->getMapCheck($dataarray[0])."'>".$database->getVillageField($dataarray[0],name)."</a>"; ?></td></tr></thead>
<tbody class="units"><tr>
<td>&nbsp;</td>
<?php
@@ -30,7 +31,9 @@ $start = ($tribe-1)*10+1;
for($i=$start;$i<=($start+9);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($dataarray[13]!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=3;$i<13;$i++) {
$unitarray['u'.($i-3+$start).''] = $dataarray[$i];
@@ -41,9 +44,7 @@ $unitarray['u'.($i-3+$start).''] = $dataarray[$i];
echo "<td>".$dataarray[$i]."</td>";
}
}
if($dataarray[13] == 0) {
echo "<td class=\"none\">0</td>";
} else {
if($dataarray[13] != 0) {
echo "<td>".$dataarray[13]."</td>";
$unitarray['hero'] = 1;
}