mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-15 15:51:01 +00:00
Fix Bucket of Water & Wall View
Fix Bucket of Water & Wall View
This commit is contained in:
+54
-17
@@ -689,26 +689,63 @@ class HeroItems
|
|||||||
return self::USE_OK;
|
return self::USE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- Bucket of Water: instant free revive of the dead hero ---- */
|
/* ---- Bucket of Water: instant free revive of the dead hero ---- */
|
||||||
if (isset($bonus[HB_BUCKET])) {
|
if (isset($bonus[HB_BUCKET])) {
|
||||||
$stmt = $this->db->prepare(
|
// Luăm rândul eroului mort (avem nevoie de heroid + wref)
|
||||||
"UPDATE " . TB_PREFIX . "hero
|
$stmt = $this->db->prepare(
|
||||||
SET dead = 0, health = 100, inrevive = 0, lastupdate = ?
|
"SELECT heroid, wref FROM " . TB_PREFIX . "hero
|
||||||
WHERE uid = ? AND dead = 1 LIMIT 1"
|
WHERE uid = ? AND dead = 1 LIMIT 1"
|
||||||
);
|
);
|
||||||
$now = time();
|
$stmt->bind_param('i', $uid);
|
||||||
$stmt->bind_param('ii', $now, $uid);
|
$stmt->execute();
|
||||||
$stmt->execute();
|
$stmt->bind_result($heroid, $wref);
|
||||||
$revived = $stmt->affected_rows > 0;
|
$found = $stmt->fetch();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
|
|
||||||
if (!$revived) {
|
if (!$found) {
|
||||||
return self::USE_INVALID; // no dead hero to revive
|
return self::USE_INVALID; // no dead hero to revive
|
||||||
}
|
}
|
||||||
$this->removeItem($uid, $rowId, 1); // one bucket per revive
|
|
||||||
return self::USE_OK;
|
$heroid = (int) $heroid;
|
||||||
|
$wref = (int) $wref;
|
||||||
|
$now = time();
|
||||||
|
|
||||||
|
$this->db->begin_transaction();
|
||||||
|
try {
|
||||||
|
// 1. Marchează eroul ca viu
|
||||||
|
$stmt = $this->db->prepare(
|
||||||
|
"UPDATE " . TB_PREFIX . "hero
|
||||||
|
SET dead = 0, health = 100, inrevive = 0, lastupdate = ?
|
||||||
|
WHERE heroid = ? AND dead = 1 LIMIT 1"
|
||||||
|
);
|
||||||
|
$stmt->bind_param('ii', $now, $heroid);
|
||||||
|
$stmt->execute();
|
||||||
|
$revived = $stmt->affected_rows > 0;
|
||||||
|
$stmt->close();
|
||||||
|
|
||||||
|
if (!$revived) {
|
||||||
|
$this->db->rollback();
|
||||||
|
return self::USE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. Pune eroul înapoi în sat (units.hero = 1)
|
||||||
|
$stmt = $this->db->prepare(
|
||||||
|
"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ? LIMIT 1"
|
||||||
|
);
|
||||||
|
$stmt->bind_param('i', $wref);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->close();
|
||||||
|
|
||||||
|
$this->db->commit();
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
$this->db->rollback();
|
||||||
|
return self::USE_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->removeItem($uid, $rowId, 1); // one bucket per revive
|
||||||
|
return self::USE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---- Book of Wisdom: reset attribute points ---- */
|
/* ---- Book of Wisdom: reset attribute points ---- */
|
||||||
if (isset($bonus[HB_RESET])) {
|
if (isset($bonus[HB_RESET])) {
|
||||||
$hero = $this->getLivingHeroRow($uid);
|
$hero = $this->getLivingHeroRow($uid);
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
<h2><?php echo CITYWALL ?></h2>
|
<h2><?php echo CITYWALL ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
<tbody><tr>
|
||||||
<tbody><tr>
|
<td class="desc"><?php echo CITYWALL_DESC ?></td>
|
||||||
<td class="desc"><?php echo CITYWALL_DESC ?></td>
|
<td rowspan="3" class="bimg">
|
||||||
<td rowspan="3" class="bimg">
|
<a href="#" onClick="return Popup(31,4);">
|
||||||
</td>
|
<img class="building g31" src="img/x.gif" alt="<?php echo CITYWALL; ?>" title="<?php echo CITYWALL; ?>" /></a>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<?php
|
<tr>
|
||||||
|
<?php
|
||||||
$_GET['bid'] = 31;
|
$_GET['bid'] = 31;
|
||||||
include("availupgrade.tpl");
|
include("availupgrade.tpl");
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
<h2><?php echo EARTHWALL ?></h2>
|
<h2><?php echo EARTHWALL ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
<tbody><tr>
|
||||||
<tbody><tr>
|
<td class="desc"><?php echo EARTHWALL_DESC ?></td>
|
||||||
<td class="desc"><?php echo EARTHWALL_DESC ?></td>
|
<td rowspan="3" class="bimg">
|
||||||
<td rowspan="3" class="bimg">
|
<a href="#" onClick="return Popup(32,4);">
|
||||||
</td>
|
<img class="building g32" src="img/x.gif" alt="<?php echo EARTHWALL; ?>" title="<?php echo EARTHWALL; ?>" /></a>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<?php
|
<tr>
|
||||||
|
<?php
|
||||||
$_GET['bid'] = 32;
|
$_GET['bid'] = 32;
|
||||||
include("availupgrade.tpl");
|
include("availupgrade.tpl");
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
<h2><?php echo PALISADE ?></h2>
|
<h2><?php echo PALISADE ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
<table class="new_building" cellpadding="1" cellspacing="1">
|
<tbody><tr>
|
||||||
<tbody><tr>
|
<td class="desc"><?php echo PALISADE_DESC ?></td>
|
||||||
<td class="desc"><?php echo PALISADE_DESC ?></td>
|
<td rowspan="3" class="bimg">
|
||||||
<td rowspan="3" class="bimg">
|
<a href="#" onClick="return Popup(33,4);">
|
||||||
</td>
|
<img class="building g33" src="img/x.gif" alt="<?php echo PALISADE; ?>" title="<?php echo PALISADE; ?>" /></a>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<?php
|
<tr>
|
||||||
|
<?php
|
||||||
$_GET['bid'] = 33;
|
$_GET['bid'] = 33;
|
||||||
include("availupgrade.tpl");
|
include("availupgrade.tpl");
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<h2><?php echo CITYWALL ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
|
<tbody><tr>
|
||||||
|
<td class="desc"><?php echo CITYWALL_DESC ?></td>
|
||||||
|
<td rowspan="3" class="bimg">
|
||||||
|
<a href="#" onClick="return Popup(31,4);">
|
||||||
|
<img class="building g31" src="img/x.gif" alt="<?php echo CITYWALL ?>" title="<?php echo CITYWALL ?>" /></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="requ"><?php echo PREREQUISITES ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?php echo TRIBE1; ?>
|
||||||
|
</td>
|
||||||
|
</tr></tbody>
|
||||||
|
</table>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<h2><?php echo EARTHWALL ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
|
<tbody><tr>
|
||||||
|
<td class="desc"><?php echo EARTHWALL_DESC ?></td>
|
||||||
|
<td rowspan="3" class="bimg">
|
||||||
|
<a href="#" onClick="return Popup(32,4);">
|
||||||
|
<img class="building g32" src="img/x.gif" alt="<?php echo EARTHWALL ?>" title="<?php echo EARTHWALL ?>" /></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="requ"><?php echo PREREQUISITES ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?php echo TRIBE2; ?>
|
||||||
|
</td>
|
||||||
|
</tr></tbody>
|
||||||
|
</table>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<h2><?php echo PALISADE ?></h2>
|
||||||
|
<table class="new_building" cellpadding="1" cellspacing="1">
|
||||||
|
<tbody><tr>
|
||||||
|
<td class="desc"><?php echo PALISADE_DESC ?></td>
|
||||||
|
<td rowspan="3" class="bimg">
|
||||||
|
<a href="#" onClick="return Popup(33,4);">
|
||||||
|
<img class="building g33" src="img/x.gif" alt="<?php echo PALISADE ?>" title="<?php echo PALISADE ?>" /></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="requ"><?php echo PREREQUISITES ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?php echo TRIBE3; ?>
|
||||||
|
</td>
|
||||||
|
</tr></tbody>
|
||||||
|
</table>
|
||||||
Reference in New Issue
Block a user