Skip to main content
Deno 2 is finally here 🎉️
Learn more
method RepeatableQuestController.prototype.getClientRepeatableQuests
import { RepeatableQuestController } from "https://deno.land/x/sptaki@1.2.0/controllers/RepeatableQuestController.d.ts";

Handle client/repeatalbeQuests/activityPeriods Returns an array of objects in the format of repeatable quests to the client. repeatableQuestObject = { id: Unique Id, name: "Daily", endTime: the time when the quests expire activeQuests: currently available quests in an array. Each element of quest type format (see assets/database/templates/repeatableQuests.json). inactiveQuests: the quests which were previously active (required by client to fail them if they are not completed) }

The method checks if the player level requirement for repeatable quests (e.g. daily lvl5, weekly lvl15) is met and if the previously active quests are still valid. This ischecked by endTime persisted in profile accordning to the resetTime configured for each repeatable kind (daily, weekly) in QuestCondig.js

If the condition is met, new repeatableQuests are created, old quests (which are persisted in the profile.RepeatableQuests[i].activeQuests) are moved to profile.RepeatableQuests[i].inactiveQuests. This memory is required to get rid of old repeatable quest data in the profile, otherwise they'll litter the profile's Quests field. (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) The new quests generated are again persisted in profile.RepeatableQuests

Parameters

Request from client

sessionID: string

Player's session id

Returns

Array of "repeatableQuestObjects" as described above