$db
$db : \nre\models\DatabaseDriver
Database connection
Model to interact with Achievements-tables.
getUnachievedOnlyOnceAchievementsForSeminary(integer $seminaryId) : array
Get all not yet achieved Achievements for a Seminary that can only be achieved once (only by one Character).
integer | $seminaryId | ID of Seminary |
Achievements data
getSeldomAchievements(integer $seminaryId, integer $count, boolean $alsoWithDeadline = true) : array
Get seldom Achievements.
integer | $seminaryId | ID of Seminary |
integer | $count | Number of Achievements to retrieve |
boolean | $alsoWithDeadline | Include Achievements with deadline (optional) |
List of seldom Achievements
getAchievedAchievementsForCharacter(integer $characterId, boolean $alsoWithDeadline = true) : array
Get all achieved Achievements for a Character.
integer | $characterId | ID of Character |
boolean | $alsoWithDeadline | Include Achievements with deadline (optional) |
Achievements data
getUnachhievedAchievementsForCharacter(integer $seminaryId, integer $characterId, boolean $includeOnlyOnce = false, boolean $alsoWithDeadline = true) : array
Get all not yet achieved Achievements for a Character.
integer | $seminaryId | ID of Seminary |
integer | $characterId | ID of Character |
boolean | $includeOnlyOnce | Include Achievements that can only be achieved by one Character |
boolean | $alsoWithDeadline | Include milestone Achievements |
Achievements data
getAchievementsCountForSeminary(integer $seminaryId, boolean $includeOnlyOnce = false, boolean $alsoWithDeadline = true) : integer
Get the amount of Achievement for a Seminary.
integer | $seminaryId | ID of Seminary |
boolean | $includeOnlyOnce | Include Achievements that can only be achieved by one Character |
boolean | $alsoWithDeadline | Include milestone Achievements |
Count of Achievements
checkAchievementConditionCharacter(string $field, integer $value, integer $characterId) : boolean
Check a Character condition.
string | $field | Field to check |
integer | $value | The value the field has to match |
integer | $characterId | ID of Character |
Result
getAchievementConditionCharacterProgress(string $field, integer $value, integer $characterId) : float
Get the progress for a Character condition.
string | $field | Field to check |
integer | $value | The value the field has to match |
integer | $characterId | ID of Character |
Percentage progress
addAchievementConditionCharacter(integer $userId, integer $achievementId, string $field, string $value)
Add a new Character condition.
integer | $userId | ID of creating user |
integer | $achievementId | ID of Achievement to add condition to |
string | $field | Field to match |
string | $value | Value to match |
checkAchievementConditionQuest(string $field, boolean $count, integer $value, integer $status, string $groupby, integer $questId, integer $characterId) : boolean
Check a Quest condition.
string | $field | Field to check |
boolean | $count | Conut field-value |
integer | $value | The value the field has to match |
integer | $status | Status of Quest or NULL |
string | $groupby | Field to group or NULL |
integer | $questId | ID of related Quest or NULL |
integer | $characterId | ID of Character |
Result
getAchievementConditionQuestProgress(string $field, boolean $count, integer $value, integer $status, string $groupby, integer $questId, integer $characterId) : float
Get the progress for a Quest condition.
string | $field | Field to check |
boolean | $count | Conut field-value |
integer | $value | The value the field has to match |
integer | $status | Status of Quest or NULL |
string | $groupby | Field to group or NULL |
integer | $questId | ID of related Quest or NULL |
integer | $characterId | ID of Character |
Percentage progress
addAchievementConditionQuest(integer $userId, integer $achievementId, string $field, boolean $count, string $value, integer $questId = null, integer $status = null, string $groupby = null)
Add a new Quest condition.
integer | $userId | ID of creating user |
integer | $achievementId | ID of Achievement to add condition to |
string | $field | Field to match |
boolean | $count | Count the value |
string | $value | Value to match |
integer | $questId | ID of Quest (optional) |
integer | $status | Quest status (optional) |
string | $groupby | Field to group by (optional) |
editAchievementConditionQuest(integer $conditionId, string $field, boolean $count, string $value, integer $questId = null, integer $status = null, string $groupby = null)
Edit a Quest condition.
integer | $conditionId | ID of condition to edit |
string | $field | Field to match |
boolean | $count | Count the value |
string | $value | Value to match |
integer | $questId | ID of Quest (optional) |
integer | $status | Quest status (optional) |
string | $groupby | Field to group by (optional) |
checkAchievementConditionAchievement(string $field, boolean $count, integer $value, string $groupby, integer $metaAchievementId, integer $characterId) : boolean
Check a Metaachievement condition.
string | $field | Field to check |
boolean | $count | Conut field-value |
integer | $value | The value the field has to match |
string | $groupby | Field to group or NULL |
integer | $metaAchievementId | ID of related Achievement or NULL |
integer | $characterId | ID of Character |
Result
getAchievementConditionAchievementProgress(string $field, boolean $count, integer $value, string $groupby, integer $metaAchievementId, integer $characterId) : float
Get the progress for a Metaachievement condition.
string | $field | Field to check |
boolean | $count | Conut field-value |
integer | $value | The value the field has to match |
string | $groupby | Field to group or NULL |
integer | $metaAchievementId | ID of related Achievement or NULL |
integer | $characterId | ID of Character |
Percentage progress
addAchievementConditionAchievement(integer $userId, integer $achievementId, string $field, boolean $count, string $value, integer $metaAchievementId = null, string $groupby = null)
Add a new Achievement condition.
integer | $userId | ID of creating user |
integer | $achievementId | ID of Achievement to add condition to |
string | $field | Field to match |
boolean | $count | Count the value |
string | $value | Value to match |
integer | $metaAchievementId | ID of Meta-Achievement (optional) |
string | $groupby | Field to group by (optional) |
editAchievementConditionAchievement(integer $conditionId, string $field, boolean $count, string $value, integer $metaAchievementId = null, string $groupby = null)
Edit a Achievement condition.
integer | $conditionId | ID of condition to edit |
string | $field | Field to match |
boolean | $count | Count the value |
string | $value | Value to match |
integer | $metaAchievementId | ID of Achievement (optional) |
string | $groupby | Field to group by (optional) |
hasCharacterAchievedAchievement(integer $achievementId, integer $characterId) : boolean
Check if a Character has achieved an Achievement.
integer | $achievementId | ID of Achievement |
integer | $characterId | ID of Character |
Whether Character has achieved the Achievement or not
achievementTitleExists(integer $seminaryId, string $title, $achievementId = null) : boolean
Check if an Achievement title already exists.
integer | $seminaryId | ID of Seminary |
string | $title | Achievement title to check |
$achievementId |
Whether Achievement title exists or not
createAchievement(integer $userId, integer $seminaryId, integer $conditionId, string $title, string $description, boolean $progress, boolean $hidden, boolean $onlyOnce, boolean $allConditions, string $deadline) : integer
Create a new Achievement for a Seminary.
integer | $userId | ID of creating user |
integer | $seminaryId | ID of Seminary |
integer | $conditionId | ID of Achievement condition |
string | $title | Title of new Achievement |
string | $description | Description of new Achievement |
boolean | $progress | Show progress |
boolean | $hidden | Secret Achievement |
boolean | $onlyOnce | Only achieveable by one user |
boolean | $allConditions | Achievement must match all conditions |
string | $deadline | Deadline for Achievement |
ID of newly created Achievement
editAchievement(integer $achievementId, integer $conditionId, string $title, string $description, boolean $progress, boolean $hidden, boolean $onlyOnce, boolean $allConditions, string $deadline)
Edit an Achievement of a Seminary.
integer | $achievementId | ID of Achievement to edit |
integer | $conditionId | ID of Achievement condition |
string | $title | New title of Achievement |
string | $description | New description of Achievement |
boolean | $progress | Show progress |
boolean | $hidden | Secret Achievement |
boolean | $onlyOnce | Only achieveable by one user |
boolean | $allConditions | Achievement must match all conditions |
string | $deadline | Deadline for Achievement |