Skip to content

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)

quest_id pydantic-field

quest_id: EnumOrInt['QuestId']

Wire key QID

The quest

progress pydantic-field

progress: tuple[int, ...] = ()

Wire key P

Each condition's counter

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

completed pydantic-field

completed: bool = False

Whether the quest is done, from S or QCS

failed pydantic-field

failed: bool = False

Whether the quest has failed, from S or QCS

locked pydantic-field

locked: bool = False

Whether the quest is not open yet, from QCS

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

from_entry(entry: dict[str, Any], now: float | None = None) -> Quest

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.

remaining_seconds

remaining_seconds(now: float | None = None) -> float | None

Seconds until the quest runs out, 0 once it has; None for a quest without a time limit.

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)

announced_quest_ids pydantic-field

announced_quest_ids: tuple[EnumOrInt['MainQuest'], ...] = ()

Wire key ANN

The main quests announced

running_quest_ids pydantic-field

running_quest_ids: tuple[EnumOrInt['MainQuest'], ...] = ()

Wire key R

The main quests running

finished_quest_ids pydantic-field

finished_quest_ids: tuple[EnumOrInt['MainQuest'], ...] = ()

Wire key D

The main quests finished

from_section classmethod

from_section(section: dict[str, Any]) -> QuestBook | None

The book a qli carries, or None when one of ANN, R and D is missing or no list.

The client then keeps its own.

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)

quest_id pydantic-field

quest_id: EnumOrInt['DailyQuestId']

Wire key QID

The daily quest

progress pydantic-field

progress: tuple[int, ...] = ()

Wire key P

Each condition's counter, read through int(); empty for a finished quest, whose counters are full

finished pydantic-field

finished: bool = False

Whether you finished it today (listed in FDQ)

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:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True)

level pydantic-field

level: int = 0

Wire key PQL

Your daily quest level

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.