Quests¶
Your active quests, the quest book and your daily quests, as client.state keeps them.
quests.models¶
Your quests as client.state keeps them: the active quests (qli), the quest book's main
quests, and the daily quests (dql).
The state has no game data, so a quest is its id (a QuestId or DailyQuestId) and the
progress the server sent; its conditions, rewards and texts are in the items' quests and
dailyactivities rows (GameData.record).
Classes:
| Name | Description |
|---|---|
Quest |
One of your active quests, or a time-limited campaign's quest. |
QuestBook |
The quest book's main quests, its chapters: those announced, running and finished. |
DailyQuest |
One of today's daily quests. |
DailyQuests |
Your daily quests: your daily quest level, today's quests and the reward thresholds. |
Quest
pydantic-model
¶
Bases: EmpireModel
One of your active quests, or a time-limited campaign's quest.
progress holds one counter per condition, in the order of the quest's conditions
in the items; the client keeps the counters as sent, the library reads them through int().
The client also counts a quest whose time has run out, and is not done, as failed.
Client: CastleQuestVO.fillFromParams (bundle line 52463), remainingSeconds and
isFailed (bundle lines 52592, 52583)
Fields:
-
quest_id(EnumOrInt['QuestId']) -
progress(tuple[int, ...]) -
end_time(float | None) -
completed(bool) -
failed(bool) -
locked(bool) -
campaign_quest_id(int) -
campaign_timestamp(int | None)
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)
end_time
pydantic-field
¶
end_time: float | None = None
Wire key RS
When the quest runs out, in time.monotonic() seconds; None without RS or for a negative one
campaign_quest_id
pydantic-field
¶
campaign_quest_id: int = 0
Wire key CQID
The quest's place in a campaign
campaign_timestamp
pydantic-field
¶
campaign_timestamp: int | None = None
Wire key ST
When a campaign quest opens, as sent; None without one
from_entry
classmethod
¶
A quest read from its entry.
S decides done or failed (1 or 0) and wins over QCS ("C" done, "F" failed,
"N" locked); without either the quest is neither.
QuestBook
pydantic-model
¶
Bases: EmpireModel
The quest book's main quests, its chapters: those announced, running and finished.
Client: CastleQuestBookMainQuestListVO.parseListsFromParamObject (bundle line 52419). An id is a
main quest's mainQuestID: the book and the main quest dialog load the same Quest_<id><status>
picture (bundle lines 52435, 93389)
Fields:
-
announced_quest_ids(tuple[EnumOrInt['MainQuest'], ...]) -
running_quest_ids(tuple[EnumOrInt['MainQuest'], ...]) -
finished_quest_ids(tuple[EnumOrInt['MainQuest'], ...])
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)
announced_quest_ids
pydantic-field
¶
Wire key ANN
The main quests announced
running_quest_ids
pydantic-field
¶
Wire key R
The main quests running
finished_quest_ids
pydantic-field
¶
Wire key D
The main quests finished
DailyQuest
pydantic-model
¶
Bases: EmpireModel
One of today's daily quests.
Client: DailyQuestVO.setProgress and setFinished (bundle lines 134132, 134135)
Fields:
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)
progress
pydantic-field
¶
Wire key P
Each condition's counter, read through int(); empty for a finished quest, whose counters are full
DailyQuests
pydantic-model
¶
Bases: EmpireModel
Your daily quests: your daily quest level, today's quests and the reward thresholds.
Client: CastleDailyQuestData.parse_DQL (bundle line 134062), parse_RDQ and parse_FDQ
(bundle lines 134063, 134070)
Fields:
-
level(int) -
quests(tuple[DailyQuest, ...]) -
threshold_rewards(tuple[tuple[Collectable, ...], ...])
model_config
class-attribute
¶
model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)
quests
pydantic-field
¶
quests: tuple[DailyQuest, ...] = ()
The finished (FDQ) and running (RDQ) quests, by quest id
threshold_rewards
pydantic-field
¶
threshold_rewards: tuple[tuple[Collectable, ...], ...] = ()
Wire key RS
Each reward threshold's rewards, in threshold order
from_section
classmethod
¶
from_section(section: dict[str, Any], previous: DailyQuests | None = None) -> DailyQuests
The daily quests a dql makes; a falsy RS keeps the thresholds of previous.
The client drops the ids its items lack; the library keeps every one.