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

@ -167,49 +167,47 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
$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; $totalquests = $totalquests + 1;
foreach ($sqlquests as $dbquest) foreach ($sqlquests as $dbquest) {
{ if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value'])
{
$completedquests = $completedquests + 1; $completedquests = $completedquests + 1;
} }
} }
if ($cquest[3] == 1) if ($cquest[3] == 1) {
{ if ($completedquests != 0) {
if ($completedquests != 0) if ($firstrun == 1) {
{ ?>
if ($firstrun == 1) <li>
{ <b> Quest progression </b>
echo '<li>'; <table id="characterprofileQuest" class="table table-striped table-hover">
echo '<b> Quest progression </b>'; <tr class="yellow">
echo '<table id="characterprofileQuest" class="table table-striped table-hover">'; <th>Quest:</th>
echo '<tr class="yellow">'; <th>progression:</th>
echo '<th>Quest:</th>'; </tr>
echo '<th>progression:</th>'; <?php
echo '</tr>';
$firstrun = 0; $firstrun = 0;
} }
$completed = $completedquests / $totalquests * 100; $completed = $completedquests / $totalquests * 100;
echo '<tr>'; ?>
echo '<td>'. $cquest[2] .'</td>'; <tr>
echo '<td id="progress"><span id="percent">'.round($completed).'%</span><div id="bar" style="width: '.$completed.'%"></div></td>'; <td><?php echo $cquest[2]; ?></td>
echo '</tr>'; <td id="progress">
<span id="percent"><?php echo round($completed); ?>%</span>
<div id="bar" style="width: '.$completed.'%"></div>
</td>
</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 -->

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;