@ -14,33 +14,17 @@ function displayCharTable($charbild, $charname, $starke, $ver, $speed, $ausdauer
?>
?>
< table class = "stylish" >
< table class = "stylish" >
< tr >
< tr >
< td >
< td >< img src = " <?php echo $charbild ; ?> " width = "75" height = "75" ></ td >
< img src = " <?php echo $charbild ; ?> " width = "75" height = "75" >
< td class = "stats" > < span class = "stats" > Name:< / span > < span
< / td >
class="statvals"><?php echo $charname ; ?> </ span > < br > < span
< td class = "stats" >
class="stats">HP:</ span > < span class = "statvals" > <?php echo $hp_akt . ' / ' . $hp_max ; ?> </ span >
< span class = "stats" > Name:< / span >
< br > < span class = "stats" > MP:</ span > < span class = "statvals" > <?php echo $mp_akt . ' / ' . $mp_max ; ?> </ span >
< span class = "statvals" > <?php echo $charname ; ?> </ span >
< br > < span class = "stats" > Stä rke:</ span > < span class = "statvals" > <?php echo round ( $starke ); ?> </ span >
< br >
< br > < span class = "stats" > Verteidigung:</ span > < span class = "statvals" > <?php echo round ( $ver ); ?> </ span >
< span class = "stats" > HP:< / span >
< br > < span class = "stats" > Geschwindigkeit:< / span > < span
< span class = "statvals" > <?php echo $hp_akt . ' / ' . $hp_max ; ?> </ span >
class="statvals"><?php echo round ( $speed ); ?> </ span > < br > < span
< br >
class="stats">Glü ck</ span > < span class = "statvals" > <?php echo round ( $glueck ); ?> </ span >
< span class = "stats" > MP:< / span >
< br > < span class = "stats" > Ausdauer:</ span > < span class = "statvals" > <?php echo round ( $ausdauer ); ?> </ span >
< span class = "statvals" > <?php echo $mp_akt . ' / ' . $mp_max ; ?> </ span >
< br >
< span class = "stats" > Stä rke:< / span >
< span class = "statvals" > <?php echo round ( $starke ); ?> </ span >
< br >
< span class = "stats" > Verteidigung:< / span >
< span class = "statvals" > <?php echo round ( $ver ); ?> </ span >
< br >
< span class = "stats" > Geschwindigkeit:< / span >
< span class = "statvals" > <?php echo round ( $speed ); ?> </ span >
< br >
< span class = "stats" > Glü ck< / span >
< span class = "statvals" > <?php echo round ( $glueck ); ?> </ span >
< br >
< span class = "stats" > Ausdauer:< / span >
< span class = "statvals" > <?php echo round ( $ausdauer ); ?> </ span >
< / td >
< / td >
< / tr >
< / tr >
< / table >
< / table >
@ -51,33 +35,27 @@ function displayAttacks($attacke1, $schaden1, $attacke2, $schaden2){
?>
?>
< table border = "0" width = "100%" >
< table border = "0" width = "100%" >
< tr >
< tr >
< td width = "50%" >
< td width = "50%" > < span class = "stats" > Technik:< / span > < span
< span class = "stats" > Technik:< / span >
class="statvals"><?php
< span class = "statvals" > <?php
if(is_numeric($attacke1) || $attacke1 === NULL) {
if(is_numeric($attacke1) || $attacke1 === NULL) {
$atk = getAttack($attacke1);
$atk = getAttack($attacke1);
echo $atk['name'];
echo $atk['name'];
} else {
} else {
echo $attacke1;
echo $attacke1;
}
}
?>< / span >
?>< / span > < br >
< br > < br >
< br > < span class = "stats" > Schaden:</ span > < span class = "statvals" > <?php echo $schaden1 ; ?> </ span >
< span class = "stats" > Schaden:< / span >
< span class = "statvals" > <?php echo $schaden1 ; ?> </ span >
< / td >
< / td >
< td width = "50%" >
< td width = "50%" > < span class = "stats" > Technik:< / span > < span
< span class = "stats" > Technik:< / span >
class="statvals"><?php
< span class = "statvals" > <?php
if(is_numeric($attacke2)|| $attacke2 === NULL) {
if(is_numeric($attacke2)|| $attacke2 === NULL) {
$atk = getAttack($attacke2);
$atk = getAttack($attacke2);
echo $atk['name'];
echo $atk['name'];
} else {
} else {
echo $attacke2;
echo $attacke2;
}
}
?>< / span >
?>< / span > < br >
< br > < br >
< br > < span class = "stats" > Schaden:</ span > < span class = "statvals" > <?php echo $schaden2 ; ?> </ span >
< span class = "stats" > Schaden:< / span >
< span class = "statvals" > <?php echo $schaden2 ; ?> </ span >
< / td >
< / td >
< / tr >
< / tr >
< / table >
< / table >
@ -174,7 +152,7 @@ echo '</table>';
if($loge !== NULL || $steh !== NULL || $sitz !== NULL) {
if($loge !== NULL || $steh !== NULL || $sitz !== NULL) {
?>
?>
< table class = "stylish" width = "50%" " >
< table class = "stylish" width = "50%" " >
< tr >
< tr >
< td >
< td >
< table width = "100%" >
< table width = "100%" >
@ -197,8 +175,8 @@ echo '</table>';
< / table >
< / table >
< / td >
< / td >
< / tr >
< / tr >
< / table >
< / table >
<?php
<?php
echo '< / td > < / tr > ';
echo '< / td > < / tr > ';
}
}
@ -256,6 +234,8 @@ function displaySchatzSuche($char){
$char['hp_max'] = $quest['hp'];
$char['hp_max'] = $quest['hp'];
$char['mp_max'] = $quest['mp'];
$char['mp_max'] = $quest['mp'];
$std = $quest['std'];
// Erstmal die Seite starten
// Erstmal die Seite starten
echo '< html > < head > < link rel = "stylesheet" type = "text/css" href = "design/FightStyle.css" > < / head > < body > < table width = "100%" > ';
echo '< html > < head > < link rel = "stylesheet" type = "text/css" href = "design/FightStyle.css" > < / head > < body > < table width = "100%" > ';
// Einfach mal ne dicke Ueberschrift
// Einfach mal ne dicke Ueberschrift
@ -286,16 +266,28 @@ function displaySchatzSuche($char){
$final_result = 'won';
$final_result = 'won';
// Nur wer gewinnt bekommt was!
// Nur wer gewinnt bekommt was!
$items = getSchatzItems($row['anzahl']);
$items = getSchatzItems($row['anzahl']);
for($i=0;$items[$i];$i++){
$res = mysql_query('Update quest_item_stats set anzahl = anzahl + 1 WHERE monster = '.$row['anzahl'].' and id = '.$items[i]['id']);
if(mysql_affected_rows() == 0){
// entry not yet present
mysql_query('INSERT INTO quest_item_stats (monster, id, anzahl) values('.$row['anzahl'].', '.$items[i]['id'].', 1)');
}
}
} else{
} else{
$final_result = 'lost';
$final_result = 'lost';
$lose_rate = mt_rand(25,60)/100;
$lose_rate = mt_rand(25,60)/100;
$row['exp'] = round($row['exp'] * $lose_rate);
$row['exp'] = round($row['exp'] * $lose_rate);
$row['geld'] = round($row['geld'] * $lose_rate);
$row['geld'] = round ( $row ['geld'] * $lose_rate );
for($i = 0;$i< count ( $ row_r ) ; $ i + + ) {
for($i = 0;$i< count ( $ row_r ) ; $ i + + ) {
$c_attacken[$i]['anzahl'] = floor($c_attacken[$i]['anzahl'] * $lose_rate);
$c_attacken[$i]['anzahl'] = floor($c_attacken[$i]['anzahl'] * $lose_rate);
}
}
}
}
$res = mysql_query('Update quest_stats set anzahl = anzahl + 1 WHERE zeit = '.$std.' AND monster = '.$row['anzahl'].' AND status = '.($final_result=='won'?1:0));
if(mysql_affected_rows() == 0){
mysql_query('INSERT INTO quest_stats (monster, zeit, anzahl, status) values('.$row['anzahl'].', '.$std.', 1, '.($final_result=='won'?1:0).')');
}
// Zeige als erstes die Zusammenfassung an!
// Zeige als erstes die Zusammenfassung an!
displayFinalResult($items, $row['exp'], $row['geld'], $final_result);
displayFinalResult($items, $row['exp'], $row['geld'], $final_result);