|
| Dzoki < dzoki.travian@gmail.com > |
| Reworked by: Esfomeado < vps1992@live.com.pt > |
| Copyright: TravianX Project All rights reserved |
\*-------------------------------------------------------*/
include_once("GameEngine/Data/hero_full.php");
global $database;
if (isset($_POST['name'])) {
$_POST['name'] = stripslashes($_POST['name']);
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($database->escape($_POST['name']))."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
echo "".NAME_CHANGED."";
}
$hero_info = $units->Hero($session->uid);
?>
".ERROR_NAME_SHORT."";
}
?>
3
% .
VillageOasisCount($village->wid); ?> .
escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
}
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
if($hero_info['points'] > 0) {
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $database->escape($session->uid) . "'");
header("Location: build.php?id=".$id."");
exit;
}
}
}
?>