diff --git a/Admin/Templates/editHero.tpl b/Admin/Templates/editHero.tpl index 9b8f20c2..19220085 100644 --- a/Admin/Templates/editHero.tpl +++ b/Admin/Templates/editHero.tpl @@ -10,11 +10,18 @@ ################################################################################# if(isset($_GET['uid'])){ $id = (int) $_GET['uid']; + $hid = (int) $_GET['hid']; include_once("../GameEngine/Data/hero_full.php"); include_once("../GameEngine/Units.php"); - $result = mysqli_query($GLOBALS["link"], "SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id); - $hero_info = mysqli_fetch_array($result); - $hero = $units->Hero($id,1); + $heroes = $units->Hero($id,1); + + foreach ($heroes as $hdata) { + if ($hdata['heroid'] == $hid) { + $hero = $hdata; + break; + } + } + $unarray = array(1=>U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33,U34,U35,U36,U37,U38,U39,U40,U41,U42,U43,U44,U45,U46,U47,U48,U49,U50,U99,U0); $utribe=($user['tribe']-1)*10; ?> @@ -88,6 +95,7 @@ function check_unit(el) {
+ @@ -100,24 +108,24 @@ function check_unit(el) { - - + + - + - - + + - + @@ -141,7 +149,7 @@ function check_unit(el) { - + @@ -149,7 +157,7 @@ function check_unit(el) { - + @@ -157,37 +165,37 @@ function check_unit(el) { - + - - + + $count_level_exp) $hero_info['points']=$count_level_exp; - if($hero_info['experience'] < 495000){ ?> + $count_level_exp=500-intval($hero['attack']+$hero['defence']+$hero['attackbonus']+$hero['defencebonus']+$hero['regeneration']); + if ($hero['points']>$count_level_exp) $hero['points']=$count_level_exp; + if($hero['experience'] < 495000){ ?> - + - + - - + + diff --git a/Admin/Templates/playerheroinfo.tpl b/Admin/Templates/playerheroinfo.tpl index a4ecb41f..1d2251f6 100644 --- a/Admin/Templates/playerheroinfo.tpl +++ b/Admin/Templates/playerheroinfo.tpl @@ -11,14 +11,19 @@ include_once("../GameEngine/Data/hero_full.php"); include_once("../GameEngine/Units.php"); -$id=(int) $user['id']; -$hero = mysqli_query($GLOBALS["link"], "SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id); -$hero_info = mysqli_fetch_array($hero); -if (!empty($hero_info)) { - $hero = $units->Hero($id,1); -}else { -$hero="none"; -} +$id = (int) $_GET['uid']; +$hero = $units->Hero($id,1); + +// find a hero who's alive +$heroAliveIndex = -1; +if ($hero !== false) { + foreach ($hero as $hid => $h) { + if (!$h['dead']) { + $heroAliveIndex = $hid; + break; + } + } +} ?>
Edit Player Hero
Hero Name
Hero Level
0
Hero UnitgetUnitName($hero_info['unit'])."\" title=\"".$technology->getUnitName($hero_info['unit'])."\" /> (".$technology->getUnitName($hero_info['unit']); ?>)
getUnitName($hero_info['unit'])."\" title=\"".$technology->getUnitName($hero_info['unit'])."\" />";?>
getUnitName($hero['unit'])."\" title=\"".$technology->getUnitName($hero['unit'])."\" /> (".$technology->getUnitName($hero['unit']); ?>)
getUnitName($hero['unit'])."\" title=\"".$technology->getUnitName($hero['unit'])."\" />";?>
Offence (-) (+)
0
Defence (-) (+)
0
Off-Bonus % (-) (+)
0
Def-Bonus % (-) (+)
0
Regeneration/Day/Day (-) (+)
0
Experience% ( - )% ( + ) Experience100% ()100% ()
5
Health%%%%
')" />