only check last Quest(s) of a Questgroup for determining if Character has solved this Questgroup
This commit is contained in:
parent
e4a030ce1f
commit
eea8797bb1
2 changed files with 35 additions and 31 deletions
|
|
@ -137,6 +137,29 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Quests a Qusetgroup that do not have a following
|
||||
* Quest.
|
||||
*
|
||||
* @param int $questId ID of Questgroup
|
||||
* @return array List of last Quests
|
||||
*/
|
||||
public function getLastQuestsOfQuestgroup($questgroupId)
|
||||
{
|
||||
return $this->db->query(
|
||||
'SELECT id, questtype_id, title, url, xps, task '.
|
||||
'FROM quests '.
|
||||
'WHERE questgroup_id = ? AND NOT EXISTS ('.
|
||||
'SELECT quest_id '.
|
||||
'FROM quests_previousquests '.
|
||||
'WHERE quests_previousquests.previous_quest_id = quests.id'.
|
||||
')',
|
||||
'i',
|
||||
$questgroupId
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Quests that follow-up a Quest.
|
||||
*
|
||||
|
|
@ -243,6 +266,7 @@
|
|||
$characterId,
|
||||
self::QUEST_STATUS_ENTERED, self::QUEST_STATUS_SOLVED, self::QUEST_STATUS_UNSOLVED
|
||||
);
|
||||
//debug_print_backtrace();
|
||||
|
||||
|
||||
return (!empty($count) && intval($count[0]['c']) > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue