Skip to content

Commit 186198b

Browse files
committed
WeeklyQuests has a limit duh!
1 parent 52d57cb commit 186198b

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- Added an introduction message for first time users.
8+
- Added missing skinning trainer quest.
89

910
### Updated
1011

Data.lua

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -968,17 +968,20 @@ function Data:GetObjectiveProgress(character, objective)
968968
if objective.quests and Utils:TableCount(objective.quests) > 0 then
969969
character.completed = character.completed or {}
970970
-- Weekly Quests is just one quest id
971-
if objective.categoryID == Enum.WK_ObjectiveCategory.WeeklyQuest then
971+
if objective.limit and objective.limit > 0 then
972+
local isCompleted = 0
972973
Utils:TableForEach(objective.quests, function(questID)
973974
if character.completed[questID] then
974-
objectiveProgress.isCompleted = true
975-
objectiveProgress.pointsEarned = objectiveProgress.pointsEarned + objective.points
976-
objectiveProgress.questsCompleted = objectiveProgress.questsCompleted + 1
977-
return
975+
isCompleted = isCompleted + 1
978976
end
979977
end)
980-
objectiveProgress.pointsTotal = objectiveProgress.pointsTotal + objective.points
981-
objectiveProgress.questsTotal = objectiveProgress.questsTotal + 1
978+
if isCompleted >= objective.limit then
979+
objectiveProgress.isCompleted = true
980+
objectiveProgress.pointsEarned = objectiveProgress.pointsEarned + (objective.points * objective.limit)
981+
objectiveProgress.questsCompleted = objectiveProgress.questsCompleted + objective.limit
982+
end
983+
objectiveProgress.pointsTotal = objectiveProgress.pointsTotal + (objective.points * objective.limit)
984+
objectiveProgress.questsTotal = objectiveProgress.questsTotal + objective.limit
982985
else
983986
Utils:TableForEach(objective.quests, function(questID)
984987
if character.completed[questID] then

0 commit comments

Comments
 (0)