Fix #145 (Characterprofile quest progression and accurate lvl 8 stats).

This commit is contained in:
Stefan Brannfjell 2014-08-31 11:35:03 +02:00
parent 889de64b5c
commit 574263f29d
2 changed files with 52 additions and 54 deletions

View File

@ -162,57 +162,55 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
</li> </li>
<!-- END DEATH LIST --> <!-- END DEATH LIST -->
<!-- QUEST PROGRESSION --> <!-- QUEST PROGRESSION -->
<?php <?php
$totalquests = 0; $totalquests = 0;
$completedquests = 0; $completedquests = 0;
$firstrun = 1; $firstrun = 1;
if ($config['TFSVersion'] == 'TFS_10' && $config['EnableQuests'] == true) if ($config['EnableQuests'] == true) {
{ $sqlquests = mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
$sqlquests = mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id"); foreach ($config['quests'] as $cquest) {
foreach ($config['quests'] as $cquest) $totalquests = $totalquests + 1;
{ foreach ($sqlquests as $dbquest) {
$totalquests = $totalquests + 1; if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
foreach ($sqlquests as $dbquest) $completedquests = $completedquests + 1;
{ }
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) }
{ if ($cquest[3] == 1) {
$completedquests = $completedquests + 1; if ($completedquests != 0) {
} if ($firstrun == 1) {
} ?>
if ($cquest[3] == 1) <li>
{ <b> Quest progression </b>
if ($completedquests != 0) <table id="characterprofileQuest" class="table table-striped table-hover">
{ <tr class="yellow">
if ($firstrun == 1) <th>Quest:</th>
{ <th>progression:</th>
echo '<li>'; </tr>
echo '<b> Quest progression </b>'; <?php
echo '<table id="characterprofileQuest" class="table table-striped table-hover">'; $firstrun = 0;
echo '<tr class="yellow">'; }
echo '<th>Quest:</th>'; $completed = $completedquests / $totalquests * 100;
echo '<th>progression:</th>'; ?>
echo '</tr>'; <tr>
$firstrun = 0; <td><?php echo $cquest[2]; ?></td>
} <td id="progress">
$completed = $completedquests / $totalquests * 100; <span id="percent"><?php echo round($completed); ?>%</span>
echo '<tr>'; <div id="bar" style="width: '.$completed.'%"></div>
echo '<td>'. $cquest[2] .'</td>'; </td>
echo '<td id="progress"><span id="percent">'.round($completed).'%</span><div id="bar" style="width: '.$completed.'%"></div></td>'; </tr>
echo '</tr>'; <?php
} }
$completedquests = 0; $completedquests = 0;
$totalquests = 0; $totalquests = 0;
} }
} }
} }
if ($firstrun == 0) if ($firstrun == 0) {
{ echo '</table></li>';
echo '</table>'; }
echo '</li>'; ?>
} <!-- END QUEST PROGRESSION -->
?>
<!-- END QUEST PROGRESSION -->
<!-- CHARACTER LIST --> <!-- CHARACTER LIST -->
<?php <?php
if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) { if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) {

View File

@ -55,7 +55,7 @@
$config['EnableQuests'] = false; $config['EnableQuests'] = false;
// array for filling questlog (Questid, max value, name, end of the quest fill 1 for the last part 0 for all others) // array for filling questlog (Questid, max value, name, end of the quest fill 1 for the last part 0 for all others)
$config['Quests'] = array( $config['quests'] = array(
array(1501,100,"Killing in the Name of",0), array(1501,100,"Killing in the Name of",0),
array(1502,150,"Killing in the Name of",0), array(1502,150,"Killing in the Name of",0),
array(65001,100,"Killing in the Name of",0), array(65001,100,"Killing in the Name of",0),
@ -232,8 +232,8 @@
$config['level'] = 8; $config['level'] = 8;
$config['health'] = 185; $config['health'] = 185;
$config['mana'] = 40; $config['mana'] = 35;
$config['cap'] = 435; $config['cap'] = 470;
$config['soul'] = 100; $config['soul'] = 100;
$config['maleOutfitId'] = 128; $config['maleOutfitId'] = 128;