import { RepeatableQuestController } from "https://deno.land/x/sptaki@1.2.0/controllers/RepeatableQuestController.d.ts";
Constructors
Properties
Methods
Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests where you have to e.g. kill scavs in same locations.
Return the locations this PMC is allowed to get daily quests for based on their level
Get the number of quests to generate - takes into account charisma state of player
Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
Return true if the given pmcLevel is allowed on the given location
Handle RepeatableQuestChange event
Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
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