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>
<!-- END DEATH LIST -->
<!-- QUEST PROGRESSION -->
<?php
$totalquests = 0;
$completedquests = 0;
$firstrun = 1;
if ($config['TFSVersion'] == 'TFS_10' && $config['EnableQuests'] == true)
{
<!-- QUEST PROGRESSION -->
<?php
$totalquests = 0;
$completedquests = 0;
$firstrun = 1;
if ($config['EnableQuests'] == true) {
$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)
{
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value'])
{
foreach ($sqlquests as $dbquest) {
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
$completedquests = $completedquests + 1;
}
}
if ($cquest[3] == 1)
{
if ($completedquests != 0)
{
if ($firstrun == 1)
{
echo '<li>';
echo '<b> Quest progression </b>';
echo '<table id="characterprofileQuest" class="table table-striped table-hover">';
echo '<tr class="yellow">';
echo '<th>Quest:</th>';
echo '<th>progression:</th>';
echo '</tr>';
if ($cquest[3] == 1) {
if ($completedquests != 0) {
if ($firstrun == 1) {
?>
<li>
<b> Quest progression </b>
<table id="characterprofileQuest" class="table table-striped table-hover">
<tr class="yellow">
<th>Quest:</th>
<th>progression:</th>
</tr>
<?php
$firstrun = 0;
}
$completed = $completedquests / $totalquests * 100;
echo '<tr>';
echo '<td>'. $cquest[2] .'</td>';
echo '<td id="progress"><span id="percent">'.round($completed).'%</span><div id="bar" style="width: '.$completed.'%"></div></td>';
echo '</tr>';
?>
<tr>
<td><?php echo $cquest[2]; ?></td>
<td id="progress">
<span id="percent"><?php echo round($completed); ?>%</span>
<div id="bar" style="width: '.$completed.'%"></div>
</td>
</tr>
<?php
}
$completedquests = 0;
$totalquests = 0;
}
}
}
if ($firstrun == 0)
{
echo '</table>';
echo '</li>';
}
?>
<!-- END QUEST PROGRESSION -->
}
if ($firstrun == 0) {
echo '</table></li>';
}
?>
<!-- END QUEST PROGRESSION -->
<!-- CHARACTER LIST -->
<?php
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;
// 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(1502,150,"Killing in the Name of",0),
array(65001,100,"Killing in the Name of",0),
@ -232,8 +232,8 @@
$config['level'] = 8;
$config['health'] = 185;
$config['mana'] = 40;
$config['cap'] = 435;
$config['mana'] = 35;
$config['cap'] = 470;
$config['soul'] = 100;
$config['maleOutfitId'] = 128;