Skip to content

Events

Active game events and their scoreboards behind client.events.

events.service

The running events, as the state keeps them, and their scoreboards.

Modules:

Name Description
base

What the events sections share: the check that an event runs.

campaign

The time-limited campaign: buying a quest or the end reward with rubies.

minigames

Event minigames.

scores

Event leagues, scores and scoreboards.

seasons

Season camps, the Samurai Invasion's daimyo and past special server runs.

special_servers

Beyond the Horizon, the Outer Realms, their charge camps and the Battle for Berimond.

tournament

The Grand Tournament, the Rift Raid and event announcements.

Classes:

Name Description
EventsService

The server's active events, your event leagues and the events' scoreboards.

EventsService

EventsService(client: 'EmpireClient')

Bases: SpecialServersMixin, SeasonsMixin, GrandTournamentMixin, MinigamesMixin, CampaignMixin, ScoresMixin, EventsBaseMixin, BaseService

The server's active events, your event leagues and the events' scoreboards.

Reached as client.events.

Methods:

Name Description
is_running

Whether an event runs and has not ended.

refresh

Ask the server for the running events and return them once its sei is applied.

get_horizon_rank

Request your alliance's current Beyond the Horizon rank (abgph).

get_horizon_timers

Request seconds until the next Beyond the Horizon tower relink and revival.

get_player_performance

Request a player's event points and performance counters (gpe).

get_outer_realms_ranks

Request your current Outer Realms daily and overall points/ranks.

select_special_server_castle

Pick the pre-built castle you enter the Outer Realms or Beyond the Horizon with (tsc).

get_outer_realms_collector_points

Request a player's collector points on the Outer Realms (tpc).

get_charge_camp_effects

Request the Outer Realms charge camp's effect and the one a reroll offered (gce).

reroll_charge_camp_effect

Reroll the Outer Realms charge camp's effect for rubies (ccr); get_charge_camp_effects

apply_charge_camp_effect

Take the rerolled effect in place of the Outer Realms charge camp's effect (ace).

get_berimond_targets

Request special camp candidate identifiers in Battle for Berimond.

get_berimond_balance

Request the red and blue faction player counts in Battle for Berimond.

get_berimond_points

Request the Gerbrandt and Ursidae points in Battle for Berimond.

join_berimond

Join Battle for Berimond with one of its prebuilt camps, e.g. PrebuiltCastle.BERIMOND_SIMPLE_CAMP.

join_season_camp

Enter a running season event's map at your camp there.

unlock_season_camp

Start on a season event's map with one of its prebuilt camps, e.g. PrebuiltCastle.UNDERWORLD_SIMPLE_CAMP.

open_season_map

Tell the server you opened a running season event's map, as the client does each time it shows it.

pay_toward_unlock

Pay towards something priced in parts: a season map's obstacle, a treasure map node or a slum level.

select_difficulty

Choose a running event's difficulty.

get_daimyo_areas

Request the samurai invasion's daimyo castles and townships; the running event keeps them too.

get_daimyo_contracts

Request your alliance's daimyo contracts; the running samurai invasion keeps them too.

get_daimyo_war_efforts

Request your war efforts against the daimyo; the running samurai invasion keeps them too.

get_previous_special_server_runs

Request when the Outer Realms and Beyond the Horizon last ran.

get_grand_tournament_status

Request alliance Grand Tournament quest slots and participating member count.

get_grand_tournament_contributions

Request player contributions for the current alliance Grand Tournament.

get_rift_raid_status

Request current alliance raid boss, health, cards and walls.

start_grand_tournament_quest

Accept a quest, consuming an event ticket. The server checks ticket balance and assignments.

complete_grand_tournament_quest

Collect the completed active quest. The server checks completion.

cancel_grand_tournament_quest

Cancel the active quest; its configured cancelCostC2 defaults to 199 rubies.

reroll_grand_tournament_quest

Reroll an unassigned quest; the client shows no currency charge.

skip_grand_tournament_cooldown

Skip a quest slot cooldown for 999 rubies.

select_raid_boss

Select an available raid boss and return the server acknowledgement.

abort_raid

Abort the active raid boss and return the server acknowledgement.

claim_announcement_reward

Claim the reward of the running event announcement, the teaser for an event to come; the

spin_wheel_of_fortune

Spin a Wheel of Fortune, paid with Wheel of Fortune tickets or a free spin; the wheel's event is updated.

change_wheel_of_fortune_mode

Switch the Wheel of Fortune between normal and pro mode; the client offers it to paying players only.

buy_wheel_of_fortune_jackpot

Spin the Wheel of Fortune for a guaranteed jackpot, paid in rubies and tickets by the wheel's mode.

increase_wheel_of_fortune_win_class

Raise the Wheel of Fortune's win class at once, paid in rubies for the spins it skips.

pull_gacha

Pull a gacha event's chest pulls times; the event's points and free chest are updated.

donate_to_colossus

Donate wood and stone from one of your castles to the running colossus.

donate_to_gold_colossus

Donate coins to the running coin colossus.

get_imperial_patronage_progress

Ask for the points each imperial patronage item has earned you; kept as donated_points.

donate_items

Give imperial patronage items, by donation item id and amount; returns the points each has earned.

give_marauder_packages

Hand resource packages from one of your castles to the marauders' contest, then read your points as the

buy_artifact_pieces

Buy pieces of a running Traveling Knights event's artifact with rubies; the event's parts_found is updated.

validate_shady_lady_target

Have the server check your Shady Lady target, as the event's dialog does when it opens; a new target

skip_shady_lady_target

Skip your Shady Lady target for another, paid in rubies; the event's new target comes with the reply.

buy_fortune_teller_reading

Buy today's next fortune teller reading and return its reward.

vote_world_cup

Bet on the world cup match; no rubies are spent, the bet opens once you spent its price in the event.

get_collector_currency

Ask how much of the collector event's currency a player holds, as the attack dialog shows it.

buy_campaign_quest

Buy a quest of the running time-limited campaign done, with rubies; see "Spending rubies" in the guides.

buy_campaign_reward

Buy the running time-limited campaign's end reward, with rubies; see "Spending rubies" in the guides.

league_id

The league your score is in for a running event, the LID of its sei entry; nothing is sent.

scoreboard

The boards an event's dialogs open.

get_scores

Get a page of a running event's scoreboard, the board its dialog opens.

get_own_points

Ask the server for your rank and points in a running event.

get_active_events

The running events with their in-game titles, in the order they started.

Attributes:

Name Type Description
shutting_down ShuttingDownEvents | None

The events shutting down, whose buildings stay in your castles, from the last sde; None until one

running dict[int, SpecialEvent]

The running events by id, in the order they started; a copy.

current_server CurrentServer | None

The kind of server this session is on, from the last tse push; None until one arrived.

special_server_castles SpecialServerCastles | None

Your castles on the special servers, from the last tcc push; None until one arrived.

berimond_kingdom_status BerimondKingdomStatus | None

Battle for Berimond's last kingdom status; None while it is not running or none has come.

donated_points tuple[DonationItemPoints, ...] | None

The points each imperial patronage item has earned you, from the last gdti or ddi; None before

running_score_events list[Event]

The running events that have a scoreboard, in the order they started; nothing is sent.

shutting_down property

shutting_down: ShuttingDownEvents | None

The events shutting down, whose buildings stay in your castles, from the last sde; None until one arrived.

running property

running: dict[int, SpecialEvent]

The running events by id, in the order they started; a copy.

current_server property

current_server: CurrentServer | None

The kind of server this session is on, from the last tse push; None until one arrived.

special_server_castles property

special_server_castles: SpecialServerCastles | None

Your castles on the special servers, from the last tcc push; None until one arrived.

berimond_kingdom_status property

berimond_kingdom_status: BerimondKingdomStatus | None

Battle for Berimond's last kingdom status; None while it is not running or none has come.

donated_points property

donated_points: tuple[DonationItemPoints, ...] | None

The points each imperial patronage item has earned you, from the last gdti or ddi; None before one or while the event is not running.

running_score_events property

running_score_events: list[Event]

The running events that have a scoreboard, in the order they started; nothing is sent.

is_running

is_running(event: Event | int) -> bool

Whether an event runs and has not ended.

refresh

refresh(*, timeout: float = 5.0) -> dict[int, SpecialEvent]

Ask the server for the running events and return them once its sei is applied.

The server's answer updates the events as any sei does; events it does not name keep running until a see or their time ends them. It asks for the sei events only: the trigger events (the Kingdom's League, the global effects) come with the login data's tei and the tei pushes.

Raises:

Type Description
CommandError

The server refused the request

EmpireTimeoutError

No sei within timeout

Client: C2SSpecialEventInfoVO (bundle line 37406)

get_horizon_rank

get_horizon_rank(alliance_id: int, *, timeout: float = 5.0) -> GetHorizonRankResponse

Request your alliance's current Beyond the Horizon rank (abgph).

Requires a running Beyond the Horizon event. Supply your alliance on the event server. Client: CastleAllianceBattleGroundEventDialogScoring.show (bundle 71907).

get_horizon_timers

get_horizon_timers(*, timeout: float = 5.0) -> GetHorizonTimersResponse

Request seconds until the next Beyond the Horizon tower relink and revival.

The event must run; the server refuses unavailable server context. Timers are a reply snapshot. Client: C2SAllianceBattleGroundGetTimersVO (bundle 54330), parseTRT (144811).

get_player_performance

get_player_performance(event: Event | int, player_id: int, *, timeout: float = 5.0) -> GetPlayerPerformanceResponse

Request a player's event points and performance counters (gpe).

Requires the event to run. Replies contain no player/event identity; requests for gpe are serialized, but a late reply after a timeout cannot be distinguished from the next request. Client: C2SGetPlayerPerformanceVO (bundle 34268-34272), GPECommand (127239-127248).

get_outer_realms_ranks

get_outer_realms_ranks(*, timeout: float = 5.0) -> GetOuterRealmsRanksResponse

Request your current Outer Realms daily and overall points/ranks.

Requires a running Outer Realms event; unavailable server context raises CommandError. Board pages use ranking.get_highscore; tsh has no pagination or previous-run selector. Client: TempServerEventVO.parseOwnRanks (bundle 118163).

select_special_server_castle

