mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 17:07:17 +00:00
fix problem with hero levels
This commit is contained in:
@@ -3849,10 +3849,15 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
|||||||
$database->modifyHero("lastupdate",time(),$hdata['heroid']);
|
$database->modifyHero("lastupdate",time(),$hdata['heroid']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while($hdata['experience'] > $hero_levels[$hdata['level']+1] && $hdata['level'] < 100){
|
$herolevel = $hdata['level'];
|
||||||
mysql_query("UPDATE " . TB_PREFIX ."hero SET level = level + 1 WHERE heroid = '".$hdata['heroid']."'");
|
for($i = $herolevel+1; $i < 100; $i++){
|
||||||
|
if($hdata['experience'] > $hero_levels[$i]){
|
||||||
|
mysql_query("UPDATE " . TB_PREFIX ."hero SET level = $i WHERE heroid = '".$hdata['heroid']."'");
|
||||||
|
if($i < 99){
|
||||||
mysql_query("UPDATE " . TB_PREFIX ."hero SET points = points + 5 WHERE heroid = '".$hdata['heroid']."'");
|
mysql_query("UPDATE " . TB_PREFIX ."hero SET points = points + 5 WHERE heroid = '".$hdata['heroid']."'");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$villunits = $database->getUnit($hdata['wref']);
|
$villunits = $database->getUnit($hdata['wref']);
|
||||||
if($villunits['hero'] == 0 && $hdata['trainingtime'] < time() && $hdata['inrevive'] == 1){
|
if($villunits['hero'] == 0 && $hdata['trainingtime'] < time() && $hdata['inrevive'] == 1){
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref']."");
|
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref']."");
|
||||||
|
|||||||
Reference in New Issue
Block a user