Name:
HP:
MP:
Stärke:
Verteidigung:
Geschwindigkeit:
Glück
Ausdauer:
Technik:

Schaden:
Technik:

Schaden:
'; if($sieger == $char1_name){ $char1_status = 'Sieger'; $char2_status = 'Verlierer'; } else{ $char1_status = 'Verlierer'; $char2_status = 'Sieger'; } echo '' . ''. ''. ''. '' . ''; echo '' . '' . '' . '' . ''. ''; echo ''. ''. ''. ''. '' . ''; echo ''. ''. ''. ''. '' . ''; echo '
'.$char1_status.''.$char1_name.''.$char2_status.''.$char2_name.'
Exp +'.$exp_char1.'Exp +'.$exp_char2.'
Geld +'.$money_char1.'Geld +'.$money_char2.'
Arena Exp +'.$arena_exp1.'Arena Exp +'.$arena_exp2.'
'; } function displayFinalResult($items, $exp, $money, $final_result){ echo '
' . ''; echo ''; if($final_result == 'lost') { echo ''; } echo '' . '' . ''. ''; echo '' . '' . ''. ''; echo '' . '' . ''; echo '
Zusammenfassung
Ihr müsst euch selbst eingestehen, dass diese Monster zu stark waren. Der Zweifel der euch plagt verringert eure Erfahrung und Diebe den Betrag in eurem Geldbeutel.
Exp +'.$exp.'
Geld +'.$money.'
Items'; // Letze Eintrag von Items ist false!! if(!$items[0]){ echo ' '; } else{ for($i=0;$items[$i];$i++){ echo $items[$i]['name'].'
'; } } echo'
' . '
'; } function displaySchatzSuche($char){ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/schatz.inc.php'); // Erstmal die Schatzsuche-stammdaten laden! $sql = 'Select * from quests where charid ='.$char['id'].' and dauer < now()'; $quest = mysql_fetch_assoc(mysql_query($sql)); // echo $sql.'
'; if(!$quest){ return 'Schatzsuche noch nicht beendet!!'; } // Uberschreibe die Char-Daten mit den Daten aus der Datenbank $char['starke'] = $quest['st']; $char['verteidigung'] = $quest['ver']; $char['speed'] = $quest['sp']; $char['glueck'] = $quest['gl']; $char['ausdauer'] = $quest['aus']; $char['hp_max'] = $quest['hp']; $char['mp_max'] = $quest['mp']; // Erstmal die Seite starten echo ''; // Einfach mal ne dicke Ueberschrift $ort = mysql_fetch_assoc(mysql_query('select * from quest_ort where id = '.$quest['ortid'])); echo ''; // Hole die Ergebnisse die auch in die Datenbank eingetragen werden muessen! $row = mysql_fetch_assoc(mysql_query('Select sum(exp) as exp, sum(geld) as geld, count(*) as anzahl from quest_fights where charid = '.$char['id'])); // Ermittle den Endzustand des Chars $end_qf = mysql_fetch_assoc(mysql_query('select max(fightnr) as mf from quest_fights where charid = '.$char['id'])); $end_qr = mysql_fetch_assoc(mysql_query('select max(roundnr) as mr from quest_rounds where fightnr = '.$end_qf['mf'].' and charid = '.$char['id'])); $last_round = mysql_fetch_assoc(mysql_query('Select * from quest_rounds where roundnr = '.$end_qr['mr'].' and fightnr = '.$end_qf['mf'].' and charid = '.$char['id'])); $last_fight = mysql_fetch_assoc(mysql_query('Select * from quest_fights where fightnr = '.$end_qf['mf'].' and charid = '.$char['id'])); // Ermittle die Reqs des Chars! $sql = 'SELECT c_attack as a_name, count(*) as anzahl FROM quest_rounds q where roundnr > 0 and charid = '.$char['id'].' group by c_attack'; // echo $sql.'
'; $reqs = mysql_query($sql); while($row_r = mysql_fetch_assoc($reqs)){ $c_attacken[] = $row_r; // print_r($c_attacken); // echo '
'; } if($last_fight['sieger'] == $char['id']){ $final_result = 'won'; // Nur wer gewinnt bekommt was! $items = getSchatzItems($row['anzahl']); } else{ $final_result = 'lost'; $lose_rate = mt_rand(25,60)/100; $row['exp'] = round($row['exp'] * $lose_rate); $row['geld'] = round($row['geld'] * $lose_rate); for($i = 0;$i< count($row_r); $i++){ $c_attacken[$i]['anzahl'] = floor($c_attacken[$i]['anzahl'] * $lose_rate); } } // Zeige als erstes die Zusammenfassung an! displayFinalResult($items, $row['exp'], $row['geld'], $final_result); // Lade nun die Fights runter $sql = 'Select * from quest_fights where charid = '.$char['id']; $qry = mysql_query($sql); while($fight = mysql_fetch_assoc($qry)){ displaySchatzSucheFight($quest, $char, $fight); } submitCharChanges($char['id'], $items, $row['exp'], $row['geld'], $quest['ortid'], array($last_round['c_hp']) , array($last_round['c_mp']), $c_attacken); echo '
Schatzsuche in '.$ort['stadt'].'
'; return null; } function displaySchatzSucheFight($quest, $char, $fight){ // Lade das Monster aus der Datenbank $sql = 'select * from quest_monster where id = '.$fight['monsterid']; $monster = mysql_fetch_assoc(mysql_query($sql)); if($monster['bild'] == null || $monster['bild'] == ''){ $monster['bild'] = 'design/bilder/avatare/noavart.gif'; } // Platziere den Table-Header echo ''.$char['name'].' Vs '.$monster['name'].''; $sql = 'Select * from quest_rounds where charid = '.$char['id']. ' and fightnr = '.$fight['fightnr']; // echo $sql.'
'; $qry = mysql_query($sql); while($round = mysql_fetch_assoc($qry)){ displaySchatzSucheFightRound($char, $monster, $fight, $round); } displaySummary($char['name'], $monster['name'], $fight['sieger']==$char['id']?$char['name']:$monster['name'], $fight['exp'], 0, $fight['geld'], 0); // Und dann halt immer noch etwas platz nach unten lassen echo ' '; } function displaySchatzSucheFightRound($char, $monster, $fight, $round){ // Rundennummer: if($round['roundnr'] == 0){ $runde = 'Start:'; } else{ $runde = 'Runde: '.$round['roundnr']; } echo ''.$runde.''; // Bild + Avantarinfo | Attacken + Schaden | Bild + Avantarinfo // In einer Reihe allerdings echo ''; displayCharTable($char['bild'], $char['name'], $round['c_st'], $round['c_ver'], $round['c_sp'], $round['c_aus'], $round['c_gl'], $round['c_hp'], $char['hp_max'], $round['c_mp'], $char['mp_max'] ); echo ''; if($round['roundnr'] != 0){ displayAttacks($round['c_attack'], $round['c_dmg'], $round['m_attack'], $round['m_dmg']); } else{ echo ' '; } echo ''; displayCharTable($monster['bild'], $monster['name'], $round['m_st'], $round['m_ver'], $round['m_sp'], $round['m_aus'], $round['m_gl'], $round['m_hp'], $monster['hp'], $round['m_mp'], $monster['mp'] ); echo ''; } ?>