select_special_server_castle(castle: PrebuiltCastle, server_type: ServerType, *, ruby_price: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> None

Pick the pre-built castle you enter the Outer Realms or Beyond the Horizon with (tsc).

Sent on the main server while the server's event runs. Then enter the server with client.connect_to_special_server(server_type), as the client connects once the pick is accepted.

The server's castle selection prices the castle; one that costs rubies is bought at that price and needs spend_rubies. As in the client, a castle that costs nothing goes as bought with rubies, at 0 of them.

Parameters:

Name Type Description Default
castle PrebuiltCastle

The pre-built castle, one of the server's castle selection

required
server_type ServerType

ServerType.OUTER_REALMS or ServerType.HORIZON

required
ruby_price bool

Buy the castle at its ruby price; it is anyway when the selection prices it in rubies

False
spend_rubies bool

Allow spending the rubies the castle costs

False
timeout float

Timeout in seconds

5.0

Raises:

Type Description
ValueError

server_type is the normal server, the server offers no such castle, it has no ruby price for ruby_price, or it costs rubies without spend_rubies

GameDataNotLoadedError

The game data cannot be loaded

EventNotRunningError

The server's event is not running

CommandError

The server refused the pick

Client: CastleSpecialServerPreBuildCastleSelectionDialog.onConfirmed (bundle lines 27953-27955), TSCCommand.executeCommand (bundle line 128531)

get_outer_realms_collector_points

get_outer_realms_collector_points(player_id: int, *, timeout: float = 5.0) -> int

Request a player's collector points on the Outer Realms (tpc).

Client: CastleCollectorEventData.getTempserverCollectorAmount (bundle line 134001), TPCCommand.executeCommand (bundle line 128516)

get_charge_camp_effects

get_charge_camp_effects(x: int, y: int, *, timeout: float = 5.0) -> ChargeCampEffects

Request the Outer Realms charge camp's effect and the one a reroll offered (gce).

Client: CastleTempServerEffectRerollDialog.showLoaded (bundle line 140279), GCECommand.executeCommand (bundle line 128501)

reroll_charge_camp_effect

reroll_charge_camp_effect(x: int, y: int, *, spend_rubies: bool = False, timeout: float = 5.0) -> None

Reroll the Outer Realms charge camp's effect for rubies (ccr); get_charge_camp_effects then shows the offered effect, and apply_charge_camp_effect takes it.

Raises:

Type Description
ValueError

spend_rubies is False; a reroll always costs rubies

CommandError

The server refused the reroll

Client: CastleTempServerEffectRerollDialog.onClick (bundle line 140282), which shows the reroll's c2Cost (bundle line 140279); CCRCommand.executeCommand (bundle line 128488)

apply_charge_camp_effect

apply_charge_camp_effect(x: int, y: int, *, timeout: float = 5.0) -> None

Take the rerolled effect in place of the Outer Realms charge camp's effect (ace).

Client: CastleTempServerEffectRerollDialog.onClick (bundle line 140284), ACECommand.executeCommand (bundle line 128475)

get_berimond_targets

get_berimond_targets(*, timeout: float = 5.0) -> tuple[BerimondTarget, ...]

Request special camp candidate identifiers in Battle for Berimond.

Requires the running event. Ids refer to special camps, not map area ids; request map and attack details separately for a target's coordinates and eligibility. Client: FactionCapitalMapobjectVO.parseAreaInfo / FactionTowerMapobjectVO.parseAreaInfo (bundle 22772-22773, 22818-22819), AFDCommand (127742-127743).

get_berimond_balance

get_berimond_balance(*, timeout: float = 5.0) -> BerimondBalance

Request the red and blue faction player counts in Battle for Berimond.

Requires the running event. This read does not require choosing or joining a faction. Client: CastleDecoShopPanel.show (bundle 9302), FGBCommand (127789-127791).

get_berimond_points

get_berimond_points(*, timeout: float = 5.0) -> BerimondPoints

Request the Gerbrandt and Ursidae points in Battle for Berimond.

Requires the running event. Client: C2SGetFactionPointsVO (bundle 66177), GFPCommand (127917).

join_berimond

join_berimond(camp: PrebuiltCastle, *, spend_rubies: bool = False, timeout: float = 5.0) -> None

Join Battle for Berimond with one of its prebuilt camps, e.g. PrebuiltCastle.BERIMOND_SIMPLE_CAMP.

A camp whose only price is rubies is bought with them and needs spend_rubies; any other is bought with its resources, the client's join offering no ruby price for it, and there spend_rubies pays the missing resources with rubies.

Raises:

Type Description
EventNotRunningError

Battle for Berimond is not running

ValueError

The camp is not Berimond's, needs a higher level, or costs rubies without spend_rubies

GameDataNotLoadedError

The game data cannot be loaded

StateNotLoadedError

No login has brought your level

CommandError

The server refused, e.g. FACTION_LAST_MAN_STANDING_ACTIVE

Client: FactionEventJoinSublayer.buyCamp (bundle 95197) sends OC2 for a camp that PrebuiltCastleItemVO.isPremium (142354); CastleResourceWaitDialogProperties.getResourceSkipCommand (35237) sends PWR; FSCCommand (127885).

join_season_camp

join_season_camp(event: Event, *, timeout: float = 5.0) -> None

Enter a running season event's map at your camp there.

Raises:

Type Description
EventNotRunningError

The event is not running

ValueError

It is no season event, or names no map

CommandError

The server refused

Client: SeasonCampPanelButton.onButtonClicked (bundle line 108195) sends C2SJoinCampVO with the running season event's map; JEACommand (bundle line 131625).

unlock_season_camp

unlock_season_camp(camp: PrebuiltCastle, *, ruby_price: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> None

Start on a season event's map with one of its prebuilt camps, e.g. PrebuiltCastle.UNDERWORLD_SIMPLE_CAMP.

The camp names the map: the first of its spaces. A camp whose only price is rubies is bought with them; one priced in resources is bought with those, or with ruby_price at its ruby price, as the client's two buttons offer. Rubies spent need spend_rubies; buying with resources, spend_rubies pays any missing ones with rubies.

Raises:

Type Description
ValueError

The camp starts a kingdom, not a season event's map, needs a higher level, has no ruby price for ruby_price, or costs rubies without spend_rubies

GameDataNotLoadedError

The game data cannot be loaded

StateNotLoadedError

No login has brought your level

CommandError

The server refused

Client: AUnlockPrebuiltCastle.buyPrebuiltCastle (bundle line 55482) sends csc for a castle with no space in WorldConst.WORLD_IDS; UnlockPrebuiltCastleForRubies (bundle line 55514) sets OC2 for the castle CastleKingdomCastleDetails.getSublayerForCastle (bundle line 97911) shows as premium; CastleResourceWaitDialogProperties.getResourceSkipCommand (bundle line 35238) sends PWR; CSCCommand (bundle line 128343).

open_season_map

open_season_map(event: Event) -> None

Tell the server you opened a running season event's map, as the client does each time it shows it.

The client reads no answer, so none is waited for.

Raises:

Type Description
EventNotRunningError

The event is not running

ValueError

It is no season event, or names no map

Client: CastleSeasonMapScreen.show (bundle line 108619) sends C2SSeasonJoinEventVO with the map

pay_toward_unlock

pay_toward_unlock(part_price_id: PartPayPriceId, *, wood: int = 0, stone: int = 0, coins: int = 0, castle_id: int = -1, kingdom: Kingdom = GREEN, ruby_payment: Literal['wood', 'stone', 'coins'] | None = None, spend_rubies: bool = False, timeout: float = 5.0) -> None

Pay towards something priced in parts: a season map's obstacle, a treasure map node or a slum level.

part_price_id is the price's row in GameData.part_pay_prices, which the obstacle, node (TreasureMapNodeDef.part_price_id) or slum level names. Goods come from castle_id in kingdom: the client pays a slum level from the joined castle, a treasure hunt node from your main castle in the hunt's kingdom, and a season obstacle from no castle (-1) in the green kingdom. ruby_payment instead pays that resource's missing amount in rubies, and needs spend_rubies.

Raises:

Type Description
ValueError

ruby_payment without spend_rubies, or with goods; no goods and no ruby_payment

CommandError

The server refused; the client shows nothing for ALREADY_UNLOCKED and NO_EVENT

Client: CastleSlumDonateDialog.onClick (bundle line 87707), CastleTreasureMapDonateDialog.onClick (bundle line 67887), CastleSeasonBaseRepairDialog.onClick (bundle line 37624), CastleTreasureMapUnlockObstacleDialog.onClick (bundle line 67849), ULECommand.executeCommand (bundle line 129307)

select_difficulty

select_difficulty(event: Event | int, difficulty_id: EventDifficultyId, *, unlock_with_rubies: bool = False, spend_rubies: bool = False, timeout: float = 5.0) -> None

Choose a running event's difficulty.

difficulty_id is the difficulty's row in GameData.event_difficulties, or 0 for the event without difficulty scaling. A locked difficulty is opened with unlock_with_rubies for its ruby price, which needs spend_rubies. The event's difficulty_id changes with its next update.

Raises:

Type Description
EventNotRunningError

The event is not running

ValueError

unlock_with_rubies without spend_rubies

CommandError

The server refused

Client: EventDifficultyConfirmDialog.onClick (bundle line 98770), EventDifficultyConfirmRewardsDialog.onClick (bundle line 98787), DifficultyScalingSelectDialog.onClick (bundle line 30389), SEDECommand.executeCommand (bundle line 128462)

get_daimyo_areas

get_daimyo_areas(*, timeout: float = 5.0) -> DaimyoAreasResponse

Request the samurai invasion's daimyo castles and townships; the running event keeps them too.

Raises:

Type Description
EventNotRunningError

The samurai invasion is not running

CommandError

The server refused

Client: CastleAllianceSamuraiInvasionDialogDaimyoSublayer.show (bundle line 99060), GDACommand.executeCommand (bundle line 128283)

get_daimyo_contracts

get_daimyo_contracts(*, timeout: float = 5.0) -> DaimyoContractsResponse

Request your alliance's daimyo contracts; the running samurai invasion keeps them too.

Raises:

Type Description
EventNotRunningError

The samurai invasion is not running

CommandError

The server refused

Client: CastleAllianceSamuraiInvasionDialogDaimyoSublayer.show (bundle line 99060), GDCCommand.executeCommand (bundle line 128298)

get_daimyo_war_efforts

get_daimyo_war_efforts(*, timeout: float = 5.0) -> DaimyoWarEffortsResponse

Request your war efforts against the daimyo; the running samurai invasion keeps them too.

Raises:

Type Description
EventNotRunningError

The samurai invasion is not running

CommandError

The server refused

Client: CastleAllianceSamuraiInvasionDialogDaimyoSublayer.show (bundle line 99060), GDWCommand.executeCommand (bundle line 128313)

get_previous_special_server_runs

get_previous_special_server_runs(*, timeout: float = 5.0) -> PreviousSpecialServerRuns

Request when the Outer Realms and Beyond the Horizon last ran.

Client: CastleHighscoreDialog.getGlobalServerInfo (bundle line 27707), GPRCommand.executeCommand (bundle line 128892)

get_grand_tournament_status

get_grand_tournament_status(*, timeout: float = 5.0) -> GrandTournamentQuestStatus

Request alliance Grand Tournament quest slots and participating member count.

Requires the running Grand Tournament event. Successful replies also update its quest_status. Client: AllianceMobilizationEventEventVO.requestAllianceQuestStatus (bundle 5117).

get_grand_tournament_contributions

get_grand_tournament_contributions(*, timeout: float = 5.0) -> tuple[GrandTournamentContribution, ...]

Request player contributions for the current alliance Grand Tournament.

The response carries no event identity; a late reply after timeout cannot be identified. Client: AllianceMobilizationEventDialogContributions.show (bundle 47205), AQPCCommand (127404).

get_rift_raid_status

get_rift_raid_status(*, timeout: float = 5.0) -> RiftRaidStatus

Request current alliance raid boss, health, cards and walls.

Requires the raid event. Successful replies and bbs broadcasts update RiftRaidEvent.boss_status. An inactive status clears the active boss fields; missing identity/stage/walls preserve prior values exactly where the client does. Replies carry no event or alliance identity, so a late reply after timeout cannot be correlated. Refusals/transport failures raise without changing the event. Client: C2SGetAllianceRaidBossStatus (bundle 47183-47187), raid parser (76190-76205).

start_grand_tournament_quest

start_grand_tournament_quest(slot_id: int, alliance_quest_id: int, *, timeout: float = 5.0) -> StartGrandTournamentQuestResponse

Accept a quest, consuming an event ticket. The server checks ticket balance and assignments.

Client: C2S quest action and dialog (bundle 75732-75735, 75830-75833). Returns the exact nested slot update; participant counts remain unchanged.

complete_grand_tournament_quest

complete_grand_tournament_quest(*, timeout: float = 5.0) -> CompleteGrandTournamentQuestResponse

Collect the completed active quest. The server checks completion.

Client: C2S quest action and dialog (bundle 75705-75708, 75779). Returns the exact nested slot update; participant counts remain unchanged.

cancel_grand_tournament_quest

cancel_grand_tournament_quest(*, spend_rubies: bool = False, timeout: float = 5.0) -> CancelGrandTournamentQuestResponse

Cancel the active quest; its configured cancelCostC2 defaults to 199 rubies.

Client: C2S quest action and dialog (bundle 75696-75699, 75826-75827, 111069). Returns the exact nested slot update; participant counts remain unchanged.

reroll_grand_tournament_quest

reroll_grand_tournament_quest(slot_id: int, alliance_quest_id: int, *, timeout: float = 5.0) -> RerollGrandTournamentQuestResponse

Reroll an unassigned quest; the client shows no currency charge.

Client: C2S quest action and dialog (bundle 75714-75717, 75855). Returns the exact nested slot update; participant counts remain unchanged.

skip_grand_tournament_cooldown

skip_grand_tournament_cooldown(slot_id: int, alliance_quest_id: int, *, spend_rubies: bool = False, timeout: float = 5.0) -> SkipGrandTournamentCooldownResponse

Skip a quest slot cooldown for 999 rubies.

Client: C2S quest action and dialog (bundle 75723-75726, 34974). Returns the exact nested slot update; participant counts remain unchanged.

select_raid_boss

select_raid_boss(boss_id: RaidBoss | int, *, timeout: float = 5.0) -> SelectRaidBossResponse

Select an available raid boss and return the server acknowledgement.

The server checks leader/co-leader permission. Known cards must be available; a newer boss id is supported. No ruby payment is shown by the client. Status is updated by bbs broadcasts; call get_rift_raid_status for a fresh snapshot. Client: AllianceRaidBossCardItem.onClick (current bundle 75377), canManageAllianceRaid (current DLL 18796), SRBCommand (bundle 127571-127580).

abort_raid

abort_raid(*, timeout: float = 5.0) -> AbortRaidResponse

Abort the active raid boss and return the server acknowledgement.

Requires leader/co-leader permission; the server checks it. A known inactive raid or last playable boss cannot be aborted. No ruby payment is shown by the client. This acknowledgement does not clear the boss; bbs supplies the resulting status. Client: AllianceRaidBossCardItem.handleAbort, updateAbortButton (current bundle 75351-75365), isLastPlayableBoss (76260-76263), ARBCommand (127528-127537).

claim_announcement_reward

claim_announcement_reward(*, timeout: float = 5.0) -> None

Claim the reward of the running event announcement, the teaser for an event to come; the announcement's reward_collected turns True in running.

Client: CastleEventTeaserDialog.claimRewards (bundle line 91443), CARCommand.executeCommand (bundle line 125277)

Raises:

Type Description
CommandError

The server refused the claim

EmpireTimeoutError / ConnectionClosedError

see EmpireClient.send

spin_wheel_of_fortune

spin_wheel_of_fortune(wheel: WheelOfFortuneType = WHEEL_OF_FORTUNE, *, timeout: float = 5.0) -> WheelOfFortuneSpinResponse

Spin a Wheel of Fortune, paid with Wheel of Fortune tickets or a free spin; the wheel's event is updated.

Raises:

Type Description
EventNotRunningError

The wheel's event is not running

CommandError

The server refused, e.g. without tickets

Client: C2SLuckyWheelSpinVO (bundle line 59783), LWSCommand.executeCommand (bundle line 128141)

change_wheel_of_fortune_mode

change_wheel_of_fortune_mode(*, timeout: float = 5.0) -> WheelOfFortuneChangeModeResponse

Switch the Wheel of Fortune between normal and pro mode; the client offers it to paying players only.

Client: CastleLuckyWheelDialog.changeMode (bundle line 116666), LWMCommand.executeCommand (bundle line 128122)

buy_wheel_of_fortune_jackpot

buy_wheel_of_fortune_jackpot(*, spend_rubies: bool = False, timeout: float = 5.0) -> WheelOfFortuneBuyJackpotResponse

Spin the Wheel of Fortune for a guaranteed jackpot, paid in rubies and tickets by the wheel's mode.

Raises:

Type Description
ValueError

Without spend_rubies

EventNotRunningError

The Wheel of Fortune is not running

Client: CastleLuckyWheelDialog.clickedBuyJackpot (bundle line 116659), LuckyWheelData.jackpotC2Price (bundle line 17639), LWJCommand.executeCommand (bundle line 128105)

increase_wheel_of_fortune_win_class

increase_wheel_of_fortune_win_class(*, spend_rubies: bool = False, timeout: float = 5.0) -> WheelOfFortuneIncreaseWinClassResponse

Raise the Wheel of Fortune's win class at once, paid in rubies for the spins it skips.

Raises:

Type Description
ValueError

Without spend_rubies

EventNotRunningError

The Wheel of Fortune is not running

Client: CastleLuckyWheelIncreaseWinClassDialog.clickedAccept (bundle line 117107), LuckyWheelData.increaseWinClassC2 (bundle line 17628), LWCCommand.executeCommand (bundle line 128090)

pull_gacha

pull_gacha(event: Event | int, pulls: int = 1, *, spend_rubies: bool = False, timeout: float = 5.0) -> GachaSpinResponse

Pull a gacha event's chest pulls times; the event's points and free chest are updated.

A pull's price is the gacha level's cost list in the game data's gachas table, which the library does not load, so it may be rubies: the call needs spend_rubies.

Raises:

Type Description
ValueError

Without spend_rubies, or pulls below 1

EventNotRunningError

The event is not running, or is no gacha event

Client: GachaComponentPull.onClick (bundle line 57102), GachaXmlVO.init (bundle line 113936) reads the cost list, DGECommand.executeCommand (bundle line 124175)

donate_to_colossus

donate_to_colossus(castle_id: int, *, wood: int = 0, stone: int = 0, timeout: float = 5.0) -> ColossusDepositResponse

Donate wood and stone from one of your castles to the running colossus.

Raises:

Type Description
ValueError

Neither amount is above 0, or the castle is not yours

EventNotRunningError

No wood and stone colossus is running

Client: CastleColossusDonateDialog.onDonate (bundle line 59308), CDECommand.executeCommand (bundle line 127690)

donate_to_gold_colossus

donate_to_gold_colossus(coins: int, *, timeout: float = 5.0) -> ColossusCoinDepositResponse

Donate coins to the running coin colossus.

Client: CastleCoinColossusDonateDialog.onDonate (bundle line 59272), CCDCommand.executeCommand (bundle line 127672)

get_imperial_patronage_progress

get_imperial_patronage_progress(*, timeout: float = 5.0) -> tuple[DonationItemPoints, ...]

Ask for the points each imperial patronage item has earned you; kept as donated_points.

Client: DonationEventDialog (bundle line 39780), GDTICommand.executeCommand (bundle line 123604)

donate_items

donate_items(items: Mapping[DonationItemId, int], *, spend_rubies: bool = False, timeout: float = 5.0) -> tuple[DonationItemPoints, ...]

Give imperial patronage items, by donation item id and amount; returns the points each has earned.

A donation item is a resource or a currency (GameData.donation_items), which may be rubies: the call needs spend_rubies.

Raises:

Type Description
ValueError

No amount is above 0, or spend_rubies is False

Client: DonationEventDialogDonate.onDonate (bundle line 115642), DDICommand.executeCommand (bundle line 123589); DonationEventDialogDonateItem.unfilteredAmountInInventory (bundle line 115730) gives rubies for an item whose resource is C2

give_marauder_packages

give_marauder_packages(castle_id: int, *, wood_packages: int = 0, stone_packages: int = 0, food_packages: int = 0, timeout: float = 5.0) -> GetEventPointsResponse

Hand resource packages from one of your castles to the marauders' contest, then read your points as the client does.

A package is the event's own amount of the resource, which the sei entry does not carry.

Raises:

Type Description
ValueError

No package count is above 0, or the castle is not yours

EventNotRunningError

The marauders' contest is not running

Client: C2SBuyBeggingKnightsPackageVO (bundle line 114933), sent with each amount divided by the package size (bundle line 114916); BKPCommand.executeCommand (bundle line 128233) asks for the points

buy_artifact_pieces

buy_artifact_pieces(event: Event | int, pieces: int = 1, *, spend_rubies: bool = False, timeout: float = 5.0) -> BuyArtifactPieceResponse

Buy pieces of a running Traveling Knights event's artifact with rubies; the event's parts_found is updated.

Raises:

Type Description
ValueError

Without spend_rubies

EventNotRunningError

The event is not running, or is no Traveling Knights event

GameDataNotLoadedError

The game data, which names the event's kingdom, cannot be loaded

Client: CastleArtifactBuyPieceDialog (bundle lines 114756, 114762) prices the pieces in rubies and sends the event's first kingdom (kIDs, "0" when missing, ASpecialEventVO.parseBasicsFromXmlNode, bundle line 2960); SAPCommand.executeCommand (bundle line 127614)

validate_shady_lady_target

validate_shady_lady_target(*, timeout: float = 5.0) -> None

Have the server check your Shady Lady target, as the event's dialog does when it opens; a new target arrives in a sei.

Client: CastleBountyhunterEventDialog.applyPropertiesLoaded (bundle line 114986), BRTCommand.executeCommand (bundle line 127629)

skip_shady_lady_target

skip_shady_lady_target(*, spend_rubies: bool = False, timeout: float = 5.0) -> SkipShadyLadyTargetResponse

Skip your Shady Lady target for another, paid in rubies; the event's new target comes with the reply.

Raises:

Type Description
ValueError

Without spend_rubies

Client: CastleBountyhunterEventDialog.onClick (bundle line 115004), targetSkipCostC2 (bundle line 114944), BSTCommand.executeCommand (bundle line 127642)

buy_fortune_teller_reading

buy_fortune_teller_reading(*, spend_rubies: bool = False, timeout: float = 5.0) -> FortuneTellerReadingResponse

Buy today's next fortune teller reading and return its reward.

Each reading is priced in rubies by the game data's fortune teller classes, which the library does not load, so the call needs spend_rubies even for one that is free.

Raises:

Type Description
ValueError

Without spend_rubies

GameDataNotLoadedError

The game data, which resolves the rewards, cannot be loaded

Client: FortuneTellerEventDialog.onClick and updateText (bundle lines 59613, 59596), FortuneTellerClassVO.parseXML (bundle line 145167), CastleFortuneTellerData.parseFTL (bundle line 145157)

vote_world_cup

vote_world_cup(vote: WorldCupVote, *, timeout: float = 5.0) -> VoteWorldCupResponse

Bet on the world cup match; no rubies are spent, the bet opens once you spent its price in the event.

Raises:

Type Description
ValueError

You have bet already

EventNotRunningError

The world cup is not running

Client: CastleWorldCupDialog.updateState (bundle line 104658), CastleWorldCupDialogNotVotedState (bundle lines 104711-104723), VWCCommand.executeCommand (bundle line 128541)

get_collector_currency

get_collector_currency(player_id: int, *, timeout: float = 5.0) -> int

Ask how much of the collector event's currency a player holds, as the attack dialog shows it.

Client: CastleCollectorEventData.getPlayerCollectorAmount (bundle line 134000), PCCCommand.executeCommand (bundle line 127657)

buy_campaign_quest

buy_campaign_quest(quest: Quest, *, spend_rubies: bool = False, timeout: float = 5.0) -> None

Buy a quest of the running time-limited campaign done, with rubies; see "Spending rubies" in the guides.

The client offers it for a campaign quest that is open, not done, and failed. It also counts one whose campaign quest event timer reads 0 as failed, but that event ends at 0 and the state drops it. Its price, the quest's c2Cost less the c2Reduction of each condition done, is not worked out here, so this always needs spend_rubies.

Parameters:

Name Type Description Default
quest Quest

One of the campaign's quests, from its CampaignEvent.quests

required
spend_rubies bool

Allow the rubies it costs; without it nothing is sent

False
timeout float

Timeout in seconds

5.0

Raises:

Type Description
EventNotRunningError

No time-limited campaign runs

ValueError

The quest is not one of the campaign's, is done, not open yet or not failed, or spend_rubies is False

CommandError

The server refused

Client: QuestInfoComponent.showQuest (bundle line 458508) shows the buy button and onClick (bundle line 458577) opens CastleQuestBuyRewardDialog, priced by CastleQuestVO.buyCost (bundle line 269537), whose onClick (bundle line 270612) sends bcq; CastleQuestVO.isFailed and remainingSeconds (bundle lines 269398, 269424); BCQCommand.exec (bundle line 640412)

buy_campaign_reward

buy_campaign_reward(*, spend_rubies: bool = False, timeout: float = 5.0) -> BuyCampaignRewardResponse

Buy the running time-limited campaign's end reward, with rubies; see "Spending rubies" in the guides.

Its price falls with each campaign quest done and is not worked out here, so this always needs spend_rubies.

Parameters:

Name Type Description Default
spend_rubies bool

Allow the rubies it costs; without it nothing is sent

False
timeout float

Timeout in seconds

5.0

Returns:

Type Description
BuyCampaignRewardResponse

Your coins and rubies after

Raises:

Type Description
EventNotRunningError

No time-limited campaign runs

ValueError

The end reward was collected, or spend_rubies is False

CommandError

The server refused

Client: CampaignQuestListComponent.show (bundle line 458237) shows the buy button until the reward is received (COL), and its onClick (bundle line 458293) opens CastleQuestBuyRewardDialog, priced by TimeLimitedCampaignEventEventVO.buyCost (bundle line 607691) through TimeLimitedCampaignConst.calculateEndRewardPurchaseCost (dll); BCRCommand.exec (bundle line 640456)

league_id

league_id(event: Event | int, part: str | None = None) -> LeagueTypeId

The league your score is in for a running event, the LID of its sei entry; nothing is sent.

Pass it as league_type_id to client.ranking.get_ranking_list, get_own_ranking_page and get_ranking_window, as the client's leaderboard dialogs do. get_scores reads it for you.

Parameters:

Name Type Description Default
event Event | int

The event (EID)

required
part str | None

One part of the entry instead, for the invasion boards: SP (players), A (alliances), FB or FR (Berimond invasion's blue and red players)

None

Returns:

Type Description
LeagueTypeId

The league, 1 (the client's default) for a running event or part without one

Raises:

Type Description
EventNotRunningError

The event is not running

Client: AScoreEventVO.parseBasicsFromParamObject (bundle line 14967), defaults at bundle line 14965, read by GlobalLeaderBoardLeagueComponent (bundle line 100470)

scoreboard

scoreboard(event: Event) -> Scoreboard

The boards an event's dialogs open.

Raises:

Type Description
ValueError

The event has no scoreboard; the message names the events that have one

get_scores

get_scores(event: Event, *, alliance: bool = False, list_type: RankingType | None = None, rank: int | None = None, name: str | None = None, league_id: LeagueType | None = None, page_size: int = 10, timeout: float = 5.0) -> EventScores

Get a page of a running event's scoreboard, the board its dialog opens.

With neither rank nor name the page holds your own score, where the client's dialogs open; rank=1 is the top of the board.

Parameters:

Name Type Description Default
event Event

The event, e.g. Event.BATTLE_FOR_BERIMOND; those with a board are in EVENT_SCOREBOARDS

required
alliance bool

Read the alliance board instead of the player board

False
list_type RankingType | None

One of the event's boards by its list, for Berimond invasion's player boards (BERIMOND_INVASION_PLAYER_URSIDAE or BERIMOND_INVASION_PLAYER_GERBRANDT)

None
rank int | None

The page from this rank (leaderboards), or the page around it (hgh boards)

None
name str | None

The page around this name: hgh's search, or for a leaderboard its search (slse) and the page of the first hit

None
league_id LeagueType | None

Another of the event's leagues, whose top is then shown; by default your own as the sei packets gave it, 1 when they gave none (the client's default), and none for the donation board. While Berimond is locked to you (no UL in its sei entry) it opens on the top of league 1, as the client does

None
page_size int

Rows per page on the leaderboards (M); an hgh page is as long as the server makes it (8 rows, seen live)

10
timeout float

Timeout in seconds, per request

5.0

Returns:

Type Description
EventScores

The page; no rows when a leaderboard search finds no one (the client then

EventScores

shows your own page instead)

Raises:

Type Description
EventNotRunningError

The event is not running

ReplyMismatchError

The hgh reply is for a list that is not the event's

ValueError

The event has no scoreboard or no such board; rank is below 1; alliance was given with a player board; Berimond invasion's player board was asked for without list_type; rank and name were both given, or name is empty

CommandError

The server refused the request

EmpireTimeoutError

No answer; seen live for your own page of a player board with no event running

Client: the hgh boards, CastleGenericHighscoreDialog (bundle line 30799), CastleGenericAllianceHighscoreDialog (bundle line 38103) and CastleGenericRankingComponent (bundle line 29585), send "-1" (or your rank) for your own page, "1" for the top and a name to search, with the board's league, and "1" in a league that is not yours (scrollLeagueUp, bundle line 30846); FactionRankingComponent.generateProperties (bundle line 95410) opens a locked Berimond (FactionEventVO.isLocked, bundle line 7379) on league 1 at "1"; the leaderboards open on LeaderBoardDataProvider.getCurrentPlayerPage (bundle line 75941) from GlobalLeaderBoardComponent.onShow (bundle line 34990)

get_own_points

get_own_points(event: Event | int, *, timeout: float = 5.0) -> GetEventPointsResponse

Ask the server for your rank and points in a running event.

Works for the events in POINT_EVENTS, those without a scoreboard too (the gacha events, the Wheel of Fortune, the alliance tournament). The reply is applied to the event's state before this returns, so client.state.get_event(event) then holds them read the event's way (own_rank, own_points, parts, ...).

Parameters:

Name Type Description Default
event Event | int

The event, e.g. Event.NOBILITY_CONTEST

required
timeout float

Timeout in seconds

5.0

Returns:

Type Description
GetEventPointsResponse

The reply: its lists hold one value per score the event keeps, in the order

GetEventPointsResponse

GetEventPointsResponse gives

Raises:

Type Description
EventHasNoPointsError

The event keeps no rank and points (a shop or sale event); nothing is sent, as the server answers none (seen live)

EventNotRunningError

The event is not running

CommandError

The server refused the request

EmpireTimeoutError

No answer within timeout, or only one for another event

Client: C2SPointEventGetPointsVO (bundle line 8697), sent by the event dialogs only for a running event (e.g. CastleFactionInvasionEventDialog.showLoaded, bundle line 91529; CastleAllianceSamuraiInvasionDialogAllianceSublayer.show, bundle line 98938); PEPCommand.exec (bundle line 128209)

get_active_events

get_active_events(lang: str = 'en', force_refresh: bool = False) -> list[GameEvent]

The running events with their in-game titles, in the order they started.

The titles come from the game's language CDN (see get_event_titles); without one, an event is named by its Event member, or its id when the library does not know it. An empty list means no event is running: a CDN outage only costs the titles.

Parameters:

Name Type Description Default
lang str

Language code for the titles (default: "en")

'en'
force_refresh bool

Fetch the titles again even when the cached ones are fresh

False
Example
for event in client.events.get_active_events():
    print(event.display_name, round(event.details.remaining_seconds()))

events.models

The running events as the state keeps them, the events that have a scoreboard, and a page of one as client.events.get_scores returns it.

Classes:

Name Description
Scoreboard

The boards an event's dialogs open, and the dialog the lists come from.

EventScore

One row of an event's scoreboard: a player, or an alliance on an alliance board.

EventScores

A page of an event's scoreboard.

ReadOnlyDict

A dict that refuses changes, so an event model handed out never changes.

EventPart

One score of an event with several: an invasion's player or alliance score, or a raid's own score.

SpecialEvent

A running event, as its sei (or tei) entries left it.

ScoredEvent

An event with a score of your own.

NobilityContestEvent

The nobility contest, and the base of WheelOfFortuneEvent: the Wheels of Fortune keep the same score

LeagueScoredEvent

A score event whose rewards come from a reward set.

MaraudersContestEvent

The marauders' contest.

GrandNobilityPrizeEvent

The grand nobility prize.

GachaEvent

A gacha event.

InvasionEvent

An invasion: its player and alliance scores are its parts.

SamuraiInvasionEvent

The samurai invasion, and its daimyo as the last gda, gdc and gdw sent them.

BerimondInvasionEvent

The Berimond invasion: FB and FR are the blue and red players' scores, A the alliance's.

AlienInvasionEvent

The war of the realms (71) and the Bloodcrow invasion (103); a part is rebuilt only from an entry that has it.

NomadInvasionEvent

The nomad invasion: SP and A (rebuilt from an entry that has them) and, while the khan

BerimondEvent

Battle for Berimond. Your rank and points come only from pep pushes and start over with each entry;

RiftRaidEvent

The Rift Raid: score is your own score, the alliance's is in alliance_points.

OuterRealmsEvent

the Outer Realms.

ImperialPatronageEvent

Imperial patronage.

KingdomsLeagueEvent

The Kingdom's League, a trigger event. It runs while it has more than a day left; on its last

GlobalEffectTimer

One global effect of a global effect event.

GlobalEffectEvent

The global effects running, a trigger event that ends with the last of them.

GlobalEffectBoost

A global effect a boost event can strengthen.

GlobalEffectBuffEvent

The global effect boost, a trigger event that ends when the global effect event running as it

AllianceTournamentEvent

The alliance tournament: your own score, and your alliance's in parts["A"], which the pep pushes update.

GrandTournamentEvent

The Grand Tournament: parts["SP"] is your score and parts["A"] your alliance's,

WheelOfFortuneEvent

The Wheel of Fortune (15) and the Wheel of Unimaginable Affluence (89): a point event score and the wheel's state.

TravelingKnightsEvent

a Traveling Knights event: the parts of the artifact you have found.

PackageShopEvent

An event whose shop sells packages for a fixed price: the packages its game data names, and those the server

MercenaryShopEvent

A mercenary camp, or the Berimond armorers: a shop that sells units. Only Berimond Armorer (76) reads the

SeasonEvent

A season event: the Thorn King (2), the Blade Coast (4) or the Underworld (64).

BannerOfGloryEvent

The Banner of Glory. Client: FameboosterEventVO.parseParamObject (bundle line 116103)

AllianceBonusEvent

An alliance payment bonus: the prime alliance bonus (45) or the alliance payment bonus (55).

DiscountSaleEvent

A prime sale with one discount: the relic enchanter sale (88) or the season pass sale (599).

SkipForFreeEvent

Free skips. Client: SkipForFreeEventVO.parseParamObject (bundle line 118150)

GiftEvent

The Goodgame gift. Client: GGSGiftEventVO.parseParamObject (bundle line 116370)

FortuneTellerEvent

The fortune teller. Client: FortuneTellerEventVO.parseParamObject (bundle line 116134)

WorldCupEvent

The world cup: a bet on one match, open once the rubies you spent in the event reach its price.

TournamentRank

One place of the tournament of fame's ranking: [rank, fame points, owner record].

TournamentEvent

The tournament of fame: the ranking, your place and the fame you have earned.

CampaignEvent

A time-limited campaign: its quests, in the order they open, and its end reward.

CampaignQuestEvent

The time-limited campaign's quest event; its end is the end of the campaign quests it names.

EventAnnouncementEvent

The event announcement, the teaser for an event to come, with a reward to claim.

SpecialEventInfoRequest

Ask for the running events; the server answers with a sei.

GetEventPointsRequest

Ask for your rank and points in a running event; the server answers with a pep.

GetEventPointsResponse

Your rank and points in an event, pushed as you score and sent in answer to a GetEventPointsRequest.

ShuttingDownEvents

The events that are shutting down: each one's building stays in your castles, with no time left.

EventEntry

One entry of a sei or tei: the event it names, and the entry as sent for that event's class to read.

SpecialEventsResponse

The running events, each entry read over the event it names or adding it.

TriggerEventsResponse

The running trigger events (the Kingdom's League and the global effect events), keyed by TRID.

EventEndedResponse

An event has ended: the client destroys it, so one sent again starts over.

TriggerEventEndedResponse

A trigger event has ended.

BerimondFactionJoinedResponse

The reply to joining a Berimond faction: your kingdoms, the events and the castle lists, then which faction.

SeasonEventResponse

A season event packet; the client accepts it and reads nothing from it.

GameEvent

A running event with its in-game title.

ClaimAnnouncementRewardRequest

Claim the reward of the running event announcement, the teaser for an event to come.

ClaimAnnouncementRewardResponse

The answer to an announcement reward claim; the client reads nothing from it.

Functions:

Name Description
event_class

The model an event's entries are read into.

Attributes:

Name Type Description
EVENT_SCOREBOARDS dict[Event, Scoreboard]

The events whose dialogs open a scoreboard.

EVENT_CLASSES dict[Event, type[SpecialEvent]]

The model each event's entries are read into; any other event is a plain SpecialEvent.

POINT_EVENTS frozenset[Event]

The events that keep your rank and points, the ones a pep is answered for.

EVENT_SCOREBOARDS module-attribute

EVENT_SCOREBOARDS: dict[Event, Scoreboard] = {Event.BATTLE_FOR_BERIMOND: Scoreboard(player_lists=(RankingType.BATTLE_FOR_BERIMOND,), source='FactionRankingComponent.generateProperties (bundle line 95410)'), Event.NOBILITY_CONTEST: Scoreboard(player_lists=(RankingType.NOBILITY_CONTEST,), source='CastlePointEventDialog (bundle line 117423)'), Event.MARAUDERS_CONTEST: Scoreboard(player_lists=(RankingType.MARAUDERS_CONTEST,), source='CastleBeggingKnightsDialog (bundle line 114835)'), Event.WAR_OF_THE_REALMS: Scoreboard(player_lists=(RankingType.WAR_OF_THE_REALMS_PLAYER,), alliance_list=RankingType.WAR_OF_THE_REALMS_ALLIANCE, source='CastleAllianceAlienInvasionEventDialogProperties (bundle lines 114205-114207)'), Event.NOMAD_INVASION_72: Scoreboard(player_lists=(), alliance_list=RankingType.ALLIANCE_NOMADINVASION_ALLIANCE, source='CastleAllianceNomadInvasionPointsEventSublayer (bundle line 98542); no player board'), Event.SAMURAI_INVASION: Scoreboard(player_lists=(), alliance_list=RankingType.SAMURAI_ALLIANCE, source='CastleAllianceSamuraiInvasionDialogAllianceSublayer (bundle line 98953); no player board'), Event.GRAND_NOBILITY_PRIZE: Scoreboard(player_lists=(RankingType.GRAND_NOBILITY_PRIZE,), is_leaderboard=True, source='LongtermPointEventGlobalLeaderBoardDialog (bundle line 100413)'), Event.BERIMOND_INVASION: Scoreboard(player_lists=(RankingType.BERIMOND_INVASION_PLAYER_URSIDAE, RankingType.BERIMOND_INVASION_PLAYER_GERBRANDT), alliance_list=RankingType.BERIMOND_INVASION_ALLIANCE, source='CastleFactionInvasionEventHighscoreDialog (bundle lines 53151-53155)'), Event.BLOODCROW_INVASION: Scoreboard(player_lists=(RankingType.BLOODCROW_INVASION_PLAYER,), alliance_list=RankingType.BLOODCROW_INVASION_ALLIANCE, source='CastleRedAllianceAlienInvasionEventDialogProperties (bundle lines 117712-117714)'), Event.IMPERIAL_PATRONAGE: Scoreboard(player_lists=(RankingType.IMPERIAL_PATRONAGE,), is_leaderboard=True, source='DonationEventDialogRanking (bundle line 115746)')}

The events whose dialogs open a scoreboard.

Client: EventConst.EVENTTYPE_* (dll line 19291) for the ids; each board's dialog in its source

EVENT_CLASSES module-attribute

EVENT_CLASSES: dict[Event, type[SpecialEvent]] = {Event.BATTLE_FOR_BERIMOND: BerimondEvent, Event.NOBILITY_CONTEST: NobilityContestEvent, Event.MARAUDERS_CONTEST: MaraudersContestEvent, Event.GRAND_NOBILITY_PRIZE: GrandNobilityPrizeEvent, Event.WAR_OF_THE_REALMS: AlienInvasionEvent, Event.BLOODCROW_INVASION: AlienInvasionEvent, Event.NOMAD_INVASION_72: NomadInvasionEvent, Event.SAMURAI_INVASION: SamuraiInvasionEvent, Event.BERIMOND_INVASION: BerimondInvasionEvent, Event.RIFT_RAID: RiftRaidEvent, Event.OUTER_REALMS: OuterRealmsEvent, Event.IMPERIAL_PATRONAGE: ImperialPatronageEvent, Event.GACHA_DECO2X2: GachaEvent, Event.ENCHANTED_SNOWGLOBE: GachaEvent, Event.SUMMONING_OF_THE_HOLLOW_MOON: GachaEvent, Event.SANDS_OF_FORTUNE: GachaEvent, Event.KINGS_BANQUET: GachaEvent, Event.HALLOWEEN_BANQUET: GachaEvent, Event.MIDNIGHT_MARKET: GachaEvent, Event.CARNIVAL_OF_MASKS: GachaEvent, Event.KINGDOMS_LEAGUE: KingdomsLeagueEvent, Event.GLOBAL_EFFECT: GlobalEffectEvent, Event.GLOBAL_EFFECT_BUFF: GlobalEffectBuffEvent, Event.ALLIANCE_TOURNAMENT: AllianceTournamentEvent, Event.GRAND_TOURNAMENT: GrandTournamentEvent, Event.WHEEL_OF_FORTUNE: WheelOfFortuneEvent, Event.WHEEL_OF_UNIMAGINABLE_AFFLUENCE: WheelOfFortuneEvent, **dict.fromkeys((Event.TRAVELING_KNIGHTS_19, Event.TRAVELING_KNIGHTS_23, Event.TRAVELING_KNIGHTS_29, Event.TRAVELING_KNIGHTS_30, Event.TRAVELING_KNIGHTS_67), TravelingKnightsEvent), **dict.fromkeys((Event.THORN_KING, Event.BLADE_COAST, Event.UNDERWORLD), SeasonEvent), Event.BANNER_OF_GLORY: BannerOfGloryEvent, Event.PRIME_ALLI_BONUS: AllianceBonusEvent, Event.ALLIANCE_PRIME_DAY: AllianceBonusEvent, Event.RELIC_ENCHANTER_PRIME_SALE: DiscountSaleEvent, Event.SEASON_PASS_PRIME_SALE: DiscountSaleEvent, Event.SKIP_FOR_FREE: SkipForFreeEvent, Event.GIFT_BOX: GiftEvent, Event.EVENT_ANNOUNCEMENT: EventAnnouncementEvent, Event.FORTUNE_TELLER: FortuneTellerEvent, Event.WORLD_CUP: WorldCupEvent, Event.TOURNAMENT: TournamentEvent, Event.TIME_LIMITED_CAMPAIGN_EVENT: CampaignEvent, Event.TIME_LIMITED_CAMPAIGN_QUEST_EVENT: CampaignQuestEvent, **dict.fromkeys((Event.TRAVELING_MERCHANT, Event.TRAVELING_MERCHANT_EVENT, Event.NOMAD_HUNTER, Event.DAIMYO_SHOP, Event.SAMURAI_ARMORER, Event.ARMORER, Event.GIFT_PEDDLER, Event.EQUIPMENT_TRADER, Event.PLAGUE_DOCTORS, Event.APPRENTICE_SMITH, Event.APPRENTICE_TOKEN_VENDOR, Event.WISHING_WELL_COIN_VENDOR, Event.RAIDBOSS_SHOP_EVENT), PackageShopEvent), **dict.fromkeys((Event.MERCENARY_THORN_KING, Event.MERCENARY_BLADE_COAST, Event.MERCENARY_UNDERWORLD, Event.MERCENARY_STORM_ISLANDS, Event.BERIMOND_ARMORER_76, Event.BERIMOND_ARMORER_86), MercenaryShopEvent)}

The model each event's entries are read into; any other event is a plain SpecialEvent.

Client: CastleSpecialEventFactory.createByEventType (bundle line 61602) picks the class from the event's eventType

POINT_EVENTS module-attribute

POINT_EVENTS: frozenset[Event] = frozenset({Event.BATTLE_FOR_BERIMOND, Event.WHEEL_OF_FORTUNE, Event.ALLIANCE_TOURNAMENT, Event.NOBILITY_CONTEST, Event.MARAUDERS_CONTEST, Event.WAR_OF_THE_REALMS, Event.NOMAD_INVASION_72, Event.SAMURAI_INVASION, Event.GRAND_NOBILITY_PRIZE, Event.BERIMOND_INVASION, Event.WHEEL_OF_UNIMAGINABLE_AFFLUENCE, Event.BLOODCROW_INVASION, Event.GACHA_DECO2X2, Event.ENCHANTED_SNOWGLOBE, Event.SUMMONING_OF_THE_HOLLOW_MOON, Event.GRAND_TOURNAMENT, Event.SANDS_OF_FORTUNE, Event.KINGS_BANQUET, Event.HALLOWEEN_BANQUET, Event.RIFT_RAID, Event.MIDNIGHT_MARKET, Event.CARNIVAL_OF_MASKS})

The events that keep your rank and points, the ones a pep is answered for.

Client: CastleSpecialEventFactory.createByEventType (bundle line 61602) builds each event as its eventType + EventVO; these are the classes with a setRankAndPoints, which PEPCommand.exec (bundle line 128213) calls: AScoreEventVO (bundle line 15044) and its subclasses (the nobility contest, marauders, Grand Nobility Prize, alliance tournament (bundle line 114412), the invasions (bundle lines 55701, 58926, 114310, 116056), the alliance Grand Tournament (bundle line 5101) and the gacha events, AGachaEventVO, bundle line 15372), FactionEventVO (bundle line 7461), AllianceRaidbossEventEventVO (bundle line 9117) and LuckyWheelEventVO (bundle line 59687) with SaleDaysLuckyWheelEventVO (bundle line 117863). Every other event class is an ASpecialEventVO (bundle line 2953) without one.

Scoreboard pydantic-model

Bases: EmpireModel

The boards an event's dialogs open, and the dialog the lists come from.

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

player_lists pydantic-field

player_lists: tuple[RankingType, ...]

The player boards; Berimond invasion has one per faction, the House of Ursidae first

alliance_list pydantic-field

alliance_list: RankingType | None = None

The alliance board, or None without one

is_leaderboard pydantic-field

is_leaderboard: bool = False

Whether the boards are read with llsp, llsw and slse rather than hgh

source pydantic-field

source: str

Where the client opens the boards

lists property

lists: tuple[RankingType, ...]

Every board, the player boards first.

EventScore pydantic-model

Bases: EmpireModel

One row of an event's scoreboard: a player, or an alliance on an alliance board.

Client: CastleGenericHighscoreDialog.onGetHighscoreData (bundle line 30827) and CastleSingleplayerRankingItem.update (bundle line 91695) read a player row as [rank, points, owner] with WorldMapOwnerInfoVO.fillFromParamObject (bundle line 10794); CastleGenericAllianceHighscoreDialog.onGetHighscoreData (bundle line 38127) and CastleAllianceRankingItem.update (bundle line 91645) read an alliance row as [rank, points, [alliance_id, name, member_count, fame]] with AllianceHighscoreInfoVO.fillFromParamObject (bundle line 27680); a leaderboard row is a LeaderboardScore

Fields:

rank pydantic-field

rank: int

Rank on the board

points pydantic-field

points: int | float

The event's points

name pydantic-field

name: str = ''

The player's name, or the alliance's on an alliance board

player_id pydantic-field

player_id: int | None = None

The player's id; None on alliance and leaderboard rows

alliance_id pydantic-field

alliance_id: int | None = None

The alliance's id, 0 for a player without one; None on leaderboard rows

alliance_name pydantic-field

alliance_name: str = ''

The alliance's name, empty for a player without one

level pydantic-field

level: int | None = None

The player's level; None on alliance and leaderboard rows

member_count pydantic-field

member_count: int | None = None

The alliance's member count, on alliance rows

instance_id pydantic-field

instance_id: int | None = None

The game server the player is on, on leaderboard rows

from_highscore_row classmethod

from_highscore_row(row: HighscoreRow) -> EventScore

A hgh row: a player's, or an alliance's on an alliance board.

from_leaderboard classmethod

from_leaderboard(score: LeaderboardScore) -> EventScore

An event leaderboard row.

EventScores pydantic-model

Bases: EmpireModel

A page of an event's scoreboard.

Fields:

event pydantic-field

event: Event

The event

list_type pydantic-field

list_type: RankingType

The board read

league_id pydantic-field

league_id: LeagueTypeId | None

The league the page is from, as the server answered; None for none

total pydantic-field

total: int | None = None

Ranked entries on the whole board (its last rank); None when not given

scores pydantic-field

scores: list[EventScore]

The page's rows, in rank order

from_highscore classmethod

from_highscore(event: Event, list_type: RankingType, reply: GetHighscoreResponse) -> EventScores

A hgh reply.

A reply for another of the event's boards is read as that board, as the dialogs adopt the list a reply names.

Raises:

Type Description
ReplyMismatchError

The reply is for a list that is not one of the event's, e.g. a late reply to another hgh request

Client: CastleGenericRankingComponent.onGetHighscoreData (bundle line 29601) ignores a reply for another list

from_leaderboard classmethod

from_leaderboard(event: Event, list_type: RankingType, reply: GetRankingListResponse) -> EventScores

A llsp or llsw reply.

ReadOnlyDict

Bases: dict[_K, _V]

A dict that refuses changes, so an event model handed out never changes.

Attributes:

Name Type Description
clear
pop
popitem
setdefault
update

clear class-attribute instance-attribute

clear = _refuse

pop class-attribute instance-attribute

pop = _refuse

popitem class-attribute instance-attribute

popitem = _refuse

setdefault class-attribute instance-attribute

setdefault = _refuse

update class-attribute instance-attribute

update = _refuse

EventPart pydantic-model

Bases: _ScoreFields

One score of an event with several: an invasion's player or alliance score, or a raid's own score.

Client: ALeagueTypeScoreEventVO.parseBasicsFromParamObject (bundle line 10260) over AScoreEventVO.parseBasicsFromParamObject (bundle line 14967), defaults at bundle line 14965; AScoreEventVO.setRankAndPoints (bundle line 15044) for a pep

Fields:

reward_set_id pydantic-field

reward_set_id: RewardSetId = RewardSetId(0)

Wire key RSID

The reward set, a set of GameData.league_type_events rows

league_rewards

league_rewards(event_id: int, *, game_data: GameData | None = None) -> LeagueTypeEventDef | None

This score's league's points thresholds and rewards in event_id, the event it is a part of; None when the game data has none.

Client: ALeagueTypeScoreEventVO.parseAdditionalXmlFromRoot (bundle line 10268)

parse classmethod

parse(entry: Any, previous: EventPart | None = None, sub_type: int = 0) -> EventPart

A part read from its entry, over previous when the client keeps the part.

SpecialEvent pydantic-model

Bases: EmpireModel

A running event, as its sei (or tei) entries left it.

Events the library has no class for keep only these fields and the entries in raw.

Client: ASpecialEventVO (bundle lines 2953-3049): parseBasicsFromParamObject (bundle line 2958) sets the end from RS when it is truthy, isActive (bundle line 3039); SpecialEventSeasonLeagueComponent.parseServerData (bundle line 64551) reads KL

Fields:

model_config class-attribute

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

is_trigger class-attribute

is_trigger: bool = False

Whether the event is a trigger event (tei): the Kingdom's League or a global effect event.

event_id pydantic-field

event_id: EnumOrInt[Event]

Wire key EID

The event; its id for one the enum lacks

end_time pydantic-field

end_time: float = 0.0

When the event ends, in time.monotonic() seconds; inf while it has no end

updated_at pydantic-field

updated_at: float = 0.0

When an entry for the event was last applied, wall clock

kingdoms_league_mode pydantic-field

kingdoms_league_mode: bool = False

Wire key KL

Whether the event runs in the Kingdom's League's season mode

raw pydantic-field

raw: _Raw

The event's entries merged, the last one's keys winning; read-only, lists as tuples

remaining_seconds

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

Seconds until the event ends, 0 once it has.

is_active

is_active(now: float | None = None) -> bool

Whether the event has not ended yet.

from_entry classmethod

from_entry(event_id: int, entry: dict[str, Any], previous: SpecialEvent | None, now: float, events: Mapping[int, SpecialEvent]) -> SpecialEvent

The event an entry makes of previous, or of nothing for a new event.

Fields the entry reads only when it has them keep their value from previous; events are the other running events.

accepts classmethod

accepts(entry: dict[str, Any]) -> bool

Whether the client reads the entry at all, rather than failing on it and leaving the event as it was.

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

The event after a pep with these OR, OP and PT; unchanged for an event without a score.

ScoredEvent pydantic-model

Bases: SpecialEvent, _ScoreFields

An event with a score of your own.

Client: AScoreEventVO.parseBasicsFromParamObject (bundle line 14975), defaults at bundle line 14973; setRankAndPoints (bundle line 15052) for a pep

Fields:

difficulty_id pydantic-field

difficulty_id: EventDifficultyId = EventDifficultyId(-1)

Wire key EDID

The difficulty chosen, a GameData.event_difficulties row; -1 before one is, 0 without difficulty scaling

difficulty_scaling pydantic-field

difficulty_scaling: bool = False

Wire key EASE

Whether the event scales its difficulty

parts pydantic-field

parts: _Parts

The event's scores by their entry key; read-only

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

leaderboard_rewards

leaderboard_rewards(league_type_id: LeagueTypeId = -1, *, game_data: GameData | None = None) -> tuple[LeaderboardRewardDef, ...]

The leaderboard's rank bands and their rewards, of one league or, by default, every league.

Client: AScoreEventVO.getGlobalLeaderBoardRewards (bundle line 15078)

NobilityContestEvent pydantic-model

Bases: ScoredEvent

The nobility contest, and the base of WheelOfFortuneEvent: the Wheels of Fortune keep the same score (LuckyWheelEventVO holds a LuckyWheelPointEventTypeScoreEventVO, an APointEventTypeScoreEventVO; bundle lines 59673, 117131).

Client: APointEventTypeScoreEventVO.parseBasicsFromParamObject (bundle line 59997)

Fields:

point_event_type pydantic-field

point_event_type: int = -1

Wire key PET

Which contest it is

LeagueScoredEvent pydantic-model

Bases: ScoredEvent

A score event whose rewards come from a reward set.

Client: ALeagueTypeScoreEventVO.parseBasicsFromParamObject (bundle line 10260)

Fields:

reward_set_id pydantic-field

reward_set_id: RewardSetId = RewardSetId(0)

Wire key RSID

The reward set, a set of GameData.league_type_events rows

league_rewards

league_rewards(*, game_data: GameData | None = None) -> LeagueTypeEventDef | None

Your league's points thresholds and rewards; None when the game data has none.

Client: ALeagueTypeScoreEventVO.parseAdditionalXmlFromRoot (bundle line 10268)

MaraudersContestEvent pydantic-model

Bases: LeagueScoredEvent

The marauders' contest.

Client: BeggingKnightsEventVO.parseBasicsFromParamObject (bundle line 114780)

Fields:

total_hours pydantic-field

total_hours: int = 0

Wire key TH

The contest's length in hours

GrandNobilityPrizeEvent pydantic-model

Bases: LeagueScoredEvent

The grand nobility prize.

Client: LongTermPointEventEventVO.parseParamObject (bundle line 116555)

Fields:

upcoming_event_ids pydantic-field

upcoming_event_ids: tuple[EnumOrInt['Event'], ...] = ()

Wire key UE

The events whose points count towards it

GachaEvent pydantic-model

Bases: LeagueScoredEvent

A gacha event.

Client: AGachaEventVO.parseGachaEvent (bundle line 15371)

Fields:

free_chest_reset_time pydantic-field

free_chest_reset_time: float = 0.0

Wire key FCRT

When the free chest comes back, in time.monotonic() seconds

with_gacha_update

with_gacha_update(update: GachaUpdate, now: float) -> GachaEvent

The event after a pull or a free chest: the values the reply sets, the others kept.

InvasionEvent pydantic-model

Bases: ScoredEvent

An invasion: its player and alliance scores are its parts.

Client: SamuraiInvasionEventVO.parseData (bundle line 55680) and FactionInvasionEventVO.parseData (bundle line 116082) rebuild every part from every entry; setRankAndPoints (bundle lines 55701, 116094) give a pep's first rank and points to the first part, and so on

Fields:

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

SamuraiInvasionEvent pydantic-model

Bases: InvasionEvent

The samurai invasion, and its daimyo as the last gda, gdc and gdw sent them.

Client: SamuraiInvasionEventVO.parseData (bundle line 55680); the client keeps the daimyo in SamuraiDaimyoDataServer (bundle lines 142515-142540)

Fields:

daimyo_areas pydantic-field

daimyo_areas: DaimyoAreasResponse | None = None

The daimyo castles and townships; None until read

daimyo_contracts pydantic-field

daimyo_contracts: DaimyoContractsResponse | None = None

Your alliance's daimyo contracts; None until read

daimyo_war_efforts pydantic-field

daimyo_war_efforts: DaimyoWarEffortsResponse | None = None

Your war efforts against the daimyo; None until read

BerimondInvasionEvent pydantic-model

Bases: InvasionEvent

The Berimond invasion: FB and FR are the blue and red players' scores, A the alliance's.

Client: FactionInvasionEventVO.parseData (bundle line 116082), setRankAndPoints (bundle line 116094)

Fields:

camp_score

camp_score(owner_id: int | None) -> EventPart | None

Your score for the faction of an invasion camp with this owner, whose league sets where its camps start.

FB for the Ursidae king's camps, FR for any other owner, as the client splits them.

Client: FactionInvasionEventVO.baseCampLevel (bundle line 116095)

AlienInvasionEvent pydantic-model

Bases: InvasionEvent

The war of the realms (71) and the Bloodcrow invasion (103); a part is rebuilt only from an entry that has it.

Client: AAlienInvasionEventVO.parseData and parseParamObject (bundle lines 58910, 58918), setRankAndPoints (bundle line 58926)

Fields:

target_zone_id pydantic-field

target_zone_id: int = 0

Wire key TZID

The zone the invasion targets

source_zone_id pydantic-field

source_zone_id: int = 0

Wire key SZID

The zone the invasion comes from

use_reroll pydantic-field

use_reroll: bool = False

Wire key CRE

Whether camps can be rerolled

reroll_currency_keys pydantic-field

reroll_currency_keys: tuple[str, ...] = ()

Wire key RCKS

The currencies a reroll costs

NomadInvasionEvent pydantic-model

Bases: InvasionEvent

The nomad invasion: SP and A (rebuilt from an entry that has them) and, while the khan camp runs (ACE), the camp's score AC.

The client shows the khan camp's level (from the game data's row of khan_camp_id) as that part's points; the state has no game data, so parts["AC"] keeps the points the entry sent.

Client: AllianceNomadInvasionEventVO.parseData (bundle lines 114287-114288), whose constructor (bundle line 114286) starts both scores; setRankAndPoints (bundle line 114310)

Fields:

alliance_rage pydantic-field

alliance_rage: int = 0

The khan camp's alliance rage

player_rage pydantic-field

player_rage: int = 0

Your current rage points on the khan camp

player_total_rage pydantic-field

player_total_rage: int = 0

Your total rage points on the khan camp

khan_camp_id pydantic-field

khan_camp_id: AllianceInvasionCampId | ScalingCampId | None = None

The khan camp: a GameData.scaling_camps row when difficulty_id is above 0, else a GameData.alliance_invasion_camps row; None before one is sent

BerimondEvent pydantic-model

Bases: SpecialEvent

Battle for Berimond. Your rank and points come only from pep pushes and start over with each entry; your protection also from Berimond uap blocks and the ffp reply.

Client: FactionEventVO.parseData (bundle line 7354) builds the league scores anew, parseParamObject and loadFactionDataFromParamObject (bundle lines 7364-7365), the defaults at bundle line 7353; setRankAndPoints (bundle line 7461); parse_FKI (bundle line 7365)

Fields:

league_id pydantic-field

league_id: EnumOrInt['LeagueType'] = 1

Wire key LID

Your league

unlocked pydantic-field

unlocked: bool = False

Wire key UL

Whether Berimond is open to you

reward_set_id pydantic-field

reward_set_id: RewardSetId = RewardSetId(0)

Wire key RSID

The reward set, a set of GameData.league_type_events rows

own_rank pydantic-field

own_rank: int = -1

Your rank, -1 while unranked; from the pep pushes

own_points pydantic-field

own_points: int = 0

Your points, from the pep pushes

faction_id pydantic-field

faction_id: EnumOrInt[BerimondFaction] = BerimondFaction.URSIDAE

Your faction

main_camp_id pydantic-field

main_camp_id: int = 0

Your faction's main camp

berimond_protection_status pydantic-field

berimond_protection_status: int = 0

Your Berimond protection's status

berimond_protection_end pydantic-field

berimond_protection_end: float | None = 0.0

When your Berimond protection ends, in time.monotonic() seconds

beginner_protection_end pydantic-field

beginner_protection_end: float = 0.0

When your beginner protection ends, in time.monotonic() seconds

kingdom_status pydantic-field

kingdom_status: BerimondKingdomStatus | None = None

The last kingdom status (fki), kept across event entries

league_rewards

league_rewards(*, game_data: GameData | None = None) -> LeagueTypeEventDef | None

Your league's points thresholds and rewards: the event's last row of your league in your reward set, of any sub type, as the client keys the leagues; None when the game data has none.

Client: FactionEventVO.parseData and getOwnLeagueEventVO (bundle lines 7352-7358, 7454)

with_faction

with_faction(faction: FactionStanding, now: float) -> BerimondEvent

This event with an FN block read over it, as a Berimond protection purchase sends one.

with_protection

with_protection(protection: KingdomProtection, now: float) -> BerimondEvent

This event with a Berimond uap block read over it.

Client: FactionEventVO.parse_uap (bundle line 7364)

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

RiftRaidEvent pydantic-model

Bases: SpecialEvent

The Rift Raid: score is your own score, the alliance's is in alliance_points.

Client: AllianceRaidbossEventEventVO.parseData and parseParamObject (bundle lines 9109-9110), defaults at bundle line 9108; setRankAndPoints (bundle line 9117); PEPCommand.exec (bundle lines 128215-128216) for BLPP

Fields:

boss_status pydantic-field

boss_status: RiftRaidStatus | None = None

Latest alliance raid boss status

score pydantic-field

score: EventPart

Your score; its points are the entry's SP.OP

league_id pydantic-field

league_id: _League = 0

Your alliance's league, from the entry's A

alliance_points pydantic-field

alliance_points: int = 0

Your alliance's points, from the entry's A and the pep pushes

alliance_rank pydantic-field

alliance_rank: int = 0

Your alliance's rank, from the pep pushes

subdivision_id pydantic-field

subdivision_id: int = 0

Your alliance's subdivision, from the entry's A

division_round_id pydantic-field

division_round_id: int = 0

Wire key DRI

The division round

raid_boss_ids pydantic-field

raid_boss_ids: tuple[EnumOrInt['RaidBoss'], ...] = ()

Wire key RBIDS

The bosses that can be fought

boss_level_points pydantic-field

boss_level_points: int = 0

Wire key BLPP

The points on the current boss level

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

OuterRealmsEvent pydantic-model

Bases: SpecialEvent

the Outer Realms.

Client: TempServerEventVO.parseParamObject (bundle line 118200), defaults at bundle line 118199

Fields:

daily_reset_time pydantic-field

daily_reset_time: float = 0.0

Wire key RD

When the daily scores reset, in time.monotonic() seconds

setting_id pydantic-field

setting_id: OuterRealmsSettingId | None = None

Wire key TSID

The run's settings, a GameData.outer_realms_settings row

castle_bought pydantic-field

castle_bought: bool = False

Wire key IPS

Whether you have a castle there

is_cross_play pydantic-field

is_cross_play: bool = False

Wire key ICSE

Whether the server is a cross-play one

ImperialPatronageEvent pydantic-model

Bases: SpecialEvent

Imperial patronage.

Client: DonationEventEventVO.parseParamObject (bundle line 115540), which looks the settings up by CastleDonationEventData.getSettingVOByID (bundle line 58868)

Fields:

setting_id pydantic-field

setting_id: DonationSettingId | None = None

Wire key DSI

The run's settings, a GameData.donation_settings row

leaderboard_reward_set_id pydantic-field

leaderboard_reward_set_id: LeaderboardRewardSetId | None = None

Wire key LRSI

The leaderboard's reward set, a set of GameData.leaderboard_rewards rows

donated_points pydantic-field

donated_points: tuple[DonationItemPoints, ...] | None = None

The points each donation item has earned you; None until they were read or donated to

leaderboard_rewards

leaderboard_rewards(league_type_id: LeagueTypeId = -1, *, game_data: GameData | None = None) -> tuple[LeaderboardRewardDef, ...]

The leaderboard's rank bands and their rewards, of one league or, by default, every league; none before the event named its set.

Client: DonationEventEventVO.parseParamObject (bundle line 115540) keeps LRSI for CastleLeaderBoardRewardsData.getRewardListForDialogList (bundle line 112015)

KingdomsLeagueEvent pydantic-model

Bases: SpecialEvent

The Kingdom's League, a trigger event. It runs while it has more than a day left; on its last day it ends with the season event (the running event with kingdoms_league_mode), and without one it runs on at one day and has ended at none.

Client: SeasonLeagueEventVO.parseParamObject and endTimestamp (bundle lines 118059-118063), SeasonLeagueData.getActiveSeasonEventVO (bundle line 142582)

Fields:

is_trigger class-attribute instance-attribute

is_trigger = True

remaining_days pydantic-field

remaining_days: int = 0

Wire key KLRD

Days left

original_days pydantic-field

original_days: int = 0

Wire key KLRT

The league's length in days

reward_set_id pydantic-field

reward_set_id: int = 0

Wire key RSID

The reward set

has_alliance_ranking pydantic-field

has_alliance_ranking: bool = False

Wire key KLARE

Whether alliances are ranked too

league_type_id pydantic-field

league_type_id: _League = 0

Wire key KLLID

The league type

end_with

end_with(events: Mapping[int, SpecialEvent], now: float) -> float

When the league ends while events run.

remaining_seconds

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

Seconds until the league ends; its days left while it has no end.

GlobalEffectTimer pydantic-model

Bases: EmpireModel

One global effect of a global effect event.

Fields:

model_config class-attribute

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

effect_id pydantic-field

effect_id: EnumOrInt['GlobalEffect']

The global effect

end_time pydantic-field

end_time: float

When it ends, in time.monotonic() seconds

strength pydantic-field

strength: int

Its strength, -1 for the effect's own

seen pydantic-field

seen: bool

Whether you have seen it

GlobalEffectEvent pydantic-model

Bases: SpecialEvent

The global effects running, a trigger event that ends with the last of them.

Client: GlobalEffectEventVO.parseParamObject (bundle lines 116399-116413)

Fields:

is_trigger class-attribute instance-attribute

is_trigger = True

effects pydantic-field

effects: tuple[GlobalEffectTimer, ...] = ()

Wire key GE

The effects

seen_effect_ids pydantic-field

seen_effect_ids: tuple[EnumOrInt['GlobalEffect'], ...] = ()

Wire key SGE

The effects you have seen

accepts classmethod

accepts(entry: dict[str, Any]) -> bool

GlobalEffectBoost pydantic-model

Bases: EmpireModel

A global effect a boost event can strengthen.

Fields:

model_config class-attribute

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

effect_id pydantic-field

effect_id: EnumOrInt['GlobalEffect']

Wire key GEID

The global effect

boost_value pydantic-field

boost_value: float

Wire key BV

How much the boost adds

cost pydantic-field

cost: int

Wire key C2

The boost's price in rubies

GlobalEffectBuffEvent pydantic-model

Bases: SpecialEvent

The global effect boost, a trigger event that ends when the global effect event running as it arrived ends (at once without one).

Client: GlobalEffectBuffEventVO.parseParamObject (bundle lines 116381-116383), getBoostValues (bundle line 116384)

Fields:

is_trigger class-attribute instance-attribute

is_trigger = True

boosts pydantic-field

boosts: tuple[GlobalEffectBoost, ...] = ()

Wire key GEB

The effects it boosts

boost_value

boost_value(effect_id: GlobalEffect | int) -> float

What the boost adds to a global effect's strength: the first matching boost's, 0 for one it lists none for.

Client: GlobalEffectBuffEventVO.getBoostValueForGlobalEffect (bundle line 116390)

AllianceTournamentEvent pydantic-model

Bases: ScoredEvent

The alliance tournament: your own score, and your alliance's in parts["A"], which the pep pushes update.

Client: AlliTournamentEventVO.parseData (bundle line 114401) reads A into its ALeagueTypeScoreEventVO (kept from entry to entry), setRankAndPoints (bundle line 114412)

Fields:

accepts classmethod

accepts(entry: dict[str, Any]) -> bool

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

GrandTournamentEvent pydantic-model

Bases: ScoredEvent

The Grand Tournament: parts["SP"] is your score and parts["A"] your alliance's, both rebuilt from every entry in the league of A.LID with the entry's RSID.

The client keeps an alliance score per league of the event's league types, and none for a league outside them; the state has no game data, so it keeps the one for your league whenever A.LID is 1 or more.

Client: AllianceMobilizationEventEventVO.parseData (bundle lines 5074-5081), setRankAndPoints (bundle line 5101)

Fields:

quest_status pydantic-field

quest_status: GrandTournamentQuestStatus | None = None

Latest requested alliance quest status

subdivision_id pydantic-field

subdivision_id: int = 0

Your alliance's subdivision, from the entry's A

division_round_id pydantic-field

division_round_id: int = 0

Wire key DRI

The division round

accepts classmethod

accepts(entry: dict[str, Any]) -> bool

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

WheelOfFortuneEvent pydantic-model

Bases: NobilityContestEvent

The Wheel of Fortune (15) and the Wheel of Unimaginable Affluence (89): a point event score and the wheel's state.

The client keeps the wheel's win class and its progress as sent; the library reads them as numbers.

Client: LuckyWheelEventVO.parseData, parseParamObject and setRankAndPoints (bundle lines 59674, 59686, 59687), LuckyWheelData.parseBasics (bundle line 17562); SaleDaysLuckyWheelEventVO (bundle line 117842) reads the same

Fields:

has_visited_pro_mode pydantic-field

has_visited_pro_mode: bool = False

Wire key HVPM

Whether you opened the pro mode

has_free_spin pydantic-field

has_free_spin: bool = False

Wire key HFS

Whether a free spin is waiting

pro_mode pydantic-field

pro_mode: bool = False

Wire key PMA

Whether the pro mode is on

win_class pydantic-field

Wire key CWC

The wheel's current win class

win_class_progress pydantic-field

win_class_progress: float = 0.0

Wire key WCP

The progress towards the next win class

jackpot_set_id pydantic-field

Wire key JSID

The next jackpot set

jackpot_spin_set_id pydantic-field

Wire key JHID

The jackpot set of the next jackpot spin

with_points

with_points(ranks: Any, points: Any, maxima: Any) -> SpecialEvent

with_reply

with_reply(reply: WheelOfFortuneStatus | WheelOfFortuneChangeModeResponse) -> WheelOfFortuneEvent

The wheel after a spin, a jackpot, a win class raise or a mode change.

Client: LuckyWheelData.parseBasics, parseLWS and parseLWM (bundle lines 17570, 17566, 17564); a mode change flips the mode rather than reading it

TravelingKnightsEvent pydantic-model

Bases: SpecialEvent

a Traveling Knights event: the parts of the artifact you have found.

Client: ArtifactEventVO.parseBasicsFromParamObject and parseParamObject (bundle lines 59141, 59161)

Fields:

artifact_league_id pydantic-field

artifact_league_id: int = 0

Wire key ALID

Your artifact league

parts_found pydantic-field

parts_found: int = 0

Wire key PF

The artifact parts you have found

skin_id pydantic-field

skin_id: int = 0

Wire key SID

The event's skin

PackageShopEvent pydantic-model

Bases: SpecialEvent

An event whose shop sells packages for a fixed price: the packages its game data names, and those the server adds.

Client: BuyPackagesEventVO.parseEventXmlNode, parseParamObject, mergeNewEventPackages and sortEventPackages (split.js lines 33778-33808); its parseParamObject does not reach ASpecialEventVO's, which reads KL

Fields:

added_package_ids pydantic-field

added_package_ids: tuple[PackageId, ...] = ()

Wire key PIDS

The packages the server adds to its shop

packages

packages(*, game_data: GameData | None = None) -> tuple[PackageDef, ...]

The packages its shop sells, by their sort order: its game data's, then those the server added. A package the game data lacks is left out, as the client leaves it out.

Raises:

Type Description
GameDataNotLoadedError

game_data is None and the game data cannot be loaded

MercenaryShopEvent pydantic-model

Bases: PackageShopEvent

A mercenary camp, or the Berimond armorers: a shop that sells units. Only Berimond Armorer (76) reads the packages the server adds.

Client: UnitDealerEventVO.parseParamObject (split.js line 150401), whose FactionArmorerEventVO and FactionHunterEventVO (split.js lines 594672, 594761) read the same

Fields:

SeasonEvent pydantic-model

Bases: SpecialEvent

A season event: the Thorn King (2), the Blade Coast (4) or the Underworld (64).

Client: ASeasonEventVO.parseParamObject (bundle line 31376); ThornkingEventVO, SeaqueenEventVO and UnderworldEventVO.parseParamObject (bundle lines 118454, 117975, 118678) read UL.MID first, the Thorn King's through int() and the others' as sent; the library reads every one through int()

Fields:

unlocked pydantic-field

unlocked: bool = False

Whether the event is open to you

reward_id pydantic-field

reward_id: RewardId | None = None

Wire key RID

The reward the event's end gives

finished pydantic-field

finished: bool = False

Wire key F

Whether you have finished the event

map_id pydantic-field

map_id: EnumOrInt['TreasureMapId'] | None = None

The event's treasure map

BannerOfGloryEvent pydantic-model

Bases: SpecialEvent

The Banner of Glory. Client: FameboosterEventVO.parseParamObject (bundle line 116103)

Fields:

bonus_percent pydantic-field

bonus_percent: int = 0

Wire key GBP

The extra glory, in percent

AllianceBonusEvent pydantic-model

Bases: SpecialEvent

An alliance payment bonus: the prime alliance bonus (45) or the alliance payment bonus (55).

Client: PrimeAlliBonusEventVO and AlliPaymentBonusEventVO.parseParamObject (bundle lines 117469, 114367)

Fields:

bonus_percent pydantic-field

bonus_percent: int = 0

Wire key APP

The bonus, in percent

DiscountSaleEvent pydantic-model

Bases: SpecialEvent

A prime sale with one discount: the relic enchanter sale (88) or the season pass sale (599).

Client: RelicEnchanterPrimeSaleEventVO and SeasonPassPrimeSaleEventVO.parseParamObject (bundle lines 117746, 118084)

Fields:

discount pydantic-field

discount: int = 0

Wire key DIS

The discount, in percent

SkipForFreeEvent pydantic-model

Bases: SpecialEvent

Free skips. Client: SkipForFreeEventVO.parseParamObject (bundle line 118150)

Fields:

free_skip_seconds pydantic-field

free_skip_seconds: int = 0

Wire key SEC

A wait this long or shorter is skipped for free

GiftEvent pydantic-model

Bases: SpecialEvent

The Goodgame gift. Client: GGSGiftEventVO.parseParamObject (bundle line 116370)

Fields:

collected pydantic-field

collected: bool = False

Wire key AC

Whether you have collected the gift

skin_id pydantic-field

skin_id: int | None = None

Wire key SID

The gift's skin, None before one is sent

FortuneTellerEvent pydantic-model

Bases: SpecialEvent

The fortune teller. Client: FortuneTellerEventVO.parseParamObject (bundle line 116134)

Fields:

tries pydantic-field

tries: int = 0

Wire key FTDC

Today's readings

daily_reset_time pydantic-field

daily_reset_time: float | None = None

Wire key STR

When the readings reset, in time.monotonic() seconds; None without STR

WorldCupEvent pydantic-model

Bases: SpecialEvent

The world cup: a bet on one match, open once the rubies you spent in the event reach its price.

Client: WorldCupEventVO.parseParamObject and bonusRubies (bundle lines 24585, 24597), CastleWorldCupDialog.updateState (bundle line 104658)

Fields:

team_a pydantic-field

team_a: int = -1

Wire key TA

The first team

team_b pydantic-field

team_b: int = -1

Wire key TB

The second team

bet_price_rubies pydantic-field

bet_price_rubies: int = -1

Wire key PC2

The rubies to spend in the event before you may bet

bonus_percent pydantic-field

bonus_percent: int = -1

Wire key BC2

The share of the price a right bet pays back, in percent

vote pydantic-field

vote: EnumOrInt[WorldCupVote] = -1

Wire key V

The outcome you bet on; -1 before you bet

rubies_spent pydantic-field

rubies_spent: int = -1

Wire key CC2

The rubies you spent in the event

bonus_rubies property

bonus_rubies: float

The rubies a right bet pays.

TournamentRank pydantic-model

Bases: EmpireModel

One place of the tournament of fame's ranking: [rank, fame points, owner record].

Client: TournamentEventVO.parseParamObject (bundle line 118596), CastleOtherPlayerData.parseOwnerInfo (bundle line 138996), which reads nothing from a record without an OID

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

rank pydantic-field

rank: int

The place

fame_points pydantic-field

fame_points: int

The fame the player has earned, read through int()

owner pydantic-field

owner: MapObject | None = None

The player; None for a record without an OID

from_row classmethod

from_row(row: list[Any]) -> TournamentRank

A ranking row; a missing fame or owner reads as 0 or None.

TournamentEvent pydantic-model

Bases: SpecialEvent

The tournament of fame: the ranking, your place and the fame you have earned.

Client: TournamentEventVO.parseParamObject (bundle lines 118593-118598)

Fields:

own_rank pydantic-field

own_rank: int = 0

Wire key OR

Your rank

own_fame_points pydantic-field

own_fame_points: int = 0

Wire key OEP

The fame you have earned

booby_prize_min_fame pydantic-field

booby_prize_min_fame: int = 0

Wire key MFB

The fame the consolation prize needs

ranking pydantic-field

ranking: tuple[TournamentRank, ...] = ()

Wire key R

The ranking by place; an entry's rows replace the places they name, the others stay

CampaignEvent pydantic-model

Bases: SpecialEvent

A time-limited campaign: its quests, in the order they open, and its end reward.

A cqs push reads its campaign over it again (see with_campaign). The client turns RIDS into the rewards' collectables at once (rewardData.getListByIdArray); the game data is loaded only on request here, so the ids are kept, and rewards gives the same list.

Client: TimeLimitedCampaignEventEventVO.parseParamObject and sortByOrder (bundle lines 118536-118549), which sorts by ST and then CQID, a quest without ST last

Fields:

reward_ids pydantic-field

reward_ids: tuple[RewardId, ...] = ()

Wire key RIDS

The campaign's rewards; GameData.reward_list gives what they hold

reward_collected pydantic-field

reward_collected: bool = False

Wire key COL

Whether you collected the end reward

end_reward_value pydantic-field

end_reward_value: int = 0

Wire key ERV

The end reward's value

quests pydantic-field

quests: tuple[Quest, ...] = ()

Wire key CQS

The campaign's quests, in campaign order

rewards

rewards(*, game_data: GameData | None = None) -> tuple[Collectable, ...]

What the campaign's rewards give, in order, as the client lists them.

Client: getListByIdArray(e.RIDS) (TimeLimitedCampaignEventEventVO.parseParamObject, bundle line 118536)

with_campaign

with_campaign(status: CampaignQuestStatusResponse) -> CampaignEvent

The event after a cqs push. Client: parseCQS (bundle line 118593)

CampaignQuestEvent pydantic-model

Bases: SpecialEvent

The time-limited campaign's quest event; its end is the end of the campaign quests it names.

Client: TimeLimitedCampaignQuestEventEventVO.parseParamObject (bundle line 118576); CastleQuestVO.remainingSeconds (bundle line 52592)

Fields:

quest_ids pydantic-field

quest_ids: tuple[EnumOrInt['QuestId'], ...] = ()

Wire key CQS

The campaign quests it times, each QID read through int()

accepts classmethod

accepts(entry: dict[str, Any]) -> bool

EventAnnouncementEvent pydantic-model

Bases: SpecialEvent

The event announcement, the teaser for an event to come, with a reward to claim.

No entry says whether the reward was claimed: the client marks it on the running event when a car answer comes, and so does the library, until the event ends.

Client: EventAnnouncementData.parseCAR and isClaimed (bundle lines 53117-53119)

Fields:

reward_collected pydantic-field

reward_collected: bool = False

Whether you claimed the reward this session

SpecialEventInfoRequest pydantic-model

Bases: BaseRequest

Ask for the running events; the server answers with a sei.

Command: sei Payload: {}

Client: C2SSpecialEventInfoVO (bundle lines 37406-37407), which has no fields; sent after the Outer Realms castle is bought (bundle line 24305)

GetEventPointsRequest pydantic-model

Bases: BaseRequest

Ask for your rank and points in a running event; the server answers with a pep.

Command: pep Payload: {"EID": event_id}

Client: C2SPointEventGetPointsVO (bundle lines 8697-8698), sent as an event's dialog opens (e.g. CastlePointEventDialog, bundle line 117419; FactionEventRankingsSublayer.show, bundle line 95328) and after a marauders' contest payment (BKPCommand, bundle line 128199)

Fields:

event_id pydantic-field

event_id: EnumOrInt[Event]

Wire key EID

The event, e.g. Event.NOBILITY_CONTEST

accepts_reply

accepts_reply(payload: Any) -> bool

Whether a pep reply is about this event: its EID, when sent, is the one asked for.

Client: PEPCommand.exec (split.js line 646824) applies a reply to the event its EID names, as sent

GetEventPointsResponse pydantic-model

Bases: BaseResponse

Your rank and points in an event, pushed as you score and sent in answer to a GetEventPointsRequest.

OR, OP and PT are lists, one value per score the event keeps, in this order:

  • a score event (nobility contest, marauders, Grand Nobility Prize, gacha): your own (AScoreEventVO.setRankAndPoints, bundle line 15044)
  • the alliance tournament: your alliance's, the first only (AlliTournamentEventVO, bundle line 114412)
  • Berimond and the Wheel of Fortune: your own, the first only (FactionEventVO, bundle line 7461, into your league; LuckyWheelEventVO, bundle line 59687)
  • the alien, red alien, nomad and samurai invasions and the alliance Grand Tournament: yours, then your alliance's; PT may be sent, these events do not read it (bundle lines 58926, 114310, 55701, 5101)
  • the Berimond invasion: blue players, red players, then your alliance, PT per part (bundle line 116056)
  • the Rift Raid: yours, then your alliance's (bundle line 9117), and BLPP

Client: PEPCommand.exec (split.js line 646824), which looks the EID up as sent (CastleSpecialEventData.getActiveEventByEventId, split.js line 696557, a Map.get) and hands the lists to the event's setRankAndPoints (AScoreEventVO, split.js line 80731, reads the first of a truthy list); the state applies them the same way (client.state.get_event)

Fields:

Validators:

event_id pydantic-field

event_id: SentEventId

Wire key EID

The event

own_ranks pydantic-field

own_ranks: list[ClientInt | None]

Wire key OR

Your ranks, one per score in the order above; -1 unranked

own_points pydantic-field

own_points: list[ClientInt | None]

Wire key OP

Your points, one per score in the order above

max_points pydantic-field

max_points: list[ClientInt | None] | None = None

Wire key PT

The most points each score counts; None when not sent

boss_level_points pydantic-field

boss_level_points: ClientInt | None = None

Wire key BLPP

The points on the raid boss's current level; None for other events

ShuttingDownEvents pydantic-model

Bases: BaseResponse

The events that are shutting down: each one's building stays in your castles, with no time left.

Each push replaces the list before it. Every id is kept, though the client keys its own map by an id every fake event shares and so shows only the last event's building.

Command: sde Payload: {"SD": [event_id, ...]}

Client: SDECommand.executeCommand (bundle line 127931), CastleSpecialEventData.parse_SDE (bundle line 139841), FakeEventVO.eventId (bundle line 139979), IsoDataObjectGroupEvent.addSpecialEventBuildings (bundle line 80597)

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

event_ids pydantic-field

event_ids: tuple[EnumOrInt[Event], ...] = ()

Wire key SD

The events shutting down

EventEntry pydantic-model

Bases: EmpireModel

One entry of a sei or tei: the event it names, and the entry as sent for that event's class to read.

Client: CastleSpecialEventData.parse_SEI (bundle line 139849) reads int(a.EID), parseTEI (bundle line 139954) int(a.TRID), and parseServerEventData (bundle line 139860) hands the entry whole to the event's parseData

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

event_id pydantic-field

event_id: EnumOrInt[Event]

The event; 0 or less names none

entry pydantic-field

entry: dict[str, Any]

The entry as sent, read by the event's own class

SpecialEventsResponse pydantic-model

Bases: BaseResponse

The running events, each entry read over the event it names or adding it.

Command: sei, as a login section of gbd, a push, a reply, and inside the fjf reply.

Client: SEICommand.executeCommand (bundle line 128417), CastleSpecialEventData.parse_SEI (bundle line 139849): e ? e.E : null, each entry by int(a.EID)

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

error_code pydantic-field

error_code: int = 0

Always 0; the E of a sei is the entries

entries pydantic-field

entries: tuple[EventEntry, ...] = ()

Wire key E

The events' entries, in the order sent

TriggerEventsResponse pydantic-model

Bases: BaseResponse

The running trigger events (the Kingdom's League and the global effect events), keyed by TRID.

They share the special events' id space and tables. An empty list leaves every event as it is.

Command: tei, as a login section of gbd and a push.

Client: TEICommand.executeCommand (bundle line 128447), CastleSpecialEventData.parseTEI (bundle line 139954), which does nothing for an empty TE and reads each entry by int(a.TRID)

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

entries pydantic-field

entries: tuple[EventEntry, ...] = ()

Wire key TE

The trigger events' entries, in the order sent

EventEndedResponse pydantic-model

Bases: BaseResponse

An event has ended: the client destroys it, so one sent again starts over.

Command: see, a push.

Client: SEECommand.executeCommand (bundle line 128402), CastleSpecialEventData.parse_SEE (bundle line 139875), which looks EID up as sent, without int(), so only a number finds the event; removeEventById (bundle line 139887)

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

event_id pydantic-field

event_id: EnumOrInt[Event] | None = None

Wire key EID

The event that ended; None when the server sent no whole number, which names no event

TriggerEventEndedResponse pydantic-model

Bases: BaseResponse

A trigger event has ended.

Command: tee, a push.

Client: TEECommand.executeCommand (bundle line 128432), CastleSpecialEventData.parseTEE (bundle line 139964): int(e && e.TRID ? e.TRID : -1), removed when 0 or above

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

event_id pydantic-field

event_id: EnumOrInt[Event] | None = None

Wire key TRID

The trigger event that ended; None for a falsy or negative TRID, which names none

BerimondFactionJoinedResponse pydantic-model

Bases: BaseResponse

The reply to joining a Berimond faction: your kingdoms, the events and the castle lists, then which faction.

Command: fjf, the reply to a faction join.

Client: FJFCommand.executeCommand (bundle line 127820) hands kpi to CastleKingdomData.parse_KPI, sei to CastleSpecialEventData.parse_SEI and a truthy mir to CastleUserData.parse_MIR, in that order, then picks the choose-faction dialog by FID == FactionConst.BLUE_FACTION

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

kingdoms pydantic-field

kingdoms: KingdomInfoResponse | None = None

Wire key kpi

Your kingdoms' unlocks and transfers; None when no object

events pydantic-field

events: SpecialEventsResponse | None = None

Wire key sei

The running events; None when no object

castle_lists pydantic-field

castle_lists: NameCastleInvitationResponse | None = None

Wire key mir

Your castle lists after the join; None when falsy or no object

faction pydantic-field

faction: EnumOrInt[BerimondFaction] = BerimondFaction.URSIDAE

Wire key FID

The faction joined

SeasonEventResponse pydantic-model

Bases: BaseResponse

A season event packet; the client accepts it and reads nothing from it.

The client has no request for it, so it comes only from the server.

Command: sea

Client: SEACommand.executeCommand (bundle line 128389)

Fields:

GameEvent pydantic-model

Bases: EmpireModel

A running event with its in-game title.

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

event_id pydantic-field

event_id: EnumOrInt[Event]

The event; its id for one the enum lacks

display_name pydantic-field

display_name: str

The in-game title; without one, the event's Event name, or its id for an unknown event

details pydantic-field

The running event, as client.state.get_event() gives it, dumped with its own fields

ClaimAnnouncementRewardRequest pydantic-model

Bases: BaseRequest

Claim the reward of the running event announcement, the teaser for an event to come.

Command: car Payload: {}

Client: C2SEventAnnouncementClaimRewardVO (bundle line 91468), sent by CastleEventTeaserDialog.claimRewards (bundle line 91443)

ClaimAnnouncementRewardResponse pydantic-model

Bases: BaseResponse

The answer to an announcement reward claim; the client reads nothing from it.

Command: car

Client: CARCommand.executeCommand (bundle line 125277) calls EventAnnouncementData.parseCAR(null) (bundle line 53117), which marks the announcement's reward collected

Fields:

event_class

event_class(event_id: int) -> type[SpecialEvent]

The model an event's entries are read into.

events.titles

The in-game titles of the server's events, from the game's language file.

Usage
titles = get_event_titles("de")
titles.get(83)  # the Grand Nobility Prize's title

The titles are cosmetic: a CDN outage gives the titles last fetched, or none, and is retried after a pause (see empire_core.texts.get_texts).

Functions:

Name Description
get_event_titles

The in-game title of every event, by event id, in lang.

get_event_titles

get_event_titles(lang: str = 'en', force_refresh: bool = False) -> dict[int, str]

The in-game title of every event, by event id, in lang.

Fetched from the GGS language CDN and cached for 24 hours. A failed fetch gives the titles last fetched, or an empty dict, and is not retried for five minutes.

Parameters:

Name Type Description Default
lang str

Language code (default: "en")

'en'
force_refresh bool

Fetch from the CDN even when the cached titles are fresh

False

Client: the event dialogs show "event_title_"+eventId (ASeasonEventVO.seasonNameString, bundle line 31389)

Alliance Grand Tournament status

get_grand_tournament_status() requests participating member count and typed quest slots. The running GrandTournamentEvent.quest_status retains the last successful response, using a new event snapshot for each update. Slot ids preserve their original zero-based positions even when a malformed row is skipped with a warning. Quest definition ids remain integers because no generated alliance quest enum is available.

get_grand_tournament_contributions() requests ranked player contributions. Both methods require a running Grand Tournament and accept keyword-only timeout. Refusals and transport failures raise; missing or malformed status containers raise PacketError.

Grand Tournament quest actions and alliance event status protocols.

Classes:

Name Description
GrandTournamentQuestProgress

Progress of the quest occupying a slot; its quest definition is in game data.

GrandTournamentQuestSlot

Client: AllianceQuestSlotVO.fillFromParams (bundle lines 34949-34951).

GetGrandTournamentStatusRequest

Client: C2SAllianceQuestStatusVO (bundle lines 75687-75691).

GrandTournamentQuestStatus

Client: AQSCommand (bundle 127419-127420), parseQuestSlots (5104-5110).

GrandTournamentContribution

Client: AllianceMobilizationEventDialogContributionItem.update (bundle 76178).

GetGrandTournamentContributionsRequest

Client: C2SAllianceDivisionPlayerContributionVO (bundle 75678-75682).

GetGrandTournamentContributionsResponse

Client: AQPCCommand (bundle 127404-127405).

RaidBossWall

Client: AllianceRaidbossServerDataVO.parseActiveBlock (bundle 76195-76196).

RaidBossWalls

Client: AllianceRaidbossServerDataVO.parseActiveBlock (bundle 76195-76196).

RaidBossCard

Client: AllianceRaidBossCardVO.parse (bundle 76258); CommKeys dll.pretty 81112-81115.

RiftRaidStatus

Current boss and cards; wall timers are snapshots at receipt.

GetRiftRaidStatusRequest

Client: C2SGetAllianceRaidBossStatus (bundle 47183-47187).

GetRiftRaidStatusResponse

Client: BSECommand (bundle 127537-127538).

RiftRaidStatusBroadcast

Client: BBSCommand (bundle 127522-127523), parsed like bse.

GrandTournamentQuestUpdate

Slot update without participant count, as action replies supply it.

CompleteGrandTournamentQuestRequest

Client: C2SCompleteAllianceQuestVO (bundle 75705-75708).

StartGrandTournamentQuestRequest

Client: C2SStartAllianceQuestVO (bundle 75732-75735).

CancelGrandTournamentQuestRequest

Client: C2SCancelActiveAllianceQuestVO (bundle 75696-75699).

RerollGrandTournamentQuestRequest

Client: C2SRerollAllianceQuestVO (bundle 75714-75717).

SkipGrandTournamentCooldownRequest

Client: C2SSkipCooldownAllianceQuestVO (bundle 75723-75726).

CompleteGrandTournamentQuestResponse

Client: CAQCommand.executeCommand (bundle 127450-127454).

StartGrandTournamentQuestResponse

Client: SAQCommand.executeCommand (bundle 127480-127484).

CancelGrandTournamentQuestResponse

Client: CAAQCommand.executeCommand (bundle 127435-127439).

RerollGrandTournamentQuestResponse

Client: RAQCommand.executeCommand (bundle 127465-127469).

SkipGrandTournamentCooldownResponse

Client: SCQCommand.executeCommand (bundle 127495-127499).

SelectRaidBossRequest

Client: C2SSelectRaidBoss (current bundle 113731-113734); constants bundle 71.

SelectRaidBossResponse

Acknowledgement only.

AbortRaidRequest

Client: C2SAbortRaid (current bundle 113723-113725).

AbortRaidResponse

Acknowledgement only.

Attributes:

Name Type Description
logger
SentEventId

An event id the client looks up as sent: only a whole number names an event, 3.0 as 3 and "3" none.

logger module-attribute

logger = logging.getLogger(__name__)

SentEventId module-attribute

An event id the client looks up as sent: only a whole number names an event, 3.0 as 3 and "3" none.

Client: CastleSpecialEventData.getActiveEventByEventId (split.js line 696557), a Map.get

GrandTournamentQuestProgress pydantic-model

Bases: BasePayload

Progress of the quest occupying a slot; its quest definition is in game data.

Client: AllianceQuestSlotVO.fillFromParams (bundle 34950-34951) delegates the first QL entry to CastleQuestVO.fillFromParams (52463-52466). No quest id is invented from QL.

Fields:

Validators:

  • _status

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

counters pydantic-field

counters: tuple[ClientInt, ...] = ()

Wire key P

Quest condition counters

remaining_seconds pydantic-field

remaining_seconds: ClientInt = -1

Wire key RS

Quest seconds at receipt; -1 without a time limit

campaign_quest_id pydantic-field

campaign_quest_id: ClientInt = 0

Wire key CQID

Quest's place in a campaign

campaign_timestamp pydantic-field

campaign_timestamp: ClientInt | None = None

Wire key ST

Campaign quest opening timestamp

completed pydantic-field

completed: bool = False

Whether the quest is complete

failed pydantic-field

failed: bool = False

Whether the quest failed

locked pydantic-field

locked: bool = False

Whether the quest is locked

GrandTournamentQuestSlot pydantic-model

Bases: BasePayload

Client: AllianceQuestSlotVO.fillFromParams (bundle lines 34949-34951).

Keys: CommKeys (dll.pretty lines 80007,79871,80180,79617).

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

slot_id pydantic-field

slot_id: int

Zero-based slot position

alliance_quest_id pydantic-field

alliance_quest_id: ClientInt

Wire key QID

Alliance quest definition id

player_id pydantic-field

player_id: ClientInt

Wire key PID

Assigned player id; nonpositive when unassigned

player_name pydantic-field

player_name: str = ''

Wire key PN

Assigned player's name

remaining_seconds pydantic-field

remaining_seconds: ClientInt

Wire key RS

Quest or cooldown seconds at receipt

progress pydantic-field

progress: GrandTournamentQuestProgress | None = None

Wire key QL

Assigned quest progress

GetGrandTournamentStatusRequest pydantic-model

Bases: BaseRequest

Client: C2SAllianceQuestStatusVO (bundle lines 75687-75691).

Fields:

event_id pydantic-field

event_id: EnumOrInt[Event]

Wire key EID

Grand Tournament event

accepts_reply

accepts_reply(payload: Any) -> bool

AQSCommand looks up EID as a numeric Map key (bundle 127419-127420).

GrandTournamentQuestStatus pydantic-model

Bases: BaseResponse

Client: AQSCommand (bundle 127419-127420), parseQuestSlots (5104-5110).

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

event_id pydantic-field

event_id: SentEventId

Wire key EID

Grand Tournament event

participants pydantic-field

participants: ClientInt | None = None

Wire key APC

Participating alliance members

slots pydantic-field

Wire key AQS

Alliance quest slots

GrandTournamentContribution pydantic-model

Bases: BasePayload

Client: AllianceMobilizationEventDialogContributionItem.update (bundle 76178).

Fields:

rank pydantic-field

rank: ClientInt

Wire key R

Contribution rank

player_name pydantic-field

player_name: str

Wire key PN

Contributing player's name

points pydantic-field

points: ClientInt

Wire key OP

Contributed event points

GetGrandTournamentContributionsRequest pydantic-model

Bases: BaseRequest

Client: C2SAllianceDivisionPlayerContributionVO (bundle 75678-75682).

Fields:

event_id pydantic-field

event_id: EnumOrInt[Event]

Wire key EID

Grand Tournament event

GetGrandTournamentContributionsResponse pydantic-model

Bases: BaseResponse

Client: AQPCCommand (bundle 127404-127405).

Fields:

Validators:

contributions pydantic-field

contributions: tuple[GrandTournamentContribution, ...]

Wire key AQPC

Player contributions in server order

RaidBossWall pydantic-model

Bases: BasePayload

Client: AllianceRaidbossServerDataVO.parseActiveBlock (bundle 76195-76196).

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

regeneration_seconds pydantic-field

regeneration_seconds: float

Wire key RT

Seconds until wall regeneration at receipt

percent_left pydantic-field

percent_left: float

Wire key PL

Wall health percentage left

RaidBossWalls pydantic-model

Bases: BasePayload

Client: AllianceRaidbossServerDataVO.parseActiveBlock (bundle 76195-76196).

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

left pydantic-field

Wire key L

Left wall status

middle pydantic-field

middle: RaidBossWall

Wire key M

Middle wall status

right pydantic-field

right: RaidBossWall

Wire key R

Right wall status

RaidBossCard pydantic-model

Bases: BasePayload

Client: AllianceRaidBossCardVO.parse (bundle 76258); CommKeys dll.pretty 81112-81115.

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

boss_id pydantic-field

boss_id: EnumOrInt['RaidBoss']

Wire key BID

Boss represented by the card

status pydantic-field

status: EnumOrInt[RaidBossCardStatus]

Wire key CST

Boss card status

unlocked_level pydantic-field

unlocked_level: ClientInt

Wire key ULV

Unlocked boss level

RiftRaidStatus pydantic-model

Bases: BasePayload

Current boss and cards; wall timers are snapshots at receipt.

Client: AllianceRaidbossServerDataVO.parse_bse, parse_bbs, parseActiveBlock, parseBossCards, hasActiveBlock and clearActiveRaidState (bundle 76190-76205). Keys: CommKeys (dll.pretty 81112-81125). Health: MathBase.ceil (dll.pretty 23328-23330).

Fields:

Validators:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True, populate_by_name=True, extra='ignore')

boss_id pydantic-field

boss_id: EnumOrInt['RaidBoss'] = 0

Wire key BID

Current boss; 0 without one

level_id pydantic-field

level_id: ClientInt = 0

Wire key BLID

Current boss level id; 0 without one

health pydantic-field

health: float = 0

Wire key HP

Current boss health, rounded up to two decimals

revive_unit_percent pydantic-field

revive_unit_percent: float = 0

Wire key RUP

Percentage of units revived

stage_id pydantic-field

stage_id: ClientInt = 0

Wire key BS

Current boss stage id; 0 without one

walls pydantic-field

walls: RaidBossWalls | None = None

Wire key WI

Latest wall status

cards pydantic-field

cards: tuple[RaidBossCard, ...] = ()

Wire key BCDS

Available boss cards

active property

active: bool

Whether the response includes a current boss or boss level.

with_previous

with_previous(previous: RiftRaidStatus | None) -> RiftRaidStatus

Retain identity, stage and walls for fields the client updates only when supplied.

GetRiftRaidStatusRequest pydantic-model

Bases: BaseRequest

Client: C2SGetAllianceRaidBossStatus (bundle 47183-47187).

GetRiftRaidStatusResponse pydantic-model

Bases: BaseResponse

Client: BSECommand (bundle 127537-127538).

Fields:

Validators:

  • _status

status pydantic-field

Boss status supplied by the server

RiftRaidStatusBroadcast pydantic-model

Bases: GetRiftRaidStatusResponse

Client: BBSCommand (bundle 127522-127523), parsed like bse.

Fields:

Validators:

  • _status

GrandTournamentQuestUpdate pydantic-model

Bases: BasePayload

Slot update without participant count, as action replies supply it.

Client: CAAQCommand, CAQCommand, RAQCommand, SAQCommand, SCQCommand (bundle 127430-127503) read only nested aqs.EID and aqs.AQS.

Fields:

Validators:

event_id pydantic-field

event_id: SentEventId

Wire key EID

Grand Tournament event

slots pydantic-field

Wire key AQS

Updated quest slots

CompleteGrandTournamentQuestRequest pydantic-model

Bases: GetGrandTournamentStatusRequest

Client: C2SCompleteAllianceQuestVO (bundle 75705-75708).

Fields:

accepts_reply

accepts_reply(payload: Any) -> bool

StartGrandTournamentQuestRequest pydantic-model

Bases: CompleteGrandTournamentQuestRequest

Client: C2SStartAllianceQuestVO (bundle 75732-75735).

Fields:

slot_id pydantic-field

slot_id: int

Wire key S

Zero-based quest slot

alliance_quest_id pydantic-field

alliance_quest_id: int

Wire key QID

Quest definition occupying the slot

CancelGrandTournamentQuestRequest pydantic-model

Bases: CompleteGrandTournamentQuestRequest

Client: C2SCancelActiveAllianceQuestVO (bundle 75696-75699).

Fields:

RerollGrandTournamentQuestRequest pydantic-model

Bases: StartGrandTournamentQuestRequest

Client: C2SRerollAllianceQuestVO (bundle 75714-75717).

Fields:

SkipGrandTournamentCooldownRequest pydantic-model

Bases: StartGrandTournamentQuestRequest

Client: C2SSkipCooldownAllianceQuestVO (bundle 75723-75726).

Fields:

CompleteGrandTournamentQuestResponse pydantic-model

Bases: BaseResponse

Client: CAQCommand.executeCommand (bundle 127450-127454).

Fields:

status pydantic-field

Wire key aqs

Updated Grand Tournament quests

StartGrandTournamentQuestResponse pydantic-model

Bases: CompleteGrandTournamentQuestResponse

Client: SAQCommand.executeCommand (bundle 127480-127484).

Fields:

CancelGrandTournamentQuestResponse pydantic-model

Bases: CompleteGrandTournamentQuestResponse

Client: CAAQCommand.executeCommand (bundle 127435-127439).

Fields:

RerollGrandTournamentQuestResponse pydantic-model

Bases: CompleteGrandTournamentQuestResponse

Client: RAQCommand.executeCommand (bundle 127465-127469).

Fields:

SkipGrandTournamentCooldownResponse pydantic-model

Bases: CompleteGrandTournamentQuestResponse

Client: SCQCommand.executeCommand (bundle 127495-127499).

Fields:

SelectRaidBossRequest pydantic-model

Bases: BaseRequest

Client: C2SSelectRaidBoss (current bundle 113731-113734); constants bundle 71.

Fields:

Validators:

boss_id pydantic-field

boss_id: EnumOrInt['RaidBoss']

Wire key BID

Raid boss to select

SelectRaidBossResponse pydantic-model

Bases: BaseResponse

Acknowledgement only.

Client: SRBCommand reads no fields (current bundle 127571-127580).

Fields:

Validators:

  • _readable

AbortRaidRequest pydantic-model

Bases: BaseRequest

Client: C2SAbortRaid (current bundle 113723-113725).

AbortRaidResponse pydantic-model

Bases: SelectRaidBossResponse

Acknowledgement only.

Client: ARBCommand reads no fields (current bundle 127528-127537).

Fields:

Validators:

  • _readable

Alliance raid status

get_rift_raid_status() requests the current boss identity, level, health, revival percentage, stage, cards and walls. Boss ids use the generated RaidBoss enum; unknown bosses and card statuses remain integers. Health rounds up to two decimal places as in the client. Wall regeneration times are seconds at receipt.

The running RiftRaidEvent.boss_status also updates from embedded sei.BSE and bbs broadcasts. Updates preserve prior identity, stage and walls only where the client does; inactive replies clear the active boss fields. These models add no raid selection, start, abort, claim or other mutation API.

Grand Tournament quests

start_grand_tournament_quest(slot_id, alliance_quest_id) accepts a slot's current quest and consumes an event ticket. complete_grand_tournament_quest() collects your completed quest. reroll_grand_tournament_quest(slot_id, alliance_quest_id) rerolls an unassigned slot. The server checks tickets, assignment, completion and eligibility; a refusal raises CommandError.

cancel_grand_tournament_quest(spend_rubies=True) cancels your active quest and permits its configured ruby cost (the client defaults to 199). skip_grand_tournament_cooldown(slot_id, alliance_quest_id, spend_rubies=True) permits the client's 999-ruby cooldown skip. Neither premium action sends without explicit consent. These methods do not purchase tickets.

Each action returns a typed response whose status holds the reply's event id and quest slots. The cached event receives the slots in packet order while retaining any known participant count; that count is None when no status query has supplied it. Replies after a timeout or an event or alliance context change cannot update a replacement context. A changed context raises ReplyMismatchError, including leaving and rejoining the same alliance. All methods require a running Grand Tournament and accept keyword-only timeout.

BREAKING CHANGE: event 129 is now Event.GRAND_TOURNAMENT, with ranking list RankingType.GRAND_TOURNAMENT (84), GrandTournamentEvent, GrandTournamentQuestStatus, GrandTournamentQuestSlot, GrandTournamentQuestProgress, GrandTournamentContribution, get_grand_tournament_status() and get_grand_tournament_contributions(). The previous backend-derived public names are removed.

Raid boss controls

select_raid_boss(boss_id) selects a boss; abort_raid() aborts the current raid. Both require the running raid event and leader or deputy permission, which the server checks. Known boss cards must be available for selection, and the last playable boss cannot be aborted. These actions have no client ruby payment path and accept keyword-only timeout.

Both return typed acknowledgements without inventing a boss status. The existing bbs broadcast handler updates the event in receive order; use get_rift_raid_status() to request a fresh snapshot. Refusals raise CommandError; timeouts and malformed replies raise.

Battle for Berimond

get_berimond_targets() requests the event’s special camp candidate identifiers and returns a tuple of BerimondTarget records in server order. Each special_camp_id is a BerimondSpecialCamp, the watchtower or capital's row of GameData.berimond_special_camps; unknown identifiers stay ints and duplicates are preserved. GameData.berimond_lane_towers(lane) gives one BerimondLane's watchtowers in id order, and BerimondLane.GERBRANDT_CAPITAL.tower_lanes a capital's three lanes. Membership in this list does not establish attack eligibility: faction, spectator, protection and destroyed-target restrictions still apply. These identifiers are not map area ids or coordinates. Obtain map positions separately; client.attack.get_attack_info() supports Berimond village, tower and capital attack pre-calculations through its area_type argument, and the Berimond camp conquest (cfi) with area_type=MapItemType.BERIMOND_CAMP, conquer=True.

get_berimond_balance() returns a BerimondBalance with gerbrandt_players and ursidae_players. Negative counts clamp to zero as in the client. No faction percentage is inferred when both counts are zero because the client retains its prior percentage in that case.

Both reads require a running Battle for Berimond event, accept keyword-only timeout, and return fresh results without caching them. Choosing or joining a faction is not required. Refusals raise CommandError, transport failures retain their typed exception, and missing or malformed successful payloads raise PacketError.

get_berimond_points() returns BerimondPoints, the gerbrandt_points and ursidae_points of the two factions.

join_berimond(camp) joins the event with one of its prebuilt camps, a PrebuiltCastle such as PrebuiltCastle.BERIMOND_SIMPLE_CAMP. The camp whose only price is rubies is bought with them and needs spend_rubies=True; any other is bought with its resources, the game offering no ruby price for it, and spend_rubies pays the missing ones with rubies. A refusal, such as FACTION_LAST_MAN_STANDING_ACTIVE, raises CommandError.

berimond_kingdom_status sends nothing: it is the last BerimondKingdomStatus (fki), pushed on its own or inside a kpi, kept on the running BerimondEvent as kingdom_status. It says whether last man standing is on for either faction, whether you still take part, and which capital is open to attack.

Battle for Berimond: targets, faction balance and points, joining, the kingdom status and your Berimond standing.

Classes:

Name Description
BerimondTarget

An attackable special camp, a GameData.berimond_special_camps row; not a map area id or coordinate.

GetBerimondTargetsRequest

Client: C2SGetAttackableFactionDataVO (bundle 47388-47392), empty request.

GetBerimondTargetsResponse

Client: AFDCommand.executeCommand (127742-127743), parse_AFD (7369).

GetBerimondBalanceRequest

Client: C2SGetFactionBalance (bundle 77727-77731), empty request.

BerimondBalance

Faction populations, clamped at zero as in the client.

GetBerimondPointsRequest

Client: C2SGetFactionPointsVO (bundle 66177), empty request, sent by the world map (66094).

BerimondPoints

The House of Gerbrandt's and the House of Ursidae's points.

SelectBerimondCampRequest

Join Battle for Berimond with one of its prebuilt camps.

SelectBerimondCampResponse

Client: FSCCommand.executeCommand (bundle 127885) reads nothing from the reply.

BerimondKingdomStatus

Last man standing, your part in the event and which capital each faction can reach.

FactionStanding

Your faction and its protection in Berimond: an FN block.

BerimondTarget pydantic-model

Bases: BasePayload

An attackable special camp, a GameData.berimond_special_camps row; not a map area id or coordinate.

Client: FactionEventVO.parse_AFD (bundle 7369), FactionLaneRenderHelper.showLane (40075) compares each AC integer with a tower's specialCampID.

Fields:

special_camp_id pydantic-field

special_camp_id: EnumOrInt['BerimondSpecialCamp']

The attackable special camp

GetBerimondTargetsRequest pydantic-model

Bases: BaseRequest

Client: C2SGetAttackableFactionDataVO (bundle 47388-47392), empty request.

GetBerimondTargetsResponse pydantic-model

Bases: BaseResponse

Client: AFDCommand.executeCommand (127742-127743), parse_AFD (7369).

Fields:

Validators:

targets pydantic-field

targets: tuple[BerimondTarget, ...]

Wire key AC

Attackable special camps in server order

GetBerimondBalanceRequest pydantic-model

Bases: BaseRequest

Client: C2SGetFactionBalance (bundle 77727-77731), empty request.

BerimondBalance pydantic-model

Bases: BaseResponse

Faction populations, clamped at zero as in the client.

Client: FactionEventVO.parse_FGB (bundle 7368), FGBCommand.executeCommand (127789-127791). No faction share is inferred when both populations are zero: the client retains its previous share in that case.

Fields:

Validators:

gerbrandt_players pydantic-field

gerbrandt_players: int

Wire key RP

Players in the House of Gerbrandt

ursidae_players pydantic-field

ursidae_players: int

Wire key BP

Players in the House of Ursidae

GetBerimondPointsRequest pydantic-model

Bases: BaseRequest

Client: C2SGetFactionPointsVO (bundle 66177), empty request, sent by the world map (66094).

BerimondPoints pydantic-model

Bases: BaseResponse

The House of Gerbrandt's and the House of Ursidae's points.

Client: GFPCommand.executeCommand (bundle 127917), which reads them only when either is set, FactionEventVO.parseFactionPointsFromParamObject (7376).

Fields:

gerbrandt_points pydantic-field

gerbrandt_points: ClientInt = 0

Wire key RFP

Gerbrandt's points

ursidae_points pydantic-field

ursidae_points: ClientInt = 0

Wire key BFP

Ursidae's points

SelectBerimondCampRequest pydantic-model

Bases: BaseRequest

Join Battle for Berimond with one of its prebuilt camps.

Client: C2SSelectFactionCampVO (bundle 47692), sent by FactionEventJoinSublayer.buyCamp (95197) and, paying the missing resources, by CastleResourceWaitDialogProperties (35237).

Fields:

camp_id pydantic-field

camp_id: EnumOrInt['PrebuiltCastle']

Wire key ID

The prebuilt camp to start with

pay_with_rubies pydantic-field

pay_with_rubies: bool = False

Wire key PWR

Pay the missing resources with rubies

ruby_camp pydantic-field

ruby_camp: bool = False

Wire key OC2

The camp is the one priced in rubies only

kingdom_id pydantic-field

kingdom_id: Kingdom = Kingdom.BERIMOND

Wire key SID

Berimond's kingdom

SelectBerimondCampResponse pydantic-model

Bases: BaseResponse

Client: FSCCommand.executeCommand (bundle 127885) reads nothing from the reply.

Fields:

BerimondKingdomStatus pydantic-model

Bases: BaseResponse

Last man standing, your part in the event and which capital each faction can reach.

Pushed on its own and inside a kpi; the client keeps it on the running event.

Client: FKICommand.executeCommand (bundle 127859), CastleKingdomData.parse_KPI (134604), FactionEventVO.parse_FKI (7365), which takes each flag as 1 == value; isOtherCapitalReachable (7430) and AFactionAttackBox.updateButton (54672) for their meaning.

Fields:

Validators:

blue_last_man_standing pydantic-field

blue_last_man_standing: bool = False

Wire key BFLMS

Last man standing is on for the House of Ursidae

red_last_man_standing pydantic-field

red_last_man_standing: bool = False

Wire key RFLMS

Last man standing is on for the House of Gerbrandt

active_in_event pydantic-field

active_in_event: bool = False

Wire key PA

You may still attack and send troops; False once last man standing shuts you out

ursidae_capital_reachable pydantic-field

ursidae_capital_reachable: bool = False

Wire key BCR

Ursidae's capital is open to attack: its towers are down

gerbrandt_capital_reachable pydantic-field

gerbrandt_capital_reachable: bool = False

Wire key RCR

Gerbrandt's capital is open to attack: its towers are down

FactionStanding pydantic-model

Bases: BasePayload

Your faction and its protection in Berimond: an FN block.

Client: FactionEventVO.loadFactionDataFromParamObject (bundle line 7363)

Fields:

faction_id pydantic-field

faction_id: EnumOrInt[BerimondFaction] = BerimondFaction.URSIDAE

Wire key FID

Your faction

main_camp_id pydantic-field

main_camp_id: ClientInt = 0

Wire key MC

Your faction's main camp

protection_seconds pydantic-field

protection_seconds: ClientNumber = 0

Wire key PMT

Seconds left of the Berimond protection stage

protection_status pydantic-field

protection_status: ClientInt = 0

Wire key PMS

The Berimond protection stage, see berimond_protection_status

beginner_protection_seconds pydantic-field

beginner_protection_seconds: ClientNumber = 0

Wire key NS

Seconds of beginner protection left in Berimond; 0 when not sent, which leaves it as it was

berimond_protection_status property

berimond_protection_status: BerimondProtectionStatus | None

protection_status as a stage; None for a value the client does not define.

Season event maps

join_season_camp(event) enters a running season event's map (the Thorn King, the Blade Coast, the Underworld) at your camp there. unlock_season_camp(camp) starts on the map with one of its prebuilt camps (PrebuiltCastle.UNDERWORLD_SIMPLE_CAMP), the camp naming its map, with the same ruby consent as join_berimond; ruby_price=True (with spend_rubies=True) buys a camp priced in resources at its ruby price instead. The transfers to the map and their skips are on client.movements (skip_treasure_map_transfer_time(map_id, transfer_type, minute_skip) among them).

Season event maps (the Thorn King, the Blade Coast, the Underworld): entering the map, its camp and transfers.

Commands:

  • jea: Enter a season event's map at your camp there
  • csc: Start on a season event's map with one of its prebuilt camps
  • msm: Shorten a transfer to a season event's map with a minute skip

Classes:

Name Description
JoinSeasonCampRequest

Enter a season event's map at your camp there.

JoinSeasonCampResponse

The map entered.

SelectSeasonCampRequest

Start on a season event's map with one of its prebuilt camps.

SelectSeasonCampResponse

The camp taken.

MinuteSkipSeasonTransferRequest

Shorten the units or goods on their way to a season event's map with a minute skip.

MinuteSkipSeasonTransferResponse

The transfer shortened.

JoinSeasonCampRequest pydantic-model

Bases: BaseRequest

Enter a season event's map at your camp there.

Command: jea Payload: {"MID": map_id}

Client: C2SJoinCampVO (bundle line 21312), sent with the running season event's map by SeasonCampPanelButton.onButtonClicked (bundle line 108195) and StartCampSeasonMapScreenItem.onClickMapItem (bundle line 57878)

Fields:

map_id pydantic-field

map_id: EnumOrInt['TreasureMapId']

Wire key MID

The event's treasure map, SeasonEvent.map_id

JoinSeasonCampResponse pydantic-model

Bases: BaseResponse

The map entered.

Command: jea

Client: JEACommand.executeCommand (bundle line 131625) reads nothing from the reply

Fields:

SelectSeasonCampRequest pydantic-model

Bases: BaseRequest

Start on a season event's map with one of its prebuilt camps.

Command: csc Payload: {"ID": prebuilt_camp_id, "PWR": 0 or 1, "OC2": 0 or 1, "SID": space_id}

Keys follow the client's order. OC2 buys the camp at its ruby price; PWR pays the missing resources with rubies, which the client sends only from its resource wait dialog.

Client: C2SSelectSeasonCampVO (bundle line 47722), sent by AUnlockPrebuiltCastle.buyPrebuiltCastle (bundle line 55482) with the camp's first spaceIDs entry, and by CastleResourceWaitDialogProperties.getResourceSkipCommand (bundle line 35238)

Fields:

prebuilt_camp_id pydantic-field

prebuilt_camp_id: EnumOrInt['PrebuiltCastle']

Wire key ID

The prebuilt camp

pay_with_rubies pydantic-field

pay_with_rubies: bool = False

Wire key PWR

Pay the missing resources with rubies

ruby_camp pydantic-field

ruby_camp: bool = False

Wire key OC2

The camp is bought at its ruby price

space_id pydantic-field

space_id: EnumOrInt['TreasureMapId']

Wire key SID

The season event map the camp starts, its first space

SelectSeasonCampResponse pydantic-model

Bases: BaseResponse

The camp taken.

Command: csc

Client: CSCCommand.executeCommand (bundle line 128343) reads nothing from the reply

Fields:

MinuteSkipSeasonTransferRequest pydantic-model

Bases: BaseRequest

Shorten the units or goods on their way to a season event's map with a minute skip.

Command: msm Payload: {"MID": map_id, "TT": transfer_type, "MST": minute_skip}

Keys follow the client's order: the constructor sets MID and TT before MST.

Client: C2SMinuteSkipMapTransferVO (bundle line 55843), built by SeasonTravelGoodsMinuteSkipProperties.getMinuteSkipCommand and SeasonTravelUnitsMinuteSkipProperties.getMinuteSkipCommand (bundle lines 99612, 99644)

Fields:

map_id pydantic-field

map_id: EnumOrInt['TreasureMapId']

Wire key MID

The event's treasure map, SeasonEvent.map_id

transfer_type pydantic-field

transfer_type: KingdomTransferType

Wire key TT

Whether the transfer carries units or goods

minute_skip pydantic-field

minute_skip: EnumOrStr['Currency']

Wire key MST

The minute skip used, Currency.SKIP_1_MINUTE to SKIP_24_HOURS

MinuteSkipSeasonTransferResponse pydantic-model

Bases: BaseResponse

The transfer shortened.

Command: msm Payload: {"tmp": {...}}

The reply model reads nothing; its tmp, the treasure maps, reaches client.map.treasure_maps.

Client: MSMCommand.executeCommand (bundle line 125852), which hands tmp to CastleTreasureMapData.parse_TMP

Fields: